/* The Quillmark: original newspaper-style layout. */
:root {
  --paper: #f7f4ec;
  --card: #fffdf8;
  --ink: #1b1c1f;
  --ink-2: #4a4c52;
  --rule: #d9d3c4;
  --rule-strong: #1b1c1f;
  --accent: #0f5c5a;
  --link: #0f4f8a;
  --realestate: #2f6f4f;
  --tools: #2d5b9a;
  --games: #6f3d99;
  --streaming: #b2452f;
  --homerepair: #8a6421;
  --deals: #a3365c;
  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #14161a; --card: #1b1e23; --ink: #ecebe6; --ink-2: #a9abb1; --rule: #2e3238; --rule-strong: #ecebe6;
    --accent: #5fbcb6; --link: #8cc0f2;
    --realestate: #6fbf91; --tools: #82a9e6; --games: #b892e0; --streaming: #ef8a72; --homerepair: #d9ac5d; --deals: #e889ab;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #14161a; --card: #1b1e23; --ink: #ecebe6; --ink-2: #a9abb1; --rule: #2e3238; --rule-strong: #ecebe6;
  --accent: #5fbcb6; --link: #8cc0f2;
  --realestate: #6fbf91; --tools: #82a9e6; --games: #b892e0; --streaming: #ef8a72; --homerepair: #d9ac5d; --deals: #e889ab;
  color-scheme: dark;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.55 var(--sans); }
