/**
 * Crestwire — mobile-first newspaper magazine styles
 * Paths use Linux-style separators in theme structure.
 */

:root {
	--cw-accent: #d62828;
	--cw-accent-dark: #b01f1f;
	--cw-ink: #1a1a1a;
	--cw-muted: #6b6b6b;
	--cw-line: #e8e8e8;
	--cw-bg: #f7f7f5;
	--cw-surface: #ffffff;
	--cw-top: #111111;
	--cw-font: "Manrope", system-ui, sans-serif;
	--cw-serif: "Source Serif 4", Georgia, serif;
	--cw-container: 1180px;
	--cw-radius: 2px;
	--cw-shadow: 0 8px 28px rgba(0, 0, 0, 0.08);
}

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	scroll-behavior: smooth;
	-webkit-text-size-adjust: 100%;
}

body {
	margin: 0;
	font-family: var(--cw-font);
	font-size: 15px;
	line-height: 1.65;
	color: var(--cw-ink);
	background: var(--cw-bg);
}

body.nav-open {
	overflow: hidden;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

a {
	color: var(--cw-accent);
	text-decoration: none;
	transition: color 0.2s ease;
}

a:hover,
a:focus-visible {
	color: var(--cw-accent-dark);
}

h1, h2, h3, h4, h5, h6 {
	font-family: var(--cw-serif);
	line-height: 1.25;
	margin: 0 0 0.45em;
	font-weight: 700;
	color: var(--cw-ink);
}

ul, ol {
	margin: 0;
	padding: 0;
	list-style: none;
}

p {
	margin: 0 0 1em;
}

button,
input,
textarea,
select {
	font: inherit;
}

.screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

.skip-link:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	background: var(--cw-accent);
	color: #fff;
	padding: 0.75rem 1rem;
	z-index: 100000;
	top: 0;
	left: 0;
}

.container {
	width: min(100% - 1.5rem, var(--cw-container));
	margin-inline: auto;
}

/* —— Header —— */
.header-top {
	background: var(--cw-top);
	color: #f2f2f2;
	font-size: 12px;
}

.header-top-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.45rem 0;
	flex-wrap: wrap;
}

.header-top a {
	color: #f2f2f2;
}

.follow-label {
	margin-right: 0.5rem;
	opacity: 0.75;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	font-size: 10px;
}

.header-top-social {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
}

.social-menu {
	display: flex;
	gap: 0.55rem;
	align-items: center;
}

.social-menu a {
	display: inline-flex;
	width: 22px;
	height: 22px;
	align-items: center;
	justify-content: center;
	border: 1px solid rgba(255, 255, 255, 0.35);
	border-radius: 50%;
	position: relative;
}

.social-menu a::before {
	content: "";
	width: 8px;
	height: 8px;
	background: currentColor;
	border-radius: 1px;
	opacity: 0.9;
}

.site-header {
	background: var(--cw-surface);
	border-bottom: 1px solid var(--cw-line);
	position: sticky;
	top: 0;
	z-index: 50;
}

.header-main {
	display: grid;
	grid-template-columns: 1fr auto;
	align-items: center;
	gap: 0.75rem;
	padding: 0.85rem 0;
}

.site-branding {
	min-width: 0;
}

.site-title {
	font-family: var(--cw-serif);
	font-size: clamp(1.55rem, 5vw, 2.15rem);
	font-weight: 700;
	margin: 0;
	letter-spacing: -0.02em;
}

.site-title a {
	color: var(--cw-ink);
}

.site-title a:hover {
	color: var(--cw-accent);
}

.site-description {
	margin: 0.15rem 0 0;
	font-size: 12px;
	color: var(--cw-muted);
}

.custom-logo-link img {
	max-height: 52px;
	width: auto;
}

.header-search {
	display: none;
}

.search-form {
	display: flex;
	gap: 0.35rem;
	width: 100%;
}

.search-field {
	flex: 1;
	border: 1px solid var(--cw-line);
	background: #fff;
	padding: 0.55rem 0.7rem;
	border-radius: var(--cw-radius);
	min-width: 0;
}

