/*
Theme Name: Broadsheet
Theme URI: https://example.com/broadsheet
Author: Your Site
Description: A classic international-newspaper theme: dateline bar, centered masthead, ruled section navigation, multi-column front page with column rules, and a refined reading layout for articles.
Version: 1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: broadsheet
Tags: news, blog, three-columns, custom-menu, featured-images, translation-ready
*/

:root {
	--ink: #121212;
	--ink-soft: #363636;
	--muted: #727272;
	--rule: #dfdfdf;
	--rule-strong: #121212;
	--paper: #ffffff;
	--accent: #326891;
	--serif-brand: "Playfair Display", Georgia, "Times New Roman", serif;
	--serif-display: "Newsreader", Georgia, "Times New Roman", serif;
	--serif: Georgia, "Newsreader", "Times New Roman", serif;
	--sans: "Libre Franklin", "Helvetica Neue", Arial, sans-serif;
	--wrap: 1200px;
	--gutter: 24px;
}

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--serif);
	font-size: 18px;
	line-height: 1.55;
	-webkit-font-smoothing: antialiased;
}

img { max-width: 100%; height: auto; display: block; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--ink-soft); }
.entry-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 2px; }

.screen-reader-text {
	position: absolute !important; width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}
.skip-link:focus {
	position: fixed; top: 8px; left: 8px; z-index: 1000; width: auto; height: auto; clip: auto;
	background: var(--ink); color: #fff; padding: 8px 12px; font-family: var(--sans);
}

.wrap { max-width: var(--wrap); margin: 0 auto; padding: 0 var(--gutter); }

/* ---------- Top bar ---------- */
.topbar {
	font-family: var(--sans);
	font-size: 12px;
	border-bottom: 1px solid var(--rule);
}
.topbar .wrap {
	display: flex; align-items: center; justify-content: space-between;
	min-height: 40px; gap: 16px;
}
.topbar-left, .topbar-right { display: flex; align-items: center; gap: 16px; }
.topbar ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 16px; }
.topbar a { font-weight: 600; text-transform: uppercase; letter-spacing: .04em; font-size: 11px; }
.icon-btn {
	background: none; border: 0; padding: 6px; cursor: pointer; color: var(--ink);
	display: inline-flex; align-items: center;
}
.icon-btn svg { width: 18px; height: 18px; }
.btn-sub {
	background: var(--accent); color: #fff !important; padding: 7px 12px; border-radius: 3px;
}
.btn-sub:hover { opacity: .9; }

.search-panel { display: none; border-bottom: 1px solid var(--rule); padding: 12px 0; }
.search-panel.is-open { display: block; }
.search-form { display: flex; gap: 8px; }
.search-form input[type="search"] {
	flex: 1; font: 16px var(--sans); padding: 10px 12px; border: 1px solid var(--muted); border-radius: 3px;
}
.search-form button {
	font: 600 13px var(--sans); text-transform: uppercase; letter-spacing: .05em;
	background: var(--ink); color: #fff; border: 0; padding: 0 18px; border-radius: 3px; cursor: pointer;
}

/* ---------- Masthead ---------- */
.masthead { text-align: center; padding: 22px 0 14px; }
.masthead .meta-row {
	display: grid; grid-template-columns: 1fr auto 1fr; align-items: end; gap: 16px;
}
.masthead .dateline {
	font-family: var(--sans); font-size: 12px; text-align: left; line-height: 1.4;
}
.masthead .dateline strong { display: block; font-weight: 700; }
.masthead .edition {
	font-family: var(--sans); font-size: 12px; text-align: right; color: var(--ink-soft);
}
.site-title {
	font-family: var(--serif-brand);
	font-weight: 900;
	font-size: clamp(36px, 6.5vw, 72px);
	line-height: 1;
	margin: 0;
	letter-spacing: -.01em;
}
.site-title a:hover { color: var(--ink); }
.custom-logo { max-height: 90px; width: auto; margin: 0 auto; }
.site-tagline {
	font-family: var(--sans); font-size: 12px; color: var(--muted);
	margin: 8px 0 0; letter-spacing: .03em;
}

