/* ==========================================================================
   Rives & Coteaux — feuille de style unique
   Maquette WebnexLab. Aucune dépendance, aucun build.

   Registre : catalogue. Barre de recherche proéminente, cartes régulières,
   chiffres mis en avant. Rien n'est partagé avec les autres maquettes.
   ========================================================================== */

/* --- 1. Jetons de couleur (une ambiance = un bloc) ----------------------- */

:root,
[data-palette="sable"] {
  --bg: #f8f4ec;
  --bg-alt: #f1ebdf;
  --surface: #fffdf8;
  --deep: #2b2419;
  --ink: #241e15;
  --muted: #75695a;
  --line: #e4dac8;
  --accent: #8c6a3f;
  --accent-soft: #f0e7d7;
  --accent-fg: #fffaf1;
  --shadow: 43 36 25;
}

[data-palette="lac"] {
  --bg: #f0f6f6;
  --bg-alt: #e6f0f0;
  --surface: #ffffff;
  --deep: #12252b;
  --ink: #112127;
  --muted: #55696e;
  --line: #d3e3e3;
  --accent: #20707e;
  --accent-soft: #ddeced;
  --accent-fg: #f3fafa;
  --shadow: 18 37 43;
}

[data-palette="brique"] {
  --bg: #faf2ee;
  --bg-alt: #f4e8e2;
  --surface: #fffcfa;
  --deep: #2c1a17;
  --ink: #2a1915;
  --muted: #7c6058;
  --line: #ecd9d0;
  --accent: #a2452e;
  --accent-soft: #f7e2da;
  --accent-fg: #fff7f4;
  --shadow: 44 26 23;
}

[data-palette="alpage"] {
  --bg: #111511;
  --bg-alt: #171c16;
  --surface: #181c17;
  --deep: #0b0e0b;
  --ink: #e9efe4;
  --muted: #93a08b;
  --line: #262d24;
  --accent: #8fb36a;
  --accent-soft: #1e2419;
  --accent-fg: #101410;
  --shadow: 0 0 0;
}

/* --- 2. Jetons non colorés ---------------------------------------------- */

:root {
  --display: "Fraunces", "Georgia", serif;
  --sans: "Work Sans", "Helvetica Neue", Arial, sans-serif;
  --shell: 1220px;
  --gutter: clamp(1.15rem, 5vw, 3.5rem);
  --section: clamp(4rem, 9vw, 7rem);
  --r: 14px;
  --ease: cubic-bezier(.25,.6,.3,1);
}

/* --- 3. Base ------------------------------------------------------------ */

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 1rem; line-height: 1.68; font-weight: 400;
  overflow-x: hidden; -webkit-font-smoothing: antialiased;
  transition: background-color .5s var(--ease), color .5s var(--ease);
}
body.is-locked { overflow: hidden; }

img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul { margin: 0; padding: 0; list-style: none; }

/* L'attribut `hidden` du HTML doit toujours gagner : sans ce garde-fou, un
   `display: grid` posé plus bas (fenêtre modale, panneau de menu, champ
   conditionnel) laisse l'élément visible alors qu'il est marqué caché. */
[hidden] { display: none !important; }

/* Vignette intégrée dans le site WebnexLab (`?apercu=1`) : pas de commandes de
   démonstration, pas de défilement, contenu affiché tout de suite. */
.is-apercu, .is-apercu body { overflow: hidden; }
.is-apercu .palette-picker,
.is-apercu .demo-flag { display: none; }
.is-apercu .reveal { opacity: 1; transform: none; transition: none; }
p { margin: 0; }

h1, h2, h3 { margin: 0; font-family: var(--display); font-weight: 500; line-height: 1.14; }
h1 { font-size: clamp(2.2rem, 5.4vw, 3.7rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.7rem, 3.5vw, 2.5rem); }
h3 { font-size: 1.12rem; line-height: 1.35; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }
.ico { width: 1.15em; height: 1.15em; flex: none; }

