/* ============================================================
   Mairie de Montricher-Albanne — Charte graphique
   Direction : le village vit de l'ardoise (ses anciennes ardoisières),
   du mélèze (chalets, fours à pain) et des courbes de niveau de la
   vallée de la Maurienne. La palette et le motif topographique
   viennent de là plutôt que d'une identité générique.
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600;9..144,700&family=Public+Sans:wght@400;500;600;700&family=IBM+Plex+Mono:wght@500&display=swap');

:root {
    /* Ardoise — gris-bleu profond des toits en lauze */
    --ardoise-950: #1c2227;
    --ardoise-800: #2b333a;
    --ardoise-600: #4a5760;
    --ardoise-300: #a9b4ba;

    /* Sapin — vert alpin sourd (identité principale) */
    --pin-700: #2f4a3a;
    --pin-600: #3c5d48;
    --pin-500: #4f7259;

    /* Mélèze — bois chaud des chalets et des fours à pain (accent) */
    --larch-600: #a86a34;
    --larch-500: #bd7d3f;
    --larch-300: #e0b17e;

    /* Pierre / parchemin — fonds clairs */
    --stone-50: #f4f1e8;
    --stone-100: #ece7d8;
    --mist-200: #ded8c7;

    --neige: #fdfcf9;
    --white-card: rgba(253, 252, 249, 0.94);

    --alert-red: #b3432f;
    --alert-red-bg: #f6e2dd;
    --success-green: #3c6b4a;
    --success-green-bg: #e2ece2;

    --font-display: 'Fraunces', Georgia, serif;
    --font-body: 'Public Sans', 'Helvetica Neue', Arial, sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

    --radius-sm: 3px;
    --radius-md: 5px;

    /* rétro-compatibilité avec d'anciennes règles inline */
    --primary-color: var(--pin-600);
    --accent-color: var(--larch-500);
    --dark-color: var(--ardoise-800);
    --light-bg: var(--white-card);
    --border-color: var(--mist-200);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

/* Filet de sécurité : empêche toute page de créer un défilement horizontal
   involontaire si un élément déborde malgré les règles ci-dessous. */
html, body {
    overflow-x: hidden;
    max-width: 100%;
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    * { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.55;
    color: var(--ardoise-800);
    background: var(--stone-50);
    min-height: 100vh;
    position: relative;
}

h1, h2, h3, h4 {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.01em;
    line-height: 1.2;
}

a { color: inherit; }

:focus-visible {
    outline: 3px solid var(--larch-500);
    outline-offset: 2px;
}

/* ---------- Motif signature : courbes de niveau ---------- */
/* Bandeau topographique — reprend le relief de la vallée, utilisé
   comme séparateur structurel plutôt que comme décor gratuit. */
.topo-divider {
    height: 22px;
    width: 100%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 22' preserveAspectRatio='none'%3E%3Cpath d='M0 14 Q 25 4 50 14 T 100 14 T 150 14 T 200 14 T 250 14 T 300 14 T 350 14 T 400 14' fill='none' stroke='%23bd7d3f' stroke-width='1' opacity='0.55'/%3E%3Cpath d='M0 19 Q 25 11 50 19 T 100 19 T 150 19 T 200 19 T 250 19 T 300 19 T 350 19 T 400 19' fill='none' stroke='%23a9b4ba' stroke-width='1' opacity='0.35'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 200px 22px;
}

/* ---------- En-tête ---------- */
header {
    background: var(--hdr-bg, var(--ardoise-950));
    color: var(--hdr-text, var(--neige));
    font-family: var(--hdr-font, var(--font-body));
    position: sticky;
    top: 0;
    z-index: 1000;
    box-shadow: 0 6px 16px rgba(0,0,0,0.18);
}

.logo-area {
    display: flex;
    align-items: center;
    padding: 16px 30px;
    justify-content: flex-start;
    gap: 20px;
    flex-wrap: wrap;
}

.site-title {
    margin-right: auto;
    min-width: 0;
}

.site-title h1 {
    overflow-wrap: break-word;
}

.site-search {
    display: flex;
    align-items: center;
    gap: 0;
    background: #0f2b4c;
    border: 1px solid #0f2b4c;
    border-radius: 999px;
    overflow: hidden;
    flex-shrink: 0;
}

.site-search input[type="search"] {
    background: none;
    border: none;
    padding: 9px 6px 9px 16px;
    color: #ffffff;
    font-family: var(--font-body);
    font-size: 0.85rem;
    width: 180px;
    outline: none;
}

.site-search input[type="search"]::placeholder {
    color: rgba(255, 255, 255, 0.65);
}

.site-search button {
    background: none;
    border: none;
    color: #ffffff;
    padding: 8px 14px;
    cursor: pointer;
    font-size: 1rem;
}

.site-search button:hover {
    background: rgba(255, 255, 255, 0.15);
}

@media (max-width: 700px) {
    .site-search {
        flex: 1 1 100%;
        order: 3;
    }
    .site-search input[type="search"] {
        width: auto;
        flex: 1 1 auto;
    }
}

.logo-img {
    max-height: 80px;
    width: auto;
}

.site-title h1 {
    margin: 0;
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--hdr-text, var(--neige));
    font-family: inherit;
}

