/*
 * Gazette Editorial - Core Stylesheet
 * Minimal, lightweight, zero external CSS dependencies.
 *
 * 1. Tokens & dark mode      7. Category boxes        13. Sidebar & widgets
 * 2. Base                    8. Search modal          14. Archives & pagination
 * 3. Header                  9. Single article        15. Footer
 * 4. Section headers        10. Article typography    16. Utilities (cookie, FAB, progress)
 * 5. Hero                   11. Share, author, nav    17. Advertising
 * 6. Post grid & cards      12. Comments              18. Responsive, motion, print
 */

/* ==========================================================================
   1. Tokens & dark mode
   ========================================================================== */
:root {
	--font-heading: 'Playfair Display', Georgia, 'Times New Roman', serif;
	--font-sans: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;

	--color-bg: #f7f7f5;
	--color-surface: #ffffff;
	--color-ink: #16161a;
	--color-ink-muted: #5c5c66;
	--color-border: #e3e3e8;
	--color-border-subtle: #efeff2;
	--color-accent: #0f766e;
	--color-accent-light: color-mix(in srgb, var(--color-accent) 12%, transparent);
	--color-on-accent: #ffffff;
	--shadow-sm: 0 1px 2px rgba(16, 16, 24, 0.05);
	--shadow-md: 0 8px 24px rgba(16, 16, 24, 0.08);
	--shadow-lg: 0 20px 48px rgba(16, 16, 24, 0.16);

	--container-max: 1240px;
	--container-padding: 1rem;
	--radius-sm: 6px;
	--radius-md: 10px;
	--radius-lg: 14px;
	--transition: 0.2s cubic-bezier(0.16, 1, 0.3, 1);

	color-scheme: light;
}

body.fonts-system {
	--font-heading: Georgia, 'Times New Roman', serif;
	--font-sans: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--color-bg: #101013;
		--color-surface: #18181c;
		--color-ink: #f2f2f4;
		--color-ink-muted: #a3a3ad;
		--color-border: #2a2a31;
		--color-border-subtle: #212127;
		--color-accent: #2dd4bf;
		--color-on-accent: #04201d;
		--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
		--shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--color-bg: #101013;
	--color-surface: #18181c;
	--color-ink: #f2f2f4;
	--color-ink-muted: #a3a3ad;
	--color-border: #2a2a31;
	--color-border-subtle: #212127;
	--color-accent: #2dd4bf;
	--color-on-accent: #04201d;
	--shadow-md: 0 8px 24px rgba(0, 0, 0, 0.35);
	--shadow-lg: 0 20px 48px rgba(0, 0, 0, 0.5);
	color-scheme: dark;
}

/* ==========================================================================
   2. Base
   ========================================================================== */
*, *::before, *::after {
	box-sizing: border-box;
	margin: 0;
	padding: 0;
}

html {
	-webkit-text-size-adjust: 100%;
	scroll-padding-top: 5rem;
}

body {
	font-family: var(--font-sans);
	font-size: 1rem;
	background-color: var(--color-bg);
	color: var(--color-ink);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	overflow-wrap: break-word;
}

a {
	color: inherit;
	text-decoration: none;
	transition: color var(--transition), background-color var(--transition), border-color var(--transition);
}

a:hover {
	color: var(--color-accent);
}

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

svg.icon {
	flex-shrink: 0;
}

button, input, select, textarea {
	font: inherit;
	color: inherit;
}

button {
	cursor: pointer;
}

:focus-visible {
	outline: 2px solid var(--color-accent);
	outline-offset: 2px;
}

[hidden] {
	display: none !important;
}

ul[class], ol[class] {
	list-style: none;
}

.site-container {
	width: 100%;
	max-width: var(--container-max);
	margin-left: auto;
	margin-right: auto;
	padding-left: var(--container-padding);
	padding-right: var(--container-padding);
}

/* Screen reader text */
.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 becomes visible only when focused via keyboard */
.skip-link.screen-reader-text:focus {
	clip: auto;
	clip-path: none;
	height: auto;
	width: auto;
	margin: 0;
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100000;
	padding: 0.75rem 1.25rem;
	background: var(--color-surface);
	color: var(--color-ink);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	font-size: 0.875rem;
	font-weight: 600;
}

/* ==========================================================================
   3. Header
   ========================================================================== */
.site-header {
	background: var(--color-surface);
	border-bottom: 1px solid var(--color-border);
	position: sticky;
	top: 0;
	z-index: 40;
}

.admin-bar .site-header {
	top: 32px;
}

.site-topbar {
	border-bottom: 1px solid var(--color-border-subtle);
	font-size: 0.75rem;
	color: var(--color-ink-muted);
}

.topbar-inner {
	display: flex;
	justify-content: space-between;
	align-items: center;
	min-height: 36px;
	gap: 1rem;
}

.topbar-right {
	display: flex;
	align-items: center;
	gap: 1rem;
}

.gazette-lang-list {
	display: flex;
	list-style: none;
	gap: 0.75rem;
}

.gazette-lang-list li a {
	color: var(--color-ink-muted);
	font-weight: 500;
	text-transform: uppercase;
	font-size: 0.7rem;
	letter-spacing: 0.05em;
}

.gazette-lang-list li.active a,
.gazette-lang-list li a:hover {
	color: var(--color-accent);
	font-weight: 700;
}

/* Social follow icons (top bar, mobile menu, footer) */
.social-follow {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
}

.social-follow-link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	color: var(--color-ink-muted);
}

.social-follow-link:hover {
	color: var(--color-on-accent);
	background: var(--color-accent);
}

.branding-nav-inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 64px;
	gap: 1.25rem;
}

.site-identity {
	min-width: 0;
}

.site-identity .custom-logo {
	max-height: 44px;
	width: auto;
}

.site-title {
	font-family: var(--font-heading);
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -0.02em;
	line-height: 1.1;
}

.site-title a {
	color: var(--color-ink);
}

.site-description {
	font-size: 0.75rem;
	color: var(--color-ink-muted);
	margin-top: 0.1rem;
}

.main-navigation {
	flex: 1;
	display: flex;
	justify-content: center;
}

.main-navigation .nav-menu {
	display: flex;
	list-style: none;
	gap: 0.25rem;
	align-items: center;
	flex-wrap: wrap;
}

.main-navigation .nav-menu a {
	display: block;
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--color-ink);
	padding: 0.45rem 0.7rem;
	border-radius: var(--radius-sm);
}

.main-navigation .nav-menu a:hover,
.main-navigation .nav-menu .current-menu-item > a,
.main-navigation .nav-menu .current-cat > a {
	color: var(--color-accent);
	background: var(--color-accent-light);
}

/* Dropdown sub-menus (desktop) */
.main-navigation .menu-item-has-children {
	position: relative;
}

.main-navigation .sub-menu {
	list-style: none;
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 200px;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	box-shadow: var(--shadow-md);
	padding: 0.4rem;
	opacity: 0;
	visibility: hidden;
	transform: translateY(4px);
	transition: opacity var(--transition), transform var(--transition), visibility var(--transition);
	z-index: 50;
}

.main-navigation .menu-item-has-children:hover > .sub-menu,
.main-navigation .menu-item-has-children:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.mobile-nav-extras {
	display: none;
}