.search-submit,
.btn {
	appearance: none;
	border: 0;
	cursor: pointer;
	background: var(--cw-ink);
	color: #fff;
	padding: 0.55rem 0.9rem;
	border-radius: var(--cw-radius);
	font-weight: 600;
	font-size: 13px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	text-decoration: none;
}

.btn-accent,
.search-submit {
	background: var(--cw-accent);
	color: #fff;
}

.btn-accent:hover,
.search-submit:hover {
	background: var(--cw-accent-dark);
	color: #fff;
}

.menu-toggle {
	width: 42px;
	height: 42px;
	border: 1px solid var(--cw-line);
	background: #fff;
	display: inline-flex;
	flex-direction: column;
	justify-content: center;
	align-items: center;
	gap: 5px;
	cursor: pointer;
	border-radius: var(--cw-radius);
}

.menu-toggle-bar {
	display: block;
	width: 18px;
	height: 2px;
	background: var(--cw-ink);
}

.primary-navigation {
	border-top: 1px solid var(--cw-line);
	background: #fff;
	max-height: 0;
	overflow: hidden;
	transition: max-height 0.35s ease;
}

.primary-navigation.is-open {
	max-height: 80vh;
	overflow: auto;
}

.primary-menu {
	display: flex;
	flex-direction: column;
	padding: 0.5rem 0 1rem;
}

.primary-menu a {
	display: block;
	padding: 0.7rem 0;
	color: var(--cw-ink);
	font-weight: 600;
	font-size: 14px;
	border-bottom: 1px solid var(--cw-line);
}

.primary-menu a:hover {
	color: var(--cw-accent);
}

.primary-menu .sub-menu {
	padding-left: 0.85rem;
}

.primary-menu .sub-menu a {
	font-weight: 500;
	font-size: 13px;
	color: var(--cw-muted);
}

/* —— Content shell —— */
.site-content {
	padding: 1rem 0 2.5rem;
}

.content-shell {
	display: block;
}

.front-main {
	width: 100%;
}

.home-banner {
	margin-bottom: 1.25rem;
	overflow: hidden;
	border-radius: var(--cw-radius);
	background: #ddd;
}

.home-banner img {
	width: 100%;
	height: clamp(160px, 42vw, 320px);
	object-fit: cover;
	animation: cw-ken 18s ease-in-out infinite alternate;
}

@keyframes cw-ken {
	from { transform: scale(1); }
	to { transform: scale(1.05); }
}

.front-layout {
	display: grid;
	gap: 1.5rem;
}

.module {
	background: var(--cw-surface);
	border: 1px solid var(--cw-line);
	padding: 1rem 0.9rem 1.1rem;
	margin-bottom: 1.15rem;
}

.module-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	border-bottom: 2px solid var(--cw-ink);
	padding-bottom: 0.55rem;
	margin-bottom: 1rem;
}

.module-title {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	margin: 0;
	font-size: 1.15rem;
	font-family: var(--cw-font);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.live-dot {
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--cw-accent);
	box-shadow: 0 0 0 0 rgba(214, 40, 40, 0.55);
	flex-shrink: 0;
}

.live-dot.is-pulsing {
	animation: cw-pulse 1.6s ease-out infinite;
}

@keyframes cw-pulse {
	0% { box-shadow: 0 0 0 0 rgba(214, 40, 40, 0.55); }
	70% { box-shadow: 0 0 0 10px rgba(214, 40, 40, 0); }
	100% { box-shadow: 0 0 0 0 rgba(214, 40, 40, 0); }
}

.see-all {
	font-size: 12px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--cw-muted);
	white-space: nowrap;
}

.see-all:hover {
	color: var(--cw-accent);
}

/* —— Story cards —— */
.story-card {
	display: grid;
	gap: 0.75rem;
}

.story-card + .story-card,
.story-stack .story-card + .story-card {
	margin-top: 1rem;
	padding-top: 1rem;
	border-top: 1px solid var(--cw-line);
}

.story-card--featured {
	margin-bottom: 0.25rem;
}

.story-card--featured .story-title {
	font-size: clamp(1.25rem, 4.2vw, 1.75rem);
}

.story-card--list {
	grid-template-columns: 112px 1fr;
	align-items: start;
}

.story-thumb {
	display: block;
	overflow: hidden;
	border-radius: var(--cw-radius);
	background: #ececec;
}

