/* =========================================================
   EDEN — feuille de style
   Palette : reprise de la DA (vert olivier, bleu nuit, noir)
   + deux tons pris sur la maison (enduit blanc, pierre de la terrasse)
   ========================================================= */

:root {
  /* Couleurs */
  --chaux: #F1F1EC;      /* enduit blanc de la façade : fond principal */
  --pierre: #D8CDB8;     /* pierre de la terrasse : filets et détails */
  --olive: #3E4C3A;      /* DA : vert olivier */
  --nuit: #0D1B2A;       /* DA : bleu nuit, sert d'encre pour le texte */
  --noir: #111111;       /* DA : noir profond, très peu utilisé */
  --olive-clair: #C9D0BF;/* texte secondaire sur fond olivier */

  /* Typo : une seule famille, EB Garamond */
  --serif: "EB Garamond", "Garamond", "Times New Roman", serif;

  /* Échelle typographique (quarte juste, ~1.333) */
  --t-small: 0.9375rem;                         /* 15px */
  --t-body: 1.25rem;                             /* 20px : Garamond a un petit œil */
  --t-lead: 1.5rem;                             /* 24px */
  --t-h2: clamp(2.1rem, 1.4rem + 2.6vw, 3.4rem);

  /* Marges */
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --section: clamp(5rem, 11vw, 10rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
/* Quand on clique sur un lien du menu, la section s'arrête sous l'en-tête fixe au lieu de passer dessous */
[id] { scroll-margin-top: 5rem; }
body {
  margin: 0;
  background: var(--chaux);
  color: var(--nuit);
  font-family: var(--serif);
  font-size: var(--t-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-variant-numeric: oldstyle-nums;
}
img { display: block; width: 100%; height: auto; }
figure { margin: 0; }
h1, h2 { margin: 0; font-weight: 400; }
h2 {
  font-size: var(--t-h2);
  line-height: 1.08;
  letter-spacing: -0.01em;
  margin-bottom: 0.6em;
  text-wrap: balance;
}
p { margin: 0 0 1em; max-width: 34em; text-wrap: pretty; }
a { color: inherit; }
:focus-visible { outline: 1px solid currentColor; outline-offset: 4px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}

/* ---------- Logo : le SVG sert de pochoir, la couleur vient de "color" ---------- */
.logo {
  display: block;
  aspect-ratio: 262 / 216;
  background: currentColor;
  -webkit-mask: url("../logo.svg") center / contain no-repeat;
          mask: url("../logo.svg") center / contain no-repeat;
}

/* ---------- En-tête ----------
   Transparent sur la photo, puis fond chaux une fois la photo dépassée
   (la classe .is-solid est ajoutée par main.js) */
.top {
  position: fixed; inset: 0 0 auto 0; z-index: 10;
  display: flex; justify-content: space-between; align-items: center;
  padding: 1.25rem var(--gutter);
  color: var(--chaux);
  transition: background-color .4s ease, color .4s ease;
}
.top.is-solid { background: var(--chaux); color: var(--nuit); }
.top a, .lang {
  text-decoration: none;
  font-size: 1.0625rem;
  letter-spacing: 0.02em;
}
.top__nav, .top__end { display: flex; gap: 2rem; align-items: baseline; }
.lang {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: inherit; font-family: inherit; font-style: italic;
}
.top__book {
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}
.top__nav a:hover, .lang:hover { opacity: .7; }
.top__nav, .top__end { flex: 1; }
.top__end { justify-content: flex-end; }
.top__home { width: 64px; opacity: 0; transition: opacity .4s ease; }
.top.is-solid .top__home { opacity: 1; }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  height: 100svh; min-height: 560px;
  display: grid; justify-items: center; align-items: start;
  overflow: hidden;
  color: var(--chaux);
}
.hero__img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; object-position: 45% 70%;
}
/* Voile léger : assombrit le ciel pour que le logo blanc ressorte */
.hero__veil {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(13,27,42,.30) 0%, rgba(13,27,42,.05) 50%, rgba(13,27,42,.35) 100%);
}
/* Le logo se pose dans le ciel, au-dessus de la ligne des pins */
.hero__logo { position: relative; width: clamp(200px, 24vw, 380px); margin-top: max(9vh, 5rem); }
.hero__place {
  position: absolute; bottom: 2.25rem; left: 0; right: 0;
  margin: 0 auto; text-align: center;
  font-style: italic; font-size: 1.125rem;
}

/* Le seul moment animé du site : la photo se pose, le logo apparaît */
@media (prefers-reduced-motion: no-preference) {
  .hero__img  { animation: settle 2.4s cubic-bezier(.2,.7,.2,1) both; }
  .hero__logo { animation: appear 1.6s .5s ease both; }
  .hero__place{ animation: appear 1.6s 1.1s ease both; }
}
@keyframes settle { from { transform: scale(1.06); } to { transform: none; } }
@keyframes appear { from { opacity: 0; } to { opacity: 1; } }

/* ---------- La maison ---------- */
.intro {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding: var(--section) var(--gutter);
}
.intro__text { grid-column: 2 / span 6; }
.intro__text p:first-of-type { font-size: var(--t-lead); line-height: 1.45; }
.facts {
  grid-column: 9 / span 4;
  align-self: end;
  margin: 0;
}
.facts div {
  display: flex; justify-content: space-between; gap: 1rem;
  padding: .8rem 0;
  border-top: 1px solid var(--pierre);
}
.facts div:last-child { border-bottom: 1px solid var(--pierre); }
.facts dt { color: var(--olive); }
.facts dd { margin: 0; text-align: right; }

