/* ═══════════════════════════════════════════════════════════
   CÔTÉ FAMILLES — singles.css
   Styles propres aux templates single-fiche.php et single-structure.php.
═══════════════════════════════════════════════════════════ */

/* ═══════════════════════════════════════════════════════════
   EYEBROW « type d'objet » (organisation / service)
   Pastille texte au-dessus du H1 du hero et dans les cards,
   pour signaler immédiatement la nature de l'objet affiché.
═══════════════════════════════════════════════════════════ */
.cf-eyebrow {
    display       : inline-flex;
    align-items   : center;
    gap           : 7px;
    font-size     : .68rem;
    font-weight   : 800;
    text-transform: uppercase;
    letter-spacing: .14em;
    padding       : 5px 12px;
    border-radius : var(--radius-pill);
    line-height   : 1;
    border        : 1px solid transparent;
}
.cf-eyebrow svg { flex-shrink: 0; }

/* Variante organisation : vert (couleur de signature des structures) */
.cf-eyebrow--orga {
    background   : var(--c-green-light);
    color        : var(--c-green-dark);
    border-color : var(--c-green-mid);
}

/* Variante service : couleur catégorie (héritée via --cf-cat-color) */
.cf-eyebrow--service {
    background   : var(--c-white);
    color        : var(--cf-cat-color, var(--c-orange));
    border-color : currentColor;
}

/* ═══════════════════════════════════════════════════════════
   SINGLE FICHE
═══════════════════════════════════════════════════════════ */
.fiche-wrap *,
.fiche-wrap *::before,
.fiche-wrap *::after { box-sizing: border-box; }

.fiche-wrap {
    max-width   : 900px;
    margin      : 40px auto;
    padding     : 0 20px 60px;
    font-family : -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color       : var(--c-text);
    line-height : 1.6;
}

/* ── Hero fiche : « affichette de service » (bandeau coloré, eyebrow SERVICE) ── */
.fiche-hero {
    --cf-cat-color : var(--c-orange);
    --cf-cat-bg    : rgba(252,72,33,.08);

    position      : relative;
    background    : linear-gradient(135deg, var(--cf-cat-bg) 0%, var(--c-white) 70%);
    border        : 1.5px solid var(--c-border);
    border-top    : 4px solid var(--cf-cat-color);
    border-radius : var(--radius-lg);
    padding       : 24px;
    margin-bottom : 24px;
    box-shadow    : var(--shadow-sm);
    overflow      : hidden;
}
.fiche-hero::after {
    /* Halo léger en couleur catégorie sur le coin haut droit */
    content       : '';
    position      : absolute;
    top           : -40px;
    right         : -40px;
    width         : 180px;
    height        : 180px;
    background    : radial-gradient(circle, var(--cf-cat-color) 0%, transparent 70%);
    opacity       : .12;
    pointer-events: none;
}
.fiche-hero__info { position: relative; z-index: 1; }
.fiche-hero__name {
    font-size  : 1.45rem;
    font-weight: 800;
    margin     : 8px 0 12px;
    color      : var(--c-text);
    line-height: 1.2;
}

.fiche-hero__meta {
    display    : flex;
    flex-wrap  : wrap;
    gap        : 6px 18px;
    font-size  : .88rem;
    color      : var(--c-text-light);
    font-weight: 500;
    margin     : 0 0 16px;
}
.fiche-hero__meta-item {
    display    : inline-flex;
    align-items: center;
    gap        : 6px;
}
.fiche-hero__meta-item a {
    color       : inherit;
    font-weight : 700;
    text-decoration: underline;
    text-decoration-color: var(--c-border);
    text-underline-offset: 2px;
    transition  : color var(--transition), text-decoration-color var(--transition);
}
.fiche-hero__meta-item a:hover {
    color       : var(--c-green-dark);
    text-decoration-color: var(--c-green-mid);
}
.fiche-hero__meta-item svg { flex-shrink: 0; }