.site-title span {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--larch-300);
}

.horizontal-menu {
    background: var(--pin-700);
    border-top: 1px solid rgba(255,255,255,0.08);
}

.horizontal-menu ul {
    list-style: none;
    margin: 0;
    padding: 0;
    display: grid;
    grid-auto-flow: row;
    gap: 0;
}

/* Sur petit écran, une seule ligne pour tous les boutons devient illisible :
   on repasse alors à une grille qui s'adapte automatiquement et s'enroule
   sur plusieurs lignes (le nombre de colonnes calculé en PHP pour le desktop
   est alors ignoré grâce à !important). */
@media (max-width: 900px) {
    .horizontal-menu ul {
        grid-template-columns: repeat(auto-fill, minmax(100px, 1fr)) !important;
    }
    .horizontal-menu a {
        font-size: calc(var(--menu-font-size, 0.72rem) + 0.08rem);
        padding: 8px 6px;
        min-height: 44px;
    }
}

@media (max-width: 520px) {
    .horizontal-menu ul {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

.horizontal-menu a {
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 6px 4px;
    min-height: 40px;
    height: auto;
    color: #e7e2d4;
    text-decoration: none;
    font-size: var(--menu-font-size, 0.72rem);
    font-family: var(--menu-font-family, inherit);
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.15;
    white-space: normal;
    word-break: break-word;
    overflow: hidden;
    border-bottom: 3px solid transparent;
    border-right: 1px solid rgba(255,255,255,0.06);
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}

.horizontal-menu a:hover {
    background: rgba(255,255,255,0.06);
    color: var(--neige);
}

.horizontal-menu a.active {
    background: var(--pin-600);
    color: var(--neige);
    border-bottom-color: var(--larch-500);
}

/* Ligne topographique sous la navigation */
header::after {
    content: "";
    display: block;
    height: 22px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 22' preserveAspectRatio='none'%3E%3Cpath d='M0 14 Q 25 4 50 14 T 100 14 T 150 14 T 200 14 T 250 14 T 300 14 T 350 14 T 400 14' fill='none' stroke='%23bd7d3f' stroke-width='1' opacity='0.5'/%3E%3Cpath d='M0 19 Q 25 11 50 19 T 100 19 T 150 19 T 200 19 T 250 19 T 300 19 T 350 19 T 400 19' fill='none' stroke='%234f7259' stroke-width='1' opacity='0.4'/%3E%3C/svg%3E");
    background-repeat: repeat-x;
    background-size: 200px 22px;
    background-color: var(--stone-50);
}

/* ---------- Mise en page ---------- */
.main-wrapper {
    display: flex;
    max-width: 1400px;
    margin: 34px auto 90px auto;
    padding: 0 20px;
    gap: 30px;
    align-items: flex-start;
}

.sidebar-menu {
    width: 270px;
    flex-shrink: 0;
    background: var(--white-card);
    padding: 22px;
    border-radius: var(--radius-md);
    border: 1px solid var(--mist-200);
    border-top: 3px solid var(--pin-600);
    /* Le menu reste visible pendant le défilement de la page : il se fixe
       sous le bandeau du haut (lui-même sticky) et ne défile plus avec le
       contenu. L'offset --header-height est calculé en JS car la hauteur
       du bandeau du haut varie (logo, titre sur 1 ou 2 lignes, etc.). */
    position: sticky;
    top: calc(var(--header-height, 180px) + 14px);
    max-height: calc(100vh - var(--header-height, 180px) - 28px);
    overflow-y: auto;
}

.sidebar-menu h3 {
    margin: 0 0 16px 0;
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--pin-700);
    font-family: var(--font-mono);
    font-weight: 500;
}

.sidebar-menu ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar-menu li {
    margin-bottom: 1px;
}

.sidebar-menu a {
    display: block;
    padding: 6px 14px;
    color: var(--ardoise-800);
    text-decoration: none;
    border-radius: var(--radius-sm);
    border-left: 3px solid transparent;
    font-size: 0.9rem;
    line-height: 1.3;
    transition: background 0.15s, border-color 0.15s, padding-left 0.15s;
}

.sidebar-menu a:hover {
    background: var(--stone-100);
    border-left-color: var(--larch-300);
}

.sidebar-menu a.active {
    background: var(--stone-100);
    border-left-color: var(--pin-600);
    color: var(--pin-700);
    font-weight: 600;
    padding-left: 18px;
}

.content-frame {
    flex: 1;
    min-width: 0;
}

.fil-ariane {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--ardoise-800);
    margin-bottom: 14px;
    padding: 8px 14px;
    background: var(--white-card);
    border: 1px solid var(--mist-200);
    border-radius: 6px;
    width: fit-content;
    max-width: 100%;
}