/* ---------- Deux photos décalées ---------- */
.pair {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding: 0 var(--gutter) var(--section);
  align-items: end;
}
.pair__tall { grid-column: 1 / span 7; }
.pair__low  { grid-column: 9 / span 4; margin-bottom: 12%; }
figcaption {
  margin-top: .75rem;
  font-size: var(--t-small);
  font-style: italic;
  color: var(--olive);
}

/* ---------- Le jardin (fond olivier) ---------- */
.garden {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  align-items: center;
  background: var(--olive);
  color: var(--chaux);
  padding: var(--section) var(--gutter);
}
.garden__img  { grid-column: 2 / span 4; }
.garden__text h2 { margin-bottom: .8em; }
.garden__text { grid-column: 7 / span 5; }
.garden__text p { color: var(--olive-clair); }

/* ---------- Photo pleine largeur (crépuscule) ---------- */
.wide img { height: min(92vh, 66vw); object-fit: cover; object-position: 50% 55%; }

/* ---------- Galerie ----------
   Mise en colonnes façon "mur de photos" : chaque photo garde son format */
.gallery {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding: var(--section) var(--gutter) 0;
}
.gallery h2 { grid-column: 2 / span 8; }
.gallery__grid {
  grid-column: 1 / -1;
  list-style: none; margin: 1rem 0 0; padding: 0;
  columns: 3;
  column-gap: 1.25rem;
}
.gallery__grid li { break-inside: avoid; margin-bottom: 1.25rem; }
.gallery__grid button {
  display: block; width: 100%;
  padding: 0; border: 0; background: none;
  cursor: zoom-in;
}
.gallery__grid img { transition: opacity .3s ease; }
.gallery__grid button:hover img { opacity: .88; }

/* ---------- Visionneuse (photo en grand) ---------- */
.lightbox {
  width: 100vw; height: 100vh; max-width: none; max-height: none;
  margin: 0; padding: 0; border: 0;
  background: rgba(13,27,42,.97);
  color: var(--chaux);
}
.lightbox[open] { display: flex; flex-direction: column; align-items: center; justify-content: center; }
.lightbox::backdrop { background: rgba(13,27,42,.97); }
.lightbox img {
  width: auto; max-width: 92vw; max-height: 82vh;
  object-fit: contain;
}
.lightbox__bar {
  display: flex; gap: 2rem; align-items: baseline;
  margin-top: 1.5rem;
  font-size: 1.0625rem;
}
.lightbox__bar button {
  background: none; border: 0; padding: 0; cursor: pointer;
  color: inherit; font: inherit; font-style: italic;
}
.lightbox__bar button:hover { opacity: .7; }
.lightbox__bar [data-count] { font-variant-numeric: lining-nums tabular-nums; opacity: .6; }

/* ---------- Alentours ---------- */
.area {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
  padding: var(--section) var(--gutter);
}
.area__text  { grid-column: 2 / span 5; }
.area__table {
  grid-column: 8 / span 4;
  border-collapse: collapse;
  align-self: start;
  margin-top: .6rem;
}
.area__table th, .area__table td {
  padding: .7rem 0;
  border-bottom: 1px solid var(--pierre);
  font-weight: 400;
  text-align: left;
}
.area__table tr:first-child th, .area__table tr:first-child td { border-top: 1px solid var(--pierre); }
.area__table td {
  text-align: right; white-space: nowrap;
  color: var(--olive);
  font-variant-numeric: lining-nums tabular-nums;
}

/* ---------- Réserver (fond bleu nuit) ---------- */
.book {
  background: var(--nuit);
  color: var(--chaux);
  text-align: center;
  padding: var(--section) var(--gutter);
}
.book p { margin-left: auto; margin-right: auto; max-width: 30em; }
.book__mail {
  display: inline-block;
  margin: 1.5rem 0 3rem;
  font-size: clamp(1.5rem, 1rem + 2.6vw, 3rem);
  letter-spacing: -0.01em;
  text-decoration: none;
  border-bottom: 1px solid rgba(241,241,236,.35);
  padding-bottom: .15em;
  overflow-wrap: anywhere;
  transition: border-color .3s ease;
}
.book__mail:hover { border-color: var(--chaux); }
.book__note {
  font-size: var(--t-small);
  font-style: italic;
  color: rgba(241,241,236,.72);
}

/* ---------- Pied de page ---------- */
.foot {
  display: flex; flex-direction: column; align-items: center; gap: .25rem;
  padding: 4rem var(--gutter) 3rem;
  color: var(--olive);
  font-size: var(--t-small);
  text-align: center;
}
.foot p { margin: 0; }
.logo--small { width: 96px; margin-bottom: 1rem; }
.foot__legal { color: rgba(13,27,42,.55); }

/* =========================================================
   Mobile & tablette
   ========================================================= */
@media (max-width: 860px) {
  .top__nav { display: none; }              /* on garde l'essentiel : langue + réserver */
  .top__home { width: 52px; }   /* sur mobile le logo passe à gauche */
  .intro, .pair, .garden, .area, .gallery { grid-template-columns: 1fr; row-gap: 2.5rem; }
  .intro > *, .pair > *, .garden > *, .area > *, .gallery > * { grid-column: 1 / -1; }
  .gallery h2 { grid-column: 1 / -1; }   /* plus spécifique que .gallery > * : on le redit ici */
  .gallery__grid { columns: 2; column-gap: .75rem; margin-top: 0; }
  .gallery__grid li { margin-bottom: .75rem; }
  .lightbox__bar { gap: 1.25rem; }
  .pair__low { margin-bottom: 0; width: 80%; justify-self: end; }
  .garden__img { width: 75%; }
  .hero__img { object-position: 38% 70%; }
}
