/* ==========================================================================
   /legal/* — policy documents
   Ported from airgo-web_design/"AirGo Legal.dc.html".
   ========================================================================== */

.ag-legal-switch {
  max-width: var(--ag-content-max);
  margin: 0 auto;
  padding: 20px var(--ag-gutter) 0;
}

.ag-legal-switch__row { display: flex; gap: 9px; flex-wrap: wrap; }

.ag-legal-switch__tab {
  font-size: 13px;
  font-weight: 700;
  color: var(--ag-slate);
  background: var(--ag-card);
  border: 1.5px solid var(--ag-line);
  padding: 8px 15px;
  border-radius: 100px;
  transition: border-color var(--ag-motion-base), color var(--ag-motion-base);
}
.ag-legal-switch__tab:hover { border-color: var(--ag-azure); color: var(--ag-navy); }
.ag-legal-switch__tab[aria-current="page"] {
  color: #fff;
  background: var(--ag-navy);
  border-color: var(--ag-navy);
}

/* ---------- Two-column shell ---------- */

.ag-legal-doc {
  max-width: 1100px;
  margin: 0 auto;
  padding: 26px var(--ag-gutter) 50px;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 44px;
  align-items: start;
}

.ag-legal-toc { position: sticky; top: 90px; }

.ag-legal-toc__label {
  font-size: 12px;
  font-weight: 800;
  color: var(--ag-faint);
  text-transform: uppercase;
  letter-spacing: .06em;
  margin-bottom: 14px;
}

.ag-legal-toc__nav {
  display: flex;
  flex-direction: column;
  gap: 3px;
  border-left: 2px solid var(--ag-line);
  padding-left: 14px;
}

.ag-legal-toc__nav a {
  font-size: 13px;
  font-weight: 600;
  color: var(--ag-muted);
  padding: 5px 0;
  line-height: 1.35;
}
.ag-legal-toc__nav a:hover { color: var(--ag-azure-600); }
.ag-legal-toc__nav a[aria-current="true"] { color: var(--ag-azure-600); font-weight: 800; }

.ag-legal-print {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 22px;
  width: 100%;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ag-navy);
  background: var(--ag-card);
  border: 1px solid var(--ag-line);
  padding: 11px;
  border-radius: 11px;
  cursor: pointer;
  min-height: 44px;
  transition: border-color var(--ag-motion-base);
}
.ag-legal-print:hover { border-color: var(--ag-azure); }
.ag-legal-print svg { width: 15px; height: 15px; flex-shrink: 0; }

/* ---------- Document ---------- */

.ag-legal-body { min-width: 0; }

.ag-legal-body__eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 800;
  color: var(--ag-azure-600);
  background: var(--ag-azure-100);
  padding: 5px 13px;
  border-radius: 100px;
  margin-bottom: 14px;
}

.ag-legal-body h1 {
  font-size: 36px;
  font-weight: 800;
  color: var(--ag-navy);
  margin-bottom: 14px;
}

/* Effective / last-updated card. Both pages keep this commented out until
   real dates are supplied — see the note in the page source. */
.ag-legal-dates {
  display: flex;
  gap: 24px;
  flex-wrap: wrap;
  padding: 16px 20px;
  background: var(--ag-card);
  border: 1px solid var(--ag-line);
  border-radius: 14px;
  margin-bottom: 16px;
}
.ag-legal-dates__rule { width: 1px; background: #EEF3F7; }
.ag-legal-dates__label {
  font-size: 11.5px;
  font-weight: 800;
  color: var(--ag-faint);
  text-transform: uppercase;
  letter-spacing: .05em;
}
.ag-legal-dates__value {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--ag-navy);
  margin-top: 3px;
}

.ag-legal-prose { margin-top: 26px; }

.ag-legal-prose h2 {
  font-size: 21px;
  font-weight: 800;
  color: var(--ag-navy);
  line-height: 1.3;
  margin: 34px 0 10px;
  scroll-margin-top: 100px;
}
.ag-legal-prose > h2:first-child { margin-top: 0; }

.ag-legal-prose h3 {
  font-size: 16.5px;
  font-weight: 800;
  color: var(--ag-navy);
  margin: 26px 0 8px;
  scroll-margin-top: 100px;
}

