/* ===========================================================================
   Les Messagers de l'Histoire
   Tokens derived from the Divi site (see content/DESIGN-TOKENS.md), with
   deliberate corrections: warmer paper ground, accessible link colour,
   larger body text, slimmer header.
   =========================================================================== */

:root {
  /* --- brand ------------------------------------------------------------ */
  --sand:        #e9d287;   /* collection band — measured from live site   */
  --sand-deep:   #d9bc60;
  --sand-pale:   #f6ecc9;
  --sky:         #daebf3;   /* philosophie band                            */
  --sky-deep:    #b9d9e8;

  /* Live site used #46b6f2 for links: 2.3:1 on white, fails WCAG AA.
     Kept as a decorative accent; text links use the darker tone.          */
  --accent:      #46b6f2;
  --accent-text: #12708f;   /* 5.1:1 on paper — AA for body text           */
  --accent-deep: #0b556d;

  /* --- ink & ground ----------------------------------------------------- */
  --paper:       #fdfbf6;   /* warm off-white, not stark #fff              */
  --paper-2:     #f7f2e8;
  --ink:         #2a2622;   /* headings (was #333)                         */
  --body:        #55504a;   /* body copy (was #666, now 7.4:1)             */
  --muted:       #857d72;
  --rule:        #e2dbcd;
  --night:       #222222;   /* footer                                      */
  --night-soft:  #9a938a;

  /* --- type ------------------------------------------------------------- */
  --display: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --text:    "Karla", "Segoe UI", system-ui, sans-serif;

  --step--1: clamp(0.86rem, 0.83rem + 0.13vw, 0.94rem);
  --step-0:  clamp(1.02rem, 0.99rem + 0.16vw, 1.12rem);
  --step-1:  clamp(1.2rem,  1.13rem + 0.34vw, 1.4rem);
  --step-2:  clamp(1.45rem, 1.32rem + 0.64vw, 1.85rem);
  --step-3:  clamp(1.8rem,  1.55rem + 1.2vw,  2.6rem);
  --step-4:  clamp(2.2rem,  1.7rem  + 2.4vw,  3.9rem);

  /* --- space & shape ---------------------------------------------------- */
  --gutter:  clamp(1.25rem, 0.9rem + 1.7vw, 2.75rem);
  --measure: 62ch;
  --shell:   1180px;
  --radius:  3px;          /* Divi used 3px — kept                         */
  --shadow-s: 0 1px 2px rgba(42,38,34,.06), 0 3px 10px rgba(42,38,34,.05);
  --shadow-m: 0 2px 6px rgba(42,38,34,.07), 0 14px 36px rgba(42,38,34,.09);
  --header-h: 78px;
}

/* ===========================================================================
   base
   =========================================================================== */

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--body);
  font-family: var(--text);
  font-size: var(--step-0);
  line-height: 1.72;
  font-synthesis-weight: none;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--display);
  color: var(--ink);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: .004em;
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); }

p  { margin: 0 0 1.15em; max-width: var(--measure); text-wrap: pretty; }
figure, blockquote { margin: 0; }   /* browsers default figure to 1em 40px */
ul, ol { max-width: var(--measure); }

a { color: var(--accent-text); text-underline-offset: .18em; text-decoration-thickness: 1px; }
/* pasted URLs and e-mail addresses in the legal pages have no break
   opportunities of their own */
.prose { overflow-wrap: anywhere; }
a:hover { color: var(--accent-deep); }

img { max-width: 100%; height: auto; display: block; }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

:focus-visible {
  outline: 3px solid var(--accent-text);
  outline-offset: 3px;
  border-radius: 2px;
}

.shell { width: min(100% - (var(--gutter) * 2), var(--shell)); margin-inline: auto; }
.narrow { width: min(100% - (var(--gutter) * 2), 760px); margin-inline: auto; }

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%);
  white-space: nowrap; border: 0;
  inset-inline-start: 0; inset-block-start: 0;   /* pin, so it can never
                                                    stretch a scroll parent */
}

.skip-link {
  position: absolute; left: 50%; translate: -50% -120%;
  z-index: 200; background: var(--ink); color: var(--paper);
  padding: .7rem 1.3rem; border-radius: 0 0 var(--radius) var(--radius);
  font-size: var(--step--1); letter-spacing: .06em; text-transform: uppercase;
  transition: translate .18s ease;
}
.skip-link:focus { translate: -50% 0; color: var(--paper); }

