/**
 * PECB theme: a light base layer.
 *
 * Every colour, size and radius is a custom property on :root, so the PECB Child theme (or the
 * Customizer's Additional CSS) restyles the site by overriding variables, not selectors.
 * Elementor-built pages get no theme styling inside their content; the theme only frames them.
 */

/* ---------- Tokens ---------- */
:root {
	--pecb-brand: #a11e29;
	--pecb-brand-bright: #d71920;
	--pecb-ink: #0f172a;
	--pecb-text: #334155;
	--pecb-muted: #64748b;
	--pecb-line: #e2e8f0;
	--pecb-line-strong: #cbd5e1;
	--pecb-soft: #f8fafc;
	--pecb-surface: #fff;
	--pecb-bg: #fff;

	--pecb-font: "Parabolica", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--pecb-font-size: 1.0625rem;
	--pecb-line-height: 1.7;
	--pecb-heading-weight: 500;

	--pecb-container: 1280px;
	--pecb-container-wide: 1040px;
	--pecb-container-narrow: 760px;
	--pecb-gutter: clamp(16px, 4vw, 32px);
	--pecb-radius: 12px;
	--pecb-radius-sm: 8px;
	--pecb-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 8px 24px -12px rgba(15, 23, 42, .12);
	--pecb-header-height: 76px;
	--pecb-ease: cubic-bezier(.2, .7, .2, 1);
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
	margin: 0;
	background: var(--pecb-bg);
	color: var(--pecb-text);
	font-family: var(--pecb-font);
	font-size: var(--pecb-font-size);
	font-weight: 400;
	line-height: var(--pecb-line-height);
	-webkit-font-smoothing: antialiased;
	text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
	margin: 1.6em 0 .5em;
	color: var(--pecb-ink);
	font-family: inherit;
	font-weight: var(--pecb-heading-weight);
	line-height: 1.2;
	letter-spacing: -.01em;
}
h1 { font-size: clamp(2rem, 1.4rem + 2.4vw, 3rem); }
h2 { font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem); }
h3 { font-size: 1.375rem; }
h4 { font-size: 1.125rem; }
h5, h6 { font-size: 1rem; }

p, ul, ol, dl, figure, blockquote, pre, table { margin: 0 0 1.25em; }

a { color: var(--pecb-brand); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .2em; transition: color .2s var(--pecb-ease); }
a:hover { color: var(--pecb-ink); }

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

hr { height: 1px; margin: 2.5em 0; border: 0; background: var(--pecb-line); }

blockquote {
	padding: .25em 0 .25em 1.25em;
	border-left: 2px solid var(--pecb-brand);
	color: var(--pecb-ink);
	font-size: 1.15em;
}
blockquote cite { display: block; margin-top: .5em; color: var(--pecb-muted); font-size: .8em; font-style: normal; }

code, kbd, pre { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .9em; }
code { padding: .1em .35em; border-radius: 4px; background: var(--pecb-soft); }
pre { overflow: auto; padding: 1.25em; border: 1px solid var(--pecb-line); border-radius: var(--pecb-radius-sm); background: var(--pecb-soft); }
pre code { padding: 0; background: none; }

table { width: 100%; border-collapse: collapse; }
th, td { padding: .75em 1em; border-bottom: 1px solid var(--pecb-line); text-align: left; }
th { color: var(--pecb-ink); font-weight: 500; }

:focus-visible { outline: 2px solid var(--pecb-brand); outline-offset: 2px; }

::selection { background: rgba(161, 30, 41, .14); color: var(--pecb-ink); }

/* ---------- Accessibility ---------- */
.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	clip-path: inset(50%);
	white-space: nowrap;
	word-wrap: normal !important;
}
.skip-link:focus {
	z-index: 100000;
	top: 8px; left: 8px;
	width: auto; height: auto;
	padding: 12px 18px;
	clip: auto; clip-path: none;
	border-radius: var(--pecb-radius-sm);
	background: var(--pecb-ink);
	color: #fff;
	font-size: .9rem;
	text-decoration: none;
}

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

.site { display: flex; flex-direction: column; min-height: 100vh; }
.site-content { flex: 1 0 auto; }
.site-content:focus { outline: 0; }
.site-main { padding-block: clamp(40px, 6vw, 80px); }
.pecb-built-with-elementor .site-main { padding-block: 0; }