.fil-ariane a {
    color: var(--pin-600);
    text-decoration: none;
    font-weight: 700;
}

.fil-ariane a:hover {
    text-decoration: underline;
}

.fil-ariane-sep {
    color: var(--ardoise-600);
}

.fil-ariane-courant {
    color: var(--ardoise-800);
    font-weight: 700;
}

.framed-card {
    background: var(--white-card);
    border: 1px solid var(--mist-200);
    border-top: 3px solid var(--larch-500);
    border-radius: var(--radius-md);
    padding: 34px 38px;
}

.framed-card h1 {
    margin-top: 0;
    color: var(--pin-700);
    font-size: 2rem;
}

.framed-card hr {
    border: 0;
    height: 1px;
    background: var(--mist-200);
    margin: 18px 0 26px 0;
}

/* ---------- Bandeau défilant ---------- */
/* Le bandeau défilant est en position fixe tout en bas de l'écran : sans
   cette réserve d'espace, il recouvre le pied de page (footer) une fois
   qu'on a scrollé jusqu'en bas. On fixe une hauteur exacte et identique
   des deux côtés (bandeau + réserve du body) pour être sûr qu'il n'y ait
   jamais de recouvrement, quel que soit le navigateur. */
body.has-scrolling-banner {
    padding-bottom: 52px;
}

.scrolling-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    color: var(--neige);
    padding: 0;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    border-top: 1px solid rgba(255,255,255,0.15);
}

.scrolling-banner.vert { background: var(--pin-700); }
.scrolling-banner.rouge { background: #7a2e22; }

.scrolling-banner {
    overflow: hidden;
}

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 26s linear infinite;
}

.marquee-track span {
    padding-right: 70px;
    white-space: nowrap;
}

.marquee-track a {
    color: var(--neige);
    text-decoration: underline;
    font-weight: 800;
    margin-left: 10px;
    white-space: nowrap;
}

.marquee-track a:hover {
    text-decoration: none;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- Formulaires ---------- */
.form-container {
    background: var(--stone-100);
    padding: 24px;
    border-radius: var(--radius-md);
    margin-top: 30px;
    border: 1px solid var(--mist-200);
}

.form-container h3 {
    margin-top: 0;
    color: var(--pin-700);
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    font-weight: 600;
    margin-bottom: 6px;
    font-size: 0.9rem;
}

.input-group input,
.input-group textarea,
.input-group select {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--ardoise-300);
    border-radius: var(--radius-sm);
    font-family: var(--font-body);
    font-size: 0.95rem;
    background: var(--neige);
}

.input-group input:focus,
.input-group textarea:focus,
.input-group select:focus {
    border-color: var(--pin-600);
}

.btn-submit {
    background: var(--pin-600);
    color: var(--neige);
    border: none;
    padding: 12px 26px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.95rem;
    cursor: pointer;
    transition: background 0.15s;
}

.btn-submit:hover {
    background: var(--larch-600);
}

.rgpd-text {
    font-size: 0.8rem;
    color: var(--ardoise-600);
}

.success-alert {
    background: var(--success-green-bg);
    color: var(--success-green);
    padding: 15px 18px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--success-green);
    margin-bottom: 20px;
}

.error-alert {
    background: var(--alert-red-bg);
    color: var(--alert-red);
    padding: 15px 18px;
    border-radius: var(--radius-sm);
    border-left: 4px solid var(--alert-red);
    margin-bottom: 20px;
}

/* ---------- Documents officiels ---------- */
.documents-section {
    margin-top: 44px;
    padding-top: 28px;
    border-top: 1px solid var(--mist-200);
}

.documents-section h3 {
    color: var(--pin-700);
}