/* ===========================================================================
   header
   =========================================================================== */

.masthead {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(10px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .25s ease, box-shadow .25s ease;
}
.masthead[data-scrolled="true"] {
  border-bottom-color: var(--rule);
  box-shadow: 0 1px 14px rgba(42,38,34,.05);
}
.masthead__inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: .8rem; text-decoration: none; margin-right: auto; min-width: 0; }
.brand img { width: 40px; height: auto; flex: none; }
@media (max-width: 400px) {
  .brand { gap: .55rem; }
  .brand img { width: 32px; }
  .brand__name { font-size: .92rem; letter-spacing: .03em; }
}
.brand__name {
  font-family: var(--display);
  font-size: clamp(1.02rem, .93rem + .42vw, 1.34rem);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: .055em;
  text-transform: uppercase;
  line-height: 1.05;
}
.brand:hover .brand__name { color: var(--accent-deep); }

.nav { display: flex; align-items: center; gap: clamp(.9rem, .3rem + 1.1vw, 1.85rem); }
.nav a {
  font-size: var(--step--1);
  letter-spacing: .09em;
  text-transform: uppercase;
  text-decoration: none;
  color: var(--body);
  padding: .45rem 0;
  position: relative;
  white-space: nowrap;
}
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0;
  height: 2px; background: var(--accent);
  scale: 0 1; transform-origin: left; transition: scale .26s cubic-bezier(.22,1,.36,1);
}
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a:hover::after, .nav a[aria-current="page"]::after { scale: 1 1; }

.nav-toggle {
  display: none; background: none; border: 0; cursor: pointer;
  padding: .55rem; margin-right: -.55rem; color: var(--ink);
}
.nav-toggle svg { display: block; }
.nav-toggle .icon-close { display: none; }
.nav-toggle[aria-expanded="true"] .icon-open  { display: none; }
.nav-toggle[aria-expanded="true"] .icon-close { display: block; }

@media (max-width: 900px) {
  .nav-toggle { display: block; }
  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--rule);
    box-shadow: var(--shadow-m);
    padding: .5rem var(--gutter) 1.4rem;
    display: none;
  }
  .nav[data-open="true"] { display: flex; }
  .nav a { padding: .95rem 0; border-bottom: 1px solid var(--rule); font-size: var(--step-0); }
  .nav a:last-child { border-bottom: 0; }
  .nav a::after { display: none; }
}

/* ===========================================================================
   bands
   =========================================================================== */

.band { padding-block: clamp(3.5rem, 2.2rem + 5vw, 7rem); }
.band--sand  { background: var(--sand); }
.band--sky   { background: var(--sky); }
.band--paper { background: var(--paper); }
.band--tint  { background: var(--paper-2); }

.band__head { text-align: center; margin-bottom: clamp(2.2rem, 1.4rem + 2.6vw, 3.6rem); }
.band__head p { margin-inline: auto; color: var(--body); }

