/* ==========================================================================
   Legal content page template
   Used by: privacy.html, cookies.html, terms.html, data-processing.html
   ========================================================================== */

/* ---------- Page hero ---------- */
.legal-hero { border-bottom: 1px solid var(--line); }
.legal-hero-inner {
  padding-top: 72px;
  padding-bottom: 48px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.legal-hero h1 {
  font-size: clamp(38px, 5vw, 60px);
  line-height: 1.02;
  font-weight: 800;
  letter-spacing: -0.035em;
}
.legal-lead { font-size: 19px; line-height: 1.5; color: var(--ink-muted); max-width: 640px; }
.legal-meta { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.legal-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 32px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--surface);
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--ink-muted);
}

/* ---------- Two-column layout ---------- */
.legal-layout {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
  padding-top: 56px;
  padding-bottom: 96px;
}

/* ---------- Sidebar ---------- */
.legal-aside { position: sticky; top: 96px; display: flex; flex-direction: column; gap: 28px; }
.legal-aside .label { display: block; margin-bottom: 10px; }

.legal-docs { display: flex; flex-direction: column; gap: 4px; }
.legal-docs a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 14px;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  color: var(--ink-muted);
  transition: background-color .15s ease, color .15s ease;
}
.legal-docs a:hover { background: var(--surface); color: var(--ink); }
.legal-docs a[aria-current="page"] { background: var(--ink); color: var(--paper); }

.legal-toc { border: 0; }
.legal-toc summary { display: none; }
.legal-toc ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; border-left: 1px solid var(--line); }
.legal-toc a {
  display: block;
  padding: 6px 0 6px 14px;
  margin-left: -1px;
  border-left: 2px solid transparent;
  font-size: 14px;
  line-height: 1.4;
  text-decoration: none;
  color: var(--ink-muted);
}
.legal-toc a:hover { color: var(--ink); }
.legal-toc a.is-active { color: var(--ink); font-weight: 600; border-left-color: var(--ink); }

/* ---------- Article typography ---------- */
.legal-article { max-width: 720px; counter-reset: section; }
.legal-article > * + * { margin-top: 16px; }
.legal-article h2 {
  counter-increment: section;
  margin-top: 56px;
  padding-top: 8px;
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.2;
  scroll-margin-top: 96px;
}
.legal-article h2::before {
  content: counter(section) ".";
  display: inline-block;
  min-width: 1.6em;
  color: var(--ink-muted);
  font-weight: 600;
}
.legal-article h2:first-of-type { margin-top: 40px; }
.legal-article h3 { margin-top: 28px; font-size: 18px; font-weight: 700; }
.legal-article p, .legal-article li { font-size: 16px; line-height: 1.7; }
.legal-article p { color: var(--text-body); }
.legal-article ul, .legal-article ol { padding-left: 22px; }
.legal-article li + li { margin-top: 6px; }
.legal-article a { color: var(--link); text-underline-offset: 3px; }
.legal-article strong { font-weight: 700; }
.legal-article code { font-family: var(--font-mono); font-size: 0.9em; }
/* A button that reads like a link in running text (e.g. "Cookie settings") */
.legal-inline-button { padding: 0; border: 0; background: none; font: inherit; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; }

/* Placeholder text: easy to spot while drafting, find with "[" */
.ph { background: var(--accent-tint); border-radius: 4px; padding: 0 3px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }

/* "In short" summary box */
.legal-summary {
  margin-top: 0;
  padding: 24px 28px;
  border-radius: var(--radius-lg);
  background: var(--tint-steel);
}
.legal-summary .label { color: var(--ink); }
.legal-summary ul { margin: 10px 0 0; }
.legal-summary li { font-size: 16px; }

/* Tables (purposes, cookies, sub-processors) */
.legal-table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
.legal-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.legal-table th, .legal-table td { padding: 12px 16px; text-align: left; vertical-align: top; border-bottom: 1px solid var(--line); }
.legal-table th { font-family: var(--font-mono); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink-muted); background: var(--paper); white-space: nowrap; }
.legal-table tr:last-child td { border-bottom: 0; }

/* Contact card at the end of each document */
.legal-contact {
  margin-top: 64px !important;
  padding: 28px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
}
.legal-contact h2 { margin: 0; padding: 0; font-size: 20px; counter-increment: none; }
.legal-contact h2::before { content: none; }
.legal-contact p { margin: 4px 0 0; color: var(--ink-muted); font-size: 15px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .legal-layout { grid-template-columns: minmax(0, 1fr); gap: 32px; padding-top: 32px; }
  .legal-aside { position: static; }
  .legal-docs { flex-direction: row; flex-wrap: wrap; }
  .legal-docs a { border: 1px solid var(--line); background: var(--surface); }
  .legal-toc { border: 1px solid var(--line); border-radius: 14px; background: var(--surface); }
  .legal-toc summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 48px;
    padding: 0 16px;
    font-weight: 600;
    cursor: pointer;
    list-style: none;
  }
  .legal-toc summary::-webkit-details-marker { display: none; }
  .legal-toc summary::after { content: "+"; font-size: 20px; transition: transform .2s ease; }
  .legal-toc[open] summary::after { transform: rotate(45deg); }
  .legal-toc .label { display: none; }
  .legal-toc ol { margin: 0 16px 16px; }
}

@media (max-width: 600px) {
  .legal-hero-inner { padding-top: 48px; padding-bottom: 32px; }
  .legal-lead { font-size: 17px; }
  .legal-article h2 { font-size: 22px; margin-top: 44px; }
  .legal-summary { padding: 20px; }
}

/* ---------- Print: just the document ---------- */
@media print {
  .site-header, .site-footer, .legal-aside, .legal-contact .btn { display: none !important; }
  .legal-layout { display: block; padding: 0; }
  .legal-hero { border: 0; }
  .ph { background: none; }
  body { background: #fff; }
}
