/*!
 * KuliPress Pro main.css
 * A modern, fast WordPress blog theme.
 */

/* ==========================================================================
   1. CSS Variables / Theme Tokens
   ========================================================================== */
:root {
	--c-bg: #ffffff;
	--c-text: #0f172a;
	--c-accent: #0f172a;
	--c-border: #e2e8f0;
	--c-surface: #f8fafc;
	--c-muted: #64748b;
	--c-code-bg: #0f172a;
	--c-code-fg: #e2e8f0;

	--container: 1200px;
	--radius-sm: 6px;
	--radius: 12px;
	--radius-lg: 18px;
	--radius-xl: 24px;

	--shadow-xs: 0 1px 2px rgba(15, 23, 42, .06);
	--shadow-sm: 0 2px 8px rgba(15, 23, 42, .06);
	--shadow-md: 0 10px 30px rgba(15, 23, 42, .08);
	--shadow-lg: 0 24px 48px -12px rgba(15, 23, 42, .15);

	--font-body: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-head: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;

	--transition: 200ms cubic-bezier(.4, 0, .2, 1);

	color-scheme: light dark;
}

/* Smooth color transitions when toggling dark mode */
html, body, .site-header, .post-card, .widget, input, textarea, select, button {
	transition: background-color var(--transition), color var(--transition), border-color var(--transition);
}

/* Font family override based on customizer choice */
body[class*="theme"] { font-family: var(--font-body); }
h1, h2, h3, h4, h5, h6, .site-title { font-family: var(--font-head); }

/* ==========================================================================
   2. Reset & Base
   ========================================================================== */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; tab-size: 4; }
body {
	margin: 0;
	background: var(--c-bg);
	color: var(--c-text);
	font-family: var(--font-body);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	overflow-x: hidden;
}

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

a { color: var(--c-accent); text-decoration: none; transition: color var(--transition), opacity var(--transition); }
a:hover { opacity: .8; }

h1, h2, h3, h4, h5, h6 { margin: 0 0 .5em; font-weight: 700; line-height: 1.25; letter-spacing: -0.02em; }
h1 { font-size: clamp(1.75rem, 1.2rem + 2.5vw, 2.75rem); }
h2 { font-size: clamp(1.5rem, 1.1rem + 1.6vw, 2.1rem); }
h3 { font-size: 1.4rem; }
h4 { font-size: 1.15rem; }

p { margin: 0 0 1em; }

ul, ol { padding-left: 1.4em; }

blockquote {
	margin: 1.5em 0;
	padding: 1em 1.4em;
	border-left: 4px solid var(--c-accent);
	background: var(--c-surface);
	border-radius: var(--radius-sm);
	font-style: italic;
	color: var(--c-muted);
}

hr { border: 0; border-top: 1px solid var(--c-border); margin: 2em 0; }

table { width: 100%; border-collapse: collapse; margin: 1.5em 0; }
th, td { padding: .75em 1em; border-bottom: 1px solid var(--c-border); text-align: left; }
th { font-weight: 700; background: var(--c-surface); }

input, textarea, select {
	font: inherit;
	color: inherit;
	background: var(--c-bg);
	border: 1px solid var(--c-border);
	border-radius: var(--radius-sm);
	padding: .65em .9em;
	width: 100%;
	transition: border-color var(--transition), box-shadow var(--transition);
}
input:focus, textarea:focus, select:focus, button:focus-visible {
	outline: none;
	border-color: var(--c-accent);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--c-accent) 20%, transparent);
}

/* Screen-reader only */
.sr-only, .screen-reader-text {
	border: 0; clip: rect(1px, 1px, 1px, 1px);
	-webkit-clip-path: inset(50%); clip-path: inset(50%);
	height: 1px; width: 1px; margin: -1px; overflow: hidden;
	padding: 0; position: absolute; word-wrap: normal !important;
}

.skip-link:focus {
	clip: auto; clip-path: none; height: auto; width: auto;
	background: var(--c-accent); color: var(--c-bg);
	left: 1rem; top: 1rem; padding: .75em 1em;
	z-index: 100000; border-radius: var(--radius-sm);
}

/* ==========================================================================
   3. Layout
   ========================================================================== */
.container { max-width: var(--container); margin: 0 auto; padding: 0 24px; }
@media (min-width: 768px) { .container { padding: 0 32px; } }

.site-content { display: block; min-height: 50vh; }

.site-main-wrap {
	display: grid;
	grid-template-columns: 1fr;
	gap: 48px;
	padding: 48px 24px 64px;
	margin: 0 auto;
}
@media (min-width: 1024px) {
	.site-main-wrap { padding: 64px 32px 96px; gap: 64px; }
	.sidebar-right .site-main-wrap { grid-template-columns: minmax(0, 1fr) 320px; }
	.sidebar-left .site-main-wrap  { grid-template-columns: 320px minmax(0, 1fr); }
	.sidebar-left #primary { order: 2; } .sidebar-left #secondary { order: 1; }
	.sidebar-none .site-main-wrap, body:not(.sidebar-right):not(.sidebar-left) .site-main-wrap { grid-template-columns: 1fr; max-width: 880px; }
}
.sidebar-none #secondary { display: none; }

/* ==========================================================================
   4. Header
   ========================================================================== */
.site-header {
	background: color-mix(in srgb, var(--c-bg) 92%, transparent);
	backdrop-filter: saturate(140%) blur(12px);
	-webkit-backdrop-filter: saturate(140%) blur(12px);
	border-bottom: 1px solid var(--c-border);
	position: relative;
	z-index: 50;
}
/* When mobile menu is open, raise the header above the backdrop.
 * The drawer lives INSIDE .site-header. Because the header creates its own
 * stacking context (via backdrop-filter and z-index), the drawer's z-index
 * is bounded by the header's stacking position in the root document.
 * Without this rule, header (z-index 50) + drawer (inside) end up BELOW the
 * backdrop (z-index 75) — which is exactly the bug shown in user reports
 * where the drawer becomes dim/blurred and unclickable. Bumping the header
 * above the backdrop lifts the entire header context — including the drawer
 * — back on top so menu items are crisp and tappable. */
body.menu-open .site-header { z-index: 85; }
body.sticky-header .site-header { position: sticky; top: 0; }
body.hide-on-scroll.scrolling-down .site-header { transform: translateY(-100%); transition: transform 300ms ease; }
body.hide-on-scroll .site-header { transition: transform 300ms ease; }

.header-inner {
	display: flex;
	align-items: center;
	gap: 24px;
	padding: 18px 24px;
}
@media (min-width: 768px) { .header-inner { padding: 22px 32px; } }

/* ----- Header Layout: Centered Logo (DESKTOP only — opt-in via Customizer) -----
 * Desktop standard layout uses default flex (logo left, nav center, actions right).
 * Desktop centered layout uses CSS Grid 1fr auto 1fr.
 */
@media (min-width: 1024px) {
	body.header-layout-centered .header-inner {
		display: grid;
		grid-template-columns: 1fr auto 1fr;
		align-items: center;
		gap: 24px;
	}
	body.header-layout-centered .main-navigation { grid-column: 1; justify-content: flex-start; }
	body.header-layout-centered .main-navigation ul#primary-menu { justify-content: flex-start; }
	body.header-layout-centered .site-branding { grid-column: 2; }
	body.header-layout-centered .header-actions { grid-column: 3; justify-self: end; }
}