/* ---------- Buttons (match PECB Extensions: white, dark outline) ---------- */
.button,
button[type="submit"],
input[type="submit"],
.wp-block-button__link,
.wp-element-button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: .5em;
	/* min-height: 44px; */
	padding: .6em 1.4em;
	border: 0;
	border-radius: 999px;
	background: var(--pecb-surface);
	box-shadow: inset 0 0 0 1px var(--pecb-ink);
	color: var(--pecb-ink);
	font-family: var(--pecb-font);
	font-size: .9375rem;
	font-weight: 500;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color .2s var(--pecb-ease), color .2s var(--pecb-ease), box-shadow .2s var(--pecb-ease);
}
.button:hover,
button[type="submit"]:hover,
input[type="submit"]:hover,
.wp-block-button__link:hover,
.wp-element-button:hover {
	background: var(--pecb-ink);
	box-shadow: inset 0 0 0 1px var(--pecb-ink);
	color: #fff;
}

/* ---------- Forms ---------- */
input[type="text"], input[type="email"], input[type="url"], input[type="password"],
input[type="search"], input[type="number"], input[type="tel"], textarea, select {
	width: 100%;
	min-height: 44px;
	padding: .6em .9em;
	border: 1px solid var(--pecb-line-strong);
	border-radius: var(--pecb-radius-sm);
	background: var(--pecb-surface);
	color: var(--pecb-ink);
	font: inherit;
	font-size: .9375rem;
	transition: border-color .2s var(--pecb-ease), box-shadow .2s var(--pecb-ease);
}
input:focus, textarea:focus, select:focus {
	outline: 0;
	border-color: var(--pecb-ink);
	box-shadow: 0 0 0 3px rgba(15, 23, 42, .08);
}
label { color: var(--pecb-ink); font-size: .9rem; font-weight: 500; }

.search-form { display: flex; gap: 8px; max-width: 520px; }
.search-form .search-field { flex: 1; border-radius: 999px; padding-inline: 1.2em; }
.search-form .search-submit { flex: 0 0 auto; }

/* ---------- Header (fallback, when no Elementor header applies) ---------- */
.site-header {
	position: sticky;
	z-index: 50;
	top: 0;
	border-bottom: 1px solid var(--pecb-line);
	background: rgba(255, 255, 255, .92);
	-webkit-backdrop-filter: saturate(1.4) blur(10px);
	backdrop-filter: saturate(1.4) blur(10px);
}
.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; } }

.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; min-height: var(--pecb-header-height); }
.site-branding img { width: auto; max-height: 44px; }
.site-title { color: var(--pecb-ink); font-size: 1.25rem; font-weight: 500; letter-spacing: -.01em; text-decoration: none; }
.site-title:hover { color: var(--pecb-brand); }

.site-navigation .menu { display: flex; align-items: center; gap: 4px; margin: 0; padding: 0; list-style: none; }
.site-navigation .menu > li { position: relative; }
.site-navigation a {
	display: block;
	padding: 8px 14px;
	border-radius: 999px;
	color: var(--pecb-ink);
	font-size: .9375rem;
	font-weight: 400;
	text-decoration: none;
	transition: background-color .2s var(--pecb-ease), color .2s var(--pecb-ease);
}
.site-navigation a:hover,
.site-navigation .current-menu-item > a,
.site-navigation .current-menu-ancestor > a { background: var(--pecb-soft); color: var(--pecb-brand); }

