@import url('https://fonts.googleapis.com/css2?family=Lexend:wght@500;600;700&family=Source+Sans+3:wght@400;500;600;700&display=swap');

:root {
    --lions-blue: #00338d;
    --lions-blue-dark: #00205b;
    --lions-blue-tint: #eef2fb;
    --lions-gold: #fdb913;
    --lions-gold-dark: #cf9200;
    --text: #16213a;
    --text-light: #5b6577;
    --border: #dde2ea;
    --bg: #f4f6fa;
    --white: #ffffff;
    --radius: 16px;
    --radius-sm: 10px;
    --shadow: 0 2px 10px rgba(16, 33, 66, 0.07);
    --shadow-md: 0 8px 24px rgba(16, 33, 66, 0.14);
    --safe-top: env(safe-area-inset-top, 0px);
    --safe-bottom: env(safe-area-inset-bottom, 0px);
    --error-bg: #fdeceb;
    --error-border: #f6c9c5;
    --error-text: #a3241c;
    --lions-blue-text: var(--lions-blue);
    --card-border: transparent;
    --space-1: 4px;
    --space-2: 8px;
    --space-3: 12px;
    --space-4: 16px;
    --space-5: 24px;
    color-scheme: light;
}

/* Firefox Android annonce une marge de sécurité basse égale à la barre de
   navigation Android, alors que la page ne s'affiche pas dessous : la barre
   d'onglets se retrouvait décollée du bas. On l'ignore donc sur Firefox. */
@supports (-moz-appearance: none) {
    :root { --safe-bottom: 0px; }
}

