/* =========================================
   DOCUMENT / FLAT INFO PAGES
   Shared layout for policy and information
   pages using the "Document" page template
   (page-document.php): Privacy Policy,
   Payment Policy, SMS Terms of Service, etc.

   Markup vocabulary:
     .doc-hero            navy header band (rendered by the template)
     .doc-updated         "Last updated" line (rendered by the template)
     .doc-card            a section card
     .doc-card--highlight emphasised card (sky background)
     .doc-toc             two-column table of contents list
     .doc-keywords        grid of .doc-keyword definition boxes
     .doc-table           key/value or comparison table
     .doc-note            inline callout inside a card
     .doc-contact         contact detail table
   ========================================= */

/* ── HERO ───────────────────────────────── */

.doc-hero {
  background: linear-gradient(135deg, var(--color-navy-dark) 0%, var(--color-navy) 100%);
  color: #fff;
  padding: 64px 24px 56px;
}

html.dark .doc-hero {
  background: linear-gradient(135deg, #071426 0%, #12304f 100%);
}

.doc-hero__inner {
  max-width: 880px;
  margin: 0 auto;
}

.doc-hero__eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.62);
  margin-bottom: 12px;
}

.doc-hero__title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.6vw, 3rem);
  line-height: 1.15;
  color: #fff;
  margin: 0 0 12px;
}

.doc-hero__sub {
  font-size: 1.05rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.8);
  max-width: 640px;
  margin: 0;
}

/* ── READING COLUMN ─────────────────────── */

.doc-main {
  display: block;
  max-width: 880px;
  margin: 0 auto;
  padding: 44px 24px 88px;
}

.doc-updated {
  font-size: 0.85rem;
  color: var(--color-text-muted);
  margin: 0 0 28px;
}

/* ── CARDS ──────────────────────────────── */

.doc-card {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 28px 32px;
  margin-bottom: 22px;
  box-shadow: var(--shadow-sm);
  /* Keep anchor targets clear of the sticky header. */
  scroll-margin-top: calc(var(--nav-height) + 24px);
}

.doc-card:last-child {
  margin-bottom: 0;
}

.doc-card--highlight {
  background: var(--color-sky);
  border-color: var(--color-accent);
}

/* ── TYPOGRAPHY ─────────────────────────── */

/* Headings inside documents use the body face: numbered legal/policy
   sections read better in a crisp sans than in the display serif. */
.doc-body h2 {
  font-family: var(--font-body);
  font-size: 1.2rem;
  font-weight: 700;
  line-height: 1.35;
  color: var(--color-navy);
  margin: 0 0 16px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--color-border);
}

html.dark .doc-body h2 {
  color: var(--color-navy-light);
}

.doc-body h3 {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin: 24px 0 8px;
}

.doc-body h4 {
  font-family: var(--font-body);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  margin: 20px 0 8px;
}

.doc-body h3:first-child,
.doc-body h4:first-child {
  margin-top: 0;
}

.doc-body p {
  font-size: 0.975rem;
  line-height: 1.75;
  color: var(--color-text);
  margin: 0 0 14px;
}

.doc-body p:last-child,
.doc-body ul:last-child,
.doc-body ol:last-child,
.doc-body table:last-child {
  margin-bottom: 0;
}

.doc-body ul,
.doc-body ol {
  margin: 0 0 14px;
  padding-left: 22px;
}

.doc-body ul {
  list-style: disc;
}

.doc-body ol {
  list-style: decimal;
}

.doc-body li {
  font-size: 0.975rem;
  line-height: 1.7;
  color: var(--color-text);
  margin-bottom: 8px;
}

.doc-body li > p {
  margin-bottom: 8px;
}

.doc-body li:last-child {
  margin-bottom: 0;
}

.doc-body strong,
.doc-body b {
  font-weight: 700;
  color: var(--color-text);
}

.doc-body a {
  color: var(--color-navy);
  text-decoration: underline;
  text-underline-offset: 2px;
  transition: color var(--transition-fast);
}

html.dark .doc-body a {
  color: var(--color-accent);
}

.doc-body a:hover {
  color: var(--color-accent-hover);
}

.doc-body hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: 24px 0;
}