.skip-link {
  position: fixed; top: .6rem; left: 50%; transform: translate(-50%, -200%);
  z-index: 300; padding: .6rem 1.1rem; border-radius: 999px;
  background: var(--deep); color: #fff; font-size: .85rem;
}
.skip-link:focus { transform: translate(-50%, 0); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }

.shell { width: 100%; max-width: var(--shell); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--section); }

.eyebrow { font-size: .7rem; text-transform: uppercase; letter-spacing: .18em; font-weight: 600; color: var(--accent); margin-bottom: .9rem; }
.lede { color: var(--muted); font-size: 1.05rem; max-width: 52ch; }

/* --- 4. Apparition ------------------------------------------------------ */

.reveal {
  opacity: 0; transform: translateY(16px);
  transition: opacity .7s var(--ease) var(--d, 0ms), transform .7s var(--ease) var(--d, 0ms);
}
.reveal.is-in { opacity: 1; transform: none; }

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

/* --- 5. Boutons --------------------------------------------------------- */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: .8rem 1.5rem; border-radius: 999px; border: 1px solid transparent;
  font-size: .9rem; font-weight: 500;
  transition: background-color .28s var(--ease), color .28s var(--ease),
              border-color .28s var(--ease), transform .28s var(--ease);
}
.btn:hover { transform: translateY(-2px); }
.btn--solid { background: var(--accent); color: var(--accent-fg); }
.btn--solid:hover { filter: brightness(1.1); }
.btn--mini { padding: .5rem 1rem; font-size: .82rem; border-color: var(--line); }
.btn--mini:hover { border-color: var(--accent); color: var(--accent); }
.btn--full { width: 100%; }

/* --- 6. Sélecteur de palette (sous l'en-tête, à gauche) ----------------- */

.palette-picker { position: fixed; top: 5.7rem; left: 1rem; z-index: 120; }
.palette-picker__toggle {
  display: inline-flex; align-items: center; gap: .5rem; padding: .5rem 1rem .5rem .8rem;
  border-radius: 999px; background: var(--surface); color: var(--ink); border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgb(var(--shadow) / .12); font-size: .8rem; font-weight: 500;
  transition: border-color .25s var(--ease);
}
.palette-picker__toggle:hover { border-color: var(--accent); }
.palette-picker__panel {
  margin-top: .5rem; width: 15.5rem; padding: 1rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  box-shadow: 0 16px 40px rgb(var(--shadow) / .16); animation: pop .28s var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) } }
