/* ==========================================================================
   Espace la Traversée — feuille de style
   Principe : lisibilité d'abord (public aîné, vulnérable, proches aidants).
   Texte de base 18 px, contrastes AA+, cibles tactiles ≥ 44 px.
   ========================================================================== */

:root {
    --blue: #044D7F;
    --blue-deep: #03365A;
    /* Palette adoucie : fonds cassés (pas de blanc pur) pour réduire l'éblouissement */
    --sky: #DCE6EE;
    --sky-line: #BFCFDC;
    --paper: #F4F2ED;     /* fond de page : blanc cassé chaud */
    --surface: #FAF9F6;   /* cartes, formulaires, menus */
    --ink: #16232F;
    --muted: #4A5B6A;
    --sun: #F0B429;
    --sun-soft: #F6EBD0;
    --ok: #1E6B45;
    --err: #A4262C;

    /* Polices neutres : Inter partout (titres un peu plus gras), avec repli sur les polices système */
    --f-body: "Inter", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
    --f-head: var(--f-body);

    --step--1: 0.889rem;
    --step-0: 1.125rem;   /* 18 px */
    --step-1: 1.333rem;
    --step-2: 1.777rem;
    --step-3: 2.369rem;
    --step-4: clamp(2.3rem, 1.6rem + 3vw, 3.6rem);

    --wrap: 72rem;
    --gutter: clamp(1.25rem, 4vw, 2.5rem);
    --radius: 6px;
    --shadow: 0 1px 2px rgba(3, 54, 90, .08), 0 6px 20px rgba(3, 54, 90, .07);
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 6rem; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }

body {
    margin: 0;
    font-family: var(--f-body);
    font-size: var(--step-0);
    line-height: 1.6;
    color: var(--ink);
    background: var(--paper);
}

img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
a[href^="tel:"] { white-space: nowrap; }
:focus-visible { outline: 3px solid var(--sun); outline-offset: 3px; border-radius: 2px; }

h1, h2, h3 { font-family: var(--f-head); font-weight: 700; line-height: 1.2; color: var(--blue-deep); margin: 0 0 .6em; }
h1 { font-size: var(--step-4); letter-spacing: -.02em; }
h2 { font-size: var(--step-3); letter-spacing: -.01em; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0 0 1em; }
ul, ol { margin: 0; padding: 0; }

.wrap { width: min(100% - 2 * var(--gutter), var(--wrap)); margin-inline: auto; }
.narrow { max-width: 44rem; }
.center { text-align: center; margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; z-index: 100; background: var(--ink); color: #fff; padding: .7rem 1rem; border-radius: var(--radius); }
.skip:focus { top: 1rem; }
main:focus { outline: none; }

.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); max-width: 40em; }
.big { font-size: var(--step-1); line-height: 1.5; }
.small, .note { font-size: var(--step--1); color: var(--muted); }
.prose { max-width: 38em; }
.prose h2 { font-size: var(--step-2); margin-top: 1.6em; }
.prose h2:first-child { margin-top: 0; }
.prose h3 { margin-top: 1.4em; margin-bottom: .3em; }

