/* ==========================================================================
   Felx theme – main stylesheet
   One accent colour, neutral greys, system fonts (no web-font download).
   ========================================================================== */

:root {
	--fx-accent: #2346d8;
	--fx-accent-hover: #1a37b5;
	--fx-accent-soft: #eef2ff;
	--fx-text: #101828;
	--fx-muted: #475467;
	--fx-subtle: #667085;
	--fx-border: #e4e7ec;
	--fx-border-strong: #d0d5dd;
	--fx-surface: #ffffff;
	--fx-surface-alt: #f7f8fa;
	--fx-radius: 10px;
	--fx-radius-lg: 14px;
	--fx-shadow: 0 1px 2px rgba(16, 24, 40, .06);
	--fx-shadow-md: 0 4px 12px -2px rgba(16, 24, 40, .08), 0 2px 4px -2px rgba(16, 24, 40, .04);
	--fx-focus: 0 0 0 3px rgba(35, 70, 216, .35);
	--fx-wrap: 1160px;
	--fx-narrow: 760px;
	--fx-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
	--fx-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	--header-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
	margin: 0;
	font-family: var(--fx-font);
	font-size: 1rem;
	line-height: 1.6;
	color: var(--fx-text);
	background: var(--fx-surface);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}
img, svg, video { max-width: 100%; height: auto; }
h1, h2, h3, h4 { line-height: 1.25; color: var(--fx-text); font-weight: 700; }
a { color: var(--fx-accent); text-underline-offset: 2px; }
a:hover { color: var(--fx-accent-hover); }
:focus-visible { outline: 3px solid rgba(35, 70, 216, .5); outline-offset: 2px; }
code { font-family: var(--fx-mono); font-size: .9em; background: var(--fx-surface-alt); border: 1px solid var(--fx-border); border-radius: 5px; padding: .1em .35em; }
hr { border: 0; border-top: 1px solid var(--fx-border); margin: 2rem 0; }

