/* ══════════════════════════════════════════════════════════════════
   CODEX FOOTER PAGES (redesign step 12)
   See design_handoff_codex_redesign/README.md §Per-view specs · Footer pages.

   Pages: About / Privacy / Credits / Open Data / Contact.
   Rendered by src/views/footer/footerPages.js into #footerPageView.

   Narrow centered column (max 920px), Codex chrome on sections and
   ‹ Back link at top.

   Deferred (DEFERRED.md):
     - Open Data: 4-tab schema documentation table + JSON sample
     - Contact: reason-picker form (Missing card / Correction / Bug /
       Feature / Other) + reason-aware help tip + privacy promise side
       panel — needs JS restructure
   ══════════════════════════════════════════════════════════════════ */

#footerPageView {
  max-width: 920px;
  margin: 0 auto;
  padding: 0 16px;
}

#footerPageView .footer-page-inner {
  background: transparent;
  padding: 0;
}

/* ── ‹ Back link ──────────────────────────────────────────────────── */
#footerPageView .footer-back-link,
#footerPageView .fp-back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 0;
  margin-bottom: 16px;
  text-decoration: none;
  transition: color 0.15s ease;
}
#footerPageView .footer-back-link:hover,
#footerPageView .fp-back-link:hover {
  color: var(--accent);
}

/* ── Page title ───────────────────────────────────────────────────── */
#footerPageView .footer-page-title,
#footerPageView .fp-title {
  font-family: var(--font-sans);
  font-size: 32px;
  font-weight: 600;
  letter-spacing: -0.03em;
  color: var(--text);
  margin: 0 0 8px;
  line-height: 1.1;
}

#footerPageView .fp-eyebrow {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 8px;
}

#footerPageView .fp-lead {
  font-family: var(--font-sans);
  font-size: 15px;
  color: var(--text-dim);
  line-height: 1.6;
  margin: 0 0 24px;
  max-width: 700px;
}

/* ── Sections ─────────────────────────────────────────────────────── */
#footerPageView .fp-section {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 22px 24px;
  margin-bottom: 14px;
}

#footerPageView .fp-section h2 {
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 10px;
}

#footerPageView .fp-section h3 {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 16px 0 6px;
}

#footerPageView .fp-section p,
#footerPageView .fp-section li {
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.6;
  color: var(--text);
  margin: 0 0 10px;
}

#footerPageView .fp-section ul {
  padding-left: 18px;
  margin: 8px 0 14px;
}

/* Small italic note tucked under a list — for tips/exceptions. */
#footerPageView .fp-section .fp-aside {
  margin: 4px 0 0;
  font-size: 12.5px;
  font-style: italic;
  color: var(--text-dim);
  line-height: 1.55;
}

/* Checklist variant — green check marker instead of plain bullet. */
#footerPageView .fp-section ul.fp-list-check {
  list-style: none;
  padding-left: 0;
}
#footerPageView .fp-section ul.fp-list-check > li {
  padding-left: 22px;
  position: relative;
}
#footerPageView .fp-section ul.fp-list-check > li::before {
  content: '✓';
  position: absolute;
  left: 2px;
  top: 0;
  color: var(--pos);
  font-weight: 700;
}

#footerPageView .fp-section a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px dashed color-mix(in srgb, var(--accent) 50%, transparent);
}
#footerPageView .fp-section a:hover {
  border-bottom-style: solid;
  color: var(--text);
}

/* Inline mono code/values. */
#footerPageView .fp-section code,
#footerPageView .fp-section .fp-mono {
  font-family: var(--font-mono);
  font-size: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  color: var(--text);
}

/* Disclaimer block — slightly dimmer. */
#footerPageView .fp-disclaimer {
  background: transparent;
  border: 1px dashed var(--border-hi);
  color: var(--text-dim);
}
#footerPageView .fp-disclaimer h2 {
  color: var(--text-dim);
}
#footerPageView .fp-disclaimer p {
  color: var(--text-dim);
  font-size: 12.5px;
}

/* ── Numbered list (e.g. data sources in Credits) ─────────────────── */
#footerPageView .fp-numbered {
  counter-reset: fp-num;
  list-style: none;
  padding: 0;
  margin: 8px 0 14px;
}
#footerPageView .fp-numbered > li {
  counter-increment: fp-num;
  padding: 8px 0 8px 36px;
  position: relative;
  border-top: 1px solid var(--border);
}
#footerPageView .fp-numbered > li:first-child { border-top: 0; }
#footerPageView .fp-numbered > li::before {
  content: counter(fp-num, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 8px;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--accent);
  letter-spacing: 0.04em;
}