/* ── TABLE OF CONTENTS ──────────────────── */

/* Extra specificity so the legacy .document-content list rules in
   components.css don't put bullets back on the table of contents. */
.doc-body ul.doc-toc {
  columns: 2;
  column-gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.doc-body ul.doc-toc li {
  font-size: 0.925rem;
  margin-bottom: 9px;
  break-inside: avoid;
}

.doc-body ul.doc-toc a {
  text-decoration: none;
}

.doc-body ul.doc-toc a:hover {
  text-decoration: underline;
}

/* ── KEYWORD / DEFINITION BOXES ─────────── */

.doc-keywords {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 14px;
  margin: 18px 0 4px;
}

.doc-keyword {
  background: var(--color-bg-alt);
  border: 1px solid var(--color-border);
  border-left: 4px solid var(--color-navy);
  border-radius: var(--radius-sm);
  padding: 14px 16px;
}

html.dark .doc-keyword {
  border-left-color: var(--color-accent);
}

.doc-keyword__kw {
  display: block;
  font-family: 'SFMono-Regular', Consolas, Menlo, monospace;
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--color-navy);
  margin-bottom: 5px;
}

html.dark .doc-keyword__kw {
  color: var(--color-accent);
}

.doc-body .doc-keyword p {
  font-size: 0.875rem;
  line-height: 1.6;
  color: var(--color-text-muted);
  margin: 0;
}

/* ── TABLES ─────────────────────────────── */

.doc-body table,
.doc-table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 14px;
  font-size: 0.925rem;
}

.doc-body th,
.doc-body td {
  text-align: left;
  vertical-align: top;
  padding: 11px 12px;
  border-bottom: 1px solid var(--color-border);
  line-height: 1.6;
}

.doc-body th {
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--color-navy);
  white-space: nowrap;
}

html.dark .doc-body th {
  color: var(--color-navy-light);
}

.doc-body tr:last-child th,
.doc-body tr:last-child td {
  border-bottom: 0;
}

/* Contact tables use a narrow label column. */
.doc-contact th {
  width: 150px;
}

/* ── INLINE CALLOUT ─────────────────────── */

.doc-note {
  background: var(--color-sky);
  border-left: 4px solid var(--color-accent);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin: 18px 0;
}

.doc-card--highlight .doc-note {
  background: var(--color-bg-alt);
}

.doc-body .doc-note p:last-child {
  margin-bottom: 0;
}

/* ── RESPONSIVE ─────────────────────────── */

@media (max-width: 700px) {
  .doc-hero {
    padding: 48px 20px 40px;
  }

  .doc-main {
    padding: 32px 20px 64px;
  }

  .doc-card {
    padding: 22px 20px;
  }

  .doc-body ul.doc-toc {
    columns: 1;
  }

  .doc-body th {
    white-space: normal;
  }

  .doc-body th,
  .doc-body td {
    padding: 9px 8px;
  }

  /* Key/value tables stack into label-over-value pairs. */
  .doc-contact,
  .doc-contact tbody,
  .doc-contact tr,
  .doc-contact th,
  .doc-contact td {
    display: block;
    width: auto;
  }

  .doc-contact tr {
    padding: 10px 0;
    border-bottom: 1px solid var(--color-border);
  }

  .doc-contact tr:last-child {
    border-bottom: 0;
    padding-bottom: 0;
  }

  .doc-contact th,
  .doc-contact td {
    padding: 0;
    border-bottom: 0;
  }

  .doc-contact th {
    margin-bottom: 3px;
  }
}

/* ── PRINT ──────────────────────────────── */

@media print {
  .doc-hero {
    background: none;
    color: #000;
    padding: 0 0 16px;
  }

  .doc-hero__eyebrow,
  .doc-hero__title,
  .doc-hero__sub {
    color: #000;
  }

  .doc-main {
    padding: 0;
    max-width: none;
  }

  .doc-card {
    box-shadow: none;
    border-color: #ccc;
    break-inside: avoid;
    page-break-inside: avoid;
  }

  .cta-section,
  .site-footer,
  .navbar,
  .announcement-bar,
  .skip-link {
    display: none !important;
  }
}
