@font-face {
    font-family: 'Marker';
    src: url('PermanentMarker.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

/* Dégradé animé du fond de la page */

body {
    background: linear-gradient(270deg, #b5d3ff, #ffef92);
    background-size: 400% 400%;
    animation: AnimationName 45s ease infinite;
    color: #111;
    font-family: 'Georgia', serif;
    margin: 0;
    padding: 0;
    min-height: 100vh;
    min-height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
}

@keyframes AnimationName {
    0%   { background-position: 0%   51%; }
    50%  { background-position: 100% 50%; }
    100% { background-position: 0%   51%; }
}

.maintenance-notice {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    padding: 12px 20px;
    color: #fff;
    background: #222;
    font-size: 1rem;
    text-align: center;
}

.maintenance-disabled {
    cursor: not-allowed;
    opacity: 0.55;
}

.construction-badge {
    display: inline-block;
    padding: 0.15em 0.35em;
    color: #fff;
    background: #777;
    border-radius: 0.25em;
    font-family: Arial, sans-serif;
    font-size: 0.38em;
    font-weight: bold;
    line-height: 1;
    vertical-align: middle;
}

.container {
    margin: 12px auto;
    max-width: 700px;
    background: transparent;
    padding: 12px 40px;
    box-shadow: none;
    position: relative;
    z-index: 1;
}
.sidebar {
    float: left;
    width: 260px;
    margin-right: 40px;
}
.sidebar ul {
    list-style: none;
    padding: 0;
}
.sidebar li {
    font-size: 2em;
    margin-bottom: 16px;
}

.sidebar > ul > li > a {
    white-space: nowrap;
}

.sidebar a {
    color: #111;
    text-decoration: none;
    position: relative;
}

/* Animation de soulignement pour les liens dans la sidebar */

.sidebar a::after,
.dropdown a::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -3px;
    height: 2px;
    width: 100%;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .28s ease;
}

.sidebar a:hover::after,
.dropdown a:hover::after,
.has-dropdown.open > .dropdown-toggle::after {
    transform: scaleX(1);
}

/* Menu déroulant pour les sections avec sous-liens (ex: "28ème édition") */

.has-dropdown {
    position: relative;
}
.dropdown-toggle {
    cursor: pointer;
    user-select: none;
}
.dropdown {
    list-style: none;
    padding: 0;
    margin: 0;
    margin-top: 10px;
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.4s ease, opacity 0.4s ease;
    opacity: 0;
}
.has-dropdown.open > .dropdown {
    max-height: 300px;
    opacity: 1;
}
.dropdown li {
    font-size: 0.55em;
    margin-bottom: 8px;
    transform: translateY(-8px);
    opacity: 0;
    transition: transform 0.3s ease, opacity 0.3s ease;
}
.has-dropdown.open > .dropdown li {
    transform: translateY(0);
    opacity: 1;
}
.has-dropdown.open > .dropdown li:nth-child(1) { transition-delay: 0.05s; }
.has-dropdown.open > .dropdown li:nth-child(2) { transition-delay: 0.12s; }
.has-dropdown.open > .dropdown li:nth-child(3) { transition-delay: 0.19s; }
.has-dropdown.open > .dropdown li:nth-child(4) { transition-delay: 0.26s; }
.has-dropdown.open > .dropdown li:nth-child(5) { transition-delay: 0.33s; }
.has-dropdown.open > .dropdown li:nth-child(n+6) { transition-delay: 0.4s; }

.dropdown a {
    color: #444;
    text-decoration: none;
}
.dropdown a:hover {
    text-decoration: none;
    color: #111;
}

.logo {
    float: right;
    font-size: 5em;
    font-family: 'Georgia', serif;
    font-weight: normal;
    margin-top: 0;
    color: #111;
    text-decoration: none;
    position: relative;
}

.logo img {
    display: block;
    width: 1.2em;
    height: auto;
}

/* Soulignement pour le logo FBD [il faudra le retirer je pense] */

.logo::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    height: 2px;
    width: 100%;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .28s ease;
}

.logo:hover::after,
.logo:focus::after {
    transform: scaleX(1);
}
.content h5 a {
    color: #111;
    text-decoration: none;
    position: relative;
}

.map-container {
    width: 100%;
    aspect-ratio: 16 / 9;
    margin: 24px 0;
    overflow: hidden;
    border-radius: 8px;
}

.map-container iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

/* h1 : pour les titres principaux de chaque page (ex: "28ème édition") */

h1 {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 2.5em;
    font-family: 'Marker', 'Georgia', serif;
    font-weight: normal;
    margin: 40px 0 20px 0;
    text-align: center;
}


/* Lignes décoratives de chaque côté du titre h1 */

h1::before,
h1::after {
    content: "";
    flex: 1;
    height: 4px;
    background: #111;
    border-radius: 2px;
    display: block;
}


h1::before { margin-right: 20px; }
h1::after { margin-left: 20px; }

/* h2 : Pour les titres dans une grande section */

h2 {
    font-size: 2.0em;
    font-family: 'Marker', 'Georgia', serif;
    font-weight: normal;
    margin-top: 10px;
    margin-bottom: 10px;
}

/* h3 : Essayez de ne pas utiliser, ça sert vraiment pas à grand chose */

h3 {
    font-size: 1.6em;
    font-family: 'Marker', 'Georgia', serif;
    font-weight: normal;
    margin: 0;
}

/* h4 : Uniquement pour les texte au dessus des balises h1 (pré-titres) */

h4 {
    font-size: 1.2em;
    font-family: 'Marker', 'Georgia', serif;
    text-align: center;
    font-weight: normal;
    margin-top: 0;
    margin-bottom: -45px;
}

/* h5 : Séparateur entre h2 et p pour mettre un lien (page partenaire) */

h5 {
    font-size: 0.9em;
    font-family: 'Georgia', serif;
    font-style: italic;
    font-weight: normal;
    margin-top: -9px;
    margin-bottom: 5px;
    margin-left: 2px;
}

/* Animation pour les liens h5 */

.content h5 a::after {
    content: "";
    position: absolute;
    left: -1px;
    bottom: -3px;
    height: 1px;
    width: 100%;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .28s ease;
}

.content h5 a:hover::after,
.content h5 a:focus::after {
    transform: scaleX(1);
}
.content {
    clear: both;
    margin-top: 16px;
}

/* p : pour les paragraphes standard */

p {
    font-size: 1.2em;
    font-family: 'Georgia', serif;
    margin-top: 5px;
    margin-bottom: 20px;
}

/* Listes : ul et ol pour les listes à puces et numérotées, li pour les éléments de liste. */

.content ul,
.content ol {
    font-family: 'Georgia', serif;
    font-size: 1.2em;
    margin-top: 5px;
    margin-bottom: 20px;
    padding-left: 1.2em;
}
.content li {
    margin-bottom: 0;
    line-height: 1.4;
}

/* Utilitaire pour rajouter une image sans reécrire du code pour centrer et redimensionner l'image à chaque fois */
/* pour l'utiliser il faut écrire : */
/* <img class="img-centered" src="chemin_depuis_le_dossier_de_base" alt="Description (optionnel)" /> */

.img-centered {
    display: block;
    margin: 20px auto;
    width: 450px;
    max-width: 100%;
    height: auto;
    border-radius: 6px;
}

/* h4 spécifiquement pour les titres dans le footer, avec un style plus léger et espacé pour différencier du reste du contenu (c'est pour la citation en bas) */

.site-footer h4 {
    font-size: 1.2em;
    font-weight: normal;
    font-style: italic;
    margin: 12px 0 8px;
    text-align: center;
}

/* Mettre de la place autour du footer */

.site-footer {
    /* align footer with site's main container */
    margin: 20px auto 0;
    max-width: 700px;
    padding: 12px 40px 20px;
    box-sizing: border-box;
}

/* Mobile: remove animated underline and tap highlight for links */

@media (max-width: 650px) {
    /* Scale all text to 60% on phones */
    body {
        font-size: 60%;
    }

    /* Stack layout: remove floats so logo, sidebar and content flow vertically */
    .sidebar {
        float: none;
        width: auto;
        margin-right: 0;
        margin-bottom: 16px;
        /* allow sidebar to shrink when header becomes flex */
        flex: 1 1 auto;
    }

    .logo {
        /* keep visual scale but place at the right using header flex */
        float: none;
        display: inline-block;
        text-align: right;
        margin: 0;
        font-size: 5em;
    }

    /* make header a flex row so logo sits to the right on phones */
    .header {
        display: flex;
        /* align to top so logo sits at the top-right */
        align-items: flex-start;
        justify-content: space-between;
        gap: 12px;
    }
    /* ensure the sidebar appears left and logo right in the flex row */
    .header .sidebar { order: 1; }
    .header .logo { order: 2; align-self: flex-start; margin-top: 0; }

    /* Reduce top spacing so items align nicely on mobile */
    .content {
        margin-top: 4px;
    }

    /* Ensure dropdown appears directly under its toggle */
    .has-dropdown {
        position: relative;
    }

    .dropdown {
        margin-top: 6px;
    }

    .sidebar a::after,
    .dropdown a::after {
        display: none;
    }

    /* hide logo underline on mobile as well */
    .logo::after { display: none; }

    /* Ensure links don't show underlines on mobile */
    .sidebar a,
    .dropdown a,
    a {
        text-decoration: none;
    }

    /* Remove the default tap highlight on mobile browsers */
    a {
        -webkit-tap-highlight-color: transparent;
    }

    /* Make centered images fit better on small phones */
    .img-centered {
        width: 85%;
        max-width: 85%;
    }

    /* hide h5 link underline on mobile as with other link underlines */
    .content h5 a::after { display: none; }
    /* Disable lift/hover animation for author cards on mobile */
    .author-card,
    .author-card:hover {
        transform: none !important;
        box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1) !important;
        transition: none !important;
    }

}

