/* ============================================================
   BASE — design system commun CREAI-VBG
   Référence visuelle : page Solen (violet institutionnel + accent
   indigo, neutres chauds, Inter). Toutes les pages héritent de ces
   jetons : ne pas redéclarer de palette dans les feuilles de page.
   ============================================================ */


:root {
    /* Marque : violet CREAI-VBG */
    --brand-50:  #f5eef7;
    --brand-100: #ead9ee;
    --brand-200: #c79dd1;
    --brand-300: #a566b3;
    --brand-500: #6a2c74;
    --brand-600: #5c2565;
    --brand-700: #4e1f57;
    --brand-800: #401a48;
    --brand-900: #33143a;

    /* Accent : indigo (remplace l'ancien turquoise) */
    --accent-50:  #efeef9;
    --accent-100: #dedbf1;
    --accent-200: #b3aade;
    --accent-400: #6a60b0;
    --accent-600: #4c4494;
    --accent-700: #3c366f;
    --accent-800: #322d5c;

    /* Corail : dons, aide, alertes d'action */
    --coral-50:  #faece7;
    --coral-200: #f0b8a3;
    --coral-500: #c04f2b;
    --coral-700: #8f3a20;
    --coral-900: #6a2915;

    /* Neutres chauds */
    --gray-50:  #f6f5f1;
    --gray-100: #efeee8;
    --gray-200: #e3e0d8;
    --gray-300: #d8d6cd;
    --gray-400: #6b695f;
    --gray-600: #5c5b55;
    --gray-900: #262622;

    --bg-page:     #faf9f7;
    --surface:     #ffffff;
    --surface-alt: var(--gray-50);
    --border:      #e6e3dc;

    --text-primary:   var(--gray-900);
    --text-secondary: var(--gray-600);
    --text-muted:     #66645b;

    /* Rythme et formes */
    --space-1: 8px;
    --space-2: 16px;
    --space-3: 24px;
    --space-4: 32px;
    --space-5: 48px;
    --space-6: 64px;
    --space-7: 96px;

    --radius-sm: 8px;
    --radius:    12px;
    --radius-lg: 20px;

    --shadow-sm: 0 1px 2px rgba(51, 20, 58, 0.06), 0 1px 1px rgba(51, 20, 58, 0.04);
    --shadow-md: 0 8px 24px rgba(51, 20, 58, 0.10);
    --shadow-lg: 0 18px 44px rgba(51, 20, 58, 0.16);

    --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}


* { box-sizing: border-box; margin: 0; padding: 0; }
html, body {
    width: 100%;
    max-width: 100%;
    overflow-x: hidden;
}
html {
    scroll-behavior: smooth;
    -webkit-text-size-adjust: 100%;
}

body {
    font-family: var(--font-sans);
    background: var(--bg-page);
    color: var(--text-primary);
    line-height: 1.6;
    padding-top: 64px; /* espace pour la nav fixe */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
    line-height: 1.2;
    letter-spacing: -0.01em;
    text-wrap: balance;
}

p { text-wrap: pretty; }

img, svg, video { max-width: 100%; }

a { color: var(--brand-500); text-underline-offset: 3px; }

::selection { background: var(--brand-100); color: var(--brand-900); }

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

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

/* ============================================================
   LOGO (image + nom + slogan empilés)
   ============================================================ */

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    text-decoration: none;
    transition: opacity 0.15s;
    flex-shrink: 0;
    max-width: 420px;            /* limite pour ne pas pousser les liens */
}

.logo:hover {
    opacity: 0.85;
}

/* --- Image du logo --- */

.logo img {
    display: block;
    height: 52px;                /* hauteur fixe pour aligner avec le texte */
    width: auto;
    max-width: 80px;
    object-fit: contain;
    flex-shrink: 0;
}

/* --- Bloc texte (nom + slogan empilés) --- */

.logo-text {
    display: flex;
    flex-direction: column;      /* ← empile les 2 lignes */
    justify-content: center;
    line-height: 1.15;
    min-width: 0;                /* permet le tronquage si besoin */
}

/* --- Nom du site --- */

.logo-name {
    font-size: 1.5rem;
    font-weight: 800;
    color: #3a1642;              /* teal principal (charte) */
    letter-spacing: -0.01em;
    margin-bottom: 2px;
    white-space: nowrap;
}

/* --- Slogan (juste en dessous) --- */

