/*
Theme Name: GyaanHub
Theme URI: https://gyaan-hub.com
Author: GyaanHub
Description: Custom editorial theme for GyaanHub — fast, accessible, light/dark aware.
Version: 1.1.0
Requires at least: 6.4
Tested up to: 7.1
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: gyaanhub
*/

/* =========================================================================
   1. Tokens
   ========================================================================= */
:root {
	/* Colour */
	--brand: #e23744;
	--brand-ink: #b51f2c;
	--brand-soft: #fdecee;
	--ink: #0e1116;
	--ink-2: #2b313b;
	--muted: #5f6774;
	--line: #e7e8ec;
	--line-strong: #d5d8de;
	--bg: #fbfbfa;
	--surface: #ffffff;
	--surface-2: #f3f3f1;
	--shadow: 0 1px 2px rgb(16 24 40 / .04), 0 8px 24px -12px rgb(16 24 40 / .12);
	--shadow-lg: 0 24px 60px -24px rgb(16 24 40 / .28);

	/* Type */
	--font: "Inter", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans", sans-serif;
	--mono: ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;
	--fs-xs: .75rem;      /* 12 */
	--fs-sm: .8125rem;    /* 13 */
	--fs-md: .9375rem;    /* 15 */
	--fs-base: 1rem;      /* 16 */
	--fs-prose: 1.0625rem;/* 17 on phones, 18 from tablet */

	/* Space scale (4px base) */
	--s-1: 4px;
	--s-2: 8px;
	--s-3: 12px;
	--s-4: 16px;
	--s-5: 20px;
	--s-6: 24px;
	--s-7: 32px;
	--s-8: 40px;
	--s-9: 48px;
	--s-10: 64px;
	--section: clamp(48px, 7vw, 88px);

	/* Shape & layout */
	--radius-sm: 10px;
	--radius: 14px;
	--radius-lg: 20px;
	--container: 1200px;
	--measure: 720px;
	--gutter: clamp(20px, 4vw, 32px);
	--header-h: 64px;
	--sidebar: 320px;
	--ease: cubic-bezier(.2, .7, .2, 1);
	color-scheme: light;
}

@media (min-width: 768px) {
	:root {
		--fs-prose: 1.125rem;
		--radius: 16px;
		--radius-lg: 24px;
		--header-h: 68px;
	}
}

@media (prefers-color-scheme: dark) {
	:root:not([data-theme="light"]) {
		--brand: #ff5c69;
		--brand-ink: #ff8790;
		--brand-soft: #3a1418;
		--ink: #eef0f3;
		--ink-2: #c9ced6;
		--muted: #9aa2b1;
		--line: #232833;
		--line-strong: #303644;
		--bg: #0b0e13;
		--surface: #12161d;
		--surface-2: #181d26;
		--shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
		--shadow-lg: 0 24px 60px -24px rgb(0 0 0 / .8);
		color-scheme: dark;
	}
}

:root[data-theme="dark"] {
	--brand: #ff5c69;
	--brand-ink: #ff8790;
	--brand-soft: #3a1418;
	--ink: #eef0f3;
	--ink-2: #c9ced6;
	--muted: #9aa2b1;
	--line: #232833;
	--line-strong: #303644;
	--bg: #0b0e13;
	--surface: #12161d;
	--surface-2: #181d26;
	--shadow: 0 1px 2px rgb(0 0 0 / .4), 0 8px 24px -12px rgb(0 0 0 / .6);
	--shadow-lg: 0 24px 60px -24px rgb(0 0 0 / .8);
	color-scheme: dark;
}

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

html {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-behavior: smooth;
	scroll-padding-top: calc(var(--header-h) + var(--s-4));
}

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--font);
	font-size: var(--fs-base);
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	font-feature-settings: "cv11", "ss01";
	overflow-x: hidden;
}

body.no-scroll { overflow: hidden; }

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

a { color: inherit; text-decoration: none; }
a:hover { color: var(--brand); }

h1, h2, h3, h4, h5, h6 {
	margin: 0 0 .5em;
	line-height: 1.2;
	letter-spacing: -0.02em;
	font-weight: 750;
	text-wrap: balance;
}

p { margin: 0 0 1em; }

:focus-visible {
	outline: 2px solid var(--brand);
	outline-offset: 3px;
	border-radius: 4px;
}

::selection { background: var(--brand); color: #fff; }

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

.icon { flex: none; }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	padding: 0; margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.skip-link:focus {
	clip: auto; width: auto; height: auto;
	top: var(--s-3); left: var(--s-3); z-index: 1000;
	padding: var(--s-3) var(--s-4);
	background: var(--ink); color: var(--bg);
	border-radius: var(--radius-sm);
}

.container {
	width: 100%;
	max-width: calc(var(--container) + 2 * var(--gutter));
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.container--narrow { max-width: calc(var(--measure) + 2 * var(--gutter)); }

/* =========================================================================
   3. Shared UI
   ========================================================================= */
.chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 3px 10px;
	border-radius: 999px;
	background: var(--brand-soft);
	color: var(--brand-ink);
	font-size: var(--fs-xs);
	font-weight: 650;
	letter-spacing: .01em;
	line-height: 1.5;
	white-space: nowrap;
	transition: background .2s var(--ease), color .2s var(--ease);
}
.chip:hover { background: var(--brand); color: #fff; }

.chip--lg {
	min-height: 38px;
	padding: 6px 14px;
	font-size: .875rem;
	background: var(--surface);
	color: var(--ink-2);
	border: 1px solid var(--line);
}
.chip--lg span { color: var(--muted); font-weight: 500; font-size: .8em; }
.chip--lg:hover { border-color: var(--brand); background: var(--brand); color: #fff; }
.chip--lg:hover span { color: rgb(255 255 255 / .8); }

.eyebrow {
	margin: 0 0 var(--s-2);
	font-size: var(--fs-xs);
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--brand);
	line-height: 1.4;
}

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--s-2);
	min-height: 48px;
	padding: 10px 22px;
	border: 0;
	border-radius: 999px;
	background: var(--brand);
	color: #fff;
	font-weight: 650;
	line-height: 1.2;
	white-space: nowrap;
	cursor: pointer;
	transition: transform .15s var(--ease), background .2s var(--ease), box-shadow .2s var(--ease);
	box-shadow: 0 6px 20px -8px color-mix(in srgb, var(--brand) 70%, transparent);
}
.btn:hover { background: var(--brand-ink); color: #fff; transform: translateY(-1px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }

.btn--ghost {
	background: transparent;
	color: var(--ink);
	border: 1px solid var(--line-strong);
	box-shadow: none;
}
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }

.icon-btn {
	display: inline-grid;
	place-items: center;
	width: 44px;
	height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ink-2);
	cursor: pointer;
	transition: background .2s var(--ease), color .2s var(--ease);
}
.icon-btn:hover { background: var(--surface-2); color: var(--ink); }

.link-arrow {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	min-height: 44px;
	font-size: .9rem;
	font-weight: 650;
	color: var(--ink-2);
	white-space: nowrap;
}
.link-arrow .icon { transition: transform .2s var(--ease); }
.link-arrow:hover .icon { transform: translateX(3px); }

.post-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--s-1) var(--s-2);
	font-size: var(--fs-sm);
	line-height: 1.4;
	color: var(--muted);
}
/* Separator dot trails each item, so a wrapped line never starts with one */
.post-meta > :not(:last-child)::after {
	content: "";
	display: inline-block;
	width: 3px;
	height: 3px;
	margin-left: var(--s-2);
	border-radius: 50%;
	background: currentColor;
	opacity: .5;
	vertical-align: middle;
}
.post-meta__author { display: inline-flex; align-items: center; gap: var(--s-2); font-weight: 600; color: var(--ink-2); }

.avatar { border-radius: 999px; flex: none; }
.avatar--initial {
	display: inline-grid;
	place-items: center;
	width: var(--size, 28px);
	height: var(--size, 28px);
	background: var(--ink);
	color: var(--bg);
	font-size: calc(var(--size, 28px) * .45);
	font-weight: 750;
	line-height: 1;
}

/* Search form */
.search-form { position: relative; display: flex; align-items: center; }
.search-form__input {
	width: 100%;
	height: 48px;
	padding: 0 52px 0 var(--s-5);
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: var(--surface);
	font-size: var(--fs-base);
	transition: border-color .2s, box-shadow .2s;
	-webkit-appearance: none;
	appearance: none;
}
.search-form__input::-webkit-search-cancel-button { display: none; }
.search-form__input:focus {
	outline: none;
	border-color: var(--brand);
	box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent);
}
.search-form__btn {
	position: absolute;
	right: 5px;
	display: grid;
	place-items: center;
	width: 38px;
	height: 38px;
	border: 0;
	border-radius: 999px;
	background: var(--brand);
	color: #fff;
	cursor: pointer;
}

/* =========================================================================
   4. Header
   ========================================================================= */
.progress {
	position: fixed;
	inset: 0 0 auto;
	z-index: 60;
	height: 3px;
	pointer-events: none;
}
.progress__bar {
	display: block;
	height: 100%;
	background: linear-gradient(90deg, var(--brand), #ff9a3c);
	transform: scaleX(0);
	transform-origin: 0 50%;
}

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: color-mix(in srgb, var(--bg) 85%, transparent);
	-webkit-backdrop-filter: saturate(180%) blur(14px);
	backdrop-filter: saturate(180%) blur(14px);
	border-bottom: 1px solid transparent;
	transition: border-color .2s;
}
.site-header.is-scrolled { border-bottom-color: var(--line); }

.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 0; } }

.site-header__inner {
	display: flex;
	align-items: center;
	gap: var(--s-6);
	height: var(--header-h);
}

.brand { display: flex; align-items: center; gap: var(--s-3); min-width: 0; }
.brand .custom-logo-link { display: block; flex: none; }
.brand .custom-logo { width: 36px; height: 36px; object-fit: contain; }
.brand__name {
	margin: 0;
	font-size: 1.25rem;
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 1;
	white-space: nowrap;
}
.brand__name a:hover { color: var(--ink); }

@media (min-width: 768px) {
	.brand .custom-logo { width: 40px; height: 40px; }
	.brand__name { font-size: 1.35rem; }
}

.primary-nav { flex: 1; min-width: 0; }
.primary-nav .menu {
	display: flex;
	align-items: center;
	gap: 2px;
	margin: 0;
	padding: 0;
	list-style: none;
}
.primary-nav .menu > li { position: relative; }
.primary-nav .menu > li > a {
	display: flex;
	align-items: center;
	gap: 6px;
	height: 40px;
	padding: 0 12px;
	border-radius: 999px;
	font-size: .9rem;
	font-weight: 550;
	color: var(--ink-2);
	white-space: nowrap;
	transition: background .2s, color .2s;
}
.primary-nav .menu > li > a:hover,
.primary-nav .menu > li:focus-within > a { background: var(--surface-2); color: var(--ink); }
.primary-nav .current-menu-item > a,
.primary-nav .current-menu-ancestor > a,
.primary-nav .current-menu-parent > a { color: var(--brand) !important; }

.primary-nav .menu-item-has-children > a::after {
	content: "";
	width: 6px;
	height: 6px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	opacity: .6;
}

.primary-nav .sub-menu {
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	min-width: 240px;
	margin: 0;
	padding: var(--s-2);
	list-style: none;
	background: var(--surface);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .18s var(--ease), transform .18s var(--ease), visibility .18s;
}
.primary-nav .sub-menu::before { content: ""; position: absolute; inset: -12px 0 auto; height: 12px; }
.primary-nav li:hover > .sub-menu,
.primary-nav li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.primary-nav .sub-menu a {
	display: block;
	padding: 10px 12px;
	border-radius: var(--radius-sm);
	font-size: .9rem;
	line-height: 1.3;
	color: var(--ink-2);
}
.primary-nav .sub-menu a:hover { background: var(--surface-2); color: var(--brand); }

.header-actions { display: flex; align-items: center; gap: 0; margin-left: auto; margin-right: -10px; }

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

.menu-toggle { display: none; }

@media (max-width: 1100px) {
	.primary-nav { display: none; }
	.menu-toggle { display: inline-grid; }
}

.header-ad { padding-block: var(--s-4); text-align: center; }

