/* ============================================================
   DOMAINE DU DAHU — Layout digital 1920×1080
   ============================================================ */

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: #2a2a2a;
  font-family: var(--font-body);
  color: var(--ink-deep);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 32px;
  padding: 32px 0;
  --page-zoom: 1;
  overflow-x: hidden;
}

/* === Page master (zoom CSS = scale + layout) === */
.page {
  width: 1920px;
  height: 1080px;
  background: var(--paper);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-soft);
  page-break-after: always;
  display: flex;
  flex-direction: column;
  zoom: var(--page-zoom);
}

.page__inner {
  flex: 1;
  padding: var(--page-margin);
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  position: relative;
  z-index: 2;
  min-height: 0;
  overflow: hidden;
}

/* Propagation min-height: 0 pour autoriser les flex children à shrink */
.page__inner > * {
  min-height: 0;
}
.page__inner > .grid,
.page__inner .grid[style*="flex: 1"] {
  min-height: 0;
}

.page__num {
  display: none;   /* numéros de page masqués sur demande */
}

/* === Variantes de fond === */
.page--warm    { background: var(--paper-warm); }
.page--dark    { background: var(--lake-night); color: var(--paper); }
.page--dark .page__num { color: var(--paper); opacity: 0.55; }

/* === Typographie de base === */
.eyebrow {
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-eyebrow);
  text-transform: uppercase;
  color: var(--accent-rust);
  margin: 0;
}

.h-hero {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-hero);
  letter-spacing: var(--letter-spacing-display);
  line-height: var(--line-height-display);
  margin: 0;
  color: inherit;
}

.h-1 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h1);
  letter-spacing: var(--letter-spacing-display);
  line-height: var(--line-height-display);
  margin: 0;
}

.h-2 {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-h2);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin: 0;
}

.h-3 {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: var(--fs-h3);
  letter-spacing: 0;
  line-height: 1.25;
  margin: 0;
  color: var(--ink-deep);
}

.lead {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: var(--fs-lead);
  line-height: 1.4;
  margin: 0;
  color: var(--ink-soft);
}

.body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: var(--fs-body);
  line-height: var(--line-height-body);
  margin: 0;
  color: var(--ink-deep);
}

.body--soft { color: var(--ink-soft); }
.body--small { font-size: var(--fs-small); }

.quote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 36px;
  line-height: 1.3;
  color: var(--ink-deep);
  margin: 0;
  padding-left: var(--space-4);
  border-left: 2px solid var(--accent-rust);
}

.stat {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--fs-stat);
  color: var(--accent-gold);
  line-height: 1;
  letter-spacing: -0.02em;
}

.hairline {
  border: none;
  border-top: 1px solid var(--hairline);
  margin: 0;
}

.hairline--accent {
  border-color: var(--accent-rust);
  width: 64px;
}

/* === Grilles === */
.grid {
  display: grid;
  gap: var(--grid-gap);
  width: 100%;
}
.grid--2 { grid-template-columns: 1fr 1fr; }
.grid--3 { grid-template-columns: 1fr 1fr 1fr; }
.grid--6 { grid-template-columns: repeat(6, 1fr); }
.grid--split-7-5 { grid-template-columns: 7fr 5fr; }
.grid--split-5-7 { grid-template-columns: 5fr 7fr; }

.flex { display: flex; gap: var(--space-5); }
.flex--col { flex-direction: column; }
.flex--between { justify-content: space-between; }
.flex--center { align-items: center; }
.flex--end { align-items: flex-end; }

.stretch { flex: 1; }

/* === Photos === */
.photo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.photo-frame {
  position: relative;
  overflow: hidden;
  background: var(--paper-warm);
  border-radius: var(--radius-soft);
}

.photo-frame--full {
  position: absolute;
  inset: 0;
  z-index: 1;
}

.photo-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(15, 26, 31, 0.05) 0%,
    rgba(15, 26, 31, 0.15) 50%,
    rgba(15, 26, 31, 0.6) 100%);
  z-index: 2;
}

