/* Meet Me Gently — shared styles for the /policies/ pages (privacy, terms,
   cookies, refunds, shipping, accessibility, age-verification, imprint, hub).
   Layers on assets/site.css tokens (--bg, --panel, --line, --ink, --ink-soft,
   --serif, --sans, --maxw, --r, --steady, path colors). Literal hex values are
   used only where no token exists. Mobile-first; no horizontal overflow. */

/* ---- breadcrumb (shared class name with /books/, styled locally here) ---- */
.book-crumb { max-width: 860px; margin: 0 auto; padding: 1.1rem clamp(1.1rem, 4vw, 2.4rem) 0; }
.book-crumb a { text-decoration: none; font: 600 .82rem/1 var(--sans); color: var(--ink-soft); }
.book-crumb a:hover { color: var(--ink); text-decoration: underline; }

/* ================= legal-wrap: the readable column ================= */
.legal-wrap {
  max-width: 860px; margin: 0 auto;
  padding: clamp(1.6rem, 5vw, 3rem) clamp(1.1rem, 4vw, 2.4rem) clamp(3rem, 8vw, 5rem);
}

/* ---- hero ---- */
.legal-hero { margin-bottom: clamp(1.8rem, 4vw, 2.6rem); }
.legal-hero h1 { font-size: clamp(2rem, 5.6vw, 3rem); letter-spacing: -.01em; margin: .3rem 0 .6rem; }
.legal-hero .updated { font: 600 .82rem/1 var(--sans); letter-spacing: .04em; color: var(--ink-soft);
  margin: 0 0 1rem; }
.legal-hero .lead { font-size: clamp(1.02rem, 2vw, 1.15rem); color: var(--ink-soft);
  max-width: 68ch; margin: 0; }

/* ================= legal banner — loud but tasteful ================= */
.legal-banner { position: relative; margin: 0 0 clamp(1.6rem, 4vw, 2.2rem);
  background: #fff8e8; border: 1px solid #EAD9A0; border-radius: 14px;
  padding: 1.2rem 1.4rem 1.2rem 1.6rem; }
