/**
 * Layout primitives, header, hero and footer.
 */

.pct-container {
	width: 100%;
	max-width: var(--pct-container);
	margin-inline: auto;
	padding-inline: var(--pct-gutter);
}

.pct-container--narrow {
	max-width: var(--pct-container-narrow);
}

.pct-section {
	padding-block: var(--pct-space-16);
}

.pct-section--tight {
	padding-block: var(--pct-space-10);
}

.pct-section--subtle {
	background: var(--pct-bg-subtle);
}

/* The title band under the site header. Used by page.php, search.php and
   tag.php, so it belongs here rather than in blog.css, which only pages of the
   blog load — without it the title sits flush against the navigation. */
.pct-page-header {
	padding-block: var(--pct-space-12) var(--pct-space-8);
	border-bottom: 1px solid var(--pct-border);
	background: var(--pct-bg-subtle);
}

.pct-page-header__title {
	margin-bottom: var(--pct-space-3);
}

.pct-page-header__description {
	max-width: 46rem;
	margin: 0;
	color: var(--pct-text-muted);
	font-size: var(--pct-text-lg);
}

.pct-section__header {
	max-width: 46rem;
	margin-bottom: var(--pct-space-10);
}

.pct-faq-section .pct-section__header {
	max-width: 48rem;
	margin-inline: auto;
	text-align: center;
}

.pct-section__eyebrow {
	display: inline-block;
	margin-bottom: var(--pct-space-3);
	color: var(--pct-accent);
	font-size: var(--pct-text-sm);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

.pct-section__lead {
	color: var(--pct-text-muted);
	font-size: var(--pct-text-lg);
}

.pct-site {
	display: flex;
	flex-direction: column;
	min-height: 100vh;
}

.pct-main {
	flex: 1 0 auto;
}

/* ---------------------------------------------------------------------------
 * Header
 * ------------------------------------------------------------------------ */

.pct-header {
	position: sticky;
	top: 0;
	z-index: 100;
	background: color-mix(in srgb, var(--pct-bg) 88%, transparent);
	backdrop-filter: saturate(180%) blur(12px);
	border-bottom: 1px solid var(--pct-border);
}

/* Without backdrop-filter support the translucent background would let text
   show through, so fall back to an opaque bar. */
@supports not (backdrop-filter: blur(1px)) {
	.pct-header {
		background: var(--pct-bg);
	}
}

.pct-header__inner {
	display: flex;
	align-items: center;
	gap: var(--pct-space-4);
	min-height: var(--pct-header-height);
}

.pct-brand {
	display: inline-flex;
	align-items: center;
	gap: var(--pct-space-2);
	color: var(--pct-heading);
	font-size: var(--pct-text-lg);
	font-weight: 700;
	letter-spacing: -0.02em;
	text-decoration: none;
	white-space: nowrap;
}

.pct-brand:hover {
	color: var(--pct-accent);
}

.pct-brand__mark {
	display: grid;
	place-items: center;
	width: 32px;
	height: 32px;
	background: var(--pct-accent);
	border-radius: var(--pct-radius);
	color: var(--pct-accent-text);
	flex-shrink: 0;
}

.pct-brand__mark svg {
	width: 18px;
	height: 18px;
}

.pct-header__nav {
	display: none;
	margin-left: auto;
}

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

.pct-header__nav + .pct-header__actions {
	margin-left: var(--pct-space-2);
}

.pct-menu {
	display: flex;
	align-items: center;
	gap: var(--pct-space-1);
	margin: 0;
	padding: 0;
	list-style: none;
}

.pct-menu li {
	margin: 0;
	position: relative;
}

.pct-menu a {
	display: block;
	padding: var(--pct-space-2) var(--pct-space-3);
	border-radius: var(--pct-radius);
	color: var(--pct-text-muted);
	font-size: var(--pct-text-sm);
	font-weight: 500;
	text-decoration: none;
	white-space: nowrap;
	transition: color var(--pct-transition), background-color var(--pct-transition);
}

.pct-menu a:hover,
.pct-menu a:focus-visible {
	background: var(--pct-surface-hover);
	color: var(--pct-text);
}

.pct-menu .current-menu-item > a,
.pct-menu .current_page_item > a {
	background: var(--pct-accent-subtle);
	color: var(--pct-accent);
	font-weight: 600;
}

/* Submenus: hidden until hover or keyboard focus enters the branch. */
.pct-menu .sub-menu {
	position: absolute;
	top: calc(100% + var(--pct-space-2));
	left: 0;
	z-index: 10;
	min-width: 13rem;
	padding: var(--pct-space-2);
	margin: 0;
	list-style: none;
	background: var(--pct-surface-raised);
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius-md);
	box-shadow: var(--pct-shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(-4px);
	transition: opacity var(--pct-transition), transform var(--pct-transition), visibility var(--pct-transition);
}

.pct-menu li:hover > .sub-menu,
.pct-menu li:focus-within > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.pct-theme-toggle {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	background: transparent;
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius);
	color: var(--pct-text-muted);
	cursor: pointer;
	transition: background-color var(--pct-transition), color var(--pct-transition), border-color var(--pct-transition);
}