/* Drawer */
.drawer { position: fixed; inset: 0; z-index: 100; }
.drawer__backdrop {
	position: absolute;
	inset: 0;
	background: rgb(5 8 12 / .5);
	opacity: 0;
	transition: opacity .25s var(--ease);
}
.drawer__panel {
	position: absolute;
	inset: 0 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: var(--s-5);
	width: min(380px, 88vw);
	padding: var(--s-3) var(--s-5) var(--s-7);
	overflow-y: auto;
	overscroll-behavior: contain;
	background: var(--surface);
	box-shadow: var(--shadow-lg);
	transform: translateX(100%);
	transition: transform .25s var(--ease);
}
.drawer__panel:focus { outline: none; }
.drawer.is-open .drawer__backdrop { opacity: 1; }
.drawer.is-open .drawer__panel { transform: none; }
.drawer__head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	min-height: 52px;
	margin-right: -10px;
}
.drawer__head .brand__name { font-size: 1.25rem; }
.drawer__menu, .drawer__menu .sub-menu { margin: 0; padding: 0; list-style: none; }
.drawer__menu > li { border-bottom: 1px solid var(--line); }
.drawer__menu a { display: flex; align-items: center; min-height: 52px; font-weight: 600; font-size: 1.0625rem; }
.drawer__menu .current-menu-item > a { color: var(--brand); }
.drawer__menu .sub-menu { padding: 0 0 var(--s-3) var(--s-4); margin-top: -6px; }
.drawer__menu .sub-menu a { min-height: 40px; font-weight: 500; font-size: var(--fs-md); color: var(--muted); }
.drawer .social-links { margin-top: auto; padding-top: var(--s-4); }

/* Search dialog */
.search-dialog {
	width: min(640px, calc(100vw - 2 * var(--gutter)));
	max-width: none;
	margin: 12vh auto auto;
	padding: 0;
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--surface);
	color: var(--ink);
	box-shadow: var(--shadow-lg);
}
.search-dialog::backdrop {
	background: rgb(5 8 12 / .45);
	-webkit-backdrop-filter: blur(6px);
	backdrop-filter: blur(6px);
}
.search-dialog[open] { animation: pop .2s var(--ease); }
.search-dialog__form {
	display: flex;
	align-items: center;
	gap: var(--s-3);
	padding: var(--s-4) var(--s-5);
	border-bottom: 1px solid var(--line);
	color: var(--muted);
}
.search-dialog__form input {
	flex: 1;
	min-width: 0;
	height: 40px;
	border: 0;
	background: transparent;
	font-size: 1.125rem;
	color: var(--ink);
	outline: none;
	-webkit-appearance: none;
	appearance: none;
}
.search-dialog kbd {
	padding: 2px 8px;
	border: 1px solid var(--line);
	border-radius: 6px;
	font: 600 .7rem var(--font);
	color: var(--muted);
}
@media (hover: none) { .search-dialog kbd { display: none; } }
.search-dialog__topics { display: flex; flex-wrap: wrap; gap: var(--s-2); padding: var(--s-4) var(--s-5) var(--s-5); }
.search-dialog__topics p { width: 100%; margin: 0 0 var(--s-1); font-size: var(--fs-xs); font-weight: 650; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* =========================================================================
   5. Cards & grids
   ========================================================================= */
.grid { display: grid; column-gap: clamp(20px, 2.6vw, 32px); row-gap: clamp(32px, 4vw, 44px); }
.grid--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid--3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid--4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 1024px) {
	.grid--3, .grid--4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	.grid--2, .grid--3, .grid--4 { grid-template-columns: minmax(0, 1fr); }

	/* Swipeable rows (homepage category spotlights) */
	.grid--scroll {
		grid-auto-flow: column;
		grid-template-columns: none;
		grid-auto-columns: 78%;
		column-gap: var(--s-4);
		overflow-x: auto;
		overscroll-behavior-x: contain;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: var(--gutter);
		margin-inline: calc(var(--gutter) * -1);
		padding-inline: var(--gutter);
		padding-bottom: var(--s-1);
		scrollbar-width: none;
	}
	.grid--scroll::-webkit-scrollbar { display: none; }
	.grid--scroll > * { scroll-snap-align: start; }
	.grid--scroll::after { content: ""; width: 1px; } /* keeps end padding in all browsers */

	/* First story as a card, the rest as a compact list */
	.grid--list-mobile { row-gap: 0; }
	.grid--list-mobile > .card:first-child { padding-bottom: var(--s-6); }
	.grid--list-mobile > .card:not(:first-child) {
		display: grid;
		grid-template-columns: 112px minmax(0, 1fr);
		gap: var(--s-4);
		align-items: start;
		padding-block: var(--s-4);
		border-top: 1px solid var(--line);
	}
	.grid--list-mobile > .card:not(:first-child) .card__media { border-radius: var(--radius-sm); }
	.grid--list-mobile > .card:not(:first-child) .card__body { padding-top: 0; gap: 6px; }
	.grid--list-mobile > .card:not(:first-child) .card__title { font-size: var(--fs-md); }
	.grid--list-mobile > .card:not(:first-child) .card__excerpt,
	.grid--list-mobile > .card:not(:first-child) .chip { display: none; }
}

.card { position: relative; display: flex; flex-direction: column; min-width: 0; }

.card__media {
	position: relative;
	display: block;
	overflow: hidden;
	aspect-ratio: 1200 / 630;
	border-radius: var(--radius);
	background: var(--surface-2);
	isolation: isolate;
}
.card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
	box-shadow: inset 0 0 0 1px rgb(0 0 0 / .06);
	pointer-events: none;
}
.card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform .5s var(--ease);
}
.card:hover .card__media img { transform: scale(1.035); }

