/* SEC Semiannual Reporting (S7-2026-15) — site styles
   ============================================================ */

:root {
  /* Palette */
  --navy-950: #06162b;
  --navy-900: #0a1f3a;
  --navy-800: #14305a;
  --navy-700: #1d4276;
  --navy-600: #2a5894;
  --navy-500: #3d6cad;
  --navy-400: #6f93c8;
  --navy-200: #c2d2e8;
  --navy-100: #e3ebf5;

  --gold:       #b88a35;
  --gold-soft:  #d6b25a;
  --gold-bg:    #f4ead2;

  --paper:      #f6f3ec;
  --paper-2:    #ece6d6;
  --cream:      #faf8f2;
  --white:      #ffffff;

  --ink:        #14181f;
  --ink-2:      #2b3340;
  --ink-3:      #4a5566;
  --ink-4:      #7a8493;
  --rule:       #ddd6c2;
  --rule-soft:  #ebe6d8;

  /* Position colors — these are the SEC docket's main axis */
  --pos-object:          #a4243b;
  --pos-object-bg:       #f5e3e6;
  --pos-support:         #2c6e49;
  --pos-support-bg:      #e1f0e7;
  --pos-support-caveats: #b88a35;
  --pos-support-caveats-bg: #f8efd6;
  --pos-neutral:         #7a8493;
  --pos-neutral-bg:      #ebebed;
  --pos-memo:            #4a5566;
  --pos-memo-bg:         #e2e4e8;
  /* Aliases so var(--pos-<id>) works for every position id used in code */
  --pos-meeting-memo:    #4a5566;
  --pos-meeting-memo-bg: #e2e4e8;

  /* Tier badges */
  --tier-substantive:    #14305a;
  --tier-retail:         #7a8493;
  --tier-memo:           #4a5566;

  --serif: 'Source Serif 4', 'Source Serif Pro', Georgia, 'Times New Roman', serif;
  --sans:  'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', Helvetica, Arial, sans-serif;
  --mono:  'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

  --shadow-1: 0 1px 0 var(--rule), 0 1px 2px rgba(10,31,58,0.04);
  --shadow-2: 0 2px 8px rgba(10,31,58,0.08);
  --shadow-3: 0 12px 32px -8px rgba(10,31,58,0.18);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
}

.loading {
  padding: 4rem;
  text-align: center;
  font-family: var(--sans);
  color: var(--ink-3);
}

/* ===== Layout shell ===== */
.app { min-height: 100vh; }
.container { max-width: 1100px; margin: 0 auto; padding: 0 2rem; }

/* ===== Cover hero ===== */
.cover {
  background: linear-gradient(180deg, var(--navy-900) 0%, var(--navy-800) 100%);
  color: var(--cream);
  padding: 3.5rem 0 3rem;
  border-bottom: 4px solid var(--gold);
}
.cover-eyebrow {
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gold-soft);
  margin-bottom: 0.6rem;
}
.cover-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  line-height: 1.15;
  margin: 0 0 0.5rem;
  color: var(--white);
}
.cover-sub {
  font-family: var(--sans);
  font-size: 1.05rem;
  color: var(--navy-100);
  max-width: 60ch;
  line-height: 1.45;
}
.cover-meta {
  margin-top: 1.5rem;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  color: var(--navy-200);
}
.cover-meta-item strong {
  display: block;
  color: var(--white);
  font-size: 1.15rem;
  margin-bottom: 0.1rem;
}
.draft-badge {
  display: inline-block;
  margin-left: 0.6rem;
  padding: 0.15rem 0.55rem;
  background: var(--gold);
  color: var(--navy-950);
  font-family: var(--sans);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  border-radius: 3px;
  vertical-align: middle;
}

/* ===== Stat bar (position breakdown) ===== */
.statbar { margin: 2rem 0; }
.statbar-title {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--navy-200);
  margin-bottom: 0.5rem;
}
.statbar-track {
  display: flex;
  height: 38px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--navy-700);
  box-shadow: var(--shadow-2);
}
.statbar-seg {
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--white);
  cursor: pointer;
  transition: filter 0.15s ease;
  border-right: 1px solid rgba(255,255,255,0.15);
}
.statbar-seg:last-child { border-right: none; }
.statbar-seg:hover { filter: brightness(1.15); }
.statbar-seg.pos-object          { background: var(--pos-object); }
.statbar-seg.pos-support         { background: var(--pos-support); }
.statbar-seg.pos-support-caveats { background: var(--pos-support-caveats); color: var(--navy-950); }
.statbar-seg.pos-neutral         { background: var(--pos-neutral); }
.statbar-seg.pos-meeting-memo    { background: var(--pos-memo); }
.statbar-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 1.2rem;
  margin-top: 0.7rem;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--navy-100);
}
.legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  margin-right: 0.4em;
  vertical-align: -1px;
}

