/*
 * WP Starter Theme - main stylesheet
 *
 * Public contract for child themes:
 *   - The main style handle is 'wps-main'.
 *   - CSS custom properties use the --wps-* prefix and are documented
 *     in DESIGN.md.
 *   - The Customizer (added in task 2.1) injects an inline <style> block
 *     in <head> to override the --wps-color-* defaults per-client.
 *   - Body sizing uses fluid clamp() for responsive readability.
 *
 * Layer order (later wins on conflict):
 *   1. :root tokens  (defaults; overridden by Customizer inline style)
 *   2. Reset          (only what's needed for the editorial baseline)
 *   3. Body baseline  (background, text, font, line-height)
 *   4. Component rules (added per-component in tasks 2.x, 3.x, 4.x)
 *   5. Reduced-motion (last, so it overrides everything else)
 */

/* ==========================================================================
   1. Design tokens (CSS custom properties)
   ========================================================================== */

:root {
	/* Colors — default values, overridden by Customizer per client */
	--wps-color-bg: #FBF8F1;          /* Warm paper background */
	--wps-color-text: #1F1B16;        /* Warm ink, primary text */
	--wps-color-text-muted: color-mix(in srgb, var(--wps-color-text) 72%, var(--wps-color-bg));
	--wps-color-primary: #2D5F3F;      /* Forest green accent */
	--wps-color-secondary: #A87C3E;    /* Terracotta, secondary accent */
	--wps-color-border: color-mix(in srgb, var(--wps-color-text) 16%, var(--wps-color-bg));
	--wps-color-surface: color-mix(in srgb, var(--wps-color-primary) 4%, var(--wps-color-bg));
	--wps-color-error: #A8341C;        /* Warm brick error */

	/* Typography */
	--wps-font-family-base: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
	--wps-font-size-base: 1rem;        /* 16px */
	--wps-font-size-sm: 0.875rem;      /* 14px, meta info */
	--wps-font-size-h1: clamp(2rem, 1.6rem + 1.8vw, 2.75rem);
	--wps-font-size-h2: clamp(1.5rem, 1.35rem + 0.7vw, 1.875rem);
	--wps-line-height-base: 1.7;       /* Body, for comfortable reading */
	--wps-line-height-tight: 1.2;       /* Headings */
	--wps-line-height-meta: 1.4;        /* Meta info */

	/* Spacing scale (rem-based for user font-size accessibility) */
	--wps-space-xs: 0.5rem;    /*  8px */
	--wps-space-sm: 1rem;      /* 16px */
	--wps-space-md: 1.5rem;    /* 24px */
	--wps-space-lg: 2.5rem;    /* 40px */
	--wps-space-xl: 4rem;      /* 64px */

	/* Layout */
	--wps-content-width: 68ch;        /* Single post reading column */
	--wps-grid-width: 75rem;           /* 1200px card grid and site chrome */
	--wps-page-padding: clamp(1rem, 4vw, 2rem);

	/* Motion */
	--wps-transition-base: 200ms cubic-bezier(0.2, 0.8, 0.2, 1);
	--wps-reveal-duration: 600ms;
}

/* ==========================================================================
   2. Minimal reset
   ========================================================================== */

*,
*::before,
*::after {
	box-sizing: border-box;
}

html {
	-webkit-text-size-adjust: 100%;
}

body,
h1, h2, h3, h4, h5, h6,
p, ul, ol, dl, blockquote, figure {
	margin: 0;
}

ul,
ol {
	padding-left: var(--wps-space-md);
}

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

a {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

/* ==========================================================================
   3. Body baseline
   ========================================================================== */

body {
	background-color: var(--wps-color-bg);
	color: var(--wps-color-text);
	font-family: var(--wps-font-family-base);
	font-size: clamp(1rem, 0.95rem + 0.2vw, 1.0625rem);
	line-height: var(--wps-line-height-base);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	font-feature-settings: 'kern' 1, 'liga' 1;
	text-rendering: optimizeLegibility;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

/* Site main content area grows to fill remaining viewport height so the
   footer (added in task 1.5) sticks to the bottom on short pages. */
.site-main {
	flex: 1 0 auto;
}

/* ==========================================================================
   4. Layout — page chrome (header / footer / archives / single)
   ========================================================================== */

/* Site header */
.site-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background-color: color-mix(in srgb, var(--wps-color-bg) 92%, transparent);
	-webkit-backdrop-filter: blur(8px);
	backdrop-filter: blur(8px);
	border-bottom: 1px solid var(--wps-color-border);
}

.site-header__inner {
	max-width: var(--wps-grid-width);
	margin: 0 auto;
	padding: var(--wps-space-sm) var(--wps-page-padding);
	display: flex;
	align-items: center;
	gap: var(--wps-space-md);
	position: relative;
	z-index: 1001;
}

.site-title {
	margin: 0;
	font-size: var(--wps-font-size-h2);
	font-weight: 700;
	line-height: var(--wps-line-height-tight);
}

.site-title a {
	color: var(--wps-color-text);
	text-decoration: none;
}

.site-title a:hover,
.site-title a:focus-visible {
	color: var(--wps-color-primary);
}

.custom-logo-link {
	display: block;
	flex: 0 1 auto;
	line-height: 0;
}

.custom-logo {
	width: auto;
	height: clamp(2.5rem, 5vw, 3.75rem);
	max-width: min(18rem, 54vw);
	object-fit: contain;
	object-position: left center;
}

.site-header__label {
	padding-left: var(--wps-space-sm);
	border-left: 1px solid var(--wps-color-border);
	color: var(--wps-color-text-muted);
	font-size: 0.75rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
}

/* Site footer */
.site-footer {
	background-color: var(--wps-color-surface);
	border-top: 1px solid var(--wps-color-border);
	padding: clamp(2.5rem, 6vw, 5rem) var(--wps-page-padding) var(--wps-space-lg);
	margin-top: var(--wps-space-xl);
}

.site-footer__inner {
	max-width: var(--wps-grid-width);
	margin: 0 auto;
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wps-space-lg);
}

