/* shared/legal.css — the legal pages (Privacy Policy, Terms of Use), 2026-11-08.
   A calm reading layout after Apple's legal and support pages: a quiet hero with the date and reading time, an
   "at a glance" summary in plain words, a translucent sticky contents rail that follows the reader, sections divided
   by hairlines, a measured reading column and a closing card that points to the contact form.
   Loaded after site.css and page.css; every rule is scoped under .pg-legal so no other page can be reached. */

.pg-legal {
  --lg-ink: #b6bfd2;
  --lg-hair: rgba(255,255,255,.07);
  --lg-glass: rgba(22,27,39,.62);
}

/* ── hero: the homepage's lit stage (shared/page-stage.css); here only the title size and the chips ── */
.pg-legal .lg-stage { min-height: min(400px, 54vh); }
.pg-legal .lg-stage h1 { font-size: clamp(2.5rem, 5.4vw, 4rem); }
.lg-meta { display: flex; flex-wrap: wrap; gap: 8px; margin: 22px 0 0; padding: 0; list-style: none; }
.lg-meta li {
  display: inline-flex; align-items: center; gap: 7px; min-height: 30px; padding: 0 12px; border-radius: 999px;
  background: rgba(255,255,255,.05); border: 1px solid var(--lg-hair); color: #c3cad9; font-size: .8rem;
}
.lg-meta svg { width: 14px; height: 14px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

/* ── at a glance ── */
.lg-glance { margin: 0 0 44px; }
.lg-glance-h { margin: 0 0 14px; font: 700 .72rem/1 var(--pg-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim); }
.lg-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.lg-cards li { padding: 18px 18px 17px; border-radius: 16px; border: 1px solid var(--lg-hair); background: rgba(255,255,255,.025); }
.lg-cards .lg-ico { display: grid; place-items: center; width: 36px; height: 36px; margin: 0 0 12px; border-radius: 11px; background: rgba(45,212,191,.12); }
.lg-cards .lg-ico svg { width: 19px; height: 19px; fill: none; stroke: var(--accent); stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.lg-cards b { display: block; margin: 0 0 5px; font-size: .96rem; line-height: 1.3; letter-spacing: -.005em; color: var(--text); }
.lg-cards .lg-txt { display: block; color: #98a2b8; font-size: .85rem; line-height: 1.55; }

/* ── contents rail + document ── */
.lg-layout { display: grid; grid-template-columns: 232px minmax(0, 1fr); gap: 56px; align-items: start; margin: 0 0 48px; }
.lg-toc {
  position: sticky; top: 24px; padding: 14px 10px 12px; border-radius: 16px; border: 1px solid var(--lg-hair);
  background: var(--lg-glass); -webkit-backdrop-filter: blur(18px) saturate(160%); backdrop-filter: blur(18px) saturate(160%);
}
.lg-toc summary {
  display: flex; align-items: center; justify-content: space-between; padding: 2px 10px 10px; list-style: none; cursor: default;
  font: 700 .7rem/1 var(--pg-mono); letter-spacing: .14em; text-transform: uppercase; color: var(--text-dim);
}
.lg-toc summary::-webkit-details-marker { display: none; }
.lg-toc ol { margin: 0; padding: 0; list-style: none; counter-reset: toc; }
.lg-toc a {
  position: relative; display: flex; gap: 10px; padding: 7px 10px; border-radius: 9px; color: #98a2b8; text-decoration: none;
  font-size: .84rem; line-height: 1.35; transition: color .15s, background .15s;
}
.lg-toc a::before { counter-increment: toc; content: counter(toc, decimal-leading-zero); flex: none; font: 600 .68rem/1.9 var(--pg-mono); color: #5d6782; }
.lg-toc a:hover { color: var(--text); background: rgba(255,255,255,.04); }
.lg-toc a[aria-current="true"] { color: var(--text); background: rgba(45,212,191,.1); }
.lg-toc a[aria-current="true"]::before { color: var(--accent); }
.lg-toc a:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }

.lg-doc { min-width: 0; max-width: 70ch; }
.pg-legal .lg-doc .pg-section { margin: 0; padding: 30px 0; border-top: 1px solid var(--lg-hair); scroll-margin-top: 16px; }
.pg-legal .lg-doc .pg-section:first-child { padding-top: 4px; border-top: 0; }
.pg-legal .lg-doc .pg-head { gap: 12px; margin: 0 0 12px; }
.pg-legal .lg-doc .pg-head h2 { font-size: clamp(1.2rem, 2.2vw, 1.38rem); font-weight: 700; letter-spacing: -.015em; line-height: 1.25; }
.pg-legal .lg-doc .pg-prose { max-width: none; }
.pg-legal .lg-doc .pg-prose p { color: var(--lg-ink); font-size: 1rem; line-height: 1.72; }
.pg-legal .lg-doc .pg-prose ul { margin: 0 0 14px; padding: 0 0 0 1.15em; }
.pg-legal .lg-doc .pg-prose li { margin: 0 0 8px; color: var(--lg-ink); font-size: 1rem; line-height: 1.65; }
.pg-legal .lg-doc .pg-prose li::marker { color: var(--accent); }
.pg-legal .lg-doc .pg-prose code { padding: 1px 5px; border-radius: 5px; background: rgba(255,255,255,.06); font-size: .88em; }
.pg-legal .lg-doc .pg-prose a { text-decoration-color: rgba(45,212,191,.45); }
.pg-legal .lg-doc .pg-prose a:hover { text-decoration-color: var(--accent); }

/* ── closing card ── */
.lg-cta {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 28px; margin: 0 0 44px;
  padding: 26px 28px; border-radius: 20px; border: 1px solid var(--lg-hair);
  background: radial-gradient(80% 140% at 0% 0%, rgba(45,212,191,.12) 0%, transparent 60%), var(--surface);
}
.lg-cta h2 { margin: 0 0 4px; font-size: 1.25rem; font-weight: 750; letter-spacing: -.015em; }
.lg-cta p { margin: 0; color: var(--lg-ink); font-size: .92rem; line-height: 1.55; }
.lg-cta-go { display: flex; flex-direction: column; align-items: flex-start; gap: 8px; }
.pg-legal .lg-cta .pg-btn.primary { min-height: 46px; padding: 0 22px; border: 0; border-radius: 12px; color: #062420; font-weight: 700; box-shadow: 0 8px 22px rgba(45,212,191,.25); }
.lg-cta small { color: #8f99ae; font-size: .8rem; }
.lg-cta small a { color: var(--accent); }

/* ── narrower windows: one column, the contents fold away ── */
@media (max-width: 960px) {
  .lg-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .lg-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .lg-toc { position: static; padding: 6px; }
  .lg-toc summary { padding: 10px 12px; cursor: pointer; }
  .lg-toc summary::after { content: ""; width: 7px; height: 7px; border-right: 2px solid var(--accent); border-bottom: 2px solid var(--accent); transform: rotate(45deg); transition: transform .2s; }
  .lg-toc[open] summary::after { transform: rotate(-135deg); }
  .lg-toc summary:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 10px; }
  .lg-toc ol { padding: 0 4px 6px; columns: 2; column-gap: 8px; }
  .lg-toc li { break-inside: avoid; }
  .lg-doc { max-width: 72ch; }
}
@media (max-width: 600px) {
  .lg-cards { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .lg-cards li { display: grid; grid-template-columns: 36px minmax(0, 1fr); column-gap: 14px; padding: 14px 16px; }
  .lg-cards .lg-ico { grid-row: span 2; margin: 0; }
  .lg-cards b { margin: 1px 0 3px; }
  .lg-toc ol { columns: 1; }
  .lg-cta { padding: 22px 20px; }
  .lg-cta-go, .pg-legal .lg-cta .pg-btn.primary { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  .lg-toc a, .lg-toc summary::after { transition: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .lg-toc { background: var(--surface); -webkit-backdrop-filter: none; backdrop-filter: none; }
}
@media (prefers-contrast: more) {
  .lg-cards li, .lg-toc, .lg-cta, .lg-meta li { border-color: #8f99ae; }
  .lg-toc a, .lg-cards .lg-txt, .pg-legal .lg-doc .pg-prose p, .pg-legal .lg-doc .pg-prose li { color: var(--text); }
}