/* ══════════════════════════════════════════════════════════════════
   COMPONENT KIT (footer-page redesign) — heroes, image placeholders,
   callouts, icon-card grids, step lists, spec rows. Used to break the
   long monotonous box-stacks (esp. Fake cards + Storage) into scannable,
   visually varied layouts.
   ══════════════════════════════════════════════════════════════════ */

/* ── Page hero ────────────────────────────────────────────────────── */
#footerPageView .fp-hero {
  margin: 4px 0 22px;
}
#footerPageView .fp-hero .footer-page-title {
  font-size: 34px;
}
#footerPageView .fp-hero .fp-lead {
  margin-bottom: 16px;
}

/* ── Image placeholder (author drops a real <img> in later) ───────── */
#footerPageView .fp-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 150px;
  padding: 24px;
  margin: 4px 0 0;
  text-align: center;
  color: var(--text-dim);
  background:
    repeating-linear-gradient(
      -45deg,
      transparent, transparent 9px,
      color-mix(in srgb, var(--border) 45%, transparent) 9px,
      color-mix(in srgb, var(--border) 45%, transparent) 10px
    ),
    var(--surface2);
  border: 1px dashed var(--border-hi);
  border-radius: 8px;
}
#footerPageView .fp-image svg {
  width: 30px;
  height: 30px;
  opacity: 0.45;
}
#footerPageView .fp-image .fp-image-cap {
  font-size: 12px;
  font-style: italic;
  max-width: 360px;
  line-height: 1.4;
}
#footerPageView .fp-image .fp-image-tag {
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-mute);
  opacity: 0.8;
}
/* When a real image replaces the placeholder, drop the dashed chrome. */
#footerPageView .fp-image.has-img {
  padding: 0;
  background: none;
  border-style: solid;
  min-height: 0;
  overflow: hidden;
}
#footerPageView .fp-image img {
  display: block;
  width: 100%;
  height: auto;
}
#footerPageView .fp-image--wide { min-height: 220px; }
#footerPageView .fp-image--tall { min-height: 300px; }

/* Caption under any figure. */
#footerPageView .fp-figcaption {
  font-size: 11.5px;
  font-style: italic;
  color: var(--text-dim);
  text-align: center;
  margin: 8px 0 0;
}

/* ── Callout (tip / warn / info / good) ───────────────────────────── */
#footerPageView .fp-callout {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 13px 15px;
  margin: 14px 0;
  border: 1px solid var(--border);
  border-left-width: 3px;
  border-radius: 8px;
  background: var(--surface2);
}
#footerPageView .fp-callout > svg {
  flex-shrink: 0;
  width: 18px;
  height: 18px;
  margin-top: 1px;
}
#footerPageView .fp-callout-body { min-width: 0; }
#footerPageView .fp-callout-body > strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 3px;
  color: var(--text);
}
#footerPageView .fp-callout-body p,
#footerPageView .fp-callout-body li {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}
#footerPageView .fp-callout-body ul { margin: 4px 0 0; padding-left: 16px; }
#footerPageView .fp-callout--tip  { border-left-color: var(--accent); }
#footerPageView .fp-callout--tip  > svg { color: var(--accent); }
#footerPageView .fp-callout--warn { border-left-color: var(--neg); background: color-mix(in srgb, var(--neg) 7%, var(--surface2)); }
#footerPageView .fp-callout--warn > svg { color: var(--neg); }
#footerPageView .fp-callout--info { border-left-color: var(--cool); }
#footerPageView .fp-callout--info > svg { color: var(--cool); }
#footerPageView .fp-callout--good { border-left-color: var(--pos); background: color-mix(in srgb, var(--pos) 7%, var(--surface2)); }
#footerPageView .fp-callout--good > svg { color: var(--pos); }

