/* ═══════════════════════════════════════════════════════════════
   theme.css: shared tokens for the cobalt + cream aesthetic
   (two-colour print, grainy paper, swashy high-contrast italic serif).
   ═══════════════════════════════════════════════════════════════ */
@import url("https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght,SOFT,WONK@0,9..144,300..900,0..100,0..1;1,9..144,300..900,0..100,0..1&family=EB+Garamond:ital,wght@0,400;0,500;0,600;1,400&display=swap");

:root {
  /* the two inks */
  --cobalt:      #2B57A7;   /* main blue, from the reference */
  --cobalt-deep: #1D3F80;   /* text on cream, shadows, pressed */
  --cobalt-soft: #6F8FCB;   /* hairlines, hover tints */
  --cream:       #F3ECDC;   /* main cream, from the reference */
  --cream-deep:  #E4D8BF;   /* shadows on cream, dividers */
  --paper:       #F8F3E8;   /* page background */

  --ink: var(--cobalt-deep);

  --font-display: "Fraunces", "Bodoni 72", "Didot", Georgia, serif;
  --font-body: "EB Garamond", "Garamond", Georgia, serif;

  /* grain texture (SVG noise), used as an overlay everywhere */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  0 0 0 .55 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* Ombre background: cream at the top fading slowly into cobalt at the bottom */
.ombre {
  min-height: 100vh;
  background-color: var(--cobalt);
  background-image: linear-gradient(to bottom,
    var(--cream) 0%, var(--cream) 8%, #DCD8D0 28%, #9DAFD2 52%, #5F80C0 70%, var(--cobalt) 86%);
  background-image: linear-gradient(in oklab to bottom,
    var(--cream) 0%, var(--cream) 8%, var(--cobalt) 86%);
}

/* swashy display italic: Fraunces with its "wonky" soft italic forms */
.display {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 800;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  letter-spacing: -0.02em;
}

/* grain overlay for the whole page */
.grain::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background-image: var(--grain);
  opacity: 0.16;
  mix-blend-mode: multiply;
}

/* Duotone: turns any full-colour image into cobalt + cream using the SVG
   filter that editions.js adds to the page.
   Markup: <div class="duo"><div class="img" style="background-image:..."></div></div> */
.duo { position: relative; overflow: hidden; background: var(--cobalt); }
.duo .img {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  filter: url(#duotone) contrast(1.05);
  transition: filter 0.3s;
}

/* small ornament used as a divider: ~❦~ */
.flourish { display: block; width: 120px; height: 18px; margin: 0 auto; color: inherit; }

/* ───────── Placeholder cover (two-tone, giant swash numeral) ─────────
   Used on the home-page tiles and as the reader's front cover until a
   real cover image is added. Sized with container units so it works at
   any size. Odd issues = cobalt ink background, even = cream. */
.ph-cover {
  position: absolute; inset: 0;
  container-type: size;
  overflow: hidden;
  background: var(--cobalt);
  color: var(--cream);
}
.ph-cover.light { background: var(--cream); color: var(--cobalt); }
.ph-cover .ph-mast {
  position: absolute; top: 5cqh; left: 0; right: 0;
  font-family: var(--font-display);
  font-style: italic; font-weight: 600;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 72;
  font-size: 13cqw; letter-spacing: -0.01em; text-align: center; line-height: 1;
}
.ph-cover .ph-num {
  position: absolute; left: -6cqw; bottom: -18cqh;
  font-family: var(--font-display);
  font-style: italic; font-weight: 900;
  font-variation-settings: "SOFT" 100, "WONK" 1, "opsz" 144;
  font-size: 118cqh; line-height: 0.8; letter-spacing: -0.06em;
  transform: rotate(-8deg);
}
.ph-cover .ph-swirl {
  position: absolute; left: -10%; top: 22%; width: 120%; height: 70%;
  fill: none; stroke: currentColor; stroke-width: 1.4; opacity: 0.9;
}
.ph-cover .ph-title {
  position: absolute; right: 6cqw; top: 22cqh;
  font-family: var(--font-body); font-style: italic;
  font-size: 7.5cqw; letter-spacing: 0.04em;
}
.ph-cover .ph-rule {
  position: absolute; top: 19cqh; left: 8cqw; right: 8cqw;
  border-top: 0.6cqw solid currentColor; opacity: 0.8;
}