.site-footer__brand {
	max-width: 36rem;
}

.site-footer .custom-logo {
	height: 2.5rem;
	max-width: 13rem;
}

.site-footer__title,
.site-footer__heading {
	margin: 0 0 var(--wps-space-sm);
	font-weight: 700;
}

.site-footer__intro {
	margin: var(--wps-space-md) 0 0;
	color: var(--wps-color-text-muted);
	font-size: var(--wps-font-size-sm);
	line-height: 1.6;
}

.site-footer__copyright,
.site-footer__client-link {
	margin: 0;
	font-size: var(--wps-font-size-sm);
	color: var(--wps-color-text-muted);
}

.site-footer__copyright {
	padding-top: var(--wps-space-md);
	border-top: 1px solid var(--wps-color-border);
}

.site-footer__client-link a {
	color: var(--wps-color-primary);
	text-decoration: none;
}

.site-footer__client-link a:hover,
.site-footer__client-link a:focus-visible {
	text-decoration: underline;
}

.site-footer__nav {
	margin: 0 0 var(--wps-space-sm);
}

.footer-menu {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wps-space-xs);
	font-size: var(--wps-font-size-sm);
}

@media (min-width: 760px) {
	.site-footer__inner {
		grid-template-columns: minmax(0, 1.5fr) minmax(14rem, 0.75fr);
	}

	.site-footer__copyright {
		grid-column: 1 / -1;
	}
}

.footer-menu a {
	color: var(--wps-color-text-muted);
	text-decoration: none;
}

.footer-menu a:hover,
.footer-menu a:focus-visible {
	color: var(--wps-color-primary);
	text-decoration: underline;
}

/* Site header client link (e.g. "consortio.hu" next to the logo) */
.site-header__client-link {
	color: var(--wps-color-text-muted);
	font-size: var(--wps-font-size-sm);
	font-weight: 600;
	text-decoration: none;
	padding: var(--wps-space-xs) var(--wps-space-sm);
	border-radius: 4px;
	transition: color var(--wps-transition-base);
}

.site-header__actions {
	margin-left: auto;
	display: flex;
	align-items: center;
	gap: var(--wps-space-sm);
}

.site-header__client-link:hover,
.site-header__client-link:focus-visible {
	color: var(--wps-color-primary);
}

/* Compact, no-JavaScript search disclosure in the site header. */
.header-search {
	position: relative;
}

.header-search summary {
	display: grid;
	place-items: center;
	width: 2.5rem;
	height: 2.5rem;
	border: 1px solid var(--wps-color-border);
	border-radius: 50%;
	cursor: pointer;
	list-style: none;
}

.header-search summary::-webkit-details-marker {
	display: none;
}

.header-search summary:hover,
.header-search summary:focus-visible,
.header-search[open] summary {
	border-color: var(--wps-color-primary);
}

.header-search__icon {
	display: block;
	width: 0.9rem;
	height: 0.9rem;
	border: 2px solid currentColor;
	border-radius: 50%;
	position: relative;
}

.header-search__icon::after {
	content: '';
	position: absolute;
	width: 0.45rem;
	height: 2px;
	right: -0.35rem;
	bottom: -0.2rem;
	background: currentColor;
	transform: rotate(45deg);
	transform-origin: center;
}

.header-search__panel {
	position: absolute;
	top: calc(100% + var(--wps-space-xs));
	right: 0;
	width: min(28rem, calc(100vw - (2 * var(--wps-page-padding))));
	padding: var(--wps-space-sm);
	background: var(--wps-color-bg);
	border: 1px solid var(--wps-color-border);
	border-radius: 0.75rem;
	box-shadow: 0 16px 40px -20px rgba(31, 27, 22, 0.35);
}

/* Hamburger / mobile menu toggle */
.menu-toggle {
	background: none;
	border: 1px solid var(--wps-color-border);
	border-radius: 4px;
	padding: var(--wps-space-xs) var(--wps-space-sm);
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	margin-left: 0;
	transition: border-color var(--wps-transition-base);
}

@media (max-width: 639px) {
	.site-header__label {
		display: none;
	}
	.site-header__client-link {
		display: none;
	}

	.menu-toggle {
		margin-left: 0;
	}

	.header-search {
		margin-left: 0;
	}
}

.menu-toggle:hover,
.menu-toggle:focus-visible {
	border-color: var(--wps-color-text-muted);
}

.menu-toggle:focus-visible {
	outline: 2px solid var(--wps-color-primary);
	outline-offset: 2px;
}

.menu-toggle__bars {
	display: inline-flex;
	flex-direction: column;
	gap: 4px;
	width: 20px;
}

.menu-toggle__bars span {
	display: block;
	height: 2px;
	width: 100%;
	background-color: var(--wps-color-text);
	border-radius: 1px;
	transition: transform var(--wps-transition-base),
		opacity var(--wps-transition-base);
}

body.has-menu-open .menu-toggle__bars span:nth-child(1) {
	transform: translateY(6px) rotate(45deg);
}

