/* =========================================================
   PAGES.CSS
   Styles des pages internes (template.html)
   Dépend de base.css. Ne redéfinit ni header, ni footer.
   ========================================================= */

/* =======================
   1) PAGE HEADER GÉNÉRIQUE
   ======================= */
.page-header {
    position: relative;
    background-color: #0b0f12;
    background-image: url("../img/bg-page.webp");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    padding: clamp(7rem, 12vw, 9.5rem) 0 clamp(3.5rem, 6vw, 4.5rem);
    text-align: center;
    color: #fff;
    overflow: hidden;
}

.page-header::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .18) 0%, rgba(0, 0, 0, .30) 100%);
    z-index: 1;
    pointer-events: none;
}

.page-header::before {
    content: "";
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: min(10vw, 120px);
    background-image: url("../img/arc-bas.png");
    background-repeat: no-repeat;
    background-position: center bottom;
    background-size: contain;
    z-index: 2;
    pointer-events: none;
}

.page-header .container {
    position: relative;
    z-index: 3;
}

.page-header__title {
    font-family: "Macondo", cursive;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: clamp(2.2rem, 5.2vw, 3.3rem);
    margin-bottom: .6rem;
    text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
}

.page-header__subtitle {
    opacity: .92;
    max-width: 52rem;
    margin: 0 auto;
    line-height: 1.5;
}

/* variantes */
.page-header--a-propos {
    background-image: url("../img/bg-page.webp");
}

.page-header--contact {
    background-image: url("../img/bg-page.webp");
}

.page-header--actualites {
    background-image: url("../img/bg-page.webp");
}

.page-header--legal {
    background-image: url("../img/bg-page.webp");
}

.page-header--tall {
    padding-top: clamp(8.5rem, 14vw, 11rem);
    padding-bottom: clamp(4rem, 6vw, 5rem);
}

/* =======================
   2) CONTENU PRINCIPAL
   ======================= */
.main-content {
    max-width: var(--maxw);
    margin: 0 auto;
    padding: clamp(3rem, 6vw, 5rem) 24px;
    line-height: 1.7;
    font-size: 1.05rem;
}

/* Fond noir total sur pages internes */
body:not(.home) {
    background: #000;
}

/* =======================
   3) TITRES & INTRO DE SECTION (pages internes)
   ======================= */
.section-title--page {
    font-family: "Macondo", cursive;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: clamp(1.3rem, 2.6vw, 1.8rem);
    color: var(--accent);
    text-align: left;
    /* ← alignement cohérent pages internes */
    margin-top: 3rem;
    /* espace avant le titre */
    margin-bottom: 1rem;
    /* espace après le titre */
    text-shadow: 0 2px 6px rgba(0, 0, 0, .35);
    position: relative;
}

.section-title--page::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -.4rem;
    height: 2px;
    width: clamp(120px, 20vw, 240px);
    background: linear-gradient(to right, var(--accent) 0%, rgba(212, 175, 55, .2) 80%, transparent 100%);
    border-radius: 2px;
    opacity: .9;
}

/* Sous-titre générique (par défaut centré) */
.section-subtitle {
    max-width: 60ch;
    margin: .25rem auto 1.5rem;
    font-size: clamp(.95rem, 1vw + .7rem, 1.1rem);
    line-height: 1.5;
    text-align: center;
    opacity: .9;
}

/* Arabesque/liseré sous le titre */
.section-underline {
    display: block;
    margin: 0 0 2.5rem 0;
    /* respiration avant le contenu */
}

/* =======================
   4) LAYOUTS RÉUTILISABLES
   ======================= */
.layout-2cols {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: clamp(2rem, 5vw, 3rem);
    align-items: start;
}

.rubrique-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: clamp(1.5rem, 3vw, 2rem);
    margin-top: 2.5rem;
}

.rubrique-card {
    background: rgba(0, 0, 0, .35);
    border: 1px solid rgba(212, 175, 55, .25);
    border-radius: 16px;
    padding: 1.5rem;
    transition: transform .3s ease, box-shadow .3s ease;
}

.rubrique-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, .3);
}

/* =======================
   5) PAGES SPÉCIFIQUES
   ======================= */
/* À propos */
.apropos-page__image img {
    width: 100%;
    height: auto;
    object-fit: cover;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
}

.apropos-page__section {
    margin-bottom: 2rem;
}

.apropos-page__section h3 {
    color: var(--accent);
    margin-bottom: .75rem;
}

.apropos-page__section p {
    margin-bottom: .8rem;
    color: rgba(255, 255, 255, .85);
    line-height: 1.7;
}

/* Contact */
.contact-page__form {
    max-width: 720px;
    margin-top: 2rem;
}

