/**
 * Base: brand font, shared tokens and helpers.
 * Colors and font come from theme.json presets (--wp--preset--*).
 */

:root {
	--cxo-ink: var(--wp--preset--color--ink, #111111);
	--cxo-paper: var(--wp--preset--color--paper, #e0e0e0);
	--cxo-white: var(--wp--preset--color--white, #ffffff);
	--cxo-red: var(--wp--preset--color--red, #c4121a);
	--cxo-red-deep: var(--wp--preset--color--red-deep, #4a0306);
	--cxo-grey: var(--wp--preset--color--grey, #7a7a7a);
	--cxo-grey-dark: var(--wp--preset--color--grey-dark, #1c1c1c);
	--cxo-muted: var(--wp--preset--color--muted, #6b6b6b);
	--cxo-font: var(--wp--preset--font-family--inter-tight, "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
	--cxo-gutter: var(--wp--custom--gutter, clamp(1rem, 0.4rem + 5.6vw, 7.625rem));
	--cxo-cell: var(--wp--custom--grid--cell-mobile, 56px);
	--cxo-grid-line: var(--wp--custom--grid--line, rgba(255, 255, 255, 0.08));
	--cxo-ease: cubic-bezier(0.22, 1, 0.36, 1);

	/* Dark sections (Opportunities, job pages). The lighter red keeps red
	 * text readable on dark backgrounds (WCAG AA). */
	--cxo-red-light: #f0343c;
	--cxo-surface: #181818;
	--cxo-surface-raised: #1f1f1f;
	--cxo-line: rgba(255, 255, 255, 0.14);
	--cxo-text-dim: rgba(255, 255, 255, 0.72);
	--cxo-radius: 14px;
}

@media (min-width: 768px) {
	:root {
		--cxo-cell: var(--wp--custom--grid--cell, 85px);
	}
}

/* Same selectors Astra uses for its typography, loaded later so ours win. */
body,
button,
input,
select,
textarea,
.ast-button,
.ast-custom-button,
h1, h2, h3, h4, h5, h6,
.entry-content :where(h1, h2, h3, h4, h5, h6) {
	font-family: var(--cxo-font);
}

/* Faint square grid used by the hero and footer backgrounds. */
.cxo-grid-bg {
	background-image:
		linear-gradient(to right, var(--cxo-grid-line) 1px, transparent 1px),
		linear-gradient(to bottom, var(--cxo-grid-line) 1px, transparent 1px);
	background-size: var(--cxo-cell) var(--cxo-cell);
}

/* Logo from the [cxo_logo] shortcode. */
.cxo-logo {
	display: inline-block;
	line-height: 0;
}

.cxo-logo img {
	width: 132px;
	height: auto;
}

.cxo-logo--light img {
	filter: invert(1) brightness(1.15);
}

/* Pill button with arrow, shared by the hero and footer. */
.cxo-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.55em;
	min-height: 3.5rem;
	padding: 0 2.2em;
	border: 2px solid transparent;
	border-radius: 999px;
	font-size: clamp(1rem, 0.9rem + 0.4vw, 1.375rem);
	font-weight: 500;
	letter-spacing: -0.01em;
	line-height: 1;
	text-decoration: none;
	white-space: nowrap;
	transition: background-color 0.25s var(--cxo-ease), color 0.25s var(--cxo-ease), border-color 0.25s var(--cxo-ease);
}

.cxo-btn svg {
	width: 0.6em;
	height: 0.6em;
	flex: none;
	transition: transform 0.25s var(--cxo-ease);
}

.cxo-btn:hover svg,
.cxo-btn:focus-visible svg {
	transform: translate(2px, -2px);
}

.cxo-btn:focus-visible {
	outline: 2px solid var(--cxo-white);
	outline-offset: 3px;
}

.cxo-btn--dark,
.cxo-btn--dark:visited {
	background: var(--cxo-ink);
	color: var(--cxo-white);
}

.cxo-btn--dark:hover,
.cxo-btn--dark:focus-visible {
	background: var(--cxo-white);
	color: var(--cxo-ink);
}

.cxo-btn--outline,
.cxo-btn--outline:visited {
	border-color: var(--cxo-white);
	background: transparent;
	color: var(--cxo-white);
}

.cxo-btn--outline:hover,
.cxo-btn--outline:focus-visible {
	background: var(--cxo-white);
	color: var(--cxo-ink);
}

.cxo-btn--red,
.cxo-btn--red:visited {
	background: var(--cxo-red);
	color: var(--cxo-white);
}

.cxo-btn--red:hover,
.cxo-btn--red:focus-visible {
	background: var(--cxo-white);
	color: var(--cxo-ink);
}

/* ---------- Dark section wrapper (jobs list, CTA band, job page) ---------- */
.cxo-section {
	box-sizing: border-box;
	padding: clamp(3.5rem, 2rem + 5vw, 7.5rem) var(--cxo-gutter);
	background-color: var(--cxo-surface);
	color: var(--cxo-white);
}

.cxo-section__inner {
	width: 100%;
	max-width: 1680px;
	margin-inline: auto;
}

/* Full-width sections sit flush against each other (no white gaps). */
.entry-content > .cxo-section,
.entry-content > .cxo-hero + .cxo-section {
	margin-block: 0;
}

/* Same font everywhere, even where Astra targets headings and links. */
.cxo-section.cxo-section,
.cxo-section.cxo-section :where(h1, h2, h3, h4, p, a, li, span, label, select, button) {
	font-family: var(--cxo-font);
}

/* Astra indents lists inside page content (.entry-content ul) and
 * underlines links in posts (.ast-single-post .entry-content a). Our lists
 * and links are styled per component, so reset both here. */
.cxo-section.cxo-section ul,
.cxo-hero.cxo-hero ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.cxo-section.cxo-section a {
	text-decoration: none;
}

/* Small uppercase label, e.g. "ABOUT THE ROLE". */
.cxo-label {
	margin: 0 0 1rem;
	color: var(--cxo-red-light);
	font-size: 0.9375rem;
	font-weight: 700;
	letter-spacing: 0.14em;
	line-height: 1.3;
	text-transform: uppercase;
}

/* ---------- Status badge ---------- */
.cxo-badge {
	display: inline-flex;
	align-items: center;
	padding: 0.3em 0.75em;
	border: 1.5px solid transparent;
	border-radius: 999px;
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	line-height: 1.2;
	text-transform: uppercase;
	white-space: nowrap;
}

.cxo-badge--open {
	background: var(--cxo-red);
	color: var(--cxo-white);
}

.cxo-badge--filled {
	background: rgba(255, 255, 255, 0.1);
	color: rgba(255, 255, 255, 0.85);
}

.cxo-badge--outline {
	border-color: currentColor;
	background: transparent;
}

.cxo-badge--outline.cxo-badge--open {
	color: var(--cxo-red-light);
}

/* Icon + text, e.g. location. */
.cxo-meta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.cxo-meta > li {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	margin: 0;
}

.cxo-icon {
	width: 1.1em;
	height: 1.1em;
	flex: none;
}

.screen-reader-text:focus {
	z-index: 100000;
}

/* ---------- Full-width blocks on "Full Width / Stretched" pages ----------
 * Depending on Customizer settings, Astra may or may not pad the page article
 * (20px sides, 2em top). So we set the padding ourselves to a known value
 * and pull full-width blocks out by exactly that amount. The doubled class
 * beats Astra's own rule (.ast-single-post.ast-page-builder-template ...).
 */
.ast-page-builder-template.ast-page-builder-template .site-main > article {
	--cxo-article-pad: 20px;
	padding-inline: var(--cxo-article-pad);
}

.ast-page-builder-template .site-main > article > .entry-content > .alignfull {
	width: auto;
	max-width: none;
	margin-inline: calc(-1 * var(--cxo-article-pad, 20px));
}

/* A full-width first block sits directly under the header. */
.ast-page-builder-template.ast-page-builder-template .site-main > article:has(> .entry-content > .alignfull:first-child) {
	padding-top: 0;
}

.ast-page-builder-template .site-main > article > .entry-content > .alignfull:first-child {
	margin-top: 0;
}
