/* ============================================================================
   VALYON — Legal / text page template  ·  scoped to .legal-page
   Ported 1:1 from design_v2_legal. The client pastes plain text into .legal-body;
   bare tags (h2/h3/p/ul/ol/table/blockquote/hr) are styled automatically. Tokens
   are scoped here so the file is self-contained (exact handoff values).
   ========================================================================== */
.legal-page {
  --cream: #F7EFE3;
  --cream-soft: #FBF7F0;
  --dark: #1C1A16;
  --gold: #B8923E;
  --gold-soft: rgba(184,146,62,.28);
  --muted: #6E665B;
  --line: #E7DDCC;
  --shadow-lg: 0 30px 64px -20px rgba(28,26,22,.32);
}
.legal-page .wrap { max-width: 1316px; margin: 0 auto; padding: 0 24px; }

/* breadcrumb */
.legal-page .breadcrumb { padding-top: 24px; font-size: 13px; letter-spacing: .04em; color: var(--muted); }
.legal-page .breadcrumb a { color: var(--muted); transition: color .2s; }
.legal-page .breadcrumb a:hover { color: var(--gold); }
.legal-page .breadcrumb .sep { margin: 0 8px; opacity: .5; }

/* hero */
.legal-page .legal-hero { padding: 46px 0 30px; border-bottom: 1px solid var(--line); }
.legal-page .legal-hero .eyebrow { color: var(--gold); font-weight: 700; font-size: 13px; letter-spacing: .16em; text-transform: uppercase; margin-bottom: 14px; }
.legal-page .legal-hero h1 { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 46px; line-height: 1.08; letter-spacing: -.015em; max-width: 18ch; color: var(--dark); margin: 0; }
.legal-page .legal-hero .meta { display: flex; align-items: center; gap: 18px; margin-top: 18px; flex-wrap: wrap; color: var(--muted); font-size: 14px; }
.legal-page .legal-hero .meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--gold); }

.legal-page .legal-layout { display: grid; grid-template-columns: 248px 1fr; gap: 56px; padding: 44px 0 90px; align-items: start; max-width: 1140px; margin: 0 auto; }

/* ---- table of contents (auto-built from h2) ---- */
.legal-page .legal-toc { position: sticky; top: 104px; }
.legal-page .legal-toc .toc-label { font-size: 11.5px; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; padding-left: 14px; }
.legal-page .legal-toc ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 1px; }
.legal-page .legal-toc a { display: block; padding: 9px 14px; border-left: 2px solid var(--line); font-size: 14px; line-height: 1.4; color: var(--muted); transition: color .18s, border-color .18s; }
.legal-page .legal-toc a:hover { color: var(--dark); }
.legal-page .legal-toc a.active { color: var(--dark); font-weight: 700; border-left-color: var(--gold); }
.legal-page .legal-toc .read-time { margin-top: 20px; padding: 14px; background: var(--cream-soft); border: 1px solid var(--line); border-radius: 12px; font-size: 13px; color: var(--muted); line-height: 1.5; }
.legal-page .legal-toc .read-time b { color: var(--dark); font-weight: 700; }

