/* WeatherWindow.AI — editorial.css: every rule the homepage and the converted
   article pages share. One source per rule: tests_live/test_editorial_css.py fails
   when a selector here is defined again in site.css / chrome.css / articles.css, or
   when a block there copies one of these blocks under another name.
   Homepage: tokens.css → chrome.css → editorial.css → site.css → consent.css.
   Articles: tokens.css → chrome.css → editorial.css → articles.css → consent.css.
   Spec: docs/superpowers/specs/2026-11-19-article-refresh-design.md §6.2.
   All values come from tokens.css. */

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: clip; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: var(--fs-base);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, video { display: block; max-width: 100%; }
a { color: var(--accent); text-underline-offset: 0.2em; }
a:hover { color: var(--accent-bright); }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
strong { font-weight: 600; color: var(--text); }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip {
  position: absolute; left: var(--s-4); top: calc(-1 * var(--s-12));
  z-index: 100; padding: var(--s-2) var(--s-4);
  background: var(--accent); color: var(--text-on-accent); border-radius: var(--radius);
}
.skip:focus { top: var(--s-4); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: var(--radius-sm); }

.wrap { width: 100%; max-width: var(--page-max); margin: 0 auto; padding: 0 var(--s-gutter); }


/* ---------- Buttons — foundation §3.1 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2);
  min-height: 2.75rem; padding: var(--s-3) var(--s-6);
  font: 600 var(--fs-base)/1 var(--font-sans);
  border: 1px solid transparent; border-radius: var(--radius);
  text-decoration: none; cursor: pointer; white-space: nowrap;
  transition: background var(--t-fast) var(--ease), border-color var(--t-fast) var(--ease), color var(--t-fast) var(--ease);
}
.btn-primary { background: var(--accent); color: var(--text-on-accent); }
.btn-primary:hover { background: var(--accent-2); color: var(--text-on-accent); border-color: var(--accent-bright); }
.btn-ghost { background: var(--glass); color: var(--text); border-color: var(--glass-border); }
.btn-ghost:hover { color: var(--text); border-color: var(--accent); }
.btn:focus-visible { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-wash); }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; }
.btn-sm { min-height: 2.25rem; padding: var(--s-2) var(--s-4); font-size: var(--fs-sm); }
.btn-lg { min-height: 3.25rem; padding: var(--s-4) var(--s-8); font-size: var(--fs-md); }

.text-link {
  display: inline-flex; gap: var(--s-2); align-items: center;
  color: var(--text); font-weight: 600; text-decoration: none;
  border-bottom: 1px solid var(--accent-border); padding-bottom: var(--s-1);
}
.text-link:hover { color: var(--text); border-color: var(--accent); }


/* ---------- Plates (full-bleed photography) ---------- */
.plate { position: absolute; inset: 0; z-index: -1; background: var(--bg-deep); }
.plate-media { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.scrim { position: absolute; inset: 0; }
.scrim--title {
  background:
    linear-gradient(180deg, var(--scrim-top) 0%, var(--scrim-clear) 30%, var(--scrim-clear) 45%, var(--scrim-strong) 100%);
}

/* ---------- Type ---------- */
h1, h2, h3 { text-transform: uppercase; }
.title {
  margin: 0;
  font-family: var(--font-display); font-weight: 400; font-size: var(--fs-title);
  line-height: var(--lh-tight); letter-spacing: var(--tracking-title);
}
.section-title {
  margin: 0 0 var(--s-6);
  font-family: var(--font-display); font-weight: 400; font-size: var(--fs-chapter);
  line-height: var(--lh-head); letter-spacing: var(--tracking-title); max-width: 22ch;
}
.hl { color: var(--accent-bright); }   /* = live splash --brass-bright */
.caption-tag, figcaption {
  display: inline-block; font-size: var(--fs-sm); color: var(--text-dim);
}

/* ---------- FAQ (homepage #faq and the article FAQ) ---------- */
.faq-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-3) var(--s-6); align-items: start; }
.faq { background: var(--surface); border: 1px solid var(--border-dim); border-radius: var(--radius); transition: border-color var(--t-fast) var(--ease); }
.faq:hover, .faq[open] { border-color: var(--accent-border); }
.faq summary {
  list-style: none; cursor: pointer; padding: var(--s-4) var(--s-12) var(--s-4) var(--s-6); position: relative;
  font-size: var(--fs-md); font-weight: 600; line-height: 1.4;
  display: flex; align-items: center; min-height: calc(2 * 1.4em + 2 * var(--s-4));
}
@media (max-width: 56rem) { .faq-list { grid-template-columns: 1fr; } }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: ""; position: absolute; right: var(--s-6); top: 50%; width: var(--s-3); height: var(--s-3);
  border-right: 1.5px solid var(--text-dim); border-bottom: 1.5px solid var(--text-dim);
  transform: translateY(-70%) rotate(45deg); transition: transform var(--t-fast) var(--ease);
}
.faq[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq p { margin: 0; padding: 0 var(--s-6) var(--s-6); color: var(--text-dim); max-width: var(--measure); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* Touch floor: touch-context controls never render below 44px (DESIGN_SYSTEM.md). */
@media (pointer: coarse) {
  .btn-sm { min-height: 2.75rem; }
  .text-link, .skip { display: inline-flex; align-items: center; min-height: 2.75rem; }
}
