/* ===== INDEX PAGE =====
   Only what is specific to the index: masthead, topics, today's briefing,
   the calendar, special-report cards, the archive rows and the search
   palette. Shared patterns (eyebrow, buttons, top bar, audio player) and
   every token live in styles.css. */

.home { max-width: 1040px; margin: 0 auto; padding: 32px 24px 72px; }
/* Zero specificity, so link patterns (.btn, .btn-primary) keep their own colours. */
:where(.home) a { color: inherit; text-decoration: none; }

.kbd { font: 500 var(--fs-2xs) var(--f-mono); color: var(--muted); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 1px 6px; }

/* ----- Masthead ----- */
.mast { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px 32px; flex-wrap: wrap; padding-bottom: 22px; border-bottom: 1px solid var(--border); }
.mast h1 { margin-top: 14px; font: 400 var(--fs-hero)/.88 var(--f-display); letter-spacing: -.025em; }
.tools { display: flex; gap: 8px; align-items: center; }
.btn-search {
  justify-content: flex-start; gap: 10px; width: 260px; max-width: 100%; padding: 0 8px 0 12px;
  background: var(--bg-card); color: var(--muted); font: var(--fs-sm) var(--f-body);
}
.btn-search:hover { color: var(--muted); border-color: color-mix(in srgb, var(--on-surface) 25%, transparent); }
.btn-search .kbd { margin-left: auto; }
.topbar .btn-search { width: 220px; }
.topbar .topbar-brand { margin-right: auto; }
@media (max-width: 640px) { .tools { width: 100%; } .tools .btn-search { flex: 1; width: auto; } .hide-sm { display: none; } }
@media (max-width: 560px) { .topbar .btn-search { width: 150px; } }

/* ----- Topics ----- */
.topics { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; padding-top: 14px; }
.topics .eyebrow { margin-right: 6px; }
.chip {
  padding: 7px 11px; border: 1px solid var(--border); border-radius: var(--r-pill); background: transparent; cursor: pointer;
  font: 500 var(--fs-xs)/1 var(--f-body); color: var(--on-surface-variant);
  transition: background var(--dur-fast), color var(--dur-fast);
}
.chip span { margin-left: 5px; font: var(--fs-2xs) var(--f-mono); color: var(--muted); }
.chip:hover { color: var(--on-surface); background: var(--bg-card); }
.chip[aria-pressed="true"] { background: var(--on-surface); border-color: var(--on-surface); color: var(--bg); }
.chip[aria-pressed="true"] span { color: var(--bg); opacity: .7; }
.topics .link { padding: 7px 6px; }
.status { min-height: 18px; padding-top: 10px; font: var(--fs-xs) var(--f-mono); color: var(--muted); }

/* ----- Today ----- */
.today { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: 48px; padding: 30px 0 48px; border-bottom: 1px solid var(--border); }
.today h2 { margin: 14px 0 22px; font: 400 var(--fs-display-sm)/1 var(--f-display); letter-spacing: -.02em; text-wrap: balance; }
.today h2 a { transition: color var(--dur-fast); }
.today h2 a:hover { color: var(--primary); }
.today ol { list-style: none; counter-reset: h; }
.today li {
  counter-increment: h; display: grid; grid-template-columns: 30px 1fr; gap: 6px; padding: 11px 0;
  border-top: 1px solid var(--border); color: var(--on-surface-variant);
  animation: rise var(--dur-slow) var(--ease) backwards;
}
.today li:nth-child(2) { animation-delay: .06s; } .today li:nth-child(3) { animation-delay: .12s; }
.today li:nth-child(4) { animation-delay: .18s; } .today li:nth-child(5) { animation-delay: .24s; }
.today li::before { content: counter(h, decimal-leading-zero); font: var(--fs-xs)/1.9 var(--f-mono); color: var(--muted); }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } }
.side { display: flex; flex-direction: column; justify-content: flex-end; gap: 14px; }
.yday { font-size: var(--fs-sm); color: var(--muted); }
.yday a { color: var(--on-surface-variant); border-bottom: 1px solid var(--border); }
.yday a:hover { color: var(--on-surface); }
@media (max-width: 780px) { .today { grid-template-columns: 1fr; gap: 28px; } }

/* ----- Sections ----- */
.sec { padding-top: 52px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 20px; }
.sec-head h3 { font: 400 var(--fs-2xl)/1 var(--f-display); letter-spacing: -.015em; }
/* Right-aligned tracked caps carry trailing letter-spacing; pull it back so the edge lines up. */
.sec-head .eyebrow, .month-h .eyebrow { margin-right: -.1em; }