.pct-theme-toggle:hover {
	background: var(--pct-surface-hover);
	border-color: var(--pct-border-strong);
	color: var(--pct-text);
}

.pct-theme-toggle svg {
	grid-area: 1 / 1;
	fill: none;
}

/* Show whichever icon represents the mode the button switches TO. */
.pct-theme-toggle__moon {
	display: none;
}

:root[data-theme="light"] .pct-theme-toggle__sun {
	display: none;
}

:root[data-theme="light"] .pct-theme-toggle__moon {
	display: block;
}

:root[data-theme="dark"] .pct-theme-toggle__sun {
	display: block;
}

:root[data-theme="dark"] .pct-theme-toggle__moon {
	display: none;
}

.pct-menu-toggle {
	display: inline-grid;
	place-items: center;
	width: 38px;
	height: 38px;
	padding: 0;
	background: transparent;
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius);
	color: var(--pct-text-muted);
	cursor: pointer;
}

.pct-menu-toggle:hover {
	background: var(--pct-surface-hover);
	color: var(--pct-text);
}

.pct-menu-toggle svg {
	width: 20px;
	height: 20px;
	fill: none;
}

.pct-menu-toggle__close {
	display: none;
}

.pct-menu-toggle[aria-expanded="true"] .pct-menu-toggle__open {
	display: none;
}

.pct-menu-toggle[aria-expanded="true"] .pct-menu-toggle__close {
	display: block;
}

/* Mobile drawer. */
.pct-mobile-nav {
	display: none;
	padding-block: var(--pct-space-4);
	border-top: 1px solid var(--pct-border);
	background: var(--pct-bg);
}

.pct-mobile-nav.is-open {
	display: block;
}

.pct-mobile-nav .pct-menu {
	flex-direction: column;
	align-items: stretch;
	gap: 0;
}

.pct-mobile-nav .pct-menu a {
	padding: var(--pct-space-3) var(--pct-space-4);
	font-size: var(--pct-text-base);
}

.pct-mobile-nav .sub-menu {
	position: static;
	min-width: 0;
	padding: 0 0 0 var(--pct-space-4);
	background: none;
	border: 0;
	box-shadow: none;
	opacity: 1;
	visibility: visible;
	transform: none;
}

@media (min-width: 900px) {
	.pct-header__nav {
		display: block;
	}

	.pct-menu-toggle,
	.pct-mobile-nav {
		display: none !important;
	}
}

/* ---------------------------------------------------------------------------
 * Hero
 *
 * The tool sits inside the hero, so the hero is sized around it rather than
 * padded like a banner.
 * ------------------------------------------------------------------------ */

.pct-hero {
	position: relative;
	overflow: hidden;
	padding-block: var(--pct-space-10) var(--pct-space-12);
	background: var(--pct-hero-bg);
	border-bottom: 1px solid var(--pct-border);
}