.story-thumb img,
.story-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.story-card--featured .story-thumb {
	aspect-ratio: 16 / 10;
}

.story-card--list .story-thumb {
	aspect-ratio: 4 / 3;
	height: 84px;
}

.story-card--grid .story-thumb {
	aspect-ratio: 16 / 10;
}

.story-card:hover .story-thumb img {
	transform: scale(1.04);
}

.story-title {
	margin: 0.2rem 0 0.35rem;
	font-size: 1.05rem;
}

.story-title a {
	color: var(--cw-ink);
}

.story-title a:hover {
	color: var(--cw-accent);
}

.story-meta,
.story-date,
.byline {
	font-size: 12px;
	color: var(--cw-muted);
}

.byline .sep {
	margin: 0 0.2rem;
}

.cat-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	margin-bottom: 0.25rem;
}

.cat-links a {
	display: inline-block;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--cw-accent);
}

.story-excerpt {
	margin: 0;
	font-size: 14px;
	color: #444;
}

.card-grid {
	display: grid;
	gap: 1rem;
}

.story-card--grid {
	margin: 0;
	padding: 0;
	border: 0;
}

.story-card--grid + .story-card--grid {
	margin: 0;
	padding: 0;
	border: 0;
}

.date-row {
	display: grid;
	gap: 0.2rem;
	padding: 0.75rem 0;
	border-bottom: 1px solid var(--cw-line);
}

.date-row:last-child {
	border-bottom: 0;
}

.date-row-date {
	font-size: 12px;
	color: var(--cw-muted);
}

.date-row-title {
	margin: 0;
	font-size: 0.98rem;
	font-family: var(--cw-serif);
}

.date-row-title a {
	color: var(--cw-ink);
}

.date-row-title a:hover {
	color: var(--cw-accent);
}

.module-more {
	margin: 1rem 0 0;
	text-align: center;
}

.module-sidebar-visual {
	padding: 0;
	overflow: hidden;
}

.module-sidebar-visual img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

/* —— Inner pages —— */
.page-header {
	margin-bottom: 1.25rem;
}

.page-title {
	font-size: clamp(1.5rem, 4vw, 2rem);
}

.content-with-sidebar {
	display: grid;
	gap: 1.5rem;
}

.entry-hero {
	margin: 0 0 1.25rem;
	overflow: hidden;
	border-radius: var(--cw-radius);
}

.entry-hero img {
	width: 100%;
	aspect-ratio: 16 / 9;
	object-fit: cover;
}

.entry-content {
	font-size: 1.02rem;
}

.entry-content h2,
.entry-content h3 {
	margin-top: 1.4em;
}

.entry-content blockquote {
	margin: 1.25rem 0;
	padding: 0.75rem 0 0.75rem 1rem;
	border-left: 3px solid var(--cw-accent);
	font-family: var(--cw-serif);
	font-size: 1.1rem;
	color: #333;
}

.single-article .entry-meta {
	margin-bottom: 1rem;
}

.widget-area .widget {
	background: var(--cw-surface);
	border: 1px solid var(--cw-line);
	padding: 1rem;
	margin-bottom: 1rem;
}

.widget-title {
	font-family: var(--cw-font);
	font-size: 0.95rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	border-bottom: 2px solid var(--cw-ink);
	padding-bottom: 0.45rem;
	margin-bottom: 0.75rem;
}

.post-navigation {
	display: grid;
	gap: 0.75rem;
	margin: 2rem 0;
	padding-top: 1rem;
	border-top: 1px solid var(--cw-line);
}

.post-navigation .nav-label {
	display: block;
	font-size: 11px;
	text-transform: uppercase;
	color: var(--cw-muted);
	margin-bottom: 0.2rem;
}

.comments-area {
	margin-top: 2rem;
	padding-top: 1rem;
	border-top: 1px solid var(--cw-line);
}

.crestwire-contact {
	display: grid;
	gap: 0.75rem;
	max-width: 560px;
	margin-top: 1rem;
}

.crestwire-contact label {
	display: block;
	font-weight: 600;
	font-size: 13px;
	margin-bottom: 0.25rem;
}