.annee-group {
    margin-bottom: 14px;
    border: 1px solid var(--mist-200);
    border-radius: var(--radius-sm);
    background: var(--neige);
    overflow: hidden;
}

.annee-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--pin-700);
    font-weight: 700;
    padding: 12px 18px;
    cursor: pointer;
    user-select: none;
    list-style: none;
}

.annee-title::-webkit-details-marker {
    display: none;
}

.annee-title::after {
    content: "+";
    font-family: var(--font-body);
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--larch-600);
    line-height: 1;
    flex-shrink: 0;
    margin-left: 12px;
}

.annee-group[open] > .annee-title::after {
    content: "−";
}

.annee-content {
    padding: 4px 18px 18px 18px;
}

.mois-group {
    margin-bottom: 18px;
}

.mois-group:last-child {
    margin-bottom: 0;
}

.mois-title {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: var(--larch-600);
    margin-bottom: 8px;
}

.documents-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.document-item {
    display: flex;
    align-items: center;
    background: var(--neige);
    padding: 13px 20px;
    border: 1px solid var(--mist-200);
    border-radius: var(--radius-sm);
    margin-bottom: 10px;
}

.document-icon {
    font-size: 1.4rem;
    margin-right: 15px;
}

.document-info {
    flex-grow: 1;
}

.document-title {
    font-weight: 600;
    color: var(--pin-700);
    text-decoration: none;
}

.document-title:hover {
    text-decoration: underline;
}

.document-meta {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--ardoise-600);
    margin-top: 3px;
}

.document-btn {
    background: var(--pin-600);
    color: var(--neige);
    text-decoration: none;
    padding: 8px 16px;
    border-radius: var(--radius-sm);
    font-size: 0.82rem;
    font-weight: 600;
}

.document-btn:hover {
    background: var(--larch-600);
}

/* ---------- Acteurs locaux ---------- */
.acteurs-section {
    margin-top: 44px;
    padding-top: 28px;
    border-top: 1px solid var(--mist-200);
}

.acteurs-section h3 {
    color: var(--pin-700);
}

.acteurs-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 22px;
    margin-top: 25px;
}

.acteur-card {
    background: var(--neige);
    border: 1px solid var(--mist-200);
    border-radius: var(--radius-md);
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.acteur-photo-wrapper {
    position: relative;
    height: 200px;
    background: var(--stone-100);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ardoise-300);
    overflow: hidden;
}


.acteur-photo {
    width: 100%;
    height: 100%;
    object-fit: contain; /* Remplace 'cover' pour afficher l'image intégrale */
}

.download-img-btn {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(28, 34, 39, 0.88);
    color: var(--neige);
    text-decoration: none;
    padding: 6px 12px;
    font-size: 0.75rem;
    border-radius: var(--radius-sm);
    font-weight: 600;
}

.download-img-btn:hover {
    background: var(--larch-600);
}

.acteur-details {
    padding: 20px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.acteur-name {
    margin: 0 0 10px 0;
    color: var(--pin-700);
    font-size: 1.25rem;
}

.acteur-desc {
    font-size: 0.95rem;
    line-height: 1.5;
    color: var(--ardoise-800);
    margin-bottom: 15px;
}

.acteur-contacts {
    border-top: 1px solid var(--stone-100);
    padding-top: 15px;
    font-size: 0.9rem;
}

.contact-line {
    margin: 5px 0;
    color: var(--ardoise-800);
}

.contact-line a {
    color: var(--pin-700);
    text-decoration: none;
}

.contact-line a:hover {
    text-decoration: underline;
}

.acteur-link {
    display: inline-block;
    margin-top: 10px;
    background: var(--larch-500);
    color: var(--ardoise-950);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    text-decoration: none;
    font-size: 0.85rem;
}

.acteur-link:hover {
    background: var(--pin-600);
    color: var(--neige);
}

/* ---------- Galeries et albums photo ---------- */
.galerie-section {
    margin-top: 44px;
    border-top: 1px solid var(--mist-200);
    padding-top: 30px;
}

.galerie-section h2 {
    color: var(--pin-700);
    margin-bottom: 25px;
    font-size: 1.5rem;
}

.album-card {
    background: var(--neige);
    border: 1px solid var(--mist-200);
    border-left: 3px solid var(--pin-600);
    border-radius: var(--radius-md);
    padding: 26px;
    margin-bottom: 28px;
}

.album-title {
    color: var(--pin-700);
    margin-top: 0;
    margin-bottom: 0;
    font-size: 1.4rem;
    padding-bottom: 0;
}

.album-title-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 14px;
    cursor: pointer;
    user-select: none;
    border: none;
    border-bottom: 1px solid var(--mist-200);
    background: none;
    font: inherit;
    color: inherit;
    text-align: left;
    padding: 0 0 10px 0;
    margin: 0;
}