.pct-hero::before {
	content: "";
	position: absolute;
	top: -30%;
	left: 50%;
	width: min(70rem, 120%);
	aspect-ratio: 2 / 1;
	transform: translateX(-50%);
	background: radial-gradient(ellipse at center, var(--pct-hero-glow) 0%, transparent 65%);
	pointer-events: none;
}

.pct-hero__inner {
	position: relative;
}

.pct-hero__header {
	max-width: 48rem;
	margin-bottom: var(--pct-space-8);
	margin-inline: auto;
	text-align: center;
}

.pct-hero__title {
	margin-bottom: var(--pct-space-4);
}

.pct-hero__description {
	margin-bottom: 0;
	color: var(--pct-text-muted);
	font-size: clamp(1rem, 0.95rem + 0.35vw, var(--pct-text-xl));
}

.pct-hero__tool {
	position: relative;
}

.pct-hero__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: var(--pct-space-3) var(--pct-space-6);
	margin-top: var(--pct-space-6);
	color: var(--pct-text-subtle);
	font-size: var(--pct-text-sm);
}

.pct-hero__meta-item {
	display: inline-flex;
	align-items: center;
	gap: var(--pct-space-2);
}

.pct-hero__meta-item svg {
	width: 16px;
	height: 16px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2;
	color: var(--pct-success);
}

/* ---------------------------------------------------------------------------
 * Grids
 * ------------------------------------------------------------------------ */

.pct-grid {
	display: grid;
	gap: var(--pct-space-6);
}

.pct-grid--2 {
	grid-template-columns: 1fr;
}

.pct-grid--3 {
	grid-template-columns: 1fr;
}