.crestwire-contact input,
.crestwire-contact textarea {
	width: 100%;
	border: 1px solid var(--cw-line);
	padding: 0.65rem 0.75rem;
	border-radius: var(--cw-radius);
	background: #fff;
}

.form-status {
	font-size: 14px;
	color: var(--cw-accent-dark);
}

.error-404 .search-form,
.no-results .search-form {
	max-width: 420px;
	margin: 1rem 0;
}

/* —— Footer —— */
.site-footer {
	background: #111;
	color: #d8d8d8;
	padding: 1.75rem 0 2rem;
	margin-top: 1rem;
}

.site-footer a {
	color: #f0f0f0;
}

.site-footer a:hover {
	color: #fff;
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.1rem;
	margin-bottom: 1rem;
	font-size: 13px;
}

.footer-link-row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.55rem 1rem;
	align-items: center;
	margin: 0 0 1.1rem;
	padding: 0.85rem 0 0;
	border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.footer-link-row a {
	font-size: 13px;
	font-weight: 500;
	white-space: nowrap;
}

.copyright {
	margin: 0;
	font-size: 12px;
	color: #9a9a9a;
}

/* —— Motion —— */
.reveal {
	opacity: 0;
	transform: translateY(14px);
	transition: opacity 0.55s ease, transform 0.55s ease;
}

.reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* —— Tablet+ —— */
@media (min-width: 640px) {
	.header-main {
		grid-template-columns: 1fr minmax(200px, 280px) auto;
	}

	.header-search {
		display: block;
	}

	.story-card--list {
		grid-template-columns: 180px 1fr;
	}

	.story-card--list .story-thumb {
		height: 120px;
	}

	.card-grid {
		grid-template-columns: repeat(2, 1fr);
	}

	.module {
		padding: 1.15rem 1.15rem 1.25rem;
	}
}

@media (min-width: 900px) {
	.menu-toggle {
		display: none;
	}

	.primary-navigation {
		max-height: none;
		overflow: visible;
		border-top: 1px solid var(--cw-line);
		border-bottom: 3px solid var(--cw-ink);
	}

	.primary-menu {
		flex-direction: row;
		flex-wrap: wrap;
		gap: 0;
		padding: 0;
	}

	.primary-menu > .menu-item > a {
		padding: 0.85rem 0.95rem;
		border-bottom: 0;
		font-size: 13px;
		text-transform: uppercase;
		letter-spacing: 0.03em;
	}

	.primary-menu .sub-menu {
		display: none;
		position: absolute;
		background: #fff;
		border: 1px solid var(--cw-line);
		min-width: 180px;
		padding: 0.35rem 0;
		box-shadow: var(--cw-shadow);
		z-index: 40;
	}

	.primary-menu .menu-item-has-children {
		position: relative;
	}

	.primary-menu .menu-item-has-children:hover > .sub-menu,
	.primary-menu .menu-item-has-children:focus-within > .sub-menu {
		display: block;
	}

	.primary-menu .sub-menu a {
		padding: 0.55rem 0.9rem;
		border: 0;
	}

	.front-layout {
		grid-template-columns: minmax(0, 1fr) 300px;
		align-items: start;
		gap: 1.35rem;
	}

	.front-sidebar {
		position: sticky;
		top: 6.5rem;
	}

	.content-with-sidebar {
		grid-template-columns: minmax(0, 1fr) 300px;
		align-items: start;
	}

	.card-grid {
		grid-template-columns: repeat(3, 1fr);
	}

	.home-banner img {
		height: 360px;
	}

	.post-navigation {
		grid-template-columns: 1fr 1fr;
	}
}

@media (min-width: 1100px) {
	.story-card--featured {
		grid-template-columns: 1.15fr 1fr;
		align-items: center;
		gap: 1.25rem;
	}

	.story-card--list {
		grid-template-columns: 220px 1fr;
		gap: 1rem;
	}

	.story-card--list .story-thumb {
		height: 140px;
	}

	.front-layout {
		grid-template-columns: minmax(0, 1fr) 320px;
	}
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.reveal,
	.story-thumb img,
	.home-banner img,
	.live-dot.is-pulsing {
		animation: none !important;
		transition: none !important;
		transform: none !important;
		opacity: 1 !important;
	}
}
