/*
Theme Name: Crimson Press Light
Theme URI: https://example.com/crimson-press-light
Author: Crimson Press
Author URI: https://example.com
Description: A clean red and white newspaper theme with a lead story, top-stories rail, headline ticker and a full Customizer for colours, fonts, width and layout. No plugins required.
Version: 1.0.0
Requires at least: 5.8
Tested up to: 6.6
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: crimson-press-light
Tags: news, blog, grid-layout, two-columns, right-sidebar, custom-colors, custom-logo, custom-menu, featured-images, footer-widgets, threaded-comments, theme-options, translation-ready, red, white
*/

/* ---------- Design tokens (change colours in Appearance > Customize) ---------- */
:root {
	--cp-red: #c8102e;
	--cp-ink: #1a1a1a;
	--cp-bar: #c8102e;
	--cp-paper: #ffffff;
	--cp-wrap: 1200px;
	--cp-head: 'DM Serif Display', Georgia, serif;
	--cp-head-weight: 400;
	--cp-body: 'Source Serif 4', Georgia, serif;
	--cp-ui: 'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--cp-red-dark: #9d0c24;
	--cp-muted: #666666;
	--cp-rule: #dddddd;
	--cp-tint: #f3f3f3;
}
@supports (color: color-mix(in srgb, red, blue)) {
	:root {
		--cp-red-dark: color-mix(in srgb, var(--cp-red) 78%, #000);
		--cp-muted: color-mix(in srgb, var(--cp-ink) 62%, var(--cp-paper));
		--cp-rule: color-mix(in srgb, var(--cp-ink) 15%, var(--cp-paper));
		--cp-tint: color-mix(in srgb, var(--cp-ink) 5%, var(--cp-paper));
	}
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
	margin: 0;
	background: var(--cp-paper);
	color: var(--cp-ink);
	font: 400 1.0625rem/1.65 var(--cp-body);
	-webkit-font-smoothing: antialiased;
	overflow-wrap: break-word;
}
img, video, iframe, svg { max-width: 100%; height: auto; }
img { display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: .18em; }
a:hover { color: var(--cp-red); }
:focus-visible { outline: 3px solid var(--cp-red); outline-offset: 2px; }
h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .5em;
	font-family: var(--cp-head);
	font-weight: var(--cp-head-weight);
	line-height: 1.12;
	letter-spacing: -.01em;
}
p { margin: 0 0 1.2em; }
.wrap { width: min(100% - 2.5rem, var(--cp-wrap)); margin-inline: auto; }
.site-main { padding-block: 2rem 3.5rem; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	margin: -1px; padding: 0; border: 0;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
}
.screen-reader-text:focus, .skip-link:focus {
	z-index: 100000;
	top: .5rem; left: .5rem;
	width: auto; height: auto;
	margin: 0; padding: .75rem 1rem;
	clip: auto; clip-path: none;
	background: var(--cp-red); color: #fff;
	font: 600 .875rem var(--cp-ui);
	text-decoration: none;
}