.fiche-hero__actions {
    display  : flex;
    gap      : 10px;
    flex-wrap: wrap;
}
.fiche-hero__btn {
    display        : inline-flex;
    align-items    : center;
    gap            : 6px;
    padding        : 8px 16px;
    border-radius  : var(--radius-sm);
    font-size      : .84rem;
    font-weight    : 700;
    text-decoration: none;
    transition     : all var(--transition);
    white-space    : nowrap;
}
/* Bouton « Voir l'organisation » : couleur verte (destination = structure) */
.fiche-hero__btn--orga {
    background  : var(--c-green-light);
    border      : 1.5px solid var(--c-green-mid);
    color       : var(--c-green-dark);
}
.fiche-hero__btn--orga:hover {
    background  : var(--c-green);
    border-color: var(--c-green);
    color       : #fff;
}
/* Bouton « Modifier » : neutre */
.fiche-hero__btn--edit {
    background  : var(--c-white);
    border      : 1.5px solid var(--c-border);
    color       : var(--c-text-light);
}
.fiche-hero__btn--edit:hover {
    border-color: var(--cf-cat-color);
    color       : var(--cf-cat-color);
    background  : var(--c-white);
}
/* Bouton « ← Mon compte » : neutre faible */
.fiche-hero__btn--back {
    background  : var(--c-bg);
    border      : 1.5px solid var(--c-border);
    color       : var(--c-text-light);
}
.fiche-hero__btn--back:hover {
    background  : var(--c-border-light);
    color       : var(--c-text);
}

/* ── Sections fiche ── */
.fiche-section {
    background    : var(--c-white);
    border        : 1.5px solid var(--c-border);
    border-radius : var(--radius-md);
    padding       : 24px 28px;
    margin-bottom : 16px;
    box-shadow    : var(--shadow-sm);
}
.fiche-section__title {
    font-size      : .76rem;
    font-weight    : 700;
    text-transform : uppercase;
    letter-spacing : .09em;
    margin         : 0 0 18px;
    padding-bottom : 12px;
    border-bottom  : 2px solid var(--c-border-light);
    display        : flex;
    align-items    : center;
    gap            : 8px;
}

