/* ══════════════════════════════════════
   Refonte visuelle 2026 — Les Huches-Coucou
   ══════════════════════════════════════ */

:root {
    --primary: #245c43;
    --primary-light: #3a8a62;
    --primary-lighter: #5cb88a;
    --primary-bg: #e8f5ee;
    --primary-dark: #143528;
    --accent: #c4894a;
    --accent-dark: #9a6a38;
    --bg: #f7f8f5;
    --surface: #ffffff;
    --surface-alt: #eef2ee;
    --border: #d7e0d9;
    --border-light: #e6ece7;
    --text: #1c2a22;
    --text-secondary: #5c6d63;
    --text-light: #8a9a90;
    --white: #ffffff;
    --shadow-sm: 0 1px 2px rgba(20, 53, 40, 0.05);
    --shadow: 0 8px 28px rgba(20, 53, 40, 0.08);
    --shadow-lg: 0 18px 50px rgba(20, 53, 40, 0.12);
    --radius: 16px;
    --radius-sm: 10px;
    --radius-lg: 22px;
    --font: 'Poppins', system-ui, sans-serif;
    --font-display: 'Fraunces', 'Poppins', Georgia, serif;
    --nav-height: 76px;
    --max-width: 1120px;
}

[data-theme="dark"] {
    --bg: #101714;
    --white: #16201b;
    --surface: #16201b;
    --surface-alt: #1c2923;
    --border: #2c3c34;
    --border-light: #24332c;
    --text: #e7eee9;
    --text-secondary: #a7b5ac;
    --text-light: #7d8d84;
    --primary-bg: rgba(92, 184, 138, 0.12);
    --shadow-sm: 0 1px 2px rgba(0,0,0,0.25);
    --shadow: 0 8px 28px rgba(0,0,0,0.35);
    --shadow-lg: 0 18px 50px rgba(0,0,0,0.45);
}

body {
    background:
        radial-gradient(ellipse 80% 50% at 0% 0%, rgba(92,184,138,0.08), transparent 50%),
        radial-gradient(ellipse 60% 40% at 100% 20%, rgba(196,137,74,0.06), transparent 45%),
        var(--bg);
}

/* ── Nav ── */
.nav {
    background: rgba(247, 248, 245, 0.82);
    backdrop-filter: blur(14px) saturate(1.2);
    border-bottom: 1px solid transparent;
    transition: background 0.3s, border-color 0.3s, box-shadow 0.3s;
}

.nav.scrolled {
    background: rgba(255, 255, 255, 0.92);
    border-bottom-color: var(--border);
    box-shadow: var(--shadow-sm);
}

[data-theme="dark"] .nav {
    background: rgba(16, 23, 20, 0.88);
}

[data-theme="dark"] .nav.scrolled {
    background: rgba(22, 32, 27, 0.95);
}

.nav-logo-text {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
}

.nav-link {
    font-weight: 500;
    font-size: 0.92rem;
    border-radius: 999px;
    padding: 8px 14px;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-bg);
    color: var(--primary-dark);
}

.nav-link-admin {
    color: var(--accent-dark) !important;
}

/* ── Hero ── */
.hero {
    min-height: min(92vh, 820px);
    background:
        linear-gradient(165deg, rgba(20,53,40,0.88) 0%, rgba(36,92,67,0.78) 45%, rgba(58,138,98,0.72) 100%),
        radial-gradient(ellipse at 30% 20%, rgba(196,137,74,0.25), transparent 50%),
        #245c43;
}

.hero-home .hero-content {
    max-width: 720px;
}

.hero-badge {
    background: rgba(255,255,255,0.12);
    border-color: rgba(255,255,255,0.22);
}

.hero h1 {
    font-family: var(--font-display);
    font-size: clamp(2.6rem, 6vw, 4.2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.05;
    color: #fff;
}

.hero-subtitle {
    font-size: clamp(1.1rem, 2.4vw, 1.45rem);
    color: rgba(255,255,255,0.88);
}

.hero-text {
    color: rgba(255,255,255,0.78);
    font-size: 1.05rem;
}

.btn-white {
    background: #fff;
    color: var(--primary-dark);
    box-shadow: 0 10px 30px rgba(0,0,0,0.15);
}

.btn-white:hover {
    transform: translateY(-2px);
    box-shadow: 0 14px 36px rgba(0,0,0,0.2);
}

.btn-outline-white {
    border-width: 1.5px;
}

/* ── Sections ── */
.section-title {
    font-family: var(--font-display);
    font-weight: 600;
    letter-spacing: -0.02em;
    font-size: clamp(1.6rem, 3vw, 2.2rem);
}

.section-subtitle {
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.section-alt {
    background: transparent;
}

.feature-card {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 28px 24px;
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s;
}

.feature-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow);
    border-color: rgba(36, 92, 67, 0.25);
}

