/* ============================================
   Fiche Allergènes — Frontend (rendu gastronomique)
   v1.2.0
   ============================================ */

.fa-fiche {
    /* Typographie serif élégante, fallback système */
    font-family: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", Times, serif;
    color: #2a2620;
    max-width: 820px;
    margin: 0 auto;
    padding: 56px 48px;
    background: #fdfbf6;
    box-sizing: border-box;
    line-height: 1.5;
}

.fa-fiche * { box-sizing: border-box; }

/* ============================================
   En-tête
   ============================================ */
.fa-fiche-head {
    text-align: center;
    padding-bottom: 32px;
    margin-bottom: 40px;
    position: relative;
}
.fa-fiche-head::after {
    content: "";
    display: block;
    width: 60px;
    height: 1px;
    background: #b8a37a;
    margin: 24px auto 0;
}

.fa-fiche-title {
    font-family: inherit;
    font-size: 38px;
    font-weight: 400;
    margin: 0 0 12px;
    color: #1f1c17;
    letter-spacing: 0.5px;
    line-height: 1.2;
    font-style: italic;
}

.fa-fiche-meta {
    font-size: 12px;
    color: #8c8377;
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-style: normal;
    letter-spacing: 1.2px;
    text-transform: uppercase;
}

/* ============================================
   État vide
   ============================================ */
.fa-fiche-empty {
    text-align: center;
    padding: 60px 20px;
    color: #8c8377;
    font-style: italic;
    font-size: 18px;
}

/* ============================================
   Liste des plats
   ============================================ */
.fa-fiche-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.fa-fiche-row {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 28px 0;
    border-bottom: 1px solid #ebe4d6;
}
.fa-fiche-row:last-child { border-bottom: none; }
.fa-fiche-row:first-child { padding-top: 0; }

.fa-fiche-name {
    font-family: inherit;
    font-size: 22px;
    font-weight: 500;
    color: #1f1c17;
    line-height: 1.35;
    letter-spacing: 0.2px;
}

.fa-fiche-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

/* ============================================
   Pastilles allergènes — version raffinée
   Contrastes validés WCAG AA (ratio min 4.5:1)
   ============================================ */
.fa-pill {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 11px;
    padding: 4px 10px 4px 8px;
    border-radius: 20px;
    line-height: 1.4;
    white-space: nowrap;
    font-weight: 600;
    border: 1.5px solid;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}
.fa-pill-allerg {
    /* Couleurs appliquées inline via PHP - WCAG AA validé */
}
.fa-pill-icon {
    display: inline-flex;
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}
.fa-pill-icon svg {
    width: 100%;
    height: 100%;
    display: block;
}
.fa-pill-text {
    display: inline-block;
}
.fa-pill-none {
    background: #f0ede4;
    color: #2a3d12;
    border-color: #6b8c3a;
    font-style: italic;
    text-transform: none;
    font-weight: 500;
}
.fa-pill-legend {
    background: #f5f1e8;
    color: #3d3528;
    border-color: #b8a37a;
    font-weight: 500;
}

/* ============================================
   Synthèse globale
   ============================================ */
.fa-fiche-summary {
    margin-top: 48px;
    padding: 28px 32px;
    background: #f5f1e8;
    border-radius: 2px;
    text-align: center;
    position: relative;
}
.fa-fiche-summary::before,
.fa-fiche-summary::after {
    content: "❦";
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #b8a37a;
    font-size: 14px;
}
.fa-fiche-summary::before { left: 16px; }
.fa-fiche-summary::after { right: 16px; }

.fa-fiche-summary h3 {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12px;
    font-weight: 500;
    margin: 0 0 16px;
    color: #6b6354;
    text-transform: uppercase;
    letter-spacing: 2px;
}

.fa-fiche-summary-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
}

/* ============================================
   Légende dépliable
   ============================================ */
