/* ============================================================
   GYBPro — Legal pages add-on stylesheet
   Loads AFTER style.css, reuses its :root brand variables
   (navy #14141F · coral-red #E84960 · orange #F47B30 · cream)
   ============================================================ */

/* ---- HERO ---- */
.legal-hero {
  background: var(--cream);
  border-bottom: 1px solid var(--border);
  padding: 3.25rem 0 2.5rem;
  position: relative;
  overflow: hidden;
}
.legal-hero::before {
  content:''; position:absolute; top:-30%; right:-8%;
  width:40%; height:150%;
  background: radial-gradient(ellipse, rgba(244,123,48,0.10), transparent 70%);
  pointer-events:none;
}
.legal-hero .container { position: relative; }
.legal-hero .crumb { margin-bottom: 1rem; }
.legal-hero h1 { font-size: clamp(2rem, 4vw, 3rem); margin-bottom: 0.6rem; }
.legal-hero .legal-sub { font-size: 1.05rem; color: var(--mid); max-width: 640px; line-height: 1.7; }
.legal-meta-pills { display:flex; flex-wrap:wrap; gap:0.6rem; margin-top:1.4rem; }
.legal-pill {
  font-size:0.75rem; font-weight:700; color:var(--ink2);
  background:var(--white); border:1px solid var(--border);
  padding:0.4rem 0.9rem; border-radius:100px;
  display:inline-flex; align-items:center; gap:0.4rem;
}
.legal-pill strong { color: var(--red); font-weight:700; }

/* ---- DOC LAYOUT: sticky TOC + prose ---- */
.legal-wrap { padding: 3rem 0 4rem; }
.legal-doc {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 3.5rem;
  align-items: start;
}
.legal-toc {
  position: sticky; top: 90px;
  max-height: calc(100vh - 110px);
  overflow-y: auto;
  padding-right: 0.75rem;
  border-right: 1px solid var(--border);
}
.legal-toc h4 {
  font-family:'Lato',sans-serif; font-size:0.7rem; font-weight:700;
  letter-spacing:0.12em; text-transform:uppercase; color:var(--muted);
  margin-bottom: 0.9rem;
}
.legal-toc a {
  display:block; font-size:0.82rem; line-height:1.4;
  color:var(--mid); padding:0.32rem 0.6rem; border-radius:7px;
  border-left:2px solid transparent; margin-bottom:1px;
  transition: all .15s;
}
.legal-toc a:hover { color:var(--red); background:var(--cream2); }
.legal-toc a.toc-part {
  font-family:'Playfair Display',serif; font-weight:700;
  font-size:0.8rem; color:var(--ink); margin-top:1rem;
  text-transform:uppercase; letter-spacing:0.02em;
}
.legal-toc a.toc-sec { padding-left:0.9rem; }
.legal-toc a.active { color:var(--red); border-left-color:var(--red); background:var(--cream2); }

/* ---- PROSE BODY ---- */
.legal-body { max-width: 760px; font-size: 0.97rem; color: var(--ink2); line-height: 1.75; }
.legal-body h1 {
  font-size: 1.05rem; font-family:'Lato',sans-serif; font-weight:900;
  letter-spacing:0.08em; text-transform:uppercase; color:var(--red);
  margin: 3rem 0 1.25rem; padding-bottom:0.6rem;
  border-bottom: 2px solid var(--highlight);
  scroll-margin-top: 90px;
}
.legal-body h1:first-child { margin-top: 0; }
.legal-body h2 {
  font-size: 1.3rem; margin: 2.5rem 0 1rem; color: var(--ink);
  scroll-margin-top: 90px; line-height:1.25;
}
.legal-body h2 strong, .legal-body h1 strong { font-weight: inherit; }
.legal-body h3 { font-size:1.05rem; margin:1.75rem 0 0.75rem; color:var(--ink); scroll-margin-top:90px; }
.legal-body p { margin-bottom: 1rem; }
.legal-body strong { color: var(--ink); font-weight: 700; }
.legal-body a { color: var(--red); text-decoration: underline; text-underline-offset: 2px; }
.legal-body ul, .legal-body ol { margin: 0 0 1.1rem 1.3rem; }
.legal-body li { margin-bottom: 0.5rem; }

/* intro/notice paragraphs that were bold headers in source */
.legal-body > p > strong:only-child { }

/* blockquotes (rights lists, definitions) */
.legal-body blockquote {
  margin: 0 0 1.1rem; padding: 0.4rem 0 0.4rem 1.25rem;
  border-left: 3px solid var(--highlight); color: var(--ink2);
}
.legal-body blockquote p { margin-bottom: 0.6rem; }

/* highlighted text from source {.mark} */
.legal-body .mark { background: var(--highlight); padding: 0 0.2em; border-radius:3px; }

/* ---- TABLES ---- */
.legal-body table {
  width: 100%; border-collapse: collapse; margin: 1.25rem 0 1.75rem;
  font-size: 0.86rem; border: 1px solid var(--border);
  border-radius: 10px; overflow: hidden;
}
.legal-body table colgroup { display:none; } /* let content size naturally */
.legal-body th, .legal-body td {
  text-align: left; padding: 0.7rem 0.85rem;
  border-bottom: 1px solid var(--border); vertical-align: top; line-height:1.5;
}
.legal-body thead th, .legal-body tr.header td {
  background: var(--cream2); font-weight: 700; color: var(--ink);
}
.legal-body tbody tr:first-child td strong:only-child { color: var(--ink); }
.legal-body tr.odd td { background: var(--white); }
.legal-body tr.even td { background: #FCFAF7; }
.legal-body td strong { color: var(--ink); }
.legal-body table p { margin: 0 0 0.4rem; }
.legal-body table p:last-child { margin-bottom: 0; }

/* first content table = document meta box, styled as a card */
.legal-body .doc-meta table { background: var(--white); }

/* callout for the "please read carefully" style intro */
.legal-callout {
  background: var(--cream2); border:1px solid rgba(232,73,96,0.2);
  border-radius: var(--radius); padding: 1.25rem 1.5rem; margin: 0 0 1.75rem;
}
.legal-callout p { margin-bottom: 0.5rem; }
.legal-callout p:last-child { margin-bottom: 0; }

/* back-to-top */
.legal-top-link { display:inline-block; margin-top:2.5rem; font-size:0.85rem; font-weight:700; color:var(--red); }

/* cross-link bar between the two legal docs */
.legal-crosslink {
  margin-top: 3rem; padding-top: 2rem; border-top: 1px solid var(--border);
  display:flex; gap:1rem; flex-wrap:wrap; align-items:center; justify-content:space-between;
}
.legal-crosslink span { font-size:0.88rem; color:var(--mid); }

/* ---- RESPONSIVE ---- */
@media (max-width: 920px) {
  .legal-doc { grid-template-columns: 1fr; gap: 1.5rem; }
  .legal-toc {
    position: static; max-height: none; border-right: none;
    border: 1px solid var(--border); border-radius: var(--radius);
    padding: 1.25rem; background: var(--cream2);
    margin-bottom: 1rem;
  }
  .legal-toc.collapsible .toc-links { display:none; }
  .legal-toc.collapsible.open .toc-links { display:block; }
  .legal-body { max-width: none; }
}
@media (max-width: 560px) {
  .legal-body { font-size: 0.93rem; }
  .legal-body table { font-size: 0.8rem; }
  .legal-body th, .legal-body td { padding: 0.55rem 0.6rem; }
}
