/* Shared styling for MMD legal documents (/terms, /terms_mediasupplier) */

:root {
  --black:  #0d0d0d;
  --dark:   #141414;
  --card:   #1e1e1e;
  --border: #333333;
  --white:  #ffffff;
  --grey:   #c8c8c8;
  --light:  #f0f0f0;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--black);
  color: var(--light);
  font-family: 'Barlow', sans-serif;
  font-size: 16px;
  line-height: 1.7;
  overflow-x: hidden;
}

/* ── NAV ──
   Scoped to .site-nav: the table of contents is also a <nav> (correctly, for
   landmark semantics) and must not inherit the sticky-header layout. */
.site-nav {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between;
  gap: 24px; padding: 0 48px; height: 72px;
  background: rgba(13,13,13,0.95); backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-nav img { height: 44px; width: auto; }
.nav-back {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  font-size: 14px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--white); text-decoration: none; transition: color 0.2s;
  white-space: nowrap;
}
.nav-back:hover { color: var(--grey); }

/* ── HEADER ── */
.doc-header {
  border-bottom: 1px solid var(--border);
  padding: 72px 48px 56px;
}
.doc-header-inner { max-width: 820px; margin: 0 auto; }
.eyebrow {
  font-family: 'Barlow Condensed', sans-serif; font-size: 13px;
  font-weight: 600; letter-spacing: 0.22em; text-transform: uppercase;
  color: var(--grey); margin-bottom: 20px;
  display: flex; align-items: center; gap: 12px;
}
.eyebrow::before { content: ''; display: block; width: 32px; height: 1px; background: var(--grey); }
.doc-header h1 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 900;
  font-size: clamp(38px, 6vw, 64px); line-height: 1;
  text-transform: uppercase; color: var(--white);
  letter-spacing: -0.01em; margin-bottom: 20px;
}
.doc-lede { font-size: 17px; color: var(--grey); max-width: 620px; }

/* ── DOCUMENT BODY ── */
.doc {
  max-width: 820px; margin: 0 auto;
  padding: 56px 48px 96px;
}
.doc-intro {
  border-left: 2px solid var(--border);
  padding-left: 24px; margin-bottom: 56px;
}
.doc-intro p { margin-bottom: 16px; }
.doc-intro p:last-child { margin-bottom: 0; }

section.clause { margin-bottom: 44px; scroll-margin-top: 96px; }
section.clause h2 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800;
  font-size: 24px; text-transform: uppercase; color: var(--white);
  letter-spacing: 0.02em; margin-bottom: 6px;
  display: flex; gap: 14px; align-items: baseline;
}
section.clause h2 .num {
  color: var(--grey); font-size: 18px; font-variant-numeric: tabular-nums;
  min-width: 28px;
}
section.clause h2 + .rule {
  width: 40px; height: 2px; background: var(--border); margin-bottom: 20px;
}
/* Grid, not flex: a clause may contain several <p> children — the lettered
   sub-paragraphs (a), (b), (c). Under flex they became side-by-side columns.
   Grid pins the number to column 1 and stacks every paragraph in column 2. */
.sub {
  display: grid; grid-template-columns: 38px 1fr;
  column-gap: 12px; margin-bottom: 14px;
}
.sub:last-child { margin-bottom: 0; }
.sub .n {
  grid-column: 1;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  color: var(--grey);
  font-variant-numeric: tabular-nums; padding-top: 1px;
}
.sub p { grid-column: 2; min-width: 0; }
.sub p + p { margin-top: 12px; }
strong { color: var(--white); font-weight: 600; }
em { font-style: italic; }

/* ── TOC ── */
.toc {
  background: var(--card); border: 1px solid var(--border);
  padding: 28px 32px; margin-bottom: 56px;
}
.toc h2 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 14px; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--grey); margin-bottom: 18px;
}
.toc ol {
  list-style: none; counter-reset: toc;
  columns: 2; column-gap: 40px;
}
.toc li { counter-increment: toc; margin-bottom: 9px; break-inside: avoid; }
.toc a {
  color: var(--light); text-decoration: none; font-size: 15px;
  transition: color 0.2s;
}
.toc a::before {
  content: counter(toc) '.'; color: var(--grey);
  display: inline-block; min-width: 24px;
  font-variant-numeric: tabular-nums;
}
.toc a:hover { color: var(--white); text-decoration: underline; }