/* ===== Section pattern ===== */
section { padding: 3rem 0; border-top: 1px solid var(--rule); }
section:first-of-type { border-top: none; }
.section-h {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.6rem;
  margin: 0 0 1.2rem;
  color: var(--ink);
}
.section-eyebrow {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 0.4rem;
}
.section-lede {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink-2);
  max-width: 88ch;
  margin: 0 0 1.5rem;
  line-height: 1.55;
}

/* ===== Position legend (reused across breakdown sections, themes grid) ===== */
.position-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1.2rem;
  font-family: var(--sans);
  font-size: 0.82rem;
  color: var(--ink-2);
  margin: 0 0 1rem;
  padding: 0.5rem 0.8rem;
  background: var(--cream);
  border: 1px solid var(--rule-soft);
  border-radius: 4px;
}
.position-legend-item {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  white-space: nowrap;
}
.position-legend-swatch {
  display: inline-block;
  width: 12px;
  height: 12px;
  border-radius: 2px;
  flex-shrink: 0;
}
.position-legend-swatch.pos-object          { background: var(--pos-object); }
.position-legend-swatch.pos-support         { background: var(--pos-support); }
.position-legend-swatch.pos-support-caveats { background: var(--pos-support-caveats); }
.position-legend-swatch.pos-neutral         { background: var(--pos-neutral); }
.position-legend-swatch.pos-meeting-memo    { background: var(--pos-memo); }

/* ===== Methodology section ===== */
.methodology {
  background: var(--cream);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.method-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(360px, 1fr));
  gap: 1.2rem;
  margin-bottom: 1.5rem;
}
.method-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 4px;
  padding: 1.1rem 1.3rem;
}
.method-card h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1.02rem;
  margin: 0 0 0.5rem;
  color: var(--navy-800);
}
.method-card p {
  font-family: var(--serif);
  font-size: 0.95rem;
  line-height: 1.55;
  color: var(--ink-2);
  margin: 0 0 0.7rem;
}
.method-list {
  margin: 0;
  padding-left: 1.2em;
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.6;
  color: var(--ink-2);
}
.method-list li { margin-bottom: 0.4em; }
.method-list .pos-pill {
  margin-right: 0.3em;
}
.method-card code, .method-limits code {
  font-family: var(--mono);
  font-size: 0.85rem;
  background: var(--rule-soft);
  padding: 0.05rem 0.3rem;
  border-radius: 2px;
}
.method-limits {
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  padding: 1rem 1.3rem;
  border-radius: 0 4px 4px 0;
}
.method-limits h3 {
  font-family: var(--sans);
  font-weight: 700;
  font-size: 1rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.method-limits ul {
  margin: 0;
  padding-left: 1.2em;
  font-family: var(--serif);
  font-size: 0.93rem;
  line-height: 1.55;
  color: var(--ink-2);
}
.method-limits li { margin-bottom: 0.4em; }

/* ===== Breakdown bars (by letter type, by constituency) ===== */
.breakdown {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 5px;
  padding: 0.5rem 0;
  box-shadow: var(--shadow-1);
}
.breakdown-row {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 1rem;
  align-items: center;
  padding: 0.7rem 1.2rem;
  border-bottom: 1px solid var(--rule-soft);
}
.breakdown-row:last-child { border-bottom: none; }
.breakdown-label {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.breakdown-label-name {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.96rem;
  color: var(--ink);
}
.breakdown-label-count {
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--ink-3);
}
.breakdown-bar {
  display: flex;
  height: 26px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--rule-soft);
}
.breakdown-bar-seg {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 700;
  transition: filter 0.15s ease;
}
.breakdown-bar-seg.pos-object          { background: var(--pos-object); }
.breakdown-bar-seg.pos-support         { background: var(--pos-support); }
.breakdown-bar-seg.pos-support-caveats { background: var(--pos-support-caveats); color: var(--navy-950); }
.breakdown-bar-seg.pos-neutral         { background: var(--pos-neutral); }
.breakdown-bar-seg.pos-meeting-memo    { background: var(--pos-memo); }
.breakdown-seg-n {
  pointer-events: none;
}
@media (max-width: 760px) {
  .breakdown-row { grid-template-columns: 1fr; gap: 0.4rem; }
}