/* ----- Mobile header: ALWAYS centered single-row layout (auto, no setting needed) -----
 * Hamburger left | Logo/Title center | Theme toggle right.
 * Uses CSS Grid `auto 1fr auto` and explicit grid-row: 1 so all three are
 * guaranteed to stay on the SAME row. The center column takes remaining space
 * and truncates long titles with ellipsis. !important is used defensively
 * to prevent any other rule (or cached CSS) from re-stacking these onto
 * separate rows.
 */
@media (max-width: 1023px) {
	.site-header .header-inner {
		display: grid !important;
		grid-template-columns: auto 1fr auto !important;
		grid-template-rows: auto !important;
		align-items: center;
		column-gap: 10px;
		row-gap: 0;
		padding: 12px 16px;
	}
	.site-header .header-inner > .main-navigation {
		grid-column: 1 !important; grid-row: 1 !important;
		align-self: center; justify-self: start;
		margin: 0;
	}
	.site-header .header-inner > .site-branding {
		grid-column: 2 !important; grid-row: 1 !important;
		align-self: center; justify-self: center;
		min-width: 0; max-width: 100%;
		display: flex !important;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		text-align: center;
		gap: 1px; margin: 0;
	}
	.site-header .header-inner > .header-actions {
		grid-column: 3 !important; grid-row: 1 !important;
		align-self: center; justify-self: end;
		margin: 0;
	}

	/* Compact branding text for mobile so it fits centred between the two buttons */
	.site-header .site-branding .site-title,
	.site-header .site-branding .default-logo-text .site-title,
	.site-header .site-branding .branding-title-only .site-title {
		font-size: 1.1rem;
		line-height: 1.15;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 100%;
		display: block;
		margin: 0;
	}
	.site-header .site-branding .site-description {
		font-size: .72rem;
		line-height: 1.2;
		white-space: nowrap;
		overflow: hidden;
		text-overflow: ellipsis;
		max-width: 100%;
		margin: 0;
	}

	/* Slightly smaller circular buttons on mobile to keep header compact */
	.site-header .header-actions .theme-toggle,
	.site-header .main-navigation .menu-toggle {
		width: 40px; height: 40px;
	}

	/* The default-logo (K-mark + title) — compact spacing on mobile */
	.default-logo { gap: 8px; }
	.default-logo-mark svg { width: 28px; height: 28px; }
}