.thumb-fallback {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	background: linear-gradient(135deg, var(--brand), #ff9a3c);
	color: #fff;
	font-size: 2.5rem;
	font-weight: 800;
}

.card__body { display: flex; flex-direction: column; align-items: flex-start; gap: var(--s-2); padding-top: var(--s-4); }
.card__body > .chip { margin-bottom: 2px; }
.card__title {
	margin: 0;
	font-size: 1.0625rem;
	line-height: 1.38;
	font-weight: 700;
	letter-spacing: -0.015em;
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
@media (min-width: 768px) { .card__title { font-size: 1.125rem; } }
.card__title a { background: linear-gradient(currentColor, currentColor) 0 100% / 0 1.5px no-repeat; transition: background-size .3s var(--ease), color .2s; }
.card:hover .card__title a { background-size: 100% 1.5px; color: var(--ink); }
.card__excerpt {
	margin: 0;
	color: var(--muted);
	font-size: var(--fs-md);
	line-height: 1.55;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.card__body > .post-meta { margin-top: 2px; }

/* Compact */
.card--compact {
	display: grid;
	grid-template-columns: 112px minmax(0, 1fr);
	gap: var(--s-4);
	align-items: start;
}
.card--compact .card__media { border-radius: var(--radius-sm); }
.card--compact .card__body { padding-top: 0; gap: 6px; }
.card--compact .card__body > .chip { margin-bottom: 0; }
.card--compact .card__title { font-size: var(--fs-md); line-height: 1.35; -webkit-line-clamp: 3; }
.card--compact .chip { padding: 1px 8px; font-size: .6875rem; }
@media (min-width: 768px) { .card--compact { grid-template-columns: 128px minmax(0, 1fr); } }

/* Lead */
.card--lead .card__media { border-radius: var(--radius-lg); }
.card--lead .card__body { gap: var(--s-3); padding-top: var(--s-5); }
.card--lead .card__title {
	font-size: clamp(1.625rem, 1.15rem + 2vw, 2.5rem);
	line-height: 1.12;
	letter-spacing: -0.03em;
	font-weight: 800;
	display: block;
	-webkit-line-clamp: unset;
	overflow: visible;
}
.card--lead .card__excerpt { font-size: clamp(1rem, .95rem + .3vw, 1.0625rem); -webkit-line-clamp: 3; max-width: 62ch; }
@media (max-width: 374px) {
	/* Keep the lead byline on one line on the smallest phones */
	.card--lead .post-meta > :last-child { display: none; }
	.card--lead .post-meta > :nth-last-child(2)::after { display: none; }
}

/* =========================================================================
   6. Homepage
   ========================================================================= */
.hero {
	display: grid;
	grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
	gap: clamp(24px, 4vw, 56px);
	padding-top: clamp(16px, 3vw, 40px);
}
.hero__list { display: flex; flex-direction: column; }
.hero__list .eyebrow { margin-bottom: var(--s-4); }
.hero__list .card--compact { padding-block: var(--s-4); border-top: 1px solid var(--line); }
.hero__list .eyebrow + .card--compact { padding-top: 0; border-top: 0; }

@media (max-width: 900px) {
	.hero { grid-template-columns: minmax(0, 1fr); gap: var(--s-8); }
	.hero__list { padding-top: var(--s-6); border-top: 1px solid var(--line); }
}
@media (min-width: 641px) and (max-width: 900px) {
	.hero__list { display: grid; grid-template-columns: 1fr 1fr; column-gap: var(--s-7); }
	.hero__list .eyebrow { grid-column: 1 / -1; }
	.hero__list .card--compact:nth-of-type(2) { padding-top: 0; border-top: 0; }
}

.topics {
	display: flex;
	align-items: center;
	gap: var(--s-4);
	margin-top: clamp(40px, 5vw, 56px);
	padding-block: var(--s-4);
	border-block: 1px solid var(--line);
}
.topics__label { flex: none; font-size: var(--fs-xs); font-weight: 700; color: var(--muted); text-transform: uppercase; letter-spacing: .12em; }
.topics__list {
	display: flex;
	gap: var(--s-2);
	min-width: 0;
	margin: 0;
	padding: 0;
	list-style: none;
	overflow-x: auto;
	scrollbar-width: none;
}
.topics__list::-webkit-scrollbar { display: none; }
.topics__list li { flex: none; }
@media (max-width: 640px) {
	.topics__label { display: none; }
	/* Let the chip row run to the screen edge, with a fade hinting it scrolls */
	.topics .topics__list {
		margin-right: calc(var(--gutter) * -1);
		padding-right: var(--gutter);
		-webkit-mask-image: linear-gradient(90deg, #000 85%, transparent);
		mask-image: linear-gradient(90deg, #000 85%, transparent);
	}
}

.section { margin-top: var(--section); }
.section-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-4);
	margin-bottom: var(--s-6);
}
.section-head .link-arrow { margin-right: -2px; }
.section-title {
	position: relative;
	margin: 0;
	font-size: clamp(1.375rem, 1.1rem + 1.2vw, 1.75rem);
	font-weight: 800;
	letter-spacing: -0.025em;
	line-height: 1.2;
}
.section > .section-title { margin-bottom: var(--s-6); }
.section-head .section-title { padding-left: 14px; }
.section-head .section-title::before {
	content: "";
	position: absolute;
	left: 0;
	top: .18em;
	bottom: .18em;
	width: 4px;
	border-radius: 4px;
	background: var(--brand);
}

/* Ad slots: centred, labelled, and hidden entirely when the ad doesn't fill */
.ad-slot { margin-top: var(--section); text-align: center; }
.ad-slot .widget-title,
.widget_custom_html .widget-title {
	margin-bottom: var(--s-2);
	font-size: .6875rem;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--muted);
	text-align: center;
}
.ad-slot--inline { margin-top: var(--s-7); }
.widget_custom_html:has(ins.adsbygoogle):not(:has(ins.adsbygoogle[data-ad-status="filled"])) .widget-title { visibility: hidden; height: 0; margin: 0; }
.widget_custom_html:has(ins.adsbygoogle[data-ad-status="unfilled"]):not(:has(ins.adsbygoogle[data-ad-status="filled"])) { display: none; }
ins.adsbygoogle[data-ad-status="unfilled"] { display: none !important; }

.tools-band {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr);
	gap: var(--s-7);
	align-items: center;
	padding: clamp(24px, 5vw, 48px);
	overflow: hidden;
	border-radius: var(--radius-lg);
	background:
		radial-gradient(600px 300px at 0% 0%, color-mix(in srgb, var(--brand) 35%, transparent), transparent 70%),
		radial-gradient(500px 280px at 100% 100%, rgb(255 154 60 / .22), transparent 70%),
		#11141a;
	color: #f2f3f5;
}
.tools-band .section-title { color: #fff; }
.tools-band .eyebrow { color: #ff9aa2; }
.tools-band__list { display: grid; gap: var(--s-3); }
.tool-link {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr) auto;
	align-items: center;
	gap: var(--s-4);
	padding: var(--s-4) var(--s-5);
	border: 1px solid rgb(255 255 255 / .1);
	border-radius: var(--radius);
	background: rgb(255 255 255 / .05);
	color: #f2f3f5;
	transition: background .2s, border-color .2s, transform .2s var(--ease);
}
.tool-link:hover { color: #fff; background: rgb(255 255 255 / .1); border-color: rgb(255 255 255 / .22); transform: translateY(-2px); }
.tool-link__text { display: grid; gap: 2px; min-width: 0; }
.tool-link__text strong { font-size: var(--fs-base); line-height: 1.35; }
.tool-link__text span { font-size: .875rem; line-height: 1.45; color: #b9bec8; }
.tool-link__icon {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--brand), #ff9a3c);
	color: #fff;
}
@media (max-width: 800px) {
	.tools-band { grid-template-columns: minmax(0, 1fr); gap: var(--s-5); }
}
@media (max-width: 480px) {
	.tool-link { grid-template-columns: 40px minmax(0, 1fr); gap: var(--s-3); padding: var(--s-4); }
	.tool-link__icon { width: 40px; height: 40px; }
	.tool-link > .icon-arrow { display: none; }
}

.about__card {
	padding: clamp(24px, 5vw, 56px);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--surface);
}
.about__content { max-width: 75ch; margin-top: var(--s-5); font-size: var(--fs-base); }
.about__content.is-collapsed {
	max-height: 240px;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(#000 50%, transparent);
	mask-image: linear-gradient(#000 50%, transparent);
}
.about .btn { margin-top: var(--s-4); }

/* =========================================================================
   7. Listing pages
   ========================================================================= */
.page-hero {
	padding-block: clamp(28px, 6vw, 72px) clamp(28px, 4vw, 44px);
	border-bottom: 1px solid var(--line);
	background:
		radial-gradient(800px 240px at 10% 0%, color-mix(in srgb, var(--brand) 8%, transparent), transparent 70%),
		var(--bg);
}
.page-hero .breadcrumbs { margin-bottom: var(--s-4); }
.page-hero__title {
	margin: 0;
	font-size: clamp(1.875rem, 1.2rem + 3vw, 3.25rem);
	font-weight: 800;
	letter-spacing: -0.035em;
	line-height: 1.1;
}
.page-hero__desc { max-width: 65ch; margin-top: var(--s-3); color: var(--muted); font-size: clamp(1rem, .95rem + .3vw, 1.0625rem); line-height: 1.6; }
.page-hero__desc p:last-child { margin: 0; }
.page-hero__count { margin: var(--s-3) 0 0; font-size: .875rem; color: var(--muted); }
.page-hero .topics__list { margin-top: var(--s-5); flex-wrap: wrap; overflow: visible; }
.page-hero__search { max-width: 520px; margin-top: var(--s-6); }
.page-hero--center { text-align: center; }
.page-hero--center .page-hero__desc, .page-hero--center .page-hero__search { margin-inline: auto; }

.layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--section);
	padding-top: clamp(28px, 5vw, 48px);
}
.has-sidebar .layout { grid-template-columns: minmax(0, 1fr) var(--sidebar); gap: clamp(40px, 4vw, 64px); }
@media (max-width: 1024px) {
	.has-sidebar .layout { grid-template-columns: minmax(0, 1fr); gap: var(--section); }
}

.empty-state {
	padding: var(--s-9) var(--s-6);
	border: 1px dashed var(--line-strong);
	border-radius: var(--radius-lg);
	text-align: center;
}
.empty-state h2 { font-size: 1.5rem; }
.empty-state p { color: var(--muted); }
.empty-state .search-form { max-width: 420px; margin: var(--s-5) auto 0; }

.pagination { margin-top: var(--s-9); }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-width: 44px;
	height: 44px;
	padding: 0 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	background: var(--surface);
	font-weight: 600;
	font-size: .9rem;
}
.pagination .page-numbers.current { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.pagination a.page-numbers:hover { border-color: var(--brand); color: var(--brand); }
.pagination .dots { min-width: 24px; padding: 0; border: 0; background: none; }

/* Breadcrumbs */
.breadcrumbs { margin-bottom: var(--s-4); font-size: var(--fs-sm); line-height: 1.4; color: var(--muted); }
.breadcrumbs ol { display: flex; flex-wrap: wrap; gap: 6px; margin: 0; padding: 0; list-style: none; }
.breadcrumbs li + li::before { content: "/"; margin-right: 6px; color: var(--line-strong); }
.breadcrumbs a:hover { color: var(--brand); }

/* =========================================================================
   8. Sidebar & widgets
   ========================================================================= */
.sidebar { display: flex; flex-direction: column; gap: var(--s-6); min-width: 0; }
@media (min-width: 1025px) {
	.sidebar { position: sticky; top: calc(var(--header-h) + var(--s-6)); align-self: start; }
}
/* When stacked below content: separate it, and use two columns on tablets */
@media (max-width: 1024px) {
	.sidebar { padding-top: var(--s-8); border-top: 1px solid var(--line); }
}
@media (min-width: 641px) and (max-width: 1024px) {
	.sidebar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; gap: var(--s-6); }
	.sidebar .widget_search, .sidebar .widget_custom_html:has(ins) { grid-column: 1 / -1; }
}

.widget { min-width: 0; }
.widget > :last-child { margin-bottom: 0; }
.sidebar .widget:not(.widget_custom_html):not(.widget_search) {
	padding: var(--s-6);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
}
.widget-title {
	margin: 0 0 var(--s-4);
	font-size: var(--fs-xs);
	font-weight: 750;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--muted);
	line-height: 1.4;
}
.widget ul { margin: 0; padding: 0; list-style: none; }
.widget li { padding: var(--s-3) 0; border-bottom: 1px solid var(--line); font-size: var(--fs-md); line-height: 1.45; }
.widget li:first-child { padding-top: 0; }
.widget li:last-child { border-bottom: 0; padding-bottom: 0; }
.widget li a { font-weight: 600; }
.widget .post-date { display: block; margin-top: var(--s-1); font-size: var(--fs-sm); font-weight: 400; color: var(--muted); }
.widget_search .widget-title { display: none; }
.widget img { border-radius: var(--radius-sm); }
.widget_custom_html .custom-html-widget { font-size: var(--fs-md); line-height: 1.6; color: var(--ink-2); }
.widget_custom_html .custom-html-widget img { width: 100%; height: auto; margin-bottom: var(--s-3); }
.widget_custom_html .custom-html-widget > div { margin: 0 0 var(--s-3) !important; }
.widget_custom_html .custom-html-widget a { color: var(--brand-ink) !important; font-weight: 600; }
.widget_text .textwidget > :last-child { margin-bottom: 0; }