.feature-icon {
    width: 52px;
    height: 52px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
    font-size: 1.2rem;
}

/* ── Page headers ── */
.page-header {
    background:
        linear-gradient(135deg, #143528 0%, #245c43 55%, #3a8a62 100%);
    padding: 72px 0 56px;
    position: relative;
    overflow: hidden;
}

.page-header::after {
    content: '';
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse at 90% 0%, rgba(255,255,255,0.12), transparent 40%);
    pointer-events: none;
}

.page-header h1 {
    font-family: var(--font-display);
    font-size: clamp(1.8rem, 4vw, 2.6rem);
    font-weight: 650;
}

.page-header p {
    opacity: 0.85;
    font-size: 1.05rem;
}

/* ── Cards / content ── */
.event-card,
.announcement-card,
.member-card,
.ev-card,
.contact-form-card {
    border-radius: var(--radius);
    border: 1px solid var(--border-light);
    box-shadow: var(--shadow-sm);
    transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.event-card:hover,
.ev-card:hover,
.member-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}

.ev-card {
    overflow: hidden;
    background: var(--surface);
    text-decoration: none;
    color: inherit;
    display: block;
}

.ev-card-img {
    aspect-ratio: 16/10;
    overflow: hidden;
    background: var(--surface-alt);
}

.ev-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.ev-card:hover .ev-card-img img {
    transform: scale(1.04);
}

.ev-card-body {
    padding: 18px 18px 20px;
}

.ev-card-title {
    font-family: var(--font-display);
    font-size: 1.15rem;
    margin-bottom: 6px;
}

.member-card {
    background: var(--surface);
    padding: 24px;
    text-align: center;
}

.member-photo,
.member-avatar {
    border-radius: 50%;
    border: 3px solid var(--primary-bg);
}

.announcement-card {
    background: var(--surface);
    padding: 24px 26px;
}

.announcement-card h3 {
    font-family: var(--font-display);
}

/* ── Newsletter ── */
.newsletter-section {
    background:
        radial-gradient(ellipse at 10% 80%, rgba(196,137,74,0.2), transparent 40%),
        linear-gradient(135deg, #143528 0%, #245c43 50%, #3a8a62 100%);
}

.newsletter-copy h2 {
    font-family: var(--font-display);
}

.newsletter-card-v2 {
    border-radius: var(--radius-lg);
}

/* ── Footer ── */
.footer {
    background: #0f1a15;
    color: rgba(255,255,255,0.75);
    padding-top: 56px;
}

.footer h3 {
    font-family: var(--font-display);
    color: #fff;
    font-weight: 600;
}

.footer a:hover {
    color: var(--primary-lighter);
}

.footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.08);
    margin-top: 36px;
    padding: 18px 0;
}

/* ── Buttons ── */
.btn {
    border-radius: 999px;
    font-weight: 600;
    letter-spacing: 0.01em;
}

.btn-primary {
    background: linear-gradient(135deg, var(--primary), var(--primary-light));
    border: none;
    box-shadow: 0 8px 20px rgba(36, 92, 67, 0.25);
}

.btn-primary:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}

.btn-outline {
    border-radius: 999px;
}