.fa-fiche-legend {
    margin-top: 32px;
    padding: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 12px;
}
.fa-fiche-legend summary {
    cursor: pointer;
    color: #8c8377;
    font-weight: 500;
    user-select: none;
    outline: none;
    text-align: center;
    padding: 12px;
    list-style: none;
    letter-spacing: 1px;
    text-transform: uppercase;
    transition: color 0.2s;
}
.fa-fiche-legend summary::-webkit-details-marker { display: none; }
.fa-fiche-legend summary::before {
    content: "+ ";
    color: #b8a37a;
    font-weight: bold;
}
.fa-fiche-legend[open] summary::before { content: "− "; }
.fa-fiche-legend summary:hover { color: #2a2620; }
.fa-fiche-legend[open] summary { margin-bottom: 16px; }
.fa-fiche-legend-pills {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding-top: 20px;
    border-top: 1px solid #ebe4d6;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 768px) {
    .fa-fiche {
        padding: 32px 24px;
    }
    .fa-fiche-title { font-size: 30px; }
    .fa-fiche-name { font-size: 20px; }
    .fa-fiche-row { padding: 22px 0; }
    .fa-fiche-summary {
        padding: 24px 20px;
    }
    .fa-fiche-summary::before,
    .fa-fiche-summary::after {
        display: none;
    }
}

@media (max-width: 480px) {
    .fa-fiche { padding: 24px 16px; }
    .fa-fiche-title { font-size: 26px; }
    .fa-fiche-name { font-size: 18px; }
}

/* ============================================
   Tablette mode lecture (paysage 1024px+)
   ============================================ */
@media (min-width: 1024px) {
    .fa-fiche {
        max-width: 900px;
        padding: 64px 56px;
    }
    .fa-fiche-title { font-size: 44px; }
    .fa-fiche-name { font-size: 24px; }
}

/* ============================================
   Impression
   ============================================ */
@media print {
    .fa-fiche {
        background: #fff;
        max-width: 100%;
        padding: 20px;
        font-size: 12pt;
    }
    .fa-fiche-row { page-break-inside: avoid; }
    .fa-fiche-summary { page-break-inside: avoid; }
    .fa-fiche-legend { page-break-inside: avoid; }
    .fa-pill { border: 1px solid #999 !important; }
}

/* ============================================
   v2.2.1 — Page "Menu introuvable"
   ============================================ */
.fa-fiche-missing {
    text-align: center;
    padding: 80px 32px;
    background: #fdfbf6;
    border-radius: 8px;
    max-width: 600px;
    margin: 0 auto;
}
.fa-missing-icon {
    font-size: 64px;
    margin-bottom: 20px;
    opacity: 0.7;
    line-height: 1;
}
.fa-missing-title {
    font-family: "Cormorant Garamond", "Cormorant", Georgia, "Times New Roman", Times, serif;
    font-size: 32px;
    font-weight: 400;
    color: #1f1c17;
    margin: 0 0 16px;
    font-style: italic;
}
.fa-missing-text {
    color: #5d3a10;
    font-size: 15px;
    line-height: 1.6;
    margin: 0 0 12px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}
.fa-missing-text:last-of-type {
    margin-bottom: 28px;
}
.fa-missing-action {
    margin-top: 28px;
}
.fa-missing-btn {
    display: inline-block;
    padding: 14px 28px;
    background: #1f1c17;
    color: #fdfbf6 !important;
    text-decoration: none;
    border-radius: 4px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    font-size: 14px;
    font-weight: 500;
    letter-spacing: 0.5px;
    transition: background 0.2s, transform 0.15s;
    border: 1px solid #1f1c17;
}
.fa-missing-btn:hover {
    background: #b8a37a;
    border-color: #b8a37a;
    color: #fff !important;
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .fa-fiche-missing { padding: 48px 20px; }
    .fa-missing-icon { font-size: 52px; }
    .fa-missing-title { font-size: 26px; }
    .fa-missing-text { font-size: 14px; }
    .fa-missing-btn { padding: 12px 24px; font-size: 13px; }
}