/* ---------- Header ---------- */
.site-header { border-top: 0; }
.topbar { background: var(--cp-bar); color: var(--cp-paper); font: 500 .8125rem/1 var(--cp-ui); }
.topbar__in { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding-block: .55rem; }
.topbar__right { display: flex; align-items: center; gap: 1.25rem; }
.topbar__social { display: flex; gap: 1rem; }
.topbar a { text-decoration: none; }
.topbar a:hover { color: #fff; text-decoration: underline; }
.topbar .search-form { display: flex; }
.topbar .search-field {
	width: 11rem; padding: .35rem .6rem;
	border: 1px solid rgba(255,255,255,.35); border-right: 0; border-radius: 0;
	background: transparent; color: var(--cp-paper); font: inherit;
}
.topbar .search-field::placeholder { color: rgba(255,255,255,.65); }
.topbar .search-submit { padding: .35rem .75rem; font-size: .8125rem; background: var(--cp-paper); color: var(--cp-bar); }
.topbar .search-submit:hover { background: var(--cp-tint); color: var(--cp-bar); }

.masthead { padding-block: 1.9rem 1.4rem; text-align: center; }
.site-title {
	margin: 0;
	font: var(--cp-head-weight) clamp(2.6rem, 8vw, 5.5rem)/1 var(--cp-head);
	letter-spacing: -.02em;
}
.site-title a { text-decoration: none; }
.site-title a:hover { color: var(--cp-red); }
.site-tagline { margin: .75rem 0 0; color: var(--cp-muted); font-style: italic; }
.masthead__logo img { margin-inline: auto; max-height: 110px; width: auto; }

.primary-nav { background: var(--cp-bar); color: var(--cp-paper); border-top: 1px solid rgba(255,255,255,.35); }
.nav-in { display: flex; justify-content: center; }
.menu-wrap .menu { display: flex; flex-wrap: wrap; justify-content: center; margin: 0; padding: 0; list-style: none; }
.menu li { position: relative; }
.menu a {
	display: block; padding: .95rem 1.1rem;
	font: 600 .9rem/1.2 var(--cp-ui);
	text-decoration: none;
}
.menu a:hover, .menu .current-menu-item > a, .menu .current-cat > a, .menu .current-menu-ancestor > a, .menu li:focus-within > a {
	background: var(--cp-paper); color: var(--cp-bar);
}
.menu .sub-menu {
	position: absolute; z-index: 50; top: 100%; left: 0;
	display: none; min-width: 14rem; margin: 0; padding: 0;
	background: var(--cp-bar); list-style: none;
	border-top: 3px solid var(--cp-paper);
}
.menu li:hover > .sub-menu, .menu li:focus-within > .sub-menu { display: block; }
.menu .sub-menu a { padding: .75rem 1.1rem; font-weight: 500; }
.nav-toggle { display: none; }

/* Ticker */
.ticker { border-bottom: 1px solid var(--cp-rule); background: var(--cp-paper); }
.ticker__in { display: flex; align-items: stretch; }
.ticker__label {
	flex: none; display: flex; align-items: center; padding: .55rem 1rem;
	background: var(--cp-red); color: #fff; font: 700 .8125rem/1 var(--cp-ui);
}
.ticker__viewport { flex: 1; min-width: 0; overflow: hidden; }
.ticker__track { display: flex; width: max-content; animation: cp-scroll 45s linear infinite; }
.ticker__track:hover, .ticker__track:focus-within { animation-play-state: paused; }
.ticker__group { display: flex; flex: none; }
.ticker__group a {
	display: block; padding: .6rem 1.5rem; white-space: nowrap;
	font: 500 .875rem/1.4 var(--cp-ui); text-decoration: none;
	border-right: 1px solid var(--cp-rule);
}
@keyframes cp-scroll { to { transform: translateX(-50%); } }

/* ---------- Section titles ---------- */
.section-title, .widget-title {
	position: relative;
	margin: 0 0 1.25rem; padding-top: .7rem;
	border-top: 3px solid var(--cp-red);
	font: var(--cp-head-weight) 1.6rem/1.1 var(--cp-head);
}
.section-title::before, .widget-title::before {
	content: ""; position: absolute; top: -3px; left: 0;
	width: 64px; height: 3px; background: var(--cp-ink);
}

/* ---------- Shared story parts ---------- */
.kicker {
	display: inline-block; margin-bottom: .5rem;
	color: var(--cp-red); font: 700 .8125rem/1.2 var(--cp-ui); text-decoration: none;
}
.kicker:hover { text-decoration: underline; }
.kicker--tab { padding: .3rem .6rem; background: var(--cp-red); color: #fff; }
.kicker--tab:hover { background: var(--cp-red-dark); color: #fff; text-decoration: none; }
.meta {
	display: flex; flex-wrap: wrap; gap: .1rem .8rem; margin: 0;
	color: var(--cp-muted); font: 400 .8125rem/1.4 var(--cp-ui);
}
.meta__author { color: var(--cp-ink); font-weight: 600; }
.noimg {
	display: grid; place-items: center; width: 100%; height: 100%; min-height: 100%;
	background: repeating-linear-gradient(135deg, var(--cp-red) 0 14px, var(--cp-red-dark) 14px 28px);
	color: #fff; font: var(--cp-head-weight) 4.5rem/1 var(--cp-head);
}

/* ---------- Home hero ---------- */
.hero { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2.5rem; padding-block: 0 2rem; }
.lead__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--cp-tint); }
.lead__media img { width: 100%; height: 100%; object-fit: cover; }
.lead__body { padding-top: 1.1rem; }
.lead__title { margin: .35rem 0 .6rem; font-size: clamp(2rem, 4.4vw, 3.4rem); }
.lead__title a { text-decoration: none; }
.lead__title a:hover { color: var(--cp-red); }
.lead__excerpt { max-width: 46rem; margin-bottom: .9rem; font-size: 1.15rem; color: var(--cp-muted); }

.rail { padding-left: 2.5rem; border-left: 1px solid var(--cp-rule); }
.rail-item { display: grid; grid-template-columns: 96px minmax(0, 1fr); gap: 1rem; padding-block: 1rem; border-bottom: 1px solid var(--cp-rule); }
.rail-item:first-of-type { padding-top: 0; }
.rail-item:last-child { border-bottom: 0; }
.rail-item__media { display: block; aspect-ratio: 1; overflow: hidden; background: var(--cp-tint); }
.rail-item__media img { width: 100%; height: 100%; object-fit: cover; }
.rail-item__media .noimg { font-size: 2rem; }
.rail-item__title { margin: 0 0 .35rem; font-size: 1.2rem; }
.rail-item__title a { text-decoration: none; }
.rail-item__title a:hover { color: var(--cp-red); }
.rail-item .kicker { margin-bottom: .25rem; }

/* ---------- Grid and cards ---------- */
.latest { padding-bottom: 1rem; }
.grid { display: grid; gap: 2.25rem 2rem; }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.card__media { display: block; aspect-ratio: 16 / 10; overflow: hidden; background: var(--cp-tint); }
.card__media img { width: 100%; height: 100%; object-fit: cover; }
.card__body { padding-top: .9rem; }
.card__title { margin: 0 0 .5rem; font-size: 1.45rem; }
.card__title a { text-decoration: none; }
.card__title a:hover { color: var(--cp-red); }
.card__excerpt { margin-bottom: .8rem; color: var(--cp-muted); font-size: 1rem; }

/* ---------- Archive headers ---------- */
.archive-head { margin-bottom: 2rem; padding-bottom: 1.25rem; border-bottom: 3px solid var(--cp-red); }
.archive-title { margin: 0; font-size: clamp(2rem, 5vw, 3.25rem); }
.archive-desc { margin-top: .75rem; color: var(--cp-muted); max-width: 46rem; }
.archive-desc p:last-child { margin-bottom: 0; }

/* ---------- Pagination ---------- */
.pagination { margin-top: 3rem; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .4rem; justify-content: center; }
.pagination .page-numbers {
	min-width: 2.6rem; padding: .55rem .9rem;
	border: 1px solid var(--cp-red); color: var(--cp-red); text-align: center;
	font: 600 .875rem/1.2 var(--cp-ui); text-decoration: none;
}
.pagination a.page-numbers:hover { background: var(--cp-red); border-color: var(--cp-red); color: #fff; }
.pagination .current { background: var(--cp-red); color: #fff; }
.pagination .dots { border-color: transparent; }

/* ---------- Single article ---------- */
.layout { display: grid; gap: 3rem; }
.layout--sidebar { grid-template-columns: minmax(0, 1fr) 320px; }
.layout--full { grid-template-columns: minmax(0, 1fr); }
.layout--full .article { max-width: 46rem; margin-inline: auto; }
.article--page { max-width: 46rem; margin-inline: auto; }
.article__head { margin-bottom: 1.5rem; }
.article__title { margin: .4rem 0 .9rem; font-size: clamp(2.2rem, 5vw, 3.6rem); }
.article__image { margin: 0 0 1.75rem; }
.article__image img { width: 100%; }
.article__image figcaption, .wp-caption-text, .wp-element-caption, figcaption {
	margin-top: .5rem; color: var(--cp-muted); font: 400 .8125rem/1.5 var(--cp-ui);
}
.entry-content { font-size: 1.1875rem; line-height: 1.75; }
.entry-content > * { max-width: 100%; }
.entry-content a { color: var(--cp-red); text-decoration: underline; }
.entry-content a:hover { color: var(--cp-red-dark); }
.entry-content h2 { margin-top: 1.8em; font-size: 2rem; }
.entry-content h3 { margin-top: 1.6em; font-size: 1.5rem; }
.entry-content ul, .entry-content ol { margin: 0 0 1.2em; padding-left: 1.4em; }
.entry-content li { margin-bottom: .35em; }
.entry-content blockquote, .wp-block-quote {
	margin: 2rem 0; padding: .25rem 0 .25rem 1.5rem;
	border-left: 5px solid var(--cp-red);
	font: italic var(--cp-head-weight) 1.5rem/1.4 var(--cp-head);
}
.entry-content blockquote cite, .wp-block-quote cite { display: block; margin-top: .6rem; color: var(--cp-muted); font: 500 .875rem var(--cp-ui); font-style: normal; }
.entry-content hr, .wp-block-separator { margin: 2.5rem 0; border: 0; border-top: 3px double var(--cp-red); }
.entry-content pre { overflow-x: auto; padding: 1rem; background: var(--cp-tint); font-size: .9rem; line-height: 1.5; }
.entry-content code { font-size: .92em; }
.entry-content table, .wp-block-table table { width: 100%; border-collapse: collapse; font: 400 .95rem/1.5 var(--cp-ui); }
.entry-content th, .entry-content td { padding: .6rem .8rem; border: 1px solid var(--cp-rule); text-align: left; }
.entry-content th { background: var(--cp-bar); color: var(--cp-paper); }
.has-dropcap .entry-content > p:first-of-type::first-letter {
	float: left; margin: .08em .12em 0 0;
	color: var(--cp-red);
	font: var(--cp-head-weight) 4.6em/.8 var(--cp-head);
}
.page-links { margin: 1.5rem 0; font: 600 .875rem var(--cp-ui); }
.tags { display: flex; flex-wrap: wrap; gap: .5rem; margin: 2rem 0; font: 500 .8125rem var(--cp-ui); }
.tags a { padding: .3rem .7rem; border: 1px solid var(--cp-rule); text-decoration: none; }
.tags a:hover { border-color: var(--cp-red); color: var(--cp-red); }

.author-box {
	display: flex; gap: 1.1rem; align-items: flex-start;
	margin: 2.5rem 0; padding: 1.4rem;
	background: var(--cp-tint); border-left: 5px solid var(--cp-red);
	font: 400 .95rem/1.55 var(--cp-ui);
}
.author-box img { border-radius: 50%; flex: none; }
.author-box p { margin: 0 0 .3rem; }
.author-box__name { font: var(--cp-head-weight) 1.3rem/1.2 var(--cp-head); }
.author-box__name a { text-decoration: none; }

.post-navigation { margin: 2.5rem 0; border-top: 1px solid var(--cp-rule); border-bottom: 1px solid var(--cp-rule); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; }
.post-navigation .nav-next { text-align: right; border-left: 1px solid var(--cp-rule); }
.post-navigation a { display: block; padding: 1.1rem 1rem; text-decoration: none; }
.post-navigation a:hover { background: var(--cp-tint); }
.nav-sub { display: block; color: var(--cp-red); font: 700 .8125rem var(--cp-ui); }
.nav-title { display: block; margin-top: .25rem; font: var(--cp-head-weight) 1.15rem/1.25 var(--cp-head); }
.related { margin-top: 3.5rem; }

/* ---------- Sidebar and widgets ---------- */
.sidebar { align-self: start; }
.widget { margin-bottom: 2.25rem; font: 400 .95rem/1.5 var(--cp-ui); }
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: .6rem 0; border-bottom: 1px solid var(--cp-rule); }
.widget li:last-child { border-bottom: 0; }
.widget a { text-decoration: none; }
.widget a:hover { color: var(--cp-red); text-decoration: underline; }

/* ---------- Forms and buttons ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="search"], input[type="password"], input[type="number"], textarea, select {
	width: 100%; padding: .65rem .8rem;
	border: 1px solid var(--cp-red); border-radius: 0;
	background: var(--cp-paper); color: var(--cp-ink);
	font: 400 1rem var(--cp-ui);
}
button, .button, input[type="submit"], .wp-block-button__link {
	padding: .7rem 1.3rem; border: 0; border-radius: 0; cursor: pointer;
	background: var(--cp-red); color: #fff;
	font: 700 .9rem/1.2 var(--cp-ui); text-decoration: none;
}
button:hover, .button:hover, input[type="submit"]:hover, .wp-block-button__link:hover { background: var(--cp-red-dark); color: #fff; }
.search-form { display: flex; max-width: 34rem; }
.search-form .search-field { flex: 1; border-right: 0; }
.no-results .search-form { margin-top: 1rem; }

/* ---------- Comments ---------- */
.comments { margin-top: 3rem; }
.comment-list, .comment-list ol { margin: 0; padding: 0; list-style: none; }
.comment-list ol { margin-left: 1.5rem; padding-left: 1.25rem; border-left: 2px solid var(--cp-rule); }
.comment-body { padding: 1.25rem 0; border-bottom: 1px solid var(--cp-rule); font: 400 .975rem/1.6 var(--cp-ui); }
.comment-author { display: flex; align-items: center; gap: .7rem; font-weight: 700; }
.comment-author img { border-radius: 50%; }
.comment-metadata, .comment-metadata a { color: var(--cp-muted); font-size: .8125rem; text-decoration: none; }
.reply a { font-weight: 700; font-size: .8125rem; color: var(--cp-red); }
.comment-respond { margin-top: 2rem; font-family: var(--cp-ui); }
.comment-reply-title { font: var(--cp-head-weight) 1.6rem/1.2 var(--cp-head); }
.comment-form label { display: block; margin-bottom: .3rem; font-size: .875rem; font-weight: 600; }
.comment-form p { margin-bottom: 1rem; }
.comment-form-cookies-consent { display: flex; gap: .5rem; align-items: center; }
.comment-form-cookies-consent input { width: auto; }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; }

/* ---------- Footer ---------- */
.site-footer { margin-top: 2rem; background: var(--cp-bar); color: var(--cp-paper); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-widgets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2.5rem; padding-block: 3rem 1rem; }
.site-footer .widget-title { border-top-color: var(--cp-paper); }
.site-footer .widget-title::before { background: rgba(255,255,255,.55); }
.site-footer .widget li { border-bottom-color: rgba(255,255,255,.18); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,.18); font: 400 .8125rem/1.5 var(--cp-ui); }
.footer-bottom__in { display: flex; flex-wrap: wrap; justify-content: space-between; gap: .75rem 2rem; padding-block: 1.25rem; }
.footer-bottom p { margin: 0; }
.footer-menu { display: flex; flex-wrap: wrap; gap: 1.25rem; margin: 0; padding: 0; list-style: none; }

