/* Medi-Cal Provider Briefing
   Sources: lassie (serif-on-warm-stone, shadowless calm), attio (weight-500 base,
   soft-tag-palette, hairlines, two-cluster scale), mercury (no-bold hierarchy). */

:root {
  --bg: #f9f8f5;
  --surface: #ffffff;
  --surface-2: #f2f0ea;
  --ink: #1a1613;
  --muted: #6b6660;
  --subtle: #8d877f;
  --border: rgba(26, 22, 19, 0.09);
  --border-strong: rgba(26, 22, 19, 0.16);
  --accent: #1c7391;          /* calm clinical blue, AA on stone */
  --accent-tint: #e3f1f6;
  --accent-tint-border: #c6e4ee;
  --amber-ink: #8a4b06;       /* action-required semantic */
  --amber-tint: #fdf1de;
  --amber-tint-border: #f5ddb4;
  --red-ink: #a12f2f;
  --red-tint: #fbeaea;
  --green-ink: #1e6b45;
  --green-tint: #e2f5e9;
  --serif: "Newsreader", Georgia, serif;
  --sans: "Public Sans", system-ui, -apple-system, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, monospace;
  --ease: cubic-bezier(0.25, 1, 0.5, 1);
  --radius: 8px;
  --radius-lg: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 15.5px;
  font-weight: 500;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

.shell { max-width: 1180px; margin: 0 auto; padding: 0 24px; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }

/* ---------- header ---------- */

.site-header {
  position: sticky; top: 0; z-index: 40;
  background: rgba(249, 248, 245, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-row { display: flex; align-items: center; gap: 28px; height: 60px; }

.wordmark { display: flex; align-items: baseline; gap: 10px; color: var(--ink); white-space: nowrap; }
.wordmark:hover { text-decoration: none; }
.wordmark-serif { font-family: var(--serif); font-size: 21px; font-weight: 480; letter-spacing: -0.01em; }
.wordmark-label {
  font-size: 10.5px; font-weight: 600; letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--subtle);
}

.search-wrap {
  position: relative; flex: 1; max-width: 420px; display: flex; align-items: center;
}
.search-icon { position: absolute; left: 12px; width: 15px; height: 15px; color: var(--subtle); pointer-events: none; }
#searchInput {
  width: 100%; height: 36px; padding: 0 40px 0 36px;
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: 999px;
  font: inherit; font-size: 14px; color: var(--ink);
  transition: border-color 0.2s var(--ease), box-shadow 0.2s var(--ease);
}
#searchInput::placeholder { color: var(--subtle); }
#searchInput:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
.search-kbd {
  position: absolute; right: 12px;
  font-family: var(--mono); font-size: 11px; color: var(--subtle);
  border: 1px solid var(--border); border-radius: 4px; padding: 1px 6px; background: var(--bg);
}

.source-link { margin-left: auto; font-size: 13px; color: var(--muted); white-space: nowrap; }
.source-link:hover { color: var(--accent); }

/* ---------- hero ---------- */

.hero { padding: 64px 0 48px; border-bottom: 1px solid var(--border); }

.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--subtle); margin-bottom: 18px;
}

.hero-title {
  font-family: var(--serif);
  font-size: clamp(34px, 5vw, 56px);
  font-weight: 400;
  letter-spacing: -0.025em;
  line-height: 1.05;
  max-width: 720px;
}
.hero-title em { font-style: italic; color: var(--muted); }

.hero-sub { margin-top: 16px; max-width: 560px; color: var(--muted); font-size: 16px; }