.site-branding { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.site-title { margin: 0; font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; }
.site-title a { color: var(--c-text); }
.site-description { margin: 0; color: var(--c-muted); font-size: .85rem; }
.custom-logo-link img { max-height: 44px; width: auto; }

/* Default branded logo (K-mark + site title) — shown when no Custom Logo uploaded */
.default-logo {
	display: inline-flex; align-items: center; gap: 12px;
	color: var(--c-text); text-decoration: none;
	transition: opacity var(--transition);
}
.default-logo:hover { opacity: .85; }
.default-logo-mark {
	display: inline-flex; align-items: center; justify-content: center;
	flex-shrink: 0; color: var(--c-text);
	transition: color var(--transition);
}
.default-logo-mark svg { display: block; }
.default-logo-text { display: inline-flex; flex-direction: column; line-height: 1; }
.default-logo-text .site-title {
	font-size: 1.35rem; font-weight: 800; letter-spacing: -.025em;
	color: var(--c-text);
}
@media (max-width: 540px) {
	.default-logo-mark svg { width: 30px; height: 30px; }
	.default-logo-text .site-title { font-size: 1.15rem; }
}

.main-navigation { flex: 1; }
.main-navigation ul { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; justify-content: center; }
.main-navigation a {
	display: inline-block; padding: 8px 14px; color: var(--c-text);
	font-weight: 500; font-size: .95rem; border-radius: var(--radius-sm);
	position: relative;
}
.main-navigation a:hover { background: var(--c-surface); opacity: 1; }
.main-navigation .current-menu-item > a { color: var(--c-accent); }
.main-navigation .current-menu-item > a::after {
	content: ""; position: absolute; left: 14px; right: 14px; bottom: 4px;
	height: 2px; background: var(--c-accent); border-radius: 2px;
}

/* Submenus */
.main-navigation li { position: relative; }
.main-navigation .sub-menu {
	position: absolute; top: 100%; left: 0; min-width: 200px;
	background: var(--c-bg); border: 1px solid var(--c-border);
	border-radius: var(--radius); padding: 8px; box-shadow: var(--shadow-md);
	display: none; flex-direction: column; gap: 0; z-index: 60;
}
.main-navigation li:hover > .sub-menu,
.main-navigation li:focus-within > .sub-menu { display: flex; }
.main-navigation .sub-menu a { width: 100%; }

.header-actions { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.header-actions .search-form { max-width: 220px; position: relative; display: none; }
@media (min-width: 1024px) { .header-actions .search-form { display: block; } }
.search-form .search-icon { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--c-muted); pointer-events: none; }
.search-form .search-field { padding-left: 40px; font-size: .9rem; background: var(--c-surface); border-color: transparent; }
.search-form .search-field:focus { background: var(--c-bg); border-color: var(--c-border); }

.theme-toggle, .menu-toggle, .back-to-top {
	display: inline-flex; align-items: center; justify-content: center;
	width: 40px; height: 40px; padding: 0; border: 1px solid var(--c-border);
	background: var(--c-surface); color: var(--c-text); border-radius: 999px;
	cursor: pointer; transition: all var(--transition);
}
.theme-toggle:hover, .menu-toggle:hover, .back-to-top:hover {
	background: var(--c-accent); color: var(--c-bg); border-color: var(--c-accent);
}
.theme-toggle .icon-moon { display: none; }
[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
[data-theme="dark"] .theme-toggle .icon-moon { display: block; }

.menu-toggle { display: inline-flex; position: relative; z-index: 90; }
@media (min-width: 1024px) { .menu-toggle { display: none; } }

/* Hamburger → X animation lines */
.menu-toggle svg .line-1,
.menu-toggle svg .line-2,
.menu-toggle svg .line-3 {
	transition: transform 240ms cubic-bezier(.4,0,.2,1), opacity 200ms;
	transform-origin: center;
}
.main-navigation.is-open .menu-toggle svg .line-1 { transform: translateY(6px) rotate(45deg); }
.main-navigation.is-open .menu-toggle svg .line-2 { opacity: 0; transform: scaleX(0); }
.main-navigation.is-open .menu-toggle svg .line-3 { transform: translateY(-6px) rotate(-45deg); }

/* Backdrop overlay (injected via JS) — covers entire viewport */
.menu-backdrop {
	position: fixed; inset: 0;
	background: rgba(15, 23, 42, .55);
	backdrop-filter: blur(3px); -webkit-backdrop-filter: blur(3px);
	z-index: 75; opacity: 0; pointer-events: none;
	transition: opacity 280ms ease;
}
.menu-backdrop.is-visible { opacity: 1; pointer-events: auto; }

/* Body scroll lock when menu open */
body.menu-open { overflow: hidden; }

/* Drawer wrapper:
   - Desktop: just a normal in-flow block wrapping the menu (the drawer-header
     children inside are hidden on desktop via the rule below).
   - Mobile: becomes an off-canvas slide-in panel via the @media block. */
.nav-drawer { display: block; }

/* On desktop, hide drawer-header (search + close) inside the wrapper */
@media (min-width: 1024px) {
	.drawer-header { display: none; }
}

/* Title-only branding variant */
.branding-title-only { text-decoration: none; color: var(--c-text); display: inline-block; }
.branding-title-only .site-title { font-size: 1.45rem; font-weight: 800; letter-spacing: -.03em; color: var(--c-text); }
.branding-title-only:hover { opacity: .85; }

/* ---------- Mobile menu (left-side drawer with search + close) ---------- */
@media (max-width: 1023px) {
	.nav-drawer {
		display: flex !important;
		flex-direction: column;
		position: fixed;
		top: 0; left: 0;
		width: min(82%, 360px);
		height: 100vh;
		height: 100dvh; /* dynamic viewport for mobile browsers with chrome bars */
		background: var(--c-bg);
		transform: translateX(-100%);
		visibility: hidden;
		transition:
			transform 380ms cubic-bezier(.4, 0, .2, 1),
			visibility 0s linear 380ms;
		box-shadow: 20px 0 60px rgba(15, 23, 42, .22);
		z-index: 80;
		overflow-y: auto;
		overscroll-behavior: contain;
		-webkit-overflow-scrolling: touch;
	}
	.main-navigation.is-open .nav-drawer {
		transform: translateX(0);
		visibility: visible;
		transition:
			transform 380ms cubic-bezier(.4, 0, .2, 1),
			visibility 0s linear 0s;
	}

	/* Drawer header: search input + X close, sticky to top */
	.drawer-header {
		display: flex; align-items: center; gap: 10px;
		padding: 14px 14px 14px;
		border-bottom: 1px solid var(--c-border);
		position: sticky; top: 0; z-index: 2;
		background: var(--c-bg);
		flex-shrink: 0;
	}
	.drawer-header .search-form {
		flex: 1; max-width: none; min-width: 0;
		display: block; position: relative; margin: 0;
	}
	.drawer-header .search-form .search-field {
		padding: 11px 44px 11px 16px;
		background: var(--c-surface);
		border: 1px solid var(--c-border);
		height: 46px;
		font-size: .98rem; width: 100%;
		border-radius: 10px;
	}
	.drawer-header .search-form .search-icon {
		left: auto;
		right: 14px;
		color: var(--c-muted);
		opacity: .9;
	}
	/* Hide the form's submit button completely inside the drawer — the icon
	 * itself is purely decorative; submission happens via the Enter key. */
	.drawer-header .search-form .search-submit { display: none !important; }
	.drawer-close {
		flex-shrink: 0;
		display: inline-flex; align-items: center; justify-content: center;
		width: 46px; height: 46px; padding: 0;
		border: 2px solid color-mix(in srgb, var(--c-border) 180%, transparent);
		border-radius: 10px;
		background: transparent; color: var(--c-text);
		cursor: pointer;
		transition: all var(--transition);
	}
	.drawer-close:hover {
		background: var(--c-surface);
		border-color: var(--c-accent);
		color: var(--c-accent);
	}
	.drawer-close:active { transform: scale(.96); }

	/* Menu list inside drawer */
	.main-navigation #primary-menu {
		list-style: none; margin: 0;
		padding: 4px 0 24px;
		display: flex; flex-direction: column;
		align-items: stretch; gap: 0;
		justify-content: flex-start;
	}
	.main-navigation #primary-menu > li {
		display: block;
		border-bottom: 1px solid color-mix(in srgb, var(--c-border) 45%, transparent);
	}
	.main-navigation #primary-menu > li:last-child { border-bottom: 0; }

	.main-navigation #primary-menu a {
		display: block;
		padding: 18px 24px;
		font-size: 1.08rem;
		font-weight: 500;
		color: var(--c-text);
		border-radius: 0;
		text-decoration: none;
		transition: background var(--transition), color var(--transition), padding-left var(--transition);
	}
	.main-navigation #primary-menu a:hover,
	.main-navigation #primary-menu .current-menu-item > a {
		background: color-mix(in srgb, var(--c-accent) 6%, transparent);
		color: var(--c-accent);
		padding-left: 30px;
		opacity: 1;
	}
	/* Override desktop "::after" decoration on a-tags */
	.main-navigation #primary-menu a::after { content: none; }
	.main-navigation #primary-menu .current-menu-item > a::after { content: none; }

	/* Sub-menus inline below parent */
	.main-navigation .sub-menu {
		position: static;
		background: var(--c-surface);
		border: 0; border-top: 1px solid var(--c-border);
		box-shadow: none; border-radius: 0;
		padding: 0; margin: 0;
		display: block;
		list-style: none;
	}
	.main-navigation .sub-menu li { border-bottom: 1px solid color-mix(in srgb, var(--c-border) 50%, transparent); }
	.main-navigation .sub-menu li:last-child { border-bottom: 0; }
	.main-navigation .sub-menu a {
		padding: 14px 24px 14px 40px;
		font-size: .96rem; color: var(--c-muted);
	}
	.main-navigation .sub-menu a:hover { color: var(--c-accent); background: color-mix(in srgb, var(--c-accent) 8%, transparent); }
}

/* ==========================================================================
   5. Reading Progress Bar
   ========================================================================== */
.reading-progress {
	position: fixed; top: 0; left: 0; right: 0; height: 3px;
	background: transparent; z-index: 100; pointer-events: none;
}
.reading-progress .bar { display: block; height: 100%; width: 0%; background: var(--c-accent); transition: width 80ms linear; }

/* ==========================================================================
   6. Breadcrumbs
   ========================================================================== */
.breadcrumbs { background: var(--c-surface); border-bottom: 1px solid var(--c-border); font-size: .85rem; }
.breadcrumbs .container { padding-top: 12px; padding-bottom: 12px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 8px; color: var(--c-muted); }
.breadcrumbs li { display: inline-flex; align-items: center; gap: 8px; }
.breadcrumbs a { color: var(--c-muted); }
.breadcrumbs a:hover { color: var(--c-accent); opacity: 1; }
.breadcrumbs .bc-sep { opacity: .5; }
.breadcrumbs li.current { color: var(--c-text); font-weight: 500; }

/* ==========================================================================
   7. Buttons
   ========================================================================== */
.btn {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	padding: 11px 22px; border-radius: 999px; font-weight: 600; font-size: .95rem;
	cursor: pointer; border: 1px solid transparent; transition: all var(--transition);
	text-decoration: none; line-height: 1;
}
.btn-primary { background: var(--c-accent); color: var(--c-bg); }
.btn-primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); opacity: 1; }
.btn-ghost { background: transparent; color: var(--c-text); border-color: var(--c-border); }
.btn-ghost:hover { background: var(--c-surface); opacity: 1; }
.btn-loadmore { background: var(--c-surface); color: var(--c-text); border: 1px solid var(--c-border); padding: 14px 28px; }
.btn-loadmore:hover { background: var(--c-accent); color: var(--c-bg); border-color: var(--c-accent); opacity: 1; }
.btn:disabled { opacity: .5; cursor: not-allowed; }