.album-title-toggle:hover,
.album-title-toggle:focus-visible {
    color: var(--pin-600);
}

.album-count {
    font-size: 0.85rem;
    font-weight: normal;
    color: var(--ardoise-800);
}

.album-toggle-icon {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: var(--pin-600);
    color: #fff;
    font-size: 1.2rem;
    line-height: 1;
}

.album-content {
    margin-top: 18px;
}

.album-description {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--ardoise-800);
    margin-bottom: 20px;
}

.galerie-vignettes {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 14px;
}

.vignette-container {
    position: relative;
    width: 100%;
    height: 100px;
    overflow: hidden;
    border-radius: var(--radius-sm);
    cursor: pointer;
    border: 1px solid var(--mist-200);
    background: var(--stone-100);
}

.vignette-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.25s ease;
}

.vignette-container img:hover {
    transform: scale(1.08);
}

/* ---------- Visionneuse (lightbox) ---------- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(20, 24, 27, 0.94);
    justify-content: center;
    align-items: center;
    user-select: none;
}

.lightbox-img {
    max-width: 90%;
    max-height: 85%;
    border-radius: var(--radius-sm);
    box-shadow: 0 0 30px rgba(0,0,0,0.4);
}

.lightbox-close {
    position: absolute;
    top: 25px;
    right: 35px;
    color: var(--neige);
    font-size: 42px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.2s;
}

.lightbox-close:hover { color: var(--larch-300); }

.lightbox-arrow {
    position: absolute;
    top: 50%;
    color: var(--neige);
    font-size: 36px;
    font-weight: bold;
    cursor: pointer;
    width: 48px;
    height: 48px;
    text-align: center;
    line-height: 45px;
    background: rgba(255,255,255,0.1);
    border-radius: 50%;
    transform: translateY(-50%);
    transition: background 0.2s, color 0.2s;
}

.lightbox-arrow:hover {
    background: rgba(255,255,255,0.25);
    color: var(--larch-300);
}

.lightbox-left { left: 30px; }
.lightbox-right { right: 30px; }

.vignette-site {
    display: block;
    max-width: 450px;
    width: 100%;
    height: auto;
    margin: 0 auto 20px auto;
    border-radius: var(--radius-sm);
    border: 1px solid var(--mist-200);
    transition: transform 0.2s;
}

.vignette-site:hover {
    transform: scale(1.015);
}

/* ---------- Pied de page ---------- */
footer {
    margin-top: 40px;
    padding: 30px 20px 26px 20px;
    background: var(--ftr-bg, linear-gradient(180deg, var(--ardoise-950), #14181c));
    color: var(--ftr-text, var(--stone-100));
    font-family: var(--ftr-font, var(--font-body));
    text-align: center;
    font-size: 0.85rem;
}

footer .footer-content p {
    margin: 4px 0;
}

footer .footer-content p:first-child {
    color: var(--ftr-text, var(--stone-100));
    opacity: 0.85;
}

footer a {
    color: var(--ftr-link, var(--larch-300));
    text-decoration: none;
    padding: 2px 6px;
    border-radius: 3px;
    transition: background 0.15s;
}

footer a:hover {
    background: rgba(253,252,249,0.08);
    text-decoration: underline;
}

.card-body img,
.actu-card-texte img,
.mentions-text img,
.album-description img,
.acteur-desc img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius-sm);
}

.card-body ul,
.actu-card-texte ul,
.mentions-text ul {
    padding-left: 1.4em;
}

.card-body p,
.actu-card-texte p,
.mentions-text p {
    margin: 0 0 1em 0;
}

/* ---------- Écran d'accueil : Hero ---------- */
.hero-accueil {
    position: relative;
    overflow: hidden;
    border-radius: var(--radius-md);
    min-height: 460px;
    display: flex;
    align-items: flex-end;
    background-color: var(--hero-bg, var(--ardoise-950));
    background-repeat: no-repeat;
    isolation: isolate;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(28,34,39,0.30) 0%, rgba(28,34,39,0.58) 55%, rgba(28,34,39,0.93) 100%),
        linear-gradient(100deg, rgba(47,74,58,0.55) 0%, rgba(28,34,39,0.05) 60%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 56px 46px 42px 46px;
    max-width: 720px;
    color: var(--neige);
}

.hero-eyebrow {
    font-family: var(--font-mono);
    font-size: 0.78rem;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--larch-300);
    margin: 0 0 14px 0;
}