.stat-row { display: flex; gap: 48px; margin-top: 40px; flex-wrap: wrap; }
.stat { display: flex; flex-direction: column; gap: 2px; }
.stat-num { font-family: var(--serif); font-size: 30px; font-weight: 450; letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.stat-label { font-size: 12px; letter-spacing: 0.06em; text-transform: uppercase; color: var(--subtle); font-weight: 600; }
.stat-alert .stat-num { color: var(--red-ink); }

/* ---------- layout ---------- */

.layout { display: grid; grid-template-columns: 232px 1fr; gap: 56px; padding-top: 40px; padding-bottom: 96px; }

/* ---------- rail ---------- */

.rail { position: sticky; top: 84px; align-self: start; display: flex; flex-direction: column; gap: 28px; }

.source-tabs { display: flex; flex-direction: column; gap: 2px; }
.tab {
  text-align: left; padding: 7px 10px; border-radius: var(--radius);
  font-size: 14px; color: var(--muted);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.tab:hover { background: var(--surface-2); color: var(--ink); }
.tab.is-active { background: var(--ink); color: var(--bg); }

.rail-group { display: flex; flex-direction: column; gap: 8px; }
.rail-label {
  font-size: 11px; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; color: var(--subtle);
}

.seg { display: flex; flex-direction: column; gap: 2px; }
.seg-btn {
  text-align: left; padding: 6px 10px; border-radius: var(--radius); font-size: 13.5px; color: var(--muted);
  transition: background 0.15s var(--ease), color 0.15s var(--ease);
}
.seg-btn:hover { background: var(--surface-2); color: var(--ink); }
.seg-btn.is-active { background: var(--surface-2); color: var(--ink); box-shadow: inset 0 0 0 1px var(--border-strong); }

.select-wrap select {
  width: 100%; height: 34px; padding: 0 10px;
  font: inherit; font-size: 13.5px; color: var(--ink);
  background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius);
}
.select-wrap select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }

.clear-btn {
  align-self: flex-start; font-size: 13px; color: var(--accent); padding: 4px 0;
}
.clear-btn:hover { text-decoration: underline; }

/* ---------- feed ---------- */

.feed-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 8px; }
.feed-count { font-family: var(--mono); font-size: 12.5px; color: var(--subtle); }

.feed { list-style: none; }

.item {
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
  cursor: pointer;
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 24px;
  transition: background 0.15s var(--ease);
}
.item:hover { background: rgba(255, 255, 255, 0.7); }

.item-date {
  font-family: var(--mono); font-size: 12px; color: var(--subtle); padding-top: 4px;
  display: flex; flex-direction: column; gap: 6px;
}
.item-source { letter-spacing: 0.06em; text-transform: uppercase; font-size: 10.5px; }

.item-main { min-width: 0; }

.item-title {
  font-family: var(--serif); font-size: 19px; font-weight: 450; letter-spacing: -0.012em; line-height: 1.28;
  transition: color 0.15s var(--ease);
}
.item:hover .item-title { color: var(--accent); }

.item-summary {
  margin-top: 6px; color: var(--muted); font-size: 14px; font-weight: 400; line-height: 1.5;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}

.item-tags { margin-top: 12px; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }

.tag {
  display: inline-flex; align-items: center; padding: 2.5px 9px;
  border-radius: 999px; border: 1px solid var(--border);
  background: var(--surface); color: var(--muted);
  font-size: 11.5px; font-weight: 500; line-height: 1.5; white-space: nowrap;
}
.tag--action { background: var(--amber-tint); border-color: var(--amber-tint-border); color: var(--amber-ink); font-weight: 600; }
.tag--reg    { background: var(--accent-tint); border-color: var(--accent-tint-border); color: var(--accent); }
.tag--alert  { background: var(--red-tint); border-color: rgba(161,47,47,0.25); color: var(--red-ink); font-weight: 600; }
.tag--new    { background: var(--green-tint); border-color: rgba(30,107,69,0.22); color: var(--green-ink); }
.tag--deadline { background: var(--amber-tint); border-color: var(--amber-tint-border); color: var(--amber-ink); font-family: var(--mono); font-size: 11px; }

.item.is-entering { animation: rise 0.5s var(--ease) both; }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.feed-empty { padding: 72px 0; text-align: center; color: var(--muted); }
.feed-empty .serif { font-family: var(--serif); font-size: 24px; display: block; margin-bottom: 8px; color: var(--ink); }

.feed-foot { display: flex; justify-content: center; padding: 32px 0; }
.more-btn {
  padding: 10px 26px; border-radius: 999px; border: 1px solid var(--border-strong);
  background: var(--surface); font-size: 14px; color: var(--ink);
  transition: border-color 0.2s var(--ease), background 0.2s var(--ease);
}
.more-btn:hover { border-color: var(--ink); }

/* ---------- reader ---------- */

.reader[hidden], .reader-backdrop[hidden] { display: none; }

.reader-backdrop {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(26, 22, 19, 0.35);
  animation: fade 0.25s var(--ease);
}
@keyframes fade { from { opacity: 0; } }