.fiche-description { font-size: .97rem; color: #334155; line-height: 1.78; }
.fiche-description p { margin: 0 0 12px; }

.fiche-cats { display: flex; flex-wrap: wrap; gap: 10px; }

/* Variante « groupes » : chaque parent + ses enfants groupés visuellement,
   séparés par un fin trait quand il y a plusieurs paires. */
.fiche-cats--groups {
    flex-direction: column;
    gap           : 10px;
}
.fiche-cat-group {
    display      : flex;
    flex-wrap    : wrap;
    gap          : 8px;
    align-items  : center;
    padding      : 8px 10px;
    background   : var(--pill-bg);
    border-radius: var(--radius-sm);
    border-left  : 3px solid var(--pill-color);
}
.fiche-cat-group + .fiche-cat-group { margin-top: 0; }
.fiche-cat-pill {
    display       : inline-flex;
    align-items   : center;
    gap           : 6px;
    padding       : 6px 14px;
    border-radius : var(--radius-pill);
    font-size     : .84rem;
    font-weight   : 600;
    border        : 1.5px solid;
    text-decoration: none;
}
a.fiche-cat-pill { text-decoration: none; }
a.fiche-cat-pill--parent:hover { background: var(--pill-color); color: #fff; }
a.fiche-cat-pill--child:hover { background: var(--c-green-light); color: var(--c-green-dark); border-color: var(--c-green-mid); }
.fiche-cat-pill--parent { color: var(--pill-color); border-color: var(--pill-color); background: var(--pill-bg); }
.fiche-cat-pill--child  { color: var(--c-text-light); border-color: var(--c-border); background: var(--c-bg); }

/* ── Carte fiche ── */
#fiche-map {
    width         : 100%;
    height        : 300px;
    border-radius : var(--radius-sm);
    border        : 1.5px solid var(--c-border);
    z-index       : 0;
    position      : relative;
    margin-top    : 16px;
}
.fiche-map-label { margin-top: 6px; font-size: .74rem; color: var(--c-text-muted); text-align: right; }
.fiche-map-label a { color: var(--c-text-muted); }

/* ── Structure liée ── */
.fiche-structure-card {
    display        : flex;
    align-items    : center;
    gap            : 16px;
    background     : var(--c-bg);
    border         : 1.5px solid var(--c-border);
    border-radius  : var(--radius-sm);
    padding        : 16px 20px;
    text-decoration: none;
    color          : inherit;
    transition     : border-color var(--transition), box-shadow var(--transition);
}
.fiche-structure-card:hover {
    border-color   : var(--c-green);
    box-shadow     : var(--shadow-green);
    color          : inherit;
    text-decoration: none;
}
.fiche-structure-card__logo {
    width          : 56px;
    height         : 56px;
    border-radius  : var(--radius-sm);
    background     : var(--c-white);
    border         : 1.5px solid var(--c-border);
    display        : flex;
    align-items    : center;
    justify-content: center;
    flex-shrink    : 0;
    overflow       : hidden;
    font-size      : 1.6rem;
}
.fiche-structure-card__logo img { width: 100%; height: 100%; object-fit: contain; }
.fiche-structure-card__info     { flex: 1; min-width: 0; }
.fiche-structure-card__name     { font-weight: 700; font-size: 1rem; color: var(--c-text); margin-bottom: 3px; }
.fiche-structure-card__cta      { font-size: .8rem; color: var(--c-green); font-weight: 600; display: flex; align-items: center; gap: 4px; }

/* ── Admin badge & infos ── */
.fiche-admin-badge {
    display       : inline-block;
    background    : #fff3cd;
    color         : #856404;
    border        : 1px solid #ffc107;
    border-radius : var(--radius-sm);
    font-size     : .68rem;
    font-weight   : 700;
    padding       : 2px 8px;
    margin-left   : 8px;
    vertical-align: middle;
}
.fiche-admin-info { display: flex; flex-direction: column; gap: 8px; }
.fiche-admin-row  { display: flex; align-items: center; gap: 10px; font-size: .88rem; color: var(--c-text-light); }
.fiche-admin-row__label {
    font-weight   : 700;
    font-size     : .7rem;
    text-transform: uppercase;
    letter-spacing: .05em;
    color         : var(--c-text-muted);
    min-width     : 80px;
}

/* ═══════════════════════════════════════════════════════════
   SINGLE STRUCTURE
═══════════════════════════════════════════════════════════ */
.str-wrap *,
.str-wrap *::before,
.str-wrap *::after { box-sizing: border-box; }

.str-wrap {
    max-width   : 900px;
    margin      : 40px auto;
    padding     : 0 20px 60px;
    font-family : -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    color       : var(--c-text);
    line-height : 1.6;
}

/* ── Hero structure : « carte d'identité » (logo + bloc identité, vert) ── */
.str-hero {
    background    : var(--c-bg);
    border        : 1.5px solid var(--c-border);
    border-top    : 4px solid var(--c-green);
    border-radius : var(--radius-lg);
    padding       : 24px;
    margin-bottom : 24px;
    box-shadow    : var(--shadow-sm);
}
.str-hero__inner {
    display       : flex;
    flex-direction: column;
    gap           : 16px;
    align-items   : flex-start;
}
.str-hero__logo {
    flex-shrink    : 0;
    width          : 88px;
    height         : 88px;
    border-radius  : var(--radius-md);
    overflow       : hidden;
    background     : var(--c-white);
    border         : 1.5px solid var(--c-border);
    display        : flex;
    align-items    : center;
    justify-content: center;
    box-shadow     : var(--shadow-sm);
}
.str-hero__logo img          { width: 100%; height: 100%; object-fit: contain; }
.str-hero__logo--placeholder { color: var(--c-green); }
.str-hero__info              { flex: 1; min-width: 0; width: 100%; }
.str-hero__name {
    font-size  : 1.45rem;
    font-weight: 800;
    margin     : 8px 0 8px;
    color      : var(--c-text);
    line-height: 1.2;
}
.str-hero__type {
    display        : inline-flex;
    align-items    : center;
    gap            : 5px;
    background     : var(--c-green-light);
    color          : var(--c-green-dark);
    font-size      : .72rem;
    font-weight    : 700;
    padding        : 4px 12px;
    border-radius  : var(--radius-pill);
    letter-spacing : .03em;
    border         : 1px solid var(--c-green-mid);
}
.str-hero__meta {
    display    : flex;
    flex-wrap  : wrap;
    gap        : 6px 16px;
    font-size  : .88rem;
    color      : var(--c-text-light);
    margin     : 10px 0 0;
}
.str-hero__meta-item {
    display    : inline-flex;
    align-items: center;
    gap        : 6px;
}
.str-hero__meta-item svg { flex-shrink: 0; color: var(--c-text-muted); }
.str-hero__meta-item a {
    color       : var(--c-green-dark);
    font-weight : 600;
    text-decoration: none;
}
.str-hero__meta-item a:hover { text-decoration: underline; }
.str-hero__desc-courte {
    margin     : 12px 0 0;
    color      : var(--c-text-light);
    font-size  : .95rem;
    line-height: 1.55;
}
.str-hero__desc-courte p           { margin: 0 0 8px; }
.str-hero__desc-courte p:last-child { margin-bottom: 0; }

/* Layout 2 colonnes à partir de 640px */
@media (min-width: 640px) {
    .str-hero { padding: 28px 32px; }
    .str-hero__inner {
        flex-direction: row;
        gap           : 24px;
        align-items   : center;
    }
    .str-hero__logo { width: 120px; height: 120px; }
    .str-hero__name { font-size: 1.85rem; margin-top: 4px; }
}

.str-section {
    background    : var(--c-white);
    border        : 1.5px solid var(--c-border);
    border-radius : var(--radius-md);
    padding       : 24px 28px;
    margin-bottom : 16px;
    box-shadow    : var(--shadow-sm);
}
.str-section__title {
    font-size      : .76rem;
    font-weight    : 700;
    text-transform : uppercase;
    letter-spacing : .09em;
    color          : var(--c-green);
    margin         : 0 0 18px;
    padding-bottom : 10px;
    border-bottom  : 2px solid var(--c-green-light);
    display        : flex;
    align-items    : center;
    gap            : 8px;
}

.str-grid {
    display               : grid;
    grid-template-columns : repeat(auto-fill, minmax(230px, 1fr));
    gap                   : 14px 24px;
}
.str-field__label {
    font-size      : .7rem;
    font-weight    : 700;
    text-transform : uppercase;
    letter-spacing : .05em;
    color          : var(--c-text-muted);
    margin-bottom  : 2px;
}
.str-field__value       { font-size: .95rem; color: var(--c-text); word-break: break-word; }
.str-field__value a     { color: var(--c-green); text-decoration: none; transition: color var(--transition); }
.str-field__value a:hover { text-decoration: underline; }

#str-map {
    width         : 100%;
    height        : 320px;
    border-radius : var(--radius-sm);
    margin-top    : 20px;
    border        : 1.5px solid var(--c-border);
    z-index       : 0;
    position      : relative;
}
.str-map-label { margin-top: 6px; font-size: .74rem; color: var(--c-text-muted); text-align: right; }
.str-map-label a { color: var(--c-text-muted); }