.palette-picker__title { font-size: .66rem; text-transform: uppercase; letter-spacing: .16em; color: var(--muted); font-weight: 600; margin-bottom: .7rem; }
.palette-picker__grid { display: grid; grid-template-columns: 1fr 1fr; gap: .45rem; }
.palette-picker__grid button {
  display: flex; align-items: center; gap: .5rem; padding: .5rem; border-radius: 9px;
  border: 1px solid var(--line); font-size: .78rem;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.palette-picker__grid button:hover { border-color: var(--accent); }
.palette-picker__grid button[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.palette-picker__grid button span {
  width: 1.1rem; height: 1.1rem; flex: none; border-radius: 999px;
  background: linear-gradient(135deg, var(--sw1) 0 33%, var(--sw2) 33% 66%, var(--sw3) 66%);
  box-shadow: inset 0 0 0 1px rgb(0 0 0 / .12);
}
.palette-picker__note { margin-top: .8rem; font-size: .72rem; line-height: 1.5; color: var(--muted); }

/* --- 7. Bandeau démonstration ------------------------------------------ */

.demo-flag { position: fixed; right: 1rem; bottom: 1rem; z-index: 120; max-width: min(23rem, calc(100vw - 2rem)); }
.demo-flag__row { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .45rem; }

.demo-flag__admin {
  display: inline-flex; align-items: center;
  padding: .55rem 1rem;
  background: var(--surface, #fff); color: var(--ink, #111);
  border: 1px solid var(--line, #ddd);
  font-size: .76rem; font-weight: 600;
  box-shadow: 0 10px 26px rgb(var(--shadow, 0 0 0) / .16);
  transition: transform .25s var(--ease), border-color .25s var(--ease);
}
.demo-flag__admin:hover { transform: translateY(-2px); border-color: currentColor; }

.demo-flag__btn {
  display: flex; align-items: center; gap: .5rem; margin-left: auto;
  padding: .55rem 1rem .55rem .8rem; border-radius: 999px;
  background: var(--deep); color: #fff; font-size: .78rem; font-weight: 500;
  box-shadow: 0 10px 26px rgb(var(--shadow) / .2); transition: transform .25s var(--ease);
}
.demo-flag__btn:hover { transform: translateY(-2px); }
.demo-flag__note {
  margin-top: .6rem; padding: 1.05rem 1.15rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  font-size: .8rem; line-height: 1.6; color: var(--muted);
  box-shadow: 0 16px 40px rgb(var(--shadow) / .16); animation: pop .28s var(--ease);
}
.demo-flag__note p + p { margin-top: .6rem; }
.demo-flag__note strong { color: var(--ink); font-weight: 600; }

/* --- 8. En-tête --------------------------------------------------------- */

.head { position: sticky; top: 0; z-index: 90; background: color-mix(in srgb, var(--bg) 95%, transparent); border-bottom: 1px solid var(--line); }
.head__in { display: flex; align-items: center; gap: 1.5rem; min-height: 4.8rem; }

.brand { display: flex; align-items: center; gap: .7rem; margin-right: auto; }
.brand__mark {
  width: 1.7rem; height: 1.7rem; flex: none; border-radius: 5px 5px 5px 14px;
  background: var(--accent);
  box-shadow: inset 0 -.5rem 0 color-mix(in srgb, var(--accent) 65%, #000);
}
.brand strong { display: block; font-family: var(--display); font-size: 1.08rem; font-weight: 500; line-height: 1.2; }
.brand small { display: block; font-size: .66rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); }

.nav { display: flex; align-items: center; gap: 1.6rem; font-size: .9rem; }
.nav a { color: var(--muted); transition: color .25s var(--ease); }
.nav a:hover { color: var(--accent); }
.nav__cta { padding: .55rem 1.15rem; border-radius: 999px; background: var(--accent); color: var(--accent-fg) !important; font-weight: 500; }
.nav__cta:hover { filter: brightness(1.1); }

.burger { display: none; width: 2.5rem; height: 2.5rem; place-items: center; border-radius: 999px; border: 1px solid var(--line); }

/* --- 9. Héros & recherche ----------------------------------------------- */

.hero { padding-block: clamp(3rem, 7vw, 5rem) 0; }
.hero h1 { margin-bottom: 1.3rem; }

.search {
  display: grid; gap: 1rem; margin-top: 2.6rem; padding: 1.4rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: 0 18px 44px rgb(var(--shadow) / .08);
}
.search__field { display: grid; gap: .3rem; }
.search__field label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--muted); }
.search__field select {
  width: 100%; padding: .65rem .8rem; font: inherit; font-size: .92rem; border-radius: 9px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
.search__field select:focus { outline: none; border-color: var(--accent); }
.search__count { grid-column: 1 / -1; font-size: .84rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: .9rem; }

/* --- 10. Annonces ------------------------------------------------------- */

/* `min()` empêche la colonne de 19 rem de dépasser sur les très petits écrans. */
.listings { display: grid; gap: 1.5rem; grid-template-columns: repeat(auto-fill, minmax(min(19rem, 100%), 1fr)); }

.bien {
  display: flex; flex-direction: column; overflow: hidden; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease), border-color .35s var(--ease);
}
.bien:hover { transform: translateY(-4px); border-color: var(--accent); box-shadow: 0 20px 44px rgb(var(--shadow) / .12); }
.bien[hidden] { display: none; }

.bien__vis { position: relative; display: grid; place-items: center; aspect-ratio: 16 / 10; background: var(--bg-alt); color: var(--accent); }
.bien__vis svg { width: 68%; height: auto; transition: transform .5s var(--ease); }
.bien:hover .bien__vis svg { transform: scale(1.04); }

.bien__badge {
  position: absolute; top: .8rem; left: .8rem; padding: .25rem .7rem; border-radius: 999px;
  background: var(--deep); color: #fff; font-size: .66rem; font-weight: 600;
  text-transform: uppercase; letter-spacing: .1em;
}
.bien__badge--new { background: var(--accent); color: var(--accent-fg); }

.fav {
  position: absolute; top: .7rem; right: .7rem; width: 2.2rem; height: 2.2rem;
  display: grid; place-items: center; border-radius: 999px;
  background: var(--surface); border: 1px solid var(--line); color: var(--muted);
  transition: color .25s var(--ease), border-color .25s var(--ease), transform .25s var(--ease);
}
.fav:hover { color: var(--accent); border-color: var(--accent); transform: scale(1.06); }
.fav.is-on { color: var(--accent); border-color: var(--accent); }
.fav.is-on .ico path { fill: currentColor; }

.bien__body { display: flex; flex-direction: column; gap: .5rem; padding: 1.2rem 1.25rem 1.3rem; flex: 1; }
.bien__loc { display: flex; align-items: center; gap: .35rem; font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); font-weight: 600; }
.bien__specs { display: flex; flex-wrap: wrap; gap: .4rem 1rem; font-size: .85rem; color: var(--muted); }
.bien__specs li { display: flex; align-items: center; gap: .3rem; }
.bien__foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .8rem; margin-top: auto; padding-top: 1rem; border-top: 1px solid var(--line); }
.bien__price { font-family: var(--display); font-size: 1.3rem; font-weight: 600; }