body.has-menu-open .menu-toggle__bars span:nth-child(2) {
	opacity: 0;
}

body.has-menu-open .menu-toggle__bars span:nth-child(3) {
	transform: translateY(-6px) rotate(-45deg);
}

/* Primary nav panel: hidden on mobile by default, slides in when toggled */
.primary-nav {
	display: none;
	background-color: var(--wps-color-bg);
	border-bottom: 1px solid var(--wps-color-border);
}

body.has-menu-open .primary-nav {
	display: block;
	position: fixed;
	inset: 0;
	z-index: 1000;
	padding: 6rem var(--wps-page-padding) var(--wps-space-xl);
	overflow-y: auto;
}

.primary-menu {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wps-space-md);
	font-size: 1.125rem;
}

body.has-menu-open .primary-menu {
	gap: var(--wps-space-lg);
	font-size: 1.5rem;
	font-weight: 500;
}

.primary-menu a {
	color: var(--wps-color-text);
	text-decoration: none;
}

.primary-menu a:hover,
.primary-menu a:focus-visible {
	color: var(--wps-color-primary);
}

.primary-menu .sub-menu {
	list-style: none;
	padding-left: var(--wps-space-md);
	margin-top: var(--wps-space-xs);
	font-size: 0.85em;
	font-weight: 400;
}

@media (min-width: 768px) {
	.menu-toggle {
		display: none;
	}

	.primary-nav {
		display: block;
		position: static;
		max-width: var(--wps-grid-width);
		margin: 0 auto;
		padding: 0 var(--wps-page-padding) var(--wps-space-sm);
		background: transparent;
		overflow: visible;
	}

	.primary-menu {
		flex-direction: row;
		gap: var(--wps-space-md);
		font-size: var(--wps-font-size-base);
		font-weight: 400;
	}

	.primary-menu .sub-menu {
		position: absolute;
		background: var(--wps-color-bg);
		border: 1px solid var(--wps-color-border);
		border-radius: 4px;
		padding: var(--wps-space-sm);
		min-width: 200px;
		margin-top: var(--wps-space-xs);
		box-shadow: 0 8px 16px -8px rgba(31, 27, 22, 0.15);
	}
}

body.has-menu-open {
	overflow: hidden;
}

/* Global focus-visible style for any interactive element not covered
   by a more specific rule. */
*:focus-visible {
	outline: 2px solid var(--wps-color-primary);
	outline-offset: 2px;
	border-radius: 2px;
}

/* Archive pages (home, category, tag, author, search) */
.site-main--archive {
	padding: var(--wps-space-xl) var(--wps-page-padding);
	max-width: var(--wps-grid-width);
	margin: 0 auto;
}

.archive-header {
	margin-bottom: var(--wps-space-lg);
	padding-bottom: var(--wps-space-md);
	border-bottom: 1px solid var(--wps-color-border);
}

.archive-header--home {
	display: flex;
	align-items: end;
	justify-content: space-between;
	margin-top: var(--wps-space-xl);
}

.archive-header--home .archive-title {
	margin-bottom: 0;
}

.archive-title {
	font-size: var(--wps-font-size-h1);
	font-weight: 700;
	line-height: var(--wps-line-height-tight);
	margin: 0 0 var(--wps-space-sm);
}

.archive-title span {
	color: var(--wps-color-primary);
}

.archive-description {
	color: var(--wps-color-text-muted);
	font-size: var(--wps-font-size-base);
	line-height: var(--wps-line-height-meta);
}

.no-posts {
	color: var(--wps-color-text-muted);
	font-style: italic;
}

/* Homepage hero and automatically populated category shortcuts */
.home-hero {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--wps-space-lg);
	align-items: end;
	padding: clamp(2rem, 6vw, 5rem);
	background: var(--wps-color-surface);
	border: 1px solid var(--wps-color-border);
	border-radius: 1rem;
	position: relative;
	overflow: hidden;
}

.home-hero::after {
	content: '';
	position: absolute;
	width: 16rem;
	height: 16rem;
	right: -7rem;
	top: -9rem;
	border: 3rem solid color-mix(in srgb, var(--wps-color-secondary) 16%, transparent);
	border-radius: 50%;
	pointer-events: none;
}

.home-hero__content {
	max-width: 48rem;
	position: relative;
	z-index: 1;
}

.home-hero__eyebrow {
	margin: 0 0 var(--wps-space-sm);
	color: var(--wps-color-primary);
	font-size: var(--wps-font-size-sm);
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.home-hero__title {
	margin: 0;
	font-size: clamp(2.35rem, 1.6rem + 3.2vw, 4.75rem);
	font-weight: 750;
	letter-spacing: -0.04em;
	line-height: 1.02;
	text-wrap: balance;
}

.home-hero__intro {
	max-width: 60ch;
	margin: var(--wps-space-md) 0 0;
	color: var(--wps-color-text-muted);
	font-size: clamp(1rem, 0.92rem + 0.35vw, 1.2rem);
}

.home-hero__cta {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wps-space-sm);
	width: fit-content;
	padding: 0.8rem 1rem;
	color: var(--wps-color-text);
	background: var(--wps-color-bg);
	border: 1px solid var(--wps-color-border);
	border-radius: 999px;
	font-size: var(--wps-font-size-sm);
	font-weight: 650;
	text-decoration: none;
	transition: transform var(--wps-transition-base), border-color var(--wps-transition-base);
	position: relative;
	z-index: 1;
}

.home-hero__cta:hover,
.home-hero__cta:focus-visible {
	transform: translateY(-2px);
	border-color: var(--wps-color-primary);
}