/* ---------- WordPress core classes ---------- */
.alignleft { float: left; margin: .3rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .3rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-inline: auto; }
.alignwide, .alignfull { max-width: 100%; }
.wp-caption { max-width: 100%; }
.wp-caption img { width: 100%; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: .75rem; }
.gallery-item { margin: 0; }
.gallery-caption { font-size: .8125rem; }
.bypostauthor > .comment-body .comment-author { color: var(--cp-red); }
.entry-content::after { content: ""; display: table; clear: both; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
	.hero { grid-template-columns: minmax(0, 1fr); gap: 2rem; }
	.rail { padding-left: 0; border-left: 0; }
	.grid--3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.layout--sidebar { grid-template-columns: minmax(0, 1fr); }
	.footer-widgets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 760px) {
	.nav-in { display: block; }
	.nav-toggle {
		display: flex; align-items: center; gap: .7rem; width: 100%;
		padding: .9rem 0; background: transparent; color: var(--cp-paper);
		font: 700 .95rem var(--cp-ui);
	}
	.nav-toggle:hover { background: transparent; }
	.nav-toggle__bars, .nav-toggle__bars::before, .nav-toggle__bars::after {
		display: block; width: 20px; height: 2px; background: currentColor; content: ""; position: relative;
	}
	.nav-toggle__bars::before { position: absolute; top: -6px; }
	.nav-toggle__bars::after { position: absolute; top: 6px; }
	.menu-wrap { display: none; padding-bottom: .75rem; }
	.menu-wrap.is-open { display: block; }
	.menu-wrap .menu { display: block; }
	.menu a { padding: .8rem 0; border-top: 1px solid rgba(255,255,255,.15); }
	.menu a:hover, .menu .current-menu-item > a, .menu .current-cat > a { padding-inline: .6rem; }
	.menu .sub-menu { position: static; display: block; min-width: 0; border-top: 0; padding-left: 1rem; }
	.topbar__social, .topbar .search-field { display: none; }
	.topbar .search-form { display: none; }
	.grid--3 { grid-template-columns: minmax(0, 1fr); }
	.post-navigation .nav-links { grid-template-columns: 1fr; }
	.post-navigation .nav-next { border-left: 0; border-top: 1px solid var(--cp-rule); text-align: left; }
	.footer-widgets { grid-template-columns: minmax(0, 1fr); }
	.alignleft, .alignright { float: none; display: block; margin: 1rem auto; }
}
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.ticker__track { animation: none; }
	.ticker__viewport { overflow-x: auto; }
	.ticker__group[aria-hidden="true"] { display: none; }
}
@media print {
	.topbar, .primary-nav, .ticker, .sidebar, .site-footer, .post-navigation, .comments { display: none; }
}

/* Sticky posts get a red rule */
.card.sticky .card__body, .lead.sticky .lead__body { border-top: 3px solid var(--cp-red); margin-top: .9rem; }