.empty { margin-top: 2rem; padding: 2rem; text-align: center; border: 1px dashed var(--line); border-radius: var(--r); color: var(--muted); }

/* --- 11. Vendre --------------------------------------------------------- */

.split { background: var(--bg-alt); }
.split__in { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); align-items: center; }
.split__text > p:not(.eyebrow) { color: var(--muted); margin-top: 1rem; max-width: 50ch; }

.marks { margin-top: 1.8rem; display: grid; gap: .7rem; }
.marks li { position: relative; padding-left: 1.8rem; font-size: .95rem; }
.marks li::before {
  content: ""; position: absolute; left: 0; top: .52rem; width: .95rem; height: .48rem;
  border-left: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(-45deg);
}

.quote-card {
  padding: 1.9rem 1.7rem; border-radius: var(--r);
  background: var(--surface); border: 1px solid var(--line); border-left: 3px solid var(--accent);
}
.quote-card p { font-family: var(--display); font-size: 1.1rem; line-height: 1.5; }
.quote-card footer { margin-top: 1.1rem; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }

/* --- 12. Chiffres ------------------------------------------------------- */

.block-head { max-width: 54ch; margin-bottom: 2.6rem; }
.block-head h2 { margin-bottom: .9rem; }
.block-head > p:not(.eyebrow) { color: var(--muted); }

.figures { display: grid; gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--r); overflow: hidden; grid-template-columns: repeat(auto-fit, minmax(11rem, 1fr)); }
.figure { background: var(--surface); padding: 1.8rem 1.5rem; display: grid; gap: .3rem; }
.figure strong { font-family: var(--display); font-size: 2.2rem; font-weight: 600; color: var(--accent); line-height: 1; }
.figure span { font-size: .85rem; color: var(--muted); }

/* --- 13. Estimation ----------------------------------------------------- */

.estim { border-top: 1px solid var(--line); }
.estim__in { display: grid; gap: clamp(2rem, 5vw, 4rem); grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: start; }
.estim__lede { color: var(--muted); margin-top: 1rem; max-width: 46ch; }
.estim__phone { margin-top: 1.8rem; font-family: var(--display); font-size: 1.35rem; color: var(--accent); }
.estim__phone span { display: block; font-size: 1rem; color: var(--muted); }

