/* Site layer on Fluid Theme v2 (loaded after the child theme). Only what the theme does not do; anything here that every
   site needs belongs upstream in the-fluid-theme. */
@layer site {
  body { overflow-wrap: break-word; }
  ::placeholder { font-style: italic; } /* stopgap until the-fluid-theme#97 ships the italic placeholder */
  .narrow { max-width: var(--measure, 65ch); }
  .table-scroll { overflow-x: auto; max-width: 100%; }
  .table-scroll:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  .site-forms { display: grid; gap: var(--space-6, 1.5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 22rem), 1fr)); align-items: start; }
  .hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
  .choice-row { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
  .choice { display: inline-flex; gap: 0.5rem; align-items: baseline; font-weight: normal; }
  fieldset.form-group { border: 0; padding: 0; margin: 0; min-width: 0; }
  fieldset.form-group legend { font-weight: 600; margin-bottom: 0.5rem; padding: 0; }
  .sources { margin-top: var(--space-8, 2rem); }
  .sources ul { padding-inline-start: 1.25rem; }
  .sources li { overflow-wrap: anywhere; }
  .answer { max-width: var(--measure, 65ch); }
  .theme-toggle { background: none; border: 0; cursor: pointer; font-family: inherit; color: inherit; padding: 0; }
  .sample-badge { display: inline-block; font-size: 0.75em; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase; border: 1px solid currentColor; padding: 0.1em 0.5em; border-radius: 0.25em; }
  .card-grid { display: grid; gap: var(--space-6, 1.5rem); grid-template-columns: repeat(auto-fit, minmax(min(100%, 18rem), 1fr)); }
  /* Show only what applies (forms.md 7): the service questions appear for an unresolved problem; a browser without
     :has() shows them always (never required). */
  @supports selector(:has(*)) {
    .letter-form:not(:has(input[name="topic"][value="problem"]:checked)) .if-problem { display: none; }
  }
}
/* Books & Literacy: a storybook skin on New base. Agent pick, Neil may change (docs/decisions.md 2026-11-22).
   Cream paper, soft sage / blush / oat / denim / ochre, one rounded serif (Fraunces, SOFT axis, OFL, self-hosted) for
   headings, the theme's grotesk for reading. The illustrations in assets/art/ share one cast: a bear cub in a mustard
   sweater, a white rabbit in a sage scarf and a fox in a denim cap. */