.hero-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(2.1rem, 4.6vw, 3.4rem);
    line-height: 1.08;
    margin: 0 0 16px 0;
    color: var(--neige);
    text-shadow: 0 2px 18px rgba(0,0,0,0.35);
}

.hero-subtitle {
    font-size: 1.05rem;
    line-height: 1.6;
    color: var(--stone-100);
    max-width: 46ch;
    margin: 0 0 26px 0;
}

.hero-facts {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 28px;
    width: 100%;
}

.hero-fact {
    font-family: var(--font-mono);
    font-size: clamp(0.68rem, 1.6vw, 0.78rem);
    letter-spacing: 0.01em;
    background: rgba(253,252,249,0.12);
    border: 1px solid rgba(253,252,249,0.28);
    color: var(--neige);
    padding: clamp(6px, 0.9vw, 7px) clamp(10px, 1.6vw, 14px);
    border-radius: 999px;
    backdrop-filter: blur(2px);
    white-space: normal;
    flex: 1 1 150px;
    text-align: center;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-bottom: 28px;
}

.btn-hero-primary,
.btn-hero-secondary {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.92rem;
    text-decoration: none;
    transition: background 0.15s, transform 0.15s, border-color 0.15s;
}

.btn-hero-primary {
    background: var(--larch-500);
    color: var(--ardoise-950);
}

.btn-hero-primary:hover {
    background: var(--larch-300);
    transform: translateY(-1px);
}

.btn-hero-secondary {
    background: transparent;
    color: var(--neige);
    border: 1px solid rgba(253,252,249,0.5);
}

.btn-hero-secondary:hover {
    background: rgba(253,252,249,0.12);
    border-color: var(--neige);
    transform: translateY(-1px);
}

.hero-villages {
    display: flex;
    flex-wrap: wrap;
    gap: 8px 4px;
    padding-top: 20px;
    border-top: 1px solid rgba(253,252,249,0.18);
}

.hero-villages span {
    font-size: 0.78rem;
    color: var(--stone-100);
    opacity: 0.88;
}

.hero-villages span:not(:last-child)::after {
    content: "·";
    margin-left: 10px;
    color: var(--larch-300);
}

@media (max-width: 900px) {
    .hero-accueil { min-height: 400px; }
    .hero-content { padding: 40px 26px 30px 26px; }
}

@media (max-width: 520px) {
    .hero-accueil { min-height: 380px; }
}

/* ---------- Écran d'accueil : introduction de section ---------- */
.accueil-intro {
    margin: 38px 0 4px 0;
}

.accueil-intro h2 {
    color: var(--accueil-intro-titre-couleur, var(--pin-700));
    font-size: var(--accueil-intro-titre-taille, 1.5rem);
    margin: 0 0 6px 0;
}

.accueil-intro p {
    color: var(--accueil-intro-texte-couleur, var(--ardoise-600));
    font-size: var(--accueil-intro-texte-taille, 1rem);
    font-family: var(--accueil-intro-texte-police, inherit);
    margin: 0;
}

/* ---------- Écran d'accueil : Actualités & Agenda ---------- */
.accueil-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
    margin-top: 24px;
}

.accueil-bloc-titre {
    color: var(--accueil-bloc-titre-couleur, var(--pin-700));
    font-size: var(--accueil-bloc-titre-taille, 1.25rem);
    margin: 0 0 16px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--mist-200);
}

.accueil-vide {
    font-style: italic;
    color: var(--ardoise-600);
    background: var(--white-card);
    border: 1px dashed var(--mist-200);
    border-radius: var(--radius-md);
    padding: 22px 18px;
    text-align: center;
}

.actu-card {
    background: var(--white-card);
    border: 1px solid var(--mist-200);
    border-left: 3px solid var(--larch-500);
    border-radius: var(--radius-md);
    margin-bottom: 18px;
    overflow: hidden;
    transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.actu-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 12px 26px rgba(28, 34, 39, 0.12);
}

.actu-card.agenda-card {
    border-left-color: var(--pin-600);
}

.actu-card-img {
    width: 100%;
    max-height: 420px;
    overflow: hidden;
    background: var(--stone-100);
    display: flex;
    align-items: center;
    justify-content: center;
}

.actu-card-img img {
    width: 100%;
    height: auto;
    max-height: 420px;
    object-fit: contain;
}

.actu-card-body {
    padding: 18px 20px;
}

.actu-card-titre {
    margin: 0 0 8px 0;
    color: var(--pin-700);
    font-size: 1.1rem;
}