.eyebrow {
  font-family: var(--text);
  font-size: var(--step--1);
  letter-spacing: .19em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 .9rem;
  max-width: none;
}
.band--sand .eyebrow { color: #8a7429; }
.band--sky  .eyebrow { color: #4b7c92; }

/* ===========================================================================
   hero
   =========================================================================== */

.hero {
  position: relative;
  min-height: clamp(440px, 62vh, 660px);
  display: grid; align-items: center;
  overflow: hidden;
  background: var(--sky);
  isolation: isolate;
}
.hero__media { position: absolute; inset: 0; z-index: -2; }
.hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 42%; }
/* Scrim only where the text sits. The illustrated figure occupies the left
   of the banner and must stay at full saturation — an all-over veil washes
   the artwork out. */
.hero::after {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: linear-gradient(100deg,
    rgba(253,251,246,0)    0%,
    rgba(253,251,246,0)   38%,
    rgba(253,251,246,.55) 50%,
    rgba(253,251,246,.88) 64%,
    rgba(253,251,246,.95) 78%);
}
.hero__inner { padding-block: clamp(3rem, 2rem + 4vw, 5.5rem); }
.hero__copy { max-width: 34ch; margin-left: auto; text-align: center; }
@media (max-width: 820px) {
  /* Narrow screens stack text over the art, so instead of veiling the whole
     image the copy gets its own panel and the artwork stays vivid. */
  .hero__copy {
    margin-inline: auto;
    background: color-mix(in srgb, var(--paper) 88%, transparent);
    backdrop-filter: blur(6px);
    border-radius: var(--radius);
    padding: 1.6rem 1.3rem 1.2rem;
    max-width: 30ch;
  }
  .hero__media img { object-position: 22% 40%; }
  .hero::after { background: linear-gradient(to bottom, rgba(253,251,246,0), rgba(253,251,246,.22)); }
}
.hero h1 {
  font-size: var(--step-4);
  font-weight: 600;
  letter-spacing: .01em;
  margin-bottom: 1.1rem;
}
.hero__lede { color: var(--body); margin-inline: auto; }

/* ===========================================================================
   buttons
   =========================================================================== */

.btn {
  display: inline-flex; align-items: center; gap: .55rem;
  font-family: var(--text);
  font-size: var(--step--1);
  letter-spacing: .1em;
  text-transform: uppercase;
  text-decoration: none;
  padding: .82rem 1.7rem;
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  color: var(--ink);
  background: transparent;
  cursor: pointer;
  transition: background .22s ease, color .22s ease, border-color .22s ease, translate .22s ease;
}
.btn:hover { background: var(--ink); color: var(--paper); translate: 0 -2px; }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--accent-deep); border-color: var(--accent-deep); color: var(--paper); }
.btn--light { border-color: var(--paper); color: var(--paper); }
.btn--light:hover { background: var(--paper); color: var(--ink); }
.btn[disabled] { opacity: .55; cursor: not-allowed; translate: none; }

/* ===========================================================================
   books
   =========================================================================== */

.books {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr));
  gap: clamp(1.8rem, 1rem + 3vw, 3.4rem);
  align-items: start;
}
.book { text-align: center; }
.book__cover {
  position: relative;
  display: block;
  margin: 0 auto 1.5rem;
  max-width: 320px;
  border-radius: 2px;
  box-shadow: var(--shadow-m);
  transition: translate .35s cubic-bezier(.22,1,.36,1), box-shadow .35s ease, rotate .35s ease;
}
.book__cover img { border-radius: 2px; }
a.book__cover:hover { translate: 0 -8px; rotate: -.5deg; box-shadow: 0 8px 18px rgba(42,38,34,.12), 0 26px 60px rgba(42,38,34,.16); }
.book h3 { font-size: var(--step-2); margin-bottom: .35rem; }
.book__price {
  font-size: var(--step--1);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #7d6a24;
  margin-bottom: 1.2rem;
}

/* the two "sales modes" — swapped by JS from config.json */
[data-sales-mode] { display: none; }
[data-sales-mode].is-active { display: block; }
.sales-links { display: flex; flex-wrap: wrap; gap: .6rem; justify-content: center; }

/* ===========================================================================
   carousel (replaces Slider Revolution)
   =========================================================================== */

.carousel { position: relative; }
.carousel__viewport {
  display: flex;
  gap: clamp(1rem, .5rem + 1.6vw, 2rem);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scroll-behavior: smooth;
  padding: .5rem .25rem 1.75rem;
  scrollbar-width: thin;
  scrollbar-color: var(--sky-deep) transparent;
  overscroll-behavior-x: contain;
}
@media (prefers-reduced-motion: reduce) { .carousel__viewport { scroll-behavior: auto; } }
.carousel__viewport::-webkit-scrollbar { height: 7px; }
.carousel__viewport::-webkit-scrollbar-track { background: transparent; }
.carousel__viewport::-webkit-scrollbar-thumb { background: var(--sky-deep); border-radius: 99px; }

.slide {
  position: relative;          /* contains .visually-hidden captions, which
                                  would otherwise escape the scroll container */
  flex: 0 0 min(560px, 84%);
  scroll-snap-align: center;
  background: var(--paper);
  border-radius: var(--radius);
  box-shadow: var(--shadow-s);
  overflow: hidden;
  transition: box-shadow .3s ease;
}
.slide:hover { box-shadow: var(--shadow-m); }
.slide img { width: 100%; aspect-ratio: 1 / 1; object-fit: contain; background: var(--paper); }