.logo-tagline {
    font-size: 0.68rem;
    font-weight: 500;
    color: #718096;              /* gris moyen */
    line-height: 1.25;
    letter-spacing: 0.005em;

    /* Limite à 2 lignes max avec "..." si trop long */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* --- Hover : renforce le teal --- */

.logo:hover .logo-name {
    color: #4e1f57;
}

/* ============================================================
   NAVIGATION
   Bureau : barre sur une ligne, sous-menus au survol.
   < 1360px : menu hamburger (voir js/nav.js, MOBILE_MAX).
   ============================================================ */

:root {
    --nav-h: 76px;
}

body {
    padding-top: var(--nav-h);
}

.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    min-height: var(--nav-h);
    padding: 0 clamp(16px, 2.2vw, 32px);
    background: #ffffff;
    border-bottom: 1px solid #ece6ef;
    transition: box-shadow 0.2s;
}

/* Ombre discrète dès que la page défile (classe posée par js/nav.js) */
.nav.is-scrolled {
    box-shadow: 0 8px 28px rgba(51, 20, 58, 0.10);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 4px;
}

/* --- Liens et boutons de sous-menu --- */
.nav-links a,
.nav-item-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 13px;
    background: none;
    border: none;
    border-radius: 10px;
    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 500;
    line-height: 1.2;
    color: #3b3844;
    text-decoration: none;
    white-space: nowrap;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s;
}

/* Survol, et onglet de la page courante (is-active) : même apparence */
.nav-links a:hover,
.nav-links a.is-active,
.nav-item-toggle:hover,
.nav-item.open .nav-item-toggle,
.nav-item-toggle.is-active {
    color: #6a2c74;
    background-color: #f5eef7;
}

.nav-links a:focus-visible,
.nav-item-toggle:focus-visible,
.nav-toggle:focus-visible {
    outline: 3px solid #c79dd1;
    outline-offset: 2px;
}

.nav-item {
    position: relative;
}

.nav-item-chevron {
    transition: transform 0.2s;
}

.nav-item.open .nav-item-chevron {
    transform: rotate(180deg);
}