/* ===== Executive summary ===== */
.exec p {
  margin: 0 0 1rem;
  /* Width pinned to container (~1100px). The previous 72ch cap left the
     right half of the section visually empty against the wider cover and
     breakdown sections; 88ch matches the visual width of the breakdown
     bars and keeps line-length under the comfortable reading max. */
  max-width: 88ch;
  font-size: 1.05rem;
  line-height: 1.65;
}
.exec p:first-child {
  font-size: 1.15rem;
  color: var(--ink-2);
}

/* ===== Themes grid ===== */
.themes-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
}
.theme-card {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 6px;
  padding: 1rem 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
  display: flex;
  flex-direction: column;
}
.theme-card:hover {
  border-color: var(--navy-600);
  box-shadow: var(--shadow-2);
  transform: translateY(-1px);
}
.theme-card-label {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 0.98rem;
  margin: 0 0 0.6rem;
  color: var(--ink);
}
.theme-card-count {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--ink-3);
  margin-bottom: 0.5rem;
}
.theme-card-bar {
  display: flex;
  height: 6px;
  border-radius: 3px;
  overflow: hidden;
  background: var(--rule-soft);
}
.theme-card-bar-seg { height: 100%; }

/* ===== Letter table / appendix ===== */
.letter-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  margin-bottom: 1rem;
}
.filter-group {
  display: flex;
  gap: 0.3rem;
}
.filter-btn {
  font-family: var(--sans);
  font-size: 0.85rem;
  font-weight: 500;
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--rule);
  background: var(--cream);
  color: var(--ink-2);
  border-radius: 3px;
  cursor: pointer;
  transition: all 0.1s;
}
.filter-btn:hover { border-color: var(--navy-600); }
.filter-btn.active {
  background: var(--navy-800);
  color: var(--white);
  border-color: var(--navy-800);
}
.search-input {
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 0.4rem 0.7rem;
  border: 1px solid var(--rule);
  background: var(--white);
  border-radius: 3px;
  flex: 1;
  max-width: 280px;
}
.letter-count {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  margin-left: auto;
}

.letter-table {
  background: var(--white);
  border: 1px solid var(--rule);
  border-radius: 4px;
  overflow: hidden;
}
.letter-row {
  display: grid;
  grid-template-columns: 50px 1fr 130px 100px;
  gap: 1rem;
  padding: 0.8rem 1rem;
  border-bottom: 1px solid var(--rule-soft);
  cursor: pointer;
  align-items: start;
  font-size: 0.93rem;
}
.letter-row:last-child { border-bottom: none; }
.letter-row:hover { background: var(--cream); }
.letter-ref {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-3);
  padding-top: 0.1rem;
}
.letter-main { min-width: 0; }
.letter-name {
  font-family: var(--sans);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: 0.15rem;
}
.letter-summary {
  font-family: var(--serif);
  font-size: 0.88rem;
  color: var(--ink-3);
  line-height: 1.4;
}
.letter-themes {
  margin-top: 0.3rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.theme-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  padding: 0.1rem 0.45rem;
  border-radius: 2px;
  background: var(--rule-soft);
  color: var(--ink-3);
}
.letter-tier {
  font-family: var(--mono);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  padding-top: 0.2rem;
}
.letter-tier.tier-substantive { color: var(--tier-substantive); }
.letter-tier.tier-retail      { color: var(--tier-retail); }
.letter-tier.tier-meeting-memo { color: var(--tier-memo); }

.pos-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  padding: 0.2rem 0.55rem;
  border-radius: 3px;
  white-space: nowrap;
}

/* Template-letter badge — surfaced on letter rows and in drawer title */
.template-badge {
  display: inline-block;
  margin-left: 0.5rem;
  padding: 0.1rem 0.5rem;
  background: var(--gold);
  color: var(--navy-950);
  font-family: var(--mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  border-radius: 3px;
  vertical-align: 2px;
}

/* Template-letter banner inside the letter drawer */
.template-banner {
  background: var(--gold-bg);
  border-left: 3px solid var(--gold);
  padding: 0.7rem 1rem;
  margin: 1rem 0;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-2);
  border-radius: 0 4px 4px 0;
  line-height: 1.45;
}