@font-face {
  font-family: 'Fraunces Soft';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('/assets/fonts/fraunces-soft-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@layer site {
  :root {
    --paper: #f2e9da; --oat: #ece2d0; --sage: #a9bba2; --sage-deep: #4f6b4c; --blush: #ecc9c0; --blush-deep: #9a4f45;
    --denim: #8fa7bf; --ochre: #d9a85b; --ink: #3d3530;
    --font-heading: 'Fraunces Soft', 'Iowan Old Style', Georgia, serif;
    --font-display: var(--font-heading);
    --radius-soft: 1.25rem;
  }
  :root[data-theme="light"] {
    --accent: #5a7656; /* deep sage: white on it is 5.0:1 */
    --color-background: var(--paper);
    --color-surface: #fbf7ef;
    --color-surface-raised: #fffdf8;
    --color-text: var(--ink);
    --color-text-muted: #5f544d;
    --color-border: #e2d6c2;
  }
  :root[data-theme="dark"] { --accent: #b9cdb2; --color-background: #2b2622; --color-surface: #342e29; --color-surface-raised: #3b342e; }
  body { background: var(--color-background); }
  .theme-toggle { color: var(--nav-ink, inherit); }
  .section__head { border: 0; padding-top: 0; }
  .site-footer { --_footer-rule: var(--color-border); }
  .card > .card__content { padding: clamp(1.25rem, 3vw, 1.75rem); }
  .section { padding-block: clamp(2.5rem, 6vw, 4.5rem); }
  :root[data-theme="light"] .nav { --nav-bg: var(--paper); --nav-ink: var(--ink); border-bottom: 1px solid var(--color-border); }
  :root[data-theme="dark"] .nav { --nav-bg: #2b2622; --nav-ink: #f2e9da; }
  h1, h2, h3, .hero__headline, .nav__brand, .site-footer__title { font-family: var(--font-heading); font-weight: 600; letter-spacing: -0.005em; }
  .nav__brand { font-size: 1.35rem; }
  .eyebrow { color: var(--blush-deep); letter-spacing: 0.06em; }
  :root[data-theme="dark"] .eyebrow { color: var(--blush); }
  .button { border-radius: 999px; }
  .card { border-radius: var(--radius-soft); border: 1px solid var(--color-border); background: var(--color-surface-raised); box-shadow: 0 1px 0 rgb(61 53 48 / 0.04), 0 8px 24px -16px rgb(61 53 48 / 0.25); }
  [data-bg="tinted"] { background: var(--oat); }
  :root[data-theme="dark"] [data-bg="tinted"] { background: #322c27; }

  /* home hero: text beside the illustration, the art's edges faded into the same cream as the page */
  .story-hero { background: var(--paper); color: var(--ink); }
  /* the hero stays on cream paper in both themes, so its text keeps the light-theme inks */
  :root[data-theme] .story-hero .eyebrow { color: var(--blush-deep); }
  :root[data-theme] .story-hero h1, :root[data-theme] .story-hero .lede { color: var(--ink); }
  :root[data-theme] .story-hero .button:not([data-variant]) { background: #5a7656; color: #fff; }
  .story-hero__inner { display: grid; gap: 1rem; align-items: center; max-width: 76rem; margin-inline: auto; padding: clamp(1.5rem, 4vw, 3rem) 1rem clamp(1rem, 3vw, 2rem); }
  .story-hero__text { gap: 1rem; position: relative; z-index: 1; }
  .story-hero__art { width: 100%; height: auto; display: block; -webkit-mask-image: radial-gradient(ellipse 75% 80% at 62% 55%, #000 60%, transparent 100%); mask-image: radial-gradient(ellipse 75% 80% at 62% 55%, #000 60%, transparent 100%); }
  .story-hero h1 { font-size: clamp(2rem, 4.2vw, 3.3rem); line-height: 1.1; max-width: 16ch; }
  .story-hero h1 em { font-style: italic; color: var(--sage-deep); }
  .story-hero .lede { max-width: 40ch; font-size: clamp(1.05rem, 1.6vw, 1.2rem); }
  @media (min-width: 56rem) {
    .story-hero__inner { grid-template-columns: minmax(18rem, 5fr) 7fr; }
    .story-hero__art { width: 100%; }
  }
  .story-hero .button[data-variant="outline"] { background: transparent; color: var(--ink); border-color: var(--ink); }

  /* shelves: round illustration medallions */
  .shelf-grid { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 9.5rem), 1fr)); }
  @media (max-width: 40rem) { .shelf-tile img { width: 7rem; height: 7rem; } .shelf-tile { padding: 0.5rem; } }
  .shelf-tile { display: grid; justify-items: center; text-align: center; gap: 0.6rem; padding: 1rem; border-radius: var(--radius-soft); text-decoration: none; color: inherit; }
  .shelf-tile:hover .shelf-tile__name, .shelf-tile:focus-visible .shelf-tile__name { text-decoration: underline; }
  .shelf-tile img, .spot { width: 9rem; height: 9rem; border-radius: 50%; object-fit: cover; background: var(--paper); border: 6px solid var(--color-surface-raised); box-shadow: 0 6px 18px -10px rgb(61 53 48 / 0.35); }
  .shelf-tile__name { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 600; }
  .spot--lg { width: 12rem; height: 12rem; }
  .spot--sm { width: 6.5rem; height: 6.5rem; border-width: 4px; }

  /* review cards */
  .review-card .card__content { gap: 0.5rem; }
  .review-card__by { color: var(--color-text-muted); font-size: 0.95rem; }
  .tag { display: inline-block; font-size: 0.8rem; font-weight: 600; padding: 0.15em 0.7em; border-radius: 999px; background: var(--blush); color: #4a2a25; }
  .tag--sage { background: #dbe5d5; color: #2f432d; }
  .tag-row { display: flex; flex-wrap: wrap; gap: 0.4rem; }

  /* the "Find the book" box after a review */
  .get-book__card { border-radius: var(--radius-soft); background: var(--oat); padding: clamp(1.25rem, 4vw, 2rem); border: 1px dashed #cdbb9e; }
  :root[data-theme="dark"] .get-book__card { background: #322c27; border-color: #5a4f45; }
  .get-book cite { font-style: italic; }
  .meta { font-size: 0.9rem; color: var(--color-text-muted); }
  .picked-by { font-weight: 600; color: var(--sage-deep); }
  .site-footer p a, .prose p a, .meta a { text-decoration: underline; }
}
/* Edge accents (Neil, 2026-11-22: small watercolor tokens at the page edges, hints rather than full illustrations).
   Each sits behind the content (z-index -1 inside an isolated parent), partly off the screen edge, and never takes clicks. */
@layer site {
  html, body { overflow-x: clip; }
  .article, [data-deco], .site-footer { position: relative; isolation: isolate; overflow-x: clip; }
  .article::before, [data-deco]::before, .site-footer::before {
    content: ""; position: absolute; z-index: -1; pointer-events: none; background: no-repeat center / contain;
  }
  :root[data-theme="dark"] .article::before, :root[data-theme="dark"] [data-deco]::before, :root[data-theme="dark"] .site-footer::before { opacity: 0.75; }
  /* a vine trailing down the right edge of every article (reviews, shelves, about) */
  .article::before { background-image: url('/assets/art/accents/vine.webp'); top: 0; right: 0; width: clamp(64px, 10vw, 150px); aspect-ratio: 1 / 3; transform: translateX(28%); }
  [data-deco="kite"]::before { background-image: url('/assets/art/accents/kite.webp'); top: 1.5rem; right: 0; width: clamp(70px, 11vw, 150px); aspect-ratio: 3 / 4.5; transform: translateX(18%) rotate(8deg); }
  [data-deco="ball"]::before { background-image: url('/assets/art/accents/ball.webp'); top: clamp(1rem, 4vw, 3rem); right: clamp(0.5rem, 6vw, 6rem); width: clamp(52px, 7vw, 96px); aspect-ratio: 1; }
  [data-deco="blocks"]::before { background-image: url('/assets/art/accents/blocks.webp'); bottom: 1.5rem; right: clamp(0.5rem, 8vw, 9rem); width: clamp(80px, 11vw, 150px); aspect-ratio: 230 / 125; }
  [data-deco="boat"]::before { background-image: url('/assets/art/accents/boat.webp'); top: 2rem; right: clamp(0.5rem, 5vw, 5rem); width: clamp(64px, 9vw, 130px); aspect-ratio: 260 / 310; }
  [data-deco="leaves"]::before { background-image: url('/assets/art/accents/leaves.webp'); top: -1.5rem; left: 0; width: clamp(80px, 12vw, 170px); aspect-ratio: 580 / 640; transform: translateX(-30%) rotate(-10deg); }
  .site-footer::before { background-image: url('/assets/art/accents/leaves.webp'); top: -2.5rem; right: 0; width: clamp(70px, 10vw, 140px); aspect-ratio: 580 / 640; transform: translateX(25%) scaleX(-1); }
  @media (max-width: 47.99rem) {
    .article::before { opacity: 0.55; transform: translateX(48%); }
    [data-deco="ball"]::before, [data-deco="boat"]::before { top: 0.5rem; }
    [data-deco="kite"]::before { opacity: 0.6; transform: translateX(45%) rotate(8deg); }
  }
}