/* ==========================================================================
   8. Hero
   ========================================================================== */
.hero-section {
	position: relative; overflow: hidden;
	margin: 0; padding: clamp(72px, 12vw, 160px) 0;
	background-color: var(--c-surface);
	background-image: var(--hero-bg, none);
	background-size: cover; background-position: center;
	color: #fff;
	isolation: isolate;
}
.hero-section .hero-overlay {
	position: absolute; inset: 0; z-index: 1;
	background: linear-gradient(135deg, rgba(15,23,42,.85) 0%, rgba(15,23,42,.5) 60%, rgba(15,23,42,.2) 100%);
}
.hero-section:not([style*="hero-bg"]) .hero-overlay { background: linear-gradient(135deg, var(--c-accent), color-mix(in srgb, var(--c-accent) 40%, var(--c-text))); }

.hero-inner { position: relative; z-index: 2; }
.hero-content { max-width: 720px; }
.hero-category {
	display: inline-flex; align-items: center; padding: 6px 14px;
	background: rgba(255,255,255,.15); backdrop-filter: blur(8px);
	color: #fff; font-size: .8rem; font-weight: 600; text-transform: uppercase;
	letter-spacing: .08em; border-radius: 999px; margin-bottom: 18px;
}
.hero-title { font-size: clamp(2rem, 1.5rem + 2.5vw, 3.5rem); margin: 0 0 18px; color: #fff; line-height: 1.1; }
.hero-title a { color: #fff; }
.hero-title a:hover { opacity: .9; }
.hero-excerpt { font-size: clamp(1rem, .9rem + .4vw, 1.15rem); color: rgba(255,255,255,.85); margin: 0 0 22px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px; font-size: .9rem; color: rgba(255,255,255,.75); margin-bottom: 28px; }
.hero-sep { opacity: .5; }
.hero-cta { background: #fff; color: var(--c-text); }
.hero-cta:hover { background: var(--c-surface); }

.hero-custom { color: var(--c-text); background: var(--c-surface); padding: 80px 0; }
.hero-custom .container { text-align: center; }

/* ==========================================================================
   9. Section Headers
   ========================================================================== */
.section-head {
	display: flex; align-items: center; gap: 16px;
	margin-bottom: 28px;
}
.section-title { margin: 0; font-size: clamp(1.4rem, 1.1rem + 1vw, 1.85rem); letter-spacing: -.02em; }
.section-rule { flex: 1; height: 1px; background: var(--c-border); }

/* ==========================================================================
   10. Editor's Pick
   ========================================================================== */
.editors-pick { padding: 56px 0; border-bottom: 1px solid var(--c-border); }
.pick-grid {
	display: grid; gap: 24px;
	grid-template-columns: 1fr;
}
@media (min-width: 900px) {
	.pick-grid { grid-template-columns: 1.4fr 1fr; gap: 36px; }
}
.pick-main {
	display: flex; flex-direction: column; gap: 18px;
	background: var(--c-surface); border-radius: var(--radius-lg); overflow: hidden;
	box-shadow: var(--shadow-xs); transition: transform var(--transition), box-shadow var(--transition);
}
.pick-main:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pick-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; }
.pick-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms ease; }
.pick-main:hover .pick-thumb img { transform: scale(1.06); }
.pick-body { padding: 0 24px 24px; }
.pick-cat {
	display: inline-block; padding: 4px 10px; background: var(--c-accent); color: var(--c-bg);
	font-size: .72rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
	border-radius: 999px; margin-bottom: 12px;
}
.pick-title { font-size: clamp(1.25rem, 1rem + 1vw, 1.75rem); margin: 0 0 12px; }
.pick-title a { color: var(--c-text); }
.pick-title a:hover { color: var(--c-accent); opacity: 1; }
.pick-excerpt { color: var(--c-muted); margin: 0 0 14px; }
.pick-meta { font-size: .85rem; color: var(--c-muted); display: flex; gap: 8px; align-items: center; }
.pick-meta .dot { opacity: .5; }

.pick-side { display: flex; flex-direction: column; gap: 16px; }
.pick-item {
	display: grid; grid-template-columns: 130px 1fr; gap: 16px;
	background: var(--c-surface); border-radius: var(--radius); overflow: hidden;
	padding: 14px; transition: background var(--transition);
}
.pick-item:hover { background: color-mix(in srgb, var(--c-accent) 6%, var(--c-surface)); }
.pick-item-thumb { display: block; aspect-ratio: 4/3; border-radius: var(--radius-sm); overflow: hidden; }
.pick-item-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pick-item-body { display: flex; flex-direction: column; justify-content: center; }
.pick-item-title { font-size: 1rem; margin: 0 0 6px; line-height: 1.35; }
.pick-item-title a { color: var(--c-text); }
.pick-item-title a:hover { color: var(--c-accent); opacity: 1; }
.pick-item-meta { font-size: .8rem; color: var(--c-muted); display: flex; gap: 6px; }
@media (max-width: 600px) { .pick-item { grid-template-columns: 90px 1fr; } }

/* ==========================================================================
   11. Posts Grid (archive, index)
   ========================================================================== */
.page-header { margin-bottom: 32px; }
.page-title { margin: 0; }
.archive-description { margin-top: 12px; color: var(--c-muted); }
.search-header .search-form { margin-top: 18px; max-width: 480px; }

.posts-grid { display: grid; gap: 28px; }
.grid-cols-1 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .grid-cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 700px) { .grid-cols-3 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .grid-cols-3 { grid-template-columns: repeat(3, 1fr); } }

/* 1-column variant: horizontal cards */
.grid-cols-1 .post-card {
	display: grid; grid-template-columns: 280px 1fr; gap: 24px;
}
@media (max-width: 680px) { .grid-cols-1 .post-card { grid-template-columns: 1fr; } }

.post-card {
	background: var(--c-bg); border: 1px solid var(--c-border);
	border-radius: var(--radius-lg); overflow: hidden;
	transition: transform var(--transition), box-shadow var(--transition), border-color var(--transition);
	display: flex; flex-direction: column;
}
.post-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); border-color: transparent; }
.card-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; background: var(--c-surface); }
.card-thumb img { width: 100%; height: 100%; object-fit: cover; transition: transform 600ms ease; }
.post-card:hover .card-thumb img { transform: scale(1.05); }
.card-body { padding: 22px 22px 24px; display: flex; flex-direction: column; flex: 1; }
.card-category {
	display: inline-block; padding: 3px 10px; font-size: .72rem; font-weight: 700;
	color: var(--c-accent); background: color-mix(in srgb, var(--c-accent) 12%, transparent);
	border-radius: 999px; text-transform: uppercase; letter-spacing: .08em; margin-bottom: 10px;
	align-self: flex-start;
}
.card-title { margin: 0 0 10px; font-size: 1.2rem; line-height: 1.35; }
.card-title a { color: var(--c-text); }
.card-title a:hover { color: var(--c-accent); opacity: 1; }
.card-excerpt { color: var(--c-muted); flex: 1; margin: 0 0 14px; font-size: .95rem; }