/* Sub-headings inside a clause (e.g. "Gross rate bookings (default)") and
   roman-numeral sub-paragraphs. Previously inline styles; now classed so the
   CMS template can emit them. */
.sub-heading {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 16px; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--grey); margin: 26px 0 14px;
}
.sub p.indent { padding-left: 20px; }

/* ── DEFINITIONS + DATA TABLES ── */
.legal-table {
  width: 100%; border-collapse: collapse;
  margin: 18px 0 6px; font-size: 15px;
}
.legal-table th {
  text-align: left; vertical-align: top;
  font-family: 'Barlow Condensed', sans-serif; font-weight: 700;
  font-size: 13px; letter-spacing: 0.12em; text-transform: uppercase;
  color: var(--grey); padding: 10px 16px 10px 0;
  border-bottom: 1px solid var(--border);
}
.legal-table td {
  vertical-align: top; padding: 12px 16px 12px 0;
  border-bottom: 1px solid var(--border); color: var(--light);
}
.legal-table td:first-child { width: 32%; }
.legal-table.defs td:first-child {
  color: var(--white); font-weight: 600;
}
.legal-table.rates td:last-child,
.legal-table.rates th:last-child { text-align: right; padding-right: 0; }
.table-scroll { overflow-x: auto; }

/* ── ENTITY FOOTER ── */
.entity {
  border-top: 1px solid var(--border);
  margin-top: 64px; padding-top: 40px;
}
.entity h3 {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 800;
  font-size: 20px; text-transform: uppercase; color: var(--white);
  margin-bottom: 16px;
}
.entity dl {
  display: grid; grid-template-columns: 140px 1fr;
  gap: 10px 20px; font-size: 15px;
}
.entity dt {
  font-family: 'Barlow Condensed', sans-serif; font-weight: 600;
  letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--grey); font-size: 13px; padding-top: 2px;
}
.entity dd { color: var(--light); }
.entity a { color: var(--light); }

footer {
  border-top: 1px solid var(--border);
  padding: 32px 48px;
  display: flex; justify-content: space-between; gap: 20px; flex-wrap: wrap;
  font-size: 14px; color: var(--grey);
}
footer a { color: var(--grey); text-decoration: none; }
footer a:hover { color: var(--white); text-decoration: underline; }

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
  .site-nav { padding: 0 20px; height: 64px; }
  .site-nav img { height: 36px; }
  .nav-back { font-size: 12px; letter-spacing: 0.08em; }
  .doc-header { padding: 48px 20px 40px; }
  .doc { padding: 40px 20px 64px; }
  .toc { padding: 22px 20px; }
  .toc ol { columns: 1; }
  .entity dl { grid-template-columns: 1fr; gap: 4px 0; }
  .entity dd { margin-bottom: 12px; }
  footer { padding: 28px 20px; }
  .sub { grid-template-columns: 32px 1fr; column-gap: 8px; }
  section.clause h2 .num { min-width: 24px; }
}

/* ── PRINT ── */
@media print {
  body { background: #fff; color: #000; font-size: 11pt; }
  .site-nav, footer, .toc, .nav-back { display: none; }
  .doc-header { border-color: #ccc; padding: 0 0 24px; }
  .doc-header h1 { color: #000; }
  .doc { padding: 24px 0; max-width: none; }
  .doc-lede, .sub .n, section.clause h2 .num, .entity dt { color: #444; }
  section.clause h2, strong, .entity h3, .entity dd { color: #000; }
  section.clause { page-break-inside: avoid; margin-bottom: 22px; }
  .doc-intro { border-color: #ccc; }
  a { color: #000; text-decoration: none; }
}