/* Hide-templates checkbox in the letter appendix filter row */
.filter-checkbox {
  display: inline-flex;
  align-items: center;
  gap: 0.4em;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-2);
  padding: 0.35rem 0.8rem;
  border: 1px solid var(--rule);
  background: var(--cream);
  border-radius: 3px;
  cursor: pointer;
  user-select: none;
}
.filter-checkbox input {
  cursor: pointer;
}
.pos-pill.pos-object          { background: var(--pos-object-bg); color: var(--pos-object); }
.pos-pill.pos-support         { background: var(--pos-support-bg); color: var(--pos-support); }
.pos-pill.pos-support-caveats { background: var(--pos-support-caveats-bg); color: #6f5320; }
.pos-pill.pos-neutral         { background: var(--pos-neutral-bg); color: var(--ink-3); }
.pos-pill.pos-meeting-memo    { background: var(--pos-memo-bg); color: var(--pos-memo); }

/* ===== Drawer ===== */
.drawer-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10,31,58,0.5);
  z-index: 100;
  display: flex;
  justify-content: flex-end;
}
.drawer {
  width: min(720px, 100%);
  background: var(--cream);
  height: 100vh;
  overflow-y: auto;
  box-shadow: var(--shadow-3);
  padding: 2rem 2.5rem 4rem;
}
.drawer-close {
  position: sticky;
  top: 0;
  background: var(--cream);
  border: none;
  color: var(--ink-3);
  font-size: 1.5rem;
  cursor: pointer;
  margin-left: auto;
  display: block;
  margin-bottom: 1rem;
}
.drawer h2 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 0 0 0.5rem;
  color: var(--ink);
}
.drawer-meta {
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--ink-3);
  margin-bottom: 1.2rem;
  display: flex;
  gap: 1rem;
  flex-wrap: wrap;
  align-items: center;
}
.drawer h3 {
  font-family: var(--sans);
  font-weight: 600;
  font-size: 1.05rem;
  margin: 1.5rem 0 0.6rem;
  color: var(--ink-2);
}
.drawer blockquote {
  margin: 0 0 1rem;
  padding: 0.7rem 1rem;
  border-left: 3px solid var(--navy-600);
  background: var(--white);
  font-family: var(--serif);
  font-size: 0.95rem;
  font-style: italic;
  color: var(--ink-2);
  line-height: 1.55;
}
.quote-attr {
  font-family: var(--sans);
  font-size: 0.82rem;
  font-style: normal;
  color: var(--ink-3);
  margin-top: 0.3rem;
  display: block;
}
.drawer-novelty {
  background: var(--paper-2);
  padding: 1rem 1.2rem;
  border-radius: 4px;
  font-family: var(--serif);
  font-size: 0.92rem;
  line-height: 1.55;
  color: var(--ink-2);
  white-space: pre-wrap;
}
.drawer-link {
  display: inline-block;
  margin-top: 1rem;
  font-family: var(--sans);
  font-size: 0.9rem;
  color: var(--navy-700);
  text-decoration: underline;
}
.drawer-retail-note {
  background: var(--paper-2);
  padding: 0.8rem 1rem;
  font-family: var(--sans);
  font-size: 0.88rem;
  color: var(--ink-3);
  border-radius: 4px;
  margin-top: 1.5rem;
  border-left: 3px solid var(--gold);
}

/* ===== Footer ===== */
footer {
  padding: 3rem 0 4rem;
  background: var(--navy-900);
  color: var(--navy-200);
  font-family: var(--sans);
  font-size: 0.88rem;
  border-top: 4px solid var(--gold);
}
footer a { color: var(--gold-soft); }

/* ===== Responsive ===== */
@media (max-width: 760px) {
  .container { padding: 0 1.2rem; }
  .letter-row {
    grid-template-columns: 40px 1fr;
    grid-template-areas:
      "ref main"
      ".   meta";
  }
  .letter-ref { grid-area: ref; }
  .letter-main { grid-area: main; }
  .letter-pos-tier {
    grid-area: meta;
    display: flex;
    gap: 0.6rem;
    align-items: center;
  }
  .letter-tier { padding-top: 0; }
  .drawer { padding: 1.2rem 1.5rem 3rem; }
}
