/* Les Délices de Cestas — site vitrine. Spec : docs/DESIGN.md §N.
   Tokens repris de src/theme/couleurs.ts ; aucune valeur visuelle hors de :root. */

:root {
  --ivoire: #f6f0e9;          /* fondIvoireHaut — fond de page */
  --creme: #fcf8f3;           /* piluleLisere — panneaux légaux */
  --encart: #f2ede5;          /* piluleCreme — marqueurs à compléter */
  --encre: #3a342c;           /* encreAccueil — 10,87:1 sur ivoire */
  --encre-douce: #68574a;     /* encreDouce — 6,08:1 */
  --brun: #583e29;            /* brunSombre — accent unique, 8,69:1 */
  --brun-secondaire: #80654c; /* encreSourdine — 4,78:1, pied de page */
  --filet: #e8dfd1;           /* fondIvoireBas — hairline */
  --voile: rgba(32, 24, 17, 0.5); /* voileModale */

  --e1: 8px;
  --e2: 16px;
  --e3: 24px;
  --e4: 32px;
  --e6: 48px;
  --rayon-bouton: 8px;
  --rayon-panneau: 16px;
  --duree: 200ms;

  --serif: "Playfair Display", Georgia, "Times New Roman", serif;
  --systeme: -apple-system, BlinkMacSystemFont, "Helvetica Neue", Arial, sans-serif;

  --colonne: 560px;
  --gouttiere: var(--e2);
  --ecart: var(--e3);
  --corps: 17px;
  --hauteur-bouton: 48px;
  --logo-max: 560px;
}

@font-face {
  font-family: "Playfair Display";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/playfair-display-600semibold.woff2") format("woff2");
}

@font-face {
  font-family: "Playfair Display";
  font-style: italic;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/playfair-display-600semibold-italic.woff2") format("woff2");
}

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

html {
  color-scheme: light;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--ivoire);
  color: var(--encre);
  font: var(--corps) / 1.5 var(--systeme);
  padding-left: env(safe-area-inset-left);
  padding-right: env(safe-area-inset-right);
}

a {
  color: var(--brun);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

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

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ── Accueil : un écran ─────────────────────────────────────────────────── */

.accueil {
  flex: 1;
  width: 100%;
  max-width: var(--colonne);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--ecart);
  padding: var(--ecart) var(--gouttiere);
  padding-top: calc(var(--ecart) + env(safe-area-inset-top));
}

.marque {
  width: 100%;
  display: flex;
  justify-content: center;
}

.logo {
  display: block;
  width: 100%;
  max-width: var(--logo-max);
  height: auto;
}

.phrase {
  margin: 0;
  max-width: 34ch;
  font: italic 600 clamp(1.25rem, 1rem + 1.2vw, 1.75rem) / 1.35 var(--serif);
  text-align: center;
  text-wrap: balance;
}

.infos {
  margin: 0;
  width: 100%;
  display: grid;
  gap: var(--e1) 0;
}

.infos > div {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: var(--e2);
  align-items: baseline;
}

.infos dt {
  font: 600 12px / 1.5 var(--systeme);
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--encre-douce);
}

.infos dd {
  margin: 0;
}

.infos address {
  font-style: normal;
}

.infos a {
  text-decoration: none;
}

.infos a:hover {
  text-decoration: underline;
}

.actions {
  margin: 0;
  width: 100%;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--e2);
}

.bouton {
  flex: 1 1 200px;
  max-width: 272px;
  min-height: var(--hauteur-bouton);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 var(--e3);
  border: 1px solid var(--brun);
  border-radius: var(--rayon-bouton);
  font-weight: 600;
  text-decoration: none;
  transition: filter var(--duree) ease-out;
}

.bouton-plein {
  background: var(--brun);
  color: var(--ivoire);
}

.bouton-filet {
  background: transparent;
  color: var(--brun);
}

.bouton:hover {
  filter: brightness(0.92);
}

/* Bloc « Téléchargez l'application » — commenté dans le HTML jusqu'à la publication. */
.app {
  width: 100%;
  display: grid;
  justify-items: center;
  gap: var(--e1);
  text-align: center;
}

.app-titre {
  margin: 0;
  font: 600 clamp(1.125rem, 1rem + 0.6vw, 1.375rem) / 1.3 var(--serif);
}

.app-badges {
  margin: var(--e1) 0 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--e2);
}

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 128px;
  height: 40px;
  padding: 0 var(--e2);
  border-radius: 6px;
  background: var(--encre);
  color: var(--ivoire);
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
}

.pied {
  width: 100%;
  max-width: var(--colonne);
  margin: 0 var(--gouttiere);
  padding: var(--e2) 0 calc(var(--e2) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--filet);
  text-align: center;
  font-size: 14px;
  line-height: 1.5;
  color: var(--brun-secondaire);
}

.pied p {
  margin: 0 0 var(--e1);
}

.pied-liens a {
  color: var(--brun);
}