.contact-page__field {
    margin-bottom: 1.25rem;
}

.contact-page__field label {
    display: block;
    margin-bottom: .35rem;
    font-weight: 600;
}

.contact-page__field input,
.contact-page__field textarea {
    width: 100%;
    background: rgba(0, 0, 0, .25);
    border: 1px solid rgba(212, 175, 55, .25);
    border-radius: 12px;
    padding: .65rem .85rem;
    color: #fff;
    font-family: inherit;
}

.contact-page__field textarea {
    min-height: 160px;
    resize: vertical;
}

/* Légales */
.legal-page .main-content {
    max-width: 900px;
}

.legal-page h2 {
    margin-top: 2.75rem;
    margin-bottom: 1rem;
    color: var(--accent);
}

.legal-page p,
.legal-page li {
    line-height: 1.7;
}

.legal-page ul {
    padding-left: 1.5rem;
}

/* =======================
   6) CARROUSEL COUVERTURES
   ======================= */
.covers-carousel {
    margin-top: clamp(2.5rem, 6vw, 4rem);
}

.covers-carousel__header {
    margin-bottom: .75rem;
}

.covers-carousel__viewport {
    position: relative;
    overflow: hidden;
    padding: 0 24px;
}

.covers-carousel__track {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: clamp(140px, 18vw, 220px);
    gap: clamp(12px, 2vw, 18px);
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    padding: 12px 0 18px;
    -webkit-overflow-scrolling: touch;
    position: relative;
    z-index: 1;
}

.covers-slide {
    scroll-snap-align: start;
    list-style: none;
}

.covers-card {
    position: relative;
    display: block;
    aspect-ratio: 2/3;
    background: #0e0e0e;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid rgba(212, 175, 55, .25);
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.covers-card:hover {
    transform: translateY(-4px);
    border-color: rgba(212, 175, 55, .6);
    box-shadow: 0 14px 34px rgba(0, 0, 0, .45);
}

.covers-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* flèches */
.covers-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 38px;
    height: 38px;
    border-radius: 50%;
    border: 1px solid rgba(212, 175, 55, .45);
    background: rgba(0, 0, 0, .5);
    color: var(--accent);
    font-size: 22px;
    line-height: 1;
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background .2s ease, transform .2s ease;
    z-index: 3;
    pointer-events: auto;
}

.covers-nav--prev {
    left: 6px;
}

.covers-nav--next {
    right: 6px;
}

.covers-nav:hover {
    background: rgba(0, 0, 0, .7);
    transform: translateY(-50%) scale(1.05);
}

/* scrollbar dorée */
.covers-carousel__track {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in oklab, var(--accent) 85%, #000 15%) rgba(212, 175, 55, .15);
}

.covers-carousel__track::-webkit-scrollbar {
    height: 10px;
}

.covers-carousel__track::-webkit-scrollbar-track {
    background: rgba(212, 175, 55, .12);
    border-radius: 999px;
}