.wp-block-search__inside-wrapper { display: flex; gap: var(--s-2); }
.wp-block-search__input { flex: 1; height: 48px; padding: 0 var(--s-4); border: 1px solid var(--line-strong); border-radius: 999px; background: var(--surface); }
.wp-block-search__button { padding: 0 var(--s-5); border: 0; border-radius: 999px; background: var(--brand); color: #fff; font-weight: 600; }

/* =========================================================================
   9. Single post
   ========================================================================= */
.entry-header { padding-top: clamp(20px, 4vw, 48px); }
.entry-header__inner { max-width: 860px; }
.entry-header .chip { margin-bottom: var(--s-4); }
.entry-title {
	margin: 0;
	font-size: clamp(1.75rem, 1.1rem + 3vw, 3.25rem);
	line-height: 1.12;
	letter-spacing: -0.035em;
	font-weight: 800;
	overflow-wrap: break-word;
	hyphens: manual;
}
.entry-dek {
	margin: var(--s-4) 0 0;
	font-size: clamp(1.0625rem, 1rem + .5vw, 1.3rem);
	line-height: 1.55;
	color: var(--muted);
	max-width: 65ch;
}
.entry-byline {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-2) var(--s-6);
	margin-top: var(--s-6);
	padding-top: var(--s-4);
	border-top: 1px solid var(--line);
}
.entry-updated { margin: 0; font-size: var(--fs-sm); color: var(--muted); }

