/* ==========================================================================
   Base — Agnesa Mirabel
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  /* Le header est sticky : sans cette marge, une ancre place le titre dessous. */
  scroll-padding-top: 6.5rem;
}

body {
  margin: 0;
  background-color: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: var(--t-base);
  line-height: var(--lh-body);
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;   /* le halo de lanterne peut dépasser : on ne scrolle jamais horizontalement */
}

/* --- Titres ------------------------------------------------------------- */
h1, h2, h3, h4, h5, h6,
.u-display {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-display);
  color: var(--text-strong);
  margin: 0 0 var(--space-md);
  text-wrap: balance;   /* évite les orphelins sur les titres courts */
}

h1 { font-size: var(--t-3xl); }
h2 { font-size: var(--t-2xl); }
h3 { font-size: var(--t-xl); }
h4 { font-size: var(--t-lg); }
h5 { font-size: var(--t-md); }
h6 {
  font-size: var(--t-sm);
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--accent);
}

p, li {
  text-wrap: pretty;
  max-width: var(--measure);
}

p { margin: 0 0 var(--space-md); }

/* --- Liens -------------------------------------------------------------- */
a {
  color: var(--accent);
  text-decoration-color: var(--border-strong);
  text-decoration-thickness: 1px;
  text-underline-offset: .22em;
  transition: color var(--d-fast) ease, text-decoration-color var(--d-fast) ease;
}
a:hover { color: var(--accent-hover); text-decoration-color: currentColor; }

/* Focus visible : obligatoire, et il doit se voir dans les DEUX thèmes. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--r-sm);
}
:where(a, button):focus:not(:focus-visible) { outline: none; }

/* --- Média -------------------------------------------------------------- */
img, picture, svg, video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- Utilitaires -------------------------------------------------------- */
.u-container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.15rem, 4vw, 2.5rem);
}
.u-container--narrow { max-width: var(--container-narrow); }

.u-section { padding-block: clamp(3.5rem, 9vw, var(--space-4xl)); }

.u-eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: var(--t-xs);
  font-weight: 600;
  letter-spacing: var(--ls-caps);
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-sm);
}

.u-lead {
  font-size: var(--t-md);
  line-height: 1.62;
  color: var(--text-muted);
}

/* Lu par les lecteurs d'écran, invisible à l'œil. */
.u-sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* Lien d'évitement — première tabulation de la page. */
.u-skip-link {
  position: absolute;
  top: 0; left: 50%;
  transform: translate(-50%, -120%);
  z-index: 999;
  padding: var(--space-sm) var(--space-lg);
  background: var(--accent);
  color: var(--accent-contrast);
  font-weight: 600;
  border-radius: 0 0 var(--r-md) var(--r-md);
  transition: transform var(--d-fast) var(--ease-out);
}
.u-skip-link:focus { transform: translate(-50%, 0); }

/* --- Filet doré : le motif de cadre de ses couvertures ------------------- */
.u-rule {
  border: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--border-strong) 18%, var(--border-strong) 82%, transparent);
  margin-block: var(--space-xl);
}

/* Ornement de séparation — dessiné en CSS, pas en caractère.
   Le fleuron ❦ (U+2766) n'existe ni dans Playfair Display ni dans Lora : il
   tombait en glyphe de substitution, un petit rectangle bâtard. Un losange
   flanqué de deux filets rend le même service et ne dépend d'aucune police. */
.u-fleuron {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  color: var(--accent-deco);
  user-select: none;
}
.u-fleuron::before,
.u-fleuron::after {
  content: '';
  width: clamp(1.5rem, 5vw, 3rem);
  height: 1px;
  background: linear-gradient(90deg, transparent, currentColor);
}
.u-fleuron::after { background: linear-gradient(90deg, currentColor, transparent); }
/* Le losange central. */
.u-fleuron > span,
.u-fleuron:empty::before { flex: none; }
.u-fleuron > .u-diamond {
  width: 6px; height: 6px;
  background: currentColor;
  transform: rotate(45deg);
  flex: none;
}

/* --- Réduction de mouvement --------------------------------------------- */
/* On garde l'opacité et la couleur (elles aident à comprendre), on retire
   tout déplacement. « Reduced » veut dire moins, pas zéro. */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .js-reveal { opacity: 1 !important; clip-path: none !important; transform: none !important; }
  .c-lantern { display: none !important; }
}

/* --- Impression (elle fera des salons : le contact doit s'imprimer) ------ */
@media print {
  .c-header, .c-footer, .c-lantern, .c-theme-toggle { display: none !important; }
  body { background: #fff; color: #000; }
}