/* ---------- Boutons ---------- */
.btn {
    display: inline-flex; align-items: center; justify-content: center; gap: .5em;
    min-height: 3rem; padding: .7em 1.3em;
    font: 700 var(--step-0)/1.2 var(--f-body);
    border-radius: 999px; border: 2px solid var(--blue);
    text-decoration: none; cursor: pointer;
    transition: background-color .15s, color .15s;
}
.btn-primary { background: var(--blue); color: #fff; }
.btn-primary:hover { background: var(--blue-deep); border-color: var(--blue-deep); }
.btn-ghost { background: transparent; color: var(--blue); }
.btn-ghost:hover { background: var(--sky); }
.btn-small { min-height: 2.75rem; padding: .5em 1.1em; font-size: 1rem; background: transparent; color: var(--blue); }
.btn-small:hover { background: var(--blue); color: #fff; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .6; cursor: progress; }
.actions { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.8rem; }
.link-strong { font-weight: 700; }

/* ---------- En-tête ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(244,242,237,.97); border-bottom: 1px solid var(--sky-line); }
@supports (backdrop-filter: blur(8px)) { .site-header { background: rgba(244,242,237,.9); backdrop-filter: blur(8px); } }
.header-inner { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 4.75rem; }
.brand { display: inline-flex; align-items: center; gap: .6rem; text-decoration: none; color: var(--blue); }
.brand-mark { width: 2.6rem; height: 2.6rem; }
.brand-logo { height: var(--logo-h, 3rem); width: auto; max-width: min(60vw, 18rem); object-fit: contain; }
@media (max-width: 36rem) { .brand-logo { height: calc(var(--logo-h, 3rem) * .85); } }
.brand-text { font-family: var(--f-head); font-weight: 700; font-size: 1.3rem; letter-spacing: -.01em; color: var(--blue-deep); }

.nav-list { list-style: none; display: flex; align-items: center; gap: .25rem; }
.nav-link {
    display: inline-flex; align-items: center; gap: .35rem; min-height: 2.75rem; padding: .4rem .8rem;
    font: 700 1.02rem/1.2 var(--f-body); color: var(--ink); text-decoration: none;
    background: none; border: 0; border-radius: 999px; cursor: pointer;
}
.nav-link:hover { background: var(--sky); }
.nav-link[aria-current="page"], .nav-item.is-active > .nav-link { color: var(--blue); box-shadow: inset 0 -3px 0 var(--sun); border-radius: 0; }
.nav-cta .nav-link { background: var(--blue); color: #fff; padding-inline: 1.1rem; margin-left: .4rem; }
.nav-cta .nav-link:hover { background: var(--blue-deep); }
.nav-cta .nav-link[aria-current="page"] { box-shadow: none; border-radius: 999px; color: #fff; }
.sub-toggle svg { width: .75rem; height: .5rem; transition: transform .15s; }
.sub-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }

.has-sub { position: relative; }
.sub {
    list-style: none; position: absolute; top: calc(100% + .4rem); left: 0; min-width: 15rem;
    background: var(--surface); border: 1px solid var(--sky-line); border-radius: var(--radius); box-shadow: var(--shadow);
    padding: .4rem; display: none;
}
.sub a { display: block; padding: .65rem .8rem; border-radius: 4px; color: var(--ink); text-decoration: none; font-weight: 700; }
.sub a:hover, .sub a[aria-current="page"] { background: var(--sky); color: var(--blue); }
.has-sub.is-open .sub { display: block; }
.no-js .has-sub:focus-within .sub, .no-js .has-sub:hover .sub { display: block; }

.nav-toggle { display: none; }

@media (max-width: 64rem) {
    .nav-toggle {
        display: inline-flex; align-items: center; gap: .55rem; min-height: 2.75rem; padding: .4rem .9rem;
        font: 700 1rem var(--f-body); color: var(--blue); background: var(--sky); border: 0; border-radius: 999px; cursor: pointer;
    }
    .nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after {
        display: block; width: 1.1rem; height: 2px; background: currentColor; position: relative; content: ""; transition: transform .2s;
    }
    .nav-toggle-bars::before { position: absolute; top: -6px; }
    .nav-toggle-bars::after { position: absolute; top: 6px; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(6px) rotate(45deg); }
    .nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-6px) rotate(-45deg); }

    .nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--surface); border-bottom: 1px solid var(--sky-line); box-shadow: var(--shadow); display: none; max-height: calc(100vh - 4.75rem); overflow-y: auto; }
    .nav.is-open { display: block; }
    .no-js .nav { display: block; position: static; box-shadow: none; }
    .nav-list { flex-direction: column; align-items: stretch; padding: .75rem var(--gutter) 1.25rem; gap: 0; }
    .nav-link { width: 100%; justify-content: space-between; min-height: 3.25rem; font-size: 1.15rem; border-radius: 0; border-bottom: 1px solid var(--sky); }
    .nav-link[aria-current="page"], .nav-item.is-active > .nav-link { box-shadow: inset 4px 0 0 var(--sun); padding-left: 1rem; }
    .sub { position: static; box-shadow: none; border: 0; padding: 0 0 .5rem 1rem; min-width: 0; }
    .sub a { padding: .8rem .8rem; font-size: 1.1rem; }
    .nav-cta .nav-link { margin: 1rem 0 0; justify-content: center; border-radius: 999px; border: 0; }
}

/* ---------- Image d'arrière-plan floutée des bandeaux (toutes les pages) ----------
   <div class="hero-bg" style="background-image:url('…')"> placé en 1er enfant de .page-head ou .hero.
   Un voile clair par-dessus garde le texte lisible (contraste AA). */
.page-head, .hero { position: relative; isolation: isolate; overflow: hidden; }
.hero-bg { position: absolute; inset: 0; z-index: -2; background: var(--sky) center / cover no-repeat; overflow: hidden; }
.hero-bg::after { content: ""; position: absolute; inset: 0; background: inherit; filter: blur(3px); transform: scale(1.06); }
.hero-bg::before { content: ""; position: absolute; inset: 0; z-index: 1;
    background: linear-gradient(90deg, rgba(220,230,238,.78) 0%, rgba(220,230,238,.68) 45%, rgba(220,230,238,.4) 100%); }
@media (max-width: 52rem) { .hero-bg::before { background: rgba(220,230,238,.88); } }

/* ---------- Accueil : héros ---------- */
.hero { background: linear-gradient(180deg, var(--sky) 0%, var(--sky) 72%, var(--paper) 72%); padding-top: clamp(2.5rem, 6vw, 5rem); }
.hero > .hero-bg { bottom: 28%; }
.hero-inner { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2rem, 5vw, 4rem); align-items: center; }
.hero h1 { max-width: 12em; }
.hero-media { margin: 0; aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
.cover { width: 100%; height: 100%; object-fit: cover; }
.img-missing { width: 100%; height: 100%; min-height: 10rem; background:
    radial-gradient(circle at 70% 35%, rgba(240,180,41,.55) 0 2.2rem, transparent 2.3rem),
    linear-gradient(160deg, #6D9CC0, var(--blue)); }

@media (max-width: 52rem) {
    .hero { background: var(--sky); padding-bottom: 2.5rem; }
    .hero > .hero-bg { bottom: 0; }
    .hero-inner { grid-template-columns: 1fr; }
    .hero-media { aspect-ratio: 16 / 10; }
}

/* Anti-pixelisation : quand une photo est plus petite que son cadre, main.js ajoute .is-lowres.
   La photo s'affiche alors à sa taille réelle (jamais agrandie), centrée sur une copie floutée d'elle-même. */
.is-lowres { position: relative; display: grid; place-items: center; background-position: center; background-size: cover; isolation: isolate; }
.is-lowres::before { content: ""; position: absolute; inset: -24px; z-index: -1; background: inherit; filter: blur(16px) saturate(1.1); }
.is-lowres img.cover { width: auto; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 4px 18px rgba(0,0,0,.18); }

/* ---------- La « traversée » : nos adresses comme les stations d'une ligne ---------- */
.ligne { position: relative; margin-top: clamp(2.5rem, 6vw, 4.5rem); background: var(--surface); border: 1px solid var(--sky-line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem clamp(1.2rem, 3vw, 2.2rem) 1.8rem; }
.ligne-titre { font-size: var(--step-1); font-weight: 500; color: var(--muted); margin-bottom: 1.4rem; }
.ligne-stops { list-style: none; display: grid; grid-template-columns: repeat(6, 1fr); position: relative; }
.ligne-stops::before { content: ""; position: absolute; left: calc(100% / 12); right: calc(100% / 12); top: calc(.75rem - 3px); height: 6px; border-radius: 3px; background: var(--blue); }
.stop a { position: relative; display: flex; flex-direction: column; align-items: center; text-align: center; gap: .15rem; padding: 0 .35rem .3rem; text-decoration: none; color: var(--ink); }
.stop-dot { width: 1.5rem; height: 1.5rem; border-radius: 50%; background: var(--surface); border: 5px solid var(--blue); margin-bottom: .55rem; transition: transform .15s, background-color .15s; }
.stop-nom { font-weight: 700; line-height: 1.25; }
.stop-quartier { font-size: var(--step--1); color: var(--muted); }
.stop a:hover .stop-dot, .stop a:focus-visible .stop-dot { background: var(--sun); transform: scale(1.2); }
.stop a:hover .stop-nom { color: var(--blue); text-decoration: underline; }

@media (prefers-reduced-motion: no-preference) {
    .ligne-stops::before { transform-origin: left; animation: tracer 1.1s .2s cubic-bezier(.3,.7,.3,1) both; }
    .stop-dot { animation: station .35s both; }
    .stop:nth-child(1) .stop-dot { animation-delay: .25s; }
    .stop:nth-child(2) .stop-dot { animation-delay: .4s; }
    .stop:nth-child(3) .stop-dot { animation-delay: .55s; }
    .stop:nth-child(4) .stop-dot { animation-delay: .7s; }
    .stop:nth-child(5) .stop-dot { animation-delay: .85s; }
    .stop:nth-child(6) .stop-dot { animation-delay: 1s; }
}
@keyframes tracer { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes tracer-v { from { transform: scaleY(0); } to { transform: scaleY(1); } }
@keyframes station { from { transform: scale(0); } to { transform: scale(1); } }

@media (max-width: 52rem) {
    .ligne-stops { grid-template-columns: 1fr; gap: 0; }
    .ligne-stops::before { left: calc(.75rem - 3px); right: auto; top: .75rem; bottom: .75rem; width: 6px; height: auto; transform-origin: top; animation-name: tracer-v; }
    .stop a { flex-direction: row; flex-wrap: wrap; align-items: baseline; text-align: left; column-gap: .7rem; padding: .55rem 0; }
    .stop-dot { margin: 0; flex: none; align-self: center; }
    .stop-quartier { flex-basis: 100%; padding-left: 2.2rem; margin-top: -.1rem; }
}

/* Ressources intermédiaires : sous la ligne, dans la même carte.
   Présentées comme un répertoire (et non comme des stations) pour les distinguer des adresses principales. */
.ri { margin-top: 1.8rem; padding-top: 1.6rem; border-top: 1px solid var(--sky-line); }
.ri-titre { font-size: var(--step-1); font-weight: 700; color: var(--blue-deep); margin-bottom: .2rem; }
.ri-intro { font-size: var(--step--1); color: var(--muted); margin-bottom: 1.1rem; max-width: 46em; }
.ri-liste { list-style: none; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: .6rem; }
.ri-lien {
    display: flex; align-items: flex-start; gap: .7rem; height: 100%; min-height: 3.25rem; padding: .7rem .9rem;
    border: 1px solid var(--sky-line); border-radius: var(--radius); text-decoration: none; color: var(--ink);
    transition: background-color .15s, border-color .15s;
}
.ri-lien:hover { background: var(--sky); border-color: var(--blue); }
.ri-dot { flex: none; width: 1rem; height: 1rem; margin-top: .3rem; border-radius: 50%; border: 3px solid var(--blue); background: var(--surface); transition: background-color .15s; }
.ri-lien:hover .ri-dot, .ri-lien:focus-visible .ri-dot { background: var(--sun); }
.ri-texte { display: flex; flex-direction: column; min-width: 0; }
.ri-nom { font-weight: 700; line-height: 1.3; }
.ri-lien:hover .ri-nom { color: var(--blue); text-decoration: underline; }
.ri-adresse { font-size: var(--step--1); color: var(--muted); line-height: 1.4; }
@media (max-width: 64rem) { .ri-liste { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 48rem) { .ri-liste { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 34rem) { .ri-liste { grid-template-columns: 1fr; } }

/* ---------- Sections ---------- */
.section { padding-block: clamp(3rem, 7vw, 5.5rem); }
.section-flush { padding-block: 0; }
.section-tint { background: var(--sky); }
.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.figure { margin: 0; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; }
@media (max-width: 52rem) { .split { grid-template-columns: 1fr; } }

.page-head { background: var(--sky); padding-block: clamp(2.5rem, 6vw, 4.5rem) clamp(2rem, 5vw, 3.5rem); border-bottom: 6px solid var(--blue); }
/* Fiches résidence : la photo chevauche le bas du bandeau flouté */
.page-head-residence { --chevauche: clamp(4rem, 12vw, 9rem); border-bottom: 0; padding-bottom: calc(clamp(1.5rem, 4vw, 2.5rem) + var(--chevauche)); }
.page-head-residence + .section-flush { position: relative; z-index: 1; margin-top: calc(-1 * clamp(4rem, 12vw, 9rem)); }
.crumbs { font-size: var(--step--1); color: var(--muted); margin-bottom: 1rem; }
.crumbs span[aria-hidden] { margin-inline: .35rem; }

.tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0 0 1rem; }
.tag { display: inline-block; padding: .22rem .75rem; font-size: .95rem; font-weight: 700; border-radius: 999px; background: var(--blue); color: #fff; }
.tag-plain { background: var(--surface); color: var(--blue-deep); border: 1px solid var(--sky-line); }
.tag-sun { background: var(--sun); color: var(--ink); }
.tag-off { background: #EDEFF1; color: #50565C; }

/* Services (accueil) : rangée texte + vignette, pas une grille de cartes */
.services { list-style: none; display: grid; grid-template-columns: 1fr 1fr; gap: 2.2rem 3rem; margin-top: 1rem; }
.service { display: grid; grid-template-columns: 9rem 1fr; gap: 1.2rem; align-items: start; }
.service-img, .service .img-missing { width: 9rem; height: 9rem; min-height: 0; object-fit: cover; border-radius: 50%; }
.service h3 { font-size: var(--step-2); margin-bottom: .3rem; }
.service h3 a { text-decoration: none; color: var(--blue-deep); }
.service h3 a:hover { text-decoration: underline; }
.service p { color: var(--muted); }
@media (max-width: 52rem) { .services { grid-template-columns: 1fr; } .service { grid-template-columns: 5.5rem 1fr; } .service-img, .service .img-missing { width: 5.5rem; height: 5.5rem; } }

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1px solid var(--sky-line); border-radius: var(--radius); overflow: hidden; }
.duo-item { padding: clamp(1.8rem, 4vw, 3rem); }
.duo-item + .duo-item { border-left: 1px solid var(--sky-line); background: var(--sun-soft); }
.duo-item h2 { font-size: var(--step-2); }
@media (max-width: 52rem) { .duo { grid-template-columns: 1fr; } .duo-item + .duo-item { border-left: 0; border-top: 1px solid var(--sky-line); } }

.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin: 1.5rem 0 0; }
.values dt { font-family: var(--f-head); font-size: var(--step-1); font-weight: 700; color: var(--blue-deep); margin-bottom: .4rem; padding-top: 1rem; border-top: 4px solid var(--sun); }
.values dd { margin: 0; color: var(--muted); }
@media (max-width: 52rem) { .values { grid-template-columns: 1fr; } }

/* ---------- Témoignages (À propos) : carrousel ---------- */
.temoignages h2 { text-align: center; margin-bottom: 1.8rem; }
.carrousel { position: relative; }
.carrousel-piste {
    list-style: none; display: grid; grid-auto-flow: column; grid-auto-columns: calc((100% - 2 * 1.5rem) / 3); gap: 1.5rem;
    overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: .5rem .25rem 1rem; margin: 0 -.25rem;
}
.carrousel-piste::-webkit-scrollbar { display: none; }
@media (prefers-reduced-motion: no-preference) { .carrousel-piste { scroll-behavior: smooth; } }
@media (max-width: 60rem) { .carrousel-piste { grid-auto-columns: calc((100% - 1.5rem) / 2); } }
@media (max-width: 40rem) { .carrousel-piste { grid-auto-columns: 100%; } }
.temoignage {
    scroll-snap-align: start; display: flex; flex-direction: column; justify-content: space-between; gap: 1.2rem;
    background: var(--surface); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.6rem 1.6rem 1.4rem; border-top: 4px solid var(--sun);
}
.temoignage blockquote { margin: 0; }
.temoignage blockquote p { margin: 0; font-size: 1.08rem; line-height: 1.6; }
.temoignage-nom { display: flex; align-items: center; gap: .7rem; margin: 0; font-weight: 700; color: var(--blue-deep); }
.temoignage-initiale { display: inline-grid; place-items: center; width: 2.6rem; height: 2.6rem; border-radius: 50%; background: var(--sky); color: var(--blue); font-weight: 700; }
.carrousel-controles { display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: .8rem; margin-top: 1rem; }
.carrousel-btn { display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: 50%; border: 2px solid var(--blue); background: var(--surface); color: var(--blue); cursor: pointer; }
.carrousel-btn:hover { background: var(--blue); color: #fff; }
.carrousel-btn svg { width: 1.3rem; height: 1.3rem; fill: none; stroke: currentColor; stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.carrousel-points { display: flex; gap: .4rem; }
.carrousel-points button { width: 1.5rem; height: 2.75rem; padding: 0; border: 0; background: none; cursor: pointer; display: grid; place-items: center; }
.carrousel-points button::before { content: ""; width: .7rem; height: .7rem; border-radius: 50%; background: var(--sky-line); transition: background-color .2s, transform .2s; }
.carrousel-points button[aria-current="true"]::before { background: var(--blue); transform: scale(1.25); }
.carrousel-pause { min-height: 2.75rem; padding: .4rem 1rem; border-radius: 999px; border: 2px solid var(--sky-line); background: var(--surface); color: var(--ink); font: 700 .95rem var(--f-body); cursor: pointer; }
.carrousel-pause:hover { border-color: var(--blue); color: var(--blue); }
.carrousel-controles[hidden] { display: none; }

/* ---------- Liste des projets ---------- */
.projets { list-style: none; display: grid; gap: clamp(2.5rem, 6vw, 4rem); }
.projet { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: center; }
.projet:nth-child(even) .projet-media { order: 2; }
.projet-media { display: block; aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden; }
.projet-media img { transition: transform .4s; }
.projet-media:hover img { transform: scale(1.03); }
.projet h2 { font-size: var(--step-3); margin-bottom: .4rem; }
.projet h2 a { text-decoration: none; color: inherit; }
.projet h2 a:hover { text-decoration: underline; }
.projet-meta { font-weight: 700; color: var(--blue); }
@media (max-width: 52rem) { .projet { grid-template-columns: 1fr; } .projet:nth-child(even) .projet-media { order: 0; } }

/* ---------- Page résidence ---------- */
.residence-hero { margin: 0; aspect-ratio: 21 / 9; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); }
@media (max-width: 40rem) { .residence-hero { aspect-ratio: 4 / 3; } }
.residence-grid { display: grid; grid-template-columns: minmax(0, 1fr) 20rem; gap: clamp(2rem, 5vw, 4.5rem); align-items: start; }
.infobox { position: sticky; top: 6.5rem; background: var(--surface); border: 1px solid var(--sky-line); border-top: 6px solid var(--blue); border-radius: var(--radius); padding: 1.5rem; box-shadow: var(--shadow); }
.infobox-h { font-family: var(--f-body); font-size: var(--step--1); font-weight: 700; color: var(--muted); margin: 0 0 .2rem; letter-spacing: .01em; }
.infobox p { margin-bottom: 1.1rem; }
@media (max-width: 52rem) { .residence-grid { grid-template-columns: 1fr; } .infobox { position: static; order: -1; } }

.pills { list-style: none; display: flex; flex-wrap: wrap; gap: .5rem; }
.pills li { padding: .45rem 1rem; border-radius: var(--radius); background: var(--sky); font-weight: 700; color: var(--blue-deep); }

/* Galerie photos (Maison d'Esther > Milieu de vie) */
.galerie { list-style: none; padding: 0; margin: 1rem 0 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: .75rem; }
.galerie li { margin: 0; }
.galerie a { display: block; aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; background: var(--sky); }
.galerie img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.galerie a:hover img, .galerie a:focus-visible img { transform: scale(1.04); }
@media (max-width: 40rem) { .galerie { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (prefers-reduced-motion: reduce) { .galerie img { transition: none; } }
.galerie a { cursor: zoom-in; }

/* Fenêtre d'agrandissement des photos (lightbox) */
.lightbox { width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0; border: 0; background: transparent; overflow: hidden; }
.lightbox::backdrop { background: rgba(8, 20, 32, .96); }
.lightbox[open] { display: flex; align-items: center; justify-content: center; }
.lightbox-fig { margin: 0; display: flex; flex-direction: column; align-items: center; gap: .8rem; max-width: calc(100vw - 8rem); }
.lightbox-fig img { max-width: 100%; max-height: calc(100vh - 7rem); width: auto; height: auto; border-radius: var(--radius); box-shadow: 0 10px 40px rgba(0, 0, 0, .5); }
.lightbox-fig figcaption { color: #fff; font-size: .95rem; opacity: .85; }
.lightbox-btn { position: absolute; display: grid; place-items: center; width: 3rem; height: 3rem; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .14); color: #fff; font-size: 1.6rem; line-height: 1; cursor: pointer; }
.lightbox-btn:hover, .lightbox-btn:focus-visible { background: rgba(255, 255, 255, .3); }
.lightbox-btn:focus-visible { outline: 3px solid var(--sun); outline-offset: 2px; }
.lightbox-fermer { top: 1rem; right: 1rem; }
.lightbox-prec { left: 1rem; top: 50%; transform: translateY(-50%); }
.lightbox-suiv { right: 1rem; top: 50%; transform: translateY(-50%); }
@media (max-width: 40rem) {
    .lightbox-fig { max-width: calc(100vw - 1.5rem); }
    .lightbox-prec, .lightbox-suiv { top: auto; bottom: 1rem; transform: none; }
    .lightbox-prec { left: calc(50% - 3.5rem); } .lightbox-suiv { right: calc(50% - 3.5rem); }
    .lightbox-fig img { max-height: calc(100vh - 10rem); }
}
.checklist { list-style: none; display: grid; grid-template-columns: repeat(auto-fill, minmax(14rem, 1fr)); gap: .45rem 1.5rem; margin-bottom: 1rem; }
.checklist li { position: relative; padding-left: 1.8rem; }
.checklist li::before { content: ""; position: absolute; left: .1rem; top: .45em; width: .9rem; height: .5rem; border-left: 3px solid var(--blue); border-bottom: 3px solid var(--blue); transform: rotate(-45deg); }

.autres { list-style: none; display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: .8rem; }
.autres a { display: flex; flex-direction: column; padding: 1rem 1.2rem; border: 1px solid var(--sky-line); border-radius: var(--radius); text-decoration: none; }
.autres a span { font-weight: 700; }
.autres a small { color: var(--muted); font-size: var(--step--1); }
.autres a:hover { border-color: var(--blue); background: var(--sky); }
.h-small { font-size: var(--step-1); }

/* ---------- Formulaires ---------- */
.form-wrap { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr); gap: clamp(2rem, 5vw, 4rem); align-items: start; }
@media (max-width: 52rem) { .form-wrap { grid-template-columns: 1fr; } }
.form { background: var(--surface); border-radius: var(--radius); padding: clamp(1.4rem, 4vw, 2.4rem); box-shadow: var(--shadow); }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.3rem 1.2rem; }
.field { grid-column: 1 / -1; min-width: 0; margin: 0; padding: 0; border: 0; }
.field-half { grid-column: span 1; }
@media (max-width: 36rem) { .form-grid { grid-template-columns: 1fr; } .field-half { grid-column: 1 / -1; } }

.field > label, .field legend { display: block; font-weight: 700; margin-bottom: .35rem; padding: 0; }
.req { color: var(--err); }
.hint { font-size: var(--step--1); color: var(--muted); margin: -.15rem 0 .5rem; }
.field input[type=text], .field input[type=email], .field input[type=tel], .field input[type=number], .field input[type=date], .field select, .field textarea {
    width: 100%; min-height: 3.1rem; padding: .7rem .85rem;
    font: inherit; color: var(--ink); background: var(--surface);
    border: 2px solid #8FA6B8; border-radius: var(--radius);
}
.field textarea { resize: vertical; min-height: 6rem; }
.field select { appearance: none; padding-right: 2.6rem; cursor: pointer;
    background: var(--surface) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23044D7F' stroke-width='2'/%3E%3C/svg%3E") no-repeat right .9rem center / .8rem; }
.field input[type=date] { cursor: pointer; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--blue); outline: 3px solid rgba(240,180,41,.7); outline-offset: 1px; }
.field input[type=file] { width: 100%; padding: .9rem; border: 2px dashed #8FA6B8; border-radius: var(--radius); background: var(--sky); font: inherit; font-size: 1rem; cursor: pointer; }
.field input[type=file]::file-selector-button { font: 700 1rem var(--f-body); margin-right: .9rem; padding: .55rem 1rem; border: 0; border-radius: 999px; background: var(--blue); color: #fff; cursor: pointer; }
.counter { font-size: var(--step--1); color: var(--muted); text-align: right; margin: .25rem 0 0; }
.counter.is-near { color: var(--err); font-weight: 700; }

.choice-row { display: flex; flex-wrap: wrap; gap: .6rem; }
.choice { display: inline-flex; align-items: flex-start; gap: .6rem; cursor: pointer; font-weight: 400; }
.choices .choice { align-items: center; min-height: 3rem; padding: .5rem 1rem .5rem .8rem; border: 2px solid #8FA6B8; border-radius: var(--radius); background: var(--surface); }
.choices .choice:has(input:checked) { border-color: var(--blue); background: var(--sky); font-weight: 700; }
.choice input { width: 1.35rem; height: 1.35rem; margin: .15rem 0 0; flex: none; accent-color: var(--blue); }
.choices .choice input { margin: 0; }
.consent .choice { font-size: 1rem; color: var(--muted); }

.has-error input, .has-error select, .has-error textarea, .has-error .choice { border-color: var(--err) !important; }
.field-error { color: var(--err); font-weight: 700; font-size: 1rem; margin: .35rem 0 0; }
.field-error::before { content: "⚠ "; }
.form-foot { font-size: var(--step--1); color: var(--muted); margin: 1.2rem 0; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.notice { border-radius: var(--radius); padding: 1rem 1.2rem; margin-bottom: 1.5rem; border-left: 6px solid; }
.notice p { margin: 0; }
.notice-ok { background: #E4F3EA; border-color: var(--ok); color: #123F29; }
.notice-err { background: #FBE9EA; border-color: var(--err); color: #5F1519; }
.notice:focus { outline: 3px solid var(--sun); }

/* ---------- Salles ---------- */
.salles { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.salle .media { aspect-ratio: 3 / 2; border-radius: var(--radius); overflow: hidden; }
.salle-body { padding-top: 1rem; }
.salle h2 { font-size: var(--step-2); margin-bottom: .5rem; }
.salle.is-off .media { filter: grayscale(.7); opacity: .8; }
@media (max-width: 60rem) { .salles { grid-template-columns: 1fr; max-width: 38rem; } }

/* Réservation de la salle Johanne-Pratte */
.etapes { margin: 1.2rem 0 1.5rem; padding-left: 1.4rem; display: grid; gap: .5rem; }
.etapes li::marker { font-weight: 700; color: var(--blue); }
.dispo { padding: .8rem 1rem; border-radius: var(--radius); background: var(--sky); border-left: 6px solid var(--sky-line); font-size: 1rem; }
.dispo-libre { background: #E4F3EA; border-left-color: var(--ok); }
.dispo-pris { background: var(--sun-soft); border-left-color: var(--sun); }

/* ---------- Hébergement ---------- */
.clienteles { list-style: none; display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; margin-top: 1rem; }
.clienteles .media { aspect-ratio: 4 / 3; border-radius: var(--radius); overflow: hidden; margin-bottom: 1rem; }
.clienteles h3 { font-size: var(--step-2); font-weight: 700; margin-bottom: .4rem; }
@media (max-width: 52rem) { .clienteles { grid-template-columns: 1fr; } }

/* ---------- Nous joindre ---------- */
.contact-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 2.5rem 4rem; }
.contact-block h2 { font-size: var(--step-2); }
.phones { border-collapse: collapse; width: 100%; }
.phones th, .phones td { text-align: left; padding: .6rem 0; border-bottom: 1px solid var(--sky-line); vertical-align: top; }
.phones th { font-weight: 400; color: var(--muted); padding-right: 1rem; }
.phones td { font-weight: 700; }
.map { aspect-ratio: 21 / 8; min-height: 18rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--sky-line); margin-bottom: clamp(3rem, 7vw, 5.5rem); }
.map iframe { width: 100%; height: 100%; border: 0; }
@media (max-width: 52rem) { .contact-grid { grid-template-columns: 1fr; } }

/* ---------- Pied de page ---------- */
.site-footer { background: var(--blue-deep); color: #DCE7F0; padding-top: clamp(3rem, 6vw, 4.5rem); margin-top: 0; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr 1fr; gap: 2rem; }
.footer-name { font-family: var(--f-head); font-size: var(--step-1); color: #fff; font-weight: 700; }
.footer-h { font-weight: 700; color: var(--sun); margin-bottom: .6rem; }
.footer-nav ul, .footer-social ul { list-style: none; display: grid; gap: .45rem; }
.footer-since { font-size: var(--step--1); opacity: .85; }
.footer-legal { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1rem; border-top: 1px solid rgba(255,255,255,.18); margin-top: 2.5rem; padding-block: 1.3rem; font-size: var(--step--1); }
.footer-legal p { margin: 0; }
@media (max-width: 60rem) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 36rem) { .footer-grid { grid-template-columns: 1fr; } }

@media print {
    .site-header, .site-footer, .map, .form, .ligne { display: none; }
    body { font-size: 12pt; }
}