.entry-media { margin: clamp(24px, 4vw, 40px) auto 0; }
.entry-media img {
	width: 100%;
	height: auto;
	max-height: 640px;
	object-fit: contain;
	border-radius: var(--radius-lg);
	background: var(--surface-2);
}
.entry-media figcaption { margin-top: var(--s-3); font-size: var(--fs-sm); color: var(--muted); text-align: center; }

.entry .layout__main { max-width: var(--measure); min-width: 0; }

/* Stacked layout (no side column): centre header, image and body on one axis */
@media (max-width: 1024px) {
	.entry-header__inner, .entry .layout__main { max-width: var(--measure); margin-inline: auto; }
	.entry-media { max-width: calc(var(--measure) + 2 * var(--gutter)); }
	.entry .sidebar { width: 100%; max-width: var(--measure); margin-inline: auto; }
}

/* Table of contents */
.toc {
	margin-bottom: var(--s-8);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
}
.toc__head { display: flex; align-items: center; justify-content: space-between; gap: var(--s-3); padding: var(--s-4) var(--s-5); }
.toc__title { display: flex; align-items: center; gap: var(--s-2); margin: 0; font-size: var(--fs-sm); font-weight: 750; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-2); }
.toc__count {
	display: inline-grid;
	place-items: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--surface-2);
	font-size: .6875rem;
	letter-spacing: 0;
	color: var(--muted);
}
.toc__toggle {
	display: none;
	place-items: center;
	width: 40px;
	height: 40px;
	margin: -8px -10px -8px 0;
	border: 0;
	border-radius: 999px;
	background: transparent;
	color: var(--ink-2);
	cursor: pointer;
}
.toc__toggle .icon { transition: transform .2s var(--ease); }
.toc.is-open .toc__toggle .icon { transform: rotate(180deg); }
.toc__list {
	display: grid;
	gap: 2px;
	margin: 0;
	padding: 0 var(--s-3) var(--s-4);
	list-style: none;
	counter-reset: toc;
}
.toc__list li { counter-increment: toc; }
.toc__list a {
	display: grid;
	grid-template-columns: 26px minmax(0, 1fr);
	gap: var(--s-2);
	padding: 7px var(--s-2);
	border-radius: 8px;
	font-size: var(--fs-md);
	line-height: 1.45;
	color: var(--ink-2);
	transition: background .2s, color .2s;
}
.toc__list a::before { content: counter(toc, decimal-leading-zero); font-variant-numeric: tabular-nums; font-weight: 700; color: var(--muted); }
.toc__list a:hover, .toc__list a[aria-current] { background: var(--brand-soft); color: var(--brand-ink); }
.toc__list a[aria-current]::before { color: var(--brand); }

@media (max-width: 1024px) {
	.toc { margin-bottom: var(--s-7); }
	.toc__head { cursor: pointer; }
	.toc__toggle { display: inline-grid; }
	.toc:not(.is-open) .toc__list { display: none; }
}