.actu-card-texte {
    font-size: 0.92rem;
    line-height: 1.55;
    color: var(--ardoise-800);
    margin-bottom: 10px;
}

.agenda-dates {
    display: inline-block;
    font-family: var(--font-mono);
    font-size: 0.72rem;
    letter-spacing: 0.03em;
    color: var(--pin-700);
    text-transform: uppercase;
    background: var(--stone-100);
    border: 1px solid var(--mist-200);
    padding: 4px 11px;
    border-radius: 999px;
    margin-bottom: 10px;
}

@media (max-width: 900px) {
    .accueil-grid {
        grid-template-columns: 1fr;
    }
}

/* ---------- Responsive ---------- */
/* ---------- Carte Google Maps intégrée dans une page éditoriale ---------- */
.map-embed-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 62%;
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--mist-200);
    margin: 18px 0;
}

.map-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}

.hameau-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin: 4px 0 22px 0;
}

.hameau-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    background: var(--neige);
    border: 1px solid var(--mist-200);
    color: var(--pin-700);
    text-decoration: none;
    font-size: 0.85rem;
    font-weight: 600;
    padding: 7px 14px;
    border-radius: 999px;
    transition: 0.15s;
}

.hameau-link:hover {
    background: var(--pin-600);
    color: var(--neige);
    border-color: var(--pin-600);
}

@media (max-width: 900px) {
    .map-embed-wrapper {
        padding-bottom: 90%;
    }
}

@media (max-width: 900px) {
    .main-wrapper {
        flex-direction: column;
        align-items: stretch;
    }
    .sidebar-menu {
        width: 100%;
        position: static;
        max-height: none;
        overflow-y: visible;
    }
    .framed-card {
        padding: 26px 22px;
    }
    .logo-area {
        padding: 14px 18px;
    }
    .horizontal-menu a {
        height: auto;
        min-height: 48px;
        padding: 10px 10px;
        font-size: 0.85rem;
    }
    .horizontal-menu ul {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

@media (max-width: 520px) {
    .framed-card h1 {
        font-size: 1.5rem;
    }
    .acteurs-container {
        grid-template-columns: 1fr;
    }
}

/* ===== Résultats de recherche ===== */
.recherche-liste {
    list-style: none;
    padding: 0;
    margin: 0;
}
.recherche-liste li {
    padding: 14px 0;
    border-bottom: 1px solid var(--mist-200);
}
.recherche-liste li:last-child {
    border-bottom: none;
}
.recherche-liste a {
    font-weight: 600;
    color: var(--pin-700);
    text-decoration: none;
    font-size: 1.05rem;
}
.recherche-liste a:hover {
    text-decoration: underline;
}
.recherche-liste p {
    margin: 6px 0 0 0;
    color: var(--ardoise-600);
    font-size: 0.9rem;
}

/* ===== Actualité phare (mise en avant) ===== */
.actu-phare-section {
    margin-top: 26px;
    position: relative;
}
.actu-phare-badge {
    position: absolute;
    top: -12px;
    left: 22px;
    background: var(--larch-500);
    color: var(--neige);
    font-family: var(--font-mono);
    font-size: 0.72rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    padding: 4px 12px;
    border-radius: 999px;
    z-index: 1;
    box-shadow: 0 2px 6px rgba(0,0,0,0.15);
}
.actu-phare-card {
    display: grid;
    grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
    gap: 0;
    background: var(--white-card);
    border: 1px solid var(--mist-200);
    border-top: 3px solid var(--larch-500);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.actu-phare-img {
    min-height: 220px;
}
.actu-phare-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.actu-phare-body {
    padding: 26px 28px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 10px;
}
.actu-phare-titre {
    margin: 0;
    font-family: var(--font-display);
    font-size: 1.5rem;
    color: var(--pin-700);
}
.actu-phare-texte {
    color: var(--ardoise-800);
    line-height: 1.5;
}
@media (max-width: 720px) {
    .actu-phare-card {
        grid-template-columns: 1fr;
    }
    .actu-phare-img {
        min-height: 160px;
    }
}

/* ===== Légendes sous les photos/vidéos ===== */
.vignette-figure {
    margin: 0;
}
.vignette-legende {
    font-size: 0.8rem;
    color: var(--ardoise-600);
    margin-top: 6px;
    line-height: 1.3;
}
.video-figure .video-embed-wrapper {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    border-radius: 6px;
    overflow: hidden;
    background: #000;
}
.video-figure .video-embed-wrapper iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}
.video-figure .video-locale {
    width: 100%;
    border-radius: 6px;
    background: #000;
}
.galerie-videos {
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)) !important;
}