/* --- Sous-menus --- */
.nav-submenu {
    position: absolute;
    top: calc(100% + 10px);
    left: -8px;
    z-index: 1001;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 270px;
    padding: 8px;
    background: #ffffff;
    border: 1px solid #ece6ef;
    border-radius: 14px;
    box-shadow: 0 18px 44px rgba(51, 20, 58, 0.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(6px);
    transition: opacity 0.18s, transform 0.18s, visibility 0.18s;
}

/* Pont invisible : le survol ne se coupe pas entre le bouton et le menu */
.nav-submenu::before {
    content: '';
    position: absolute;
    top: -12px;
    left: 0;
    right: 0;
    height: 12px;
}

.nav-item.open .nav-submenu {
    opacity: 1;
    visibility: visible;
    transform: none;
}

/* Survol : uniquement pour les appareils à souris, sur grand écran */
@media (hover: hover) and (min-width: 1360px) {
    .nav-item:hover .nav-submenu {
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-item:hover .nav-item-toggle {
        color: #6a2c74;
        background-color: #f5eef7;
    }

    .nav-item:hover .nav-item-chevron {
        transform: rotate(180deg);
    }
}

.nav-submenu a {
    display: block;
    padding: 11px 14px;
    white-space: nowrap;
}

.nav-submenu a.is-active {
    font-weight: 600;
}

/* --- Actions : « Besoin d'aide ? » et « Don » --- */
.nav-actions {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-left: 10px;
    padding-left: 16px;
    border-left: 1px solid #ece6ef;
}

/* --- Sélecteur de langue FR / EN --- */
.lang-switch {
    display: inline-flex;
    border: 1.5px solid #ece6ef;
    border-radius: 999px;
    overflow: hidden;
}

.lang-switch button {
    padding: 7px 12px;
    font: inherit;
    font-size: 0.85rem;
    font-weight: 600;
    color: #6a2c74;
    background: transparent;
    border: none;
    cursor: pointer;
}

.lang-switch button:hover {
    background-color: #f4eef6;
}

.lang-switch button.is-active {
    color: #ffffff;
    background-color: #6a2c74;
}

.lang-switch button:focus-visible {
    outline: 2px solid #6a2c74;
    outline-offset: -2px;
}

/* Masque l'interface native de Google Traduction (bandeau, infobulles) */
.skiptranslate iframe.skiptranslate,
iframe.goog-te-banner-frame,
.goog-te-banner-frame,
#goog-gt-tt,
.goog-tooltip,
.goog-te-balloon-frame {
    display: none !important;
}

body {
    top: 0 !important;
}

.goog-text-highlight {
    background: none !important;
    box-shadow: none !important;
}

@media (max-width: 1100px) {
    .lang-switch {
        align-self: center;
    }
}

.nav-links a.nav-help {
    padding: 8px 16px;
    color: #c24a22;
    border: 1.5px solid #f0b8a3;
    border-radius: 999px;
    font-weight: 600;
}

.nav-links a.nav-help:hover,
.nav-links a.nav-help.is-active {
    color: #8f3a20;
    background-color: #faece7;
    border-color: #c04f2b;
}

.nav-links a.nav-don {
    gap: 7px;
    padding: 9px 20px;
    color: #ffffff;
    background: #c04f2b;
    border-radius: 999px;
    font-weight: 700;
    box-shadow: 0 4px 12px rgba(192, 79, 43, 0.3);
    transition: background-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.nav-links a.nav-don:hover {
    color: #ffffff;
    background-color: #a2431f;
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(192, 79, 43, 0.4);
}

/* Écrans intermédiaires : menu resserré pour tout garder sur une ligne */
@media (min-width: 1360px) and (max-width: 1519px) {
    .nav {
        gap: 12px;
    }

    .nav-links {
        gap: 0;
    }

    .nav-links a,
    .nav-item-toggle {
        padding: 10px 9px;
        font-size: 0.9rem;
    }

    .nav-actions {
        gap: 8px;
        margin-left: 6px;
        padding-left: 10px;
    }

    .nav-links a.nav-help {
        padding: 8px 12px;
    }

    .nav-links a.nav-don {
        padding: 9px 16px;
    }

    .logo-name {
        font-size: 1.35rem;
    }
}

/* ============================================================
   BOUTON HAMBURGER
   ============================================================ */

.nav-toggle {
    display: none; /* caché sur grand écran */
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 5px;
    width: 46px;
    height: 46px;
    padding: 0;
    background: #f5eef7;
    border: none;
    border-radius: 12px;
    cursor: pointer;
    transition: background-color 0.15s;
}

.nav-toggle:hover {
    background: #ead9ee;
}

.nav-toggle-bar {
    display: block;
    width: 22px;
    height: 2.5px;
    background: #4e1f57;
    border-radius: 2px;
    transition: transform 0.25s, opacity 0.25s;
}

/* Animation : hamburger → X */
.nav-toggle.open .nav-toggle-bar:nth-child(1) {
    transform: translateY(7.5px) rotate(45deg);
}

.nav-toggle.open .nav-toggle-bar:nth-child(2) {
    opacity: 0;
}

.nav-toggle.open .nav-toggle-bar:nth-child(3) {
    transform: translateY(-7.5px) rotate(-45deg);
}

/* ============================================================
   RESPONSIVE — menu hamburger < 1360px
   (le menu compte 8 entrées + 2 boutons : il ne tient plus
   sur une ligne en dessous de cette largeur)
   ============================================================ */

@media (max-width: 1359px) {

    :root {
        --nav-h: 68px;
    }

    .nav {
        flex-wrap: wrap;
        padding: 10px 16px;
    }

    .logo img {
        height: 44px;
    }

    .nav-toggle {
        display: flex;
    }

    /* Menu vertical, masqué par défaut */
    .nav-links {
        display: none;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        width: 100%;
        margin-top: 10px;
        padding: 12px 0 16px;
        border-top: 1px solid #ece6ef;
        /* le menu défile si l'écran est trop court */
        max-height: calc(100vh - var(--nav-h) - 12px);
        overflow-y: auto;
    }

    /* JS ajoute .open → on affiche */
    .nav-links.open {
        display: flex;
        animation: slideDown 0.2s ease-out;
    }

    .nav-links a,
    .nav-item-toggle {
        width: 100%;
        justify-content: space-between;
        padding: 14px 12px;
        font-size: 1rem;
        white-space: normal;
    }

    .nav-item {
        width: 100%;
    }

    /* Sous-menus : dépliés en accordéon */
    .nav-submenu {
        position: static;
        display: none;
        min-width: 0;
        margin: 2px 0 8px 14px;
        padding: 2px 0 2px 10px;
        background: transparent;
        border: none;
        border-left: 2px solid #ead9ee;
        border-radius: 0;
        box-shadow: none;
        opacity: 1;
        visibility: visible;
        transform: none;
    }

    .nav-submenu::before {
        display: none;
    }

    .nav-item.open .nav-submenu {
        display: flex;
    }

    .nav-submenu a {
        padding: 12px;
        white-space: normal;
    }

    /* Boutons d'action : pleine largeur, en bas du menu */
    .nav-actions {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        margin: 12px 0 0;
        padding: 16px 0 0;
        border-left: none;
        border-top: 1px solid #ece6ef;
    }

    .nav-links .nav-actions a {
        justify-content: center;
        padding: 14px 18px;
        border-radius: 12px;
    }
}

@media (max-width: 640px) {
    .logo-tagline {
        display: none;
    }

    .logo-name {
        font-size: 1.3rem;
    }
}

@keyframes slideDown {
    from { opacity: 0; transform: translateY(-8px); }
    to   { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .nav-submenu,
    .nav-links a.nav-don,
    .nav-links a.nav-don:hover {
        transition: none;
        transform: none;
    }
}

/* ============================================================
   CONTENEUR PRINCIPAL
   ============================================================ */

.container {
    max-width: 640px;
    margin: 40px auto;
    padding: 0 20px;
}

/* ============================================================
   ALERTES
   ============================================================ */

.alert { padding: 12px 16px; border-radius: 6px; margin-bottom: 20px; font-size: 0.95rem; }
.alert-success { background: #c6f6d5; color: #22543d; border-left: 4px solid #38a169; }
.alert-error   { background: #fed7d7; color: #742a2a; border-left: 4px solid #e53e3e; }
.alert-error ul { margin: 4px 0 0 20px; }

/* ============================================================
   FOOTER
   ============================================================ */

.footer {
    position: relative;
    background: linear-gradient(180deg, var(--brand-900) 0%, #2a0f30 100%);
    border-top: 4px solid var(--brand-500);
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.9rem;
    line-height: 1.6;
}

.footer-inner {
    display: grid;
    grid-template-columns: 1.6fr repeat(3, 1fr);
    gap: 40px;
    max-width: 1100px;
    margin: 0 auto;
    padding: 56px 40px 40px;
}

.footer-name {
    font-size: 1.4rem;
    font-weight: 800;
    letter-spacing: -0.01em;
    color: #ffffff;
    margin-bottom: 8px;
}

.footer-brand p {
    margin-bottom: 10px;
    max-width: 340px;
}

.footer-tagline {
    font-style: italic;
    color: #c79dd1;
}

.footer-heading {
    padding-bottom: 10px;
    border-bottom: 2px solid rgba(199, 157, 209, 0.35);
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: #ffffff;
    margin-bottom: 14px;
}

.footer-col ul {
    list-style: none;
}

.footer-col li + li {
    margin-top: 8px;
}

.footer-col a {
    color: rgba(255, 255, 255, 0.82);
    text-decoration: none;
    transition: color 0.15s;
}

.footer-col a:hover {
    color: #ffffff;
    text-decoration: underline;
    text-underline-offset: 4px;
}

.footer-col a.footer-help {
    color: #f5a58a;
    font-weight: 600;
}

.footer-bottom {
    max-width: 1100px;
    margin: 0 auto;
    padding: 22px 40px 28px;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    text-align: center;
    font-size: 0.82rem;
    color: rgba(255, 255, 255, 0.7);
}

.footer-bottom p + p {
    margin-top: 4px;
}

@media (max-width: 900px) {
    .footer-inner {
        grid-template-columns: 1fr 1fr;
        gap: 32px;
        padding: 44px 32px 32px;
    }

    .footer-brand {
        grid-column: 1 / -1;
    }
}

@media (max-width: 520px) {
    .footer-inner {
        grid-template-columns: 1fr;
        padding: 36px 20px 24px;
    }

    .footer-bottom {
        padding: 20px;
    }
}

/* ============================================================
   MODAL ÉVÉNEMENT
   ============================================================ */

.event-modal {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: modalFadeIn 0.25s ease;
}

.event-modal[hidden] {
    display: none;
}

@keyframes modalFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.event-modal-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    cursor: pointer;
}

.event-modal-content {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 820px;
    max-height: calc(100vh - 40px);
    background: var(--surface, #ffffff);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
    display: flex;
    flex-direction: column;
    animation: modalSlideUp 0.3s ease;
}

@keyframes modalSlideUp {
    from { opacity: 0; transform: translateY(24px) scale(0.98); }
    to   { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- Bouton fermer --- */

.event-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 10;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255, 255, 255, 0.95);
    color: var(--gray-900, #2c2c2a);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.15);
    transition: background 0.15s, transform 0.15s;
}

.event-modal-close:hover {
    background: #ffffff;
    transform: scale(1.08);
}

.event-modal-close svg {
    display: block;
}

/* --- Image de couverture --- */

.event-modal-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: var(--gray-100, #efeee8);
    flex-shrink: 0;
}

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

.event-modal-image-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(51, 20, 58, 0.1) 0%, rgba(51, 20, 58, 0.4) 100%);
    pointer-events: none;
}

.event-modal-badge {
    position: absolute;
    top: 16px;
    left: 16px;
    padding: 8px 16px;
    background: var(--accent-600);
    color: #ffffff;
    border-radius: 999px;
    font-size: 11.5px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    box-shadow: 0 6px 18px rgba(76, 68, 148, 0.4);
}

/* --- Corps --- */

.event-modal-body {
    padding: 32px 36px 28px;
    overflow-y: auto;
    flex: 1;
}

.event-modal-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 18px;
    margin-bottom: 18px;
    font-size: 13.5px;
    color: var(--accent-600);
    font-weight: 600;
}

.event-modal-meta-item {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.event-modal-meta-item svg {
    display: block;
    flex-shrink: 0;
}

.event-modal-title {
    font-size: 28px;
    font-weight: 800;
    color: var(--text-primary, #2c2c2a);
    line-height: 1.2;
    margin: 0 0 20px;
    letter-spacing: -0.01em;
}

.event-modal-description {
    font-size: 16.5px;
    line-height: 1.7;
    color: var(--text-primary, #2c2c2a);
    font-weight: 500;
    padding: 0 0 20px;
    border-bottom: 1px solid var(--border, #e5e7eb);
    margin-bottom: 24px;
}

.event-modal-content-html {
    font-size: 15.5px;
    line-height: 1.75;
    color: var(--text-secondary, #5f5e5a);
}

.event-modal-content-html:empty {
    display: none;
}

.event-modal-content-html p {
    margin: 0 0 16px;
}

.event-modal-content-html h2,
.event-modal-content-html h3 {
    color: var(--text-primary, #2c2c2a);
    margin: 24px 0 12px;
}

.event-modal-content-html ul,
.event-modal-content-html ol {
    margin: 0 0 16px;
    padding-left: 24px;
}

/* --- Footer --- */

.event-modal-footer {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    padding: 20px 36px;
    border-top: 1px solid var(--border, #e5e7eb);
    background: var(--surface-alt, #f1efe8);
    flex-wrap: wrap;
}

.event-modal-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 12px 22px;
    border-radius: 8px;
    font-family: inherit;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    border: 2px solid transparent;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.1s;
}

.event-modal-btn svg {
    display: block;
    flex-shrink: 0;
}

.event-modal-btn--ghost {
    background: transparent;
    color: var(--text-secondary, #5f5e5a);
    border-color: var(--border, #e5e7eb);
}

.event-modal-btn--ghost:hover {
    background: var(--surface, #ffffff);
    color: var(--text-primary, #2c2c2a);
    border-color: var(--gray-200, #b4b2a9);
}

.event-modal-btn--primary {
    background: var(--accent-600);
    color: #ffffff;
    border-color: var(--accent-600);
}

.event-modal-btn--primary:hover {
    background: var(--accent-800);
    border-color: var(--accent-800);
    transform: translateY(-2px);
}

/* --- Blocage du scroll body --- */

body.event-modal-open {
    overflow: hidden;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

@media (max-width: 600px) {
    .event-modal {
        padding: 0;
        align-items: flex-end;
    }

    .event-modal-content {
        max-width: 100%;
        max-height: 92vh;
        border-radius: 20px 20px 0 0;
    }

    .event-modal-image {
        aspect-ratio: 16 / 10;
    }

    .event-modal-close {
        top: 12px;
        right: 12px;
        width: 38px;
        height: 38px;
    }

    .event-modal-body {
        padding: 24px 22px 20px;
    }

    .event-modal-title {
        font-size: 22px;
    }

    .event-modal-description {
        font-size: 15px;
    }

    .event-modal-content-html {
        font-size: 14.5px;
    }

    .event-modal-footer {
        padding: 16px 22px;
        flex-direction: column-reverse;
    }

    .event-modal-btn {
        width: 100%;
        justify-content: center;
    }
}
.footer-legal-link {
    color: rgba(255, 255, 255, 0.85);
    text-decoration: underline;
}

.footer-legal-link:hover {
    color: #ffffff;
}

/* ============================================================
   BOUTON "QUITTER RAPIDEMENT" (toutes les pages)
   Icône seule : un clic, ou 3 pressions sur Échap (js/quick-exit.js)
   ============================================================ */

.quick-exit {
    position: fixed;
    top: calc(var(--nav-h, 76px) + 16px);
    right: 20px;
    z-index: 9999;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-width: 48px;
    height: 48px;
    padding: 0 16px;
    font-family: 'Inter', sans-serif;
    font-size: 14px;
    font-weight: 700;
    background: #c04f2b;
    color: #fff;
    border: 3px solid #fff;
    border-radius: 999px;
    box-shadow: 0 8px 20px rgba(192, 79, 43, 0.35), 0 0 0 1px rgba(192, 79, 43, 0.25);
    text-decoration: none;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.quick-exit svg {
    display: block;
    width: 22px;
    height: 22px;
}

.quick-exit:hover {
    background: #8f3a20;
    transform: scale(1.08);
    box-shadow: 0 10px 24px rgba(153, 60, 29, 0.4), 0 0 0 1px rgba(153, 60, 29, 0.3);
}

.quick-exit:focus-visible {
    outline: 3px solid #712b13;
    outline-offset: 3px;
}

/* Sur petit écran : icône seule (le nom accessible reste porté par aria-label) */
@media (max-width: 700px) {
    .quick-exit { padding: 0; width: 48px; }
    .quick-exit-text { display: none; }
}

/* Ancienne infobulle, remplacée par le libellé visible */
.quick-exit::after {
    display: none;
    content: attr(data-tooltip);
    position: absolute;
    top: 50%;
    right: calc(100% + 12px);
    transform: translateY(-50%);
    padding: 7px 12px;
    background: #2c2c2a;
    color: #fff;
    border-radius: 8px;
    font-family: 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 600;
    line-height: 1.2;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s;
}

.quick-exit:hover::after,
.quick-exit:focus-visible::after {
    opacity: 1;
}

@media (max-width: 600px) {
    .quick-exit {
        top: calc(var(--nav-h, 68px) + 12px);
        right: 12px;
        width: 44px;
        height: 44px;
    }

    .quick-exit svg {
        width: 20px;
        height: 20px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .quick-exit,
    .quick-exit:hover {
        transition: none;
        transform: none;
    }
}

/* ============================================================
   BOUTON « FAIRE UN DON » (menu + bandeaux de toutes les pages)
   ============================================================ */

.btn-don {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    min-height: 48px;
    padding: 12px 26px;
    background: #c04f2b;
    color: #ffffff;
    border: 1.5px solid #c04f2b;
    border-radius: 8px;
    box-shadow: 0 8px 20px rgba(192, 79, 43, 0.32);
    font-family: 'Inter', sans-serif;
    font-size: 15px;
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn-don:hover {
    background: #a2431f;
    border-color: #a2431f;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(192, 79, 43, 0.4);
}

.btn-don:focus-visible {
    outline: 3px solid #ffffff;
    outline-offset: 3px;
}

.btn-don svg {
    flex-shrink: 0;
}

/* Bouton seul sous l'introduction d'un bandeau */
.hero-don {
    margin-top: 28px;
}

@media (prefers-reduced-motion: reduce) {
    .btn-don:hover,
    .btn-don:focus-visible {
        transform: none;
    }
}


/* ============================================================
   BOUTONS ET CHAMPS PAR DÉFAUT (les pages peuvent les affiner)
   ============================================================ */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    padding: 13px 28px;
    border: 2px solid transparent;
    border-radius: var(--radius-sm);
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    line-height: 1.2;
    text-decoration: none;
    cursor: pointer;
    transition: background 0.15s, color 0.15s, border-color 0.15s, transform 0.15s, box-shadow 0.15s;
}

.btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-md);
}

.btn:active {
    transform: translateY(0);
    box-shadow: none;
}

.btn:disabled {
    opacity: 0.55;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

input, select, textarea {
    font-family: var(--font-sans);
}

input:not([type="checkbox"]):not([type="radio"]):focus,
select:focus,
textarea:focus {
    outline: none;
    border-color: var(--accent-600);
    box-shadow: 0 0 0 3px rgba(76, 68, 148, 0.16);
}

.alert-success { background: #e6f4ec; color: #17553a; border-left-color: #1f9d6f; }
.alert-error   { background: #fbe9e7; color: #7a2418; border-left-color: var(--coral-500); }

/* ============================================================
   Bloc d'urgence (partials/urgence.php) — en tête de la page d'accueil
   Une seule ligne de cartes ; défilement doux avec flèches quand l'écran est étroit.
   ============================================================ */

.urgence-bar {
    background: linear-gradient(135deg, var(--coral-900) 0%, #7d2f18 100%);
    color: #fff;
    border-bottom: 4px solid var(--coral-500);
}

.urgence-bar-inner {
    max-width: 1320px;
    margin: 0 auto;
    padding: 16px clamp(16px, 2.2vw, 32px) 14px;
}

.urgence-bar-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px 20px;
    flex-wrap: wrap;
    margin-bottom: 14px;
}

.urgence-bar h2 {
    margin: 0;
    padding-right: 150px;   /* laisse la place au bouton « Quitter vite » fixe */
    font-size: clamp(1rem, 1.4vw, 1.2rem);
    font-weight: 600;
    line-height: 1.3;
    color: #fff;
}

.urgence-bar h2::before {
    content: "";
    display: inline-block;
    vertical-align: middle;
    margin: -2px 12px 0 0;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 0 0 0 rgba(255, 255, 255, 0.7);
    animation: urgencePulse 2.2s ease-out infinite;
}

.urgence-bar h2 span { font-weight: 800; }

@keyframes urgencePulse {
    70%  { box-shadow: 0 0 0 10px rgba(255, 255, 255, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 255, 255, 0); }
}

.urgence-exit {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: transparent;
    color: #fff;
    border: 2px solid rgba(255, 255, 255, 0.85);
    border-radius: 999px;
    padding: 8px 18px;
    font: inherit;
    font-weight: 700;
    font-size: 0.88rem;
    cursor: pointer;
    transition: background 0.15s, color 0.15s;
}

.urgence-exit::after { content: "92"; font-size: 1.05em; }
.urgence-exit:hover { background: #fff; color: var(--coral-900); }

/* ---- Rangée de cartes ---- */

.urgence-track {
    position: relative;
}

.urgence-list {
    list-style: none;
    margin: 0;
    padding: 2px 2px 6px;
    display: flex;
    flex-wrap: nowrap;
    gap: 12px;
    overflow-x: auto;
    scroll-snap-type: x proximity;
    scroll-padding: 0 12px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
}

.urgence-list::-webkit-scrollbar { display: none; }

.urgence-item {
    position: relative;
    flex: 1 1 0;
    min-width: 188px;
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 14px 16px 14px;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.30);
    border-radius: 14px;
    transition: background 0.15s, transform 0.15s, box-shadow 0.15s;
}

.urgence-item:hover,
.urgence-item:focus-within {
    background: rgba(255, 255, 255, 0.20);
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.25);
}

/* Les deux numéros prioritaires : cartes pleines */
.urgence-item--main {
    background: #fff;
    border-color: #fff;
    color: var(--gray-900);
}

.urgence-item--main:hover,
.urgence-item--main:focus-within { background: var(--coral-50); }

.urgence-item--main .urgence-num { color: var(--coral-700); }
.urgence-item--main .urgence-call,
.urgence-item--main .urgence-detail { color: var(--gray-900); }
.urgence-item--main .urgence-detail { opacity: 0.8; }

/* Ligne d'écoute du CREAI-VBG : carte violette */
.urgence-item--team {
    background: var(--brand-50);
    border-color: var(--brand-100);
    color: var(--gray-900);
}
.urgence-item--team .urgence-num { color: var(--brand-700); }
.urgence-item--team .urgence-call,
.urgence-item--team .urgence-detail { color: var(--gray-900); }
.urgence-item--team .urgence-detail { opacity: 0.8; }

.urgence-call {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: #fff;
    text-decoration: none;
}

/* Toute la carte est cliquable pour appeler */
.urgence-call::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
}

.urgence-call:focus-visible { outline: none; }
.urgence-item:focus-within { outline: 3px solid #fff; outline-offset: 3px; }
.urgence-item--main:focus-within { outline-color: var(--coral-200); }

.urgence-num {
    font-size: clamp(1.7rem, 2.4vw, 2.2rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: 0.01em;
    font-variant-numeric: tabular-nums;
}

.urgence-label { font-weight: 700; font-size: 0.92rem; line-height: 1.25; }

.urgence-detail {
    font-size: 0.78rem;
    line-height: 1.35;
    opacity: 0.88;
}

/* ---- Flèches de navigation (affichées seulement si les cartes débordent) ---- */

.urgence-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 40px;
    height: 40px;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #fff;
    color: var(--coral-900);
    border: 0;
    border-radius: 50%;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35);
    cursor: pointer;
}

.urgence-nav svg { width: 20px; height: 20px; }
.urgence-nav--prev { left: -8px; }
.urgence-nav--next { right: -8px; }
.urgence-nav:hover { background: var(--coral-50); }
.urgence-nav:focus-visible { outline: 3px solid #fff; outline-offset: 2px; }
.urgence-track.is-scrollable .urgence-nav { display: inline-flex; }
.urgence-track.at-start .urgence-nav--prev,
.urgence-track.at-end .urgence-nav--next { display: none; }

/* Fondu sur le bord où d'autres cartes se cachent */
.urgence-track.is-scrollable:not(.at-end)::after,
.urgence-track.is-scrollable:not(.at-start)::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 6px;
    width: 36px;
    z-index: 1;
    pointer-events: none;
}
.urgence-track.is-scrollable:not(.at-end)::after { right: 0; background: linear-gradient(to left, #7d2f18, transparent); }
.urgence-track.is-scrollable:not(.at-start)::before { left: 0; background: linear-gradient(to right, var(--coral-900), transparent); }

.urgence-note {
    margin: 10px 0 0;
    font-size: 0.82rem;
    line-height: 1.5;
    opacity: 0.95;
}
.urgence-note a { color: #fff; font-weight: 600; text-decoration: underline; text-underline-offset: 2px; }
.urgence-note a:focus-visible,
.urgence-exit:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }

@media (max-width: 700px) {
    .urgence-item { min-width: 156px; padding: 12px 13px; }
    .urgence-bar h2 { font-size: 0.98rem; padding-right: 56px; }
    .urgence-nav--prev { left: -4px; }
    .urgence-nav--next { right: -4px; }
}

@media (prefers-reduced-motion: reduce) {
    .urgence-bar h2::before { animation: none; }
    .urgence-item { transition: none; }
    .urgence-item:hover, .urgence-item:focus-within { transform: none; }
    .urgence-list { scroll-behavior: auto; }
}

/* Lien d'évitement : visible seulement au focus clavier */
.skip-link {
    position: fixed;
    top: -100px;
    left: 12px;
    z-index: 10000;
    padding: 10px 16px;
    background: var(--brand-700);
    color: #fff;
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    text-decoration: none;
}

.skip-link:focus { top: 0; outline: 3px solid #fff; outline-offset: -3px; }
#contenu:focus { outline: none; }

/* ============================================================
   BOUTONS DE CARTE — « En savoir plus » et appels à l'action des cartes
   Un seul style pour tout le site : pastille violette claire avec flèche,
   qui se remplit au survol de la carte entière.
   ============================================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.card-cta,
a.info-card-link,
a.programme-link,
a.partenaire-card-link,
.duo-card-more,
.pillar-link {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    align-self: flex-start;
    margin-top: 18px;
    padding: 9px 16px;
    border: 0;
    border-radius: 8px;
    background: var(--brand-50);
    color: var(--brand-700);
    font-size: 14px;
    font-weight: 700;
    line-height: 1.2;
    text-decoration: none;
    transition: background 0.15s, color 0.15s, box-shadow 0.15s;
}

.card-cta svg,
a.info-card-link svg,
a.programme-link svg,
.duo-card-more svg,
.pillar-link svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    transition: transform 0.15s;
}

.card-cta:hover,
.card-cta:focus-visible,
a.info-card-link:hover,
a.programme-link:hover,
a.partenaire-card-link:hover,
.duo-card--link:hover .duo-card-more,
.pillar-card:hover .pillar-link {
    background: var(--brand-500);
    color: #fff;
    text-decoration: none;
    box-shadow: 0 6px 16px rgba(106, 44, 116, 0.28);
}

.card-cta:hover svg,
a.programme-link:hover svg { transform: translateX(3px); }

.card-cta:focus-visible,
a.info-card-link:focus-visible,
a.programme-link:focus-visible,
a.partenaire-card-link:focus-visible { outline: 3px solid var(--brand-500); outline-offset: 3px; }

/* La carte se remplit quand on survole sa carte (bouton plein = action principale) */
.programme-card:hover .card-cta,
.duo-card:hover .card-cta,
.info-card:hover .card-cta,
.categorie-card:hover .card-cta,
.approach-card:hover .card-cta,
.objectif-item:hover .card-cta {
    background: var(--brand-500);
    color: #fff;
}

/* Cartes à bouton : le bouton reste en bas, quelle que soit la longueur du texte */
.programme-card:has(.card-cta),
.duo-card:has(.card-cta),
.info-card:has(> .card-cta),
.categorie-card:has(.card-cta),
.approach-card:has(.card-cta),
.objectif-item:has(.card-cta) {
    display: flex;
    flex-direction: column;
}

.programme-card:has(.card-cta) .card-cta,
.duo-card:has(.card-cta) .card-cta,
.categorie-card:has(.card-cta) .card-cta,
.approach-card:has(.card-cta) .card-cta,
.objectif-item:has(.card-cta) .card-cta,
.info-card > .card-cta { margin-top: auto; }

.programme-card:has(.card-cta) > p,
.duo-card:has(.card-cta) > p,
.categorie-card:has(.card-cta) > p,
.approach-card:has(.card-cta) > p,
.objectif-item:has(.card-cta) > p { margin-bottom: 18px; }

@media (prefers-reduced-motion: reduce) {
    .card-cta, .card-cta svg,
    a.info-card-link, a.programme-link, a.partenaire-card-link,
    .duo-card-more, .pillar-link { transition: none; }
    .card-cta:hover svg, a.programme-link:hover svg { transform: none; }
}
