/**
 * GOERGO base styles.
 *
 * Site-wide typography, layout primitives and shared components (buttons,
 * eyebrows, section headings, media frames, reveal motion). Kadence provides
 * the reset. Header/footer live in layout.css; page styles in pages/.
 *
 * Link-like components declare :hover/:focus colours explicitly because
 * Kadence's a:hover rule is more specific than a single class.
 */

/* Document */

html {
	scroll-padding-top: calc(var(--goergo-header-height) + var(--wp-admin--admin-bar--height, 0px));
}

@media (prefers-reduced-motion: no-preference) {
	html {
		scroll-behavior: smooth;
	}
}

body.goergo {
	background: var(--goergo-bg);
	color: var(--goergo-text-2);
	font-family: var(--goergo-font-body);
	font-size: var(--goergo-text-base);
	line-height: var(--goergo-leading-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

body.goergo #wrapper {
	overflow-x: clip;
	background: var(--goergo-bg);
}

.goergo ::selection {
	background: var(--goergo-gold);
	color: var(--goergo-on-gold);
}

.goergo :where(h1, h2, h3, h4) {
	color: var(--goergo-text);
	font-family: var(--goergo-font-display);
	font-weight: 400;
	line-height: var(--goergo-leading-tight);
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.goergo :where(p) {
	text-wrap: pretty;
}

.goergo img {
	max-width: 100%;
	height: auto;
}

/* Accessibility: visible keyboard focus. */
.goergo :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--goergo-gold);
	outline-offset: 3px;
}

.goergo [tabindex="-1"]:focus {
	outline: none;
}

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

/* Layout primitives (prefix .goergo- to avoid Kadence collisions). */

.goergo-container {
	width: 100%;
	max-width: calc(var(--goergo-container) + 2 * var(--goergo-gutter));
	margin-inline: auto;
	padding-inline: var(--goergo-gutter);
}

.goergo-container--wide {
	max-width: calc(var(--goergo-container-wide) + 2 * var(--goergo-gutter));
}

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

.goergo-stack > * + * {
	margin-block-start: var(--goergo-space-4);
}

.goergo-visually-hidden {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Eyebrow: small gold label with a hairline. */

.goergo-eyebrow {
	display: flex;
	align-items: center;
	gap: 0.9rem;
	margin: 0 0 var(--goergo-space-5);
	color: var(--goergo-gold);
	font-family: var(--goergo-font-body);
	font-size: var(--goergo-text-xs);
	font-weight: 600;
	letter-spacing: 0.28em;
	line-height: 1.4;
	text-transform: uppercase;
}

.goergo-eyebrow::before {
	content: "";
	flex: 0 0 2.5rem;
	height: 1px;
	background: currentColor;
	opacity: 0.7;
}

.goergo-heading--center .goergo-eyebrow,
.goergo-eyebrow--center {
	justify-content: center;
}

.goergo-heading--center .goergo-eyebrow::after,
.goergo-eyebrow--center::after {
	content: "";
	flex: 0 0 2.5rem;
	height: 1px;
	background: currentColor;
	opacity: 0.7;
}

/* Section heading */

.goergo-heading {
	max-width: 48rem;
	margin-block-end: clamp(3rem, 2rem + 4vw, 5.5rem);
}

.goergo-heading--center {
	margin-inline: auto;
	text-align: center;
}

.goergo .goergo-heading__title {
	margin: 0;
	font-size: var(--goergo-text-h2);
}

.goergo-heading__lede {
	max-width: 36rem;
	margin: var(--goergo-space-5) 0 0;
	color: var(--goergo-text-2);
	font-size: var(--goergo-text-lg);
	line-height: 1.65;
}

.goergo-heading--center .goergo-heading__lede {
	margin-inline: auto;
}

/* Buttons */

.goergo-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--goergo-space-4) var(--goergo-space-5);
}

.goergo-actions--center {
	justify-content: center;
}

.goergo-button {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	min-height: 3.25rem;
	padding: 0 1.9rem;
	border: 1px solid transparent;
	border-radius: var(--goergo-radius-sm);
	font-family: var(--goergo-font-body);
	font-size: var(--goergo-text-xs);
	font-weight: 600;
	letter-spacing: var(--goergo-tracking-caps);
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	text-transform: uppercase;
	transition:
		background-color var(--goergo-duration) var(--goergo-ease),
		border-color var(--goergo-duration) var(--goergo-ease),
		color var(--goergo-duration) var(--goergo-ease);
}