/* Écrans peu hauts (iPhone 15, iPad paysage, ordinateur 720 px) : même hiérarchie, moins d'air. */
@media (max-height: 860px) {
  :root {
    --ecart: var(--e2);
    --logo-max: 480px;
  }
}

/* Le plus petit (iPhone SE, 667 px) : les blancs se resserrent, les tailles de texte non. */
@media (max-height: 700px) {
  :root {
    --ecart: 12px;
  }

  .accueil {
    padding-top: calc(var(--e1) + env(safe-area-inset-top));
    padding-bottom: var(--e1);
  }

  .pied {
    padding-top: 12px;
    padding-bottom: calc(12px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 400px) {
  :root {
    --corps: 16px;
    --hauteur-bouton: 44px;
  }
}

@media (min-width: 480px) {
  :root {
    --gouttiere: var(--e4);
  }

  .infos > div {
    grid-template-columns: 112px 1fr;
  }
}

/* Large et bas (paysage, ordinateur portable) : les quatre informations en deux colonnes,
   libellé au-dessus de sa valeur — la hauteur du bloc est divisée par deux. */
@media (min-width: 768px) and (max-height: 860px) {
  :root {
    --colonne: 640px;
  }

  .infos {
    grid-template-columns: 1fr 1fr;
    gap: var(--e2) var(--e4);
  }

  .infos > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
}

@media (min-height: 900px) and (min-width: 768px) {
  :root {
    --ecart: var(--e4);
  }
}

/* ── Panneaux légaux : par-dessus la page, ouverts par :target ───────────── */

.panneau {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
}

.panneau:target {
  display: block;
}

.voile {
  position: absolute;
  inset: 0;
  background: var(--voile);
}

.panneau-corps {
  --haut: var(--e3);
  position: relative;
  height: 100%;
  overflow: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  background: var(--creme);
  color: var(--encre);
  padding: 0 var(--e2) calc(var(--e4) + env(safe-area-inset-bottom));
  padding-left: calc(var(--e2) + env(safe-area-inset-left));
  padding-right: calc(var(--e2) + env(safe-area-inset-right));
}

.panneau-entete {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: var(--e2);
  padding: calc(var(--haut) + env(safe-area-inset-top)) 0 var(--e2);
  background: var(--creme);
}

.panneau h2 {
  margin: 0;
  font: 600 clamp(1.5rem, 1.2rem + 1.5vw, 2rem) / 1.2 var(--serif);
}

.fermer {
  flex: none;
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 var(--e2);
  border: 1px solid var(--brun);
  border-radius: var(--rayon-bouton);
  color: var(--brun);
  font-weight: 600;
  text-decoration: none;
}

.maj {
  margin: 0 0 var(--e3);
  color: var(--encre-douce);
  font-size: 14px;
}

.panneau h3 {
  margin: var(--e3) 0 var(--e1);
  font: 600 var(--corps) / 1.4 var(--systeme);
}

.panneau p,
.panneau ul {
  margin: 0 0 var(--e2);
  max-width: 70ch;
}

.panneau ul {
  padding-left: 1.25em;
}

.panneau li {
  margin-bottom: var(--e1);
}

.panneau a {
  overflow-wrap: anywhere;
}

.a-completer {
  padding: 0 4px;
  background: var(--encart);
  color: var(--encre);
  border-bottom: 1px dashed var(--brun-secondaire);
}

@media (min-width: 768px) {
  .panneau {
    display: none;
    overflow: auto;
  }

  .panneau-corps {
    --haut: var(--e4);
    margin: var(--e6) auto;
    max-width: 720px;
    height: auto;
    max-height: calc(100vh - 96px);
    max-height: calc(100svh - 96px);
    border-radius: var(--rayon-panneau);
    padding-left: var(--e6);
    padding-right: var(--e6);
  }
}

/* Le voile et le panneau apparaissent ENSEMBLE (fondu sur le conteneur), le corps monte de
   8 px. Animer l'opacité du corps seul laissait la page se voir à pleine lumière pendant
   l'ouverture, sans le voile — mesuré à la capture. */
@media (prefers-reduced-motion: no-preference) {
  .panneau:target {
    animation: fondu var(--duree) ease-out;
  }

  .panneau:target .panneau-corps {
    animation: monter var(--duree) ease-out;
  }

  @keyframes fondu {
    from {
      opacity: 0;
    }

    to {
      opacity: 1;
    }
  }

  @keyframes monter {
    from {
      transform: translateY(8px);
    }

    to {
      transform: none;
    }
  }
}

/* ── Page 404 ────────────────────────────────────────────────────────────── */

.absente {
  flex: 1;
  width: 100%;
  max-width: var(--colonne);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: var(--e3);
  padding: var(--e3) var(--gouttiere);
  text-align: center;
}

.absente h1 {
  margin: 0;
  font: 600 clamp(1.5rem, 1.2rem + 1.5vw, 2rem) / 1.2 var(--serif);
}

.absente p {
  margin: 0;
}