.covers-carousel__track::-webkit-scrollbar-thumb {
    background: color-mix(in oklab, var(--accent) 85%, #000 15%);
    border-radius: 999px;
    border: 2px solid transparent;
    background-clip: content-box;
}

.covers-carousel__track::-webkit-scrollbar-thumb:hover {
    background: color-mix(in oklab, var(--accent) 95%, #000 5%);
}

/* tooltip titre au survol */
.covers-card::after {
    content: attr(aria-label);
    position: absolute;
    left: 50%;
    bottom: 10px;
    transform: translate(-50%, 8px);
    padding: .45rem .7rem;
    font-family: "Macondo", cursive;
    text-transform: uppercase;
    letter-spacing: .06em;
    font-size: clamp(.7rem, 1.6vw, .85rem);
    color: #0b0f12;
    background: linear-gradient(90deg, var(--accent), var(--accent-2));
    border: 1px solid rgba(212, 175, 55, .5);
    border-radius: 999px;
    box-shadow: 0 8px 22px rgba(0, 0, 0, .35);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease, transform .25s ease;
    white-space: nowrap;
    z-index: 5;
}

.covers-card:hover::after,
.covers-card:focus-visible::after {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media(hover:none) and (pointer:coarse) {
    .covers-card::after {
        display: none;
    }
}

/* =======================
   7) HR DORÉ
   ======================= */
.hr-gold {
    position: relative;
    height: 2px;
    width: 100%;
    max-width: 720px;
    margin: clamp(2rem, 5vw, 3.5rem) auto;
    background: linear-gradient(90deg, transparent 0%, rgba(212, 175, 55, .3) 20%, var(--accent) 50%, rgba(212, 175, 55, .3) 80%, transparent 100%);
    border: none;
    border-radius: 2px;
    box-shadow: 0 0 12px rgba(212, 175, 55, .15);
}

@media(max-width:640px) {
    .hr-gold {
        max-width: 420px;
    }
}

/* =======================
   8) PAGE ACTUALITÉS — overrides main + titres
   ======================= */
.actualites-page .actualites {
    background: none !important;
    /* pas d'image d'arrière-plan */
    padding: 0;
    position: relative;
}

.actualites-page .actualites__arc-haut,
.actualites-page .actualites__arc-bas {
    display: none !important;
}

/* supprime les arcs du main */
.actualites-page .actualites__grid {
    margin: 2rem 0;
}

/* Sous-titre aligné à gauche pour cette page */
.actualites-page .section-subtitle {
    text-align: left;
    margin: .25rem 0 1.5rem 0;
}

/* =======================
   9) PAGINATION (container + nav)
   ======================= */
.pagination-row {
    max-width: var(--maxw);
    margin: 0 auto;
    clear: both;
    /* sécurité si la grille utilise des floats */
}

.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: .5rem;
    width: 100%;
    margin: 2rem 0 1.5rem;
}

.pagination__btn {
    border: 1px solid var(--gold, #d3b36a);
    background: transparent;
    padding: .4rem .7rem;
    border-radius: .5rem;
    font-size: 1rem;
    cursor: pointer;
}

.pagination__btn:disabled {
    opacity: .5;
    cursor: not-allowed;
}

.pagination__pages {
    display: flex;
    gap: .25rem;
    padding: 0;
    margin: 0;
    list-style: none;
}

.pagination__pages button {
    min-width: 2.25rem;
    aspect-ratio: 1/1;
    border-radius: .5rem;
    border: 1px solid var(--gold, #d3b36a);
    background: transparent;
    cursor: pointer;
}

.pagination__pages button[aria-current="page"] {
    background: var(--gold, #d3b36a);
    color: #111;
    font-weight: 600;
}

/* =======================
   10) RESPONSIVE
   ======================= */
@media(max-width:980px) {
    .layout-2cols {
        grid-template-columns: 1fr;
        text-align: center;
        padding-inline: 0;
    }

    .apropos-page__image {
        max-width: 320px;
        margin: 0 auto 2rem;
    }
}

@media(max-width:640px) {
    .main-content {
        padding-inline: 1.5rem;
    }

    .rubrique-grid {
        grid-template-columns: 1fr;
    }
}

/* Contact – grille desktop 2/3–1/3 */
.contact-page .layout-2cols {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(0, 1fr);
    gap: clamp(1.5rem, 4vw, 3rem);
    align-items: start;
}

/* Colonne image : limite raisonnable en desktop */
.contact-page .contact-page__media {
    justify-self: end;
    max-width: 520px;
    /* ajuste à 480/420 si tu veux plus étroit */
    width: 100%;
}

.contact-page .contact-page__media img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
}

/* Mobile : on empile + on choisit l’ordre (formulaire avant l’image) */
@media (max-width: 768px) {
    .contact-page .layout-2cols {
        display: flex;
        flex-direction: column;
        gap: clamp(1rem, 4vw, 1.5rem);
    }

    .contact-page .stack-form-first .contact-page__content {
        order: 1;
    }

    .contact-page .stack-form-first .contact-page__media {
        order: 2;
    }

    /* Si tu veux l’image avant un jour, remplace la classe par stack-image-first et inverse : */
    .contact-page .stack-image-first .contact-page__media {
        order: 1;
    }

    .contact-page .stack-image-first .contact-page__content {
        order: 2;
    }

    /* Pleine largeur en mobile */
    .contact-page .contact-page__media {
        max-width: none;
        width: 100%;
        justify-self: auto;
    }
}

/* --- Contact: forcer le plein-œil en mobile pour le formulaire + iframe --- */
@media (max-width: 768px) {

    /* Empilement déjà OK, on s'assure que la colonne s'étire */
    .contact-page .layout-2cols {
        align-items: stretch !important;
        text-align: initial;
        /* annule le centrage hérité */
    }

    /* Colonne contenu (formulaire) : prend toute la largeur */
    .contact-page .contact-page__content {
        align-self: stretch !important;
        width: 100% !important;
    }

    /* Wrapper de l'embed : largeur totale, pas de max-width ni centrage */
    .contact-page .contact-embed__framewrap {
        max-width: none !important;
        width: 100% !important;
        margin: 0 !important;
    }

    /* Iframe : 100% de la colonne */
    .contact-page #contactFrame {
        width: 100% !important;
        display: block;
    }
}