/* ===== Menus verticaux : séparateurs + espacement réduit ===== */
.sidebar-menu li {
    margin-bottom: 0;
    border-bottom: 1px solid var(--mist-200);
}
.sidebar-menu li:last-child {
    border-bottom: none;
}
.sidebar-menu a {
    padding: 5px 12px;
}

/* ===== Cartes Google Maps (page "Situation géographique") ===== */
.carte-villages-section {
    margin-top: 10px;
}
.google-maps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 20px;
}
.google-maps-item {
    background: var(--white-card);
    border: 1px solid var(--mist-200);
    border-radius: var(--radius-md);
    overflow: hidden;
}
.google-maps-item iframe {
    width: 100%;
    height: 220px;
    border: none;
    display: block;
}
.google-maps-caption {
    margin: 0;
    padding: 10px 14px;
    font-weight: 600;
    color: var(--pin-700);
    font-size: 0.9rem;
    border-top: 1px solid var(--mist-200);
}
/* ============================================================
   Blocs complémentaires : Bandeau, Lightbox, Docs & Maps
   ============================================================ */

/* ---------- Bandeau défilant (Marquee) ---------- */
body.has-scrolling-banner {
    padding-bottom: 52px;
}

.scrolling-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 52px;
    display: flex;
    align-items: center;
    box-sizing: border-box;
    color: #ffffff;
    font-weight: 600;
    font-size: 0.9rem;
    z-index: 1000;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    overflow: hidden;
}

.scrolling-banner.vert { background: var(--pin-700); }
.scrolling-banner.rouge { background: var(--alert-red); }

.marquee-track {
    display: flex;
    width: max-content;
    animation: marquee-scroll 26s linear infinite;
}

.marquee-track span {
    padding-right: 70px;
    white-space: nowrap;
}

.marquee-track a {
    color: #ffffff;
    text-decoration: underline;
    font-weight: 800;
    margin-left: 10px;
}

@keyframes marquee-scroll {
    from { transform: translateX(0); }
    to { transform: translateX(-50%); }
}

/* ---------- Documents officiels (Accordéons <details>) ---------- */
.documents-section {
    margin-top: 2.5rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--mist-200);
}

.annee-group {
    margin-bottom: 0.8rem;
    border: 1px solid var(--mist-200);
    border-radius: var(--radius-sm);
    background: var(--card-bg);
}

.annee-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 0.95rem;
    text-transform: uppercase;
    color: var(--pin-700);
    font-weight: 700;
    padding: 0.8rem 1.2rem;
    cursor: pointer;
    user-select: none;
}

.annee-title::-webkit-details-marker { display: none; }

.annee-title::after {
    content: "+";
    font-size: 1.3rem;
    color: var(--larch-600);
}

.annee-group[open] > .annee-title::after {
    content: "−";
}

.annee-content {
    padding: 0.5rem 1.2rem 1.2rem 1.2rem;
}

.document-item {
    display: flex;
    align-items: center;
    background: var(--stone-50);
    padding: 0.8rem 1rem;
    border: 1px solid var(--mist-200);
    border-radius: var(--radius-sm);
    margin-bottom: 0.5rem;
}

.document-info { flex-grow: 1; }
.document-title { font-weight: 600; color: var(--pin-700); text-decoration: none; }
.document-title:hover { text-decoration: underline; }
.document-meta { font-family: var(--font-mono); font-size: 0.75rem; color: var(--ardoise-600); }

/* ---------- Visionneuse Photo (Lightbox) ---------- */
.lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    inset: 0;
    background: rgba(18, 21, 24, 0.95);
    justify-content: center;
    align-items: center;
}

.lightbox-img {
    max-width: 90%;
    max-height: 85vh;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-lg);
}

.lightbox-close {
    position: absolute;
    top: 20px;
    right: 30px;
    color: #fff;
    font-size: 2.5rem;
    cursor: pointer;
}

.lightbox-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    color: #fff;
    font-size: 2rem;
    background: rgba(255, 255, 255, 0.1);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-arrow:hover { background: rgba(255, 255, 255, 0.25); color: var(--larch-300); }
.lightbox-left { left: 20px; }
.lightbox-right { right: 20px; }

/* ---------- Intégration Cartes & Vidéos ---------- */
.map-embed-wrapper,
.video-embed-wrapper {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%; /* Ratio 16:9 */
    height: 0;
    overflow: hidden;
    border-radius: var(--radius-md);
    border: 1px solid var(--mist-200);
    margin: 1rem 0;
}

.map-embed-wrapper iframe,
.video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: 0;
}