:root {
    --primary: #307194;
    --secondary: #73ACCB;
    --accent: #FFD668;
    --success: #30A566;
    --neutral-light: #D5EBF7;
    --neutral-dark: #A2CDE4;
    --white: #ffffff;
    --text-dark: #333333;
    --text-light: #666666;
}

/* Reset et base */
* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    margin: 0;
    padding: 16px 0;
    color: var(--text-dark);
    line-height: 1.6;
    font-size: 16px;
}

/* Mode "page dans une iframe" : on maximise la fiabilité du scroll mobile */
html, body {
    height: 100%;
}

body {
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
}

a, button {
    touch-action: manipulation;
}

/* Container pour iframe 1104px max */
.iframe-container {
    width: 100%;
    max-width: 1104px;
    margin: 0 auto;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e2e2e252;
}

.container {
    width: 100%;
    padding: 0 20px;
}

/* Hero avec gradient subtil */
.hero {
    background: linear-gradient(135deg, var(--white) 0%, var(--neutral-light) 100%);
    padding: 60px 0;
    text-align: center;
    border-bottom: 1px solid var(--neutral-light);
}

.hero h1 {
    font-size: 2.8rem;
    font-weight: 300;
    margin-bottom: 15px;
    color: var(--primary);
}

.hero-subtitle {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: var(--text-light);
    font-weight: 400;
}

.hero-description {
    font-size: 1.1rem;
    margin-bottom: 35px;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    color: var(--text-dark);
}

.btn {
    display: inline-block;
    padding: 14px 28px;
    text-decoration: none;
    border-radius: 6px;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s ease;
    margin: 0 8px;
    border: 2px solid transparent;
}

.btn-primary {
    background: var(--primary);
    color: var(--white);
    box-shadow: 0 4px 12px rgba(48, 113, 148, 0.3);
}

.btn-primary:hover {
    background: #255a73;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(48, 113, 148, 0.4);
}

.btn-secondary {
    background: var(--white);
    color: var(--primary);
    border-color: var(--primary);
}

.btn-secondary:hover {
    background: var(--primary);
    color: var(--white);
    transform: translateY(-2px);
}

/* Sections avec gradients */
.section {
    padding: 70px 0;
    position: relative;
}

.section:nth-child(even) {
    background: linear-gradient(135deg, var(--white) 0%, rgba(213, 235, 247, 0.3) 100%);
}

.section:nth-child(odd) {
    background: linear-gradient(135deg, rgba(255, 214, 104, 0.1) 0%, var(--white) 100%);
}

.section-title {
    font-size: 2.2rem;
    text-align: center;
    margin-bottom: 15px;
    font-weight: 300;
    color: var(--primary);
}

.section-subtitle {
    font-size: 1.1rem;
    text-align: center;
    margin-bottom: 50px;
    color: var(--text-light);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

/* Grid moderne */
.grid {
    display: grid;
    gap: 16px;
    margin-top: 40px;
}

.grid-1 { grid-template-columns: 1fr; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(400px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(250px, 1fr)); }

/* Carousel Agenda (si plusieurs événements) */
.agenda-carousel {
    position: relative;
    padding: 0 56px; /* réserve de la place pour les boutons */
    margin-top: 40px;
}

.agenda-carousel-viewport {
    overflow: hidden;
    border-radius: 12px;
    touch-action: pan-y;
}

.agenda-carousel-track {
    display: flex;
    transition: transform 280ms ease;
    will-change: transform;
}

.agenda-carousel-slide {
    flex: 0 0 100%;
}

.agenda-carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 48px;
    height: 48px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.12);
    background: rgba(255, 255, 255, 0.92);
    color: var(--text-dark);
    cursor: pointer;
    display: grid;
    place-items: center;
    font-size: 36px;
    font-weight: 500;
    line-height: 1;
    box-shadow: 0 8px 25px rgba(0,0,0,0.12);
    touch-action: manipulation;
    z-index: 2;
}

.agenda-carousel-btn:hover {
    background: rgba(255, 255, 255, 1);
}

.agenda-carousel-btn:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.agenda-carousel-btn.prev {
    left: 8px;
    padding: 0 0 6px 0;
}

.agenda-carousel-btn.next {
    right: 8px;
    padding: 0 0 6px 4px;
}

.agenda-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 14px;
}

.agenda-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 999px;
    border: 1px solid rgba(0, 0, 0, 0.2);
    background: rgba(0, 0, 0, 0.15);
    cursor: pointer;
    padding: 0;
    touch-action: manipulation;
}

.agenda-carousel-dot[aria-current="true"] {
    background: var(--primary);
    border-color: var(--primary);
}

