/* ===== Fondations ===== */
:root {
    --color-bg: #faf9f6;
    --color-surface: #edebe6;
    --color-surface-2: #ffffff;
    --color-border: #dad7cf;
    --color-text: #26241f;
    --color-text-muted: #6b6862;
    --color-accent: #3b5566;
    --color-accent-dark: #2c4150;
    --color-accent-contrast: #ffffff;
    --color-accent-2: #c97b3b;
    --color-danger: #a3372b;
    --color-danger-bg: #fbe9e7;
    --color-success: #3a6b4a;
    --color-success-bg: #e7f3ea;
    --color-footer-bg: #26241f;
    --color-footer-text: #e9e7e2;
    --color-footer-muted: #a9a69e;
    --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --radius: 4px;
    --shadow-soft: 0 1px 2px rgba(38, 36, 31, 0.06), 0 2px 8px rgba(38, 36, 31, 0.06);
    --container-width: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

[data-theme="dark"] {
    --color-bg: #1b1d1c;
    --color-surface: #252927;
    --color-surface-2: #303432;
    --color-border: #4a504c;
    --color-text: #f2f0e9;
    --color-text-muted: #bdc1ba;
    --color-accent: #9fc2d1;
    --color-accent-dark: #c0dce6;
    --color-accent-contrast: #172024;
    --color-danger-bg: #432a27;
    --color-success-bg: #263c2d;
    --color-footer-bg: #101312;
    --color-footer-text: #f2f0e9;
    --color-footer-muted: #bdc1ba;
    color-scheme: dark;
}

@keyframes page-fade-in {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes image-reveal {
    from { opacity: 0; transform: scale(1.04); }
    to { opacity: 1; transform: scale(1); }
}

body {
    margin: 0;
    font-family: var(--font-sans);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

.site-header__inner,
.hero > .container {
    animation: page-fade-in 650ms ease both;
}

.hero__visual { animation: image-reveal 900ms 120ms ease both; }
.hero__inner > :first-child { animation: page-fade-in 650ms 80ms ease both; }
.card-grid .card { animation: page-fade-in 600ms ease both; }
.card-grid .card:nth-child(2) { animation-delay: 80ms; }
.card-grid .card:nth-child(3) { animation-delay: 160ms; }
.card-grid .card:nth-child(4) { animation-delay: 240ms; }

.section.reveal-ready {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity 700ms ease, transform 700ms ease;
}
.section.reveal-ready.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    .section.reveal-ready { opacity: 1; transform: none; }
}

img { max-width: 100%; display: block; }

a { color: var(--color-accent); text-decoration: underline; text-underline-offset: 2px; }
a:hover { color: var(--color-accent-dark); }

h1, h2, h3, h4 { line-height: 1.25; margin: 0 0 0.6em; font-weight: 700; }
h1 { font-size: clamp(2rem, 1.6rem + 1.6vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.3rem + 0.8vw, 2.1rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }

.container {
    width: 100%;
    max-width: var(--container-width);
    margin-inline: auto;
    padding-inline: 1.25rem;
}

.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;
}

.skip-link {
    position: absolute;
    left: -999px;
    top: 0;
    background: var(--color-accent);
    color: var(--color-accent-contrast);
    padding: 0.75rem 1.25rem;
    z-index: 1000;
    border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; }

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

/* ===== Boutons ===== */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5em;
    padding: 0.7em 1.4em;
    border-radius: var(--radius);
    border: 1px solid transparent;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    line-height: 1.2;
}
.btn--primary { background: var(--color-accent); color: var(--color-accent-contrast); }
.btn--primary:hover { background: var(--color-accent-dark); color: var(--color-accent-contrast); }
.btn--ghost { background: transparent; border-color: var(--color-border); color: var(--color-text); }
.btn--ghost:hover { border-color: var(--color-accent); color: var(--color-accent); }
.btn--danger { background: var(--color-danger); color: #fff; }
.btn--danger:hover { background: #832a20; color: #fff; }
.btn--small { padding: 0.4em 0.9em; font-size: 0.85rem; }

/* ===== En-tete ===== */
.site-header {
    background: var(--color-surface-2);
    border-bottom: 1px solid var(--color-border);
    position: sticky;
    top: 0;
    z-index: 100;
}
.site-header__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: 0.9rem;
    gap: 1rem;
}
.brand {
    display: flex;
    align-items: center;
    gap: 0.7rem;
    text-decoration: none;
    color: var(--color-text);
}
.brand__mascot {
    width: 58px;
    height: 58px;
    object-fit: contain;
    object-position: center;
    flex-shrink: 0;
}
.brand__text { font-weight: 700; font-size: 1.05rem; line-height: 1.2; }
.brand__text small { display: block; font-weight: 400; font-size: 0.72rem; color: var(--color-text-muted); }

.nav-toggle {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 0.5rem 0.65rem;
    cursor: pointer;
}
.nav-toggle__bar { width: 20px; height: 2px; background: var(--color-text); display: block; }

.site-nav { display: flex; align-items: center; gap: 1.6rem; }
.site-nav a { color: var(--color-text); text-decoration: none; font-weight: 500; font-size: 0.95rem; }
.site-nav a:hover, .site-nav a.is-active { color: var(--color-accent); }
.site-nav__cta {
    background: var(--color-accent);
    color: var(--color-accent-contrast) !important;
    padding: 0.5em 1em;
    border-radius: var(--radius);
}
.site-nav__cta:hover { background: var(--color-accent-dark); }

.language-slider {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 4.3rem;
    height: 2.2rem;
    padding: 0.2rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    background: var(--color-surface);
    color: var(--color-text-muted);
    text-decoration: none;
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
}
.language-slider span { position: relative; z-index: 1; width: 50%; text-align: center; }
.language-slider i {
    position: absolute;
    top: 0.2rem;
    left: 0.2rem;
    width: 1.75rem;
    height: 1.75rem;
    border-radius: 50%;
    background: var(--color-accent);
    transition: transform 220ms ease;
}
.language-slider.is-english i { transform: translateX(2rem); }
.language-slider:not(.is-english) span:first-child,
.language-slider.is-english span:nth-child(2) { color: var(--color-accent-contrast); }
.language-slider:hover { border-color: var(--color-accent); }
.language-slider:hover, .language-slider.is-english { color: var(--color-text); }

.theme-toggle {
    display: inline-grid;
    place-items: center;
    width: 2.4rem;
    height: 2.4rem;
    flex-shrink: 0;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    background: var(--color-surface-2);
    color: var(--color-text);
    cursor: pointer;
}
.theme-toggle:hover { border-color: var(--color-accent); color: var(--color-accent); }
.theme-toggle svg { width: 1.15rem; height: 1.15rem; }
.theme-toggle__sun { display: none; }
[data-theme="dark"] .theme-toggle__moon { display: none; }
[data-theme="dark"] .theme-toggle__sun { display: block; }

@media (max-width: 780px) {
    .nav-toggle { display: inline-flex; }
    .site-nav {
        display: none;
        position: absolute;
        top: 100%; left: 0; right: 0;
        background: var(--color-surface-2);
        border-bottom: 1px solid var(--color-border);
        flex-direction: column;
        align-items: stretch;
        padding: 1rem 1.25rem 1.5rem;
        gap: 0.9rem;
    }
    .site-nav.is-open { display: flex; }
    .site-nav__cta { text-align: center; }
}

/* ===== Hero ===== */
.hero {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding-block: clamp(3rem, 2rem + 4vw, 6rem);
}
.hero__inner { display: grid; gap: 2.5rem; align-items: center; grid-template-columns: 1.1fr 0.9fr; }
.hero__eyebrow {
    display: inline-block;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.78rem;
    font-weight: 700;
    color: var(--color-accent);
    margin-bottom: 0.9rem;
}
.hero__lead { font-size: 1.1rem; color: var(--color-text-muted); max-width: 46ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.8rem; margin-top: 1.6rem; }
.hero__visual {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    background: linear-gradient(155deg, var(--color-accent) 0%, var(--color-accent-dark) 55%, var(--color-text) 100%);
    position: relative;
    overflow: hidden;
}
.carousel__slides { position: absolute; inset: 0; }
.hero__image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center 58%; opacity: 0; transition: opacity 500ms ease; }
.hero__image.is-active { opacity: 1; }
.carousel__control {
    position: absolute;
    top: 50%;
    width: 2.3rem;
    height: 2.3rem;
    transform: translateY(-50%);
    border: 1px solid rgba(255,255,255,0.75);
    border-radius: 50%;
    background: rgba(38,36,31,0.65);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
}
.carousel__control:hover { background: var(--color-text); }
.carousel__control--prev { left: 0.9rem; }
.carousel__control--next { right: 0.9rem; }
.carousel__dots { position: absolute; left: 50%; bottom: 0.9rem; display: flex; gap: 0.45rem; transform: translateX(-50%); }
.carousel__dot { width: 0.6rem; height: 0.6rem; padding: 0; border: 1px solid #fff; border-radius: 50%; background: transparent; cursor: pointer; }
.carousel__dot.is-active { background: #fff; }

@media (max-width: 860px) {
    .hero__inner { grid-template-columns: 1fr; }
    .hero__visual { order: -1; aspect-ratio: 16 / 9; }
}

/* ===== Sections generiques ===== */
.section { position: relative; isolation: isolate; padding-block: clamp(2.5rem, 1.8rem + 3vw, 4.5rem); }
.section + .section::before {
    content: '';
    position: absolute;
    z-index: -1;
    top: -2rem;
    left: -8%;
    width: -webkit-fill-available;
    height: 4rem;
    clip-path: ellipse(72% 100% at 50% 100%);
}
.section:not(.section--alt) + .section:not(.section--alt)::before,
.section--alt + .section:not(.section--alt)::before { background: var(--color-bg); }
.section:not(.section--alt) + .section--alt::before { background: var(--color-surface); }
.section--alt { background: var(--color-surface); }
.section__head { max-width: 62ch; margin-bottom: 2.2rem; }
.section__head p { color: var(--color-text-muted); }

.divider { border: 0; height: 14px; margin: 0; }

.card-grid { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.card {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    padding: 1.6rem;
}
.service-card__image {
    width: calc(100% + 3.2rem);
    max-width: none;
    height: 170px;
    margin: -1.6rem -1.6rem 1.3rem;
    object-fit: cover;
    object-position: center;
    border-radius: var(--radius) var(--radius) 0 0;
}
.card h3 { margin-bottom: 0.5rem; }
.card p { color: var(--color-text-muted); margin-bottom: 0; }
.card--link { text-decoration: none; color: inherit; display: block; }
.card--link:hover { border-color: var(--color-accent); }
.card__icon {
    width: 42px; height: 42px;
    border-radius: var(--radius);
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    margin-bottom: 1rem;
    padding: 0.55rem;
    color: var(--color-accent);
}

.zone-list { display: flex; flex-wrap: wrap; gap: 0.6rem; padding: 0; margin: 0; list-style: none; }
.zone-list li {
    background: var(--color-surface-2);
    border: 1px solid var(--color-border);
    border-radius: 999px;
    padding: 0.4em 1em;
    font-size: 0.9rem;
}

.cta-band {
    background: var(--color-accent-dark);
    color: var(--color-accent-contrast);
    border-radius: var(--radius);
    padding: clamp(1.8rem, 1.4rem + 2vw, 3rem);
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
}
.cta-band h2 { margin: 0 0 0.3em; }
.cta-band p { margin: 0; opacity: 0.85; }
.cta-band .btn--ghost { border-color: rgba(255,255,255,0.5); color: #fff; }
.cta-band .btn--ghost:hover { border-color: #fff; color: #fff; }
.cta-band__actions { margin-top: 0; }

/* Placeholder marketing/legal text */
.placeholder-note {
    border: 1px dashed var(--color-border);
    background: var(--color-surface-2);
    padding: 1rem 1.2rem;
    border-radius: var(--radius);
    font-style: italic;
    color: var(--color-text-muted);
}

/* ===== Galerie ===== */
.filter-bar { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-bottom: 2rem; }
.filter-chip {
    display: inline-block;
    padding: 0.5em 1.1em;
    border-radius: 999px;
    border: 1px solid var(--color-border);
    background: var(--color-surface-2);
    color: var(--color-text);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
}
.filter-chip:hover { border-color: var(--color-accent); color: var(--color-accent); }
.filter-chip.is-active { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-contrast); }

.gallery-category { margin-bottom: 3rem; }
.gallery-category__title { display: flex; align-items: baseline; gap: 0.7rem; }
.gallery-category__title span { color: var(--color-text-muted); font-weight: 400; font-size: 0.85rem; }

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1rem;
}
.gallery-grid__item {
    aspect-ratio: 4 / 3;
    border-radius: var(--radius);
    overflow: hidden;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
}
.gallery-grid__item img { width: 100%; height: 100%; object-fit: cover; }

.empty-state {
    border: 1px dashed var(--color-border);
    border-radius: var(--radius);
    padding: 2rem;
    text-align: center;
    color: var(--color-text-muted);
    background: var(--color-surface-2);
}

/* ===== Pied de page ===== */
.site-footer { background: var(--color-footer-bg); color: var(--color-footer-text); margin-top: 3rem; }
.site-footer a { color: var(--color-footer-text); text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer__inner {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2rem;
    padding-block: 2.6rem;
}
.site-footer__brand { font-weight: 700; font-size: 1.1rem; }
.site-footer__label { text-transform: uppercase; font-size: 0.72rem; letter-spacing: 0.08em; color: var(--color-footer-muted); margin-bottom: 0.6em; }
.site-footer__bottom {
    border-top: 1px solid rgba(255,255,255,0.12);
    padding-block: 1.1rem;
    font-size: 0.82rem;
    color: var(--color-footer-muted);
}
@media (max-width: 700px) {
    .site-footer__inner { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ===== Pages legales ===== */
.legal-content { max-width: 74ch; }
.legal-content h2 { margin-top: 2em; }

/* ===== Formulaires ===== */
.form-field { margin-bottom: 1.2rem; }
.form-field label { display: block; font-weight: 600; margin-bottom: 0.4em; font-size: 0.92rem; }
.form-field .hint { display: block; color: var(--color-text-muted); font-size: 0.82rem; margin-top: 0.3em; }
.form-field input[type="text"],
.form-field input[type="password"],
.form-field input[type="email"],
.form-field input[type="file"],
.form-field select,
.form-field textarea {
    width: 100%;
    padding: 0.65em 0.8em;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface-2);
    color: var(--color-text);
    font: inherit;
}
.form-field textarea { resize: vertical; min-height: 6rem; }
.form-actions { display: flex; gap: 0.8rem; margin-top: 1.4rem; }
.form-row { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }

/* ===== Alertes / messages flash ===== */
.alert { padding: 0.9em 1.1em; border-radius: var(--radius); margin-bottom: 1.2rem; font-size: 0.92rem; border: 1px solid transparent; }
.alert--success { background: var(--color-success-bg); color: var(--color-success); border-color: rgba(58,107,74,0.25); }
.alert--error { background: var(--color-danger-bg); color: var(--color-danger); border-color: rgba(163,55,43,0.25); }
.alert--info { background: var(--color-surface); color: var(--color-text); border-color: var(--color-border); }

/* ===== Zone admin ===== */
.admin-shell { min-height: 100vh; background: var(--color-bg); }
.admin-topbar {
    background: var(--color-text);
    color: #e9e7e2;
    padding-block: 0.9rem;
}
.admin-topbar__inner { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 1rem; }
.admin-topbar a { color: #e9e7e2; text-decoration: none; }
.admin-topbar__brand { font-weight: 700; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 1.2rem; font-size: 0.92rem; }
.admin-nav a.is-active { color: var(--color-accent-2); font-weight: 600; }

.admin-warning {
    background: #3d2c17;
    color: #f4dcb3;
    border-bottom: 1px solid rgba(244,220,179,0.25);
}
.admin-warning .container { padding-block: 0.7rem; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.8rem; font-size: 0.88rem; }
.admin-warning a { color: #f4dcb3; font-weight: 600; }

.admin-main { padding-block: 2.2rem; }
.admin-header-row { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 1rem; margin-bottom: 1.6rem; }

.data-table { width: 100%; border-collapse: collapse; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.data-table th, .data-table td { padding: 0.75em 0.9em; text-align: left; border-bottom: 1px solid var(--color-border); font-size: 0.92rem; vertical-align: middle; }
.data-table th { background: var(--color-surface); font-size: 0.78rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--color-text-muted); }
.data-table tr:last-child td { border-bottom: none; }
.data-table .row-actions { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.data-table img.thumb { width: 56px; height: 56px; object-fit: cover; border-radius: var(--radius); border: 1px solid var(--color-border); }

.admin-panel { background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 1.6rem; margin-top: 1rem; margin-bottom: 2rem; }
.admin-panel h2 { font-size: 1.05rem; }

.admin-nav form { display: inline-flex; align-items: center; margin: 0; }
.link-button {
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    font: inherit;
    color: inherit;
    cursor: pointer;
    text-decoration: none;
}
.link-button:hover { color: var(--color-accent-2); }

.btn--block { width: 100%; }
.form-row--align-end { align-items: end; }
.form-field--tight { margin-bottom: 0; }

.login-shell { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 1.5rem; background: var(--color-surface); }
.login-card { width: 100%; max-width: 380px; background: var(--color-surface-2); border: 1px solid var(--color-border); border-radius: var(--radius); padding: 2.2rem; box-shadow: var(--shadow-soft); }
.login-card h1 { font-size: 1.3rem; text-align: center; }
.login-card__sub { text-align: center; color: var(--color-text-muted); font-size: 0.88rem; margin-bottom: 1.6rem; }