.carousel__controls {
  display: flex; align-items: center; justify-content: center;
  gap: 1.1rem; margin-top: .4rem;
}
.carousel__btn {
  width: 46px; height: 46px; flex: none;
  display: grid; place-items: center;
  border: 2px solid var(--ink); border-radius: 50%;
  background: transparent; color: var(--ink); cursor: pointer;
  transition: background .2s ease, color .2s ease, opacity .2s ease;
}
.carousel__btn:hover:not([disabled]) { background: var(--ink); color: var(--sky); }
.carousel__btn[disabled] { opacity: .3; cursor: default; }

.carousel__dots { display: flex; gap: .45rem; }
.carousel__dot {
  width: 9px; height: 9px; padding: 0; border-radius: 50%;
  border: 1px solid var(--ink); background: transparent; cursor: pointer;
  transition: background .2s ease, scale .2s ease;
}
.carousel__dot[aria-current="true"] { background: var(--ink); scale: 1.25; }

/* ===========================================================================
   prose (legal pages, bios)
   =========================================================================== */

.prose { max-width: var(--measure); }
.prose h2 { font-size: var(--step-2); margin-top: 2.4em; }
.prose h3 { font-size: var(--step-1); margin-top: 2em; }
.prose h2:first-child, .prose h3:first-child { margin-top: 0; }
.prose li { margin-bottom: .45em; }
.prose ul, .prose ol { padding-inline-start: 1.35rem; }
.prose strong { color: var(--ink); font-weight: 700; }

/* ===========================================================================
   people
   =========================================================================== */

/* Text only — the client asked for the two portraits to come off (2026-09-08).
   .prose is already capped at --measure, so no column layout is needed. */
.person + .person { margin-top: clamp(3rem, 2rem + 3.5vw, 5.5rem); padding-top: clamp(3rem, 2rem + 3.5vw, 5.5rem); border-top: 1px solid var(--rule); }
.person h2 { margin-bottom: .6rem; }

/* ===========================================================================
   media page
   =========================================================================== */

.split {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: clamp(2rem, 1.2rem + 3vw, 4rem);
  align-items: start;
}
.card {
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: clamp(1.3rem, 1rem + 1vw, 2rem);
  box-shadow: var(--shadow-s);
}
.card h3 { font-size: var(--step-1); }

.embed { position: relative; aspect-ratio: 16 / 9; background: var(--night); border-radius: 2px; overflow: hidden; }
.embed iframe, .embed img { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; object-fit: cover; }
.embed__play {
  position: absolute; inset: 0; display: grid; place-items: center;
  border: 0; background: rgba(20,18,16,.28); cursor: pointer; width: 100%; height: 100%;
  transition: background .22s ease;
}
.embed__play:hover { background: rgba(20,18,16,.14); }
.embed__play svg { filter: drop-shadow(0 3px 10px rgba(0,0,0,.45)); transition: scale .22s ease; }
.embed__play:hover svg { scale: 1.08; }

.clipping { display: block; text-decoration: none; }
.clipping + .clipping { margin-top: 1.6rem; }
.clipping img {
  border: 1px solid var(--rule);
  box-shadow: var(--shadow-s);
  transition: translate .3s ease, box-shadow .3s ease;
}
.clipping:hover img { translate: 0 -4px; box-shadow: var(--shadow-m); }
.clipping__meta {
  display: flex; justify-content: space-between; align-items: baseline;
  gap: 1rem; margin-top: .7rem;
  font-size: var(--step--1); letter-spacing: .1em; text-transform: uppercase;
}
.clipping__date { color: var(--muted); }
.clipping__name { color: var(--accent-text); font-weight: 700; }

.socials { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1.6rem; }
.social { text-decoration: none; display: block; }
.social img { border-radius: var(--radius); box-shadow: var(--shadow-s); transition: translate .3s ease, box-shadow .3s ease; }
.social:hover img { translate: 0 -4px; box-shadow: var(--shadow-m); }
.social__label { margin-top: .7rem; font-size: var(--step--1); letter-spacing: .1em; text-transform: uppercase; color: var(--accent-text); font-weight: 700; }
.social__handle { color: var(--muted); font-size: var(--step--1); }

/* ===========================================================================
   forms
   =========================================================================== */

.form { display: grid; gap: 1.15rem; }
.field { display: grid; gap: .4rem; }
.field label { font-size: var(--step--1); letter-spacing: .07em; text-transform: uppercase; color: var(--ink); font-weight: 700; }
.field .hint { font-size: var(--step--1); color: var(--muted); letter-spacing: 0; text-transform: none; font-weight: 400; }