/* Dropdowns (one level) */
.site-navigation .sub-menu {
	position: absolute;
	top: 100%; left: 0;
	min-width: 220px;
	margin: 0; padding: 8px;
	list-style: none;
	border: 1px solid var(--pecb-line);
	border-radius: var(--pecb-radius);
	background: var(--pecb-surface);
	box-shadow: var(--pecb-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(6px);
	transition: opacity .2s var(--pecb-ease), transform .2s var(--pecb-ease), visibility .2s;
}
.site-navigation li:hover > .sub-menu,
.site-navigation li:focus-within > .sub-menu { opacity: 1; visibility: visible; transform: none; }
.site-navigation .sub-menu a { border-radius: var(--pecb-radius-sm); }

.menu-hint { color: var(--pecb-muted); font-size: .875rem; }

/* Menu button */
.menu-toggle {
	display: none;
	position: relative;
	width: 44px; height: 44px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: var(--pecb-surface);
	box-shadow: inset 0 0 0 1px var(--pecb-line-strong);
	cursor: pointer;
}
.menu-toggle__lines,
.menu-toggle__lines::before,
.menu-toggle__lines::after {
	position: absolute;
	left: 50%;
	width: 18px; height: 1.5px;
	margin-left: -9px;
	border-radius: 2px;
	background: var(--pecb-ink);
	transition: transform .25s var(--pecb-ease), opacity .2s;
}
.menu-toggle__lines { top: 50%; }
.menu-toggle__lines::before,
.menu-toggle__lines::after { content: ""; left: 0; margin-left: 0; }
.menu-toggle__lines::before { transform: translateY(-6px); }
.menu-toggle__lines::after { transform: translateY(6px); }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines { background: transparent; }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines::before { background: var(--pecb-ink); transform: rotate(45deg); }
.menu-toggle[aria-expanded="true"] .menu-toggle__lines::after { background: var(--pecb-ink); transform: rotate(-45deg); }

@media (max-width: 960px) {
	.menu-toggle { display: inline-block; }
	.site-navigation {
		position: absolute;
		top: 100%; left: 0; right: 0;
		max-height: calc(100vh - var(--pecb-header-height));
		overflow-y: auto;
		padding: 12px var(--pecb-gutter) 24px;
		border-bottom: 1px solid var(--pecb-line);
		background: var(--pecb-surface);
		box-shadow: var(--pecb-shadow);
		display: none;
	}
	.site-navigation.is-open { display: block; }
	.site-navigation .menu { flex-direction: column; align-items: stretch; gap: 2px; }
	.site-navigation a { padding: 12px 14px; border-radius: var(--pecb-radius-sm); }
	.site-navigation .sub-menu {
		position: static;
		min-width: 0;
		padding: 0 0 0 14px;
		border: 0;
		box-shadow: none;
		opacity: 1; visibility: visible; transform: none;
	}
	.no-js .site-navigation { display: block; position: static; box-shadow: none; }
}

/* ---------- Footer (fallback) ---------- */
.site-footer {
	margin-top: auto;
	padding-block: 48px 32px;
	border-top: 1px solid var(--pecb-line);
	background: var(--pecb-soft);
	color: var(--pecb-muted);
	font-size: .9375rem;
}
.site-footer__widgets { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 32px; margin-bottom: 40px; }
.site-footer .widget-title { margin: 0 0 .75em; font-size: 1rem; }
.site-footer .widget ul { margin: 0; padding: 0; list-style: none; }
.site-footer .widget li + li { margin-top: .4em; }
.site-footer a { color: var(--pecb-text); text-decoration: none; }
.site-footer a:hover { color: var(--pecb-brand); }
.site-footer__bottom { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; border-top: 1px solid var(--pecb-line); }
.site-footer__copy { margin: 0; }
.site-footer__nav .menu { display: flex; flex-wrap: wrap; gap: 20px; margin: 0; padding: 0; list-style: none; }

/* ---------- Page headers ---------- */
.page-header { margin-bottom: clamp(32px, 4vw, 48px); }
.page-title { margin: 0 0 .35em; }
.page-title span { color: var(--pecb-brand); }
.page-description { max-width: 640px; color: var(--pecb-muted); font-size: 1.0625rem; }
.page-description > :last-child { margin-bottom: 0; }
.page-header .search-form { margin-top: 24px; }

.entry-eyebrow {
	display: inline-block;
	margin-bottom: .75em;
	color: var(--pecb-brand);
	font-size: .75rem;
	font-weight: 500;
	letter-spacing: .08em;
	text-decoration: none;
	text-transform: uppercase;
}
a.entry-eyebrow:hover { color: var(--pecb-ink); }

/* ---------- Post grid and cards ---------- */
.post-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 28px; }

.card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	border: 1px solid var(--pecb-line);
	border-radius: var(--pecb-radius);
	background: var(--pecb-surface);
	transition: border-color .25s var(--pecb-ease), box-shadow .25s var(--pecb-ease), transform .25s var(--pecb-ease);
}
.card:hover { border-color: var(--pecb-line-strong); box-shadow: var(--pecb-shadow); transform: translateY(-2px); }
.card .entry-media { display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--pecb-soft); }
.card .entry-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--pecb-ease); }
.card:hover .entry-media img { transform: scale(1.03); }
.card__body { display: flex; flex: 1; flex-direction: column; padding: 22px 24px 26px; }
.card__title { margin: 0 0 .5em; font-size: 1.25rem; line-height: 1.3; }
.card__title a { color: var(--pecb-ink); text-decoration: none; }
.card__title a::after { content: ""; position: absolute; inset: 0; }
.card { position: relative; }
.card__title a:hover { color: var(--pecb-brand); }
.card .entry-eyebrow { position: relative; z-index: 1; }
.card__excerpt { color: var(--pecb-muted); font-size: .9375rem; }
.card__excerpt p { margin: 0; }

.entry-meta { margin-bottom: .75em; color: var(--pecb-muted); font-size: .875rem; }

/* ---------- Single entry ---------- */
.entry-header { margin-bottom: clamp(24px, 4vw, 40px); }
.entry-title { margin: 0 0 .4em; }
.entry .entry-media { margin: 0 0 clamp(32px, 4vw, 48px); overflow: hidden; border-radius: var(--pecb-radius); }
.entry .entry-media img { width: 100%; }