/* ── Forms ── */
.form-input,
.form-textarea,
.form-select {
    border-radius: 12px;
    border: 1px solid var(--border);
    background: var(--surface);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.form-input:focus,
.form-textarea:focus {
    border-color: var(--primary-light);
    box-shadow: 0 0 0 4px rgba(92, 184, 138, 0.18);
}

/* ── Contact ── */
.contact-section {
    gap: 28px;
}

.contact-info-item {
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 16px;
}

.contact-info-icon {
    background: var(--primary-bg);
    color: var(--primary);
    border-radius: 12px;
}

/* ── Fade ── */
.fade-in {
    animation: riseIn 0.55s ease both;
}

@keyframes riseIn {
    from { opacity: 0; transform: translateY(14px); }
    to { opacity: 1; transform: none; }
}

@media (max-width: 768px) {
    .hero {
        min-height: 78vh;
    }
    .page-header {
        padding: 56px 0 40px;
    }
}

/* ── Accessibilité / contraste WCAG AA ── */
:root {
    --text-secondary: #4a5c52; /* ≥4.5:1 sur fond clair */
    --text-light: #55665c;     /* ≥4.5:1 (était trop clair) */
    --accent: #9a6a38;         /* texte accent lisible sur blanc */
    --accent-dark: #7a5228;
    --link: var(--primary-dark);
}

[data-theme="dark"] {
    --text: #eef4f0;
    --text-secondary: #c2d0c8;
    --text-light: #9aaba2;
    --link: #6fcea0;           /* liens / focus lisibles sur fond sombre */
    --primary-bg: rgba(111, 206, 160, 0.14);
    --accent: #e0b57a;
    --accent-dark: #e6c08a;
}

/* Liens : primary foncé en clair, vert clair en sombre */
a {
    color: var(--link);
}
a:hover {
    color: var(--primary-light);
}
[data-theme="dark"] a:hover {
    color: #8fd9b4;
}

.nav-link:hover,
.nav-link.active {
    background: var(--primary-bg);
    color: var(--link);
}

[data-theme="dark"] .nav-link {
    color: var(--text-secondary);
}
[data-theme="dark"] .nav-link:hover,
[data-theme="dark"] .nav-link.active {
    color: var(--link);
    background: var(--primary-bg);
}

.nav-link-admin {
    color: var(--accent-dark) !important;
}
[data-theme="dark"] .nav-link-admin {
    color: var(--accent) !important;
}
[data-theme="dark"] .nav-link-admin:hover,
[data-theme="dark"] .nav-link-admin.active {
    background: rgba(224, 181, 122, 0.15) !important;
    color: var(--accent) !important;
}

.btn-outline {
    color: var(--link);
    border-color: var(--primary);
}
[data-theme="dark"] .btn-outline {
    color: var(--link);
    border-color: var(--link);
}
.btn-outline:hover {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
}
[data-theme="dark"] .btn-outline:hover {
    background: #2a6b4e;
    color: #fff;
    border-color: #2a6b4e;
}

/* Bouton primary : fond assez sombre pour blanc ≥4.5 */
.btn-primary {
    background: linear-gradient(135deg, #1e4d38, #245c43);
    color: #fff;
}
.btn-primary:hover {
    filter: brightness(1.08);
    color: #fff;
}

/* Hero : textes blancs renforcés */
.hero-subtitle { color: rgba(255, 255, 255, 0.92); }
.hero-text { color: rgba(255, 255, 255, 0.88); }
.hero-badge { color: #fff; }

/* Footer : jamais var(--white) (sombre = surface foncée) */
.footer,
.footer-col p,
.footer-col a,
.footer-contact-item,
.footer-bottom p {
    color: rgba(255, 255, 255, 0.88);
}
.footer h3,
.footer-col h3 {
    color: #ffffff !important;
}
.footer-col p {
    color: rgba(255, 255, 255, 0.78);
}
.footer-col a {
    color: rgba(255, 255, 255, 0.82);
}
.footer-col a:hover,
.footer a:hover {
    color: #8fd9b4;
}
.footer-col .footer-contact-item i {
    color: #8fd9b4;
}
.footer-bottom {
    border-top-color: rgba(255, 255, 255, 0.12);
}

/* Légal / titres sections */
.legal-content h2 {
    color: var(--link);
}
[data-theme="dark"] .legal-content a {
    color: var(--link);
}
.section-subtitle,
.feature-card p,
.text-secondary {
    color: var(--text-secondary);
}
.text-light,
.text-muted {
    color: var(--text-light);
}

/* Placeholders formulaires */
.form-input::placeholder,
.form-textarea::placeholder {
    color: var(--text-light);
    opacity: 1;
}

/* Cookie : texte secondaire déjà AA ; boutons outline OK */
.cookie-banner-inner p {
    color: var(--text-secondary);
}
[data-theme="dark"] .cookie-banner {
    background: var(--surface);
    border-color: var(--border);
}
[data-theme="dark"] .btn-outline.btn-sm {
    color: var(--link);
    border-color: var(--link);
}

/* Cartes / contenus riches */
[data-theme="dark"] .rich-content a,
[data-theme="dark"] .announcement-card a {
    color: var(--link);
}

/* Admin link color on public pages */
.nav-logo {
    color: var(--link);
}
[data-theme="dark"] .nav-logo {
    color: var(--text);
}
[data-theme="dark"] .nav-logo:hover {
    color: var(--link);
}

/* Rando banner bouton */
.rando-banner .btn-white {
    color: #7a3d00;
    background: #fff;
}
.rando-banner .btn-white:hover {
    color: #5c2e00;
    background: #fff7ef;
}

/* Contenu hero boutons outline blanc */
.btn-outline-white {
    color: #fff;
    border-color: rgba(255, 255, 255, 0.85);
}
.btn-outline-white:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}
.btn-white {
    color: #143528;
    background: #fff;
}
.btn-white:hover {
    color: #143528;
    background: #f3faf6;
}


/* ── Cookie banner ── */
.cookie-banner {
    position: fixed;
    left: 16px;
    right: 16px;
    bottom: 16px;
    z-index: 10000;
    max-width: 720px;
    margin: 0 auto;
    background: var(--surface);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 16px;
    box-shadow: var(--shadow-lg);
    padding: 16px 18px;
    animation: riseIn 0.35s ease;
}

.cookie-banner-inner {
    display: flex;
    gap: 16px;
    align-items: center;
    flex-wrap: wrap;
}

.cookie-banner-inner p {
    flex: 1;
    min-width: 220px;
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.5;
    color: var(--text-secondary);
}

.cookie-banner-actions {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

/* ── Pages légales ── */
.legal-content {
    max-width: 760px;
    background: var(--surface);
    border: 1px solid var(--border-light);
    border-radius: var(--radius);
    padding: 32px 28px;
    box-shadow: var(--shadow-sm);
}

.legal-content h2 {
    font-family: var(--font-display);
    font-size: 1.25rem;
    margin: 28px 0 10px;
    color: var(--primary-dark);
}

[data-theme="dark"] .legal-content h2 {
    color: var(--primary-lighter);
}

.legal-content ul {
    padding-left: 1.2rem;
    margin: 8px 0 16px;
}

.legal-content li {
    margin-bottom: 6px;
}

.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0,0,0,0);
    white-space: nowrap;
    border: 0;
}

/* Images responsives */
img {
    max-width: 100%;
    height: auto;
}

.nav-logo-icon img {
    max-height: 55px;
}

/* Perf: avoid layout shift on hero buttons */
.hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    justify-content: center;
}