/* ── Icon-card grid (turns bullet lists into scannable cards) ─────── */
#footerPageView .fp-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
  margin: 12px 0 4px;
}
#footerPageView .fp-card {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 14px;
}
#footerPageView .fp-card-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  margin-bottom: 9px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}
#footerPageView .fp-card-icon svg { width: 17px; height: 17px; }
#footerPageView .fp-card h3,
#footerPageView .fp-card h4 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-transform: none;
  letter-spacing: -0.01em;
  color: var(--text);
  margin: 0 0 4px;
}
#footerPageView .fp-card p {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-dim);
  margin: 0;
}
/* Tinted icon variants for warning/positive cards. */
#footerPageView .fp-card--warn .fp-card-icon { background: color-mix(in srgb, var(--neg) 14%, transparent); color: var(--neg); }
#footerPageView .fp-card--good .fp-card-icon { background: color-mix(in srgb, var(--pos) 14%, transparent); color: var(--pos); }
#footerPageView .fp-card--info .fp-card-icon { background: color-mix(in srgb, var(--cool) 14%, transparent); color: var(--cool); }

/* ── Numbered step list ───────────────────────────────────────────── */
#footerPageView .fp-steps {
  counter-reset: fp-step;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 12px 0 4px;
}
#footerPageView .fp-step {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
#footerPageView .fp-step::before {
  counter-increment: fp-step;
  content: counter(fp-step);
  flex-shrink: 0;
  width: 24px;
  height: 24px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 16%, transparent);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
}
#footerPageView .fp-step-body { min-width: 0; padding-top: 2px; }
#footerPageView .fp-step-body strong {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
#footerPageView .fp-step-body p {
  font-size: 12.5px;
  line-height: 1.55;
  color: var(--text-dim);
  margin: 0;
}

/* ── Spec rows (e.g. sleeve sizes: name · fits · note) ────────────── */
#footerPageView .fp-spec {
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
  margin: 12px 0 4px;
}
#footerPageView .fp-spec-row {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 4px 14px;
  padding: 11px 14px;
  border-top: 1px solid var(--border);
}
#footerPageView .fp-spec-row:first-child { border-top: 0; }
#footerPageView .fp-spec-name {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
}
#footerPageView .fp-spec-val {
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text);
}
#footerPageView .fp-spec-val small {
  display: block;
  color: var(--text-dim);
  font-size: 11.5px;
  margin-top: 2px;
}

/* ── CTA button (link into the app, e.g. the compare tool) ────────── */
#footerPageView .fp-cta {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  height: 34px;
  padding: 0 16px;
  border-radius: 7px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 0;
  margin-top: 4px;
  transition: background-color 0.15s ease;
}
#footerPageView .fp-cta:hover { background: color-mix(in srgb, var(--accent) 88%, white); border-bottom: 0; }
#footerPageView .fp-cta svg { width: 15px; height: 15px; }

/* Two-column row: text beside an image/figure. Stacks on narrow. */
#footerPageView .fp-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: center;
}
@media (max-width: 640px) {
  #footerPageView .fp-split { grid-template-columns: 1fr; }
  #footerPageView .fp-spec-row { grid-template-columns: 1fr; }
}

/* ── Open Data tab strip + panels (Codex step 12) ─────────────────── */
#footerPageView .od-hero {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 8px;
  margin: 16px 0;
}
#footerPageView .od-stat {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
#footerPageView .od-stat-value {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.02em;
}
#footerPageView .od-stat-label {
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
}

#footerPageView .od-tabs {
  display: flex;
  gap: 2px;
  padding: 4px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  margin-bottom: 14px;
}

#footerPageView .od-tab-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 30px;
  padding: 0 12px;
  background: transparent;
  border: 0;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  border-radius: 5px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease;
}
#footerPageView .od-tab-btn:hover {
  background: var(--surface2);
  color: var(--text);
}
#footerPageView .od-tab-btn.active {
  background: var(--accent-dim);
  color: var(--accent);
}

#footerPageView .od-tab-panel {
  display: none;
}

#footerPageView .fp-table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  margin: 8px 0;
}
#footerPageView .fp-table {
  width: 100%;
  border-collapse: collapse;
  font-family: var(--font-sans);
  font-size: 12px;
}
#footerPageView .fp-table th {
  background: var(--surface2);
  text-align: left;
  padding: 8px 10px;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  border-bottom: 1px solid var(--border);
}
#footerPageView .fp-table td {
  padding: 8px 10px;
  border-bottom: 1px solid var(--border);
  vertical-align: top;
  color: var(--text);
}
#footerPageView .fp-table tr:last-child td {
  border-bottom: 0;
}
#footerPageView .fp-table code {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent);
  background: transparent;
  border: 0;
  padding: 0;
}