.goergo-button .goergo-icon {
	flex: none;
	width: 1.15rem;
	height: 1.15rem;
	transition: transform var(--goergo-duration) var(--goergo-ease);
}

.goergo-button--primary,
.goergo-button--primary:visited {
	background: var(--goergo-gold);
	border-color: var(--goergo-gold);
	color: var(--goergo-on-gold);
}

.goergo-button--primary:hover,
.goergo-button--primary:focus-visible {
	background: var(--goergo-gold-soft);
	border-color: var(--goergo-gold-soft);
	color: var(--goergo-on-gold);
}

.goergo-button--ghost,
.goergo-button--ghost:visited {
	background: rgb(var(--goergo-shade) / 0.2);
	border-color: var(--goergo-line-strong);
	color: var(--goergo-text);
}

.goergo-button--ghost:hover,
.goergo-button--ghost:focus-visible {
	background: rgb(var(--goergo-shade) / 0.35);
	border-color: var(--goergo-gold);
	color: var(--goergo-gold);
}

.goergo-button--text,
.goergo-button--text:visited {
	min-height: 2.75rem;
	padding: 0;
	color: var(--goergo-text);
}

.goergo-button--text span {
	background: linear-gradient(currentColor, currentColor) 0 100% / 100% 1px no-repeat;
	padding-block: 0.35rem;
	transition: background-size var(--goergo-duration) var(--goergo-ease);
}

.goergo-button--text:hover,
.goergo-button--text:focus-visible {
	color: var(--goergo-gold);
}

.goergo-button:hover .goergo-icon--arrow,
.goergo-button:focus-visible .goergo-icon--arrow {
	transform: translateX(0.3rem);
}

/* Prose */

.goergo-prose > * {
	margin: 0;
}

.goergo-prose > * + * {
	margin-block-start: 1.25em;
}

.goergo-prose p {
	color: var(--goergo-text-2);
	font-size: var(--goergo-text-lg);
	line-height: 1.75;
}

/* Media frame: fixed proportions, image or placeholder. */

.goergo-media {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--goergo-ratio, auto);
	background-color: var(--goergo-bg-alt);
}

.goergo-media > img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.goergo-media.is-placeholder {
	background:
		radial-gradient(120% 90% at 72% 18%, rgb(198 166 118 / 0.1), transparent 58%),
		linear-gradient(160deg, #202124 0%, #161719 55%, #111214 100%);
}

.goergo-media.is-placeholder::before {
	content: "";
	position: absolute;
	inset: 0;
	background: repeating-linear-gradient(135deg, rgb(244 239 231 / 0.022) 0 1px, transparent 1px 16px);
}

.goergo-media.is-placeholder::after {
	content: "";
	position: absolute;
	inset: clamp(0.75rem, 2vw, 1.25rem);
	border: 1px solid rgb(198 166 118 / 0.16);
	pointer-events: none;
}

.goergo-media__mark {
	position: absolute;
	top: 50%;
	left: 50%;
	display: grid;
	place-items: center;
	width: 1.7em;
	height: 1.7em;
	border: 1px solid rgb(198 166 118 / 0.22);
	border-radius: 50%;
	color: rgb(198 166 118 / 0.3);
	font-family: var(--goergo-font-display);
	font-size: clamp(2.5rem, 1.5rem + 4vw, 5rem);
	font-style: italic;
	line-height: 1;
	transform: translate(-50%, -50%);
}

.goergo-media__label {
	position: absolute;
	bottom: clamp(1.25rem, 3vw, 2rem);
	left: clamp(1.25rem, 3vw, 2rem);
	z-index: 1;
	color: rgb(185 181 174 / 0.55);
	font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
	font-size: 0.6875rem;
	letter-spacing: 0.06em;
}

.goergo-media__label span {
	margin-left: 0.5em;
	opacity: 0.7;
}

/* Icons */

.goergo-icon {
	display: inline-block;
	vertical-align: middle;
}

/* Scroll reveal: only when JavaScript is running and motion is welcome. */

@media (prefers-reduced-motion: no-preference) {
	.goergo-reveal [data-reveal] {
		opacity: 0;
		transform: translate3d(0, 1.75rem, 0);
		transition:
			opacity var(--goergo-duration-slow) var(--goergo-ease),
			transform var(--goergo-duration-slow) var(--goergo-ease);
		transition-delay: var(--goergo-delay, 0ms);
	}

	.goergo-reveal [data-reveal].is-visible {
		opacity: 1;
		transform: none;
	}
}