.photo-overlay--top {
  background: linear-gradient(180deg,
    rgba(15, 26, 31, 0.55) 0%,
    rgba(15, 26, 31, 0.15) 40%,
    rgba(15, 26, 31, 0.05) 100%);
}

.photo-placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background: repeating-linear-gradient(
    45deg,
    var(--paper-warm),
    var(--paper-warm) 12px,
    var(--paper-cool) 12px,
    var(--paper-cool) 24px
  );
  color: var(--accent-rust);
  font-family: var(--font-body);
  font-size: var(--fs-small);
  font-weight: 500;
  letter-spacing: var(--letter-spacing-eyebrow);
  text-transform: uppercase;
  text-align: center;
  padding: var(--space-4);
}

/* === Lists === */
.list-clean {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list-clean li {
  padding: var(--space-3) 0;
  border-top: 1px solid var(--hairline);
  display: flex;
  justify-content: space-between;
  gap: var(--space-5);
  font-size: var(--fs-body);
}
.list-clean li:first-child { border-top: none; }
.list-clean li strong { font-weight: 600; }

.list-bullets {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-bullets li {
  position: relative;
  padding-left: var(--space-4);
  font-size: var(--fs-body);
  line-height: var(--line-height-body);
  margin-bottom: var(--space-2);
}
.list-bullets li::before {
  content: '·';
  position: absolute;
  left: 0;
  color: var(--accent-rust);
  font-weight: 700;
  font-size: 24px;
  line-height: 1;
  top: 4px;
}

.list-check {
  list-style: none;
  padding: 0;
  margin: 0;
}
.list-check li {
  position: relative;
  padding-left: 28px;
  font-size: var(--fs-body);
  line-height: var(--line-height-body);
  margin-bottom: var(--space-3);
}
.list-check li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 14px;
  height: 8px;
  border-left: 2px solid var(--accent-rust);
  border-bottom: 2px solid var(--accent-rust);
  transform: rotate(-45deg);
}

/* === Mark / accent === */
strong, b { font-weight: 600; }
.accent { color: var(--accent-rust); }
.gold   { color: var(--accent-gold); }

/* === Brand mark === */
.brand-mark {
  font-family: var(--font-display);
  font-size: 28px;
  letter-spacing: 0.02em;
  font-style: italic;
}

/* ===== Sélecteur de langue (web) ===== */
.lang-switcher {
  position: fixed; top: 16px; right: 16px; z-index: 1000;
  display: flex; gap: 2px;
  background: rgba(255,255,255,0.92); -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  border: 1px solid var(--hairline); border-radius: 999px;
  padding: 4px; box-shadow: 0 6px 20px rgba(15,26,31,0.16);
}
.lang-switcher a {
  font-family: var(--font-body); font-size: 12px; font-weight: 600; letter-spacing: 0.06em;
  color: var(--ink-soft); text-decoration: none; padding: 6px 10px; border-radius: 999px;
  transition: background 0.15s, color 0.15s; line-height: 1;
}
.lang-switcher a:hover { color: var(--ink-deep); }
.lang-switcher a.active { background: var(--ink-deep); color: var(--paper); }
@media print { .lang-switcher { display: none !important; } }

/* ============================================================
   MOBILE — reflow vertical (< 768px)
   Les pages sont des slides fixes 1920×1080 mises à l'échelle par
   `zoom` (illisible sur mobile). En dessous de 768px on casse le
   canvas fixe : hauteur auto, zoom neutralisé, grilles empilées,
   typo réduite. Nécessite viewport width=device-width dans le HTML.
   ============================================================ */
@media (max-width: 768px) {
  :root {
    --fs-hero:  40px;
    --fs-h1:    30px;
    --fs-h2:    23px;
    --fs-h3:    18px;
    --fs-lead:  18px;
    --fs-body:  16px;
    --fs-small: 14px;
    --fs-stat:  34px;
    --page-margin: 22px;
    --grid-gap: 16px;
    --space-6: 28px;
    --space-7: 32px;
    --space-8: 40px;
    --space-9: 48px;
  }

  body { padding: 0; gap: 10px; background: var(--lake-night); overflow-x: hidden; }

  .page {
    width: 100%;
    height: auto;
    min-height: auto;
    zoom: 1 !important;
    box-shadow: none;
    border-radius: 0;
  }

  /* Pages plein-écran photo : hauteur suffisante pour respirer */
  .page:has(.photo-frame--full) { min-height: 86vh; }

  .page__inner { padding: var(--page-margin); gap: var(--space-5); }

  /* Toutes les grilles s'empilent (classes + inline) */
  .grid, .grid--2, .grid--3, .grid--6,
  .grid--split-7-5, .grid--split-5-7,
  [style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto !important;
  }
  /* Neutralise le placement explicite de la mosaïque (residence-*) */
  [style*="grid-column"] { grid-column: auto !important; }
  [style*="grid-row"]    { grid-row: auto !important; }

  .flex { flex-wrap: wrap; gap: var(--space-3); }

  /* Cadres photo en flux : hauteur fixe lisible (sinon collapse à 0) */
  .photo-frame:not(.photo-frame--full) { height: 220px !important; width: 100%; }

  /* Cartes (cadastre / zonage) : pleine largeur, hauteur naturelle,
     carte entière visible, sans letterbox blanc ni bordure */
  .map-frame {
    background: transparent !important;
    border: none !important;
    padding: 0 !important;
    display: block !important;
    min-height: 0 !important;
    height: auto !important;
  }
  .map-frame img {
    width: 100% !important;
    height: auto !important;
    max-height: none !important;
    max-width: 100% !important;
    object-fit: contain !important;
    border-radius: var(--radius-soft);
  }

  /* Largeurs / paddings inline trop larges */
  [style*="max-width:"] { max-width: 100% !important; }
  [style*="padding-left: var(--space-6)"],
  [style*="padding-left: var(--space-5)"] { padding-left: 0 !important; }
  [style*="margin-right: calc(-1 * var(--page-margin))"] { margin-right: 0 !important; }

  /* Tailles de police inline ramenées au mobile */
  [style*="font-size: 150px"] { font-size: 44px !important; }
  [style*="font-size: 120px"] { font-size: 40px !important; }
  [style*="font-size: 96px"]  { font-size: 38px !important; }
  [style*="font-size: 88px"]  { font-size: 36px !important; }
  [style*="font-size: 84px"]  { font-size: 34px !important; }
  [style*="font-size: 76px"]  { font-size: 32px !important; }
  [style*="font-size: 64px"]  { font-size: 30px !important; }
  [style*="font-size: 60px"]  { font-size: 28px !important; }
  [style*="font-size: 50px"]  { font-size: 26px !important; }
  [style*="font-size: 32px"]  { font-size: 21px !important; }
  [style*="font-size: 30px"]  { font-size: 20px !important; }
  [style*="font-size: 28px"]  { font-size: 19px !important; }
  [style*="font-size: 26px"]  { font-size: 18px !important; }
  [style*="font-size: 25px"]  { font-size: 18px !important; }
  [style*="font-size: 24px"]  { font-size: 17px !important; }
  [style*="font-size: 23px"]  { font-size: 16px !important; }
  [style*="font-size: 22px"]  { font-size: 16px !important; }
  [style*="font-size: 21px"]  { font-size: 16px !important; }
  [style*="font-size: 20px"]  { font-size: 15px !important; }
  [style*="font-size: 19px"]  { font-size: 15px !important; }
  [style*="font-size: 18px"]  { font-size: 15px !important; }
  [style*="font-size: 17px"]  { font-size: 14px !important; }
  [style*="font-size: 16px"]  { font-size: 14px !important; }
  [style*="font-size: 15px"]  { font-size: 13px !important; }
  [style*="font-size: 14px"]  { font-size: 13px !important; }
  [style*="font-size: 13px"]  { font-size: 12px !important; }
  [style*="font-size: 12px"]  { font-size: 11px !important; }

  .quote      { font-size: 20px; padding-left: var(--space-3); }
  .brand-mark { font-size: 20px; }

  .lang-switcher { top: 10px; right: 10px; padding: 3px; gap: 1px; }
  .lang-switcher a { font-size: 11px; padding: 5px 8px; }
}