@media (max-width: 560px) {
    .cookie-banner-inner {
        flex-direction: column;
        align-items: stretch;
    }
    .cookie-banner-actions .btn {
        flex: 1;
    }
    .hero-buttons .btn {
        width: 100%;
    }
}

/* Bandeau randonnée (paramètre admin) */
.rando-banner {
    position: fixed;
    top: var(--nav-height, 72px);
    left: 0;
    right: 0;
    z-index: 999;
    background: linear-gradient(90deg, #E67E22, #d35400);
    color: #fff;
    box-shadow: 0 4px 16px rgba(230, 126, 34, 0.25);
}
.rando-banner-inner {
    max-width: min(1120px, 100%);
    margin: 0 auto;
    padding: 10px max(16px, 3vw);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px 16px;
    font-weight: 500;
    font-size: clamp(0.85rem, 2vw, 0.98rem);
}
.rando-banner-inner span {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
    flex: 1 1 180px;
}
.rando-banner .btn-white {
    background: #fff;
    color: #d35400;
    border: none;
    white-space: nowrap;
    flex: 0 0 auto;
}
.rando-banner .btn-white:hover {
    background: #fff7ef;
    color: #b03d00;
}
body.has-rando-banner .hero {
    padding-top: calc(var(--nav-height, 72px) + 56px);
}
body.has-rando-banner {
    --rando-banner-h: 56px;
}


/* Zoom-safe hero */
.hero {
    min-height: min(92dvh, 820px);
    width: 100%;
    box-sizing: border-box;
}
.hero-content {
    width: 100%;
    max-width: min(720px, 100%);
}
.features-grid {
    grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}
@media (max-width: 1024px) {
    .hero { min-height: min(78dvh, 700px); }
}