.form { display: grid; gap: 1.05rem; padding: clamp(1.5rem, 4vw, 2.2rem); border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); }
.field { display: grid; gap: .35rem; }
.field label { font-size: .68rem; text-transform: uppercase; letter-spacing: .12em; font-weight: 600; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%; padding: .72rem .85rem; font: inherit; font-size: .95rem; border-radius: 9px;
  background: var(--bg); color: var(--ink); border: 1px solid var(--line);
}
.field textarea { resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field-row { display: grid; gap: 1.05rem; grid-template-columns: 1fr 1fr; }

.form-status { font-size: .84rem; line-height: 1.55; color: var(--accent); }
.form-status:empty { display: none; }

/* --- 14. Pied de page --------------------------------------------------- */

.foot { background: var(--deep); color: #fff; padding-block: 2.8rem 2.2rem; }
.foot__in { display: grid; gap: 1.4rem; }
.foot__brand { display: flex; align-items: center; gap: .8rem; }
.foot__brand strong { font-family: var(--display); font-size: 1.08rem; }
.foot__brand p { font-size: .86rem; color: rgb(255 255 255 / .62); }
.foot__nav { display: flex; flex-wrap: wrap; gap: 1.4rem; font-size: .88rem; color: rgb(255 255 255 / .7); }
.foot__nav a:hover { color: #fff; }
.foot__legal { font-size: .77rem; color: rgb(255 255 255 / .45); max-width: 62ch; }
.foot__legal-links { display: flex; flex-wrap: wrap; justify-content: center; gap: .5rem 1.5rem; margin-top: .85rem; }
.foot__legal-links a { font-size: .85rem; opacity: .85; padding-block: .35rem; text-decoration: underline; text-underline-offset: .2em; text-decoration-color: currentColor; }
.foot__legal-links a:hover, .foot__legal-links a:focus-visible { opacity: 1; }

/* --- 15. Fenêtre de demande de visite ---------------------------------- */

.modal { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1rem; }
.modal__scrim { position: absolute; inset: 0; width: 100%; height: 100%; background: rgb(var(--shadow) / .5); animation: fade .3s var(--ease); }
@keyframes fade { from { opacity: 0 } }

.modal__box {
  position: relative; z-index: 1; width: min(30rem, 100%);
  max-height: calc(100vh - 2rem); overflow-y: auto;
  padding: clamp(1.5rem, 4vw, 2.2rem); border-radius: var(--r);
  background: var(--bg); border: 1px solid var(--line);
  box-shadow: 0 28px 70px rgb(var(--shadow) / .3); animation: rise .35s var(--ease);
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) } }
.modal__box h2 { font-size: 1.35rem; margin-bottom: 1.4rem; }
.modal__box .form { padding: 0; background: none; border: 0; }
.modal__x {
  position: absolute; top: .9rem; right: .9rem; width: 2.2rem; height: 2.2rem;
  display: grid; place-items: center; border-radius: 999px; border: 1px solid var(--line); color: var(--muted);
}
.modal__x:hover { border-color: var(--accent); color: var(--accent); }

/* --- 16. Adaptations ---------------------------------------------------- */

@media (max-width: 1000px) {
  .search { grid-template-columns: 1fr 1fr; }
  .split__in, .estim__in { grid-template-columns: 1fr; }
}

@media (max-width: 780px) {
  .burger { display: grid; }
  .nav {
    position: fixed; inset: 4.8rem 0 auto; z-index: 88; flex-direction: column;
    align-items: stretch; gap: 0; padding: .5rem var(--gutter) 1.4rem;
    background: var(--bg); border-bottom: 1px solid var(--line);
    transform: translateY(-130%); transition: transform .35s var(--ease);
  }
  .nav.is-open { transform: none; }
  .nav a { padding-block: .9rem; border-bottom: 1px solid var(--line); }
  .nav__cta { margin-top: .8rem; text-align: center; border-bottom: 0; }

  .palette-picker { top: 5.5rem; }
  .demo-flag { max-width: calc(100vw - 9.5rem); }
  .demo-flag__note { max-height: 55vh; overflow-y: auto; }
}

@media (max-width: 520px) {
  .search { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
}

@media (max-width: 420px) {
  .palette-picker__toggle span, .demo-flag__btn span { display: none; }
  .palette-picker__panel { width: min(17rem, calc(100vw - 2rem)); }
}