.entry-content > * { margin-block: 0 1.25em; }
.entry-content > h2, .entry-content > h3, .entry-content > h4 { margin-top: 1.8em; }
.entry-content ul, .entry-content ol { padding-left: 1.25em; }
.entry-content li + li { margin-top: .35em; }
.entry-content li::marker { color: var(--pecb-brand); }
.entry-content .alignwide { margin-inline: calc((var(--pecb-container-wide) - var(--pecb-container-narrow)) / -2); }
.entry-content .alignfull { width: 100vw; max-width: 100vw; margin-inline: calc(50% - 50vw); }
@media (max-width: 1080px) { .entry-content .alignwide { margin-inline: 0; } }
.alignleft { float: left; margin: .3em 1.5em 1em 0; }
.alignright { float: right; margin: .3em 0 1em 1.5em; }
.aligncenter { margin-inline: auto; }
.wp-caption-text, figcaption { margin-top: .6em; color: var(--pecb-muted); font-size: .875rem; text-align: center; }

.page-links { display: flex; gap: 8px; margin-top: 2em; }

.entry-footer { margin-top: 32px; }
.tag-list { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list a {
	padding: 4px 12px;
	border: 1px solid var(--pecb-line);
	border-radius: 999px;
	color: var(--pecb-text);
	font-size: .8125rem;
	text-decoration: none;
}
.tag-list a:hover { border-color: var(--pecb-ink); color: var(--pecb-ink); }

/* ---------- Post navigation and pagination ---------- */
.post-navigation { margin-top: 56px; }
.post-navigation .nav-links { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; padding-top: 32px; border-top: 1px solid var(--pecb-line); }
.post-navigation .nav-next { text-align: right; }
.post-navigation a { display: block; color: var(--pecb-ink); text-decoration: none; }
.post-navigation a:hover .nav-title { color: var(--pecb-brand); }
.nav-label { display: block; margin-bottom: 4px; color: var(--pecb-muted); font-size: .75rem; letter-spacing: .08em; text-transform: uppercase; }
.nav-title { font-weight: 500; transition: color .2s var(--pecb-ease); }

.pagination { margin-top: 56px; }
.pagination .nav-links { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px; height: 42px;
	padding: 0 12px;
	border-radius: 999px;
	color: var(--pecb-ink);
	font-size: .9375rem;
	text-decoration: none;
	transition: background-color .2s var(--pecb-ease), box-shadow .2s var(--pecb-ease);
}
.pagination a.page-numbers:hover { box-shadow: inset 0 0 0 1px var(--pecb-line-strong); }
.pagination .page-numbers.current { background: var(--pecb-ink); color: #fff; }

/* ---------- Comments ---------- */
.comments-area { margin-top: 64px; padding-top: 40px; border-top: 1px solid var(--pecb-line); }
.comments-title { margin-top: 0; font-size: 1.375rem; }
.comment-list, .comment-list .children { margin: 0; padding: 0; list-style: none; }
.comment-list .children { margin-left: clamp(16px, 4vw, 48px); }
.comment-body { padding: 20px 0; border-bottom: 1px solid var(--pecb-line); }
.comment-author { display: flex; align-items: center; gap: 12px; color: var(--pecb-ink); font-weight: 500; }
.comment-author .avatar { border-radius: 50%; }
.comment-author .says { display: none; }
.comment-metadata { margin: 4px 0 12px 60px; font-size: .8125rem; }
.comment-metadata a { color: var(--pecb-muted); text-decoration: none; }
.comment-content { margin-left: 60px; }
.reply { margin-left: 60px; font-size: .875rem; }
.comment-respond { margin-top: 40px; }
.comment-form p { margin-bottom: 1em; }
.comment-form label { display: block; margin-bottom: 6px; }
.comment-form-cookies-consent { display: flex; align-items: flex-start; gap: 8px; }
.comment-form-cookies-consent label { display: inline; margin: 0; font-weight: 400; }

/* ---------- 404 and empty states ---------- */
.error-404 { text-align: center; }
.error-404 .entry-eyebrow { font-size: 1rem; }
.error-404 .page-description { margin-inline: auto; }
.error-404 .search-form { margin: 32px auto 24px; }
.no-results { padding: 48px 0; text-align: center; }
.no-results .search-form { margin: 24px auto 0; }

/* ---------- Widgets ---------- */
.widget { font-size: .9375rem; }
.widget_search .search-form { max-width: none; }

/* ---------- WordPress core ---------- */
.sticky .card__title::before { content: "★ "; color: var(--pecb-brand); }
.bypostauthor > .comment-body .fn::after { content: " ·"; color: var(--pecb-brand); }
.gallery { display: grid; grid-template-columns: repeat(var(--cols, 3), 1fr); gap: 12px; }
.gallery-columns-2 { --cols: 2; } .gallery-columns-4 { --cols: 4; } .gallery-columns-5 { --cols: 5; }
.gallery-item { margin: 0; }