/* Prose */
.prose {
	font-size: var(--fs-prose);
	line-height: 1.75;
	color: var(--ink-2);
	overflow-wrap: break-word;
}
.prose > * { margin-block: 0 1.2em; }
.prose h2, .prose h3, .prose h4, .prose h5 { color: var(--ink); scroll-margin-top: calc(var(--header-h) + var(--s-6)); }
.prose h2 { margin: 1.9em 0 .55em; font-size: clamp(1.375rem, 1.1rem + 1.3vw, 1.875rem); line-height: 1.25; }
.prose h3 { margin: 1.7em 0 .5em; font-size: clamp(1.1875rem, 1.05rem + .6vw, 1.375rem); line-height: 1.3; }
.prose h4 { margin: 1.5em 0 .45em; font-size: 1.125rem; line-height: 1.35; }
.prose h5 { margin: 1.4em 0 .4em; font-size: 1rem; line-height: 1.4; }
.prose > :first-child { margin-top: 0; }
.prose a { color: var(--brand-ink); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; text-decoration-color: color-mix(in srgb, var(--brand) 40%, transparent); }
.prose a:hover { text-decoration-color: currentColor; }
.prose strong { color: var(--ink); font-weight: 700; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li { margin-bottom: .5em; padding-left: .2em; }
.prose li > ul, .prose li > ol { margin-top: .5em; }
.prose li::marker { color: var(--brand); font-weight: 600; }
.prose img { border-radius: var(--radius); }
.prose figure { margin-inline: 0; }
.prose figcaption, .prose .wp-element-caption { margin-top: var(--s-2); font-size: .875rem; line-height: 1.5; color: var(--muted); text-align: center; }
.prose blockquote, .prose .wp-block-quote {
	margin-inline: 0;
	padding: var(--s-1) 0 var(--s-1) var(--s-5);
	border-left: 4px solid var(--brand);
	font-size: 1.15em;
	font-style: italic;
	color: var(--ink);
}
.prose blockquote p:last-child { margin-bottom: 0; }
.prose blockquote cite { display: block; margin-top: var(--s-2); font-size: .85rem; font-style: normal; color: var(--muted); }
.prose code { padding: .12em .38em; border-radius: 6px; background: var(--surface-2); font-family: var(--mono); font-size: .86em; overflow-wrap: anywhere; }
.prose pre { padding: var(--s-4) var(--s-5); overflow-x: auto; border-radius: var(--radius); background: #0f1218; color: #e6e8eb; font-size: .875rem; line-height: 1.6; }
.prose pre code { padding: 0; background: none; color: inherit; overflow-wrap: normal; }
.prose hr { border: 0; border-top: 1px solid var(--line); margin-block: 2.5em; }
.prose .wp-block-table { overflow-x: auto; margin-inline: 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: .9em; line-height: 1.5; }
.prose th, .prose td { padding: 10px 12px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.prose th { color: var(--ink); background: var(--surface-2); font-weight: 700; }
.prose td:first-child, .prose th:first-child { padding-left: 14px; }
.prose iframe { border-radius: var(--radius); }
.prose .alignleft { float: left; margin: .3em 1.5em 1em 0; }
.prose .alignright { float: right; margin: .3em 0 1em 1.5em; }
.prose .aligncenter { margin-inline: auto; }
.prose > :last-child { margin-bottom: 0; }
@media (max-width: 640px) {
	.prose .alignleft, .prose .alignright { float: none; margin: 0 0 1em; }
	.prose th, .prose td { padding: 9px 10px; }
}

.entry-tags { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: var(--s-8) 0 0; padding: 0; list-style: none; }

.author-box {
	display: flex;
	gap: var(--s-4);
	align-items: center;
	margin-top: var(--s-8);
	padding: var(--s-5) var(--s-6);
	border-radius: var(--radius);
	background: var(--surface-2);
}
.author-box__label { margin: 0; font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.author-box__name { margin: 2px 0 0; font-size: 1.125rem; font-weight: 750; line-height: 1.3; }
.author-box__bio { margin: var(--s-2) 0 0; color: var(--muted); font-size: var(--fs-md); }

.post-navigation { margin-top: var(--s-6); }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: var(--s-3); }
.post-navigation a {
	display: grid;
	align-content: start;
	gap: var(--s-1);
	height: 100%;
	padding: var(--s-4) var(--s-5);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	background: var(--surface);
	transition: border-color .2s, transform .2s var(--ease);
}
.post-navigation a:hover { border-color: var(--brand); transform: translateY(-2px); color: var(--ink); }
.post-navigation .nav-next { grid-column: 2; text-align: right; }
.post-nav__label { font-size: var(--fs-xs); font-weight: 700; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.post-nav__title { font-size: var(--fs-md); font-weight: 650; line-height: 1.4; }
@media (max-width: 640px) {
	.post-navigation .nav-links { grid-template-columns: minmax(0, 1fr); }
	.post-navigation .nav-next { grid-column: auto; text-align: left; }
}

.related { margin-top: var(--section); padding-top: var(--s-8); border-top: 1px solid var(--line); }
.related .section-title { margin-bottom: var(--s-6); }

/* Share buttons (Meks Easy Social Share) */
.entry-content .meks_ess_share_label { margin: var(--s-8) 0 var(--s-3); }
.meks_ess_share_label h5 {
	margin: 0;
	font-size: var(--fs-sm) !important;
	font-weight: 650 !important;
	letter-spacing: 0;
	color: var(--muted) !important;
	text-transform: none;
}
.entry-content .meks_ess { display: flex; flex-wrap: wrap; gap: var(--s-2); margin: 0 !important; }
.entry-content .meks_ess a.meks_ess-item {
	display: inline-grid !important;
	place-items: center;
	width: 44px !important;
	height: 44px !important;
	min-width: 0 !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 1px solid var(--line-strong) !important;
	border-radius: 999px !important;
	background: var(--surface) !important;
	line-height: 1 !important;
	text-decoration: none;
	transition: border-color .2s, transform .2s var(--ease);
}
.entry-content .meks_ess a.meks_ess-item:hover { border-color: currentColor !important; transform: translateY(-2px); }
.entry-content .meks_ess a.meks_ess-item::before { margin: 0 !important; font-size: 17px !important; }
.entry-content .meks_ess a.socicon-googleplus { display: none !important; }

/* Comments */
.comments { margin-top: var(--s-9); padding-top: var(--s-8); border-top: 1px solid var(--line); }
.comments .section-title { margin-bottom: var(--s-5); }
.comment-list, .comment-list .children { margin: 0; padding: 0; list-style: none; }
.comment-list .children { padding-left: clamp(16px, 4vw, 48px); }
.comment-body { padding: var(--s-5) 0; border-bottom: 1px solid var(--line); }
.comment-author { display: flex; align-items: center; gap: var(--s-3); font-weight: 650; }
.comment-author .says { display: none; }
.comment-metadata { margin: var(--s-1) 0 var(--s-3); font-size: var(--fs-sm); color: var(--muted); }
.comment-content { color: var(--ink-2); }
.comment-content > :last-child { margin-bottom: 0; }
.reply { margin-top: var(--s-2); font-size: .875rem; font-weight: 650; }
.reply a { color: var(--brand); }
.comment-respond { margin-top: var(--s-7); }
.comment-form { display: grid; gap: var(--s-4); }
.comment-form p { margin: 0; }
.comment-form label { display: block; margin-bottom: 6px; font-size: .875rem; font-weight: 600; }
.comment-form input[type="text"],
.comment-form input[type="email"],
.comment-form input[type="url"],
.comment-form textarea {
	width: 100%;
	padding: 12px 14px;
	border: 1px solid var(--line-strong);
	border-radius: var(--radius-sm);
	background: var(--surface);
	font-size: var(--fs-base);
}
.comment-form input:focus, .comment-form textarea:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.comment-form-cookies-consent { display: flex; gap: var(--s-2); align-items: flex-start; font-size: .875rem; }
.comment-form-cookies-consent label { margin: 0; font-weight: 400; }
.comment-notes, .logged-in-as, .must-log-in { font-size: .875rem; color: var(--muted); }

/* =========================================================================
   10. Pages & tools
   ========================================================================= */
.entry--page .prose { padding-top: var(--s-8); }
.entry--page .tool + .prose { padding-top: var(--s-8); }

.tool {
	margin-top: var(--s-8);
	padding: clamp(20px, 4vw, 32px);
	border: 1px solid var(--line);
	border-radius: var(--radius-lg);
	background: var(--surface);
	box-shadow: var(--shadow);
}
.tool__label { display: block; margin-bottom: var(--s-3); font-weight: 700; line-height: 1.4; }
.tool__row {
	display: flex;
	align-items: center;
	gap: var(--s-2);
	padding: 5px 5px 5px var(--s-4);
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	background: var(--bg);
	transition: border-color .2s, box-shadow .2s;
}
.tool__row:focus-within { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
.tool__prefix { font-weight: 700; color: var(--muted); }
.tool__input {
	flex: 1;
	min-width: 0;
	height: 46px;
	padding: 0 4px;
	border: 0;
	background: transparent;
	outline: none;
	font-size: var(--fs-base);
	-webkit-appearance: none;
	appearance: none;
}
.tool__row--stack { flex-direction: column; align-items: stretch; padding: var(--s-2); border-radius: var(--radius); }
.tool__row--stack .tool__input { height: auto; min-height: 96px; padding: var(--s-2); resize: vertical; line-height: 1.5; }
.tool__hint { margin: var(--s-3) 0 0; font-size: var(--fs-sm); line-height: 1.5; color: var(--muted); }
.tool__result { display: grid; justify-items: center; gap: var(--s-4); text-align: center; }
.tool__result:not(:empty) { margin-top: var(--s-6); }
.tool__result img { max-width: min(100%, 420px); border-radius: var(--radius); box-shadow: var(--shadow-lg); }
.tool__result.is-error p { margin: 0; padding: var(--s-3) var(--s-4); border-radius: var(--radius-sm); background: var(--brand-soft); color: var(--brand-ink); font-weight: 600; }
.tool__result.is-loading p { margin: 0; color: var(--muted); }
@media (max-width: 560px) {
	/* Separate field and full-width button on phones */
	.tool__row:not(.tool__row--stack) {
		flex-wrap: wrap;
		padding: 0;
		border: 0;
		border-radius: 0;
		background: none;
		box-shadow: none !important;
	}
	.tool__row:not(.tool__row--stack) .tool__prefix { display: none; }
	.tool__row:not(.tool__row--stack) .tool__input {
		flex-basis: 100%;
		height: 50px;
		padding: 0 var(--s-4);
		border: 1px solid var(--line-strong);
		border-radius: var(--radius-sm);
		background: var(--bg);
	}
	.tool__row:not(.tool__row--stack) .tool__input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px color-mix(in srgb, var(--brand) 18%, transparent); }
	.tool__row .btn { width: 100%; }
}

.spinner {
	width: 36px;
	height: 36px;
	border: 3px solid var(--line);
	border-top-color: var(--brand);
	border-radius: 999px;
	animation: spin .8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* =========================================================================
   11. Footer
   ========================================================================= */
.site-footer {
	margin-top: var(--section);
	padding-top: clamp(40px, 6vw, 64px);
	border-top: 1px solid var(--line);
	background: var(--surface);
	font-size: var(--fs-md);
}
.site-footer__top {
	display: grid;
	grid-template-columns: 1.2fr repeat(3, minmax(0, 1fr));
	gap: var(--s-8);
	padding-bottom: var(--s-8);
}
.site-footer__brand .brand__name { display: inline-block; margin-bottom: var(--s-3); font-size: 1.5rem; }
.site-footer__brand p { max-width: 32ch; margin: 0; color: var(--muted); }
.site-footer .widget-title { color: var(--ink); margin-bottom: var(--s-3); }
.site-footer .widget { color: var(--muted); line-height: 1.6; }
.site-footer .widget a { color: var(--ink-2); }
.site-footer .widget a:hover { color: var(--brand); }
.site-footer .textwidget a[style] { color: var(--ink-2) !important; }
.site-footer .textwidget strong { color: var(--ink-2); font-weight: 650; }
.site-footer .textwidget p:last-child { margin-bottom: 0; }

.social-links { display: flex; gap: var(--s-2); margin: var(--s-5) 0 0; padding: 0; list-style: none; }
.social-links a {
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border: 1px solid var(--line-strong);
	border-radius: 999px;
	color: var(--ink-2);
	transition: background .2s, color .2s, border-color .2s;
}
.social-links a:hover { background: var(--brand); border-color: var(--brand); color: #fff; }

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--s-3) var(--s-6);
	padding-block: var(--s-6);
	border-top: 1px solid var(--line);
	font-size: .875rem;
	color: var(--muted);
}
.site-footer__bottom p { margin: 0; }
.footer-menu { display: flex; flex-wrap: wrap; gap: var(--s-1) var(--s-5); margin: 0; padding: 0; list-style: none; }
.footer-menu a { display: inline-flex; align-items: center; min-height: 32px; }
.footer-menu a:hover { color: var(--brand); }

@media (max-width: 1024px) {
	.site-footer__top { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.site-footer__brand { grid-column: 1 / -1; }
}
@media (max-width: 640px) {
	.site-footer__top { grid-template-columns: minmax(0, 1fr); gap: var(--s-7); }
	.site-footer__col { padding-top: var(--s-6); border-top: 1px solid var(--line); }
	.site-footer__bottom { flex-direction: column-reverse; align-items: flex-start; padding-bottom: calc(var(--s-6) + 56px); }
}

.back-to-top {
	position: fixed;
	right: var(--s-4);
	bottom: var(--s-4);
	z-index: 40;
	display: grid;
	place-items: center;
	width: 44px;
	height: 44px;
	border-radius: 999px;
	background: var(--ink);
	color: var(--bg);
	box-shadow: var(--shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(10px);
	transition: opacity .25s, transform .25s var(--ease), visibility .25s;
}
.back-to-top .icon { transform: rotate(-90deg); }
.back-to-top.is-visible { opacity: 1; visibility: visible; transform: none; }
.back-to-top:hover { color: var(--bg); background: var(--brand); }
@media (min-width: 768px) { .back-to-top { right: var(--s-6); bottom: var(--s-6); } }

/* =========================================================================
   12. WordPress core classes
   ========================================================================= */
.alignwide { margin-inline: calc(-1 * min(80px, 6vw)); max-width: none; }
.alignfull { margin-inline: calc(50% - 50vw); max-width: 100vw; width: 100vw; }
@media (max-width: 1024px) { .alignwide { margin-inline: 0; } }
.wp-caption, .gallery-caption { font-size: .875rem; color: var(--muted); }
.sticky .card__title::before { content: "★ "; color: var(--brand); }
.bypostauthor > .comment-body .comment-author b::after { content: " · Author"; color: var(--brand); font-size: .8em; }

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

@media print {
	.site-header, .site-footer, .sidebar, .progress, .back-to-top, .related, .comments, .ad-slot, .toc, .meks_ess, .meks_ess_share_label { display: none !important; }
	body { background: #fff; color: #000; }
}