/* ----- Calendar ----- */
.cal-wrap { display: grid; grid-template-columns: minmax(0, auto) minmax(0, 1fr); gap: 32px 56px; align-items: end; }
@media (max-width: 860px) { .cal-wrap { grid-template-columns: minmax(0, 1fr); } }
.cal-scroll { overflow-x: auto; padding: 4px 4px 6px; }
.cal { display: grid; grid-auto-flow: column; grid-template-rows: 16px repeat(7, 14px); grid-template-columns: 30px; grid-auto-columns: 14px; gap: 3px; width: max-content; }
.cal .ml { grid-row: 1; font: var(--fs-2xs)/16px var(--f-mono); color: var(--muted); white-space: nowrap; }
.cal .wd { font: var(--fs-2xs)/14px var(--f-mono); color: var(--muted); }
.cell { display: block; width: 14px; height: 14px; border-radius: 3px; background: color-mix(in srgb, var(--on-surface) 6%, transparent); transition: transform var(--dur-fast) var(--ease), opacity var(--dur-base); }
a.cell:hover, a.cell:focus-visible { transform: scale(1.3); }
.l1 { background: color-mix(in srgb, var(--primary) 28%, var(--bg-card)); }
.l2 { background: color-mix(in srgb, var(--primary) 50%, var(--bg-card)); }
.l3 { background: color-mix(in srgb, var(--primary) 74%, var(--bg-card)); }
.l4 { background: var(--primary); }
.cell.dim { opacity: .2; }
.facts { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; }
.fact .n { font: 400 var(--fs-3xl)/1 var(--f-display); letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.fact .n small { font-size: .5em; }
.fact .k { margin-top: 6px; font-size: var(--fs-sm); color: var(--muted); }
.cal-foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 12px; font: var(--fs-2xs) var(--f-mono); color: var(--muted); }
.legend { display: inline-flex; gap: 3px; align-items: center; }
.legend .cell { width: 10px; height: 10px; border-radius: 2px; }
.tip {
  position: fixed; z-index: 30; max-width: 280px; padding: 8px 10px; pointer-events: none;
  background: var(--on-surface); color: var(--bg); border-radius: var(--r-md);
  font-size: var(--fs-xs); line-height: 1.4;
  opacity: 0; transform: translateY(4px); transition: opacity var(--dur-fast) var(--ease-in), transform var(--dur-fast) var(--ease-in);
}
.tip.on { opacity: 1; transform: none; transition-duration: var(--dur-base); transition-timing-function: var(--ease); }
.tip .eyebrow { display: block; margin-bottom: 3px; color: var(--bg); opacity: .65; }

/* ----- Special-report cards ----- */
.specials { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 32px; }
.sp { display: flex; flex-direction: column; gap: 10px; padding: 18px 0 26px; border-top: 1px solid var(--border); }
.sp h4 { font: 400 var(--fs-lg)/1.1 var(--f-display); letter-spacing: -.01em; text-wrap: balance; transition: color var(--dur-fast); }
.sp:hover h4 { color: var(--primary); }
.sp p { font-size: var(--fs-sm); color: var(--muted); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sp .eyebrow b { color: var(--on-surface-variant); }   /* series name: a label, not a brand moment */
.sp .meta { margin-top: auto; padding-top: 4px; display: flex; justify-content: space-between; font: var(--fs-2xs) var(--f-mono); color: var(--muted); }
@media (max-width: 900px) { .specials { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .specials { grid-template-columns: 1fr; } }

/* ----- Daily archive ----- */
.month + .month { margin-top: 28px; }
.month-h {
  position: sticky; top: calc(env(safe-area-inset-top, 0px) + var(--topbar-h)); z-index: 2; background: var(--bg);
  display: flex; justify-content: space-between; align-items: baseline; padding: 12px 0 8px; border-bottom: 1px solid var(--border);
}
.month-h h5 { font: 400 var(--fs-lg) var(--f-display); }
.row {
  display: grid; grid-template-columns: 70px minmax(0, 1fr) auto; gap: 18px; align-items: baseline;
  padding: 12px 10px; margin: 0 -10px; border-bottom: 1px solid var(--border); border-radius: var(--r-md);
  transition: background var(--dur-fast);
}
.row:hover { background: var(--bg-card); }
.row .d { font: var(--fs-xs) var(--f-mono); color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.row .d b { color: var(--on-surface); font-weight: 500; }
.row .t { min-width: 0; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.row .lead { font-weight: 500; }
.row .rest { color: var(--muted); }
.row .r { display: flex; gap: 10px; font: var(--fs-2xs) var(--f-mono); color: var(--muted); white-space: nowrap; }
.row .tg { color: var(--on-surface-variant); }
@media (max-width: 640px) { .row { grid-template-columns: 48px minmax(0, 1fr); gap: 4px 12px; } .row .r { grid-column: 2; } }
.empty { padding: 28px 0; color: var(--muted); }
.loading { padding: 40px 0; font: var(--fs-xs) var(--f-mono); color: var(--muted); }

.foot { display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-top: 64px; padding-top: 18px; border-top: 1px solid var(--border); font-size: var(--fs-sm); color: var(--muted); }
.foot a:hover { color: var(--on-surface); }

/* ----- Search palette ----- */
.pal-back {
  position: fixed; inset: 0; z-index: 40; display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px;
  background: color-mix(in srgb, var(--bg) 60%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.pal {
  width: 100%; max-width: 600px; overflow: hidden;
  background: var(--bg-card); border: 1px solid var(--border); border-radius: var(--r-lg); box-shadow: var(--shadow-pop);
  animation: pop var(--dur-fast) var(--ease);
}
@keyframes pop { from { opacity: 0; transform: translateY(-6px) scale(.985); } }
.pal-in { display: flex; align-items: center; gap: 10px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.pal input { flex: 1; min-width: 0; height: 54px; border: 0; background: transparent; color: var(--on-surface); font: var(--fs-md) var(--f-body); outline: none; }
.pal-list { max-height: 50vh; overflow-y: auto; padding: 6px; }
.pal-item { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 2px 12px; padding: 10px 12px; border-radius: var(--r-md); color: var(--on-surface); cursor: pointer; }
.pal-item[aria-selected="true"] { background: var(--bg-card-hover); }
.pal-item .pt { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-item .pm { font: var(--fs-2xs) var(--f-mono); color: var(--muted); white-space: nowrap; }
.pal-item .ps { grid-column: 1 / -1; font-size: var(--fs-xs); color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pal-foot { display: flex; gap: 14px; flex-wrap: wrap; padding: 10px 16px; border-top: 1px solid var(--border); font: var(--fs-2xs) var(--f-mono); color: var(--muted); }
