/* Privacy, Terms and Support (prd-website-legal-pages-restyle, mockup D).
   Linked after site.css, whose tokens, nav, footer and buttons these pages
   reuse; only legal-page rules live here. Not one word of the pages is
   styled away: landingLegalText.test.js fails if a class used on legal text
   is hidden by any rule in site.css or this file. Dark only (Keith K3). */

/* Title band: eyebrow, h1, date line, over the homepage's contour artwork.
   The url() resolves against this file's origin, so it also works when the
   Support page is served from support.planforadventure.com. */
.legal-band {
  position: relative;
  border-bottom: 1px solid var(--border-subtle);
  overflow: hidden;
}
.legal-band::before {
  content: "";
  position: absolute; inset: 0;
  background: url('/img/topo-band.svg') center / cover no-repeat;
  opacity: 0.7;
  pointer-events: none;
}
.legal-band-inner {
  position: relative;
  max-width: var(--site-max); margin: 0 auto;
  padding: 56px var(--site-pad) 40px;
  display: flex; flex-direction: column; gap: 8px;
}
.legal-eyebrow { color: var(--text-brand); }
.legal-band h1 {
  font-family: var(--font-display);
  font-size: 40px; line-height: 44px; font-weight: 900;
  letter-spacing: -0.01em;
}
.legal-meta {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 8px;
  color: var(--text-tertiary);
}
.legal-cross::before { content: "\00B7"; margin-right: 8px; color: var(--text-tertiary); }

/* Two columns: "On this page" beside the reading column. No ancestor of the
   list may clip overflow, or position: sticky stops working. */
.legal-layout {
  max-width: var(--site-max); margin: 0 auto;
  padding: 40px var(--site-pad) 0;
  display: flex; align-items: flex-start; gap: 48px;
}
.legal-toc {
  flex: 0 0 260px;
  position: sticky; top: 93px;
  max-height: calc(100vh - 117px);
  overflow: auto;
  font-size: 14px; line-height: 20px;
}
.legal-toc-label {
  padding: 0 12px 8px;
  font-size: 11px; line-height: 16px; font-weight: 600;
  letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--text-tertiary);
}
.legal-toc ul { margin: 0; padding: 0; list-style: none; display: flex; flex-direction: column; gap: 2px; }
.legal-toc a {
  display: block;
  padding: 6px 12px;
  border-radius: var(--radius-md);
  color: var(--text-secondary);
  text-decoration: none;
  transition: background var(--duration-fast), color var(--duration-fast);
}
.legal-toc a:hover { background: var(--bg-surface-hover); color: var(--text-primary); }
.legal-toc a.on,
.legal-toc a[aria-current] {
  background: var(--interactive-primary-tint);
  color: var(--text-accent);
  font-weight: 600;
}
.legal-toc a:focus-visible { outline-offset: -2px; }

/* Reading column */
.legal-article {
  flex: 1 1 auto; min-width: 0; max-width: 720px;
  /* Bottom space inside the layout's content box, not its padding, so the
     sticky list keeps its place under the header at the end of the page. */
  padding-bottom: 80px;
  color: var(--text-secondary);
}
.legal-article h2 {
  margin: 32px 0 12px;
  font-family: var(--font-display);
  font-size: 22px; line-height: 28px; font-weight: 700;
  color: var(--text-primary);
  scroll-margin-top: 16px;
}
.legal-article > h2:first-child { margin-top: 0; }
.legal-article h3 {
  margin: 24px 0 8px;
  font-size: 17px; line-height: 24px; font-weight: 600;
  color: var(--text-primary);
}
.legal-article p,
.legal-article li { font-size: 17px; line-height: 28px; }
.legal-article p { margin: 0 0 16px; }
.legal-article ul { margin: 0 0 16px; padding-left: 24px; }
.legal-article li { margin-bottom: 8px; }
.legal-article strong { color: var(--text-primary); font-weight: 600; }
.legal-article a { color: var(--interactive-link); text-decoration: underline; text-underline-offset: 2px; }
.legal-article a:hover { color: var(--interactive-link-hover); }

/* Cards: the Privacy services table and the Contact block. */
.legal-card {
  margin: 0 0 16px;
  padding: 16px 20px;
  border-radius: var(--radius-lg);
  background: var(--bg-surface);
  border: 1px solid var(--border-default);
}
.legal-card p:last-child { margin-bottom: 0; }
.legal-table { padding-top: 4px; padding-bottom: 4px; }
.privacy-services { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 22px; }
.privacy-services th,
.privacy-services td {
  padding: 10px 12px 10px 0;
  text-align: left; vertical-align: top;
  border-bottom: 1px solid var(--border-default);
  color: var(--text-secondary);
}
.privacy-services tbody tr:last-child td { border-bottom: 0; }
.privacy-services th,
.privacy-services td:first-child { color: var(--text-primary); font-weight: 600; }
.privacy-services td:first-child { width: 34%; }

/* A short window (iPad landscape, 744 px): tighter entries, so Terms' 15
   still fit beside the last section. */
@media (min-width: 960px) and (max-height: 820px) {
  .legal-toc a { padding-top: 4px; padding-bottom: 4px; }
}

/* Below 960 px the list sits above the text, unstuck, with 44 px targets. */
@media (max-width: 959px) {
  .legal-layout { flex-direction: column; align-items: stretch; gap: 32px; }
  .legal-toc {
    flex: none; position: static; max-height: none; overflow: visible;
    padding: 12px 8px;
    border-radius: var(--radius-lg);
    background: var(--bg-surface);
    border: 1px solid var(--border-default);
  }
  .legal-toc-label { padding-top: 4px; }
  .legal-toc ul { gap: 0; }
  .legal-toc a { min-height: var(--touch-target); display: flex; align-items: center; padding: 8px 12px; }
  .legal-article { max-width: none; }
}
@media (max-width: 600px) {
  .legal-band-inner { padding: 40px 16px 28px; }
  .legal-band h1 { font-size: 32px; line-height: 36px; }
  .legal-meta { flex-direction: column; }
  .legal-cross::before { content: none; }
  .legal-layout { padding: 24px 16px 0; }
  .legal-article { padding-bottom: 60px; }
  .legal-card { padding: 12px 14px; }
  .privacy-services th,
  .privacy-services td { overflow-wrap: anywhere; }
  .privacy-services td:first-child { width: 38%; }
}

/* Print: the text only, dark on white. The page's color-scheme is dark,
   which would resolve Canvas/CanvasText to a dark canvas and white text
   (white on white on paper in Safari), so print switches the scheme to
   light first; the system colours then resolve to white and black. */
@media print {
  :root { color-scheme: light; }
  .site-nav, .legal-toc { display: none; }
  .legal-band::before { background: none; }
  body, .legal-band, .legal-card { background: Canvas; color: CanvasText; border-color: CanvasText; }
  .legal-band h1, .legal-meta, .legal-article, .legal-article h2, .legal-article h3,
  .legal-article strong, .legal-article a, .privacy-services th, .privacy-services td, .site-footer, .site-footer a {
    color: CanvasText;
  }
  .legal-layout { display: block; padding: 0; }
  .legal-band-inner { padding: 0 0 16px; }
  .legal-article { max-width: none; }
}