.ag-legal-prose p {
  font-size: 15.5px;
  color: var(--ag-muted);
  line-height: 1.75;
  margin-bottom: 14px;
}

.ag-legal-prose p:last-child { margin-bottom: 0; }

.ag-legal__list {
  list-style: disc;
  padding-left: 22px;
  margin: 0 0 16px;
  display: flex;
  flex-direction: column;
  gap: 9px;
}
.ag-legal__list li {
  font-size: 15.5px;
  color: var(--ag-muted);
  line-height: 1.7;
}

/* Blocks the source document sets in full capitals — arbitration notice,
   warranty disclaimer, liability cap. Kept verbatim, given a surface so a
   wall of capitals is still readable. */
.ag-legal__callout {
  font-size: 13.5px !important;
  font-weight: 700;
  color: var(--ag-warning-text) !important;
  background: var(--ag-warning-surface);
  border: 1px solid var(--ag-warning-border);
  border-radius: 12px;
  padding: 16px 18px;
  line-height: 1.65 !important;
  margin-bottom: 18px;
}

/* ---------- Table (privacy: purpose / legal basis) ---------- */

.ag-legal__tablewrap {
  overflow-x: auto;
  margin: 0 0 18px;
  border: 1px solid var(--ag-line);
  border-radius: 14px;
  background: var(--ag-card);
}

.ag-legal__table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 14px;
}

.ag-legal__table th {
  text-align: left;
  font-weight: 800;
  color: var(--ag-navy);
  background: var(--ag-hover-fill);
  padding: 13px 16px;
  border-bottom: 1px solid var(--ag-line);
}

.ag-legal__table td {
  padding: 13px 16px;
  color: var(--ag-muted);
  line-height: 1.6;
  border-bottom: 1px solid #F2F5F8;
  vertical-align: top;
}
.ag-legal__table tr:last-child td { border-bottom: 0; }
.ag-legal__table td:first-child { width: 55%; }

/* ---------- Contact card ---------- */

.ag-legal-contact {
  background: var(--ag-card);
  border: 1px solid var(--ag-line);
  border-radius: 16px;
  padding: 26px;
  margin-top: 34px;
}

.ag-legal-contact h2 {
  font-size: 19px;
  font-weight: 800;
  color: var(--ag-navy);
  margin-bottom: 10px;
}

.ag-legal-contact p {
  font-size: 14.5px;
  color: var(--ag-muted);
  line-height: 1.6;
  margin-bottom: 16px;
}

.ag-legal-contact__rows {
  display: flex;
  flex-direction: column;
  gap: 7px;
  font-size: 14.5px;
  color: var(--ag-slate);
  margin-bottom: 18px;
}
.ag-legal-contact__rows b { color: var(--ag-navy); }

/* ---------- Responsive ---------- */

@media (max-width: 900px) {
  .ag-legal-doc { grid-template-columns: 1fr; gap: 26px; }
  .ag-legal-toc {
    position: static;
    border: 1px solid var(--ag-line);
    border-radius: 14px;
    background: var(--ag-card);
    padding: 18px;
  }
}

@media (max-width: 768px) {
  .ag-legal-switch__tab { min-height: 44px; padding: 11px 16px; }
  /* HANDOFF.md §4: 44px touch targets. display:flex keeps a wrapped,
     two-line entry centred rather than top-aligned. */
  .ag-legal-toc__nav a {
    padding: 11px 0;
    min-height: 44px;
    display: flex;
    align-items: center;
  }
  .ag-legal-body h1 { font-size: 28px; }
  .ag-legal-prose h2 { font-size: 19px; }
  .ag-legal-contact { padding: 20px; }
}

/* ---------- Print ---------- */

@media print {
  .ag-noprint,
  airgo-header,
  airgo-cookie-consent,
  .ag-footer,
  .ag-legal-switch,
  .ag-legal-toc,
  .ag-crumbs { display: none !important; }

  .ag-legal-doc { display: block; max-width: none; padding: 0; }
  .ag-legal-prose p,
  .ag-legal__list li { color: #000; font-size: 11pt; }
  .ag-legal-prose h2 { page-break-after: avoid; }
  .ag-legal__callout { border: 1px solid #999; color: #000 !important; }
}