.header-actions {
	display: flex;
	align-items: center;
	gap: 0.4rem;
}

.action-btn {
	background: none;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	height: 38px;
	min-width: 38px;
	padding: 0 0.85rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	font-size: 0.8125rem;
	font-weight: 500;
	color: var(--color-ink);
	transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.action-btn:hover,
.action-btn[aria-expanded="true"] {
	border-color: var(--color-accent);
	color: var(--color-accent);
}

.theme-toggle {
	padding: 0;
}

.theme-icon-light {
	display: none;
}

:root[data-theme="dark"] .theme-icon-light {
	display: inline-flex;
}

:root[data-theme="dark"] .theme-icon-dark {
	display: none;
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) .theme-icon-light {
		display: inline-flex;
	}
	:root:not([data-theme="light"]) .theme-icon-dark {
		display: none;
	}
}

/* Header share popover */
.header-share {
	position: relative;
}

.header-share-panel {
	position: absolute;
	right: 0;
	top: calc(100% + 0.6rem);
	width: 320px;
	max-width: calc(100vw - 2rem);
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	padding: 1rem;
	z-index: 60;
}

.header-share-title {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-ink-muted);
	margin-bottom: 0.75rem;
}

.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--color-border);
	width: 40px;
	height: 40px;
	border-radius: var(--radius-sm);
	color: var(--color-ink);
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

/* Hamburger icon drawn from the .nav-toggle-icon span; turns into an X when open */
.nav-toggle-icon,
.nav-toggle-icon::before,
.nav-toggle-icon::after {
	display: block;
	width: 18px;
	height: 2px;
	background: currentColor;
	border-radius: 1px;
	transition: transform var(--transition), background-color var(--transition);
}

.nav-toggle-icon {
	position: relative;
}

.nav-toggle-icon::before,
.nav-toggle-icon::after {
	content: '';
	position: absolute;
	left: 0;
}

.nav-toggle-icon::before {
	top: -6px;
}

.nav-toggle-icon::after {
	top: 6px;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon {
	background: transparent;
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::before {
	transform: translateY(6px) rotate(45deg);
}

.nav-toggle[aria-expanded="true"] .nav-toggle-icon::after {
	transform: translateY(-6px) rotate(-45deg);
}

/* Breadcrumbs */
.breadcrumbs {
	padding: 1rem 0 0;
	font-size: 0.8125rem;
	color: var(--color-ink-muted);
}

.breadcrumbs ol {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
}

.breadcrumbs li + li::before {
	content: '/';
	margin-right: 0.25rem;
	opacity: 0.5;
}

.breadcrumbs li:last-child span {
	color: var(--color-ink);
	display: inline-block;
	max-width: 40ch;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	vertical-align: bottom;
}

/* ==========================================================================
   4. Section headers
   ========================================================================== */
.section-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1.25rem;
	padding-bottom: 0.75rem;
	border-bottom: 2px solid var(--color-ink);
}

.section-title {
	font-family: var(--font-heading);
	font-size: 1.6rem;
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.2;
	display: flex;
	align-items: center;
	gap: 0.6rem;
}

.section-title::before {
	content: '';
	width: 10px;
	height: 10px;
	border-radius: 50%;
	background: var(--color-accent);
	flex-shrink: 0;
}

.section-link {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--color-accent);
	white-space: nowrap;
}

/* ==========================================================================
   5. Hero (featured stories)
   ========================================================================== */
.hero-section {
	padding-top: 2rem;
	padding-bottom: 1rem;
}

.hero-grid {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
	gap: 2rem;
}

.lead-card {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.lead-image-wrap {
	display: block;
	border-radius: var(--radius-lg);
	overflow: hidden;
	aspect-ratio: 16 / 9;
	background: var(--color-border-subtle);
}

.lead-image-wrap img,
.lead-image-wrap .card-image-fallback {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.lead-card:hover .lead-image-wrap img {
	transform: scale(1.025);
}

.lead-title {
	font-family: var(--font-heading);
	font-size: clamp(1.6rem, 1.1rem + 1.8vw, 2.35rem);
	font-weight: 700;
	line-height: 1.18;
	letter-spacing: -0.02em;
}

.lead-excerpt {
	font-size: 1rem;
	color: var(--color-ink-muted);
	line-height: 1.6;
}

.hero-side {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.hero-side-title {
	font-size: 0.75rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: var(--color-ink-muted);
	padding-bottom: 0.5rem;
	border-bottom: 1px solid var(--color-border);
}

.hero-side .compact-card {
	padding-bottom: 1rem;
	border-bottom: 1px solid var(--color-border-subtle);
}

.hero-side .compact-card:last-child {
	border-bottom: 0;
}

/* ==========================================================================
   6. Post grid, category tabs & cards
   ========================================================================== */
.post-feed-section {
	padding-top: 2.5rem;
	padding-bottom: 1rem;
}

.category-tabs {
	margin: 0 calc(var(--container-padding) * -1) 1.5rem;
	padding: 0 var(--container-padding);
	overflow-x: auto;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.category-tabs::-webkit-scrollbar {
	display: none;
}

.category-tabs ul {
	list-style: none;
	display: flex;
	gap: 0.5rem;
	width: max-content;
}

.category-tab {
	display: inline-flex;
	align-items: center;
	min-height: 38px;
	padding: 0 1rem;
	border-radius: 999px;
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	font-size: 0.875rem;
	font-weight: 500;
	white-space: nowrap;
	color: var(--color-ink);
}

.category-tab:hover {
	border-color: var(--color-accent);
}

.category-tab.is-active {
	background: var(--color-ink);
	border-color: var(--color-ink);
	color: var(--color-bg);
}

.post-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 290px), 1fr));
	gap: 1.5rem;
	transition: opacity var(--transition);
}

.post-feed[aria-busy="true"] .post-grid {
	opacity: 0.45;
}

/* Ads inside a grid span the full row */
.post-grid > .gazette-ad-wrapper {
	grid-column: 1 / -1;
	margin: 0;
	padding: 0;
}

/* Article card: vertical box */
.gazette-card {
	display: flex;
	flex-direction: column;
	background: var(--color-surface);
	border: 1px solid var(--color-border-subtle);
	border-radius: var(--radius-lg);
	overflow: hidden;
	box-shadow: var(--shadow-sm);
	transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
	animation: card-in 0.35s ease both;
}

@keyframes card-in {
	from { opacity: 0; transform: translateY(8px); }
	to { opacity: 1; transform: none; }
}

.gazette-card:hover {
	transform: translateY(-3px);
	border-color: var(--color-border);
	box-shadow: var(--shadow-md);
}

.card-media {
	aspect-ratio: 16 / 10;
	background: var(--color-border-subtle);
	overflow: hidden;
}

.card-thumb-link {
	display: block;
	height: 100%;
}

.card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.gazette-card:hover .card-image {
	transform: scale(1.04);
}

.card-image-fallback {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	min-height: 100%;
	background: linear-gradient(135deg, var(--color-accent-light), var(--color-border-subtle));
	font-family: var(--font-heading);
	font-size: 1.25rem;
	color: var(--color-ink-muted);
}

