/* === Grille === */
.appellations-grid {
    --ap-teal: #335c67;
    --ap-card-radius: 18px;
    --ap-shadow: 0 6px 30px rgba(0,0,0,0.08);

    display: flex;
    flex-wrap: wrap;
    gap: 5.5%;
    row-gap: 60px;
    width: 92%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 0;
    align-items: stretch;
}

/* === Carte ===
   Structure : .card (row flex)
     ├─ .card__photo  (colonne gauche, blanche, bouteille en bas)
     └─ .card__right  (colonne droite, column flex)
          ├─ .card__content  (année / nom / badge)
          └─ .card__more     (barre teal "En savoir plus")
*/
.appellation-card {
    flex: 1 1 calc((100% - 11%) / 3);
    max-width: calc((100% - 11%) / 3);
    min-width: 280px;
    background: #ffffff;
    border-radius: var(--ap-card-radius);
    box-shadow: var(--ap-shadow);
    overflow: hidden;
    display: block;
    min-height: 360px;
    position: relative;
}
.appellation-card__photo {
    position: absolute !important;
    bottom: -6%;
    left: 0;
    top: auto;
    right: auto;
    transform: translateX(-30%);
    pointer-events: none;
}
.appellation-card__photo img {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}
.appellation-card__right {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    min-height: 360px;
}
.appellation-card__content {
    --horizontal-gap: 1.5rem;
    --vertical-gap: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--vertical-gap);
    margin: 4rem 2rem auto 8rem;
}
.appellation-card__annee {
    font-family: 'Behind The Nineties', Georgia, serif;
    font-style: italic;
    font-size: 1.5rem;
    color: #1a1a1a;
    line-height: 1;
}
.appellation-card__nom {
    font-family: 'Behind The Nineties', Georgia, serif;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1.3;
    color: #1a1a1a;
    margin: 0;
}
.appellation-card__badge {
    align-self: flex-start;
    margin-top: 6px;
    width: 64px;
    height: 64px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    font-family: 'Sura', serif;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}
.appellation-card__more {
    background: var(--ap-teal);
    color: #ffffff;
    border: none;
    width: 100%;
    padding: 14px 20px 14px 8px;
    text-align: center;
    font-family: 'Behind The Nineties', Georgia, serif;
    font-size: 1rem;
    cursor: pointer;
    transition: background .2s ease;
}
.appellation-card__more:hover,
.appellation-card__more:focus-visible {
    background: #335c67;
    outline: none;
}
.appellation-card.is-open .appellation-card__more {
    background: #335c67;
}

/* === Panneau déplié === */
.appellation-panel {
    flex: 0 0 100%;
    width: 100%;
    background: #ffffff;
    border-radius: var(--ap-card-radius);
    box-shadow: var(--ap-shadow);
    position: relative;
    overflow: hidden;
    margin-top: 8px;
    animation: ap-fade-in .35s ease both;
}
@keyframes ap-fade-in {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}
.appellation-panel__inner {
    display: grid;
    grid-template-columns: minmax(220px, 28%) 1fr;
    gap: 32px;
    align-items: center;
    padding: 40px;
}
.appellation-panel__photo {
    display: flex;
    justify-content: center;
}
.appellation-panel__photo img {
    max-width: 100%;
    max-height: 360px;
    height: auto;
    object-fit: contain;
}
.appellation-panel__content {
    padding-right: 32px;
}
.appellation-panel__annee {
    display: block;
    font-family: 'Behind The Nineties', Georgia, serif;
    font-style: italic;
    font-size: 1.5rem;
    color: #1a1a1a;
    margin-bottom: 12px;
}
.appellation-panel__nom {
    font-family: 'Behind The Nineties', Georgia, serif;
    font-weight: 700;
    color: #335C67FF;
    font-size: 1.5rem;
    line-height: 1.2;
    margin: 0 0 24px;
}
.appellation-panel__texte {
    color: #2a2a2a;
    line-height: 1.7;
    font-size: 1rem;
}
.appellation-panel__texte p { font-family: 'Sura',Georgia,"Times New Roman",serif}
.appellation-panel__texte p:last-child { margin-bottom: 0; }
.appellation-panel__lien {
    display: inline-block;
    margin-top: 24px;
    padding: 10px 22px;
    background: var(--ap-teal);
    color: #fff;
    text-decoration: none;
    border-radius: 999px;
    font-family: 'Behind The Nineties', Georgia, serif;
    font-style: italic;
}
.appellation-panel__close {
    position: absolute;
    top: 12px;
    right: 16px;
    background: transparent;
    border: none;
    font-size: 2rem;
    line-height: 1;
    cursor: pointer;
    color: var(--ap-teal);
}
.appellation-panel__close:hover,
.appellation-panel__close:focus-visible {
    opacity: 0.7;
    outline: none;
}

/* === Modale (mobile) === */
.appellation-modal-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    z-index: 9998;
    animation: ap-fade-bg .2s ease both;
}
@keyframes ap-fade-bg {
    from { opacity: 0; }
    to   { opacity: 1; }
}
.appellation-panel.is-modal {
    position: fixed;
    inset: 0;
    margin: auto;
    z-index: 9999;
    width: min(92vw, 560px);
    max-height: 90vh;
    overflow-y: auto;
    border-radius: var(--ap-card-radius);
    animation: ap-modal-in .25s ease both;
}
@keyframes ap-modal-in {
    from { opacity: 0; transform: scale(.96); }
    to   { opacity: 1; transform: scale(1); }
}
body.appellation-modal-open {
    overflow: hidden;
}

/* === Empty === */
.appellations-grid-empty {
    text-align: center;
    padding: 4rem 1rem;
    font-style: italic;
    opacity: 0.7;
}

/* === Responsive === */
@media (max-width: 1024px) {
    .appellation-card {
        flex: 1 1 calc((100% - 32px) / 2);
        max-width: calc((100% - 32px) / 2);
    }
    .appellations-grid { gap: 32px; }
}
@media (max-width: 700px) {
    .appellations-grid { gap: 24px; padding: 2.5rem 0; }
    .appellation-card { flex: 1 1 100%; max-width: 100%; min-height: 0; }

    /* La photo redescend dans le flow et passe à gauche en flex sur mobile */
    .appellation-card { display: flex; flex-direction: row; }
    .appellation-card__photo img { max-height: 240px; }
    .appellation-card__right { margin-left: 0; flex: 1; min-height: 0; }
    .appellation-card__content { padding: 22px 18px 16px 4px; gap: 12px; }

    .appellation-panel__inner {
        grid-template-columns: 1fr;
        padding: 28px 20px;
        gap: 16px;
    }
    .appellation-panel__photo img { max-height: 240px; }
    .appellation-panel__content { padding-right: 0; text-align: center; }
}
