/* The Capitolist — Editorial Broadsheet
   Region styles ported from the approved design mock (Option 1A).
   The inline values in the mock ARE the spec; they live here as real classes. */

:root {
	color-scheme: only light;
	--cap-desk:        #34302c;
	--cap-sheet:       #ffffff;
	--cap-ink:         #161412;
	--cap-red:         #940000;
	--cap-dek:         #4a443c;
	--cap-feed-dek:    #5a534a;
	--cap-meta:        #8a8276;
	--cap-hair:        #e4ddd3;
	--cap-hair-inner:  #eee6da;
	--cap-rule-red:    #ffd4cf;
	--cap-muted-black: #b7afa6;
	--cap-band:        #f1ede6;
	--cap-dot:         #c9c1b5;

	--cap-serif: "Newsreader", Georgia, serif;
	--cap-sans:  "Libre Franklin", system-ui, sans-serif;
	--cap-mono:  "IBM Plex Mono", ui-monospace, monospace;

	--cap-stripe-lg: repeating-linear-gradient(45deg,#e6e1d9,#e6e1d9 12px,#ddd7cd 12px,#ddd7cd 24px);
	--cap-stripe-md: repeating-linear-gradient(45deg,#e6e1d9,#e6e1d9 10px,#ddd7cd 10px,#ddd7cd 20px);
	--cap-stripe-sm: repeating-linear-gradient(45deg,#e6e1d9,#e6e1d9 8px,#ddd7cd 8px,#ddd7cd 16px);
}

* { box-sizing: border-box; }

html {
	background: var(--cap-desk);
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
}
html, body { overflow-x: hidden; max-width: 100%; }

body {
	margin: 0;
	background: var(--cap-desk);
	color: var(--cap-ink);
	font-family: var(--cap-serif);
	overflow-wrap: break-word;
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }

@keyframes cap-pulse { 0%,100% { opacity: 1; } 50% { opacity: .25; } }

/* The centered white sheet the design sits on. */
.cap-sheet {
	max-width: 1440px;
	margin: 0 auto;
	background: var(--cap-sheet);
	box-shadow: 0 30px 80px rgba(0,0,0,.4);
	overflow: hidden;
}

/* Reusable image placeholder (empty ad slots, missing featured images). */
.cap-ph { background: var(--cap-stripe-md); border: 1px solid #d8d1c6; position: relative; }
.cap-ph--lg { background: var(--cap-stripe-lg); }
.cap-ph--sm { background: var(--cap-stripe-sm); }
.cap-ph__label {
	position: absolute; top: 9px; left: 11px;
	font-family: var(--cap-mono); font-size: 10px; letter-spacing: .14em; color: var(--cap-meta);
}

/* ============================ Utility bar ============================ */
.cap-utility {
	display: flex; align-items: center; justify-content: space-between;
	padding: 9px 40px; background: var(--cap-ink); color: #e7e2db;
	font-family: var(--cap-sans); font-size: 12px; letter-spacing: .06em;
}
.cap-utility__date { text-transform: uppercase; letter-spacing: .12em; color: var(--cap-muted-black); }
.cap-utility__right { display: flex; align-items: center; gap: 22px; }
.cap-utility__countdown { color: var(--cap-muted-black); font-variant-numeric: tabular-nums; }
.cap-utility__sep { opacity: .4; }
.cap-utility__login { cursor: pointer; }
.cap-utility__subscribe {
	background: var(--cap-red); color: #fff; padding: 6px 15px;
	font-weight: 700; letter-spacing: .08em; text-transform: uppercase; cursor: pointer;
}

/* ============================= Masthead ============================= */
.cap-masthead { text-align: center; padding: 30px 40px 18px; border-bottom: 1px solid var(--cap-hair); }
.cap-masthead__kicker {
	font-family: var(--cap-sans); font-size: 11px; font-weight: 700; letter-spacing: .42em;
	text-transform: uppercase; color: var(--cap-red); margin-bottom: 10px;
}
.cap-masthead__wordmark {
	font-family: var(--cap-serif); font-weight: 800; font-size: 76px; line-height: .92;
	color: var(--cap-ink); letter-spacing: -.01em;
}
.cap-masthead__wordmark img { display: inline-block; margin: 0 auto; max-height: 96px; width: auto; }

/* ========================== Primary nav =========================== */
.cap-nav {
	display: flex; align-items: center; justify-content: center;
	padding: 0 40px; border-bottom: 3px solid var(--cap-ink); background: var(--cap-sheet);
}
.cap-nav__list {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 8px;
	list-style: none; margin: 0; padding: 12px 0;
	font-family: var(--cap-sans); font-size: 14px; font-weight: 700; letter-spacing: .07em;
	text-transform: uppercase; color: var(--cap-ink);
}
/* Tabs: uniform light cream with a subtle outline and softly rounded corners. */
.cap-nav__list a {
	display: block; padding: 8px 16px; border-radius: 6px;
	background: #f4f0e8; border: 1px solid #e6ddcd;
	transition: color .15s ease, background .15s ease, border-color .15s ease;
}
.cap-nav__list a:hover { color: var(--cap-red); border-color: #d9cdb8; }
/* Selected tab reads as white, lifted out of the cream row. */
.cap-nav__list li.is-active a { background: #fff; border-color: var(--cap-ink); }
.cap-nav__list .current-menu-item > a,
.cap-nav__list .cap-nav__current {
	color: var(--cap-red); border-bottom: 3px solid var(--cap-red);
	padding-bottom: 14px; margin-bottom: -17px;
}
/* Hamburger toggle — desktop-hidden; revealed and wired up on mobile. */
.cap-nav__ham { display: none; }
.cap-nav__ham-bars, .cap-nav__ham-bars::before, .cap-nav__ham-bars::after {
	content: ""; display: block; width: 18px; height: 2px; background: var(--cap-ink); border-radius: 2px;
}
.cap-nav__ham-bars { position: relative; }
.cap-nav__ham-bars::before { position: absolute; left: 0; top: -6px; }
.cap-nav__ham-bars::after  { position: absolute; left: 0; top: 6px; }
.cap-nav__ham.is-open .cap-nav__ham-bars { background: transparent; }
.cap-nav__ham.is-open .cap-nav__ham-bars::before { top: 0; transform: rotate(45deg); }
.cap-nav__ham.is-open .cap-nav__ham-bars::after  { top: 0; transform: rotate(-45deg); }

/* ============================== Ads =============================== */
.cap-ad { position: relative; }
.cap-ad--leaderboard { padding: 20px 40px; display: flex; justify-content: center; background: var(--cap-band); }
.cap-ad--leaderboard .cap-ad__slot { width: 728px; height: 90px; }
.cap-ad--rectangle { margin-top: 24px; display: flex; justify-content: center; }
.cap-ad--rectangle .cap-ad__slot { width: 300px; height: 250px; }
.cap-ad__slot {
	display: flex; align-items: center; justify-content: center;
	background: var(--cap-stripe-md); border: 1px solid #d8d1c6; position: relative;
}
.cap-ad__label {
	position: absolute; top: 6px; left: 8px;
	font-family: var(--cap-mono); font-size: 9px; letter-spacing: .18em; color: #9c9488;
}
.cap-ad__size { font-family: var(--cap-mono); font-size: 12px; color: var(--cap-meta); }
.cap-ad__slot img { width: 100%; height: 100%; object-fit: contain; }

/* ============================ Main grid ============================ */
.cap-grid { display: grid; grid-template-columns: 288px 1fr 312px; gap: 34px; padding: 34px 40px 44px; }

/* ================= Shared panel header (wire + most read) ================= */
.cap-panel-head {
	display: flex; align-items: center; justify-content: space-between;
	color: #fff; padding: 9px 13px;
}
.cap-panel-head--red { background: var(--cap-red); }
.cap-panel-head--black { background: var(--cap-ink); }
.cap-panel-head__titles { line-height: 1.08; }
.cap-panel-head__l1 { font-family: var(--cap-sans); font-size: 13px; font-weight: 800; letter-spacing: .12em; text-transform: uppercase; }
.cap-panel-head__l2 { font-family: var(--cap-sans); font-size: 9px; font-weight: 700; letter-spacing: .15em; text-transform: uppercase; }
.cap-panel-head--red .cap-panel-head__l2 { color: var(--cap-rule-red); }
.cap-panel-head--black .cap-panel-head__l2 { color: var(--cap-muted-black); }
.cap-panel-head__tag { font-family: var(--cap-mono); font-size: 9px; letter-spacing: .12em; }
.cap-panel-head--red .cap-panel-head__tag { color: var(--cap-rule-red); }
.cap-panel-head--black .cap-panel-head__tag { color: var(--cap-muted-black); }
.cap-panel-head__live { display: flex; align-items: center; gap: 8px; }
.cap-pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: #fff; animation: cap-pulse 1.3s infinite; flex: none; }

/* ===================== Top Stories wire (left) ===================== */
.cap-wire__body {
	border: 1px solid var(--cap-hair); border-top: none;
}
.cap-wire__item { display: flex; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--cap-hair-inner); cursor: pointer; }
.cap-wire__item:hover { background: var(--cap-band); }
.cap-wire__main { flex: 1; min-width: 0; }
.cap-wire__meta { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; flex-wrap: nowrap; overflow: hidden; }
.cap-wire__src { font-family: var(--cap-mono); font-size: 10px; font-weight: 700; letter-spacing: .03em; color: var(--cap-red); text-transform: uppercase; flex: none; white-space: nowrap; }
.cap-wire__author { font-family: var(--cap-mono); font-size: 10px; color: var(--cap-meta); min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cap-wire__meta-dot { width: 3px; height: 3px; border-radius: 50%; background: var(--cap-dot); flex: none; }
.cap-wire__time { font-family: var(--cap-mono); font-size: 10px; color: var(--cap-meta); flex: none; white-space: nowrap; }
.cap-wire__head { font-family: var(--cap-serif); font-size: 15.5px; font-weight: 600; line-height: 1.28; color: var(--cap-ink); }
.cap-wire__chip {
	display: inline-block; vertical-align: baseline; position: relative; top: -1px;
	margin-right: 6px; padding: 1px 7px 2px; background: var(--cap-ink); color: #fff;
	font-family: var(--cap-sans); font-size: 9.5px; font-weight: 800; letter-spacing: .06em;
	text-transform: uppercase; border-radius: 3px; white-space: nowrap;
}
.cap-wire__arrow { color: var(--cap-dot); font-size: 12px; }
.cap-wire__thumb { width: 58px; height: 58px; flex: none; }
.cap-wire__more {
	padding: 13px 14px; text-align: center; border-top: 1px solid var(--cap-ink);
	font-family: var(--cap-sans); font-size: 12px; font-weight: 700; letter-spacing: .1em;
	text-transform: uppercase; color: var(--cap-ink); cursor: pointer;
	background: var(--cap-sheet);
}

/* ==================== Featured story (center top) ==================== */
.cap-featured__kicker { font-family: var(--cap-sans); font-size: 12px; font-weight: 800; letter-spacing: .2em; text-transform: uppercase; color: var(--cap-red); margin-bottom: 10px; }
.cap-featured__lead { width: 100%; height: 390px; margin-bottom: 18px; }
.cap-featured__lead img { width: 100%; height: 100%; object-fit: cover; }
.cap-featured__title { font-family: var(--cap-serif); font-weight: 800; font-size: 46px; line-height: 1.04; letter-spacing: -.015em; color: var(--cap-ink); margin: 0 0 14px; transition: color .15s ease; }
.cap-featured__title a:hover { color: var(--cap-red); }
.cap-featured__dek { font-family: var(--cap-serif); font-size: 20px; line-height: 1.5; color: var(--cap-dek); margin: 0 0 14px; }
.cap-featured__byline { display: flex; align-items: center; gap: 10px; font-family: var(--cap-sans); font-size: 13px; color: #6d665c; border-top: 1px solid var(--cap-hair); padding-top: 12px; }
.cap-featured__byline .author { font-weight: 700; color: var(--cap-ink); }
.cap-featured__byline .sep { color: var(--cap-dot); }

/* ===================== Capitolist Feed (center) ===================== */
.cap-feed__head { display: flex; align-items: baseline; gap: 14px; margin: 36px 0 4px; border-bottom: 3px solid var(--cap-ink); padding-bottom: 10px; }
.cap-feed__title { font-family: var(--cap-serif); font-weight: 800; font-size: 26px; color: var(--cap-ink); }
.cap-feed__label { font-family: var(--cap-sans); font-size: 12px; font-weight: 700; letter-spacing: .14em; text-transform: uppercase; color: var(--cap-meta); }
.cap-feed__list { display: flex; flex-direction: column; }
.cap-feed__item { display: grid; grid-template-columns: 200px 1fr; gap: 18px; padding: 20px 0; border-bottom: 1px solid var(--cap-hair); align-items: stretch; }
/* Thumb fills the full height of the card; the text column sizes the card. */
.cap-feed__thumb { min-height: 132px; overflow: hidden; border-radius: 2px; }
.cap-feed__thumb img, .cap-feed__thumb .cap-ph { width: 100%; height: 100%; object-fit: cover; display: block; }
/* Text column centered next to the tall thumbnail. */
.cap-feed__item > .cap-feed__body { display: flex; flex-direction: column; justify-content: center; min-width: 0; }
.cap-feed__kicker { font-family: var(--cap-sans); font-size: 11px; font-weight: 800; letter-spacing: .14em; text-transform: uppercase; color: var(--cap-red); margin-bottom: 6px; }
.cap-feed__itemtitle { font-family: var(--cap-serif); font-weight: 700; font-size: 24px; line-height: 1.12; color: var(--cap-ink); margin: 0 0 7px; transition: color .15s ease; }
.cap-feed__itemtitle a:hover { color: var(--cap-red); }
.cap-feed__dek { font-family: var(--cap-serif); font-size: 16px; line-height: 1.42; color: var(--cap-feed-dek); margin: 0 0 8px; }
.cap-feed__byline { font-family: var(--cap-sans); font-size: 12px; color: var(--cap-meta); }

/* ====================== Most Read (right rail) ====================== */
.cap-mostread__list { list-style: none; margin: 0; padding: 0; border: 1px solid var(--cap-hair); border-top: none; }
.cap-mostread__item { display: flex; align-items: center; gap: 11px; padding: 11px 14px; border-bottom: 1px solid var(--cap-hair-inner); cursor: pointer; }
.cap-mostread__item:last-child { border-bottom: none; }
.cap-mostread__item:hover { background: var(--cap-band); }
.cap-mostread__num { font-family: var(--cap-serif); font-weight: 800; font-size: 26px; line-height: .85; color: var(--cap-red); flex: none; width: 18px; text-align: center; }
.cap-mostread__thumb { width: 52px; height: 52px; flex: none; }
.cap-mostread__thumb img { width: 52px; height: 52px; object-fit: cover; }
.cap-mostread__title { font-family: var(--cap-serif); font-size: 15px; font-weight: 600; line-height: 1.2; color: var(--cap-ink); }

/* ============================== Footer ============================== */
.cap-footer { background: var(--cap-ink); color: var(--cap-muted-black); padding: 26px 40px; display: flex; align-items: center; justify-content: space-between; font-family: var(--cap-sans); font-size: 13px; }
.cap-footer__wordmark { font-family: var(--cap-serif); font-weight: 800; font-size: 20px; color: var(--cap-sheet); }
.cap-footer__logo { display: inline-flex; align-items: center; }
.cap-footer__logo img { height: 30px; width: auto; }
/* Fallback only: reverse the dark logo to white if no real white asset is set. */
.cap-footer__logo--invert img { filter: brightness(0) invert(1); }
.cap-footer__meta { letter-spacing: .04em; }

/* ============================ Article ============================== */
.cap-article-wrap {
	display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 48px;
	max-width: 1120px; margin: 0 auto; padding: 44px 40px 56px; align-items: start;
}
.cap-article { min-width: 0; }
/* No ad rail (e.g. before the ad module is live): center a single reading column. */
.cap-article-wrap--norail { grid-template-columns: minmax(0, 760px); justify-content: center; }
.cap-article__header { margin-bottom: 6px; }
.cap-article__kicker {
	display: inline-block; font-family: var(--cap-sans); font-size: 12px; font-weight: 800;
	letter-spacing: .14em; text-transform: uppercase; color: var(--cap-red); margin-bottom: 14px;
}
.cap-article__title {
	font-family: var(--cap-serif); font-weight: 800; font-size: 50px; line-height: 1.03;
	letter-spacing: -.015em; color: var(--cap-ink); margin: 0 0 18px;
}
.cap-article__dek { font-family: var(--cap-serif); font-size: 22px; line-height: 1.5; color: var(--cap-dek); margin: 0 0 20px; }
.cap-article__byline {
	display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
	font-family: var(--cap-sans); font-size: 13px; color: #6d665c;
	border-top: 1px solid var(--cap-hair); border-bottom: 1px solid var(--cap-hair); padding: 12px 0;
}
.cap-article__byline .author { font-weight: 700; color: var(--cap-ink); }
.cap-article__byline .sep { color: var(--cap-dot); }
.cap-article__lead { margin: 18px 0 24px; }
.cap-article__lead img { width: 100%; height: auto; }
.cap-article__lead .cap-ph { aspect-ratio: 16 / 9; }
.cap-article__caption { font-family: var(--cap-sans); font-size: 12px; color: var(--cap-meta); margin-top: 8px; }

/* Article right rail — ad slots (filled by the ad module via cap_ad_slot). */
.cap-article-rail { position: sticky; top: 20px; display: flex; flex-direction: column; gap: 28px; }
.cap-ad--article-square .cap-ad__slot { width: 300px; height: 300px; }
.cap-ad--article-skyscraper .cap-ad__slot { width: 300px; height: 600px; }

/* Body copy — comfortable broadsheet reading measure. */
.cap-article__body { font-family: var(--cap-serif); font-size: 19px; line-height: 1.65; color: #2a2620; }
.cap-article__body p { margin: 0 0 22px; }
.cap-article__body a { color: var(--cap-red); text-decoration: underline; text-underline-offset: 2px; }
.cap-article__body h2 { font-family: var(--cap-serif); font-weight: 800; font-size: 30px; line-height: 1.15; margin: 40px 0 14px; color: var(--cap-ink); }
.cap-article__body h3 { font-family: var(--cap-serif); font-weight: 700; font-size: 24px; line-height: 1.2; margin: 32px 0 12px; color: var(--cap-ink); }
.cap-article__body blockquote {
	margin: 28px 0; padding: 6px 0 6px 24px; border-left: 3px solid var(--cap-red);
	font-style: italic; font-size: 22px; line-height: 1.5; color: var(--cap-dek);
}
.cap-article__body img { height: auto; margin: 26px 0; }
.cap-article__body ul, .cap-article__body ol { margin: 0 0 22px; padding-left: 26px; }
.cap-article__body li { margin-bottom: 8px; }

.cap-article__tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 0; }
.cap-article__tags a {
	font-family: var(--cap-sans); font-size: 11px; font-weight: 700; letter-spacing: .06em;
	text-transform: uppercase; color: var(--cap-meta); border: 1px solid var(--cap-hair);
	padding: 5px 11px; border-radius: 3px; transition: color .15s ease, border-color .15s ease;
}
.cap-article__tags a:hover { color: var(--cap-red); border-color: var(--cap-red); }
.cap-article__foot { margin-top: 40px; padding-top: 20px; border-top: 3px solid var(--cap-ink); }
.cap-article__home { font-family: var(--cap-sans); font-size: 13px; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--cap-ink); }
.cap-article__home:hover { color: var(--cap-red); }

/* Mobile-only ad slots: hidden on desktop, revealed when the layout stacks. */
.cap-ad--mobile { display: none; }

/* ============================ Responsive ============================ */
@media (max-width: 1024px) {
	/* minmax(0,1fr) + min-width:0 stop a wide featured image from blowing the
	   grid track past the viewport (Safari doesn't clamp the item min to max-width). */
	.cap-grid { grid-template-columns: minmax(0, 1fr); }
	.cap-grid > * { min-width: 0; max-width: 100%; }
	/* Stacked order: lead + Capitolist stories, then the Wire, then Most Read. */
	.cap-grid > .cap-col--center { order: 1; }
	.cap-grid > .cap-col--wire { order: 2; }
	.cap-grid > .cap-ad--mobile-grid { order: 3; }
	.cap-grid > .cap-col--rail { order: 4; }
	.cap-ad--mobile { display: flex; justify-content: center; margin: 24px 0; }
	.cap-masthead__wordmark { font-size: 12vw; }
	.cap-featured__title { font-size: 34px; }
	.cap-article-wrap { grid-template-columns: 1fr; max-width: 760px; }
	.cap-article-rail { position: static; flex-direction: row; flex-wrap: wrap; justify-content: center; }
}
@media (max-width: 768px) {
	.cap-utility, .cap-ad--leaderboard, .cap-grid { padding-left: 16px; padding-right: 16px; }
	/* Compact header: small visible logo on the left, hamburger on the right. */
	.cap-masthead { position: relative; display: flex; align-items: center; padding: 10px 16px; text-align: left; }
	.cap-masthead__wordmark { font-size: 0; }
	/* The white outline is baked into logo.png (invisible on white, legible on a
	   dark bg), so no CSS filter is needed here. */
	.cap-masthead__wordmark img { max-height: 34px; margin: 0; }
	.cap-nav__ham {
		display: flex; align-items: center; justify-content: center;
		position: absolute; top: 50%; right: 12px; transform: translateY(-50%);
		width: 42px; height: 42px; padding: 0;
		background: #fff; border: 1px solid var(--cap-hair); border-radius: 8px; cursor: pointer;
	}
	/* Categories collapse into the hamburger dropdown (2-column grid when open). */
	.cap-nav { display: none; padding: 4px 16px 10px; }
	.cap-nav.is-open { display: block; }
	.cap-nav__list { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; font-size: 12px; letter-spacing: .05em; }
	.cap-nav__list li { margin: 0; }
	.cap-nav__list a { text-align: center; padding: 11px 6px; }
	/* Lead story stays prominent. */
	.cap-featured__title { font-size: 30px; }
	/* Compact "next 5" Capitolist module: side thumbnail, no dek, first 5 only. */
	.cap-feed__list .cap-feed__item:nth-child(n+6) { display: none; }
	.cap-feed__item { grid-template-columns: 120px minmax(0, 1fr); gap: 14px; padding: 14px 0; min-height: 96px; }
	.cap-feed__thumb { min-height: 96px; }
	.cap-feed__dek { display: none; }
	.cap-feed__itemtitle { font-size: 19px; line-height: 1.2; }
	/* Footer: stack so the long tagline never squeezes/distorts the logo. */
	.cap-footer { flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px 16px; }
	.cap-footer__logo { flex: none; }
	.cap-footer__logo img { height: 28px; }
	.cap-footer__meta { line-height: 1.5; }
	.cap-article-wrap { padding: 28px 18px 40px; }
	.cap-article__title { font-size: 34px; }
	.cap-article__dek { font-size: 19px; }
	.cap-article__body { font-size: 18px; }
}