.topic-nav {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wps-space-sm);
	margin-top: var(--wps-space-lg);
}

.topic-nav__label {
	color: var(--wps-color-text-muted);
	font-size: var(--wps-font-size-sm);
}

.topic-nav__list {
	display: flex;
	flex-wrap: wrap;
	gap: var(--wps-space-xs);
	padding: 0;
	margin: 0;
	list-style: none;
}

.topic-nav__list a {
	display: block;
	padding: 0.35rem 0.75rem;
	border: 1px solid var(--wps-color-border);
	border-radius: 999px;
	font-size: var(--wps-font-size-sm);
	text-decoration: none;
	transition: color var(--wps-transition-base), border-color var(--wps-transition-base), background-color var(--wps-transition-base);
}

.topic-nav__list a:hover,
.topic-nav__list a:focus-visible {
	color: var(--wps-color-primary);
	border-color: var(--wps-color-primary);
	background: var(--wps-color-surface);
}

.empty-state {
	max-width: 44rem;
	padding: var(--wps-space-xl);
	background: var(--wps-color-surface);
	border: 1px dashed var(--wps-color-border);
	border-radius: 0.75rem;
}

.empty-state h2 {
	margin: 0 0 var(--wps-space-sm);
	font-size: var(--wps-font-size-h2);
}

.empty-state p {
	margin: 0;
	color: var(--wps-color-text-muted);
}

@media (min-width: 800px) {
	.home-hero {
		grid-template-columns: minmax(0, 1fr) auto;
	}
}

/* ==========================================================================
   5. Card grid (archive template cards)
   ========================================================================== */

.card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: var(--wps-space-lg);
	margin: 0 0 var(--wps-space-xl);
}

@media (min-width: 640px) {
	.card-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 1024px) {
	.card-grid {
		grid-template-columns: repeat(3, 1fr);
	}
}

.card {
	display: flex;
	flex-direction: column;
	position: relative;
	background: color-mix(in srgb, var(--wps-color-bg) 94%, white);
	border: 1px solid var(--wps-color-border);
	border-radius: 0.75rem;
	overflow: hidden;
	transition: transform var(--wps-transition-base),
		box-shadow var(--wps-transition-base),
		border-color var(--wps-transition-base);
}

.card--no-image::before {
	content: '';
	display: block;
	height: 0.35rem;
	background: linear-gradient(90deg, var(--wps-color-primary), var(--wps-color-secondary));
}

.card:hover,
.card:focus-within {
	transform: translateY(-2px);
	box-shadow: 0 12px 24px -10px rgba(31, 27, 22, 0.12);
	border-color: var(--wps-color-text-muted);
}

.card__thumbnail {
	display: block;
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--wps-color-border);
}

.card__thumbnail img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 400ms ease-out;
}

.card:hover .card__thumbnail img {
	transform: scale(1.03);
}

.card__body {
	padding: clamp(1.35rem, 2.5vw, 2rem);
	display: flex;
	flex-direction: column;
	flex: 1;
	gap: var(--wps-space-sm);
}

.card--no-image .card__body {
	padding-top: clamp(1.75rem, 3.5vw, 2.75rem);
}

.card__category {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--wps-color-primary);
	text-transform: uppercase;
	letter-spacing: 0.06em;
}

.card__category a {
	color: inherit;
	text-decoration: none;
}

.card__category a:hover,
.card__category a:focus-visible {
	text-decoration: underline;
}

.card__title {
	margin: 0;
	font-size: var(--wps-font-size-h2);
	font-weight: 600;
	line-height: var(--wps-line-height-tight);
}

@media (min-width: 1024px) {
	.home .card-grid .card:first-child {
		grid-column: span 2;
	}

	.home .card-grid .card:first-child .card__title {
		font-size: clamp(1.75rem, 1.3rem + 1vw, 2.35rem);
	}
}

.home .card-grid > .card:only-child {
	grid-column: 1 / -1;
}

@media (min-width: 800px) {
	.home .card-grid > .card--no-image:only-child .card__body {
		display: grid;
		grid-template-columns: minmax(0, 1.15fr) minmax(18rem, 0.85fr);
		column-gap: clamp(2rem, 6vw, 5rem);
		align-items: end;
		padding: clamp(2.25rem, 5vw, 4rem);
	}

	.home .card-grid > .card--no-image:only-child .card__category,
	.home .card-grid > .card--no-image:only-child .card__title {
		grid-column: 1;
	}

	.home .card-grid > .card--no-image:only-child .card__title {
		max-width: 20ch;
		font-size: clamp(2rem, 1.5rem + 1.7vw, 3.25rem);
	}

	.home .card-grid > .card--no-image:only-child .card__excerpt {
		grid-column: 2;
		grid-row: 1 / span 2;
		max-width: 48ch;
		align-self: end;
	}

	.home .card-grid > .card--no-image:only-child .card__footer {
		grid-column: 1 / -1;
		margin-top: var(--wps-space-md);
		padding-top: var(--wps-space-md);
		border-top: 1px solid var(--wps-color-border);
	}
}

.card__title a {
	color: var(--wps-color-text);
	text-decoration: none;
}

.card__title a:hover,
.card__title a:focus-visible {
	color: var(--wps-color-primary);
}

.card__excerpt {
	color: var(--wps-color-text-muted);
	font-size: var(--wps-font-size-base);
	line-height: var(--wps-line-height-meta);
	flex: 1;
}

.card__excerpt p {
	margin: 0;
}

.card__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--wps-space-sm);
	margin-top: auto;
	padding-top: var(--wps-space-xs);
}

