/* Daybreak Gazette. Tokens first, then layout. Light and dark themes both defined at the token level. */
:root {
  --bg: #F6F3EC;
  --surface: #FFFFFF;
  --ink: #0F1B2D;
  --muted: #566377;
  --line: #DDD8CA;
  --accent: #1747A6;
  --accent-ink: #FFFFFF;
  --danger: #B8321D;
  --tint: #ECE8DC;
  --navy: #0B1F3A;
  --rule: #0B1F3A;
  --hot: #FF8A3D;
  --hot-soft: #FFA865;
  --hot-text: #C2490A;
  --tab-on: #0B1F3A;
  --tab-on-ink: #FFA865;
  --font-display: "Bricolage Grotesque", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Source Serif 4", Georgia, "Times New Roman", serif;
  --font-mono: "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0A1424; --surface: #11213A; --ink: #E8EEF7; --muted: #95A4BB; --line: #223555;
    --accent: #7AA8FF; --accent-ink: #0A1424; --danger: #FF8A74; --tint: #15294A;
    --rule: #3A568A; --hot-text: #FFA865; --tab-on: #1B3868; --tab-on-ink: #FFB07A;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #0A1424; --surface: #11213A; --ink: #E8EEF7; --muted: #95A4BB; --line: #223555;
  --accent: #7AA8FF; --accent-ink: #0A1424; --danger: #FF8A74; --tint: #15294A;
  --rule: #3A568A; --hot-text: #FFA865; --tab-on: #1B3868; --tab-on-ink: #FFB07A;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--font-body); font-size: 17px; line-height: 1.55; padding-inline: 16px; padding-block: 0 40px; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.wrap { max-width: 1120px; margin-inline: auto; }
.sr { position: absolute; left: -9999px; }
.skip { position: absolute; left: -9999px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 20; }
.skip:focus { left: 8px; top: 8px; }
.muted { color: var(--muted); }

.top { margin-inline: -16px; padding-inline: 16px; color: #F3F5FA; background: radial-gradient(60% 140% at 92% 125%, rgba(255,138,61,.95) 0%, rgba(255,138,61,0) 60%), linear-gradient(100deg, #0B1F3A 0%, #123A66 55%, #1F5FA8 100%); }
.strip { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; align-items: center; padding-block: 10px; border-bottom: 1px solid rgba(255,255,255,.16); font-family: var(--font-mono); font-size: 12px; color: #C3D0E3; letter-spacing: .02em; }
.strip-right { display: flex; gap: 14px; align-items: center; }
.strip a { text-decoration: none; }
.strip a:hover { color: var(--hot-soft); }
.icon-btn { display: inline-block; background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 4px 10px; font-family: var(--font-mono); font-size: 12px; color: var(--ink); text-decoration: none; line-height: 1.5; }
.icon-btn:hover { border-color: var(--accent); }
.top .icon-btn { color: #F3F5FA; border-color: rgba(255,255,255,.32); }
.top .icon-btn:hover { border-color: var(--hot-soft); }
.top :focus-visible, .admin-bar :focus-visible { outline-color: var(--hot-soft); }

.mast { display: flex; flex-wrap: wrap; gap: 14px 24px; align-items: end; justify-content: space-between; padding-block: 22px 24px; }
.logo { color: #FFF8EC; font-family: var(--font-display); font-weight: 800; font-size: clamp(2.4rem, 8vw, 4.6rem); line-height: .95; letter-spacing: -.04em; text-decoration: none; }
.logo { display: inline-flex; align-items: center; gap: .2em; }
.logo-mark { width: .92em; height: .92em; flex-shrink: 0; border-radius: 22%; }
.logo-text span { color: var(--hot-soft); font-family: var(--font-body); font-style: italic; font-weight: 600; letter-spacing: -.02em; }
.search { display: flex; flex: 1 1 240px; max-width: 360px; min-width: 0; }
.search input { width: 100%; min-width: 0; font-size: 15px; padding: 9px 12px; border: 1px solid transparent; border-radius: 8px; background: rgba(255,255,255,.94); color: #0F1B2D; }
.search input::placeholder { color: #566377; }

.tabs-wrap { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 5; background: var(--bg); border-bottom: 3px solid var(--hot); margin-inline: -16px; padding-inline: 16px; }
.tabs { display: flex; gap: 4px; overflow-x: auto; padding-block: 8px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs a { flex: none; border-radius: 999px; padding: 7px 14px; font-family: var(--font-display); font-weight: 700; font-size: 14px; color: var(--muted); text-decoration: none; }
.tabs a:hover { color: var(--ink); }
.tabs a[aria-current="page"] { background: var(--tab-on); color: var(--tab-on-ink); }

.page { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 36px; padding-top: 26px; }
@media (max-width: 880px) { .page { grid-template-columns: minmax(0, 1fr); } }
.col { min-width: 0; }
.page-title { margin: 0 0 14px; font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 5vw, 3rem); letter-spacing: -.03em; line-height: 1.05; }
.label { margin: 0 0 10px; font-family: var(--font-mono); font-size: 12px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--accent); }
.label.spaced { margin-top: 28px; }

.kicker { display: flex; gap: 10px; align-items: baseline; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .07em; color: var(--muted); }
.kicker .cat { color: var(--hot-text); font-weight: 500; text-decoration: none; }
.kicker .cat:hover { text-decoration: underline; }
.thumb { display: block; margin-bottom: 12px; border-radius: 8px; overflow: hidden; background: var(--tint); box-shadow: 0 8px 24px rgba(11,31,58,.18); }
.thumb img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

.lead { padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.lead h2 { margin: 10px 0 12px; font-family: var(--font-display); font-weight: 800; font-size: clamp(1.9rem, 4.6vw, 3rem); line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
.lead h2 a { text-decoration: none; }
.lead h2 a:hover { text-decoration: underline; text-decoration-thickness: 3px; text-underline-offset: 5px; text-decoration-color: var(--hot); }
.lead .dek { font-size: 1.15rem; color: var(--muted); max-width: 62ch; margin: 0; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 28px; }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 760px) { .grid.three { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .grid, .grid.three { grid-template-columns: minmax(0, 1fr); } }
.card { padding-block: 20px; border-bottom: 1px solid var(--line); min-width: 0; }
.card h3 { margin: 8px 0; font-family: var(--font-display); font-weight: 700; font-size: 1.28rem; line-height: 1.15; letter-spacing: -.015em; text-wrap: balance; }
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: var(--hot); }
.card .dek { margin: 0; color: var(--muted); font-size: .98rem; }

.items { list-style: none; margin: 0; padding: 0; }
.item { padding-block: 12px; border-bottom: 1px solid var(--line); }
.item a { font-family: var(--font-display); font-weight: 700; font-size: 1.02rem; line-height: 1.2; text-decoration: none; }
.item a:hover { text-decoration: underline; text-decoration-color: var(--hot); text-underline-offset: 3px; }
.item .snip { margin: 6px 0 0; font-size: .92rem; color: var(--muted); }
.item .src { display: block; margin-top: 6px; font-family: var(--font-mono); font-size: 11px; letter-spacing: .03em; color: var(--muted); }
.side { align-self: start; }

.band { margin-top: 38px; }
.band-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; padding-bottom: 6px; border-bottom: 3px solid var(--rule); }
.band-head h3 { margin: 0; font-family: var(--font-display); font-weight: 800; font-size: 1.5rem; letter-spacing: -.02em; }
.band-head a { font-family: var(--font-mono); font-size: 12px; color: var(--accent); text-decoration: none; }
.band-head a:hover { text-decoration: underline; }
.sections { padding-top: 6px; }
.pager { display: flex; justify-content: space-between; gap: 12px; margin-top: 24px; font-family: var(--font-mono); font-size: 13px; }
.pager a { color: var(--accent); }
.empty { padding-block: 30px; color: var(--muted); }
.empty h1, .empty h2 { color: var(--ink); font-family: var(--font-display); letter-spacing: -.02em; }

/* article */
.article-wrap { padding-top: 26px; }
.article { max-width: 720px; margin-inline: auto; }
.article h1 { margin: 10px 0 14px; font-family: var(--font-display); font-weight: 800; font-size: clamp(2rem, 5vw, 3.1rem); line-height: 1.04; letter-spacing: -.03em; text-wrap: balance; }
.article .dek { font-size: 1.25rem; color: var(--muted); margin: 0 0 16px; }
.byline { font-family: var(--font-mono); font-size: 12px; color: var(--muted); letter-spacing: .02em; margin: 0 0 18px; }
.hero { margin: 0 0 18px; }
.hero img { width: 100%; border-radius: 8px; }
.hero figcaption { margin-top: 8px; font-size: 13px; color: var(--muted); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; padding-block: 12px; margin-bottom: 22px; border-block: 1px solid var(--line); }
.body { font-size: 1.12rem; line-height: 1.72; }
.body p, .body ul, .body ol, .body blockquote { margin: 0 0 1.1em; max-width: 65ch; }
.body h2, .body h3 { font-family: var(--font-display); letter-spacing: -.02em; line-height: 1.15; margin: 1.6em 0 .5em; }
.body a { color: var(--accent); }
.body blockquote { border-left: 3px solid var(--hot); padding-left: 16px; color: var(--muted); }
.body img { border-radius: 8px; margin-block: 1em; }
.body table { border-collapse: collapse; display: block; overflow-x: auto; }
.body th, .body td { border: 1px solid var(--line); padding: 6px 10px; }
.sources { margin-top: 28px; padding: 16px 18px; background: var(--tint); border-radius: 10px; font-size: 15px; }
.sources ul { margin: 0; padding-left: 18px; }
.sources a { color: var(--accent); overflow-wrap: anywhere; }
.draft-note { background: var(--danger); color: var(--bg); padding: 8px 12px; border-radius: 6px; font-family: var(--font-mono); font-size: 12px; margin: 0 0 16px; }

.site-foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 18px 40px; margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line); font-size: 14px; color: var(--muted); }
.site-foot p { max-width: 62ch; margin: 6px 0 0; }
.site-foot strong { font-family: var(--font-display); color: var(--ink); }
.site-foot nav { display: flex; gap: 16px; align-items: start; }

/* admin */
body.admin { padding-inline: 16px; }
.admin-top { margin-inline: -16px; padding-inline: 16px; background: linear-gradient(100deg, #0B1F3A 0%, #123A66 100%); border-bottom: 3px solid var(--hot); color: #F3F5FA; }
.admin-bar { display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: center; justify-content: space-between; padding-block: 12px; }
.admin-bar .icon-btn { color: #F3F5FA; border-color: rgba(255,255,255,.32); }
.admin-bar nav { display: flex; flex-wrap: wrap; gap: 4px 16px; font-family: var(--font-display); font-weight: 700; font-size: 15px; }
.admin-bar a { text-decoration: none; color: #C3D0E3; }
.admin-bar a:hover, .admin-bar a[aria-current="page"] { color: var(--hot-soft); }
.admin-bar strong { font-family: var(--font-display); font-size: 18px; letter-spacing: -.02em; }
.admin-main { padding-top: 24px; max-width: 920px; }
.admin-main h1 { margin: 0 0 16px; font-family: var(--font-display); font-weight: 800; font-size: 2rem; letter-spacing: -.02em; }
.admin-main h2 { margin: 28px 0 10px; font-family: var(--font-display); font-size: 1.2rem; }
.flash { background: var(--tint); border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 15px; }
.error { background: color-mix(in srgb, var(--danger) 14%, var(--surface)); border: 1px solid var(--danger); border-radius: 8px; padding: 10px 14px; margin-bottom: 16px; font-size: 15px; }
.btn { display: inline-block; background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent); border-radius: 8px; padding: 8px 16px; font-family: var(--font-display); font-weight: 700; font-size: 14px; text-decoration: none; }
.btn:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { border-color: var(--accent); filter: none; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--danger); }
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; font-family: var(--font-mono); font-size: 13px; }
.filters a { padding: 4px 10px; border: 1px solid var(--line); border-radius: 999px; text-decoration: none; }
.filters a[aria-current="true"] { background: var(--tab-on); color: var(--tab-on-ink); border-color: var(--tab-on); }
.table-wrap { overflow-x: auto; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; }
table.t { width: 100%; border-collapse: collapse; font-size: 15px; }
table.t th { text-align: left; font-family: var(--font-mono); font-size: 11px; font-weight: 500; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); padding: 10px 12px; border-bottom: 1px solid var(--line); white-space: nowrap; }
table.t td { padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
table.t tr:last-child td { border-bottom: 0; }
td.actions { display: table-cell; white-space: nowrap; }
td.actions > * { margin-right: 6px; }
td.actions > *:last-child { margin-right: 0; }
.pill { display: inline-block; font-family: var(--font-mono); font-size: 11px; padding: 2px 8px; border-radius: 999px; background: var(--tint); }
.pill.live { background: var(--accent); color: var(--accent-ink); }
.pill.off { color: var(--danger); }
form.stack { display: grid; gap: 16px; }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .field .l { font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); }
.field input[type=text], .field input[type=password], .field input[type=url], .field input[type=datetime-local], .field select, .field textarea { width: 100%; min-width: 0; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); }
.field textarea { min-height: 120px; resize: vertical; font-family: var(--font-mono); font-size: 14px; line-height: 1.5; }
.field textarea.big { min-height: 380px; }
.field .hint { font-size: 13px; color: var(--muted); font-family: var(--font-body); text-transform: none; letter-spacing: 0; }
.row2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
@media (max-width: 620px) { .row2 { grid-template-columns: minmax(0, 1fr); } }
.check { display: flex; gap: 8px; align-items: center; font-size: 15px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.inline { display: inline; margin: 0; }
.cur-img { max-width: 240px; border-radius: 8px; border: 1px solid var(--line); }
.login-box { max-width: 380px; margin: 12vh auto 0; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 24px; }
.login-box h1 { margin: 0 0 16px; font-family: var(--font-display); font-weight: 800; letter-spacing: -.02em; }

@media (prefers-reduced-motion: no-preference) { .card, .lead { animation: rise .35s ease both; } }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* corrections and most-read */
.correction { margin: 28px 0 0; padding: 14px 16px; border-left: 4px solid var(--danger, #b3261e); background: var(--tint, rgba(127,127,127,.08)); border-radius: 0 6px 6px 0; }
.correction .label { margin: 0 0 6px; }
.correction p { margin: 0; }
.most-read { margin-bottom: 28px; }
.ranked { list-style: none; margin: 0; padding: 0; counter-reset: rank; }
.ranked li { counter-increment: rank; display: grid; grid-template-columns: 1.6em 1fr; column-gap: 8px; padding: 10px 0; border-top: 1px solid var(--line, rgba(127,127,127,.25)); }
.ranked li::before { content: counter(rank); grid-row: span 2; font-weight: 700; font-size: 1.25rem; opacity: .45; line-height: 1.2; }
.ranked li a { font-weight: 600; text-decoration: none; }
.ranked li a:hover { text-decoration: underline; }
.ranked .src { font-size: .8rem; opacity: .7; }