/* Author Cards Styles */
.author-cards-container {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin: 20px 0;
    justify-content: center;
}

/* Image cards */
.image-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.image-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.image-card:hover,
.image-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    outline: none;
}

.image-card-image {
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
}

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

.image-card-title {
    font-family: 'Marker', 'Georgia', serif;
    font-size: 1.2em;
    text-align: center;
    margin: 12px 8px 14px;
    color: #111;
}

.image-card-viewer {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.18s ease;
}

.image-card-viewer.active {
    opacity: 1;
}

.image-card-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.9);
}

.image-card-viewer-content {
    position: relative;
    z-index: 1;
    width: 95vw;
    height: 95vh;
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
}

.image-card-viewer-image {
    display: block;
    width: auto;
    height: auto;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 6px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.6);
    pointer-events: auto;
}

/* Poster cards */
.poster-cards-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 24px;
    margin: 20px 0;
}

.poster-card {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    cursor: pointer;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.poster-card:hover,
.poster-card:focus-visible {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
    outline: none;
}

.poster-card-image {
    width: 100%;
    overflow: hidden;
    background: #f0f0f0;
}

.poster-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

.poster-card-year {
    font-family: 'Marker', 'Georgia', serif;
    font-size: 1.2em;
    text-align: center;
    margin: 12px 8px 14px;
    color: #111;
}

.image-card-viewer-close {
    position: absolute;
    top: -16px;
    right: -16px;
    z-index: 2;
    width: 44px;
    height: 44px;
    border: none;
    border-radius: 50%;
    background: white;
    color: #111;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    pointer-events: auto;
}

body.image-card-viewer-open {
    overflow: hidden;
}

/* Fixed bottom decorative background image */
#bg-bottom {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 70vh; /* larger visible area */
    background-image: url('BG.png');
    background-position: center top;
    background-repeat: no-repeat;
    background-size: cover; /* scale to cover area, anchored by background-position */
    mix-blend-mode: normal; /* make the image itself more visible */
    opacity: 0.15; /* increased visibility */
    pointer-events: none; /* allow clicks through */
    z-index: 0; /* sit behind main content but above page background */
}

