/*
 * Navigation du thème — en-tête « Satin Premium » et pied de page « Warm Ivory ».
 * Validés au laboratoire (docs/LABORATOIRE-NAVIGATION.md), chargés sur l’accueil (après
 * assets/app/prisc.css) et sur les pages ordinaires (après assets/css/site.css).
 *
 * - En-tête collé (sticky), hauteur fixe, sous la barre d’administration WordPress ;
 * - --nav-offset (mesuré par le script) règle le décalage des ancres ;
 * - fenêtres (z-index 50) et toast (100) au-dessus de l’en-tête (30) ;
 * - transitions limitées au survol et au focus, coupées en mouvement réduit.
 */

:root {
  --nav-ink: #30251f;
  --nav-muted: #6b5a4e;
  --nav-terra: #9b4936;
  --nav-champagne: #d8bf95;
  --nav-champagne-light: #efe1c4;
  --nav-h: 88px;
  --nav-logo: 72px;
  --nav-pad: clamp(20px, 4vw, 64px);
}

/* Décalage des ancres : hauteur réellement occupée par l’en-tête collé, barre admin comprise. */
html { scroll-padding-top: calc(var(--nav-offset, 88px) + 16px); }

/* ---------- Lien d’évitement (accueil et pages) ---------- */
.screen-reader-text { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus {
  position: fixed !important; top: 8px; left: 8px; z-index: 100000; width: auto; height: auto; clip: auto; clip-path: none;
  padding: 12px 18px; border-radius: 12px; background: #fffdf9; color: var(--nav-ink);
  font: 14px/1.2 Arial, Helvetica, sans-serif; text-decoration: none; box-shadow: 0 6px 20px -8px rgba(48, 37, 31, .45);
  outline: 2px solid var(--nav-terra); outline-offset: 2px;
}
body.admin-bar .skip-link:focus { top: 40px; }
#contenu:focus { outline: none; }

/* ======================================================================
   EN-TÊTE — Satin Premium
   ====================================================================== */
.masthead {
  position: sticky; top: 0; z-index: 30;
  color: var(--nav-ink); font-family: Arial, Helvetica, sans-serif;
  background: linear-gradient(180deg, #fffdf9 0%, #fbf6ee 55%, #f5ede1 100%);
  box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(70, 38, 22, .06), 0 16px 30px -24px rgba(70, 38, 22, .5);
}
.masthead::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; pointer-events: none;
  background: linear-gradient(90deg, rgba(216, 191, 149, 0), var(--nav-champagne) 18%, var(--nav-champagne-light) 50%, var(--nav-champagne) 82%, rgba(216, 191, 149, 0));
}
.masthead[data-stuck] { box-shadow: inset 0 1px 0 #fff, 0 1px 2px rgba(70, 38, 22, .08), 0 18px 34px -22px rgba(70, 38, 22, .55); }
/* Barre d’administration WordPress : fixe (32 px, 46 px sous 783 px), non fixe sous 601 px. */
body.admin-bar .masthead { top: 32px; }
@media (max-width: 782px) { body.admin-bar .masthead { top: 46px; } }
@media (max-width: 600px) { body.admin-bar .masthead { top: 0; } }

.masthead-bar {
  height: var(--nav-h); display: grid; align-items: center; column-gap: 32px;
  grid-template-columns: minmax(max-content, 1fr) auto minmax(max-content, 1fr);
  padding: 0 var(--nav-pad);
}
.masthead-brand { justify-self: start; display: inline-flex; line-height: 0; }
.masthead-brand .brand-logo {
  display: block; height: var(--nav-logo); width: auto; max-width: none;
  /* Logo à fond blanc opaque : multiply laisse voir la surface satinée, tracé noir intact. */
  mix-blend-mode: multiply;
}

.masthead-links ul { display: flex; gap: clamp(28px, 3vw, 44px); margin: 0; padding: 0; list-style: none; }
.masthead-links a {
  position: relative; display: inline-flex; align-items: center; min-height: 44px;
  color: var(--nav-ink); font: 14px/1.2 Arial, Helvetica, sans-serif; letter-spacing: .015em;
  text-decoration: none; white-space: nowrap;
}
.masthead-links a::after {
  content: ''; position: absolute; left: 0; right: 0; bottom: 10px; height: 1px;
  background: var(--nav-terra); transform: scaleX(0); transform-origin: left center; transition: transform .2s ease;
}
.masthead-links a:is(:hover, :focus-visible) { color: var(--nav-ink); }
.masthead-links a:is(:hover, :focus-visible)::after,
.masthead-links a[aria-current]::after,
.masthead-links .current-menu-item > a::after { transform: scaleX(1); }
.masthead-links a[aria-current], .masthead-links .current-menu-item > a { color: var(--nav-terra); }

.masthead-actions { justify-self: end; display: flex; align-items: center; gap: 20px; }

/* CTA : bouton terracotta satiné du thème (rayon 16 px) à la hauteur de l’en-tête, reflet au tiers haut. */
.button.masthead-cta {
  position: relative; isolation: isolate;
  min-height: 44px; padding: 10px 20px; gap: 9px;
  font: 13px/1.2 Arial, Helvetica, sans-serif; letter-spacing: .01em; white-space: nowrap; text-decoration: none;
}
.button.masthead-cta svg { flex-shrink: 0; }
.button.masthead-cta::before {
  content: ''; position: absolute; z-index: -1; inset: 1px 1px 70% 1px; pointer-events: none;
  border-radius: 15px 15px 4px 4px / 12px 12px 2px 2px;
  background: linear-gradient(180deg, rgba(255, 236, 214, .28), rgba(255, 236, 214, 0));
}

.masthead-lang {
  display: inline-flex; align-items: center; gap: 8px; min-width: 44px; min-height: 44px; padding: 0 4px;
  border: 0; background: none; color: var(--nav-muted); cursor: pointer;
  font: 12px/1 Arial, Helvetica, sans-serif; letter-spacing: .1em;
}
.masthead-lang [data-on] { color: var(--nav-ink); font-weight: 700; }
.masthead-lang-sep { width: 1px; height: 12px; background: #cbbba8; }
.masthead-lang:hover { color: var(--nav-ink); }

.masthead-bag {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  min-width: 44px; min-height: 44px; padding: 0 4px;
  border: 0; background: none; color: var(--nav-ink); cursor: pointer; text-decoration: none;
  font: 13px/1.2 Arial, Helvetica, sans-serif; white-space: nowrap;
}
.masthead-bag:hover { color: var(--nav-terra); }
.masthead-bag svg { flex-shrink: 0; }
.masthead-count {
  position: absolute; top: 5px; left: 17px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--nav-terra); color: #fffaf4;
  font: 700 10px/18px Arial, Helvetica, sans-serif; text-align: center;
  box-shadow: 0 0 0 2px #fbf6ee, 0 2px 4px rgba(90, 35, 18, .25);
}
.masthead-count[hidden] { display: none; }

.masthead-menu-btn {
  display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -10px;
  border: 0; background: none; color: var(--nav-ink); cursor: pointer;
}
.masthead :focus-visible { outline: 2px solid var(--nav-terra); outline-offset: 4px; }

/* Libellé « Ma sélection » visible si la place le permet. */
@media (max-width: 1279px) {
  .masthead-bag-label { display: none; }
  .masthead-actions { gap: 14px; }
}
/* Menu mobile dès que tout ne tient plus (mesuré en anglais, la langue la plus longue). */
@media (max-width: 1023px) {
  :root { --nav-h: 72px; --nav-logo: 56px; }
  .masthead-bar { grid-template-columns: 1fr auto; }
  .masthead-links, .masthead-actions > .masthead-cta, .masthead-actions > .masthead-lang { display: none; }
  .masthead-menu-btn { display: inline-flex; }
  .masthead-actions { gap: 6px; }
}
@media (max-width: 480px) {
  :root { --nav-h: 68px; --nav-logo: 52px; --nav-pad: 16px; }
}

/* ---------- Panneau mobile (Sheet Radix sur l’accueil, <dialog> natif sur les pages) ---------- */
.masthead-sheet {
  width: min(88vw, 380px) !important; max-width: none !important;
  padding: 0 !important; gap: 0 !important;
  display: flex; flex-direction: column;
  background: linear-gradient(180deg, #fffdf9, #f7f0e5) !important; color: var(--nav-ink);
  border: 0 !important; border-left: 1px solid rgba(216, 191, 149, .6) !important;
  box-shadow: inset 1px 0 0 #fff, -24px 0 60px -30px rgba(50, 26, 14, .45) !important;
  font-family: Arial, Helvetica, sans-serif;
}
.masthead-sheet[data-state="open"] { animation-duration: .24s !important; }
.masthead-sheet[data-state="closed"] { animation-duration: .18s !important; }
body.admin-bar .masthead-sheet { padding-top: 32px !important; }
@media (max-width: 782px) { body.admin-bar .masthead-sheet { padding-top: 46px !important; } }
.masthead-sheet-inner { height: 100%; display: flex; flex-direction: column; }
.masthead-sheet-head {
  display: flex; align-items: center; justify-content: space-between; min-height: 72px;
  padding: 0 14px 0 28px; border-bottom: 1px solid rgba(216, 191, 149, .55);
}
.masthead-sheet-title { margin: 0; color: var(--nav-muted); font: 700 11px/1 Arial, Helvetica, sans-serif; letter-spacing: .2em; text-transform: uppercase; }
.masthead-sheet-close {
  display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px;
  border: 0; background: none; color: var(--nav-ink); cursor: pointer;
}
.masthead-sheet-links { margin: 0; padding: 12px 28px; list-style: none; }
.masthead-sheet-links a {
  display: flex; align-items: center; min-height: 60px;
  border-bottom: 1px solid rgba(216, 191, 149, .45);
  color: var(--nav-ink); font: 26px/1.2 Georgia, 'Times New Roman', serif; letter-spacing: -.02em; text-decoration: none;
}
.masthead-sheet-links a:hover, .masthead-sheet-links a[aria-current] { color: var(--nav-terra); }
.masthead-sheet-foot {
  margin-top: auto; display: flex; flex-direction: column; align-items: stretch; gap: 14px;
  padding: 22px 28px calc(26px + env(safe-area-inset-bottom));
  border-top: 1px solid rgba(216, 191, 149, .45);
}
.button.masthead-cta--block { width: 100%; min-height: 52px; font-size: 14px; }
.masthead-lang--panel { align-self: center; font-size: 13px; }
.masthead-sheet :focus-visible { outline: 2px solid var(--nav-terra); outline-offset: 3px; }

dialog.masthead-sheet {
  position: fixed; inset: 0 0 0 auto; margin: 0; height: 100dvh; max-height: none;
}
dialog.masthead-sheet:not([open]) { display: none; }
dialog.masthead-sheet::backdrop { background: rgba(0, 0, 0, .5); }
html:has(dialog.masthead-sheet[open]) { overflow: hidden; }

/* ======================================================================
   PIED DE PAGE — Warm Ivory
   ====================================================================== */
footer.colophon {
  --colophon-pad: clamp(20px, 6vw, 96px);
  --colophon-gap: clamp(32px, 5vw, 80px);
  position: relative; margin: 0; padding: 72px var(--colophon-pad) 0;
  background: #f2eadf; color: #33261e;
  box-shadow: inset 0 1px 0 var(--nav-champagne), inset 0 2px 0 rgba(255, 251, 244, .75);
  font-family: Arial, Helvetica, sans-serif; font-size: 14px; line-height: 1.6;
}
.colophon-main {
  display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: 40px var(--colophon-gap); padding-bottom: 56px;
}
.colophon-brand > a { display: inline-flex; line-height: 0; padding: 10px 16px; margin: -10px -16px 0; border-radius: 12px; }
.colophon-brand .brand-logo { display: block; height: 64px; width: auto; max-width: none; mix-blend-mode: multiply; }
.colophon-signature { margin: 20px 0 10px; color: #33261e; font: italic 22px/1.3 Georgia, 'Times New Roman', serif; letter-spacing: -.01em; }
.colophon-intro { max-width: 34ch; margin: 0; color: #5e4c40; font-size: 14px; line-height: 1.75; }
.colophon-heading {
  margin: 8px 0 14px; color: #8a4532; font: 700 11px/1.4 Arial, Helvetica, sans-serif; letter-spacing: .18em; text-transform: uppercase;
}
.colophon-group { position: relative; }
/* Filets verticaux au milieu des gouttières : aucune colonne ne se déplace. */
.colophon-group::before {
  content: ''; position: absolute; top: 6px; bottom: 0; left: calc(-1 * var(--colophon-gap) / 2); width: 1px;
  background: linear-gradient(180deg, rgba(184, 151, 106, .45), rgba(184, 151, 106, 0));
}
.colophon-group ul { display: flex; flex-direction: column; gap: 2px; margin: 0; padding: 0; list-style: none; }
.colophon-group :is(a, button), .colophon-place {
  display: inline-flex; align-items: center; min-height: 38px; padding: 0; border: 0; background: none;
  color: #33261e; font: 15px/1.4 Arial, Helvetica, sans-serif; text-align: left; text-decoration: none; cursor: pointer;
}
.colophon-place { cursor: default; }
.colophon-group :is(a, button):hover { color: var(--nav-terra); text-decoration: underline; text-underline-offset: 5px; text-decoration-thickness: 1px; }
.colophon-bottom {
  display: flex; flex-wrap: wrap; align-items: center; gap: 6px 28px;
  padding: 18px 0 22px; border-top: 1px solid rgba(184, 151, 106, .45); color: #5e4c40; font-size: 12px; line-height: 1.5;
}
.colophon-bottom > :last-child { margin-left: auto; }
.colophon-bottom :is(a, button) {
  display: inline-flex; align-items: center; min-height: 32px; padding: 0; border: 0; background: none;
  color: inherit; font: inherit; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; cursor: pointer;
}
footer.colophon :focus-visible { outline: 2px solid var(--nav-terra); outline-offset: 4px; }

@media (max-width: 1023px) {
  .colophon-main { grid-template-columns: 1fr 1fr; }
  .colophon-brand { grid-column: 1 / -1; }
  .colophon-group:first-of-type::before { display: none; }
}
@media (max-width: 640px) {
  footer.colophon { padding-top: 56px; }
  .colophon-main { grid-template-columns: 1fr; gap: 36px; padding-bottom: 40px; }
  .colophon-group::before { display: none; }
  .colophon-brand .brand-logo { height: 56px; }
  .colophon-group :is(a, button), .colophon-place { min-height: 44px; }
  .colophon-bottom { flex-direction: column; align-items: flex-start; gap: 4px; }
  .colophon-bottom > :last-child { margin-left: 0; }
  .colophon-bottom :is(a, button) { min-height: 44px; }
}

/* ---------- Mouvement réduit ---------- */
@media (prefers-reduced-motion: reduce) {
  .masthead-links a::after { transition: none !important; }
  .masthead-sheet { animation: none !important; }
}