/* Post Meta */
.entry-meta { display: flex; flex-wrap: wrap; gap: 12px; font-size: .85rem; color: var(--c-muted); align-items: center; }
.entry-meta > span { display: inline-flex; align-items: center; gap: 5px; }
.entry-meta svg { flex-shrink: 0; opacity: .7; }
.entry-meta a { color: inherit; }
.entry-meta a:hover { color: var(--c-accent); opacity: 1; }
.meta-single { padding: 18px 0; border-bottom: 1px solid var(--c-border); margin-bottom: 28px; font-size: .92rem; gap: 18px; }

/* ==========================================================================
   12. Pagination
   ========================================================================== */
.pagination { margin: 48px 0 0; }
.pagination ul, .nav-links { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 12px;
	background: var(--c-bg); border: 1px solid var(--c-border);
	border-radius: var(--radius-sm); font-weight: 500; color: var(--c-text);
	transition: all var(--transition);
}
.page-numbers:hover, .page-numbers.current {
	background: var(--c-accent); color: var(--c-bg); border-color: var(--c-accent); opacity: 1;
}
.page-numbers.dots { background: transparent; border: 0; }
.load-more-wrap { margin: 48px 0 0; text-align: center; }

/* ==========================================================================
   13. Single Post
   ========================================================================== */
.is-single .content-area, .is-page .content-area { max-width: 100%; min-width: 0; }
.post-single { font-size: 1.05rem; }
.entry-header { margin-bottom: 32px; }
.entry-category {
	display: inline-block; padding: 5px 14px; background: var(--c-accent); color: var(--c-bg);
	font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .08em;
	border-radius: 999px; margin-bottom: 18px;
}
.entry-title { font-size: clamp(2rem, 1.4rem + 2.5vw, 3rem); margin: 0 0 18px; line-height: 1.15; }
.entry-featured { margin: 0 0 36px; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm); }
.entry-featured img { width: 100%; height: auto; display: block; }
.entry-featured figcaption { padding: 12px 16px; color: var(--c-muted); font-size: .85rem; background: var(--c-surface); text-align: center; }