@media (max-width: 650px) {
    #bg-bottom { height: 35vh; background-size: cover; opacity: 0.15; }
}

.author-card {
    background: white;
    border-radius: 6px;
    overflow: hidden;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    /* base and scale: base set per-breakpoint, scale controlled by JS or the .big class */
    --author-card-base: 220px;
    --author-card-scale: 1;
    --card-ratio: 1;
    /* width is the scaled base * ratio but never exceed container width */
    width: min(calc(var(--author-card-base) * var(--author-card-scale) * var(--card-ratio)), 100%);
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
}

/* Big variant: ~1.3x the regular width */
.author-card.big {
    --author-card-scale: 1.3; /* scale factor relative to base */
}

.author-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.2);
}

.author-card-image {
    width: 100%;
    aspect-ratio: var(--card-ratio-w, 1) / var(--card-ratio-h, 1);
    overflow: hidden;
    background: #f0f0f0;
}

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

.author-card-content {
    padding: 16px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.author-card-name {
    font-family: 'Marker', 'Georgia', serif;
    font-size: 1.3em;
    margin: 0 0 12px 0;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    display: block;
    max-width: 100%;
}

.author-card-description {
    font-size: 1em;
    line-height: 1.5;
    color: #555;
    margin: 0;
    overflow: hidden;
    max-height: 7.5em; /* 5 lines of text (5 * 1.5 line-height) */
    display: -webkit-box;
    -webkit-line-clamp: 5;
    -webkit-box-orient: vertical;
}

/* Responsive design for author cards */
@media (max-width: 650px) {
    .author-card {
        --author-card-base: 140.8px;
        width: min(calc(var(--author-card-base) * var(--author-card-scale) * var(--card-ratio, 1)), 100%);
        max-width: 100%;
        box-sizing: border-box;
    }

    .author-cards-container {
        gap: 12px;
    }

    /* Mobile big variant scaled similarly */
    .author-card.big {
        --author-card-scale: 1.3; /* ~140.8 * 1.3 = 183 */
    }
}

/* Author Modal Styles */
.author-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.author-modal.active {
    opacity: 1;
}

.author-modal-backdrop {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    /* Avoid expensive backdrop-filter on slower devices/hosts */
    backdrop-filter: none;
}

.author-modal-content {
    position: relative;
    background: white;
    border-radius: 16px;
    max-width: 700px;
    width: 90%;
    max-height: 85vh;
    overflow-y: auto;
    padding: 40px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    transform: scale(0.9);
    transition: transform 0.3s ease;
    margin: 20px;
    scrollbar-gutter: stable;
}

.author-modal.active .author-modal-content {
    transform: scale(1);
}

/* Custom scrollbar styling */
.author-modal-content::-webkit-scrollbar {
    width: 8px;
}

.author-modal-content::-webkit-scrollbar-track {
    background: transparent;
    margin: 16px 0;
}

.author-modal-content::-webkit-scrollbar-thumb {
    background: #d0d0d0;
    border-radius: 4px;
}

.author-modal-content::-webkit-scrollbar-thumb:hover {
    background: #b0b0b0;
}

.author-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 40px;
    height: 40px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    color: #111;
    transition: background 0.2s ease, transform 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.author-modal-close:hover {
    background: #e0e0e0;
    transform: rotate(90deg);
}

.author-modal-name {
    font-family: 'Marker', 'Georgia', serif;
    font-size: 2.5em;
    text-align: center;
    margin: 0 0 30px 0;
    color: #111;
}

.author-modal-image {
    display: flex;
    justify-content: center;
    margin-bottom: 30px;
}

.author-modal-image img {
    width: 300px;
    height: 300px;
    object-fit: cover;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.author-modal-description {
    font-family: 'Georgia', serif;
    font-size: 1.2em;
    line-height: 1.7;
    color: #333;
    margin-bottom: 30px;
    text-align: justify;
    white-space: pre-wrap;
}

.author-modal-bd-container {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 20px;
    flex-wrap: wrap;
    padding-top: 20px;
    border-top: 2px solid #e0e0e0;
}

.author-modal-bd-image {
    width: 180px;
    aspect-ratio: 594 / 841;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    cursor: pointer;
}

.author-modal-bd-image:hover {
    /* Disable hover lift/scale for performance and consistency */
    transform: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

/* Responsive modal design */
@media (max-width: 650px) {
    .author-modal-content {
        padding: 30px 20px;
        width: 95%;
        max-height: 90vh;
    }
    
    .author-modal-name {
        font-size: 2em;
        margin-bottom: 20px;
    }
    
    .author-modal-image img {
        width: 200px;
        height: 200px;
    }
    
    .author-modal-description {
        font-size: 1.6em;
    }
    
    .author-modal-bd-container {
        gap: 15px;
    }
    
    .author-modal-bd-image {
        width: 120px;
    }
}

/* Full-screen image viewer used when clicking BD images */
.image-viewer {
    position: fixed;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 0;
    transition: opacity 0.18s ease;
}
.image-viewer.active { opacity: 1; }
.image-viewer-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0,0,0,0.85);
}
.image-viewer-content {
    position: relative;
    z-index: 2001;
    max-width: 95%;
    max-height: 95%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 12px;
}
.image-viewer-img {
    /* Fixed visual width: slightly slimmer than the author card (card max-width = 700px)
       Use a responsive cap so it remains usable on small screens. Height is automatic
       to preserve aspect ratio and may vary between images. */
    width: calc(min(640px, 86vw) * 0.6);
    height: auto;
    max-height: 92vh; /* ensure it never exceeds viewport height */
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 10px 40px rgba(0,0,0,0.6);
}
.image-viewer-close {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 2010;
    background: rgba(255,255,255,0.9);
    border: none;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    font-size: 28px;
    cursor: pointer;
}