/* Mode sombre : suit le thème du téléphone, pas de bouton dédié. */
@media (prefers-color-scheme: dark) {
    :root {
        --lions-blue-tint: #182849;
        --lions-blue-text: #7ba7ff;
        --text: #eef1f7;
        --text-light: #98a4bc;
        --border: #2a3550;
        --bg: #0e1320;
        --white: #1a2338;
        --shadow: 0 2px 10px rgba(0, 0, 0, 0.4);
        --shadow-md: 0 8px 24px rgba(0, 0, 0, 0.5);
        --error-bg: #3a1a17;
        --error-border: #5c2924;
        --error-text: #f3a89f;
        --card-border: #253150;
        color-scheme: dark;
    }
    .skeleton-media, .skeleton-line {
        background: linear-gradient(90deg, #202c47 25%, #2a3856 37%, #202c47 63%);
        background-size: 400% 100%;
    }
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html, body {
    margin: 0;
    height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: "Source Sans 3", "Segoe UI", Arial, sans-serif;
    overscroll-behavior-y: contain;
}

h1, h2, h3, .brand { font-family: "Lexend", "Source Sans 3", "Segoe UI", Arial, sans-serif; font-weight: 600; letter-spacing: -0.01em; }

/* Les boutons n'héritent pas de la police par défaut (Arial sinon). */
button, input, select, textarea { font-family: inherit; }
button { touch-action: manipulation; }

/* Focus clavier visible partout, discret au toucher. */
:focus-visible { outline: 2px solid var(--lions-gold); outline-offset: 2px; border-radius: 6px; }
button:focus:not(:focus-visible) { outline: none; }

#app-header {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 27;
    background: linear-gradient(135deg, var(--lions-blue-dark) 0%, var(--lions-blue) 100%);
    color: #fff;
    padding: calc(14px + var(--safe-top)) 18px 14px;
    display: flex;
    align-items: center;
    gap: 12px;
    border-bottom: 3px solid var(--lions-gold);
}
#app-header img { width: 38px; height: 38px; border-radius: 50%; background: #fff; padding: 3px; flex-shrink: 0; }
#app-header .brand { font-size: 1.05rem; margin: 0; }
#app-header .subtitle { font-size: 0.78rem; color: #cfe0ff; margin: 2px 0 0; }

.app-footer {
    text-align: center;
    padding: 28px 16px calc(16px + var(--safe-bottom));
    color: var(--text-light);
    font-size: 0.82rem;
}
.app-footer p { margin: 4px 0; }
.app-footer a { color: var(--lions-blue-text); text-decoration: none; }
.app-footer a:hover { text-decoration: underline; }
.app-footer-link-btn {
    background: none; border: none; padding: 0;
    color: var(--lions-blue-text); font-family: inherit; font-size: inherit;
    cursor: pointer; text-decoration: none;
}
.app-footer-link-btn:hover { text-decoration: underline; }

/* --- Superposition "Proposer un événement" (reste dans l'appli) --- */
.add-overlay {
    position: fixed;
    top: calc(74px + var(--safe-top)); left: 0; right: 0; bottom: 0;
    z-index: 25;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    transform: translateY(100%);
    transition: transform 260ms cubic-bezier(0.22,1,0.36,1);
}
/* Toujours au-dessus des autres superpositions : peut s'ouvrir par-dessus
   (ex. un article d'actu ouvert depuis la liste des actualités). */
#page-overlay, #article-overlay { z-index: 26; }
.add-overlay.is-open { transform: translateY(0); }
.add-overlay[hidden] { display: none; }
#page-overlay-iframe { flex: 1; width: 100%; border: none; }

/* --- Formulaire natif "Proposer un événement" --- */
.add-form-wrap {
    flex: 1;
    overflow-y: auto;
    padding: 18px 18px calc(90px + var(--safe-bottom));
}
.add-form-loading, .add-form-message {
    text-align: center;
    color: var(--text-light);
    padding: 60px 20px;
    line-height: 1.5;
}
.add-form-intro h2 { margin: 0 0 6px; font-size: 1.15rem; color: var(--lions-blue-text); }
.add-form-intro p { color: var(--text-light); margin: 0 0 18px; font-size: 0.9rem; }
.add-form-error {
    background: var(--error-bg);
    color: var(--error-text);
    border: 1px solid var(--error-border);
    border-radius: var(--radius-sm);
    padding: 12px 14px;
    margin-bottom: 16px;
    font-size: 0.88rem;
}
.add-form-error p { margin: 0 0 4px; }
.add-form-error p:last-child { margin-bottom: 0; }
.honeypot { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.add-form-wrap .field { margin-bottom: 16px; }
.add-form-wrap label { display: block; font-weight: 600; font-size: 0.88rem; margin-bottom: 6px; color: var(--text); }
.add-form-wrap .required { color: var(--lions-blue-text); }
.add-form-wrap .step-optional { font-weight: 400; color: var(--text-light); font-size: 0.8rem; }
.add-form-wrap input[type="text"],
.add-form-wrap input[type="email"],
.add-form-wrap input[type="date"],
.add-form-wrap input[type="time"],
.add-form-wrap select,
.add-form-wrap textarea {
    width: 100%;
    font-family: inherit;
    font-size: 0.95rem;
    color: var(--text);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    padding: 11px 13px;
    outline: none;
}
.add-form-wrap input:focus, .add-form-wrap select:focus, .add-form-wrap textarea:focus {
    border-color: var(--lions-blue-text);
}
.add-form-wrap textarea { min-height: 90px; resize: vertical; }
.add-form-wrap select {
    appearance: none;
    background-image: url("data:image/svg+xml;charset=UTF-8,%3csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%235b6577' stroke-width='2'%3e%3cpath d='M6 9l6 6 6-6'/%3e%3c/svg%3e");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 16px;
    padding-right: 36px;
}
.add-form-wrap .row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.add-form-wrap .checkbox-line { display: flex; align-items: center; gap: 8px; }
.add-form-wrap .checkbox-line input { width: 18px; height: 18px; accent-color: var(--lions-blue-text); flex-shrink: 0; }
.add-form-wrap .checkbox-line label { margin: 0; font-weight: 400; }
.add-form-wrap .helper-text { font-size: 0.78rem; color: var(--text-light); margin: 4px 0 0; }

.add-form-wrap .file-upload { position: relative; border: 2px dashed var(--border); border-radius: var(--radius-sm); padding: 20px; text-align: center; }
.add-form-wrap .file-upload.has-file { border-style: solid; border-color: var(--lions-blue-text); }
.add-form-wrap .file-upload input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.add-form-wrap .file-upload-label { display: flex; flex-direction: column; align-items: center; gap: 8px; color: var(--lions-blue-text); cursor: pointer; }
.add-form-wrap .file-upload-label span { color: var(--text-light); font-size: 0.85rem; }
.add-form-wrap .photo-preview { display: block; max-width: 100%; max-height: 180px; margin: 12px auto 0; border-radius: var(--radius-sm); }

.btn-block {
    width: 100%;
    background: linear-gradient(135deg, var(--lions-blue) 0%, #0043b8 100%);
    color: #fff;
    border: none;
    padding: 14px 20px;
    border-radius: var(--radius-sm);
    font-family: "Lexend", "Source Sans 3", Arial, sans-serif;
    font-weight: 600;
    font-size: 0.98rem;
    cursor: pointer;
    margin-top: 6px;
}
.btn-block:disabled { opacity: 0.65; cursor: not-allowed; }

.add-form-success { text-align: center; padding: 40px 10px; }
.add-form-success svg { color: #1c8a4c; margin-bottom: 12px; }
.add-form-success h2 { margin: 0 0 8px; color: var(--lions-blue-text); }
.add-form-success p { color: var(--text-light); margin: 0 0 24px; }

/* --- Actualités du district --- */
.news-quicklinks {
    display: flex;
    gap: 8px;
    margin-bottom: 18px;
    overflow-x: auto;
    scrollbar-width: none;
}
.news-quicklinks::-webkit-scrollbar { display: none; }
.news-quicklink {
    flex: 0 0 auto;
    background: var(--white);
    color: var(--text-light);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 9px 15px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.82rem;
    cursor: pointer;
    white-space: nowrap;
}
.news-card { cursor: pointer; }
.news-card .event-card-meta { color: var(--text-light); -webkit-line-clamp: 3; display: -webkit-box; -webkit-box-orient: vertical; overflow: hidden; }

/* --- Article natif (lu dans l'appli, sans le design du site externe) --- */
.article-hero {
    aspect-ratio: 16 / 9;
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    background: var(--lions-blue-tint);
}
.article-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.article-date { color: var(--lions-blue-text); font-weight: 700; font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 6px; }
.article-title { font-size: 1.3rem; color: var(--text); margin: 0 0 16px; line-height: 1.3; }
.article-content { color: var(--text); font-size: 0.98rem; line-height: 1.65; }
.article-content p { margin: 0 0 16px; }
.article-content h2, .article-content h3, .article-content h4 { color: var(--lions-blue-text); margin: 22px 0 10px; }
.article-content ul, .article-content ol { margin: 0 0 16px; padding-left: 22px; }
.article-content li { margin-bottom: 6px; }
.article-content a { color: var(--lions-blue-text); }
.article-content img { max-width: 100%; border-radius: var(--radius-sm); margin: 8px 0 16px; }
.article-content blockquote { margin: 0 0 16px; padding-left: 14px; border-left: 3px solid var(--lions-blue-tint); color: var(--text-light); }
.article-source-link { margin-top: 8px; }

/* --- Accueil : tableau de bord --- */
.home-section { margin-bottom: var(--space-5); }
.home-section-head {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: var(--space-1);
}
.home-section-head h2 { margin: 0; font-size: 1.08rem; color: var(--text); }
.home-link {
    display: inline-flex; align-items: center; gap: 2px;
    min-height: 44px; margin-right: -8px;
    background: none; border: none; padding: 0 8px;
    color: var(--lions-blue-text); font-family: inherit; font-weight: 600; font-size: 0.85rem;
    cursor: pointer; white-space: nowrap; border-radius: 8px;
}
.home-link::after { content: "\203A"; font-size: 1.2rem; line-height: 1; margin-top: -2px; }
.home-item {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    padding: var(--space-2);
    margin-bottom: var(--space-2);
    cursor: pointer;
    transition: transform 120ms ease, background-color 120ms ease;
}
.home-item:active { transform: scale(0.98); background: var(--lions-blue-tint); }
.home-thumb {
    width: 64px; height: 64px;
    flex-shrink: 0;
    border-radius: 10px;
    overflow: hidden;
    background: var(--lions-blue-tint);
}
.home-thumb > img { width: 100%; height: 100%; object-fit: cover; display: block; }
.home-thumb-generic {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--lions-blue-dark) 0%, var(--lions-blue) 100%);
}
.home-thumb-generic img { width: 34px; height: 34px; border-radius: 50%; background: #fff; padding: 3px; }
.home-item-body { min-width: 0; flex: 1; }
.home-item-label { color: var(--lions-blue-text); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.home-item-title { font-weight: 600; font-size: 0.95rem; line-height: 1.3; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.home-item-meta { color: var(--text-light); font-size: 0.8rem; margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.home-loading { color: var(--text-light); font-size: 0.88rem; padding: var(--space-3) var(--space-1); }
.home-cta { margin-top: 4px; }

/* Page Cabinet : fiches structurées par section (Gouvernance, bureau...). */
.is-directory { text-align: center; }
.is-directory .article-source-link { margin-left: auto; margin-right: auto; }
.cabinet-section {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lions-blue-text);
    margin: var(--space-5) 0 var(--space-2);
}
.cabinet-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 10px;
}
.cabinet-person {
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    padding: 14px 10px;
}
.cabinet-person img {
    width: 72px; height: 72px;
    object-fit: cover;
    border-radius: 50%;
    display: block;
    margin: 0 auto 8px;
}
.cabinet-role { color: var(--lions-blue-text); font-size: 0.74rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.cabinet-name { font-weight: 600; font-size: 0.92rem; margin-top: 2px; }
.cabinet-club { color: var(--text-light); font-size: 0.8rem; margin-top: 2px; }
.cabinet-extra { font-size: 0.82rem; color: var(--text-light); margin-top: 6px; }
.cabinet-extra h4 { font-size: 0.85rem; margin: 0 0 6px; color: var(--text); font-style: italic; }
.cabinet-extra p { margin: 0; }
/* Le gouverneur : fiche pleine largeur, mise en avant. */
.cabinet-grid:first-of-type .cabinet-person:first-child { grid-column: 1 / -1; padding: 18px 14px; }
.cabinet-grid:first-of-type .cabinet-person:first-child img { width: 96px; height: 96px; }
.cabinet-grid:first-of-type .cabinet-person:first-child .cabinet-name { font-size: 1.05rem; }

/* --- Clubs du district --- */
.clubs-search { margin-bottom: 16px; }
.clubs-zone {
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    color: var(--lions-blue-text);
    margin: var(--space-5) 0 var(--space-2);
}
.clubs-group {
    background: var(--white);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    overflow: hidden;
}
.club-row { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3) 14px; border-bottom: 1px solid var(--border); }
.club-row-body { flex: 1; min-width: 0; }
.club-row:last-child { border-bottom: none; }
.club-name { font-weight: 600; font-size: 0.93rem; }
.club-leo-badge {
    flex-shrink: 0;
    padding: 3px 9px;
    border-radius: 999px;
    background: var(--lions-gold);
    color: var(--lions-blue-dark);
    font-size: 0.68rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.club-president { color: var(--text-light); font-size: 0.83rem; margin-top: 2px; }

/* Footer "site classique" (identique à celui de index.php), écrans larges uniquement */
.site-footer {
    display: none;
    position: relative;
    background: var(--lions-blue-dark);
    color: #c9d6f0;
    padding: 40px 0 0;
    font-size: 0.88rem;
}
.site-footer::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--lions-gold) 0%, #ffe08a 50%, var(--lions-gold) 100%);
}
.site-footer a { color: #cfe0ff; text-decoration: none; transition: color 150ms ease; }
.site-footer a:hover { color: var(--lions-gold); }
.site-footer .wrap { max-width: 860px; margin: 0 auto; padding: 0 20px; }
.site-footer-grid { display: grid; grid-template-columns: 1.3fr 1fr 1fr; gap: 28px; padding-bottom: 28px; }
.site-footer-col { display: flex; flex-direction: column; gap: 8px; }
.site-footer-col h3 { color: var(--white); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.06em; margin: 0 0 4px; }
.site-footer-col p { margin: 0; line-height: 1.5; }
.site-footer-logo { width: 46px; height: 46px; object-fit: contain; background: var(--white); border-radius: 50%; padding: 6px; margin-bottom: 6px; }
.site-footer-bottom { border-top: 1px solid rgba(255,255,255,0.12); padding: 16px 0; text-align: center; font-size: 0.8rem; color: #a9c1ec; }
.site-footer-bottom p { margin: 0; }

main { padding: calc(90px + var(--safe-top)) 16px calc(84px + var(--safe-bottom)); max-width: 640px; margin: 0 auto; }

/* Mobile : la page elle-même ne défile jamais, seul <main> défile. Sans ça,
   Firefox mobile (et Chrome) masque/réaffiche sa barre d'adresse au gré du
   défilement et du changement d'onglet, ce qui fait sauter la barre du bas. */
@media (max-width: 859px) {
    html, body { overflow: hidden; }
    main {
        position: fixed;
        top: 0; bottom: 0; left: 0; right: 0;
        overflow-y: auto;
        overscroll-behavior-y: contain;
        -webkit-overflow-scrolling: touch;
    }
}

/* --- Navigation basse (façon appli native) --- */
.bottom-nav {
    position: fixed;
    left: 0; right: 0; bottom: 0;
    z-index: 27;
    display: flex;
    background: var(--white);
    border-top: 1px solid var(--border);
    box-shadow: 0 -4px 16px rgba(16, 33, 66, 0.08);
    padding-bottom: var(--safe-bottom);
}
.bottom-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-width: 0;
    gap: 3px;
    padding: 6px 2px 7px;
    background: none;
    border: none;
    text-decoration: none;
    color: var(--text-light);
    font-family: inherit;
    font-size: 0.64rem;
    white-space: nowrap;
    font-weight: 600;
    cursor: pointer;
    transition: color 150ms ease;
}
.bottom-nav-item svg {
    box-sizing: content-box;
    padding: 3px 16px;
    border-radius: 999px;
    transition: transform 150ms ease, background-color 200ms ease;
}
.bottom-nav-item.is-active { color: var(--lions-blue-text); }
.bottom-nav-item.is-active svg { background: var(--lions-blue-tint); }
.bottom-nav-item span { display: block; height: 13px; line-height: 13px; }
.bottom-nav-item svg { flex-shrink: 0; }
.bottom-nav-item:active svg { transform: scale(0.9); }
.bottom-nav-add { color: var(--lions-gold-dark); }

/* --- Recherche --- */
.search-wrap { position: relative; margin-bottom: 14px; }
.search-bar {
    display: flex;
    align-items: center;
    gap: 10px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 11px 16px;
    box-shadow: var(--shadow);
}
.search-bar svg { flex-shrink: 0; color: var(--text-light); }
.search-bar input {
    border: none;
    outline: none;
    flex: 1;
    font-size: 0.95rem;
    font-family: inherit;
    color: inherit;
    background: transparent;
}
.search-bar input::placeholder { color: var(--text-light); }

.search-suggestions {
    position: absolute;
    left: 0; right: 0; top: calc(100% + 6px);
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
    overflow: hidden;
    z-index: 5;
}
.search-suggestions[hidden] { display: none; }
.suggestion-item {
    display: block;
    width: 100%;
    text-align: left;
    padding: 11px 16px;
    background: none;
    border: none;
    border-bottom: 1px solid var(--border);
    font-size: 0.9rem;
    font-family: inherit;
    color: var(--text);
    cursor: pointer;
}
.suggestion-item:last-child { border-bottom: none; }
.suggestion-item:hover, .suggestion-item:active { background: var(--lions-blue-tint); color: var(--lions-blue-text); }

.status-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--white);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 14px 16px;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
    font-size: 0.9rem;
}
.status-banner[hidden] {
    display: none;
}
.status-banner svg { flex-shrink: 0; color: var(--lions-blue-text); }
.status-banner button {
    margin-left: auto;
    background: var(--lions-gold);
    color: var(--lions-blue-dark);
    border: none;
    padding: 9px 16px;
    border-radius: 8px;
    font-weight: 600;
    font-size: 0.85rem;
    cursor: pointer;
    white-space: nowrap;
}

/* --- Filtres --- */

.location-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 10px;
    margin-bottom: 14px;
}
.location-row[hidden] { display: none; }
.location-label {
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 0.8rem;
    color: var(--text-light);
    flex-shrink: 0;
}
.location-label svg { flex-shrink: 0; color: var(--lions-blue-text); }

.radius-bar {
    display: flex;
    gap: var(--space-2);
    overflow-x: auto;
    scrollbar-width: none;
}
#agenda-subnav { margin-bottom: 14px; }
#agenda-subnav[hidden] { display: none; }
.radius-bar::-webkit-scrollbar { display: none; }
.radius-chip {
    flex-shrink: 0;
    min-height: 36px;
    padding: 7px 14px;
    border-radius: 999px;
    border: 1px solid var(--border);
    background: var(--white);
    color: var(--text-light);
    font-size: 0.82rem;
    transition: background-color 150ms ease, color 150ms ease;
    font-weight: 600;
    cursor: pointer;
}
.radius-chip.is-active { background: var(--lions-gold); color: var(--lions-blue-dark); border-color: var(--lions-gold); }

/* --- Cartes événement --- */
.event-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: var(--space-4);
    box-shadow: var(--shadow);
    border: 1px solid var(--card-border);
    cursor: pointer;
    transition: transform 120ms ease, box-shadow 150ms ease;
}
.event-card:active { transform: scale(0.98); box-shadow: var(--shadow); }