.entry-content { font-size: 1.075rem; line-height: 1.75; }
.entry-content > * { margin-bottom: 1.25em; }
.entry-content h2 { margin-top: 1.6em; margin-bottom: .5em; }
.entry-content h3, .entry-content h4 { margin-top: 1.4em; margin-bottom: .4em; }
.entry-content img { border-radius: var(--radius); }
.entry-content figure { margin: 1.5em 0; }
.entry-content figcaption { text-align: center; color: var(--c-muted); font-size: .85rem; margin-top: 8px; }
.entry-content a { color: var(--c-accent); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.entry-content a:hover { text-decoration: none; }
.entry-content ul, .entry-content ol { padding-left: 1.5em; }
.entry-content li { margin-bottom: .3em; }

.entry-tags { margin-top: 36px; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; padding-top: 24px; border-top: 1px solid var(--c-border); }
.tags-label { font-weight: 600; color: var(--c-muted); margin-right: 4px; }
.tag-chip {
	display: inline-block; padding: 6px 12px; background: var(--c-surface); color: var(--c-muted);
	border-radius: 999px; font-size: .82rem; transition: all var(--transition);
}
.tag-chip:hover { background: var(--c-accent); color: var(--c-bg); opacity: 1; }

/* ==========================================================================
   13.5. Advertisement slots
   ========================================================================== */

/* Generic ad-slot wrapper used by all in-page placements */
.ad-slot {
	position: relative;
	margin: 28px 0;
	padding: 22px 16px 16px;
	background: var(--c-surface);
	border: 1px solid color-mix(in srgb, var(--c-border) 70%, transparent);
	border-radius: var(--radius);
	text-align: center;
	overflow: hidden;
}
.ad-slot > * { max-width: 100%; }
.ad-slot ins, .ad-slot iframe, .ad-slot img { margin: 0 auto; display: block; max-width: 100%; }

.ad-label {
	position: absolute; top: 6px; left: 50%; transform: translateX(-50%);
	font-size: .65rem; font-weight: 600;
	color: var(--c-muted); text-transform: uppercase; letter-spacing: .1em;
	opacity: .7;
}

/* Position-specific tweaks for spacing */
.ad-above-title    { margin: 0 0 28px; }
.ad-below-title    { margin: 0 0 28px; }
.ad-below-featured { margin: 0 0 32px; }
.ad-in-content     { margin: 1.8em 0; }
.ad-after-content  { margin: 2em 0 0; }
.ad-before-related { margin: 36px 0; }

/* In-feed ad: blends with the post grid */
.ad-in-feed {
	margin: 0;
	background: var(--c-surface);
	border: 1px dashed var(--c-border);
	min-height: 200px;
	display: flex; align-items: center; justify-content: center;
}

/* Backward compatibility for older class names */
.ad-in-content, .ad-after-content { /* now inherit from .ad-slot via PHP */ }

/* ==========================================================================
   13.6. Sticky Anchor Ad
   ========================================================================== */
.anchor-ad {
	position: fixed;
	left: 0; right: 0;
	background: color-mix(in srgb, var(--c-bg) 96%, transparent);
	backdrop-filter: saturate(140%) blur(10px);
	-webkit-backdrop-filter: saturate(140%) blur(10px);
	border-top: 1px solid var(--c-border);
	box-shadow: 0 -6px 20px rgba(15, 23, 42, .12);
	z-index: 70;
	padding: 8px 44px 8px 12px;
	min-height: 60px;
	display: flex; align-items: center; justify-content: center;
	animation: anchor-in 360ms cubic-bezier(.4, 0, .2, 1);
}
.anchor-ad.anchor-bottom { bottom: 0; }
.anchor-ad.anchor-top {
	top: 0; border-top: 0; border-bottom: 1px solid var(--c-border);
	box-shadow: 0 6px 20px rgba(15, 23, 42, .12);
}
.anchor-ad.is-closing { animation: anchor-out 280ms ease forwards; }
@keyframes anchor-in  { from { transform: translateY(100%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes anchor-out { to   { transform: translateY(100%); opacity: 0; } }
.anchor-ad.anchor-top { animation-name: anchor-in-top; }
@keyframes anchor-in-top  { from { transform: translateY(-100%); opacity: 0; } to { transform: none; opacity: 1; } }
.anchor-ad.anchor-top.is-closing { animation-name: anchor-out-top; }
@keyframes anchor-out-top { to   { transform: translateY(-100%); opacity: 0; } }

.anchor-ad-inner {
	display: flex; align-items: center; justify-content: center; gap: 8px;
	flex-direction: column; max-width: 100%;
}
.anchor-ad-inner .ad-label {
	position: static; transform: none;
	font-size: .58rem; opacity: .55;
	margin: 0 0 2px;
}
.anchor-ad-inner ins, .anchor-ad-inner iframe, .anchor-ad-inner img {
	display: block; margin: 0 auto; max-width: 100%;
}
.anchor-ad-close {
	position: absolute;
	top: 8px; right: 8px;
	width: 28px; height: 28px; padding: 0;
	display: inline-flex; align-items: center; justify-content: center;
	background: rgba(15, 23, 42, .85); color: #fff;
	border: 0; border-radius: 999px;
	cursor: pointer; transition: all var(--transition);
	z-index: 1;
}
.anchor-ad-close:hover { background: #000; transform: scale(1.05); }

/* Device-targeted visibility */
@media (min-width: 768px) {
	.anchor-on-mobile { display: none; }
}
@media (max-width: 767px) {
	.anchor-on-desktop { display: none; }
}

/* Body offsets so the back-to-top button and footer don't sit under the anchor ad */
body.has-anchor-ad.anchor-bottom .back-to-top { bottom: 80px; }
body.has-anchor-ad.anchor-bottom { padding-bottom: 60px; }
body.has-anchor-ad.anchor-top    { padding-top: 60px; }

/* ==========================================================================
   13.7. Vignette / Interstitial Ad
   ========================================================================== */
.vignette-ad {
	position: fixed; inset: 0;
	z-index: 200;
	display: flex; align-items: center; justify-content: center;
	animation: vignette-fade-in 280ms ease;
}
.vignette-ad[hidden] { display: none; }
.vignette-ad-overlay {
	position: absolute; inset: 0;
	background: rgba(0, 0, 0, .85);
	backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
}
.vignette-ad-panel {
	position: relative; z-index: 1;
	background: var(--c-bg);
	color: var(--c-text);
	border-radius: var(--radius-lg);
	box-shadow: 0 24px 80px rgba(0, 0, 0, .45);
	width: min(92vw, 420px);
	max-height: 90vh;
	display: flex; flex-direction: column;
	overflow: hidden;
	animation: vignette-pop-in 320ms cubic-bezier(.34, 1.56, .64, 1);
}
.vignette-ad-bar {
	display: flex; align-items: center; justify-content: space-between;
	padding: 10px 12px;
	border-bottom: 1px solid var(--c-border);
	background: var(--c-surface);
}
.vignette-ad-bar .ad-label {
	position: static; transform: none;
	font-size: .65rem; font-weight: 700;
	color: var(--c-muted); opacity: 1;
}
.vignette-ad-close {
	display: inline-flex; align-items: center; gap: 6px;
	padding: 6px 10px;
	background: transparent; color: var(--c-text);
	border: 1px solid var(--c-border); border-radius: 999px;
	cursor: pointer; font-size: .8rem; font-weight: 500;
	transition: all var(--transition);
}
.vignette-ad-close:disabled { opacity: .5; cursor: not-allowed; }
.vignette-ad-close:not(:disabled):hover { background: var(--c-surface); border-color: var(--c-accent); color: var(--c-accent); }
.vignette-countdown { font-variant-numeric: tabular-nums; }

.vignette-ad-body {
	flex: 1; overflow: auto;
	padding: 18px;
	display: flex; align-items: center; justify-content: center;
	min-height: 250px;
}
.vignette-ad-body > * { max-width: 100%; }
.vignette-ad-body ins, .vignette-ad-body iframe, .vignette-ad-body img {
	display: block; margin: 0 auto; max-width: 100%;
}

.vignette-ad-foot {
	padding: 12px 18px;
	border-top: 1px solid var(--c-border);
	display: flex; justify-content: center;
}
.vignette-ad-continue { width: 100%; justify-content: center; }

body.vignette-open { overflow: hidden; }

@keyframes vignette-fade-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes vignette-pop-in  { from { transform: translateY(20px) scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }

/* ==========================================================================
   14. Table of Contents
   ========================================================================== */
.toc-container {
	background: var(--c-surface); border: 1px solid var(--c-border);
	border-radius: var(--radius); padding: 18px 20px; margin: 0 0 28px;
}
.toc-container.toc-content { margin-bottom: 32px; }
.toc-title {
	display: flex; align-items: center; justify-content: space-between; width: 100%;
	font-size: 1rem; font-weight: 700; margin: 0 0 12px; padding: 0;
	color: var(--c-text); background: transparent; border: 0; cursor: pointer;
	font-family: inherit; text-align: left;
}
button.toc-title:hover { color: var(--c-accent); }
.toc-title::after {
	content: ""; flex-shrink: 0; margin-left: 12px;
	width: 9px; height: 9px;
	border-right: 2px solid currentColor; border-bottom: 2px solid currentColor;
	transform: rotate(45deg); transition: transform 240ms ease;
	opacity: .6;
}
.toc-container.collapsed .toc-title::after { transform: rotate(-45deg); }
.toc-container.not-collapsible .toc-title { cursor: default; }
.toc-container.not-collapsible .toc-title::after { display: none; }
.toc-container.collapsed .toc-list { display: none; }
.toc-list { list-style: none; padding: 0; margin: 0; font-size: .92rem; }
.toc-list ol { list-style: none; padding-left: 14px; margin: 4px 0; }
.toc-list a {
	display: block; padding: 6px 10px; color: var(--c-muted); border-radius: 6px;
	line-height: 1.4; border-left: 2px solid transparent; transition: all var(--transition);
}
.toc-list a:hover { background: var(--c-bg); color: var(--c-text); opacity: 1; }
.toc-list a.active { color: var(--c-accent); background: color-mix(in srgb, var(--c-accent) 10%, transparent); border-left-color: var(--c-accent); font-weight: 600; }

/* TOC in sidebar (sticky) */
.widget-toc { position: sticky; top: 100px; }

/* ==========================================================================
   15. Code & Syntax Highlight
   ========================================================================== */
:not(pre) > code, .entry-content :not(pre) > code {
	background: var(--c-surface); color: var(--c-accent);
	padding: .15em .45em; border-radius: 5px; font-size: .9em;
	border: 1px solid var(--c-border);
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
}

pre {
	background: var(--c-code-bg); color: var(--c-code-fg);
	padding: 0; margin: 1.5em 0;
	border-radius: var(--radius); overflow: hidden;
	position: relative;
	font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
	font-size: .9em; line-height: 1.6;
}
pre code { display: block; padding: 18px 20px; overflow-x: auto; background: transparent; color: inherit; border: 0; }

.code-header {
	display: flex; justify-content: space-between; align-items: center;
	padding: 8px 14px; background: color-mix(in srgb, var(--c-code-bg) 80%, #fff 5%);
	color: rgba(255,255,255,.7); font-size: .75rem; font-family: ui-monospace, monospace;
	border-bottom: 1px solid rgba(255,255,255,.08);
}
.code-lang { text-transform: uppercase; letter-spacing: .08em; font-weight: 700; }
.code-copy {
	background: transparent; color: rgba(255,255,255,.7); border: 1px solid rgba(255,255,255,.15);
	padding: 4px 10px; border-radius: 5px; font-size: .75rem; cursor: pointer;
	transition: all var(--transition);
}
.code-copy:hover { background: rgba(255,255,255,.1); color: #fff; }
.code-copy.is-copied { background: #16a34a; border-color: #16a34a; color: #fff; }

pre.line-numbers code { display: grid; }
pre code .line { display: block; padding-left: 3.5em; position: relative; }
pre code .line::before {
	content: attr(data-line); position: absolute; left: 0; width: 2.5em;
	text-align: right; color: rgba(255,255,255,.3); user-select: none;
}

/* Prism token colors (a small palette) */
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #94a3b8; font-style: italic; }
.token.punctuation { color: #cbd5e1; }
.token.tag, .token.boolean, .token.number, .token.constant, .token.symbol, .token.deleted { color: #fb7185; }
.token.selector, .token.attr-name, .token.string, .token.char, .token.builtin, .token.inserted { color: #86efac; }
.token.operator, .token.entity, .token.url, .token.variable { color: #fcd34d; }
.token.atrule, .token.attr-value, .token.function, .token.class-name { color: #93c5fd; }
.token.keyword { color: #c4b5fd; }
.token.regex, .token.important { color: #fbbf24; }
.token.important, .token.bold { font-weight: bold; }
.token.italic { font-style: italic; }

/* ==========================================================================
   16. Share Buttons
   ========================================================================== */
.share-buttons {
	display: flex; align-items: center; flex-wrap: wrap; gap: 14px;
	padding: 22px 24px; margin: 36px 0 0;
	background: var(--c-surface); border-radius: var(--radius-lg);
}
.share-label { font-weight: 600; color: var(--c-muted); font-size: .9rem; }
.share-list { display: flex; gap: 8px; flex-wrap: wrap; }
.share-btn {
	display: inline-flex; align-items: center; justify-content: center;
	width: 38px; height: 38px; border-radius: 999px;
	background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-border);
	cursor: pointer; transition: all var(--transition);
}
.share-btn:hover { transform: translateY(-2px); opacity: 1; }
.share-fb:hover { background: #1877f2; color: #fff; border-color: #1877f2; }
.share-tw:hover { background: #0f1419; color: #fff; border-color: #0f1419; }
.share-li:hover { background: #0a66c2; color: #fff; border-color: #0a66c2; }
.share-wa:hover { background: #25d366; color: #fff; border-color: #25d366; }
.share-tg:hover { background: #229ed9; color: #fff; border-color: #229ed9; }
.share-copy { position: relative; }
.share-copy.is-copied { background: #16a34a; color: #fff; border-color: #16a34a; }
.share-copy.is-copied::after {
	content: attr(data-tip); position: absolute; bottom: calc(100% + 6px); left: 50%;
	transform: translateX(-50%); background: var(--c-text); color: var(--c-bg);
	padding: 4px 10px; border-radius: 4px; font-size: .75rem; white-space: nowrap;
}

/* ==========================================================================
   17. Author Bio
   ========================================================================== */
.author-bio {
	display: grid; grid-template-columns: 96px 1fr; gap: 22px; align-items: start;
	padding: 28px; margin: 36px 0 0;
	background: var(--c-surface); border-radius: var(--radius-lg); border: 1px solid var(--c-border);
}
@media (max-width: 540px) { .author-bio { grid-template-columns: 1fr; text-align: center; } .author-bio .author-avatar img { margin: 0 auto; } }
.author-avatar img { width: 96px; height: 96px; border-radius: 999px; object-fit: cover; }
.author-eyebrow { display: block; font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); margin-bottom: 4px; font-weight: 600; }
.author-name { margin: 0 0 8px; font-size: 1.25rem; }
.author-name a { color: var(--c-text); }
.author-name a:hover { color: var(--c-accent); opacity: 1; }
.author-desc { margin: 0 0 14px; color: var(--c-muted); }
.author-link { display: inline-flex; align-items: center; gap: 4px; font-weight: 600; font-size: .9rem; }

/* ==========================================================================
   18. Related Posts
   ========================================================================== */
.related-posts { margin: 56px 0 0; padding-top: 36px; border-top: 1px solid var(--c-border); }
.related-grid { display: grid; gap: 24px; }
.related-cols-1, .related-cols-2 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .related-cols-2 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 700px) { .related-cols-3, .related-cols-4, .related-cols-5, .related-cols-6 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .related-cols-3 { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .related-cols-4, .related-cols-5, .related-cols-6 { grid-template-columns: repeat(3, 1fr); } }
.related-card {
	background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius);
	overflow: hidden; transition: all var(--transition);
}
.related-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.rel-thumb { display: block; aspect-ratio: 16/10; overflow: hidden; }
.rel-thumb img { width: 100%; height: 100%; object-fit: cover; }
.rel-body { padding: 16px 18px 18px; }
.rel-cat { display: inline-block; font-size: .7rem; font-weight: 700; color: var(--c-accent); text-transform: uppercase; letter-spacing: .08em; margin-bottom: 8px; }
.rel-title { margin: 0 0 8px; font-size: 1.05rem; line-height: 1.35; }
.rel-title a { color: var(--c-text); }
.rel-title a:hover { color: var(--c-accent); opacity: 1; }
.rel-meta { font-size: .8rem; color: var(--c-muted); display: flex; gap: 6px; }
.rel-meta .dot { opacity: .5; }

/* ==========================================================================
   19. Post Navigation
   ========================================================================== */
.post-navigation { margin: 48px 0 0; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr; gap: 16px; padding: 0; list-style: none; justify-content: stretch; }
@media (min-width: 700px) { .post-navigation .nav-links { grid-template-columns: 1fr 1fr; } }
.post-navigation a {
	display: flex; flex-direction: column; gap: 4px; padding: 18px 22px;
	background: var(--c-surface); border-radius: var(--radius); color: var(--c-text);
	transition: all var(--transition);
}
.post-navigation a:hover { background: var(--c-accent); color: var(--c-bg); opacity: 1; }
.post-navigation .nav-next a { text-align: right; }
.nav-direction { font-size: .75rem; text-transform: uppercase; letter-spacing: .08em; color: var(--c-muted); font-weight: 600; }
.post-navigation a:hover .nav-direction { color: inherit; opacity: .8; }
.nav-title { font-weight: 600; }

/* ==========================================================================
   20. Comments
   ========================================================================== */
.comments-area { margin: 56px 0 0; padding-top: 36px; border-top: 1px solid var(--c-border); }
.comments-title { margin: 0 0 24px; }
.comment-list { list-style: none; padding: 0; margin: 0; }
.comment-list .children { list-style: none; padding-left: 24px; margin: 0; border-left: 2px solid var(--c-border); }
.comment-body { display: grid; grid-template-columns: 48px 1fr; gap: 14px; padding: 18px 0; border-bottom: 1px solid var(--c-border); }
.comment-author img { border-radius: 999px; }
.comment-meta { font-size: .85rem; color: var(--c-muted); margin-bottom: 6px; }
.comment-meta .fn { font-weight: 700; color: var(--c-text); }
.comment-content { font-size: .95rem; }
.comment-reply-link { font-size: .8rem; font-weight: 600; color: var(--c-accent); }
.comment-form { margin-top: 28px; }
.comment-form label { display: block; font-weight: 600; font-size: .85rem; margin-bottom: 6px; }
.comment-form-comment, .comment-form-author, .comment-form-email, .comment-form-url { margin-bottom: 14px; }
.comment-form .form-submit { margin: 0; }

/* ==========================================================================
   21. Sidebar / Widgets
   ========================================================================== */
.widget-area { display: flex; flex-direction: column; gap: 28px; }
.widget {
	background: var(--c-surface); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
	padding: 22px;
}
.widget-title { margin: 0 0 14px; font-size: 1rem; font-weight: 700; padding-bottom: 12px; border-bottom: 1px solid var(--c-border); display: flex; align-items: center; gap: 8px; }
.widget-title::before { content: ""; width: 4px; height: 16px; background: var(--c-accent); border-radius: 4px; }
.widget ul { list-style: none; padding: 0; margin: 0; }
.widget li { padding: 8px 0; border-bottom: 1px solid var(--c-border); font-size: .92rem; }
.widget li:last-child { border-bottom: 0; }
.widget a { color: var(--c-text); }
.widget a:hover { color: var(--c-accent); opacity: 1; }

/* ==========================================================================
   22. Footer
   ========================================================================== */
.before-footer { padding: 32px 0; background: var(--c-surface); border-top: 1px solid var(--c-border); }
.site-footer { background: var(--c-surface); border-top: 1px solid var(--c-border); margin-top: 56px; }
.footer-widgets { padding: 56px 0 32px; }
.footer-widgets-grid { display: grid; gap: 28px; }
.footer-widgets-grid.cols-1 { grid-template-columns: 1fr; }
@media (min-width: 700px) { .footer-widgets-grid.cols-2 { grid-template-columns: repeat(2, 1fr); } .footer-widgets-grid.cols-3, .footer-widgets-grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .footer-widgets-grid.cols-3 { grid-template-columns: repeat(3, 1fr); } .footer-widgets-grid.cols-4 { grid-template-columns: repeat(4, 1fr); } }
.footer-widget-area .widget { background: transparent; border: 0; padding: 0; }

.footer-bottom { padding: 24px 0; border-top: 1px solid var(--c-border); }
.footer-bottom-inner {
	display: flex; flex-direction: column; gap: 18px;
	font-size: .9rem; color: var(--c-muted);
}

/* Top row: footer menu + social icons */
.footer-top-row {
	display: flex; flex-wrap: wrap; gap: 18px;
	align-items: center; justify-content: space-between;
}
.footer-top-row:only-child { /* if no copyright shown */ }

/* Bottom row: copyright — separated by subtle divider */
.site-info {
	width: 100%;
	padding-top: 18px;
	border-top: 1px solid color-mix(in srgb, var(--c-border) 70%, transparent);
	text-align: center;
}
.footer-top-row + .site-info { margin-top: 0; }
/* When there's no top row, drop the divider */
.footer-bottom-inner > .site-info:only-child {
	padding-top: 0; border-top: 0; text-align: left;
}

.site-info a { color: var(--c-accent); }
.footer-navigation ul { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 18px; }
.footer-navigation a { color: var(--c-muted); font-weight: 500; }
.footer-navigation a:hover { color: var(--c-accent); opacity: 1; }

/* Centre menu items on mobile for a tidier feel */
@media (max-width: 700px) {
	.footer-top-row { flex-direction: column; gap: 14px; }
	.footer-navigation ul { justify-content: center; }
}

.social-icons { display: flex; gap: 8px; flex-wrap: wrap; }
.social-icon {
	display: inline-flex; align-items: center; justify-content: center;
	width: 34px; height: 34px; border-radius: 999px;
	background: var(--c-bg); color: var(--c-text); border: 1px solid var(--c-border);
	transition: all var(--transition);
}
.social-icon:hover { transform: translateY(-2px); background: var(--c-accent); color: var(--c-bg); border-color: var(--c-accent); opacity: 1; }

/* ==========================================================================
   23. Back-to-top
   ========================================================================== */
.back-to-top {
	position: fixed; bottom: 24px; right: 24px; z-index: 60;
	width: 44px; height: 44px; box-shadow: var(--shadow-md);
	opacity: 0; transform: translateY(20px) scale(.9); pointer-events: none;
	transition: all 300ms cubic-bezier(.4, 0, .2, 1);
}
.back-to-top.is-visible { opacity: 1; transform: none; pointer-events: auto; }

/* ==========================================================================
   24. Cookie banner
   ========================================================================== */
.cookie-banner {
	position: fixed; bottom: 16px; left: 16px; right: 16px; z-index: 200;
	background: var(--c-bg); border: 1px solid var(--c-border); border-radius: var(--radius-lg);
	box-shadow: var(--shadow-lg); padding: 16px 8px;
	max-width: 720px; margin: 0 auto;
	animation: cookie-up 400ms cubic-bezier(.4,0,.2,1);
}
.cookie-inner { display: flex; gap: 16px; flex-wrap: wrap; align-items: center; justify-content: space-between; }
.cookie-msg { margin: 0; font-size: .9rem; flex: 1; min-width: 200px; }
.cookie-actions { display: flex; gap: 8px; flex-shrink: 0; }
.cookie-actions .btn { padding: 8px 18px; font-size: .85rem; }
@keyframes cookie-up { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: none; } }

/* ==========================================================================
   25. 404
   ========================================================================== */
.is-404 .site-main-wrap { grid-template-columns: 1fr !important; max-width: 720px; }
.error-404 { text-align: center; padding: 60px 0; }
.error-illustration { color: var(--c-muted); margin: 0 auto 24px; opacity: .8; }
.error-code { font-size: clamp(4rem, 3rem + 4vw, 6rem); margin: 0; font-weight: 800; line-height: 1; color: var(--c-accent); }
.error-title { margin: 8px 0 12px; }
.error-text { color: var(--c-muted); margin-bottom: 24px; max-width: 480px; margin-inline: auto; }
.error-actions { margin-bottom: 32px; }
.error-search { max-width: 380px; margin: 0 auto; }

/* ==========================================================================
   26. Block Editor / WP-specific
   ========================================================================== */
.alignleft  { float: left;  margin: 0.5em 1.5em 1em 0; }
.alignright { float: right; margin: 0.5em 0 1em 1.5em; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.alignwide  { max-width: calc(var(--container) - 80px); margin-left: auto; margin-right: auto; }
.alignfull  { width: 100vw; margin-left: calc(50% - 50vw); margin-right: calc(50% - 50vw); border-radius: 0 !important; }
.wp-block-image { margin: 1.5em 0; }
.wp-block-pullquote { font-size: 1.3rem; }
.wp-caption-text { color: var(--c-muted); font-size: .85rem; text-align: center; }

/* ==========================================================================
   27. Print
   ========================================================================== */
@media print {
	.site-header, .breadcrumbs, .site-footer, .reading-progress, .back-to-top,
	.share-buttons, .related-posts, .post-navigation, .cookie-banner, .toc-container,
	#secondary, .ad-slot, .ad-in-content, .ad-after-content, .anchor-ad, .vignette-ad { display: none !important; }
	body { background: #fff; color: #000; }
	.entry-content a { color: #000; text-decoration: underline; }
}

/* ==========================================================================
   28. Utility / focus rings (a11y)
   ========================================================================== */
:focus-visible { outline: 3px solid color-mix(in srgb, var(--c-accent) 50%, transparent); outline-offset: 2px; border-radius: 4px; }

/* Dark-mode small refinements */
[data-theme="dark"] .site-header { background: color-mix(in srgb, var(--c-bg) 90%, transparent); }
[data-theme="dark"] .post-card, [data-theme="dark"] .related-card { background: var(--c-surface); }
[data-theme="dark"] .pick-item, [data-theme="dark"] .pick-main { background: var(--c-surface); }
[data-theme="dark"] .widget { background: color-mix(in srgb, var(--c-surface) 80%, var(--c-bg)); }
[data-theme="dark"] :not(pre) > code { background: color-mix(in srgb, var(--c-accent) 14%, var(--c-bg)); color: var(--c-accent); }