.card__meta {
	font-size: var(--wps-font-size-sm);
	color: var(--wps-color-text-muted);
	display: flex;
	align-items: center;
	gap: var(--wps-space-xs);
}

.card__meta-separator {
	color: var(--wps-color-border);
}

.card__read-more {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	color: var(--wps-color-text);
	font-size: var(--wps-font-size-sm);
	font-weight: 700;
	text-decoration: none;
}

.card__read-more span {
	transition: transform var(--wps-transition-base);
}

.card__read-more:hover,
.card__read-more:focus-visible {
	color: var(--wps-color-primary);
}

.card__read-more:hover span,
.card__read-more:focus-visible span {
	transform: translateX(0.2rem);
}

/* ==========================================================================
   6. Single post layout
   ========================================================================== */

.reading-progress {
	position: fixed;
	top: var(--wp-admin--admin-bar--height, 0px);
	left: 0;
	right: 0;
	height: 3px;
	z-index: 1100;
	pointer-events: none;
}

.reading-progress__bar {
	display: block;
	width: 100%;
	height: 100%;
	background: var(--wps-color-primary);
	transform: scaleX(0);
	transform-origin: left center;
	will-change: transform;
}

.entry {
	padding: clamp(2rem, 5vw, 5rem) var(--wps-page-padding) var(--wps-space-xl);
}

.entry-content,
.entry-footer,
.article-cta,
.post-thumbnail,
.page-links {
	max-width: var(--wps-content-width);
	margin-left: auto;
	margin-right: auto;
}

.entry-header {
	max-width: 58rem;
	margin: 0 auto clamp(2.5rem, 6vw, 5rem);
	padding: clamp(1.5rem, 5vw, 4.5rem);
	background: var(--wps-color-surface);
	border: 1px solid var(--wps-color-border);
	border-radius: 1rem;
	position: relative;
	overflow: hidden;
}

.entry-header::after {
	content: '';
	position: absolute;
	width: 16rem;
	height: 16rem;
	right: -8rem;
	top: -9rem;
	border: 3rem solid color-mix(in srgb, var(--wps-color-secondary) 16%, transparent);
	border-radius: 50%;
	pointer-events: none;
}

.entry-header > * {
	position: relative;
	z-index: 1;
}

.entry-title {
	max-width: 15ch;
	font-size: clamp(2.4rem, 1.5rem + 4vw, 4.75rem);
	font-weight: 750;
	letter-spacing: -0.045em;
	line-height: 1.02;
	margin: 0 0 var(--wps-space-md);
	text-wrap: balance;
}

.entry-lead {
	max-width: 55ch;
	margin: 0 0 var(--wps-space-md);
	color: var(--wps-color-text-muted);
	font-size: clamp(1.05rem, 0.95rem + 0.45vw, 1.3rem);
	line-height: 1.55;
}

.post-thumbnail {
	margin: 0 auto var(--wps-space-lg);
}