/* ---------- Section nav ---------- */
.section-nav {
	border-top: 1px solid var(--rule-strong);
	border-bottom: 3px double var(--rule-strong);
	font-family: var(--sans);
}
.section-nav ul {
	list-style: none; margin: 0; padding: 0;
	display: flex; justify-content: center; flex-wrap: wrap;
}
.section-nav li { position: relative; }
.section-nav a {
	display: block; padding: 10px 12px; font-size: 13px; font-weight: 500;
}
.section-nav a:hover { text-decoration: underline; color: var(--ink); }
.section-nav .current-menu-item > a,
.section-nav .current-cat > a { font-weight: 700; }
.section-nav .sub-menu {
	display: none; position: absolute; top: 100%; left: 0; z-index: 50; min-width: 200px;
	background: #fff; border: 1px solid var(--rule); flex-direction: column;
	box-shadow: 0 4px 12px rgba(0,0,0,.08);
}
.section-nav li:hover > .sub-menu,
.section-nav li:focus-within > .sub-menu { display: flex; }
.section-nav .sub-menu a { padding: 8px 14px; }
.nav-toggle { display: none !important; }
.nav-toggle svg, .icon-btn svg { width: 20px; height: 20px; flex: none; }

/* ---------- Generic typography ---------- */
.kicker {
	font-family: var(--sans); font-size: 11px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft);
	display: inline-block; margin-bottom: 6px;
}
.kicker:hover { text-decoration: underline; }
.headline {
	font-family: var(--serif-display); font-weight: 600; margin: 0 0 6px; line-height: 1.2;
	letter-spacing: -.005em; font-optical-sizing: auto; text-wrap: balance;
}
.headline a:hover { color: var(--ink-soft); }
.summary { font-family: var(--serif); color: #5a5a5a; margin: 0 0 8px; font-size: 15px; line-height: 1.45; }
.byline, .meta {
	font-family: var(--sans); font-size: 11px; color: var(--muted);
	text-transform: uppercase; letter-spacing: .04em;
}
.readtime { font-family: var(--sans); font-size: 11px; color: var(--muted); }
.figure-caption {
	font-family: var(--sans); font-size: 12px; color: var(--muted); margin-top: 6px; line-height: 1.4;
}

/* ---------- Front page ---------- */
.front { padding-top: 20px; }

.lead-grid {
	display: grid;
	grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
	border-bottom: 1px solid var(--rule-strong);
	padding-bottom: 20px;
}
.lead-main { padding-right: var(--gutter); }
.lead-side { padding-left: var(--gutter); border-left: 1px solid var(--rule); }

.lead-story {
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
	gap: var(--gutter);
	padding-bottom: 20px;
	border-bottom: 1px solid var(--rule);
}
.lead-story .headline { font-size: clamp(26px, 2.6vw, 32px); font-weight: 700; line-height: 1.15; }
.lead-story .summary { font-size: 16px; }
.lead-story .lead-media { order: 2; }
.lead-story .lead-text { order: 1; }

.secondary-row {
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
	padding-top: 18px;
}
.secondary-row .story { padding: 0 var(--gutter); border-left: 1px solid var(--rule); }
.secondary-row .story:first-child { padding-left: 0; border-left: 0; }
.secondary-row .story:last-child { padding-right: 0; }
.story .headline { font-size: 20px; }
.secondary-row .story .headline { font-size: 21px; }
.story .story-media { margin-bottom: 10px; }

.side-title {
	font-family: var(--sans); font-size: 13px; font-weight: 700;
	text-transform: uppercase; letter-spacing: .05em;
	border-bottom: 1px solid var(--rule-strong); padding-bottom: 6px; margin: 0 0 12px;
}
.side-title a:hover { text-decoration: underline; }
.side-list { list-style: none; margin: 0; padding: 0; }
.side-list li { padding: 12px 0; border-bottom: 1px solid var(--rule); }
.side-list li:first-child { padding-top: 0; }
.side-list li:last-child { border-bottom: 0; }
.side-list .author {
	font-family: var(--sans); font-size: 12px; font-weight: 700; display: block; margin-bottom: 4px;
}
.side-list .headline { font-size: 17px; margin: 0; }
.side-list .side-thumb { float: right; width: 72px; height: 72px; object-fit: cover; margin-left: 10px; border-radius: 50%; }
.side-list li::after { content: ""; display: block; clear: both; }

/* Section blocks */
.section-block { padding: 22px 0 24px; border-bottom: 1px solid var(--rule-strong); }
.section-header {
	display: flex; align-items: baseline; justify-content: space-between;
	border-top: 1px solid var(--rule-strong); padding-top: 8px; margin-bottom: 16px;
}
.section-header h2 {
	font-family: var(--sans); font-size: 15px; font-weight: 700; margin: 0;
	text-transform: none;
}
.section-header h2 a:hover { text-decoration: underline; }
.section-header .more { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.section-header .more:hover { color: var(--ink); text-decoration: underline; }

.four-col { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.four-col .story { padding: 0 calc(var(--gutter) / 1.2); border-left: 1px solid var(--rule); }
.four-col .story:first-child { padding-left: 0; border-left: 0; }
.four-col .story:last-child { padding-right: 0; }
.four-col .story .headline { font-size: 18px; }

/* Latest / stream */
.stream-grid {
	display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 1fr); gap: 0; padding-top: 22px;
}
.stream-grid .stream { padding-right: var(--gutter); }
.stream-grid .stream-aside { padding-left: var(--gutter); border-left: 1px solid var(--rule); }

.list-story {
	display: grid; grid-template-columns: 120px minmax(0, 1fr) 200px;
	gap: var(--gutter); padding: 20px 0; border-bottom: 1px solid var(--rule);
}
.list-story .date-col { font-family: var(--sans); font-size: 12px; color: var(--muted); }
.list-story .headline { font-size: 22px; }
.list-story .list-media img { width: 200px; aspect-ratio: 3/2; object-fit: cover; }
.list-story.no-media { grid-template-columns: 120px minmax(0, 1fr); }

/* Archive header */
.archive-header { padding: 32px 0 20px; border-bottom: 1px solid var(--rule-strong); text-align: left; }
.archive-header h1 {
	font-family: var(--serif-display); font-size: clamp(32px, 4vw, 48px); margin: 0 0 6px; font-weight: 700;
}
.archive-header .archive-description { font-size: 17px; color: var(--ink-soft); max-width: 720px; }
.archive-header .archive-description p { margin: 0; }

/* Pagination */
.pagination { padding: 30px 0; font-family: var(--sans); text-align: center; }
.pagination .nav-links { display: inline-flex; gap: 6px; flex-wrap: wrap; justify-content: center; }
.pagination .page-numbers {
	display: inline-block; padding: 8px 12px; border: 1px solid var(--rule); font-size: 14px;
}
.pagination .page-numbers.current { background: var(--ink); color: #fff; border-color: var(--ink); }

/* ---------- Single article ---------- */
.article { padding: 36px 0 20px; }
.article-header { max-width: 720px; margin: 0 auto; }
.article-header .kicker { font-size: 12px; }
.article-title {
	font-family: var(--serif-display); font-weight: 700; letter-spacing: -.01em; text-wrap: balance;
	font-size: clamp(32px, 4.5vw, 48px); line-height: 1.1; margin: 4px 0 14px;
}
.article-dek { font-family: var(--serif); font-size: 21px; line-height: 1.4; color: #5a5a5a; margin: 0 0 22px; }
.article-figure { max-width: 1000px; margin: 0 auto 26px; }
.article-figure img { width: 100%; }
.article-byline {
	max-width: 720px; margin: 0 auto 28px; display: flex; align-items: center; gap: 12px;
	font-family: var(--sans); font-size: 14px;
}
.article-byline img { border-radius: 50%; width: 44px; height: 44px; }
.article-byline .by { font-weight: 700; }
.article-byline time { display: block; color: var(--muted); font-size: 12px; }
.share { margin-left: auto; display: flex; gap: 6px; }
.share a {
	display: inline-flex; width: 34px; height: 34px; align-items: center; justify-content: center;
	border: 1px solid var(--rule); border-radius: 50%; font-size: 12px; font-weight: 700;
}
.share a:hover { background: #f4f4f4; }

.entry-content { max-width: 620px; margin: 0 auto; font-size: 20px; line-height: 1.6; color: #121212; }
.entry-content > * { margin: 0 0 1.1em; }
.entry-content h2, .entry-content h3, .entry-content h4 {
	font-family: var(--serif-display); line-height: 1.25; margin-top: 1.6em;
}
.entry-content h2 { font-size: 28px; }
.entry-content h3 { font-size: 23px; }
.entry-content blockquote {
	border-left: 3px solid var(--ink); margin-left: 0; padding-left: 20px;
	font-style: italic; color: var(--ink-soft);
}
.entry-content .wp-block-pullquote, .entry-content .pullquote {
	border-top: 1px solid var(--ink); border-bottom: 1px solid var(--ink);
	font-family: var(--serif-display); font-size: 26px; text-align: center; padding: 20px 0;
}
.entry-content figure { margin-left: 0; margin-right: 0; }
.entry-content figcaption, .wp-caption-text { font-family: var(--sans); font-size: 13px; color: var(--muted); }
.entry-content .alignwide { max-width: 1000px; margin-left: 50%; transform: translateX(-50%); width: 100vw; }
.entry-content .alignfull { width: 100vw; max-width: 100vw; margin-left: 50%; transform: translateX(-50%); }
.entry-content .alignleft { float: left; margin: 0 1.2em 1em 0; max-width: 50%; }
.entry-content .alignright { float: right; margin: 0 0 1em 1.2em; max-width: 50%; }
.entry-content .aligncenter { margin-left: auto; margin-right: auto; }
.entry-content table { border-collapse: collapse; width: 100%; font-family: var(--sans); font-size: 15px; }
.entry-content th, .entry-content td { border-bottom: 1px solid var(--rule); padding: 8px; text-align: left; }

.article-footer { max-width: 640px; margin: 30px auto 0; padding-top: 16px; border-top: 1px solid var(--rule); }
.tags { font-family: var(--sans); font-size: 13px; display: flex; flex-wrap: wrap; gap: 8px; }
.tags a { border: 1px solid var(--rule); padding: 4px 10px; border-radius: 20px; }
.tags a:hover { background: #f4f4f4; }

.related { padding: 30px 0; border-top: 1px solid var(--rule-strong); margin-top: 40px; }

.page-links { font-family: var(--sans); font-size: 14px; }

/* Comments */
.comments-area { max-width: 640px; margin: 40px auto; font-family: var(--sans); font-size: 15px; }
.comments-title, .comment-reply-title { font-family: var(--serif-display); font-size: 24px; }
.comment-list { list-style: none; padding: 0; }
.comment-list .children { list-style: none; padding-left: 24px; }
.comment-body { padding: 16px 0; border-bottom: 1px solid var(--rule); }
.comment-meta { font-size: 13px; color: var(--muted); }
.comment-author .avatar { float: left; margin-right: 10px; border-radius: 50%; }
.comment-form input[type="text"], .comment-form input[type="email"], .comment-form input[type="url"], .comment-form textarea {
	width: 100%; padding: 10px; border: 1px solid var(--muted); border-radius: 3px; font: inherit;
}
.comment-form .submit {
	background: var(--ink); color: #fff; border: 0; padding: 10px 20px; font: 600 14px var(--sans);
	text-transform: uppercase; letter-spacing: .05em; cursor: pointer; border-radius: 3px;
}

/* Widgets */
.widget { margin-bottom: 28px; font-family: var(--sans); font-size: 14px; }
.widget-title {
	font-family: var(--sans); font-size: 13px; font-weight: 700; text-transform: uppercase;
	letter-spacing: .05em; border-bottom: 1px solid var(--rule-strong); padding-bottom: 6px; margin: 0 0 12px;
}
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 6px 0; border-bottom: 1px solid var(--rule); }

/* ---------- Footer ---------- */
.site-footer {
	margin-top: 40px; border-top: 3px double var(--rule-strong); padding: 28px 0 40px;
	font-family: var(--sans); font-size: 13px;
}
.footer-brand {
	font-family: var(--serif-brand); font-weight: 900; font-size: 28px; margin-bottom: 20px;
}
.footer-widgets {
	display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--gutter);
	padding-bottom: 20px; border-bottom: 1px solid var(--rule);
}
.footer-sections ul { list-style: none; margin: 0; padding: 0; columns: 5; column-gap: var(--gutter); }
.footer-sections li { padding: 4px 0; break-inside: avoid; }
.footer-sections a:hover { text-decoration: underline; }
.footer-bottom {
	display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	padding-top: 16px; color: var(--muted); font-size: 12px;
}
.footer-bottom ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 14px; flex-wrap: wrap; }
.footer-bottom a:hover { color: var(--ink); text-decoration: underline; }

/* 404 / empty */
.not-found { max-width: 640px; margin: 60px auto; text-align: center; }
.not-found h1 { font-family: var(--serif-display); font-size: 44px; margin: 0 0 10px; }

/* ---------- Responsive ---------- */
@media (max-width: 1024px) {
	.four-col { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 22px; }
	.four-col .story:nth-child(3) { padding-left: 0; border-left: 0; }
	.footer-sections ul { columns: 3; }
}

@media (max-width: 860px) {
	body { font-size: 17px; }
	.lead-grid, .stream-grid { grid-template-columns: 1fr; }
	.lead-main, .stream-grid .stream { padding-right: 0; }
	.lead-side, .stream-grid .stream-aside {
		padding-left: 0; border-left: 0; border-top: 1px solid var(--rule-strong); margin-top: 20px; padding-top: 16px;
	}
	.lead-story { grid-template-columns: 1fr; }
	.lead-story .lead-media { order: 0; }
	.secondary-row { grid-template-columns: 1fr; }
	.secondary-row .story { padding: 16px 0; border-left: 0; border-top: 1px solid var(--rule); }
	.secondary-row .story:first-child { border-top: 0; padding-top: 0; }
	.list-story, .list-story.no-media { grid-template-columns: minmax(0, 1fr) 120px; }
	.list-story .date-col { grid-column: 1 / -1; }
	.list-story .list-media img { width: 120px; }
	.list-story.no-media { grid-template-columns: 1fr; }
	.footer-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }

	.masthead .meta-row { grid-template-columns: 1fr; }
	.masthead .dateline, .masthead .edition { text-align: center; }
	.masthead .edition { display: none; }

	.section-nav .wrap { padding: 0; }
	.section-nav ul {
		justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto;
		-webkit-overflow-scrolling: touch; scrollbar-width: none; padding: 0 8px;
		scroll-snap-type: x proximity;
	}
	.section-nav ul::-webkit-scrollbar { display: none; }
	.section-nav li { flex: none; scroll-snap-align: start; }
	.section-nav a { padding: 12px 10px; white-space: nowrap; font-size: 14px; }
	.section-nav .sub-menu { display: none !important; }
	.site-tagline { display: none; }
	.masthead { padding: 14px 0 10px; }
	.topbar-left ul { display: none; }
}

@media (max-width: 560px) {
	:root { --gutter: 16px; }
	body { font-size: 17px; }
	.site-title { font-size: 34px; }
	.masthead .dateline { font-size: 11px; }
	.lead-story .headline { font-size: 26px; }
	.lead-story .lead-media { margin: 0 calc(var(--gutter) * -1); }
	.lead-story .lead-media img { width: 100%; }
	.lead-story .figure-caption { padding: 0 var(--gutter); }
	/* compact stacked cards: text left, thumbnail right */
	.secondary-row .story, .four-col .story {
		display: grid; grid-template-columns: minmax(0, 1fr) 104px; column-gap: 14px; align-content: start;
	}
	.secondary-row .story > *, .four-col .story > * { grid-column: 1; }
	.secondary-row .story .story-media, .four-col .story .story-media {
		grid-column: 2; grid-row: 1 / span 4; margin: 0;
	}
	.story .story-media img { width: 104px; height: 104px; object-fit: cover; }
	.secondary-row .story .headline, .four-col .story .headline { font-size: 18px; }
	.four-col .story .summary { display: none; }
	.secondary-row .story .summary { font-size: 14px; }
	.kicker { margin-bottom: 3px; }
	.article { padding-top: 20px; }
	.article-title { font-size: 30px; }
	.article-figure { margin-left: calc(var(--gutter) * -1); margin-right: calc(var(--gutter) * -1); }
	.article-figure .figure-caption { padding: 0 var(--gutter); }
	.four-col { grid-template-columns: 1fr; }
	.four-col .story { padding: 14px 0 !important; border-left: 0 !important; border-top: 1px solid var(--rule); }
	.four-col .story:first-child { border-top: 0; padding-top: 0 !important; }
	.entry-content { font-size: 18px; }
	.article-dek { font-size: 19px; }
	.share { display: none; }
	.footer-widgets { grid-template-columns: 1fr; }
	.footer-sections ul { columns: 2; }
}