.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 {
	position: absolute;
	left: 1rem;
	top: -100px;
	z-index: 100;
	padding: .75rem 1rem;
	background: var(--fx-text);
	color: #fff;
	border-radius: var(--fx-radius);
	font-weight: 600;
	text-decoration: none;
}
.skip-link:focus { top: 1rem; color: #fff; }

.wrap { width: 100%; max-width: var(--fx-wrap); margin: 0 auto; padding: 0 1.25rem; }
.wrap--narrow { max-width: calc(var(--fx-narrow) + 2.5rem); }
.section-pad { padding-top: 2.5rem; padding-bottom: 3rem; }
.section-pad-bottom { padding-bottom: 3.5rem; }
.site-main { display: block; min-height: 60vh; outline: none; }

/* ---------- Buttons ---------- */
.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5rem;
	min-height: 44px;
	padding: .5rem 1rem;
	border: 1px solid transparent;
	border-radius: var(--fx-radius);
	font: inherit;
	font-weight: 600;
	font-size: .9375rem;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .15s, color .15s;
}
.btn--primary { background: var(--fx-accent); color: #fff; }
.btn--primary:hover { background: var(--fx-accent-hover); color: #fff; }
.btn:focus-visible { outline: none; box-shadow: var(--fx-focus); }

/* ---------- Header ---------- */
.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: rgba(255, 255, 255, .96);
	border-bottom: 1px solid var(--fx-border);
}
@supports (backdrop-filter: blur(8px)) {
	.site-header { background: rgba(255, 255, 255, .88); backdrop-filter: saturate(180%) blur(8px); }
}
.admin-bar .site-header { top: 32px; }
@media (max-width: 782px) { .admin-bar .site-header { top: 46px; } }
@media (max-width: 600px) { .admin-bar .site-header { top: 0; position: relative; } }

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

.site-logo { margin: 0; flex: none; }
.site-logo a { display: inline-flex; align-items: center; gap: .55rem; color: var(--fx-text); text-decoration: none; }
.site-logo__mark { color: var(--fx-accent); display: block; }
.site-logo__text { font-size: 1.25rem; font-weight: 800; letter-spacing: .14em; }
.custom-logo-link img { max-height: 40px; width: auto; }

.site-nav { margin-left: auto; display: flex; align-items: center; gap: 1.5rem; }
.site-nav__list { display: flex; align-items: center; gap: .25rem; list-style: none; margin: 0; padding: 0; }
.site-nav__list a {
	display: block;
	padding: .5rem .75rem;
	border-radius: 8px;
	color: var(--fx-muted);
	font-weight: 550;
	font-size: .9375rem;
	text-decoration: none;
}
.site-nav__list a:hover { color: var(--fx-text); background: var(--fx-surface-alt); }
.site-nav__list .current-menu-item > a,
.site-nav__list .current_page_item > a,
.site-nav__list .current-page-ancestor > a,
.site-nav__list a[aria-current="page"] { color: var(--fx-text); }

.nav-toggle {
	display: none;
	margin-left: auto;
	align-items: center;
	gap: .5rem;
	min-height: 44px;
	padding: .375rem .75rem;
	border: 1px solid var(--fx-border-strong);
	border-radius: var(--fx-radius);
	background: var(--fx-surface);
	color: var(--fx-text);
	font: inherit;
	font-weight: 600;
	font-size: .9375rem;
	cursor: pointer;
}
.nav-toggle__bars { display: inline-flex; flex-direction: column; gap: 4px; width: 18px; }
.nav-toggle__bars span { display: block; height: 2px; background: currentColor; border-radius: 2px; transition: transform .2s, opacity .2s; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 899px) {
	.nav-toggle { display: inline-flex; }
	.site-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		flex-direction: column;
		align-items: stretch;
		gap: .75rem;
		padding: .75rem 1.25rem 1.25rem;
		background: var(--fx-surface);
		border-bottom: 1px solid var(--fx-border);
		box-shadow: 0 12px 24px -12px rgba(16, 24, 40, .2);
		max-height: calc(100vh - var(--header-h));
		overflow-y: auto;
	}
	.site-nav.is-open { display: flex; }
	.site-nav__list { flex-direction: column; align-items: stretch; gap: 0; }
	.site-nav__list li { border-bottom: 1px solid var(--fx-border); }
	.site-nav__list a { padding: .875rem .25rem; font-size: 1rem; border-radius: 0; }
	.site-nav__list a:hover { background: transparent; }
	.site-nav__cta { width: 100%; min-height: 48px; }
}
@media (prefers-reduced-motion: reduce) { .nav-toggle__bars span { transition: none; } }

/* ---------- Page header & breadcrumbs ---------- */
.page-header { padding: 2rem 0 1.5rem; }
.page-header--center { text-align: center; padding: 3.5rem 0 2rem; }
.page-title { margin: 0; font-size: clamp(1.75rem, 4.2vw, 2.5rem); letter-spacing: -.02em; }
.page-lead { margin: .75rem 0 0; color: var(--fx-muted); font-size: 1.0625rem; max-width: 44rem; }
.page-header--center .page-lead { margin-left: auto; margin-right: auto; margin-bottom: 1.5rem; }
.error-code { margin: 0 0 .5rem; font-size: .875rem; font-weight: 700; letter-spacing: .1em; color: var(--fx-accent); }

.breadcrumbs { margin: 0 0 .875rem; font-size: .875rem; }
.breadcrumbs ol { display: flex; flex-wrap: wrap; list-style: none; margin: 0; padding: 0; color: var(--fx-subtle); }
.breadcrumbs li { display: inline-flex; align-items: center; }
.breadcrumbs li + li::before { content: "/"; margin: 0 .5rem; color: var(--fx-border-strong); }
.breadcrumbs a { color: var(--fx-muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--fx-accent); text-decoration: underline; }
.breadcrumbs [aria-current] { color: var(--fx-text); }

