body {
    margin: 0;
    font-family: 'Montserrat', Arial, sans-serif;
    background: #fff;
    color: #222;
}
/* ensure padding doesn't break width calculations */
*, *::before, *::after { box-sizing: border-box; }
header {
    background: #111;
    color: #fff;
    text-align: center;
    padding: 1.2rem 1rem 1rem 1rem;
}
h1 {
    font-size: 2.2rem;
    font-weight: 900;
    margin-top: 0;
    margin-bottom: 0.8rem;
    letter-spacing: 1px;
}
.intro.under-title { max-width: 720px; margin: -0.5rem auto 1rem; color:#e8e8e8; }
.intro.under-title b, .intro.under-title strong { color:#fff; }
.intro.under-title i, .intro.under-title em { opacity: .95; }
.dual-btn {
    display: inline-flex;
    align-items: stretch;
    background: #d32f2f;
    border-radius: 30px;
    overflow: hidden;
    margin-bottom: 0.7rem;
    margin-left: 0.25rem;
    margin-right: 0.25rem;
    position: relative;
}
.dual-btn .segment {
    border: none;
    background: transparent;
    color: #fff;
    font: inherit;
    font-weight: bold;
    padding: 0.7rem 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 0.4rem;
    text-decoration: none;
    position: relative;
}
.dual-btn .segment.main { padding-right: 0.75rem; }
.dual-btn .segment.qr-trigger {
    padding: 0.7rem 0.9rem;
    background: transparent; /* même rouge que le parent */
    border-left: 1px solid rgba(255,255,255,0.28);
}
.dual-btn .segment.qr-trigger:hover,
.dual-btn .segment.qr-trigger:focus { background: rgba(255,255,255,0.22); }
.dual-btn a.segment:hover,
.dual-btn a.segment:focus { background: #b71c1c; }
.dual-btn img { width: 22px; height: 22px; display: block; }
.dual-btn .qr-trigger img { color:#fff; }
.ext-icon { display:inline-flex; vertical-align:middle; margin-left:0.15rem; opacity:.9; line-height:0; }
.ext-icon svg { width:19px; height:19px; }
.segment.main:hover .ext-icon, .segment.main:focus .ext-icon { opacity:1; }

.dual-btn:focus-within { outline: 1px solid rgba(255,255,255,.6); outline-offset: 2px; }

/* Modal QR */
.qr-modal { position: fixed; inset:0; display:none; align-items:center; justify-content:center; z-index:1000; padding: 1rem; overflow: auto; }
.qr-modal-backdrop { position:absolute; inset:0; background:rgba(0,0,0,0.55); backdrop-filter: blur(2px); }
.qr-modal-content { position:relative; background:#fff; padding:1.2rem 1.2rem 1.6rem; border-radius:16px; max-width:320px; width:90%; text-align:center; box-shadow:0 10px 40px -5px rgba(0,0,0,0.3); animation:pop 0.25s ease; max-height: calc(100vh - 2rem); overflow: auto; -webkit-overflow-scrolling: touch; }
.qr-modal-content img { max-width:100%; height:auto; border-radius:8px; border:3px solid #d32f2f; }

/* iOS install modal image: keep reasonably sized on small screens */
.ios-install-img { max-width: 100%; height: auto; max-height: 55vh; display:block; margin: 0.4rem auto 0; }
.qr-hint { font-size:0.85rem; color:#444; margin-top:0.6rem; }
.close-btn { position:absolute; top:6px; right:8px; background:#d32f2f; color:#fff; border:none; width:34px; height:34px; border-radius:50%; font-size:1.3rem; line-height:1; cursor:pointer; box-shadow:0 2px 6px rgba(0,0,0,0.25); }
.close-btn:hover { background:#b71c1c; }
@keyframes pop { from { transform:translateY(10px) scale(.96); opacity:0; } to { transform:translateY(0) scale(1); opacity:1; } }

body.no-scroll { overflow:hidden; }
.download-btn {
    display: inline-block;
    background: #d32f2f;
    color: #fff;
    padding: 0.7rem 1.5rem;
    border-radius: 30px;
    border: none;                 /* remove default button border */
    appearance: none;             /* reset default styles */
    -webkit-appearance: none;     /* Safari/iOS */
    box-shadow: none;             /* remove inset borders on some UAs */
    text-decoration: none;
    font-weight: bold;
    margin-bottom: 0.7rem;
    transition: background 0.2s;
}
.download-btn:hover {
    background: #b71c1c;
}
.download-btn:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
/* Disabled state for action buttons */
.download-btn:disabled,
.download-btn[aria-busy="true"] {
    background: #9e9e9e;
    cursor: not-allowed;
    opacity: 0.85;
}
.contact {
    font-size: 1rem;
    margin-top: 0.5rem;
}
main {
    max-width: 600px;
    margin: 2rem auto;
    padding: 0 1rem;
    position: relative;
}
.site-nav { display:flex; gap:0.8rem; justify-content:center; margin:0.6rem 0 2rem; }
.site-nav a { text-decoration:none; color:#d32f2f; font-weight:700; padding:0.4rem 0.6rem; border-radius:6px; }
.site-nav a:hover { background:#f3f3f3; }
/* keep the same background on the active/current page link */
.site-nav a[aria-current="page"],
.site-nav a.active { background:#f3f3f3; }
.intro { color:#333; margin-bottom: 2rem; }
/* Cards */
.card-grid { display:grid; grid-template-columns: repeat(auto-fit,minmax(240px,1fr)); gap:16px; }
.card-item { background:#fff; border:1px solid #eee; border-radius:10px; padding:12px; box-shadow:0 2px 10px rgba(0,0,0,0.04); transition: box-shadow .15s ease, transform .15s ease; }
.card-item:hover { box-shadow:0 6px 18px rgba(0,0,0,0.08); transform: translateY(-1px); }
.card-item h3 { margin:0 0 6px; font-size:1.05rem; }
.card-item h3 a { color: inherit; text-decoration: none; }
.muted-sm { color:#666; font-size:0.9rem; }
.chip { display:inline-block; padding:2px 8px; border-radius:999px; background:#f1f1f1; font-size:0.85rem; margin-right:6px; }
.thumb-grid { display:grid; grid-template-columns: repeat(auto-fill,minmax(140px,1fr)); gap:10px; }
.thumb { position:relative; overflow:hidden; border-radius:8px; }
.thumb img { width:100%; height:140px; object-fit:cover; display:block; transition: transform .2s ease; }
.thumb:hover img { transform: scale(1.03); }
/* Ligne verticale de chronologie */
main::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 50%;
    width: 2px;
    background: linear-gradient(#e2e2e2, #d5d5d5);
    transform: translateX(-50%);
    z-index: 0; /* keep the line behind event content */
}
/* allow pages to opt-out of the timeline line */
.no-timeline main::before,
main.no-timeline::before {
    display: none;
}

/* Bloc évènement en mode timeline desktop */
.event {
    position: relative;
    display: flex;
    gap: 0;
    margin: 0 0 2.3rem;
    padding: 0; /* on gère dans les sous-blocs */
    background: transparent;
    border: none;
    box-shadow: none;
    z-index: 1; /* above the timeline line */
}
.event:last-of-type { margin-bottom: 0; }

/* Pastille sur la ligne */
.event::before {
    content: "";
    position: absolute;
    left: 50%;
    top: 1.25rem; /* aligné avec le début du texte date */
    width: 16px;
    height: 16px;
    background: #fff;
    border: 4px solid #d32f2f;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 0 3px #fff; /* halo pour détacher si contenu passe dessous */
}
/* Past events: avoid global opacity so the dot stays opaque (no bleed-through) */
.event.past { opacity: 1; }
.event.past .date { color: #a6a6a6; }
.event.past .date .location { color: #8a8a8a; }
.event.past .details { color: #6f6f6f; }
.event.past::before { border-color: #bdbdbd; background: #fff; box-shadow: 0 0 0 3px #fff; }

.date, .details {
    width: 50%;
    box-sizing: border-box;
    font-size: 1rem;
    line-height: 1.45;
}
.date {
    text-align: right;
    padding: 0.7rem 1.6rem 0.9rem 0.6rem;
    font-weight: bold;
    color: #d32f2f;
    font-size: 1.05rem;
}
.details {
    padding: 0.7rem 0.6rem 0.9rem 1.6rem;
}
.details strong:first-child { display: inline-block; margin-bottom: 0.3rem; }

/* Event location separate from date: subtle styling */
.details .location {
    color: #666;
    font-size: 0.95rem;
    margin: 0.1rem 0 0.35rem;
}

/* Location displayed under the date on the left column */
.date .location {
    display: block;
    color: #222; /* neutral text color to avoid clashing with red */
    font-weight: 500;
    font-style: italic;
    font-size: 0.95rem;
    margin-top: 0.25rem;
}

.sub {
    font-size: 0.95rem;
    color: #555;
    font-style: italic;
}
footer {
    background: #111;
    color: #fff;
    text-align: center;
    padding: 1rem;
    font-size: 0.95rem;
    margin-top: 2rem;
}
@media (max-width: 600px) {
    h1 {
        font-size: 1.3rem;
    }
    main {
        padding: 0 0.3rem;
    }
    /* Timeline mobile : on repasse en pile classique avec ligne à gauche */
    main::before {
        left: 26px;
        transform: none;
    }
    .event {
        display: block;
        background: #f5f5f5;
        padding: 0.85rem 0.9rem 0.95rem 2.9rem;
        margin: 0 0 1.3rem;
        border-left: none;
        box-shadow: 0 2px 8px rgba(0,0,0,0.04);
        border-radius: 6px;
    }
        .event::before {
            left: 26px;
            top: 1.2rem;
            width: 14px;
            height: 14px;
            border-width: 4px;
            /* Add a halo matching card background to hide the timeline line behind on mobile */
            box-shadow: 0 0 0 6px #f5f5f5;
            background: #fff;
        }
    /* Ensure past state keeps the same halo and muted border on mobile */
    .event.past::before { border-color: #bdbdbd; background:#fff; box-shadow: 0 0 0 6px #f5f5f5; }
    .date, .details { width: 100%; padding: 0; text-align: left; }
    .date { margin: 0 0 0.35rem; font-size: 1.05rem; }
    .details { padding: 0; }
    .download-btn {
        padding: 0.5rem 1rem;
        font-size: 0.95rem;
    }
    .dual-btn .segment { padding:0.55rem 0.9rem; font-size:0.9rem; }
    .dual-btn .segment.qr-trigger { padding:0.55rem 0.7rem; }
    /* Admin forms spacing */
    .admin-wrap .row { gap: 0.6rem; }
    .admin-wrap .row > * { min-width: 100%; }
}