/* Cards avec images */
.card {
    background: var(--white);
    border-radius: 12px;
    box-shadow: 0 8px 25px rgba(0,0,0,0.1);
    text-align: center;
    transition: all 0.3s ease;
    border: 1px solid rgba(162, 206, 228, 0.2);
    overflow: hidden;
    padding: 20px;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

a.card {
    display: block;
    text-decoration: none;
    color: inherit;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: 12px;
    margin: 5px 0 14px;
    object-fit: cover;
    display: block;
}

.card-with_illustration {
    padding: 0;
}

.card-with_illustration .card-content {
    padding: 0 25px 20px 25px;
}

.card-image {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
    border-radius: 12px 12px 0 0;
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 35px rgba(0,0,0,0.15);
}

.card h3 {
    margin-bottom: 15px;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.card p {
    color: var(--text-light);
    font-size: 1rem;
    line-height: 1.7;
}

.card-cta {
    border: 2px solid var(--primary);
    background: linear-gradient(135deg, var(--white) 0%, rgba(48, 113, 148, 0.05) 100%);
}

.card-cta h3 {
    color: var(--primary);
}

/* Event Cards */
.event-card {
    display: flex;
    flex-direction: column;
    background: var(--white);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 8px 0 rgba(0,0,0,0.1);
    transition: all 0.3s ease;
    border: 1px solid rgba(162, 206, 228, 0.2);
    min-height: 360px;
    max-height: 360px;
    position: relative;
}

.event-date {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 25px 20px;
    text-align: center;
    min-width: 90px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.day {
    font-size: 2rem;
    font-weight: 700;
    line-height: 1;
}

.month {
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-top: 5px;
}

.event-content {
    padding: 25px;
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

.event-content h3 {
    margin: 0;
    color: var(--primary);
    font-size: 1.3rem;
    font-weight: 600;
}

.event-info {
    margin: 6px 0;
    font-size: 0.95rem;
    color: var(--text-light);
    font-weight: 500;
}

.event-content p {
    color: var(--text-dark);
    line-height: 1.6;
}

.event-desc {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    overflow: hidden;
}

.event-more {
    margin-top: 8px;
    padding: 0;
    border: 0;
    background: transparent;
    color: var(--primary);
    font-weight: 600;
    text-decoration: underline;
    cursor: pointer;
    align-self: flex-start;
    touch-action: manipulation;
}

.event-more:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Post-it d'inscription (si buttonUrl est présent) */
.event-signup {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 3;
    display: inline-block;
    max-width: 48%;
    height: 84px;
    padding: 26px 12px;
    background: #FFD668;
    color: #2b2b2b;
    font-weight: 800;
    font-size: 0.95rem;
    line-height: 1.15;
    text-decoration: none;
    border-radius: 0;
    border: 1px solid rgba(0,0,0,0.10);
    box-shadow: 0 12px 26px rgba(0,0,0,0.18);
    transform: rotate(-7deg);
    transform-origin: 20% 20%;
    cursor: pointer;
    touch-action: manipulation;
}

.event-signup::before {
    content: '';
    position: absolute;
    top: -11px;
    left: 18px;
    width: 46px;
    height: 16px;
    background: rgba(255,255,255,0.55);
    border: 1px solid rgba(0,0,0,0.06);
    border-radius: 6px;
    box-shadow: 0 6px 14px rgba(0,0,0,0.10);
    transform: rotate(-2deg);
}

.event-signup:hover {
    transform: rotate(-7deg) translateY(-1px);
    box-shadow: 0 14px 30px rgba(0,0,0,0.22);
}

.event-signup:focus {
    outline: 2px solid var(--primary);
    outline-offset: 3px;
}

/* Modale Agenda */
.agenda-modal {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    padding: 20px;
    background: rgba(0, 0, 0, 0.55);
    align-items: center;
    justify-content: center;
}

.agenda-modal.is-open {
    display: flex;
}

.agenda-modal-dialog {
    width: min(720px, 100%);
    max-height: min(80vh, 720px);
    overflow: hidden;
    background: var(--white);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.35);
    border: 1px solid rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
}

.agenda-modal-header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 12px;
    padding: 18px 18px 10px 18px;
    border-bottom: 1px solid rgba(0,0,0,0.08);
}

.agenda-modal-title {
    margin: 0;
    color: var(--primary);
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.25;
}

.agenda-modal-close {
    border: 1px solid rgba(0,0,0,0.12);
    background: rgba(0,0,0,0.04);
    color: var(--text-dark);
    width: 36px;
    height: 36px;
    border-radius: 10px;
    cursor: pointer;
    flex: 0 0 auto;
    touch-action: manipulation;
}

.agenda-modal-body {
    padding: 16px 18px 18px 18px;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    color: var(--text-dark);
}

.agenda-modal-meta {
    color: var(--text-light);
    font-weight: 600;
    margin: 0 0 10px 0;
}

/* Highlight Box */
.highlight-box {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
    color: var(--white);
    padding: 50px 40px;
    border-radius: 12px;
    text-align: center;
    box-shadow: 0 8px 25px rgba(48, 113, 148, 0.3);
}

.highlight-box h3 {
    margin-bottom: 20px;
    font-size: 1.5rem;
    font-weight: 600;
}

.highlight-box p {
    font-size: 1.1rem;
    line-height: 1.7;
    opacity: 0.95;
}

.highlight-box ul {
  list-style: none;
}

/* Responsive pour iframe */
@media (max-width: 1104px) {
    .container {
    padding: 0 15px;
    }
}

@media (max-width: 768px) {
    .hero h1 {
    font-size: 2.2rem;
    }
    .hero-subtitle {
    font-size: 1.1rem;
    }
    .hero-description {
    font-size: 1rem;
    }
    .btn {
    display: block;
    margin: 8px 0;
    width: 100%;
    max-width: 300px;
    margin-left: auto;
    margin-right: auto;
    }
    .section {
    padding: 50px 0;
    }
    .section-title {
    font-size: 1.8rem;
    }
    .grid-2, .grid-3, .grid-4 {
    grid-template-columns: 1fr;
    gap: 20px;
    }
    .event-card {
    flex-direction: column;
    }

    .event-card {
    min-height: 360px;
    max-height: 360px;
    }

    .event-signup {
    right: 40px;
    }

    .event-date {
    min-width: auto;
    padding: 15px;
    }
    .card {
    padding: 25px 20px;
    }

    .event-signup {
    width: 80px;
    height: 76px;
    padding: 27px 4px;
    }

    .event-signup::before {
    left: 14px;
    }

    /* Sur mobile, boutons comme desktop : centrés verticalement sur la carte */
    .agenda-carousel {
    padding: 0;
    display: block;
    }

    .agenda-carousel-btn.prev {
    left: -14px;
    }

    .agenda-carousel-btn.next {
    right: -14px;
    }

    .agenda-carousel-btn {
    position: absolute;
    top: 60px;
    }

    .agenda-carousel-dots {
    margin-top: 10px;
    }

    /* Modale : en haut + scroll interne sur mobile */
    .agenda-modal {
    padding: 12px;
    align-items: flex-start;
    justify-content: center;
    overscroll-behavior: contain;
    }

    .agenda-modal-dialog {
    width: 100%;
    max-height: calc(100dvh - 24px);
    border-radius: 12px;
    }

    .agenda-modal-body {
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
    }
}

/* Accessibilité */
.btn:focus, .card:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

/* Animations subtiles */
@keyframes fadeInUp {
    from {
    opacity: 0;
    transform: translateY(30px);
    }
    to {
    opacity: 1;
    transform: translateY(0);
    }
}

.card, .highlight-box {
    animation: fadeInUp 0.6s ease-out;
}

/* Utilitaires contenu (pages texte) */
.prose {
    max-width: 920px;
    margin: 0 auto;
}

.prose p {
    margin: 0 0 16px 0;
}

.prose ul {
    margin: 0 0 16px 0;
    padding-left: 1.2rem;
    color: var(--text-dark);
}

.prose li {
    margin: 8px 0;
}

.card-left {
    text-align: left;
}

.or-sep {
    text-align: center;
    margin: 22px 0;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 0.04em;
}

/* FAQ (accordéon sans JS) */
.faq-list {
    display: grid;
    gap: 14px;
}

details.faq-item {
    padding: 0;
}

details.faq-item > summary {
    list-style: none;
    cursor: pointer;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--primary);
    padding: 22px 22px;
}

details.faq-item > summary::-webkit-details-marker {
    display: none;
}

details.faq-item > summary {
    position: relative;
    padding-right: 56px;
}

details.faq-item > summary::after {
    content: '+';
    position: absolute;
    right: 18px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border-radius: 999px;
    display: grid;
    place-items: center;
    background: rgba(48, 113, 148, 0.10);
    border: 1px solid rgba(48, 113, 148, 0.18);
    color: var(--primary);
    font-weight: 900;
    line-height: 1;
}

details.faq-item[open] > summary::after {
    content: '−';
}

.faq-answer {
    padding: 0 22px 22px 22px;
}

.faq-answer p:last-child,
.faq-answer ul:last-child {
    margin-bottom: 0;
}