.page-content { padding-bottom: 3rem; }
.page-content > p:first-child:not([class]) { color: var(--fx-muted); font-size: 1.0625rem; max-width: 46rem; margin-top: 0; }

/* ---------- Reading content ---------- */
.prose { padding-bottom: 3rem; font-size: 1.0625rem; line-height: 1.75; }
.prose > * { margin-top: 0; margin-bottom: 1.15em; }
.prose h2 { font-size: clamp(1.375rem, 3vw, 1.625rem); margin-top: 2.25em; margin-bottom: .6em; letter-spacing: -.01em; }
.prose h3 { font-size: 1.1875rem; margin-top: 1.75em; margin-bottom: .5em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: .45em; }
.prose li::marker { color: var(--fx-subtle); }
.prose blockquote { margin-left: 0; padding: .25rem 0 .25rem 1.25rem; border-left: 3px solid var(--fx-accent); color: var(--fx-muted); }
.prose img { border-radius: var(--fx-radius); }
.prose table { width: 100%; border-collapse: collapse; font-size: .9375rem; }
.prose th, .prose td { padding: .625rem .75rem; border-bottom: 1px solid var(--fx-border); text-align: left; }
.prose .wp-block-image figcaption, .prose figcaption { font-size: .875rem; color: var(--fx-subtle); text-align: center; }

.entry-meta { margin: .75rem 0 0; color: var(--fx-subtle); font-size: .9375rem; }
.article__image { margin: 0 0 2rem; }
.article__image img { display: block; width: 100%; border-radius: var(--fx-radius-lg); }
.article__tools { margin: 1rem 0 2.5rem; padding: 1.5rem; background: var(--fx-surface-alt); border: 1px solid var(--fx-border); border-radius: var(--fx-radius-lg); }
.article__tools h2 { margin: 0 0 1rem; font-size: 1.25rem; }
.article__tools .fx-grid { grid-template-columns: repeat(auto-fill, minmax(min(100%, 240px), 1fr)); }

.post-navigation { margin: 0 0 3.5rem; }
.post-navigation .nav-links { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); }
.post-navigation a { display: flex; flex-direction: column; gap: .25rem; height: 100%; padding: 1rem 1.25rem; border: 1px solid var(--fx-border); border-radius: var(--fx-radius-lg); text-decoration: none; color: var(--fx-text); }
.post-navigation a:hover { border-color: var(--fx-border-strong); box-shadow: var(--fx-shadow-md); }
.post-navigation .nav-next { text-align: right; }
.post-nav__label { font-size: .8125rem; color: var(--fx-subtle); }
.post-nav__title { font-weight: 650; }

/* ---------- Post listings ---------- */
.post-grid { display: grid; gap: 1.25rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 320px), 1fr)); margin-bottom: 1.25rem; }
.post-card { display: flex; flex-direction: column; border: 1px solid var(--fx-border); border-radius: var(--fx-radius-lg); background: var(--fx-surface); overflow: hidden; box-shadow: var(--fx-shadow); transition: box-shadow .15s, border-color .15s; }
.post-card:hover { box-shadow: var(--fx-shadow-md); border-color: var(--fx-border-strong); }
.post-card__image img { display: block; width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.post-card__body { display: flex; flex-direction: column; flex: 1; padding: 1.25rem; }
.post-card__cat { margin: 0 0 .5rem; font-size: .75rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fx-accent); }
.post-card__title { margin: 0 0 .5rem; font-size: 1.1875rem; }
.post-card__title a { color: var(--fx-text); text-decoration: none; }
.post-card__title a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card__title a:focus-visible { outline: none; }
.post-card:focus-within { box-shadow: var(--fx-focus); }
.post-card__excerpt { margin: 0 0 1rem; color: var(--fx-muted); font-size: .9375rem; flex: 1; }
.post-card__meta { margin: 0; font-size: .8125rem; color: var(--fx-subtle); }
.empty-state { color: var(--fx-muted); }