a { color: inherit; }
img { max-width: 100%; display: block; }
.wrap { max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }
.test-banner { background: #b00020; color: #fff; text-align: center; font: 700 14px/1.4 var(--sans); padding: 8px 16px; letter-spacing: .04em; }

/* ---- header */
.site-head { border-bottom: 3px double var(--rule-strong); margin-bottom: 20px; }
.topline { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: 13px; color: var(--ink-2); padding-top: 10px; padding-bottom: 6px; border-bottom: 1px solid var(--rule); }
.topline-links { display: flex; align-items: center; gap: 14px; }
.topline-links a { text-decoration: none; }
.topline-links a:hover { text-decoration: underline; }
.theme-btn { background: none; border: 1px solid var(--rule); color: var(--ink); border-radius: 50%; width: 30px; height: 30px; cursor: pointer; font-size: 16px; line-height: 1; }
.masthead { text-align: center; padding-top: 18px; padding-bottom: 10px; }
.wordmark { font-family: var(--serif); font-weight: 800; font-size: clamp(40px, 8vw, 76px); letter-spacing: -0.02em; line-height: 1; text-decoration: none; font-variation-settings: "opsz" 144; }
.wordmark.small { font-size: 28px; }
.tagline { margin: 8px 0 0; font: italic 600 15px/1.3 var(--serif); color: var(--accent); letter-spacing: .02em; }
.sections { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 22px; padding-top: 10px; padding-bottom: 10px; border-top: 1px solid var(--rule); font-weight: 600; font-size: 15px; }
.sections a { text-decoration: none; padding: 4px 0; border-bottom: 2px solid transparent; }
.sections a:hover, .sections a[aria-current] { border-bottom-color: var(--accent); }

/* ---- grid */
.front { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 32px; }
.front-side { border-left: 1px solid var(--rule); padding-left: 24px; }
@media (max-width: 900px) {
  .front { grid-template-columns: minmax(0, 1fr); }
  .front-side { border-left: 0; padding-left: 0; border-top: 3px double var(--rule-strong); padding-top: 16px; }
}

/* ---- cards */
.kicker { display: inline-block; font: 700 11px/1.2 var(--sans); letter-spacing: .1em; text-transform: uppercase; color: var(--accent); margin-bottom: 4px; }
.k-realestate { color: var(--realestate); } .k-tools { color: var(--tools); } .k-games { color: var(--games); }
.k-streaming { color: var(--streaming); } .k-homerepair { color: var(--homerepair); } .k-deals { color: var(--deals); }
.meta { display: block; font-size: 12.5px; color: var(--ink-2); margin-top: 6px; }
.meta .src::before { content: "\00b7\00a0"; }
.meta .src { font-weight: 600; }
article > a { text-decoration: none; display: block; color: inherit; }
article > a:hover h3, article > a:focus-visible h3 { text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
h1, h2, h3 { font-family: var(--serif); font-weight: 800; line-height: 1.15; letter-spacing: -0.01em; }
h3 { font-size: 19px; margin: 0; }
.summary { margin: 6px 0 0; color: var(--ink-2); font-size: 15.5px; }

.thumb { aspect-ratio: 16 / 9; overflow: hidden; background: var(--rule); margin-bottom: 10px; }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb.art { display: grid; place-items: center; color: #fff; }
.thumb.art span { font: 800 64px/1 var(--serif); opacity: .9; }
.s-realestate.art { background: linear-gradient(135deg, var(--realestate), #173a29); }
.s-tools.art { background: linear-gradient(135deg, var(--tools), #172e50); }
.s-games.art { background: linear-gradient(135deg, var(--games), #36184f); }
.s-streaming.art { background: linear-gradient(135deg, var(--streaming), #5a1d12); }
.s-homerepair.art { background: linear-gradient(135deg, var(--homerepair), #463010); }
.s-deals.art { background: linear-gradient(135deg, var(--deals), #521a2e); }

.lead-block { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(0, 1fr); gap: 24px; padding-bottom: 20px; border-bottom: 1px solid var(--rule); }
.lead h3 { font-size: clamp(26px, 3.4vw, 38px); }
.lead .summary { font-size: 17px; }
.lead .thumb.art span { font-size: 120px; }
.top-stack { display: flex; flex-direction: column; }
.compact { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.compact:first-child { padding-top: 0; }
.compact:last-child { border-bottom: 0; }
.compact .summary { font-size: 14.5px; }
@media (max-width: 700px) { .lead-block { grid-template-columns: minmax(0, 1fr); } }

/* ---- rails */
.rail { padding: 18px 0 22px; border-bottom: 1px solid var(--rule); }
.rail-head { display: flex; justify-content: space-between; align-items: baseline; border-top: 2px solid var(--rule-strong); padding-top: 8px; margin-bottom: 14px; }
.rail-head h2 { margin: 0; font-size: 22px; }
.rail-head h2 a { text-decoration: none; }
.more { font-size: 13px; font-weight: 600; color: var(--link); }
.rail-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 20px; }
.rail-grid h3 { font-size: 17px; }
.rail-grid .thumb.art span { font-size: 44px; }
@media (max-width: 1000px) { .rail-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 480px) { .rail-grid { grid-template-columns: minmax(0, 1fr); } }
.empty { color: var(--ink-2); margin: 0; }
.empty a { color: var(--link); }

/* ---- latest */
.latest h2, .side-box h2, .related h2, .sources h2 { font-size: 18px; border-top: 2px solid var(--rule-strong); padding-top: 8px; margin: 0 0 10px; }
.latest ol { list-style: none; counter-reset: n; margin: 0; padding: 0; }
.latest li { counter-increment: n; position: relative; padding: 10px 0 10px 30px; border-bottom: 1px solid var(--rule); }
.latest li::before { content: counter(n); position: absolute; left: 0; top: 8px; font: 800 20px/1 var(--serif); color: var(--ink-2); }
.latest li > a { display: block; font-weight: 600; text-decoration: none; line-height: 1.3; }
.latest li > a:hover { text-decoration: underline; }
.latest .kicker { margin-bottom: 2px; }
.updated { font-size: 12px; color: var(--ink-2); }
.side-box { margin-bottom: 24px; }
.side-box ul { margin: 0; padding-left: 18px; }
.side-box a { color: var(--link); }

/* ---- section page */
.crumbs { font-size: 13px; color: var(--ink-2); margin-bottom: 10px; }
.crumbs a { color: var(--link); }
.section-head { border-bottom: 1px solid var(--rule); margin-bottom: 8px; }
.section-head h1 { font-size: clamp(30px, 5vw, 46px); margin: 0 0 6px; }
.answer { font-size: 17px; color: var(--ink-2); margin-top: 0; }
.row { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.row > a { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: 18px; }
.row .thumb { margin: 0; }
.row h3 { font-size: 21px; }
@media (max-width: 560px) { .row > a { grid-template-columns: minmax(0, 1fr); } }

/* ---- story */
.story-head h1 { font-size: clamp(30px, 4.6vw, 46px); margin: 4px 0 10px; }
.dek { font: 600 20px/1.4 var(--serif); color: var(--ink-2); margin: 0 0 12px; }
.byline { font-size: 14px; color: var(--ink-2); border-top: 1px solid var(--rule); border-bottom: 1px solid var(--rule); padding: 8px 0; }
.story-body { max-width: 680px; font-size: 18.5px; line-height: 1.65; }
.story-body h2 { font-size: 24px; margin: 28px 0 8px; }
.story-body p { margin: 0 0 16px; }
.sources { max-width: 680px; margin-top: 28px; }
.sources a, .prose a { color: var(--link); }
.sources li { margin-bottom: 6px; }
.note { font-size: 14px; color: var(--ink-2); }
.related { margin-top: 28px; }
.related-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; }
.related-grid .compact:first-child { padding-top: 12px; }
@media (max-width: 560px) { .related-grid { grid-template-columns: minmax(0, 1fr); } }

/* ---- prose pages */
.prose { max-width: 720px; }
.prose h1 { font-size: clamp(30px, 5vw, 44px); margin-top: 0; }
.prose h2 { font-size: 22px; margin-top: 28px; }

/* ---- ads (hidden unless app.js fills them) */
.ad-slot { display: none; }
.ad-slot.on { display: block; margin: 24px 0; min-height: 100px; text-align: center; }
.ad-slot.on::before { content: "Advertisement"; display: block; font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-2); margin-bottom: 4px; }

/* ---- footer */
.site-foot { margin-top: 48px; border-top: 3px double var(--rule-strong); padding: 20px 0 32px; font-size: 14px; color: var(--ink-2); }
.network { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 16px; padding-bottom: 14px; border-bottom: 1px solid var(--rule); }
.network-label { font-weight: 700; text-transform: uppercase; letter-spacing: .08em; font-size: 12px; color: var(--ink); }
.network ul { display: flex; flex-wrap: wrap; gap: 6px 16px; list-style: none; margin: 0; padding: 0; }
.network a { color: var(--link); }
.network [aria-current] { font-weight: 700; color: var(--ink); border-bottom: 2px solid var(--accent); }
.foot-cols { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 20px; padding-top: 16px; }
.foot-cols p { max-width: 460px; }
.foot-links { list-style: none; margin: 0; padding: 0; columns: 2; column-gap: 32px; }
.foot-links li { margin-bottom: 6px; }
.foot-links a { color: var(--ink); }
.fine { font-size: 12px; margin-top: 16px; }