.legal-banner::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 5px;
  border-radius: 14px 0 0 14px; background: var(--reach, #EA9E04); }
.legal-banner h2 { font-family: var(--sans); font-size: .95rem; font-weight: 800;
  letter-spacing: .01em; color: #6a5a2a; margin: 0 0 .45rem; }
.legal-banner p { margin: 0 0 .5rem; font-size: .92rem; line-height: 1.55; color: #6a5a2a; }
.legal-banner p:last-child { margin-bottom: 0; }
.legal-banner strong { color: #4d3f15; }

/* ================= table of contents ================= */
.legal-toc { border: 1px solid var(--line); border-radius: var(--r); background: var(--panel);
  padding: 1.3rem 1.5rem 1.4rem; margin: 0 0 clamp(2rem, 4vw, 2.8rem); }
.legal-toc h2 { font-size: 1rem; font-family: var(--sans); font-weight: 800;
  letter-spacing: .06em; text-transform: uppercase; color: var(--ink-soft); margin: 0 0 .9rem; }
.legal-toc ol { list-style: none; counter-reset: toc; margin: 0; padding: 0;
  display: grid; grid-template-columns: 1fr 1fr; gap: .35rem 1.5rem; }
.legal-toc li { counter-increment: toc; }
.legal-toc a { display: flex; gap: .5rem; text-decoration: none; color: var(--ink);
  font-size: .93rem; padding: .3rem 0; border-radius: 6px; }
.legal-toc a::before { content: counter(toc) "."; color: var(--ink-soft); font-weight: 600;
  flex: 0 0 auto; }
.legal-toc a:hover, .legal-toc a:focus-visible { color: var(--steady, #0A2472); text-decoration: underline; }
@media (max-width: 640px) {
  .legal-toc ol { grid-template-columns: 1fr; }
}

/* ================= body copy ================= */
.legal-body h2 { font-size: clamp(1.3rem, 3vw, 1.7rem); margin: 2.6rem 0 1rem;
  padding-top: 1.6rem; border-top: 1px solid var(--line); scroll-margin-top: 5.5rem; }
.legal-body > section:first-of-type h2,
.legal-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.legal-body h3 { font-size: 1.08rem; margin: 1.6rem 0 .7rem; }
.legal-body p { line-height: 1.7; font-size: 1.02rem; color: var(--ink-soft); margin: 0 0 1rem; }
.legal-body ul, .legal-body ol { line-height: 1.7; font-size: 1.02rem; color: var(--ink-soft);
  margin: 0 0 1.2rem; padding-left: 1.4rem; }
.legal-body li { margin-bottom: .5rem; }
.legal-body li:last-child { margin-bottom: 0; }
.legal-body strong { color: var(--ink); }
.legal-body a { color: var(--steady, #0A2472); text-decoration-thickness: 1px; text-underline-offset: 2px; }
.legal-body a:hover { text-decoration-thickness: 2px; }
.legal-body h2 + p, .legal-body h3 + p { margin-top: 0; }
.legal-body section + section { margin-top: 0; }

/* ---- back-to-top ---- */
.back-top { display: inline-block; margin: .4rem 0 0; font: 600 .8rem/1 var(--sans);
  color: var(--ink-soft); text-decoration: none; }
.back-top:hover { color: var(--steady, #0A2472); text-decoration: underline; }

/* ================= tables ================= */
.table-scroll { overflow-x: auto; margin: 0 0 1.4rem; border-radius: 12px; border: 1px solid var(--line); }
.legal-table { width: 100%; border-collapse: collapse; font-size: .92rem; min-width: 560px; }
.legal-table caption { text-align: left; font-size: .82rem; color: var(--ink-soft);
  padding: .6rem .9rem; background: var(--panel); }
.legal-table th, .legal-table td { padding: .7rem .9rem; text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--line); line-height: 1.5; }
.legal-table thead th { background: #F3ECDA; color: var(--ink); font-weight: 700;
  font-size: .8rem; letter-spacing: .03em; text-transform: uppercase;
  position: sticky; top: 0; }
.legal-table tbody tr:nth-child(even) { background: rgba(231, 221, 201, .28); }
.legal-table tbody tr:last-child td { border-bottom: none; }

/* ================= placeholder chip ================= */
.placeholder { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .86em; color: #8A5E00; background: #FBF2D8; border: 1px dashed #D9B65A;
  border-radius: 5px; padding: .05em .45em; line-height: 1.4; }

/* ================= note / callout ================= */
.legal-note, .legal-callout { border: 1px solid var(--line); border-left: 4px solid var(--steady, #0A2472);
  background: var(--panel); border-radius: var(--r); padding: 1.1rem 1.3rem; margin: 1.4rem 0; }
.legal-note p, .legal-callout p { margin: 0 0 .6rem; font-size: .96rem; }
.legal-note p:last-child, .legal-callout p:last-child { margin-bottom: 0; }
.legal-note h3, .legal-callout h3 { margin-top: 0; font-size: 1rem; }

/* ================= data-subject-rights grid ================= */
.rights-grid { list-style: none; margin: 0 0 1.4rem; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: .9rem; }
.rights-grid li { border: 1px solid var(--line); background: var(--panel); border-radius: 12px;
  padding: 1rem 1.1rem; font-size: .92rem; line-height: 1.55; color: var(--ink-soft); }
.rights-grid li b, .rights-grid li strong { display: block; color: var(--ink); font-family: var(--serif);
  font-size: 1rem; margin-bottom: .3rem; }

/* ================= policy hub grid (index.html) ================= */
.policy-hub-grid { list-style: none; margin: 0 0 2rem; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 1rem; }
.policy-hub-grid li { border: 1px solid var(--line); background: var(--panel); border-radius: var(--r);
  padding: 1.3rem 1.4rem; display: flex; flex-direction: column; gap: .5rem; }
.policy-hub-grid h3 { font-size: 1.08rem; margin: 0; }
.policy-hub-grid p { margin: 0; font-size: .9rem; color: var(--ink-soft); line-height: 1.55; flex: 1; }
.policy-hub-grid a.read-more { align-self: flex-start; text-decoration: none; font: 700 .84rem/1 var(--sans);
  color: var(--steady, #0A2472); margin-top: .2rem; }
.policy-hub-grid a.read-more:hover { text-decoration: underline; }

/* ---- compliance checklist ---- */
.legal-body ol.checklist { padding-left: 1.6rem; }
.legal-body ol.checklist li { margin-bottom: .7rem; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ================= print ================= */
@media print {
  .site-header, .site-footer, .book-crumb, .legal-toc, .back-top, .skip, .cta-dock { display: none !important; }
  body { background: #fff; }
  .legal-wrap { max-width: none; padding: 0; }
  .legal-banner { border: 1px solid #999; background: #fff; }
  .legal-body h2 { border-top: none; break-after: avoid; }
  a { color: #000; text-decoration: underline; }
  .placeholder { border: 1px dashed #999; background: none; }
}

/* A field that build.py has FILLED from 01_source_of_truth/legal_entity.json.
   It keeps the monospace tone so the reader can still see it is a specific,
   verifiable datum, but drops the amber "unfilled" flag — leaving real details
   dressed as placeholders makes a completed policy page read as a draft. */
.legal-value {
  /* plain inline, not inline-block: an inline-block swallowed the space after the
     comma separating the entity name from the legal form */
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: .92em;
  background: none;
  border: 0;
  padding: 0;
  color: inherit;
}

.btn-cookie-settings {
  font: 600 .92rem/1 var(--sans);
  cursor: pointer;
  padding: .6rem 1.2rem;
  border-radius: 999px;
  background: var(--ink, #14110E);
  color: var(--paper, #FBF7EF);
  border: 1px solid var(--ink, #14110E);
}
.btn-cookie-settings:hover, .btn-cookie-settings:focus-visible {
  opacity: .88;
}