.pagination { margin: 2rem 0 0; }
.pagination .nav-links { display: flex; flex-wrap: wrap; gap: .375rem; }
.pagination .page-numbers { display: inline-grid; place-items: center; min-width: 44px; min-height: 44px; padding: 0 .75rem; border: 1px solid var(--fx-border); border-radius: var(--fx-radius); color: var(--fx-text); text-decoration: none; font-weight: 600; }
.pagination .page-numbers.current { background: var(--fx-accent); border-color: var(--fx-accent); color: #fff; }
.pagination a.page-numbers:hover { background: var(--fx-surface-alt); }

/* ---------- Search form ---------- */
.search-form { display: flex; gap: .5rem; max-width: 520px; }
.search-form__input { flex: 1; min-width: 0; min-height: 44px; padding: .5rem .75rem; border: 1px solid var(--fx-border-strong); border-radius: var(--fx-radius); font: inherit; font-size: 1rem; }
.search-form__input:focus { outline: none; border-color: var(--fx-accent); box-shadow: var(--fx-focus); }

/* ---------- Ad slots ---------- */
.ad-slot { margin: 2.5rem auto; max-width: var(--fx-wrap); padding: 0 1.25rem; text-align: center; min-height: 120px; }
.fx-article .ad-slot, .prose + .ad-slot { padding: 0; }
.ad-slot__label { margin: 0 0 .375rem; font-size: .6875rem; letter-spacing: .08em; text-transform: uppercase; color: var(--fx-subtle); }

/* ---------- Footer ---------- */
.site-footer { margin-top: 0; background: var(--fx-surface-alt); border-top: 1px solid var(--fx-border); font-size: .9375rem; }
.site-footer__grid { display: grid; gap: 2rem 1.5rem; grid-template-columns: repeat(2, minmax(0, 1fr)); padding-top: 3rem; padding-bottom: 2.5rem; }
.site-footer__brand { grid-column: 1 / -1; max-width: 22rem; }
.site-footer__brand p { margin: .75rem 0 0; color: var(--fx-muted); }
.site-footer__privacy { font-size: .8125rem; color: var(--fx-subtle) !important; }
.site-footer__title { margin: 0 0 .75rem; font-size: .8125rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--fx-text); }
.site-footer__title a { color: inherit; text-decoration: none; }
.site-footer__title a:hover { color: var(--fx-accent); }
.site-footer__links { list-style: none; margin: 0; padding: 0; }
.site-footer__links li { margin: 0 0 .5rem; }
.site-footer__links a { color: var(--fx-muted); text-decoration: none; display: inline-block; padding: .125rem 0; }
.site-footer__links a:hover { color: var(--fx-accent); text-decoration: underline; }
.site-footer__bottom { border-top: 1px solid var(--fx-border); }
.site-footer__bottom p { margin: 0; padding: 1.25rem 0; font-size: .875rem; color: var(--fx-subtle); text-align: center; }
.site-footer__credit { white-space: nowrap; }
@media (min-width: 700px) { .site-footer__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) {
	.site-footer__grid { grid-template-columns: 1.6fr repeat(5, minmax(0, 1fr)); }
	.site-footer__brand { grid-column: auto; }
}

/* ---------- Front page ---------- */
.front-content > :first-child { margin-top: 0; }

/* ---------- WordPress core alignment helpers ---------- */
.alignleft { float: left; margin: .25rem 1.5rem 1rem 0; }
.alignright { float: right; margin: .25rem 0 1rem 1.5rem; }
.aligncenter { display: block; margin-left: auto; margin-right: auto; }
.wp-caption-text { font-size: .875rem; color: var(--fx-subtle); }
.sticky .post-card__title::before { content: "★ "; color: var(--fx-accent); }

@media print {
	.site-header, .site-footer, .ad-slot, .fx-related, .article__tools, .post-navigation { display: none !important; }
}