/* ---- content: bare-tag styling ---- */
.legal-page .legal-body { max-width: none; font-size: 17px; line-height: 1.75; color: #3a342a; text-wrap: pretty; }
.legal-page .legal-body > * { max-width: 68ch; } /* comfortable measure */
/* Gutenberg wraps tables in <figure> — let those span full width. */
.legal-page .legal-body > figure,
.legal-page .legal-body > .wp-block-table { max-width: none; }

.legal-page .legal-body h2 { font-family: 'Playfair Display', serif; font-weight: 700; font-size: 27px; line-height: 1.2; letter-spacing: -.01em; color: var(--dark); margin: 48px 0 4px; padding-top: 20px; scroll-margin-top: 96px; counter-increment: sec; position: relative; }
.legal-page .legal-body h2:first-child { margin-top: 0; padding-top: 0; }
.legal-page .legal-body h2::before { content: counter(sec); display: block; font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 12px; letter-spacing: .1em; color: var(--gold); margin-bottom: 10px; }
.legal-page .legal-body h2::after { content: ""; position: absolute; left: 0; top: 0; width: 42px; height: 2px; background: var(--gold); }

.legal-page .legal-body h3 { font-family: 'Manrope', sans-serif; font-weight: 800; font-size: 17px; letter-spacing: .01em; color: var(--dark); margin: 30px 0 2px; scroll-margin-top: 96px; }

.legal-page .legal-body p { margin: 14px 0; }
.legal-page .legal-body p:first-of-type { margin-top: 18px; }
.legal-page .legal-body .lead { font-size: 19px; line-height: 1.7; color: #4d4639; }

.legal-page .legal-body a { color: var(--gold); font-weight: 600; text-decoration: underline; text-decoration-color: var(--gold-soft); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.legal-page .legal-body a:hover { text-decoration-color: var(--gold); }

.legal-page .legal-body strong, .legal-page .legal-body b { font-weight: 700; color: var(--dark); }

.legal-page .legal-body ul, .legal-page .legal-body ol { margin: 14px 0; padding-left: 0; list-style: none; }
.legal-page .legal-body li { position: relative; padding-left: 28px; margin: 9px 0; }
.legal-page .legal-body ul > li::before { content: ""; position: absolute; left: 6px; top: 12px; width: 6px; height: 6px; border-radius: 50%; background: var(--gold); }
.legal-page .legal-body ol { counter-reset: li; }
.legal-page .legal-body ol > li { counter-increment: li; }
.legal-page .legal-body ol > li::before { content: counter(li); position: absolute; left: 0; top: 1px; font-family: 'Playfair Display', serif; font-weight: 700; font-size: 14px; color: var(--gold); width: 18px; text-align: center; }
.legal-page .legal-body li > ul, .legal-page .legal-body li > ol { margin: 8px 0 4px; }

.legal-page .legal-body blockquote { margin: 22px 0; padding: 18px 22px; background: var(--cream-soft); border-left: 3px solid var(--gold); border-radius: 0 12px 12px 0; color: #4d4639; font-size: 16px; }
.legal-page .legal-body blockquote p { margin: 6px 0; }

.legal-page .legal-body table { width: 100%; max-width: none; border-collapse: collapse; margin: 22px 0; font-size: 15px; }
.legal-page .legal-body th, .legal-page .legal-body td { text-align: left; padding: 13px 16px; border-bottom: 1px solid var(--line); }
.legal-page .legal-body thead th { font-size: 12px; font-weight: 800; letter-spacing: .05em; text-transform: uppercase; color: var(--muted); border-bottom: 1.5px solid var(--gold-soft); }
.legal-page .legal-body tbody tr:hover { background: var(--cream-soft); }
.legal-page .legal-body td { font-variant-numeric: lining-nums tabular-nums; }

.legal-page .legal-body hr { border: none; border-top: 1px solid var(--line); margin: 40px 0; max-width: none; }
.legal-page .legal-body .fineprint { font-size: 14px; color: var(--muted); line-height: 1.7; }

/* back-to-top */
.legal-page .to-top { position: fixed; right: 28px; bottom: 28px; width: 48px; height: 48px; border-radius: 50%; background: var(--dark); color: #fff; border: none; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: var(--shadow-lg); opacity: 0; pointer-events: none; transform: translateY(10px); transition: opacity .25s, transform .25s; z-index: 60; }
.legal-page .to-top.show { opacity: 1; pointer-events: auto; transform: none; }

/* ============================================================================
   Responsive
   ========================================================================== */
@media (max-width: 920px) {
  .legal-page .legal-layout { grid-template-columns: 1fr; gap: 0; }
  .legal-page .legal-toc { position: static; margin-bottom: 6px; border: 1px solid var(--line); border-radius: 14px; background: var(--cream-soft); overflow: hidden; }
  .legal-page .legal-toc .toc-inner { max-height: 0; overflow: hidden; transition: max-height .3s ease; }
  .legal-page .legal-toc.open .toc-inner { max-height: 600px; }
  .legal-page .legal-toc .toc-mob { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 16px 18px; background: none; border: none; cursor: pointer; font-family: inherit; font-weight: 700; font-size: 15px; color: var(--dark); }
  .legal-page .legal-toc .toc-mob svg { transition: transform .25s; }
  .legal-page .legal-toc.open .toc-mob svg { transform: rotate(180deg); }
  .legal-page .legal-toc .toc-label { display: none; }
  .legal-page .legal-toc ul { padding: 6px 12px 14px; }
  .legal-page .legal-toc .read-time { margin: 0 12px 14px; }
}
@media (min-width: 921px) { .legal-page .legal-toc .toc-mob { display: none; } }
@media (max-width: 760px) {
  .legal-page .legal-hero { padding: 30px 0 22px; }
  .legal-page .legal-hero h1 { font-size: 32px; }
  .legal-page .legal-body { font-size: 16px; }
  .legal-page .legal-body h2 { font-size: 23px; }
  .legal-page .legal-layout { padding: 26px 0 70px; }
}