.event-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    background: var(--lions-blue-tint);
}
.event-card-media img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Sans photo : bandeau compact plutôt qu'un grand bloc bleu vide. */
.event-card-media:has(> .no-photo) { aspect-ratio: auto; height: 96px; }
.event-card-media .no-photo {
    width: 100%; height: 100%;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--lions-blue-dark) 0%, var(--lions-blue) 55%, #0043b8 100%);
}
.event-card-media .no-photo img {
    width: 56px; height: 56px;
    object-fit: contain;
    border-radius: 50%;
    background: #fff;
    padding: 8px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
}

.event-date-badge {
    position: absolute;
    top: 10px; left: 10px;
    background: #ffffff;
    color: #00205b;
    border-radius: 10px;
    padding: 5px 9px 6px;
    text-align: center;
    font-family: "Lexend", "Source Sans 3", Arial, sans-serif;
    font-weight: 700;
    font-size: 1.05rem;
    line-height: 1;
    box-shadow: var(--shadow-md);
}
.event-date-badge small {
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    text-transform: uppercase;
    color: #00338d;
    margin-top: 2px;
}

.event-distance-badge {
    position: absolute;
    bottom: 10px; right: 10px;
    display: inline-flex; align-items: center; gap: 3px;
    background: rgba(16, 33, 66, 0.7);
    backdrop-filter: blur(4px);
    color: #fff;
    padding: 4px 10px; border-radius: 999px; font-weight: 600; font-size: 0.78rem;
}