.post-thumbnail.is-style-full-bleed {
	max-width: none;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.post-thumbnail img {
	width: 100%;
	height: auto;
	border-radius: 0.75rem;
	display: block;
}

.entry-content {
	font-size: clamp(1.03rem, 0.98rem + 0.2vw, 1.125rem);
}

.entry-content > * + * {
	margin-top: var(--wps-space-md);
}

.entry-content h2 {
	font-size: var(--wps-font-size-h2);
	font-weight: 700;
	line-height: var(--wps-line-height-tight);
	margin-top: clamp(4rem, 8vw, 6rem);
	margin-bottom: clamp(1.75rem, 3.5vw, 2.75rem);
	scroll-margin-top: 6rem;
}

.entry-content > h2::before {
	content: '';
	display: block;
	width: 2.75rem;
	height: 0.25rem;
	margin-bottom: 1rem;
	background: linear-gradient(90deg, var(--wps-color-primary), var(--wps-color-secondary));
	border-radius: 999px;
}

.entry-content h3 {
	font-size: 1.25rem;
	font-weight: 600;
	line-height: var(--wps-line-height-tight);
	margin-top: clamp(2.25rem, 5vw, 3.5rem);
	margin-bottom: clamp(1rem, 2vw, 1.5rem);
	scroll-margin-top: 6rem;
}

.entry-content p,
.entry-content ul,
.entry-content ol,
.entry-content blockquote,
.entry-content figure {
	margin: 0;
}

.entry-content li + li {
	margin-top: 0.8rem;
}

.entry-content blockquote {
	padding: var(--wps-space-md);
	border-left: 4px solid var(--wps-color-primary);
	background: var(--wps-color-surface);
	border-radius: 0 0.5rem 0.5rem 0;
	font-style: italic;
	color: var(--wps-color-text-muted);
}

.article-toc {
	margin: 0 0 clamp(3rem, 7vw, 5rem);
	padding: clamp(1.5rem, 4vw, 2.5rem);
	background: color-mix(in srgb, var(--wps-color-primary) 4%, var(--wps-color-bg));
	border: 1px solid color-mix(in srgb, var(--wps-color-primary) 18%, var(--wps-color-border));
	border-left: 0.35rem solid var(--wps-color-primary);
	border-radius: 0 0.85rem 0.85rem 0;
}

.entry-content .article-toc__eyebrow,
.author-box__eyebrow {
	margin: 0 0 var(--wps-space-sm);
	color: var(--wps-color-primary);
	font-size: 0.75rem;
	font-weight: 750;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.entry-content .article-toc__title {
	margin: 0 0 var(--wps-space-md);
	color: var(--wps-color-text);
	font-size: clamp(1.35rem, 1.15rem + 0.6vw, 1.75rem);
	font-weight: 700;
	line-height: var(--wps-line-height-tight);
}

.article-toc__list {
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: 1fr;
	column-gap: clamp(1.5rem, 4vw, 3rem);
	list-style: none;
	counter-reset: article-toc;
}

.entry-content .article-toc__list li {
	counter-increment: article-toc;
	display: grid;
	grid-template-columns: 2.25rem minmax(0, 1fr);
	gap: var(--wps-space-xs);
	align-items: start;
	margin: 0;
	padding: 0.85rem 0;
	border-top: 1px solid var(--wps-color-border);
}

.article-toc__list li::before {
	content: counter(article-toc, decimal-leading-zero);
	color: var(--wps-color-primary);
	font-size: 0.75rem;
	font-weight: 750;
	letter-spacing: 0.06em;
	line-height: 1.7;
}

.entry-content .article-toc__list a {
	color: var(--wps-color-text);
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.45;
	text-decoration: none;
}

.entry-content .article-toc__list a:hover,
.entry-content .article-toc__list a:focus-visible {
	color: var(--wps-color-primary);
	text-decoration: underline;
}

@media (min-width: 760px) {
	.article-toc__list {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.entry-content .article-summary {
	margin: clamp(2.5rem, 6vw, 4rem) 0;
	padding: clamp(1.5rem, 4vw, 2.25rem);
	background: color-mix(in srgb, var(--wps-color-secondary) 10%, var(--wps-color-bg));
	border: 1px solid color-mix(in srgb, var(--wps-color-secondary) 35%, var(--wps-color-bg));
	border-left: 5px solid var(--wps-color-secondary);
	border-radius: 0 0.75rem 0.75rem 0;
}

.entry-content .article-summary__eyebrow {
	margin: 0 0 var(--wps-space-xs);
	color: var(--wps-color-secondary);
	font-size: 0.75rem;
	font-weight: 750;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.entry-content .article-summary h2 {
	margin: 0;
	padding: 0;
	border: 0;
}

.entry-content .article-summary h2::before {
	display: none;
}

.entry-content .article-summary h2 + * {
	margin-top: var(--wps-space-sm);
}

.entry-content a {
	color: var(--wps-color-primary);
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 2px;
}

.entry-content a:hover,
.entry-content a:focus-visible {
	text-decoration-thickness: 2px;
}

.entry-content .faq {
	margin-top: clamp(4rem, 8vw, 6rem);
	padding: clamp(1.25rem, 4vw, 2rem);
	background: color-mix(in srgb, var(--wps-color-primary) 5%, var(--wps-color-bg));
	border-radius: 0.75rem;
	border: 1px solid var(--wps-color-border);
}

.entry-content .faq .faq__title {
	margin: 0 0 var(--wps-space-lg);
	padding: 0;
	border: 0;
}

.faq__item {
	border-top: 1px solid var(--wps-color-border);
}

.faq__item:last-child {
	border-bottom: 1px solid var(--wps-color-border);
}

.faq__item summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wps-space-sm);
	padding: var(--wps-space-md) 0;
	cursor: pointer;
	list-style: none;
	font-weight: 700;
}

.faq__item summary::-webkit-details-marker {
	display: none;
}

.faq__item summary::after {
	content: '+';
	display: grid;
	place-items: center;
	flex: 0 0 auto;
	width: 1.75rem;
	height: 1.75rem;
	border: 1px solid var(--wps-color-border);
	border-radius: 50%;
	color: var(--wps-color-primary);
}

.faq__item[open] summary::after {
	content: '−';
}

.faq__answer {
	padding: 0 2.75rem var(--wps-space-md) 0;
	color: var(--wps-color-text-muted);
}

.faq__answer p {
	margin: 0;
}

.entry-content img {
	border-radius: 4px;
}

.page-links {
	margin-top: var(--wps-space-md);
	display: flex;
	gap: var(--wps-space-xs);
	flex-wrap: wrap;
}

.entry-footer {
	margin-top: var(--wps-space-lg);
	padding-top: var(--wps-space-md);
	border-top: 1px solid var(--wps-color-border);
	display: flex;
	flex-direction: column;
	gap: var(--wps-space-sm);
	font-size: var(--wps-font-size-sm);
}

.author-box {
	display: grid;
	grid-template-columns: auto minmax(0, 1fr);
	gap: var(--wps-space-md);
	max-width: var(--wps-content-width);
	margin: var(--wps-space-xl) auto 0;
	padding: clamp(1.25rem, 4vw, 2rem);
	background: var(--wps-color-surface);
	border: 1px solid var(--wps-color-border);
	border-radius: 0.75rem;
}

.author-box__image {
	width: clamp(4rem, 9vw, 6rem);
	height: clamp(4rem, 9vw, 6rem);
	border-radius: 50%;
	object-fit: cover;
}

.author-box__name {
	margin: 0;
	font-size: clamp(1.35rem, 1.2rem + 0.5vw, 1.7rem);
	line-height: var(--wps-line-height-tight);
}

.author-box__name a {
	color: inherit;
	text-decoration: none;
}

.author-box__name a:hover,
.author-box__name a:focus-visible {
	color: var(--wps-color-primary);
}

.author-box__role {
	margin: 0.35rem 0 0;
	color: var(--wps-color-primary);
	font-size: var(--wps-font-size-sm);
	font-weight: 650;
}

.author-box__bio {
	margin: var(--wps-space-sm) 0 0;
	color: var(--wps-color-text-muted);
	font-size: var(--wps-font-size-sm);
	line-height: 1.65;
}

@media (max-width: 520px) {
	.author-box {
		grid-template-columns: 1fr;
	}
}

/* Client-site recommendation — shown only when a destination URL exists. */
.article-cta {
	display: grid;
	gap: var(--wps-space-lg);
	margin-top: var(--wps-space-xl);
	padding: clamp(1.5rem, 5vw, 3rem);
	color: var(--wps-color-bg);
	background: var(--wps-color-text);
	border-radius: 1rem;
	position: relative;
	overflow: hidden;
}

.article-cta::after {
	content: '';
	position: absolute;
	width: 13rem;
	height: 13rem;
	right: -7rem;
	bottom: -8rem;
	border: 2.5rem solid color-mix(in srgb, var(--wps-color-secondary) 45%, transparent);
	border-radius: 50%;
	pointer-events: none;
}

.article-cta__content,
.article-cta__button {
	position: relative;
	z-index: 1;
}

.article-cta__eyebrow,
.related-posts__eyebrow {
	margin: 0 0 var(--wps-space-xs);
	color: var(--wps-color-secondary);
	font-size: 0.75rem;
	font-weight: 750;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}

.article-cta__title {
	max-width: 18ch;
	margin: 0;
	font-size: clamp(1.65rem, 1.35rem + 1.2vw, 2.4rem);
	line-height: 1.12;
	text-wrap: balance;
}

.article-cta__text {
	max-width: 55ch;
	margin: var(--wps-space-sm) 0 0;
	color: color-mix(in srgb, var(--wps-color-bg) 78%, transparent);
}

.article-cta__button {
	display: inline-flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wps-space-sm);
	width: fit-content;
	align-self: end;
	padding: 0.85rem 1.1rem;
	color: var(--wps-color-text);
	background: var(--wps-color-bg);
	border-radius: 999px;
	font-size: var(--wps-font-size-sm);
	font-weight: 700;
	text-decoration: none;
	transition: transform var(--wps-transition-base), background-color var(--wps-transition-base);
}

.article-cta__button:hover,
.article-cta__button:focus-visible {
	transform: translateY(-2px);
	background: color-mix(in srgb, var(--wps-color-bg) 90%, var(--wps-color-secondary));
}

/* Automatic related articles below the reading column. */
.related-posts {
	max-width: var(--wps-grid-width);
	margin: 0 auto;
	padding: var(--wps-space-xl) var(--wps-page-padding) 0;
	border-top: 1px solid var(--wps-color-border);
}

.related-posts__header {
	margin-bottom: var(--wps-space-lg);
}

.related-posts__header h2 {
	margin: 0;
	font-size: clamp(1.8rem, 1.5rem + 1.2vw, 2.6rem);
	line-height: var(--wps-line-height-tight);
}

.card-grid--related {
	margin-bottom: 0;
}

@media (min-width: 760px) {
	.article-cta {
		grid-template-columns: minmax(0, 1fr) auto;
		align-items: end;
	}
}

.entry-meta-label {
	font-weight: 600;
	color: var(--wps-color-text);
	margin-right: var(--wps-space-xs);
}

.entry-categories a,
.entry-tags a {
	color: var(--wps-color-primary);
	text-decoration: none;
}

.entry-categories a:hover,
.entry-categories a:focus-visible,
.entry-tags a:hover,
.entry-tags a:focus-visible {
	text-decoration: underline;
}

/* Entry meta (single post) */
.entry-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wps-space-xs);
	color: var(--wps-color-text-muted);
	font-size: var(--wps-font-size-sm);
	line-height: var(--wps-line-height-meta);
}

