/* public/legal/legal.css — Brief 169: Terms, Privacy, Cookies and Help. Builds on my.css (the bar, the buttons)
   and reads tokens.css only. A list of the pages down the left, the words on a white card, a frozen bar.
   Legal pages tidy (Linzie, 8 Nov 2026): the same type as the rest of decodED. DM Sans for the words (loaded by a
   <link> in each page's head, as on index.html; before this it never loaded here and the words fell back to the
   system font), Stolzl Book for headings, at Learn's sizes: a 26px title, 18px sections, 15px words, no big lede. */
:root {
  --legal-display: 'Stolzl', 'DM Sans', system-ui, sans-serif;
  --legal-body: 'DM Sans', system-ui, sans-serif;
}
body { font-family: var(--legal-body); -webkit-font-smoothing: antialiased; }
.legal-bar { position: sticky; top: 0; z-index: 5; }

.legal {
  display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 32px;
  max-width: 1120px; margin: 0 auto; padding: 32px 24px 64px;
}
.legal-nav { position: sticky; top: 92px; align-self: start; display: grid; gap: 2px; }
.legal-nav-title {
  font: 600 12px var(--legal-body); letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--ink-soft); margin: 0 0 8px 10px;
}
.legal-nav a {
  display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: var(--radius-control, 8px);
  color: var(--ink); text-decoration: none; font-size: 14px; font-weight: 500;
}
.legal-nav a:hover { background: var(--surface); }
.legal-nav a[aria-current="page"] { background: var(--orange); color: var(--on-orange); }
.legal-ico {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 6px; background: var(--green);
  display: grid; place-items: center;
}
.legal-ico img { width: 16px; height: 16px; filter: brightness(0) invert(1); }
.legal-nav a[aria-current="page"] .legal-ico { background: transparent; }

.legal-card {
  background: var(--surface); border-radius: var(--radius-panel, 12px); padding: 28px 40px 40px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06); min-width: 0; font-size: 15px; line-height: 1.6;
}
.legal-card h1 { font: 400 26px/1.2 var(--legal-display); letter-spacing: -0.01em; margin: 0 0 4px; }
.legal-card h2 {
  font: 400 18px/1.3 var(--legal-display); margin: 28px 0 8px; padding-top: 20px;
  border-top: 1px solid var(--story-rule, #E3DED4);
}
.legal-card h3 { font: 600 15px/1.4 var(--legal-body); margin: 18px 0 4px; }
.legal-card p { margin: 0 0 10px; }
.legal-card p, .legal-card li { max-width: 72ch; }
.legal-card ul { padding-left: 20px; }
.legal-card li { margin: 4px 0; }
.legal-card a:not(.my-btn) { color: var(--green); }
.legal-updated { color: var(--ink-soft); margin: 0 0 16px; font-size: 13px; }
.legal-lede { margin: 0 0 8px; }


/* Tables: dense, aligned, a dark green header row (the house table). */
.legal-table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 14px; }
.legal-table th {
  background: var(--green); color: #fff; text-align: left; font-weight: 600; padding: 8px 10px;
}
.legal-table td { padding: 8px 10px; border-bottom: 1px solid var(--story-rule, #E3DED4); vertical-align: top; }
.legal-table-wrap { overflow-x: auto; }
.legal-table .legal-num { text-align: right; white-space: nowrap; font-variant-numeric: tabular-nums; }

/* Help: the two ways to reach NZA side by side, then quick answers that open one at a time. */
.help-ways { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; margin: 20px 0 8px; }
.help-way {
  border: 1px solid var(--neutral); border-radius: var(--radius-control, 8px); padding: 16px;
  display: flex; flex-direction: column; gap: 8px;
}
.legal-card .help-way h3 { margin: 0; display: flex; align-items: center; gap: 10px; }
.help-way p { margin: 0; color: var(--ink-soft); font-size: 14px; flex: 1; }
.help-way .my-btn { align-self: flex-start; }
.help-faq details { border-bottom: 1px solid var(--story-rule, #E3DED4); }
.help-faq summary {
  cursor: pointer; padding: 12px 0; font-weight: 600; list-style: none; display: flex; justify-content: space-between; gap: 12px;
}
.help-faq summary::-webkit-details-marker { display: none; }
.help-faq summary::after { content: '+'; color: var(--green); font-size: 18px; line-height: 1; }
.help-faq details[open] summary::after { content: '–'; }
.help-faq details > p, .help-faq details > ul { margin: 0 0 14px; }

@media (max-width: 760px) {
  /* The bar's two buttons pushed the page sideways on a phone: the logo already goes home, so Back to decodED goes. */
  .legal-bar { padding: 10px 16px; }
  .legal-bar .my-btn-quiet { display: none; }
  .legal { grid-template-columns: 1fr; gap: 16px; padding: 16px 16px 48px; }
  .legal-nav { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .legal-nav-title { grid-column: 1 / -1; }
  .legal-card { padding: 20px 18px 28px; }
  .legal-card h1 { font-size: 24px; }
}