.event-card-body { padding: 14px 16px 16px; }
.event-card-title { font-weight: 600; font-size: 1.02rem; margin: 2px 0 4px; line-height: 1.3; }
.event-card-club { color: var(--lions-blue-text); font-size: 0.78rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.02em; }
.event-card-meta { color: var(--text-light); font-size: 0.85rem; margin-top: 6px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }

/* --- Écrans de chargement (squelettes) --- */
.skeleton-card {
    background: var(--white);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 16px;
    box-shadow: var(--shadow);
}
.skeleton-media { aspect-ratio: 16 / 9; background: linear-gradient(90deg, #e8ecf3 25%, #f2f4f8 37%, #e8ecf3 63%); background-size: 400% 100%; animation: skeleton-shimmer 1.4s ease infinite; }
.skeleton-body { padding: 14px 16px 16px; }
.skeleton-line { height: 12px; border-radius: 6px; margin-bottom: 8px; background: linear-gradient(90deg, #e8ecf3 25%, #f2f4f8 37%, #e8ecf3 63%); background-size: 400% 100%; animation: skeleton-shimmer 1.4s ease infinite; }
.skeleton-line:last-child { margin-bottom: 0; }
@keyframes skeleton-shimmer {
    0% { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}
@media (prefers-reduced-motion: reduce) {
    .skeleton-media, .skeleton-line { animation: none; }
}

.empty-state { text-align: center; padding: 60px 20px; color: var(--text-light); line-height: 1.5; }

/* Changement d'onglet : court fondu du contenu. */
#home-view, #agenda-view, .add-overlay.is-open .add-form-wrap { animation: view-in 220ms ease both; }
@keyframes view-in { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
    #home-view, #agenda-view, .add-overlay.is-open .add-form-wrap { animation: none; }
    .add-overlay, #sheet { transition: none; }
}
.empty-state svg { color: var(--lions-blue-text); margin-bottom: 12px; }

/* Fiche détail (bottom sheet) */
#sheet-backdrop {
    position: fixed; inset: 0; background: rgba(16,33,66,0.5);
    display: none; z-index: 28;
}
#sheet-backdrop.is-open { display: block; }
#sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 29;
    background: var(--white);
    border-radius: 20px 20px 0 0;
    max-height: 85vh;
    overflow-y: auto;
    transform: translateY(100%);
    transition: transform 260ms cubic-bezier(0.22,1,0.36,1);
    padding: 18px 20px calc(24px + var(--safe-bottom));
}
#sheet.is-open { transform: translateY(0); }
#sheet img { width: 100%; max-height: 220px; object-fit: cover; border-radius: var(--radius-sm); margin-bottom: 14px; }
.sheet-no-photo {
    width: 100%; height: 160px;
    display: flex; align-items: center; justify-content: center;
    background: linear-gradient(135deg, var(--lions-blue-dark) 0%, var(--lions-blue) 55%, #0043b8 100%);
    border-radius: var(--radius-sm);
    margin-bottom: 14px;
}
#sheet .sheet-no-photo img {
    width: 84px; height: 84px;
    object-fit: contain;
    border-radius: 50%;
    background: var(--white);
    padding: 10px;
    box-shadow: 0 4px 14px rgba(0,0,0,0.2);
    margin-bottom: 0;
}
#sheet h2 { margin: 0 0 6px; font-size: 1.2rem; color: var(--lions-blue-text); }
#sheet .sheet-club { color: var(--lions-blue-text); font-weight: 700; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.02em; margin-bottom: 12px; }
#sheet .sheet-meta { display: flex; flex-direction: column; gap: 8px; font-size: 0.9rem; color: var(--text-light); margin-bottom: 14px; }
#sheet .sheet-meta span { display: flex; align-items: center; gap: 8px; }
#sheet .sheet-meta svg { color: var(--lions-blue-text); flex-shrink: 0; }
#sheet-close {
    position: absolute; top: 10px; right: 12px;
    width: 40px; height: 40px; border-radius: 50%;
    border: none; background: var(--bg); color: var(--text-light);
    display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.sheet-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-top: 6px;
}
.sheet-action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 48px;
    background: var(--lions-blue-tint);
    color: var(--lions-blue-text);
    text-decoration: none;
    border: none;
    padding: 11px 12px;
    border-radius: 12px;
    font-family: inherit;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 150ms ease, transform 150ms ease;
}
.sheet-action:active { transform: scale(0.97); }
.sheet-action-primary { background: var(--lions-blue); color: #fff; }
.sheet-action-primary:last-child { background: var(--lions-blue-dark); }

/* --- Toast (confirmation de copie de lien) --- */
.toast {
    position: fixed;
    left: 50%;
    bottom: calc(90px + var(--safe-bottom));
    transform: translateX(-50%) translateY(10px);
    background: var(--lions-blue-dark);
    color: #fff;
    padding: 12px 20px;
    border-radius: 999px;
    font-size: 0.88rem;
    font-weight: 600;
    box-shadow: var(--shadow-md);
    z-index: 30;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 200ms ease;
}
.toast.is-visible { opacity: 1; transform: translateX(-50%) translateY(0); }
.toast[hidden] { display: none; }

/* ==========================================================================
   Écrans larges (ordinateur) : site classique — nav en haut, grille de
   cartes, footer complet — plutôt qu'une mise en page pensée pour mobile.
   ========================================================================== */
@media (min-width: 860px) {
    main { max-width: 1200px; padding: calc(96px + var(--safe-top)) 32px calc(40px + var(--safe-bottom)); }

    #app-header { padding: 20px 32px; }
    .add-overlay { top: calc(96px + var(--safe-top)); }
    #app-header img { width: 46px; height: 46px; }
    #app-header .brand { font-size: 1.25rem; }
    #app-header .subtitle { font-size: 0.85rem; }

    .bottom-nav {
        position: fixed;
        top: calc(82px + var(--safe-top)); bottom: auto;
        justify-content: center;
        gap: 8px;
        padding: 12px 20px;
        box-shadow: none;
        border-top: none;
        border-bottom: 1px solid var(--border);
    }
    .bottom-nav-item {
        flex: 0 0 auto;
        flex-direction: row;
        gap: 8px;
        padding: 9px 18px;
        border-radius: 999px;
        font-size: 0.88rem;
    }
    .bottom-nav-item svg { width: 18px; height: 18px; }
    .bottom-nav-item svg, .bottom-nav-item.is-active svg { padding: 0; background: none; }
    .bottom-nav-item.is-active { background: var(--lions-blue-tint); }
    .bottom-nav-item.is-active svg { transform: none; }
    .bottom-nav-add { color: var(--white); background: var(--lions-gold); }
    .bottom-nav-add:hover { background: var(--lions-gold-dark); }

    .search-wrap { max-width: 480px; }

    #event-list {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
        gap: 22px;
        align-items: start;
    }
    .event-card { margin-bottom: 0; }
    .event-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
    .skeleton-card { margin-bottom: 0; }
    .empty-state { grid-column: 1 / -1; }

    .app-footer { display: none; }
    .site-footer { display: block; }

    .toast { bottom: 24px; }
}