.entry-meta__author a {
	color: var(--wps-color-text);
	font-weight: 500;
	text-decoration: none;
}

.entry-meta__author a:hover,
.entry-meta__author a:focus-visible {
	color: var(--wps-color-primary);
}

.entry-meta__separator {
	color: var(--wps-color-border);
}

/* ==========================================================================
   6b. Entry sources section (Customizer-gated)
   ========================================================================== */

.entry-sources {
	max-width: var(--wps-content-width);
	margin: var(--wps-space-lg) auto 0;
	padding: var(--wps-space-md);
	background: color-mix(in srgb, var(--wps-color-primary) 4%, var(--wps-color-bg));
	border: 1px solid var(--wps-color-border);
	border-radius: 4px;
}

.entry-sources__title {
	margin: 0 0 var(--wps-space-sm);
	font-size: 1.125rem;
	font-weight: 600;
	color: var(--wps-color-text);
}

.entry-sources__list {
	margin: 0;
	padding-left: var(--wps-space-md);
	display: flex;
	flex-direction: column;
	gap: var(--wps-space-xs);
	font-size: var(--wps-font-size-sm);
	color: var(--wps-color-text-muted);
	line-height: var(--wps-line-height-meta);
}

.entry-sources__item a {
	color: var(--wps-color-primary);
	text-decoration: none;
	word-break: break-word;
}

.entry-sources__item a:hover,
.entry-sources__item a:focus-visible {
	text-decoration: underline;
}

/* ==========================================================================
   7. Breadcrumb
   ========================================================================== */

.breadcrumb {
	max-width: var(--wps-content-width);
	margin: 0 auto var(--wps-space-md);
	padding: 0 var(--wps-page-padding);
	font-size: var(--wps-font-size-sm);
	color: var(--wps-color-text-muted);
}

.breadcrumb__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--wps-space-xs);
}

