/* ── Privacy Policy v2 — page-scoped styles ──
 *
 * Loaded via page_css frontmatter on td/privacy/index.html and td/accessibility.html.
 * Scoped under .td-privacy-v2 body class.
 * Builds on tw-base.css tokens + tw-walkthrough.css shared classes.
 */

/* ── Container: center on navless page ──
 * tw-walkthrough.css sets margin-right: var(--content-right-gap) for nav offset.
 * tw-nav.css centers at ≥1100px via html:not(.tw-nav-open), but the
 * 768–1099px range stays left-biased. Override unconditionally here. */
.td-privacy-v2 .tw-container {
  margin-left: auto;
  margin-right: auto;
  padding-top: 32px;
}

/* Footer has its own padding — don't double up */
.td-privacy-v2 .tw-contact-section .tw-container {
  padding-top: 0;
}

/* ── Hero: darker blue for privacy page ── */
.td-privacy-v2 .tw-hero {
  background: var(--berkeley-blue);
}

/* ── Policy metadata (version + date) ── */
.tw-policy-meta {
  text-align: center;
  color: var(--color-text-secondary);
  font-size: 0.875rem;
  margin-bottom: 24px;
}

/* ── TL;DR summary box (blue variant) ── */
.tw-policy-summary {
  background: var(--berkeley-blue);
  color: var(--color-text-on-blue);
  border-radius: 8px;
  padding: 20px 24px;
  margin: 0 0 32px;
  font-size: 0.95rem;
  line-height: 1.65;
}

.tw-policy-summary strong {
  color: var(--berkeley-gold);
}

/* ── Section typography ──
 * Walkthrough h2 is 2.25rem — too large for a data-dense policy page.
 * Scale down to 1.5rem for appropriate density. */
.td-privacy-v2 .tw-section {
  padding: 28px 0;
}

.td-privacy-v2 .tw-section + .tw-section {
  border-top: 1px solid var(--border-color);
  padding-top: 28px;
}

.td-privacy-v2 .tw-section h2 {
  font-size: 1.5rem;
  margin-bottom: 12px;
}

.td-privacy-v2 .tw-section h3 {
  font-size: 1.2rem;
  margin-top: 24px;
  margin-bottom: 8px;
}

.td-privacy-v2 .tw-section p {
  font-size: 0.95rem;
  line-height: 1.65;
  color: var(--berkeley-blue);
  margin-bottom: 12px;
}

.td-privacy-v2 .tw-section p:last-child {
  margin-bottom: 0;
}

/* ── Policy data tables ── */
.tw-policy-table {
  width: 100%;
  border-collapse: collapse;
  margin: 16px 0;
  font-size: 0.88rem;
  border: 1px solid var(--border-color);
}

.tw-policy-table th {
  background: var(--berkeley-blue);
  color: var(--color-text-on-blue);
  padding: 10px 14px;
  text-align: left;
  font-weight: 600;
  font-size: 0.84rem;
  white-space: nowrap;
}

.tw-policy-table td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--border-color);
  vertical-align: top;
  color: var(--berkeley-blue);
}

.tw-policy-table tr:nth-child(even) {
  background: var(--gray-light);
}

.tw-policy-table td:first-child {
  font-weight: 600;
}

.tw-policy-table code {
  background: var(--gray-light);
  color: var(--berkeley-blue);
  padding: 2px 5px;
  border-radius: 3px;
  font-family: Monaco, Menlo, monospace;
  font-size: 0.82rem;
  border: 1px solid var(--border-color);
  white-space: nowrap;
}

/* Zebra stripe: code on even rows needs different background */
.tw-policy-table tr:nth-child(even) code {
  background: var(--color-surface-primary);
}

/* ── Responsive table wrapper ── */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 16px 0;
}

.table-responsive .tw-policy-table {
  margin: 0;
}

.table-responsive--3col .tw-policy-table {
  min-width: 560px;
}

.table-responsive--4col .tw-policy-table {
  min-width: 520px;
}

/* Allow 4-col header text to wrap (e.g. "Contains User Data?") */
.table-responsive--4col .tw-policy-table th {
  white-space: normal;
}

/* ── Styled lists (negations, controls) ── */
.tw-policy-list {
  list-style: none;
  margin: 16px 0;
  padding: 16px 20px 16px 24px;
  background: var(--gray-light);
  border: 1px solid var(--border-color);
  border-radius: 8px;
}

.tw-policy-list li {
  padding: 4px 0 4px 20px;
  position: relative;
  color: var(--berkeley-blue);
  font-size: 0.95rem;
  line-height: 1.65;
  margin-bottom: 4px;
}

.tw-policy-list li::before {
  content: "\2022";
  position: absolute;
  left: 0;
  color: var(--berkeley-blue-80);
  font-weight: bold;
}

.tw-policy-list li:last-child {
  margin-bottom: 0;
}

/* ── Ordered variant (numbered steps) ── */
.tw-policy-list--ordered {
  list-style: decimal inside;
  padding-left: 28px;
}

.tw-policy-list--ordered li::before {
  content: none;
}

/* ── Parameter code block ── */
.tw-policy-params {
  background: var(--gray-light);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  padding: 12px 16px;
  margin: 12px 0;
  font-family: Monaco, Menlo, monospace;
  font-size: 0.82rem;
  color: var(--berkeley-blue);
  line-height: 1.7;
  overflow-wrap: break-word;
}

/* ── CWS compliance pass indicator ── */
.tw-policy-table .tw-pass {
  color: #1a7f37;
  font-weight: 600;
}

/* ── Scroll-to offset for anchored sections (clears fixed hamburger area) ── */
.td-privacy-v2 .tw-section[id],
.td-privacy-v2 .tw-contact-section[id],
.td-privacy-v2 .tw-section > h2 {
  scroll-margin-top: 56px;
}

/* ── Mobile ── */
@media (max-width: 768px) {
  .tw-policy-summary {
    padding: 16px 18px;
    font-size: 0.9rem;
  }

  .td-privacy-v2 .tw-section h2 {
    font-size: 1.3rem;
  }

  .tw-policy-table th,
  .tw-policy-table td {
    padding: 8px 10px;
    font-size: 0.82rem;
  }
}

@media (max-width: 600px) {
  .tw-policy-meta {
    font-size: 0.8rem;
  }

  .tw-policy-summary {
    padding: 14px 16px;
    font-size: 0.85rem;
  }

  .td-privacy-v2 .tw-section h2 {
    font-size: 1.2rem;
  }
}