.reader {
  position: fixed; top: 0; right: 0; bottom: 0; z-index: 70;
  width: min(680px, 100vw);
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  animation: slide 0.35s var(--ease);
}
@keyframes slide { from { transform: translateX(40px); opacity: 0; } }

.reader-bar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 28px; border-bottom: 1px solid var(--border); flex-shrink: 0;
}
.reader-close {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 14px; color: var(--muted); padding: 4px 8px; border-radius: var(--radius);
}
.reader-close:hover { background: var(--surface-2); color: var(--ink); }
.reader-close-hint {
  font-family: var(--mono); font-size: 10.5px; border: 1px solid var(--border);
  border-radius: 4px; padding: 0 5px; color: var(--subtle);
}
.reader-source { font-size: 13px; }

.reader-scroll { overflow-y: auto; padding: 36px 44px 72px; }

.reader-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 18px; align-items: center; }
.reader-meta .meta-date { font-family: var(--mono); font-size: 12px; color: var(--subtle); margin-right: 6px; }

.reader-title {
  font-family: var(--serif); font-size: clamp(24px, 3.4vw, 32px); font-weight: 430;
  letter-spacing: -0.02em; line-height: 1.15; margin-bottom: 20px;
}

.reader-action {
  background: var(--amber-tint); border: 1px solid var(--amber-tint-border);
  border-radius: var(--radius-lg); padding: 14px 18px; margin-bottom: 24px;
  font-size: 14px; color: var(--amber-ink); line-height: 1.5;
}
.reader-action strong { display: block; font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 4px; }

.reader-body { font-weight: 400; font-size: 15.5px; line-height: 1.65; color: #38332d; }
.reader-body p, .reader-body ul, .reader-body ol, .reader-body address, .reader-body table { margin-bottom: 14px; }
.reader-body ul, .reader-body ol { padding-left: 22px; }
.reader-body li { margin-bottom: 6px; }
.reader-body h2, .reader-body h3 {
  font-family: var(--serif); font-weight: 480; letter-spacing: -0.01em;
  margin: 28px 0 10px; color: var(--ink);
}
.reader-body h2 { font-size: 21px; } .reader-body h3 { font-size: 18px; }
.reader-body a { color: var(--accent); text-decoration: underline; text-decoration-color: var(--accent-tint-border); text-underline-offset: 2px; }
.reader-body address { font-style: normal; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 16px; font-family: var(--mono); font-size: 13px; }
.reader-body table { border-collapse: collapse; width: 100%; font-size: 13.5px; }
.reader-body th, .reader-body td { border: 1px solid var(--border-strong); padding: 7px 10px; text-align: left; vertical-align: top; }
.reader-body th { background: var(--surface-2); font-weight: 600; }
.reader-body em { font-style: italic; }
.reader-bulletin-note { color: var(--muted); font-size: 14px; font-weight: 400; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--border); padding: 28px 0 40px; }
.site-footer p { font-size: 13px; color: var(--subtle); font-weight: 400; max-width: 560px; }

/* ---------- responsive ---------- */

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 24px; padding-top: 24px; }
  .rail { position: static; gap: 16px; }
  .source-tabs { flex-direction: row; flex-wrap: wrap; }
  .tab { padding: 6px 12px; border: 1px solid var(--border-strong); border-radius: 999px; font-size: 13px; }
  .tab.is-active { border-color: var(--ink); }
  .seg { flex-direction: row; flex-wrap: wrap; }
  .seg-btn { border: 1px solid var(--border); border-radius: 999px; padding: 5px 12px; }
  .rail-group { flex-direction: row; align-items: center; gap: 12px; flex-wrap: wrap; }
  .rail-label { flex-shrink: 0; }
  .select-wrap { flex: 1; }
  .hero { padding: 40px 0 32px; }
  .stat-row { gap: 28px; margin-top: 28px; }
  .item { grid-template-columns: 1fr; gap: 6px; padding: 18px 0; }
  .item-date { flex-direction: row; align-items: baseline; padding-top: 0; }
  .reader-scroll { padding: 28px 22px 64px; }
  .header-row { gap: 14px; }
  .wordmark-label, .source-link, .search-kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
  html { scroll-behavior: auto; }
}