.breadcrumb__item {
	display: inline-flex;
	align-items: center;
}

.breadcrumb__item:not(:last-child)::after {
	content: '›';
	margin-left: var(--wps-space-xs);
	color: var(--wps-color-border);
}

.breadcrumb__item a {
	color: var(--wps-color-text-muted);
	text-decoration: none;
}

.breadcrumb__item a:hover,
.breadcrumb__item a:focus-visible {
	color: var(--wps-color-primary);
	text-decoration: underline;
}

.breadcrumb__item span[aria-current='page'] {
	color: var(--wps-color-text);
	font-weight: 500;
}

/* ==========================================================================
   8. Pagination (archive + search)
   ========================================================================== */

.navigation.pagination {
	max-width: var(--wps-content-width);
	margin: var(--wps-space-lg) auto;
}

.nav-links {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: var(--wps-space-xs);
}

.nav-links a,
.nav-links span {
	padding: var(--wps-space-xs) var(--wps-space-sm);
	border-radius: 4px;
	font-size: var(--wps-font-size-sm);
	text-decoration: none;
	color: var(--wps-color-text);
	min-width: 2.5rem;
	text-align: center;
}

.nav-links a {
	border: 1px solid var(--wps-color-border);
	transition: background-color var(--wps-transition-base),
		border-color var(--wps-transition-base);
}

.nav-links a:hover,
.nav-links a:focus-visible {
	background-color: var(--wps-color-border);
	border-color: var(--wps-color-text-muted);
}

.nav-links .current {
	background-color: var(--wps-color-primary);
	color: #fff;
	border: 1px solid var(--wps-color-primary);
}

.nav-links .dots {
	border: none;
	color: var(--wps-color-text-muted);
}

/* ==========================================================================
   9. Scroll-reveal (assets/js/main.js adds .is-revealed on intersection)
   ========================================================================== */

[data-reveal] {
	opacity: 0;
	transform: translateY(24px);
	transition: opacity var(--wps-reveal-duration) cubic-bezier(0.2, 0.8, 0.2, 1),
		transform var(--wps-reveal-duration) cubic-bezier(0.2, 0.8, 0.2, 1);
}

[data-reveal].is-revealed {
	opacity: 1;
	transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
	[data-reveal] {
		opacity: 1 !important;
		transform: none !important;
		transition: none !important;
	}
}

/* ==========================================================================
   10. Search form (used in header and 404)
   ========================================================================== */

.search-form {
	max-width: var(--wps-content-width);
	margin: 0 auto;
}

.search-form__inner {
	display: flex;
	gap: var(--wps-space-xs);
}

.search-form__input {
	flex: 1;
	padding: var(--wps-space-sm);
	font-family: inherit;
	font-size: var(--wps-font-size-base);
	color: var(--wps-color-text);
	background-color: var(--wps-color-bg);
	border: 1px solid var(--wps-color-border);
	border-radius: 4px;
	transition: border-color var(--wps-transition-base),
		box-shadow var(--wps-transition-base);
}

.search-form__input:focus {
	outline: none;
	border-color: var(--wps-color-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wps-color-primary) 20%, transparent);
}

.search-form__button {
	padding: var(--wps-space-sm) var(--wps-space-md);
	background-color: var(--wps-color-primary);
	color: #fff;
	border: 1px solid var(--wps-color-primary);
	border-radius: 4px;
	font-family: inherit;
	font-size: var(--wps-font-size-base);
	font-weight: 500;
	cursor: pointer;
	transition: transform var(--wps-transition-base),
		box-shadow var(--wps-transition-base);
}

.search-form__button:hover,
.search-form__button:focus-visible {
	transform: translateY(-1px);
	box-shadow: 0 8px 20px -8px color-mix(in srgb, var(--wps-color-primary) 50%, transparent);
}

.search-form__button:focus-visible {
	outline: 2px solid var(--wps-color-primary);
	outline-offset: 2px;
}

.search-empty {
	max-width: var(--wps-content-width);
	margin: 0 auto;
}

/* ==========================================================================
   11. 404 page
   ========================================================================== */

.site-main--error {
	max-width: var(--wps-content-width);
}

.error-content {
	display: flex;
	flex-direction: column;
	gap: var(--wps-space-lg);
}

.error-message {
	color: var(--wps-color-text-muted);
	font-size: 1.125rem;
}

.recent-posts {
	border-top: 1px solid var(--wps-color-border);
	padding-top: var(--wps-space-lg);
}

.recent-posts__title {
	font-size: var(--wps-font-size-h2);
	font-weight: 600;
	margin: 0 0 var(--wps-space-md);
}

.recent-posts__list {
	list-style: none;
	padding: 0;
	margin: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wps-space-sm);
}

.recent-posts__item {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: var(--wps-space-md);
	padding-bottom: var(--wps-space-sm);
	border-bottom: 1px solid var(--wps-color-border);
}

.recent-posts__item:last-child {
	border-bottom: none;
}

.recent-posts__item a {
	color: var(--wps-color-text);
	text-decoration: none;
	font-weight: 500;
}

.recent-posts__item a:hover,
.recent-posts__item a:focus-visible {
	color: var(--wps-color-primary);
}

.recent-posts__item time {
	color: var(--wps-color-text-muted);
	font-size: var(--wps-font-size-sm);
	flex-shrink: 0;
}

/* ==========================================================================
   12. Accessibility: respect prefers-reduced-motion
   ========================================================================== */

/* ==========================================================================
   4. Accessibility: respect prefers-reduced-motion
   ========================================================================== */

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