.str-tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; }
.str-tags li {
    background    : var(--c-green-light);
    color         : var(--c-green-dark);
    border        : 1.5px solid var(--c-green-mid);
    border-radius : var(--radius-pill);
    padding       : 4px 12px;
    font-size     : .84rem;
    font-weight   : 500;
}

.str-desc-longue     { font-size: .97rem; color: #334155; line-height: 1.78; }
.str-desc-longue p   { margin: 0 0 12px; }

.str-social { display: flex; flex-wrap: wrap; gap: 10px; }
.str-social__link {
    display        : inline-flex;
    align-items    : center;
    gap            : 7px;
    padding        : 8px 18px;
    border-radius  : var(--radius-sm);
    font-size      : .88rem;
    font-weight    : 600;
    text-decoration: none;
    color          : #fff;
    transition     : opacity var(--transition);
}
.str-social__link:hover          { opacity: .82; color: #fff; text-decoration: none; }
.str-social__link--site          { background: var(--c-text); }
.str-social__link--facebook      { background: #1877f2; }
.str-social__link--instagram     { background: linear-gradient(135deg, #f58529, #dd2a7b, #8134af); }
.str-social__link--autre         { background: var(--c-green); }

.str-document__link {
    display        : inline-flex;
    align-items    : center;
    gap            : 8px;
    background     : var(--c-bg);
    border         : 1.5px solid var(--c-border);
    border-radius  : var(--radius-sm);
    padding        : 10px 18px;
    font-size      : .92rem;
    font-weight    : 600;
    color          : var(--c-green);
    text-decoration: none;
    transition     : background var(--transition), border-color var(--transition);
}
.str-document__link:hover { background: var(--c-green-light); border-color: var(--c-green-mid); }

.str-responsable {
    display       : flex;
    align-items   : flex-start;
    gap           : 16px;
    background    : var(--c-bg);
    border-radius : var(--radius-sm);
    padding       : 16px 20px;
    border        : 1.5px solid var(--c-border);
}
.str-responsable__avatar {
    width          : 50px;
    height         : 50px;
    border-radius  : 50%;
    background     : var(--c-green-light);
    display        : flex;
    align-items    : center;
    justify-content: center;
    font-size      : 1.4rem;
    flex-shrink    : 0;
    border         : 1.5px solid var(--c-green-mid);
}
.str-responsable__name            { font-weight: 700; font-size: 1rem; margin-bottom: 5px; color: var(--c-text); }
.str-responsable__contact         { font-size: .88rem; color: var(--c-text-light); }
.str-responsable__contact a       { color: var(--c-green); text-decoration: none; }
.str-responsable__contact a:hover { text-decoration: underline; }
.str-responsable__contact div     { margin-bottom: 3px; }

.str-admin-badge {
    display       : inline-block;
    background    : #fff3cd;
    color         : #856404;
    border        : 1px solid #ffc107;
    border-radius : var(--radius-sm);
    font-size     : .68rem;
    font-weight   : 700;
    padding       : 2px 8px;
    margin-left   : 8px;
    vertical-align: middle;
}

.str-fiches-grid {
    display               : grid;
    grid-template-columns : repeat(auto-fill, minmax(220px, 1fr));
    gap                   : 14px;
    margin-top            : 4px;
}
/* ── Cards « services proposés » (mini-affichette, couleur catégorie) ── */
.str-fiche-card {
    --cf-cat-color : var(--c-text-muted);

    position       : relative;
    background     : var(--c-white);
    border         : 1.5px solid var(--c-border);
    border-top     : 3px solid var(--cf-cat-color);
    border-radius  : var(--radius-sm);
    padding        : 14px 16px 16px;
    text-decoration: none;
    color          : inherit;
    transition     : box-shadow var(--transition), border-color var(--transition), transform var(--transition);
    display        : flex;
    flex-direction : column;
    gap            : 8px;
}
.str-fiche-card:hover {
    box-shadow      : var(--shadow-md);
    transform       : translateY(-2px);
    text-decoration : none;
    color           : inherit;
}
.str-fiche-card__eyebrow {
    display       : inline-flex;
    align-items   : center;
    gap           : 5px;
    font-size     : .58rem;
    font-weight   : 800;
    color         : var(--cf-cat-color);
    text-transform: uppercase;
    letter-spacing: .12em;
    line-height   : 1;
}
.str-fiche-card__title {
    font-weight: 700;
    font-size  : .98rem;
    color      : var(--c-text);
    line-height: 1.3;
}
.str-fiche-card__meta {
    font-size  : .8rem;
    color      : var(--c-text-muted);
    display    : flex;
    align-items: center;
    gap        : 5px;
}
.str-fiche-card__meta svg { flex-shrink: 0; color: var(--cf-cat-color); }
.str-fiche-card__cta {
    margin-top : auto;
    padding-top: 4px;
    font-size  : .76rem;
    font-weight: 700;
    color      : var(--c-orange);
    display    : inline-flex;
    align-items: center;
    gap        : 4px;
}

.str-btn-creer-fiche {
    display        : inline-flex;
    align-items    : center;
    gap            : 8px;
    background     : var(--c-green);
    color          : #fff;
    font-weight    : 700;
    font-size      : .92rem;
    padding        : 10px 22px;
    border-radius  : var(--radius-sm);
    text-decoration: none;
    transition     : background var(--transition), box-shadow var(--transition);
    margin-bottom  : 20px;
}
.str-btn-creer-fiche:hover {
    background     : var(--c-green-dark);
    color          : #fff;
    text-decoration: none;
    box-shadow     : var(--shadow-green);
}


/* ── RESPONSIVE SINGLES (mobile-first : tout est déjà mobile par défaut,
   ce bloc gère uniquement les petits ajustements pour < 600px) ── */
@media (max-width: 600px) {
    .fiche-hero    { padding: 20px 18px; }
    .fiche-section { padding: 18px 16px; }
    #fiche-map     { height: 240px; }
    .str-section   { padding: 18px 16px; }
    #str-map       { height: 240px; }
}

/* À partir de 720px, hero fiche un peu plus aéré */
@media (min-width: 720px) {
    .fiche-hero        { padding: 32px 36px; }
    .fiche-hero__name  { font-size: 1.85rem; }
}

/* Structure sans activité en ligne — état normal juste après validation.
   La section « Activités proposées » s'affiche quand même pour le
   propriétaire, avec son appel à l'action. */
.str-fiches-vide {
    margin      : 0 0 var(--sp-4);
    padding     : var(--sp-4);
    border      : 1px dashed var(--c-border);
    border-radius: var(--radius-sm);
    background  : var(--c-bg);
    color       : var(--c-text-muted);
    font-size   : .92rem;
    line-height : 1.6;
    max-width   : 62ch;
}
