/* ============================================================================
 * sprint1.css — Sprint 1-E (heartbeat) + 1-F (anchor scroll) + 1-G (subscribe).
 * Texas Business Court Live Monitor PWA layer. SMU CGI · 2026-05-28.
 *
 * All design tokens reference the existing umbrella tokens defined inline in
 * opinions/index.html (var(--navy), var(--cream), etc.). Nothing here forks
 * the design system; this file ONLY adds the new UI surfaces.
 * ============================================================================ */

/* -------------------- 1-E: Live freshness heartbeat -------------------- */
/* Reuses the existing .status-pill chrome in the hero; the JS just sets the
   label text + a single data-attribute on the pill for colour swap. */
.status-pill[data-heartbeat="green"]  { border-color: #2da06a; color: #2da06a; background: rgba(45,160,106,0.08); }
.status-pill[data-heartbeat="green"]  .status-pill__dot { background: #2da06a; }
.status-pill[data-heartbeat="yellow"] { border-color: #d4a017; color: #d4a017; background: rgba(212,160,23,0.08); }
.status-pill[data-heartbeat="yellow"] .status-pill__dot { background: #d4a017; }
.status-pill[data-heartbeat="red"]    { border-color: #c2543b; color: #c2543b; background: rgba(194,84,59,0.08); }
.status-pill[data-heartbeat="red"]    .status-pill__dot { background: #c2543b; animation-duration: 1s; }

/* -------------------- 1-F: Anchor scroll target spacing -------------------- */
/* The masthead is sticky (z-index 100). Without scroll-margin-top, anchor
   jumps land underneath it. Apply to every section the hero channels link to. */
section[id], div[id^="tab-"], .tab-panel[id], [data-tab-target] {
  scroll-margin-top: 84px;
}

/* -------------------- 1-G: Subscribe FAB + modal -------------------- */
.subscribe-fab {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 90;                           /* below masthead (100), above content */
  width: auto; min-width: 56px; height: 56px;
  padding: 0 22px 0 18px;
  border: 1px solid rgba(255,255,255,0.18);
  border-radius: 999px;
  background: var(--navy);
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.02em;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 6px 22px rgba(10,30,58,0.28), 0 2px 4px rgba(10,30,58,0.18);
  transition: transform 0.16s ease, box-shadow 0.16s ease, background 0.16s ease;
  -webkit-tap-highlight-color: transparent;
}
.subscribe-fab:hover { background: #102a52; transform: translateY(-1px); box-shadow: 0 10px 28px rgba(10,30,58,0.34); }
.subscribe-fab:active { transform: translateY(0); }
.subscribe-fab:focus-visible { outline: 2px solid var(--accent-warm); outline-offset: 3px; }
.subscribe-fab__bell {
  display: inline-flex; width: 22px; height: 22px; flex-shrink: 0;
  align-items: center; justify-content: center;
  color: var(--accent-warm);
}
.subscribe-fab__bell svg { width: 18px; height: 18px; }
@media (max-width: 640px) {
  .subscribe-fab { right: 14px; bottom: 14px; padding: 0 18px 0 14px; font-size: 13px; }
}

.subscribe-modal {
  position: fixed; inset: 0; z-index: 200;
  display: none;
  align-items: center; justify-content: center;
  padding: 24px;
  background: rgba(6, 18, 38, 0.55);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.subscribe-modal.is-open { display: flex; }
.subscribe-modal__panel {
  width: 100%; max-width: 640px; max-height: 90vh; overflow: auto;
  background: var(--cream);
  border-radius: 14px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.32);
  padding: 28px 28px 22px;
  font-family: var(--font-body);
  color: var(--ink);
}
.subscribe-modal__header { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.subscribe-modal__title { font-family: var(--font-display); font-size: 1.5rem; font-weight: 600; margin: 0; letter-spacing: -0.015em; }
.subscribe-modal__close {
  appearance: none; background: transparent; border: none;
  width: 32px; height: 32px; border-radius: 6px; cursor: pointer;
  color: var(--ink-subtle); font-size: 22px; line-height: 1;
  display: inline-flex; align-items: center; justify-content: center;
}
.subscribe-modal__close:hover { background: rgba(10,30,58,0.06); color: var(--ink); }
.subscribe-modal__lede { font-family: var(--font-display); font-style: italic; font-size: 1rem; line-height: 1.55; color: var(--ink-muted); margin: 0 0 18px; }
.subscribe-modal__row {
  display: flex; flex-direction: column;
  gap: 4px; padding: 14px 0;
  border-top: 1px solid rgba(10,30,58,0.08);
}
.subscribe-modal__row:first-of-type { border-top: none; padding-top: 8px; }
.subscribe-modal__row-head { display: flex; align-items: center; gap: 10px; }
.subscribe-modal__icon {
  width: 30px; height: 30px; flex-shrink: 0;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent-warm);
  border: 1px solid rgba(217,101,68,0.32);
  border-radius: 8px;
}
.subscribe-modal__icon svg { width: 18px; height: 18px; }
.subscribe-modal__row-title { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; color: var(--ink); margin: 0; flex: 1; }
.subscribe-modal__row-body { font-size: 0.92rem; line-height: 1.55; color: var(--ink-muted); margin: 6px 0 0 40px; }
.subscribe-modal__actions { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 0 40px; }
.subscribe-modal__btn {
  appearance: none; cursor: pointer;
  font-family: var(--font-body); font-size: 0.85rem; font-weight: 600;
  padding: 7px 14px; border-radius: 999px;
  border: 1px solid rgba(10,30,58,0.18);
  background: transparent; color: var(--navy);
  text-decoration: none;
  display: inline-flex; align-items: center; gap: 6px;
  transition: background 0.14s ease, border-color 0.14s ease, transform 0.14s ease;
}
.subscribe-modal__btn:hover { background: rgba(10,30,58,0.06); border-color: rgba(10,30,58,0.32); }
.subscribe-modal__btn--primary {
  background: var(--navy); color: var(--cream); border-color: var(--navy);
}
.subscribe-modal__btn--primary:hover { background: #102a52; color: var(--cream); border-color: #102a52; }
.subscribe-modal__btn[disabled], .subscribe-modal__btn[aria-disabled="true"] {
  opacity: 0.55; cursor: not-allowed; pointer-events: none;
}
.subscribe-modal__copy { font-family: var(--font-mono); font-size: 11px; background: rgba(10,30,58,0.05); border-radius: 6px; padding: 3px 6px; color: var(--ink-muted); }
.subscribe-modal__footnote { font-size: 0.78rem; color: var(--ink-subtle); margin: 16px 0 0; line-height: 1.5; }
.subscribe-modal__toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: var(--navy); color: var(--cream); padding: 10px 18px; border-radius: 999px;
  font-family: var(--font-body); font-size: 0.88rem; box-shadow: 0 8px 24px rgba(10,30,58,0.3);
  z-index: 300; opacity: 0; pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}
.subscribe-modal__toast.is-shown { opacity: 1; transform: translateX(-50%) translateY(-10px); }

@media (prefers-reduced-motion: reduce) {
  .subscribe-fab, .subscribe-modal__btn, .subscribe-modal__toast { transition: none; }
  .status-pill[data-heartbeat="red"] .status-pill__dot { animation: none; }
}