.field input, .field textarea, .field select {
  font: inherit;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: .72rem .9rem;
  width: 100%;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.field input:focus, .field textarea:focus, .field select:focus {
  outline: none;
  border-color: var(--accent-text);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 28%, transparent);
}
.field textarea { min-height: 8.5rem; resize: vertical; }
.field--invalid input, .field--invalid textarea, .field--invalid select { border-color: #b3401f; }
.field__error { font-size: var(--step--1); color: #9c3819; }

.form__row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); gap: 1.15rem; }

/* honeypot — must stay visually gone but not display:none (bots skip those) */
.hp {
  position: absolute !important; left: -9999px !important;
  width: 1px; height: 1px; overflow: hidden;
}

.form__note { font-size: var(--step--1); color: var(--muted); }
.form__status { padding: .9rem 1.1rem; border-radius: var(--radius); font-size: var(--step--1); }
.form__status[data-state="ok"]    { background: #e6f2e4; color: #24571c; border: 1px solid #bcd9b6; }
.form__status[data-state="error"] { background: #fbe9e3; color: #8d3316; border: 1px solid #eec3b3; }

.order-line {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 1rem; align-items: center;
  padding: .85rem 0;
  border-bottom: 1px solid var(--rule);
}
.order-line:last-of-type { border-bottom: 0; }
.order-line__title { font-weight: 700; color: var(--ink); }
.order-line__price { font-size: var(--step--1); color: var(--muted); }
.order-line input[type="number"] { width: 5.5rem; }

/* ===========================================================================
   contact block
   =========================================================================== */

.contact-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: clamp(2rem, 1.2rem + 3vw, 4rem);
  align-items: start;
}
.contact-aside { text-align: center; }
.contact-aside img { max-width: 220px; margin: 0 auto 1.4rem; }
.contact-aside a { font-weight: 700; }

.social-row { display: flex; gap: .6rem; justify-content: center; margin-top: 1.2rem; }
.social-row a {
  width: 42px; height: 42px; display: grid; place-items: center;
  border-radius: 50%; border: 1px solid var(--rule); color: var(--body);
  transition: background .2s ease, color .2s ease, translate .2s ease, border-color .2s ease;
}
.social-row a:hover { background: var(--ink); border-color: var(--ink); color: var(--paper); translate: 0 -2px; }

/* ===========================================================================
   footer
   =========================================================================== */

.colophon { background: var(--night); color: var(--night-soft); padding-block: 2.6rem 2rem; }
.colophon a { color: #cfc7bb; text-decoration: none; }
.colophon a:hover { color: #fff; text-decoration: underline; }
.colophon__nav {
  display: flex; flex-wrap: wrap; gap: .6rem 2rem; justify-content: center;
  font-size: var(--step--1); letter-spacing: .08em; text-transform: uppercase;
  padding-bottom: 1.6rem; border-bottom: 1px solid #343434;
}
.colophon__base {
  display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between;
  align-items: center; padding-top: 1.5rem; font-size: var(--step--1);
}
.colophon__social { display: flex; gap: 1rem; }
.colophon__social a { display: grid; place-items: center; }

/* ===========================================================================
   scroll reveal
   =========================================================================== */

@media (prefers-reduced-motion: no-preference) {
  [data-reveal] {
    opacity: 0;
    translate: 0 18px;
    transition: opacity .7s cubic-bezier(.22,1,.36,1), translate .7s cubic-bezier(.22,1,.36,1);
    transition-delay: var(--reveal-delay, 0ms);
  }
  [data-reveal].is-visible { opacity: 1; translate: none; }
}

/* ===========================================================================
   utilities
   Small and deliberate: the CSP forbids inline style attributes, so anything
   that would have been style="..." lives here instead.
   =========================================================================== */

.u-center      { text-align: center; }
.u-flush       { margin: 0; }
.u-mt          { margin-top: 1rem; }
.u-mt-s        { margin-top: .8rem; }
.u-bare        { border: 0; padding: 0; margin: 0; }
.u-mx          { margin-inline: auto; }
.u-rounded     { border-radius: var(--radius); }
.u-cap-300     { max-width: 300px; margin-inline: auto; }

/* ===========================================================================
   print
   =========================================================================== */

@media print {
  .masthead, .colophon, .carousel__controls, .nav-toggle, .skip-link { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  a::after { content: " (" attr(href) ")"; font-size: .85em; color: #555; }
}