#footerPageView .fp-code-block {
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 12px;
  font-family: var(--font-mono);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--text);
}
#footerPageView .fp-code-block code {
  color: var(--accent);
  background: transparent;
  border: 0;
  padding: 0;
}
#footerPageView .fp-field-values {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-dim);
}

#footerPageView .od-sample {
  margin-top: 10px;
}
#footerPageView .od-sample summary {
  cursor: pointer;
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--accent);
  padding: 6px 10px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: 5px;
  user-select: none;
}
#footerPageView .od-sample summary:hover {
  background: var(--surface3);
}
#footerPageView .od-sample pre {
  font-family: var(--font-mono);
  font-size: 11px;
  background: var(--surface2);
  color: var(--text);
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-top: 0;
  border-radius: 0 0 6px 6px;
  overflow-x: auto;
  margin: 0;
}

/* ── Open Data download bar (download button + format chip) ───────── */
#footerPageView .od-download-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 10px 14px;
  margin-bottom: 12px;
}

#footerPageView .od-download-bar .btn,
#footerPageView .od-download-btn {
  background: var(--accent);
  color: var(--bg);
  border: 1px solid var(--accent);
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 600;
  padding: 6px 12px;
  cursor: pointer;
  background-image: none;
}
#footerPageView .od-download-bar .btn:hover,
#footerPageView .od-download-btn:hover {
  background: color-mix(in srgb, var(--accent) 88%, white);
}

/* ── Contact modal split layout + privacy side panel (Codex step 12) ─ */
#contactModal .contact-modal-content--codex {
  max-width: 900px;
  width: calc(100vw - 32px);
}

#contactModal .contact-modal-body {
  padding: 16px 20px;
}

/* Required-field legend below the form. */
#contactModal .contact-required-legend {
  margin: 4px 0 0;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-sans);
  font-size: 11px;
  color: var(--text-mute);
  letter-spacing: 0.02em;
}

/* Inline hint sitting right under the message textarea, suggesting imgur
   for attaching screenshots (since the form is text-only). */
#contactModal .contact-screenshot-hint {
  margin: 6px 0 0;
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 8px 10px;
  background: color-mix(in srgb, var(--accent) 7%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
  border-radius: 5px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.5;
  color: var(--text-dim);
}
#contactModal .contact-screenshot-hint-icon {
  flex-shrink: 0;
  font-size: 13px;
  line-height: 1.5;
}
#contactModal .contact-screenshot-hint a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}
#contactModal .contact-screenshot-hint a:hover {
  color: var(--text);
}

/* ── Contact reason-picker (Codex step 12) ────────────────────────── */
#contactModal .contact-reason-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

#contactModal .contact-reason-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 32px;
  padding: 0 12px;
  background: var(--surface2);
  border: 1px solid var(--border);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 12px;
  font-weight: 500;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
#contactModal .contact-reason-btn:hover {
  background: var(--surface3);
  border-color: var(--border-hi);
}
#contactModal .contact-reason-btn.active {
  background: var(--accent-dim);
  border-color: var(--accent);
  color: var(--accent);
}

#contactModal .contact-reason-glyph {
  font-size: 14px;
  line-height: 1;
}

/* ── Contact form (sub-deferred — current markup may differ) ──────── */
#footerPageView .fp-form label {
  display: block;
  font-family: var(--font-sans);
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--text-dim);
  margin: 0 0 4px;
}
#footerPageView .fp-form input[type='text'],
#footerPageView .fp-form input[type='email'],
#footerPageView .fp-form textarea,
#footerPageView .fp-form select {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 13px;
  padding: 8px 10px;
  width: 100%;
  margin-bottom: 12px;
}
#footerPageView .fp-form textarea {
  min-height: 120px;
  resize: vertical;
}
#footerPageView .fp-form input:focus,
#footerPageView .fp-form textarea:focus,
#footerPageView .fp-form select:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: var(--focus-ring);
}

/* ── Dark-mode safety ─────────────────────────────────────────────── */
body.dark-mode #footerPageView .fp-section {
  background: var(--surface);
  border-color: var(--border);
}
body.dark-mode #footerPageView .fp-disclaimer {
  background: transparent;
  border-color: var(--border-hi);
}
body.dark-mode #footerPageView .od-download-bar {
  background: var(--surface2);
  border-color: var(--border);
}