.card-body {
	padding: 1rem 1.15rem 1.15rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	flex-grow: 1;
}

.card-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.75rem;
	color: var(--color-ink-muted);
}

.card-category-badge {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 0.75rem;
	letter-spacing: 0.06em;
	color: var(--color-accent);
}

.meta-dot {
	opacity: 0.5;
}

.card-title {
	font-family: var(--font-heading);
	font-size: 1.2rem;
	line-height: 1.3;
	font-weight: 700;
	letter-spacing: -0.01em;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-title a {
	color: var(--color-ink);
}

.card-title a:hover {
	color: var(--color-accent);
}

/* Whole card clickable via the title link, without nesting links */
.gazette-card {
	position: relative;
}

.card-title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.card-category-badge {
	position: relative;
	z-index: 2;
}

.card-excerpt {
	font-size: 0.9rem;
	line-height: 1.55;
	color: var(--color-ink-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card-footer {
	margin-top: auto;
	padding-top: 0.6rem;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.75rem;
	color: var(--color-ink-muted);
}

.card-author {
	font-weight: 600;
	color: var(--color-ink);
}

/* Compact card (hero list, category boxes, sidebar) */
.compact-card {
	display: grid;
	grid-template-columns: 96px minmax(0, 1fr);
	gap: 0.85rem;
	align-items: start;
}

.compact-thumb {
	display: block;
	aspect-ratio: 4 / 3;
	border-radius: var(--radius-sm);
	overflow: hidden;
	background: var(--color-border-subtle);
}

.compact-thumb img,
.compact-thumb .card-image-fallback {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.compact-body {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
}

.compact-title {
	font-family: var(--font-heading);
	font-size: 1rem;
	font-weight: 700;
	line-height: 1.3;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.compact-date {
	font-size: 0.75rem;
	color: var(--color-ink-muted);
}

/* Whole compact row is tappable via the title link (category badge stays on top) */
.compact-card {
	position: relative;
}

.compact-title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

/* Load more */
.feed-actions {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.5rem;
	margin-top: 2rem;
}

.load-more-btn {
	min-height: 46px;
	padding: 0 2rem;
	border-radius: 999px;
	border: 2px solid var(--color-ink);
	background: transparent;
	font-weight: 600;
	font-size: 0.9rem;
	color: var(--color-ink);
	transition: background-color var(--transition), color var(--transition);
}

.load-more-btn:hover:not(:disabled) {
	background: var(--color-ink);
	color: var(--color-bg);
}

.load-more-btn:disabled {
	opacity: 0.6;
	cursor: progress;
}

.feed-status {
	font-size: 0.875rem;
	color: var(--color-ink-muted);
	min-height: 1.4em;
	text-align: center;
}

/* ==========================================================================
   6b. Category sliders (one horizontal carousel per category)
   ========================================================================== */
.category-sliders-section {
	padding-top: 2.5rem;
	padding-bottom: 1rem;
}

.category-slider {
	--slides: var(--per-view, 4);
	--slide-gap: 1.25rem;
	padding: 1.25rem 0 1.75rem;
}

.category-slider + .category-slider {
	border-top: 1px solid var(--color-border);
}

.slider-header {
	display: flex;
	justify-content: space-between;
	align-items: flex-end;
	gap: 1rem;
	margin-bottom: 1rem;
}

.slider-title-area {
	min-width: 0;
}

.slider-title {
	font-family: var(--font-heading);
	font-size: 1.45rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: -0.01em;
}

.slider-desc {
	font-size: 0.8125rem;
	color: var(--color-ink-muted);
	margin-top: 0.2rem;
}

.slider-controls {
	display: flex;
	align-items: center;
	gap: 0.4rem;
	flex-shrink: 0;
}

.slider-view-all {
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-accent);
	padding: 0.4rem 0.7rem;
	border-radius: 999px;
	margin-right: 0.25rem;
}

.slider-view-all:hover {
	background: var(--color-accent-light);
}

.slider-arrow {
	width: 38px;
	height: 38px;
	border-radius: 50%;
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	color: var(--color-ink);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	transition: border-color var(--transition), color var(--transition), opacity var(--transition);
}

.slider-arrow:hover:not(:disabled) {
	border-color: var(--color-accent);
	color: var(--color-accent);
}

.slider-arrow:disabled {
	opacity: 0.35;
	cursor: default;
}

.slider-track {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: calc((100% - (var(--slides) - 1) * var(--slide-gap)) / var(--slides));
	gap: var(--slide-gap);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	/* Room for the card hover lift and shadow, which overflow would otherwise clip.
	   scroll-padding matches the side padding so cards snap flush, without cutting their edge. */
	padding: 4px 2px 10px;
	margin: -4px -2px -10px;
	scroll-padding-inline: 2px;
}

.slider-track::-webkit-scrollbar {
	display: none;
}

.slider-track > * {
	scroll-snap-align: start;
	animation: none;
}

/* Browse by Category as a slider of boxes */
.category-boxes-section.is-slider {
	--slides: var(--per-view, 3);
	--slide-gap: 1.5rem;
}

.category-boxes-section .section-header .slider-controls {
	align-self: center;
}

/* Latest Stories (hero side list): a plain vertical list on desktop... */
.hero-side .hero-side-track {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	overflow: visible;
	padding: 0;
	margin: 0;
}

.hero-side .slider-dots {
	display: none;
}

.slider-dots {
	display: flex;
	justify-content: center;
	gap: 0.4rem;
	margin-top: 1rem;
	min-height: 8px;
}

.slider-dot {
	position: relative;
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--color-border);
	transition: width var(--transition), background-color var(--transition);
}

/* Invisible 24px hit area around each dot */
.slider-dot::before {
	content: '';
	position: absolute;
	inset: -8px -4px;
}

.slider-dot.is-active {
	width: 22px;
	background: var(--color-accent);
}

@media (max-width: 1024px) {
	.category-slider,
	.category-boxes-section.is-slider {
		--slides: min(var(--per-view, 4), 2);
	}
}

/* ...and a one-box slider on phones and tablets (follows page scrolling or autoplays) */
@media (max-width: 900px) {
	.hero-side-slider {
		--slides: 1;
		--slide-gap: 0.75rem;
	}
	.hero-side-slider .hero-side-track {
		display: grid;
		overflow-x: auto;
		padding: 4px 2px 10px;
		margin: -4px -2px -10px;
	}
	.hero-side-slider .hero-side-track .compact-card {
		grid-template-columns: 140px minmax(0, 1fr);
		gap: 0.9rem;
		align-items: center;
		padding: 0.75rem;
		border: 1px solid var(--color-border-subtle);
		border-radius: var(--radius-md);
		background: var(--color-surface);
		box-shadow: var(--shadow-sm);
	}
	.hero-side-slider .hero-side-track .compact-card:last-child {
		border-bottom: 1px solid var(--color-border-subtle);
		padding-bottom: 0.75rem;
	}
	.hero-side-slider .compact-thumb {
		aspect-ratio: 16 / 10;
	}
	.hero-side-slider .compact-title {
		font-size: 1.05rem;
		-webkit-line-clamp: 3;
	}
}

@media (max-width: 600px) {
	/* One card with the next one peeking in, which invites a swipe */
	.category-slider,
	.category-boxes-section.is-slider {
		--slides: 1.15;
		--slide-gap: 0.9rem;
	}
	.slider-title {
		font-size: 1.25rem;
	}
	.slider-arrow {
		display: none;
	}
}

/* ==========================================================================
   7. Category boxes (vertical scrolling lists)
   ========================================================================== */
.category-boxes-section {
	padding-top: 2.5rem;
	padding-bottom: 1rem;
}

.category-boxes-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
	gap: 1.5rem;
}

.category-box {
	display: flex;
	flex-direction: column;
	background: var(--color-surface);
	border: 1px solid var(--color-border-subtle);
	border-top: 3px solid var(--color-accent);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
}

.category-box-header {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 1rem 1.15rem 0.25rem;
}

.category-box-title {
	font-family: var(--font-heading);
	font-size: 1.3rem;
	font-weight: 700;
	line-height: 1.2;
}

.category-box-count {
	font-size: 0.75rem;
	color: var(--color-ink-muted);
	white-space: nowrap;
}

.category-box-desc {
	padding: 0 1.15rem;
	font-size: 0.8125rem;
	color: var(--color-ink-muted);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.category-box-list {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
	padding: 1rem 1.15rem;
	max-height: 25rem;
	overflow-y: auto;
	scroll-snap-type: y proximity;
	scrollbar-width: thin;
	scrollbar-color: var(--color-border) transparent;
	/* Fade hints that the list scrolls */
	-webkit-mask-image: linear-gradient(to bottom, #000 85%, transparent);
	mask-image: linear-gradient(to bottom, #000 85%, transparent);
}

.category-box-list.is-scrolled-end {
	-webkit-mask-image: none;
	mask-image: none;
}

.category-box-list::-webkit-scrollbar {
	width: 5px;
}

.category-box-list::-webkit-scrollbar-thumb {
	background-color: var(--color-border);
	border-radius: 4px;
}

.category-box-list .compact-card {
	scroll-snap-align: start;
	padding-bottom: 0.9rem;
	border-bottom: 1px solid var(--color-border-subtle);
}

.category-box-list .compact-card:last-child {
	border-bottom: 0;
	padding-bottom: 0;
}

.category-box-more {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	margin-top: auto;
	padding: 0.85rem 1rem;
	border-top: 1px solid var(--color-border-subtle);
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-accent);
}

.category-box-more:hover {
	background: var(--color-accent-light);
}

/* ==========================================================================
   8. Search modal
   ========================================================================== */
.search-modal-overlay {
	position: fixed;
	inset: 0;
	z-index: 100;
	display: none;
	align-items: flex-start;
	justify-content: center;
	padding: 10vh 1rem 0;
}

.search-modal-overlay[hidden] {
	display: none !important;
}

.search-modal-overlay.is-open,
.search-modal-overlay:not([hidden]) {
	display: flex;
}

.search-modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.search-modal-container {
	position: relative;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
	width: 100%;
	max-width: 640px;
	padding: 1.75rem;
	box-shadow: var(--shadow-lg);
}

.search-modal-header {
	display: flex;
	justify-content: space-between;
	align-items: center;
	margin-bottom: 1.25rem;
}

.search-modal-title {
	font-family: var(--font-heading);
	font-size: 1.5rem;
}

.search-modal-close {
	background: none;
	border: none;
	color: var(--color-ink-muted);
	padding: 0.25rem;
}

.search-input-wrap {
	display: flex;
	align-items: center;
	border: 2px solid var(--color-ink);
	border-radius: var(--radius-md);
	padding: 0.4rem 0.4rem 0.4rem 0.75rem;
	gap: 0.5rem;
}

.search-input {
	flex-grow: 1;
	min-width: 0;
	border: none;
	outline: none;
	font-size: 1.05rem;
	background: transparent;
	color: var(--color-ink);
}

.search-submit-btn {
	background: var(--color-ink);
	color: var(--color-bg);
	border: none;
	padding: 0.55rem 1rem;
	border-radius: var(--radius-sm);
	font-size: 0.875rem;
	font-weight: 600;
}

/* Live search suggestions */
.live-search {
	margin-top: 0.75rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	overflow: hidden;
}

.live-search-results {
	max-height: min(55vh, 26rem);
	overflow-y: auto;
	overscroll-behavior: contain;
}

.live-search-option a {
	display: grid;
	grid-template-columns: 64px minmax(0, 1fr);
	gap: 0.75rem;
	align-items: center;
	padding: 0.6rem 0.75rem;
	color: var(--color-ink);
}

.live-search-option + .live-search-option {
	border-top: 1px solid var(--color-border-subtle);
}

.live-search-option.is-active a,
.live-search-option a:hover {
	background: var(--color-accent-light);
}

.live-search-thumb {
	width: 64px;
	height: 48px;
	border-radius: var(--radius-sm);
	object-fit: cover;
	background: var(--color-border-subtle);
}

.live-search-text {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
	min-width: 0;
}

.live-search-title {
	font-family: var(--font-heading);
	font-weight: 700;
	font-size: 0.975rem;
	line-height: 1.3;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.live-search-title mark {
	background: var(--color-accent-light);
	color: inherit;
	border-radius: 2px;
	padding: 0 1px;
}

.live-search-meta {
	font-size: 0.75rem;
	color: var(--color-ink-muted);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.live-search-meta .card-category-badge {
	margin-right: 0.35rem;
}

.live-search-empty {
	padding: 1rem;
	font-size: 0.875rem;
	color: var(--color-ink-muted);
	text-align: center;
}

.live-search-all {
	display: block;
	padding: 0.7rem;
	text-align: center;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-accent);
	border-top: 1px solid var(--color-border);
	background: var(--color-bg);
}

.live-search-all:hover {
	background: var(--color-accent-light);
}

.search-modal-container.has-live-results .search-quick-tags {
	display: none;
}

.search-quick-tags {
	margin-top: 1.25rem;
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex-wrap: wrap;
	font-size: 0.8125rem;
}

.quick-tags-label {
	color: var(--color-ink-muted);
}

.quick-tags-list {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.quick-tag-pill {
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	padding: 0.3rem 0.7rem;
	border-radius: 999px;
}

/* Inline search form (sidebar, results, 404) */
.search-form {
	display: flex;
	align-items: center;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: var(--color-bg);
	padding: 0.25rem 0.25rem 0.25rem 1rem;
	max-width: 520px;
}

.search-form:focus-within {
	border-color: var(--color-accent);
}

.search-field {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	outline: none;
	padding: 0.45rem 0;
	font-size: 0.9375rem;
}

.search-form-submit {
	width: 36px;
	height: 36px;
	border: 0;
	border-radius: 50%;
	background: var(--color-ink);
	color: var(--color-bg);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

/* ==========================================================================
   9. Single article
   ========================================================================== */
.single-post-main {
	padding-bottom: 3rem;
}

.single-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 300px;
	gap: 3rem;
	padding-top: 1.5rem;
	align-items: start;
}

.single-article {
	max-width: 760px;
}

.entry-meta-top {
	margin-bottom: 0.75rem;
}

.entry-title {
	font-family: var(--font-heading);
	font-size: clamp(1.9rem, 1.3rem + 2.4vw, 2.9rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
	margin-bottom: 1rem;
}

.entry-subheading {
	font-size: 1.2rem;
	line-height: 1.55;
	color: var(--color-ink-muted);
	margin-bottom: 1.5rem;
}

.entry-byline {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	border-top: 1px solid var(--color-border);
	border-bottom: 1px solid var(--color-border);
	padding: 0.9rem 0;
	margin-bottom: 1.75rem;
}

.byline-avatar img {
	border-radius: 50%;
}

.byline-info {
	display: flex;
	flex-direction: column;
	gap: 0.1rem;
}

.byline-name {
	font-weight: 600;
	font-size: 0.9375rem;
}

.byline-name a {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
}

.byline-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.8125rem;
	color: var(--color-ink-muted);
}

.entry-featured-image {
	border-radius: var(--radius-lg);
	overflow: hidden;
	margin-bottom: 2rem;
}

.entry-featured-image img {
	width: 100%;
}

.entry-featured-image figcaption {
	font-size: 0.8125rem;
	color: var(--color-ink-muted);
	padding-top: 0.5rem;
}

/* Table of contents */
.gazette-toc {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-left: 4px solid var(--color-accent);
	border-radius: var(--radius-md);
	padding: 1rem 1.25rem;
	margin-bottom: 2rem;
	font-family: var(--font-sans);
}

.gazette-toc-title {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	font-weight: 700;
	font-size: 0.9375rem;
	cursor: pointer;
	list-style: none;
}

.gazette-toc-title::-webkit-details-marker {
	display: none;
}

.gazette-toc-title::after {
	content: '+';
	margin-left: auto;
	font-weight: 400;
	font-size: 1.25rem;
	line-height: 1;
	color: var(--color-ink-muted);
}

.gazette-toc[open] .gazette-toc-title::after {
	content: '−';
}

.typography-body .gazette-toc-list {
	list-style: none;
	counter-reset: toc;
	margin: 0.75rem 0 0;
	padding: 0;
	font-size: 0.9375rem;
	line-height: 1.5;
}

.typography-body .gazette-toc-list li {
	margin: 0;
	padding: 0.25rem 0;
}

.gazette-toc-list .toc-level-2 {
	counter-increment: toc;
}

.gazette-toc-list .toc-level-2::before {
	content: counter(toc) '.';
	display: inline-block;
	min-width: 1.6em;
	color: var(--color-accent);
	font-weight: 600;
}

.gazette-toc-list .toc-level-3 {
	padding-left: 1.6em;
	font-size: 0.875rem;
}

.typography-body .gazette-toc-list a {
	display: inline-block;
	padding: 0.15rem 0;
	color: var(--color-ink);
	text-decoration: none;
}

.typography-body .gazette-toc-list a:hover {
	color: var(--color-accent);
}

/* ==========================================================================
   10. Article typography
   ========================================================================== */
.typography-body {
	font-size: 1.125rem;
	line-height: 1.8;
	color: var(--color-ink);
}

.typography-body > * + * {
	margin-top: 1.4rem;
}

.typography-body h2,
.typography-body h3,
.typography-body h4 {
	font-family: var(--font-heading);
	font-weight: 700;
	line-height: 1.25;
	letter-spacing: -0.01em;
	margin-top: 2.4rem;
	margin-bottom: -0.4rem;
}

.typography-body h2 {
	font-size: 1.75rem;
}

.typography-body h3 {
	font-size: 1.35rem;
}

.typography-body h4 {
	font-size: 1.15rem;
}

.typography-body a {
	color: var(--color-accent);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.typography-body ul,
.typography-body ol {
	padding-left: 1.4rem;
}

/* Restore markers that the ul[class] reset removes from block-editor lists */
.typography-body ul {
	list-style: disc;
}

.typography-body ol {
	list-style: decimal;
}

.typography-body li + li {
	margin-top: 0.45rem;
}

.typography-body li::marker {
	color: var(--color-accent);
}

.typography-body blockquote {
	border-left: 4px solid var(--color-accent);
	padding: 0.25rem 0 0.25rem 1.25rem;
	font-family: var(--font-heading);
	font-size: 1.35rem;
	font-style: italic;
	line-height: 1.5;
	color: var(--color-ink);
}

.typography-body blockquote cite {
	display: block;
	margin-top: 0.5rem;
	font-family: var(--font-sans);
	font-size: 0.875rem;
	font-style: normal;
	color: var(--color-ink-muted);
}

.typography-body img {
	border-radius: var(--radius-md);
}

.typography-body figcaption {
	font-size: 0.8125rem;
	color: var(--color-ink-muted);
	margin-top: 0.5rem;
	text-align: center;
}

.typography-body code {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.875em;
	background: var(--color-border-subtle);
	padding: 0.1em 0.35em;
	border-radius: 4px;
}

.typography-body pre {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	padding: 1rem 1.25rem;
	overflow-x: auto;
	font-size: 0.9rem;
	line-height: 1.6;
}

.typography-body pre code {
	background: none;
	padding: 0;
}

.typography-body table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.95rem;
	display: block;
	overflow-x: auto;
}

.typography-body th,
.typography-body td {
	border: 1px solid var(--color-border);
	padding: 0.6rem 0.8rem;
	text-align: left;
}

.typography-body th {
	background: var(--color-border-subtle);
}

.typography-body hr {
	border: 0;
	border-top: 1px solid var(--color-border);
	margin: 2.5rem 0;
}

/* WordPress core alignment & caption classes used inside post content */
.entry-content .alignleft {
	float: left;
	margin: 0.35rem 1.5rem 1rem 0;
}

.entry-content .alignright {
	float: right;
	margin: 0.35rem 0 1rem 1.5rem;
}

.entry-content .aligncenter {
	display: block;
	margin-left: auto;
	margin-right: auto;
}

.entry-content .wp-caption {
	max-width: 100%;
}

.entry-content .wp-caption-text,
.entry-content .gallery-caption {
	font-size: 0.8125rem;
	color: var(--color-ink-muted);
	margin-top: 0.5rem;
}

.entry-content::after {
	content: '';
	display: table;
	clear: both;
}

.page-links {
	font-size: 0.9rem;
	font-weight: 600;
}

/* ==========================================================================
   11. Share buttons, tags, author box, post navigation, related
   ========================================================================== */
.gazette-social-share {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex-wrap: wrap;
}

.share-panel {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

.share-btn {
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: 999px;
	min-height: 36px;
	padding: 0 0.85rem;
	font-size: 0.8125rem;
	font-weight: 500;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	color: var(--color-ink);
	transition: border-color var(--transition), color var(--transition), background-color var(--transition);
}

.share-panel .share-btn {
	border-radius: var(--radius-sm);
	justify-content: flex-start;
}

.share-btn:hover {
	border-color: var(--color-ink);
	color: var(--color-ink);
}

.share-btn.share-whatsapp:hover { color: #fff; background: #25d366; border-color: #25d366; }
.share-btn.share-facebook:hover { color: #fff; background: #1877f2; border-color: #1877f2; }
.share-btn.share-x:hover { color: #fff; background: #000; border-color: #000; }
.share-btn.share-linkedin:hover { color: #fff; background: #0a66c2; border-color: #0a66c2; }
.share-btn.share-telegram:hover { color: #fff; background: #229ed9; border-color: #229ed9; }
.share-btn.share-pinterest:hover { color: #fff; background: #e60023; border-color: #e60023; }

.entry-footer {
	margin-top: 2.5rem;
	display: flex;
	flex-direction: column;
	gap: 1.25rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--color-border);
}

.entry-tags {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.4rem;
	font-size: 0.8125rem;
}

.tags-label,
.share-title {
	font-weight: 600;
	font-size: 0.875rem;
	margin-right: 0.25rem;
}

.entry-tags a {
	padding: 0.25rem 0.7rem;
	border-radius: 999px;
	background: var(--color-border-subtle);
	color: var(--color-ink);
}

.entry-tags a:hover {
	background: var(--color-accent);
	color: var(--color-on-accent);
}

.entry-share-bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.6rem;
}

.author-box {
	display: flex;
	gap: 1.25rem;
	margin-top: 2.5rem;
	padding: 1.5rem;
	background: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
}

.author-box-avatar img {
	border-radius: 50%;
}

.author-box-label {
	font-size: 0.75rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--color-ink-muted);
}

.author-box-name {
	font-family: var(--font-heading);
	font-size: 1.25rem;
	margin: 0.1rem 0 0.4rem;
}

.author-box-bio {
	font-size: 0.9375rem;
	color: var(--color-ink-muted);
	line-height: 1.6;
}

.post-navigation {
	margin-top: 2.5rem;
}

.post-navigation .nav-links {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}

.post-navigation a {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	height: 100%;
	padding: 1rem 1.15rem;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-md);
	background: var(--color-surface);
}

.post-navigation a:hover {
	border-color: var(--color-accent);
}

.post-navigation .nav-next {
	text-align: right;
	grid-column: 2;
}

.post-navigation .nav-subtitle {
	font-size: 0.75rem;
	color: var(--color-ink-muted);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.post-navigation .nav-title {
	font-family: var(--font-heading);
	font-weight: 700;
	line-height: 1.3;
	color: var(--color-ink);
}

.related-posts {
	margin-top: 3.5rem;
}

/* ==========================================================================
   12. Comments
   ========================================================================== */
#comments,
.comment-reply-title {
	font-family: var(--font-heading);
	font-size: 1.5rem;
	margin-top: 3rem;
	margin-bottom: 1.25rem;
}

.commentlist,
.commentlist .children {
	list-style: none;
}

.commentlist .children {
	margin-left: 1.5rem;
	padding-left: 1rem;
	border-left: 2px solid var(--color-border-subtle);
}

.commentlist .comment-body {
	padding: 1.1rem 0;
	border-bottom: 1px solid var(--color-border-subtle);
	font-size: 0.9375rem;
}

.comment-author {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	font-weight: 600;
}

.comment-author img {
	border-radius: 50%;
}

.comment-author .says {
	display: none;
}

.comment-meta {
	font-size: 0.75rem;
	color: var(--color-ink-muted);
	margin: 0.2rem 0 0.5rem;
}

.comment-body p + p {
	margin-top: 0.75rem;
}

.reply a {
	display: inline-flex;
	align-items: center;
	min-height: 32px;
	font-size: 0.8125rem;
	font-weight: 600;
	color: var(--color-accent);
}

.comment-meta a {
	display: inline-flex;
	align-items: center;
	min-height: 24px;
}

.comment-form-cookies-consent input[type="checkbox"] {
	width: 20px;
	height: 20px;
	flex-shrink: 0;
	margin-top: 0.1rem;
	accent-color: var(--color-accent);
}

.comment-form {
	display: grid;
	gap: 1rem;
}

.comment-form label {
	display: block;
	font-size: 0.875rem;
	font-weight: 600;
	margin-bottom: 0.35rem;
}

.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	background: var(--color-surface);
	padding: 0.7rem 0.85rem;
	font-size: 0.9375rem;
}

.comment-form-cookies-consent {
	display: flex;
	gap: 0.5rem;
	align-items: flex-start;
	font-size: 0.8125rem;
}

.comment-form-cookies-consent label {
	font-weight: 400;
}

.comment-notes,
.logged-in-as {
	font-size: 0.8125rem;
	color: var(--color-ink-muted);
}

.form-submit .submit {
	background: var(--color-ink);
	color: var(--color-bg);
	border: 0;
	border-radius: 999px;
	padding: 0.75rem 1.75rem;
	font-weight: 600;
}

/* ==========================================================================
   13. Sidebar & widgets
   ========================================================================== */
.site-sidebar {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	height: 100%;
}

.widget {
	background: var(--color-surface);
	border: 1px solid var(--color-border-subtle);
	border-radius: var(--radius-lg);
	padding: 1.15rem;
	font-size: 0.9375rem;
}

.widget-title {
	font-family: var(--font-heading);
	font-size: 1.1rem;
	font-weight: 700;
	margin-bottom: 0.9rem;
	padding-bottom: 0.6rem;
	border-bottom: 1px solid var(--color-border);
}

.widget ul {
	list-style: none;
}

.widget li {
	padding: 0.45rem 0;
	border-bottom: 1px solid var(--color-border-subtle);
}

.widget li:last-child {
	border-bottom: 0;
}

.widget_categories li {
	display: flex;
	justify-content: space-between;
	color: var(--color-ink-muted);
}

.widget_categories li a {
	color: var(--color-ink);
}

.widget-recent-compact {
	display: flex;
	flex-direction: column;
	gap: 0.9rem;
}

.widget-recent-compact .widget-title {
	margin-bottom: 0;
}

.widget-recent-compact .compact-card {
	grid-template-columns: 72px minmax(0, 1fr);
}

.widget-recent-compact .compact-title {
	font-size: 0.9375rem;
}

.sidebar-sticky {
	position: sticky;
	top: 6rem;
}

.sidebar-sticky:empty {
	display: none;
}

/* ==========================================================================
   14. Archives, pages & pagination
   ========================================================================== */
.archive-main,
.search-main,
.static-page-main,
.error-404-main {
	padding-bottom: 3rem;
}

.page-header {
	padding: 1.5rem 0 1.75rem;
}

.page-title {
	font-family: var(--font-heading);
	font-size: clamp(1.8rem, 1.3rem + 2vw, 2.6rem);
	font-weight: 700;
	line-height: 1.15;
	letter-spacing: -0.02em;
}

.archive-description,
.search-count {
	margin-top: 0.5rem;
	color: var(--color-ink-muted);
	max-width: 65ch;
}

.search-again-form {
	margin-top: 1.25rem;
}

.static-page-article {
	max-width: 760px;
	margin: 0 auto;
	padding-top: 1.5rem;
}

.static-page-article .entry-header {
	margin-bottom: 1.5rem;
}

/* Sitemap page template */
.sitemap-page {
	max-width: 960px;
}

.sitemap-sections {
	display: grid;
	gap: 2.5rem;
	margin-top: 2rem;
}

.sitemap-heading {
	font-family: var(--font-heading);
	font-size: 1.5rem;
	padding-bottom: 0.5rem;
	margin-bottom: 1.25rem;
	border-bottom: 2px solid var(--color-ink);
}

.sitemap-section > .sitemap-category + .sitemap-category {
	margin-top: 1.75rem;
}

.sitemap-category-title {
	font-family: var(--font-heading);
	font-size: 1.2rem;
	margin-bottom: 0.5rem;
}

.sitemap-count {
	font-family: var(--font-sans);
	font-size: 0.8125rem;
	font-weight: 400;
	color: var(--color-ink-muted);
}

.sitemap-list {
	list-style: none;
	columns: 2 280px;
	column-gap: 2rem;
}

.sitemap-list li {
	break-inside: avoid;
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.15rem 0.6rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--color-border-subtle);
	font-size: 0.9375rem;
}

.sitemap-list a {
	color: var(--color-ink);
}

.sitemap-list a:hover {
	color: var(--color-accent);
}

.sitemap-list time {
	font-size: 0.75rem;
	color: var(--color-ink-muted);
}

.sitemap-list .children {
	list-style: none;
	padding-left: 1rem;
}

.sitemap-xml-note {
	margin-top: 1.25rem;
	font-size: 0.875rem;
	color: var(--color-ink-muted);
}

.sitemap-xml-note a {
	color: var(--color-accent);
	font-weight: 600;
}

.no-results-box {
	padding: 2rem;
	text-align: center;
	background: var(--color-surface);
	border: 1px dashed var(--color-border);
	border-radius: var(--radius-lg);
	color: var(--color-ink-muted);
}

.pagination-nav {
	margin-top: 2.5rem;
}

.pagination-nav .nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.4rem;
}

.pagination-nav .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 0.85rem;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: var(--color-surface);
	font-size: 0.875rem;
	font-weight: 600;
}

.pagination-nav .page-numbers.current {
	background: var(--color-ink);
	border-color: var(--color-ink);
	color: var(--color-bg);
}

.pagination-nav .page-numbers.dots {
	border: 0;
	background: none;
}

.error-404 {
	max-width: 640px;
	margin: 0 auto;
	padding-top: 3rem;
	text-align: center;
}

.error-num {
	display: block;
	font-family: var(--font-heading);
	font-size: 6rem;
	line-height: 1;
	color: var(--color-accent);
}

.error-404 .page-content > * + * {
	margin-top: 1.5rem;
}

.error-search-box .search-form {
	margin: 0 auto;
}

.error-suggested-categories h3 {
	font-size: 1rem;
	margin-bottom: 0.75rem;
}

.suggested-cats-list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem;
}

.suggested-cats-list a {
	display: inline-block;
	padding: 0.4rem 0.9rem;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	background: var(--color-surface);
	font-size: 0.875rem;
}

/* ==========================================================================
   15. Footer
   ========================================================================== */
.site-footer {
	/* Below the fold: the browser skips rendering it until the reader scrolls near it */
	content-visibility: auto;
	contain-intrinsic-size: auto 700px;
	background: var(--color-surface);
	border-top: 1px solid var(--color-border);
	padding: 3.5rem 0 1.5rem;
	margin-top: 4rem;
}

.footer-columns {
	display: grid;
	grid-template-columns: 1.4fr 1fr 1fr 1.4fr;
	gap: 2.5rem;
	padding-bottom: 2.5rem;
}

.footer-title {
	font-family: var(--font-heading);
	font-size: 1.6rem;
	font-weight: 700;
	margin-bottom: 0.6rem;
}

.footer-heading {
	font-size: 0.8125rem;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	margin-bottom: 1rem;
}

.footer-text {
	font-size: 0.9rem;
	color: var(--color-ink-muted);
	line-height: 1.6;
	margin-bottom: 1rem;
}

.footer-links {
	list-style: none;
	display: flex;
	flex-direction: column;
	gap: 0.55rem;
	font-size: 0.9rem;
}

.footer-links a {
	display: inline-flex;
	align-items: center;
	min-height: 28px;
	color: var(--color-ink-muted);
}

.footer-links a:hover {
	color: var(--color-accent);
}

.social-follow-footer .social-follow-link {
	border: 1px solid var(--color-border);
	width: 36px;
	height: 36px;
}

.site-footer .widget {
	background: none;
	border: 0;
	padding: 0;
}

.newsletter-form {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.newsletter-input {
	flex: 1 1 180px;
	min-width: 0;
	border: 1px solid var(--color-border);
	border-radius: 999px;
	padding: 0.7rem 1rem;
	font-size: 0.875rem;
	background: var(--color-bg);
	color: var(--color-ink);
}

.newsletter-submit {
	background: var(--color-accent);
	color: var(--color-on-accent);
	border: none;
	border-radius: 999px;
	padding: 0.7rem 1.35rem;
	font-size: 0.875rem;
	font-weight: 600;
}

.newsletter-feedback {
	flex-basis: 100%;
	font-size: 0.8rem;
	color: var(--color-accent);
	font-weight: 500;
	min-height: 1.25rem;
}

.footer-bottom {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 1rem;
	flex-wrap: wrap;
	font-size: 0.8125rem;
	color: var(--color-ink-muted);
	border-top: 1px solid var(--color-border);
	padding-top: 1.5rem;
}

.back-to-top-btn {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	background: var(--color-bg);
	border: 1px solid var(--color-border);
	border-radius: 999px;
	padding: 0.45rem 0.9rem;
	font-size: 0.75rem;
	color: var(--color-ink);
}

.back-to-top-btn:hover {
	border-color: var(--color-accent);
	color: var(--color-accent);
}

/* ==========================================================================
   16. Utilities: reading progress, floating back-to-top, cookie notice
   ========================================================================== */
.reading-progress {
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	height: 3px;
	z-index: 1000;
	pointer-events: none;
}

.reading-progress-bar {
	display: block;
	height: 100%;
	background: var(--color-accent);
	transform: scaleX(0);
	transform-origin: 0 50%;
}

.to-top-fab {
	position: fixed;
	right: 1rem;
	bottom: 1rem;
	z-index: 45;
	width: 44px;
	height: 44px;
	border-radius: 50%;
	border: 1px solid var(--color-border);
	background: var(--color-surface);
	color: var(--color-ink);
	box-shadow: var(--shadow-md);
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.to-top-fab:hover {
	color: var(--color-accent);
	border-color: var(--color-accent);
}

.cookie-notice {
	position: fixed;
	left: 1rem;
	right: 1rem;
	bottom: 1rem;
	z-index: 90;
	max-width: 640px;
	margin: 0 auto;
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.9rem 1rem 0.9rem 1.25rem;
	background: var(--color-ink);
	color: var(--color-bg);
	border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg);
	font-size: 0.875rem;
}

.cookie-notice a {
	display: inline-block;
	padding: 0.2rem 0;
	color: inherit;
	text-decoration: underline;
}

.cookie-notice-accept {
	flex-shrink: 0;
	background: var(--color-accent);
	color: var(--color-on-accent);
	border: 0;
	border-radius: 999px;
	padding: 0.55rem 1.1rem;
	font-weight: 600;
}

/* ==========================================================================
   17. Advertising & sponsor slots (CLS prevention, responsive & accessible)
   ========================================================================== */
.gazette-ad-wrapper {
	width: 100%;
	margin: 2rem auto;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	contain: layout style;
}

.gazette-ad-wrapper.is-inline {
	margin: 2rem 0;
}

.gazette-ad-label {
	font-family: var(--font-sans);
	font-size: 0.6875rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.14em;
	color: var(--color-ink-muted);
	opacity: 0.8;
	margin-bottom: 0.4rem;
	display: block;
	text-align: center;
}

.gazette-ad-container {
	width: 100%;
	max-width: 970px;
	background: var(--color-surface);
	border: 1px dashed var(--color-border);
	border-radius: var(--radius-sm);
	overflow: hidden;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	min-height: 90px;
}

/* Responsive AdSense units measure their parent width; inside a centered flex box an <ins>
   would otherwise shrink to 0px and AdSense reports "availableWidth=0" (no ad served). */
.gazette-ad-container > ins.adsbygoogle {
	width: 100%;
}

.gazette-ad-container > ins.adsbygoogle[data-ad-status="unfilled"] {
	display: none !important;
}

.gazette-ad-header {
	max-width: 728px;
	min-height: 90px;
}

.gazette-ad-infeed {
	max-width: 970px;
	min-height: 120px;
}

.gazette-ad-article {
	max-width: 728px;
	min-height: 90px;
}

.gazette-ad-incontent {
	max-width: 100%;
	min-height: 280px;
}

.gazette-ad-sidebar {
	min-height: 250px;
}

.gazette-ad-placeholder {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.35rem;
	padding: 1rem;
	text-align: center;
	font-family: var(--font-sans);
	font-size: 0.75rem;
	color: var(--color-ink-muted);
}

.gazette-ad-placeholder-badge {
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	background: var(--color-border-subtle);
	color: var(--color-ink-muted);
	border: 1px solid var(--color-border);
	padding: 0.25rem 0.55rem;
	border-radius: 3px;
	white-space: nowrap;
}

.gazette-ad-placeholder-text {
	font-size: 0.75rem;
}

/* ==========================================================================
   18. Responsive, reduced motion, print
   ========================================================================== */
@media (min-width: 768px) {
	:root {
		--container-padding: 1.5rem;
	}
}

@media (max-width: 1100px) {
	.footer-columns {
		grid-template-columns: 1fr 1fr;
	}
}

@media (max-width: 1024px) {
	.single-layout {
		grid-template-columns: minmax(0, 1fr);
	}
	.single-article {
		margin: 0 auto;
	}
	.site-sidebar {
		display: grid;
		grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
		align-items: start;
	}
	.sidebar-sticky {
		position: static;
	}
}

@media (max-width: 900px) {
	.hero-grid {
		grid-template-columns: minmax(0, 1fr);
	}

	/* Mobile navigation drawer */
	.nav-toggle {
		display: inline-flex;
	}
	.main-navigation {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100vh - 64px);
		overflow-y: auto;
		background: var(--color-surface);
		border-bottom: 1px solid var(--color-border);
		box-shadow: var(--shadow-md);
		padding: 0.5rem var(--container-padding) 1.25rem;
	}
	.main-navigation.nav-open {
		display: block;
	}
	.main-navigation .nav-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
	}
	.main-navigation .nav-menu a {
		display: flex;
		align-items: center;
		min-height: 48px;
		padding: 0 0.5rem;
		border-bottom: 1px solid var(--color-border-subtle);
		border-radius: 0;
		font-size: 1rem;
	}
	.main-navigation .sub-menu {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: 0;
		padding: 0 0 0 1rem;
	}
	.mobile-nav-extras {
		display: block;
		padding-top: 1rem;
	}
	.site-identity {
		flex: 1;
	}
	.site-description {
		display: none;
	}
	.action-label {
		display: none;
	}
	.action-btn {
		padding: 0;
		width: 40px;
	}
}

@media (max-width: 600px) {
	.site-topbar {
		display: none;
	}
	/* Header: give the site name room (Share is hidden unless enabled for phones) */
	.hide-on-phone {
		display: none;
	}
	.branding-nav-inner {
		gap: 0.75rem;
		min-height: 60px;
	}
	.site-identity {
		min-width: 0;
	}
	.site-title {
		font-size: 1.55rem;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
	}
	.site-identity .custom-logo {
		max-height: 38px;
	}
	/* Footer: two-column grid. About and Newsletter span the full width,
	   Quick Links and Categories sit side by side. */
	.footer-columns {
		grid-template-columns: 1fr 1fr;
		gap: 2rem 1.25rem;
	}
	.footer-about,
	.footer-newsletter {
		grid-column: 1 / -1;
	}
	.footer-about { order: 1; }
	.footer-quicklinks { order: 2; }
	.footer-categories { order: 3; }
	.footer-newsletter { order: 4; }

	.search-modal-overlay {
		padding-top: 1rem;
	}
	.search-modal-container {
		padding: 1.25rem;
	}
	.header-actions {
		gap: 0.3rem;
	}
	.section-title {
		font-size: 1.35rem;
	}
	.typography-body {
		font-size: 1.0625rem;
		line-height: 1.75;
	}
	.typography-body h2 {
		font-size: 1.45rem;
	}
	.typography-body blockquote {
		font-size: 1.15rem;
	}
	.post-grid {
		gap: 1.25rem;
	}
	.category-box-list {
		max-height: 21rem;
	}
	.footer-bottom {
		flex-direction: column-reverse;
		align-items: flex-start;
	}
	.author-box {
		flex-direction: column;
		gap: 0.75rem;
	}
	.post-navigation .nav-links {
		grid-template-columns: 1fr;
	}
	.post-navigation .nav-next {
		grid-column: auto;
	}
	.cookie-notice {
		flex-direction: column;
		align-items: stretch;
		text-align: left;
	}
	.to-top-fab {
		bottom: 5rem;
	}
	.gazette-ad-header {
		min-height: 50px;
		max-width: 320px;
	}
	.gazette-ad-infeed {
		min-height: 100px;
	}
	.gazette-ad-incontent {
		min-height: 250px;
	}
	.entry-share-bottom .share-btn-text {
		display: none;
	}
	.entry-share-bottom .share-btn {
		width: 40px;
		height: 40px;
		padding: 0;
		justify-content: center;
	}
	.entry-share-bottom .share-copy-btn {
		width: auto;
		padding: 0 0.85rem;
	}
}

@media screen and (max-width: 782px) {
	.admin-bar .site-header {
		top: 46px;
	}
}

@media screen and (max-width: 600px) {
	/* WordPress' admin bar stops being fixed at this width */
	.admin-bar .site-header {
		top: 0;
	}
}

@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

@media print {
	.site-header,
	.site-footer,
	.site-sidebar,
	.gazette-ad-wrapper,
	.entry-share-bottom,
	.related-posts,
	.post-navigation,
	.cookie-notice,
	.to-top-fab,
	.reading-progress,
	.gazette-toc,
	#respond {
		display: none !important;
	}
	body {
		background: #fff;
		color: #000;
	}
	.single-layout {
		display: block;
	}
}