.pct-grid--4 {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

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

	.pct-grid--3 {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 960px) {
	.pct-grid--3 {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	.pct-grid--4 {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

.pct-content-grid {
	display: grid;
	gap: var(--pct-space-10);
	grid-template-columns: 1fr;
}

@media (min-width: 1000px) {
	.pct-content-grid {
		grid-template-columns: minmax(0, 1fr) 20rem;
		gap: var(--pct-space-12);
	}

	.pct-no-sidebar .pct-content-grid {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* ---------------------------------------------------------------------------
 * Footer
 * ------------------------------------------------------------------------ */

.pct-footer {
	margin-top: var(--pct-space-20);
	padding-block: var(--pct-space-8);
	background: var(--pct-bg-subtle);
	border-top: 1px solid var(--pct-border);
	color: var(--pct-text-muted);
	font-size: var(--pct-text-sm);
}

.pct-footer__row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--pct-space-4) var(--pct-space-8);
	padding-bottom: var(--pct-space-6);
}

.pct-footer__brand {
	color: var(--pct-heading);
	font-size: var(--pct-text-base);
	font-weight: 700;
	letter-spacing: -0.01em;
	text-decoration: none;
}

.pct-footer__brand:hover {
	color: var(--pct-accent);
}

.pct-footer__links .pct-menu {
	flex-wrap: wrap;
	gap: var(--pct-space-1) var(--pct-space-5);
}

.pct-footer__links .pct-menu a {
	padding: 0;
	color: var(--pct-text-muted);
	font-size: var(--pct-text-sm);
	font-weight: 500;
}

.pct-footer__links .pct-menu a:hover {
	background: none;
	color: var(--pct-accent);
	text-decoration: underline;
}

.pct-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: var(--pct-space-3) var(--pct-space-4);
	padding-top: var(--pct-space-5);
	border-top: 1px solid var(--pct-border);
	color: var(--pct-text-subtle);
	font-size: var(--pct-text-xs);
}

.pct-footer__bottom p {
	margin: 0;
}

.pct-footer__bottom .pct-menu {
	gap: var(--pct-space-4);
}

.pct-footer__bottom .pct-menu a {
	padding: 0;
	font-size: var(--pct-text-xs);
}

.pct-footer__bottom .pct-menu a:hover {
	background: none;
	color: var(--pct-accent);
}


/* Language switcher - compact EN / ES select in the header actions. */
.pct-lang__select {
	height: 38px;
	padding: 0 1.75rem 0 0.625rem;
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.5rem center;
	background-size: 0.75rem;
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius);
	color: var(--pct-text-muted);
	font-family: inherit;
	font-size: var(--pct-text-xs);
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	transition: background-color var(--pct-transition), color var(--pct-transition), border-color var(--pct-transition);
}

.pct-lang__select:hover {
	background-color: var(--pct-surface-hover);
	border-color: var(--pct-border-strong);
	color: var(--pct-text);
}

.pct-lang__select:focus-visible {
	outline: 2px solid var(--pct-accent);
	outline-offset: 2px;
}

.pct-lang__select option {
	background: var(--pct-surface);
	color: var(--pct-text);
}


/* ==== RESPONSIVE REFINEMENTS ==== */

/* Controls stay square but may shrink when space is tight. */
.pct-theme-toggle,
.pct-menu-toggle {
	box-sizing: border-box;
	width: 100%;
	max-width: 38px;
	min-width: 34px;
	height: 38px;
	min-height: 38px;
	flex: 0 1 38px;
}

.pct-lang__select {
	box-sizing: border-box;
	width: 100%;
	max-width: 76px;
	min-height: 38px;
	flex: 0 1 76px;
}

/* Tighter vertical rhythm on small screens. */
.pct-section {
	padding-block: var(--pct-space-8);
}

.pct-section--tight {
	padding-block: var(--pct-space-6);
}

.pct-section__header {
	margin-bottom: var(--pct-space-6);
}

@media (min-width: 640px) {
	.pct-section { padding-block: var(--pct-space-12); }
	.pct-section--tight { padding-block: var(--pct-space-8); }
	.pct-section__header { margin-bottom: var(--pct-space-8); }
}

@media (min-width: 1000px) {
	.pct-section { padding-block: var(--pct-space-16); }
	.pct-section--tight { padding-block: var(--pct-space-10); }
	.pct-section__header { margin-bottom: var(--pct-space-10); }
}

/* Smaller brand on phones. */
@media (max-width: 639px) {
	.pct-brand { font-size: var(--pct-text-base); gap: var(--pct-space-2); }
	.pct-brand__mark { width: 28px; height: 28px; }
	.pct-brand__mark svg { width: 16px; height: 16px; }
	.pct-header__inner { gap: var(--pct-space-2); }
	.pct-header__inner { justify-content: space-between; }
	.pct-lang__select { max-width: 60px; padding: 0 1.35rem 0 0.45rem; background-position: right 0.35rem center; background-size: 0.65rem; flex: 0 1 60px; }
}

/* Mobile navigation as a left drawer. */
@media (max-width: 999px) {
	.pct-mobile-nav {
		display: block;
		position: fixed;
		top: 0;
		left: 0;
		bottom: 0;
		width: min(320px, 84vw);
		padding-block: var(--pct-space-4);
		background: var(--pct-bg);
		border-top: 0;
		border-right: 1px solid var(--pct-border);
		transform: translateX(-100%);
		visibility: hidden;
		overflow-y: auto;
		overscroll-behavior: contain;
		z-index: 200;
		transition: transform 0.28s ease, visibility 0.28s ease;
	}

	.pct-mobile-nav.is-open {
		transform: translateX(0);
		visibility: visible;
		box-shadow: 0 0 0 100vmax rgba(0, 0, 0, 0.55);
	}

	body.pct-nav-open { overflow: hidden; }
}

.pct-mobile-nav__close {
	display: grid;
	place-items: center;
	box-sizing: border-box;
	width: 38px;
	height: 38px;
	margin: 0 0 var(--pct-space-3) auto;
	padding: 0;
	background: transparent;
	border: 1px solid var(--pct-border);
	border-radius: var(--pct-radius);
	color: var(--pct-text-muted);
	cursor: pointer;
}

.pct-mobile-nav__close svg { width: 20px; height: 20px; fill: none; }

.pct-mobile-nav__close:hover { background: var(--pct-surface-hover); color: var(--pct-text); }

@media (min-width: 1000px) {
	.pct-mobile-nav__close { display: none; }
}
