/*
 * Site chrome: header, navigation, footer, archive cards, utilities.
 * Content/typography lives in content.css (shared with the editor).
 */

.sf-container {
	max-width: calc(var(--sf-container) + 2.5rem);
	margin-inline: auto;
	padding-inline: clamp(1.25rem, 4vw, 2rem);
}

/* --- Background styles (body class from inc/css-output.php) --- */

body.sf-bg-gradient {
	background-attachment: fixed;
	background-image: linear-gradient(180deg, var(--sf-surface) 0%, var(--sf-bg-grad) 100%);
}

body.sf-bg-image {
	background-size: cover;
	background-position: center top;
	background-attachment: fixed;
}

/* --- Accessibility utilities --- */

.screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	border: 0;
	white-space: nowrap;
}

.skip-link:focus {
	position: fixed;
	top: 0.5rem;
	left: 0.5rem;
	z-index: 100;
	width: auto;
	height: auto;
	clip-path: none;
	background: var(--sf-accent);
	color: var(--sf-on-accent);
	padding: 0.6em 1.2em;
	border-radius: var(--sf-radius);
	text-decoration: none;
}

/* --- Header --- */

.sf-header {
	background: var(--sf-header-bg);
	border-bottom: 1px solid var(--sf-border);
}

.sf-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem 1rem;
	flex-wrap: wrap;
	padding-block: 0.6rem;
	/*
	 * Stable header height: it never collapses when the header is empty and
	 * never balloons from an oversized logo. The logo (max-height 48px, below)
	 * fits inside this with even padding, so the bar reads the same with or
	 * without a menu.
	 */
	min-height: 72px;
}

/*
 * Centered layout: a 3-column grid (brand | nav | balancer) keeps the nav
 * optically centered while the brand stays in normal flow on the left. Because
 * the logo is in-flow — not absolutely positioned — it can size the header, but
 * min-height (floor) + the logo's max-height (ceiling) keep that height stable.
 */
.sf-header__inner--centered {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	justify-content: initial;
}

.sf-header__inner--centered .sf-header__brand {
	grid-column: 1;
	justify-self: start;
}

.sf-header__inner--centered .sf-nav--center {
	grid-column: 2;
}

.sf-nav--center {
	margin-inline: auto;
}

.sf-nav--center .sf-menu {
	justify-content: center;
}

@media (max-width: 640px) {
	.sf-header__inner--centered {
		grid-template-columns: 1fr;
		justify-items: center;
	}

	.sf-header__inner--centered .sf-header__brand {
		grid-column: 1;
		justify-self: center;
	}

	.sf-header__inner--centered .sf-nav--center {
		grid-column: 1;
	}
}

.sf-header__title {
	font-family: var(--sf-font-heading);
	font-weight: 800;
	font-size: 1.25rem;
	color: var(--sf-text);
	text-decoration: none;
}

.custom-logo {
	display: block;
	height: auto;
	width: auto;
	/* Ceiling so a huge upload can't bloat the bar; contain never distorts it. */
	max-height: 48px;
	max-width: 240px;
	object-fit: contain;
}

/*
 * Primary nav: horizontally scrollable pill row. Mini-sites carry 3-6 anchor
 * items, so no burger — the row scrolls on narrow screens instead.
 */
.sf-nav {
	overflow-x: auto;
	scrollbar-width: none;
	/* Breathing room so pill focus rings aren't clipped by the scroll container. */
	padding: 5px;
	margin: -5px;
}

.sf-menu {
	display: flex;
	gap: 0.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
	white-space: nowrap;
}

.sf-menu a {
	display: inline-block;
	padding: 0.45em 0.9em;
	border-radius: 999px;
	color: var(--sf-text);
	text-decoration: none;
}

.sf-menu a:hover {
	background: var(--sf-accent-tint);
	color: var(--sf-text);
}

.sf-menu .current-menu-item > a,
.sf-menu .current_page_item > a {
	background: var(--sf-accent);
	color: var(--sf-on-accent);
}

/* --- Breadcrumbs --- */

.sf-breadcrumbs {
	font-size: 0.85rem;
	color: var(--sf-text-muted);
	padding-block: 0.75rem 0;
}

.sf-breadcrumbs a {
	color: var(--sf-text-muted);
	text-decoration: none;
}

.sf-breadcrumbs a:hover {
	color: var(--sf-link);
}

/* --- Author box --- */

.sf-author {
	display: flex;
	gap: 1rem;
	align-items: flex-start;
	max-width: var(--sf-container);
	margin: 2.5rem auto 0;
	padding: 1.25rem;
	background: var(--sf-surface-raised);
	border: 1px solid var(--sf-border);
	border-radius: var(--sf-radius);
}

.sf-author__photo img {
	border-radius: 50%;
	width: 72px;
	height: 72px;
	object-fit: cover;
}

.sf-author__label {
	display: block;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--sf-text-muted);
}

.sf-author__name {
	font-family: var(--sf-font-heading);
	font-size: 1.1rem;
}

.sf-author__bio {
	font-size: 0.92rem;
	color: var(--sf-text-muted);
}

.sf-author__bio p:last-child {
	margin-bottom: 0;
}

.sf-author__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.25rem 1rem;
	list-style: none;
	margin: 0.5rem 0 0;
	padding: 0;
	font-size: 0.85rem;
}

/* --- Main column --- */

.sf-main {
	padding-block: 2rem 3rem;
}

/* Full-bleed hero sits flush under the header. */
body.sf-has-hero .sf-main {
	padding-top: 0;
}

/* --- Global hero: two-column split on the skin surface --- */

.sf-main > .sf-hero--split {
	position: relative;
	overflow: hidden;
	margin-bottom: 2.5rem;
	/* background-color (not the shorthand) so a per-page hero image set inline
	   as background-image still layers on top. Default token = skin surface. */
	background-color: var(--sf-hero-bg);
	border-bottom: 1px solid var(--sf-border);
}

/* Per-page hero background image (Hero background image in the meta box). */
.sf-hero--has-bg {
	background-size: cover;
	background-position: center;
}

/* A solid hero color (General settings) or a hero image both replace the
   accent glow, so the chosen fill stays clean and predictable. */
.sf-hero--has-bg .sf-hero__glow,
body.sf-has-hero-color .sf-hero__glow {
	display: none;
}

.sf-hero__glow {
	position: absolute;
	inset: 0;
	pointer-events: none;
	background:
		radial-gradient(60% 80% at 18% 30%, var(--sf-accent-tint) 0%, transparent 60%),
		radial-gradient(50% 70% at 90% 80%, var(--sf-accent2-tint) 0%, transparent 65%);
}

.sf-hero--split .sf-hero__inner {
	position: relative;
	z-index: 1;
	display: grid;
	grid-template-columns: minmax(0, 5fr) minmax(0, 6fr);
	align-items: center;
	gap: clamp(1.5rem, 4vw, 3rem);
	max-width: calc(var(--sf-container) + 2.5rem);
	margin-inline: auto;
	padding: clamp(2rem, 5vw, 3.5rem) clamp(1.25rem, 4vw, 2rem);
	color: var(--sf-text);
}

.sf-hero__card {
	border-radius: calc(var(--sf-radius) + 6px);
	overflow: hidden;
	background: var(--sf-surface-raised);
	border: 1px solid var(--sf-border);
	box-shadow: 0 24px 60px -20px rgba(0, 0, 0, 0.45);
}

.sf-hero__img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 3;
	object-fit: cover;
}

.sf-hero__body {
	min-width: 0;
}

.sf-hero--split .sf-hero__title {
	margin: 0 0 0.4em;
	color: var(--sf-text);
	font-size: clamp(2rem, 4.5vw, 3rem);
	line-height: 1.1;
}

.sf-hero--split .sf-hero__lead {
	margin: 0 0 1.5rem;
	max-width: 44rem;
	color: var(--sf-text-muted);
	font-size: clamp(1.05rem, 2.2vw, 1.25rem);
}

.sf-hero--split .sf-hero__cta {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
}

.sf-btn--ghost {
	background: transparent;
	color: var(--sf-text);
	border: 2px solid var(--sf-border-strong);
}

.sf-btn--ghost:hover {
	background: var(--sf-accent);
	color: var(--sf-on-accent);
	border-color: var(--sf-accent);
}

/* Winners-bar ticker — author opts in via class="sf-ticker" in First text. */
.sf-hero__first {
	margin: 0 0 1rem;
	overflow: hidden;
	-webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
	mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.sf-ticker {
	display: flex;
	gap: 1.5rem;
	white-space: nowrap;
	font-size: 0.85rem;
	color: var(--sf-text-muted);
}

.sf-ticker > * {
	display: inline-block;
	animation: sf-ticker 22s linear infinite;
}

.sf-hero__first:hover .sf-ticker > * {
	animation-play-state: paused;
}

@keyframes sf-ticker {
	from {
		transform: translateX(0);
	}

	to {
		transform: translateX(-100%);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sf-ticker > * {
		animation: none;
	}

	.sf-ticker {
		white-space: normal;
		flex-wrap: wrap;
	}
}

@media (max-width: 782px) {
	.sf-hero--split .sf-hero__inner {
		grid-template-columns: 1fr;
	}

	.sf-hero__media {
		order: -1;
	}

	.sf-hero__img {
		aspect-ratio: 16 / 9;
	}
}

/* Breadcrumbs sit just under the hero. */
.sf-has-hero .sf-breadcrumbs {
	padding-top: 0;
	margin-bottom: 0.5rem;
}

.sf-page-header {
	margin-bottom: 1.5rem;
}

.sf-page-title {
	margin: 0;
}

/* --- Author page template --- */

.sf-author-page {
	margin-bottom: 2rem;
}

.sf-author-page__title {
	margin-top: 0;
}

.sf-author-page__card {
	display: flex;
	gap: 1.5rem;
	align-items: flex-start;
	flex-wrap: wrap;
	background: var(--sf-surface-raised);
	border: 1px solid var(--sf-border);
	border-radius: var(--sf-radius);
	padding: 1.75rem;
}

.sf-author-page__photo img {
	width: 140px;
	height: 140px;
	object-fit: cover;
	border-radius: 50%;
	border: 2px solid var(--sf-accent);
}

.sf-author-page__body {
	flex: 1;
	min-width: 16rem;
}

.sf-author-page__name {
	font-family: var(--sf-font-heading);
	font-size: 1.35rem;
	font-weight: 700;
	margin: 0 0 0.5em;
}

.sf-author-page__bio {
	color: var(--sf-text-muted);
}

.sf-author-page__links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 0.6rem;
	list-style: none;
	margin: 1rem 0 0;
	padding: 0;
}

.sf-author-page__links a {
	display: inline-block;
	padding: 0.3em 0.9em;
	border: 1px solid var(--sf-border);
	border-radius: 999px;
	background: var(--sf-surface);
	color: var(--sf-text);
	text-decoration: none;
	font-size: 0.85rem;
}

.sf-author-page__links a:hover {
	border-color: var(--sf-accent);
	background: var(--sf-accent-tint);
}

/* --- Archive / search cards --- */

.sf-card {
	background: var(--sf-surface-raised);
	border: 1px solid var(--sf-border);
	border-radius: var(--sf-radius);
	padding: 1.25rem 1.5rem;
	margin-bottom: 1rem;
}

.sf-card__title {
	margin: 0 0 0.5em;
	font-size: 1.2rem;
}

.sf-card__title a {
	color: var(--sf-text);
	text-decoration: none;
}

.sf-card__title a:hover {
	color: var(--sf-link);
}

.sf-card__excerpt {
	color: var(--sf-text-muted);
	font-size: 0.95rem;
}

.sf-archive__empty {
	color: var(--sf-text-muted);
}

/* --- Search form --- */

.search-form {
	display: flex;
	gap: 0.5rem;
	max-width: 30rem;
}

.search-form .search-field {
	flex: 1;
	padding: 0.6em 0.9em;
	border: 1px solid var(--sf-border);
	border-radius: var(--sf-radius);
	background: var(--sf-surface-raised);
	color: var(--sf-text);
}

/* --- Demo modal (#demo overlay) --- */

.sf-demo-modal {
	position: fixed;
	inset: 0;
	z-index: 95;
	display: grid;
	place-items: center;
	padding: 1rem;
}

.sf-demo-modal[hidden] {
	display: none;
}

html.sf-modal-open,
html.sf-modal-open body {
	overflow: hidden;
}

.sf-demo-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.75);
}

.sf-demo-modal__dialog {
	position: relative;
	width: min(960px, 100%);
	aspect-ratio: 16 / 9;
	max-height: 86vh;
	background: var(--sf-surface-sunken);
	border: 1px solid var(--sf-border-strong);
	border-radius: var(--sf-radius);
	box-shadow: 0 24px 80px rgba(0, 0, 0, 0.6);
}

.sf-demo-modal__body,
.sf-demo-modal__body iframe {
	width: 100%;
	height: 100%;
	border: 0;
	border-radius: var(--sf-radius);
	display: block;
}

.sf-demo-modal__close {
	position: absolute;
	top: -2.6rem;
	right: 0;
	width: 2.2rem;
	height: 2.2rem;
	border: 0;
	border-radius: 50%;
	background: var(--sf-surface-raised);
	color: var(--sf-text);
	font-size: 1.4rem;
	line-height: 1;
	cursor: pointer;
	z-index: 1;
}

.sf-demo-modal__close:hover {
	background: var(--sf-accent);
	color: var(--sf-on-accent);
}

/* --- Popup --- */

.sf-popup {
	position: fixed;
	inset: 0;
	z-index: 90;
	display: grid;
	place-items: center;
	padding: 1rem;
}

.sf-popup[hidden] {
	display: none;
}

.sf-popup__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.6);
}

.sf-popup__dialog {
	position: relative;
	max-width: 27rem;
	width: 100%;
	background: var(--sf-surface-raised);
	border: 1px solid var(--sf-border-strong);
	border-radius: calc(var(--sf-radius) + 6px);
	overflow: hidden;
	box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
}

.sf-popup__close {
	position: absolute;
	top: 0.5rem;
	right: 0.5rem;
	z-index: 1;
	width: 2rem;
	height: 2rem;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.2);
	color: #fff;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.sf-popup__close:hover {
	background: rgba(0, 0, 0, 0.4);
}

/* Accent header band (matches the reference modal). */
.sf-popup__head {
	background: var(--sf-accent);
	padding: 1.1rem 1.5rem;
	text-align: center;
}

.sf-popup__title {
	margin: 0;
	font-size: 1.25rem;
	color: var(--sf-on-accent);
	text-transform: uppercase;
	letter-spacing: 0.02em;
}

.sf-popup__body {
	padding: 1.75rem 1.5rem;
	text-align: center;
}

.sf-popup__text {
	color: var(--sf-text);
	margin-bottom: 1.25rem;
	font-size: 1.05rem;
}

.sf-popup__cta {
	display: inline-block;
	background: var(--sf-accent);
	color: var(--sf-on-accent);
	font-family: var(--sf-font-heading);
	font-weight: 700;
	text-decoration: none;
	border-radius: 999px;
	padding: 0.8em 2.2em;
	transition: background-color 0.15s ease;
}

.sf-popup__cta:hover {
	background: var(--sf-accent-hover);
	color: var(--sf-on-accent);
}

/* --- Catfish sticky bar --- */

.sf-catfish {
	position: fixed;
	inset: auto 0 0 0;
	z-index: 80;
	background: var(--sf-catfish-bg);
	color: var(--sf-catfish-text);
	border-top: 1px solid rgba(255, 255, 255, 0.08);
	box-shadow: 0 -8px 30px rgba(0, 0, 0, 0.35);
}

.sf-catfish[hidden] {
	display: none;
}

.sf-catfish__inner {
	display: flex;
	align-items: center;
	gap: clamp(0.75rem, 2vw, 1.75rem);
	padding-block: 0.6rem;
}

.sf-catfish__brand {
	display: flex;
	align-items: center;
	flex: none;
}

.sf-catfish__logo {
	max-height: 34px;
	width: auto;
	display: block;
}

.sf-catfish__name {
	font-family: var(--sf-font-heading);
	font-weight: 800;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	font-size: 1.05rem;
}

.sf-catfish__rating {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex: none;
	font-family: var(--sf-font-heading);
	font-weight: 700;
}

.sf-catfish__star {
	color: var(--sf-catfish-accent);
}

.sf-catfish__bonus {
	margin: 0;
	flex: 1;
	min-width: 0;
	font-size: 0.95rem;
	line-height: 1.35;
}

.sf-catfish__cta {
	flex: none;
	background: var(--sf-catfish-btn);
	color: var(--sf-catfish-btn-text);
	font-family: var(--sf-font-heading);
	font-weight: 800;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: var(--sf-radius);
	padding: 0.75em 1.6em;
	white-space: nowrap;
	transition: filter 0.15s ease;
}

.sf-catfish__cta:hover {
	filter: brightness(1.08);
	color: var(--sf-catfish-btn-text);
}

.sf-catfish__close {
	flex: none;
	width: 1.9rem;
	height: 1.9rem;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	opacity: 0.6;
	font-size: 1.3rem;
	line-height: 1;
	cursor: pointer;
}

.sf-catfish__close:hover {
	opacity: 1;
}

/* Keep the fixed bar from covering page-bottom content. */
body.sf-has-catfish {
	padding-bottom: 5rem;
}

@media (max-width: 640px) {
	.sf-catfish__inner {
		flex-wrap: wrap;
		gap: 0.4rem 0.75rem;
		padding-block: 0.5rem;
	}

	.sf-catfish__brand {
		order: 1;
	}

	.sf-catfish__rating {
		order: 2;
	}

	.sf-catfish__close {
		order: 3;
		margin-left: auto;
	}

	.sf-catfish__bonus {
		order: 4;
		flex-basis: 100%;
		font-size: 0.82rem;
	}

	.sf-catfish__cta {
		order: 5;
		flex-basis: 100%;
		text-align: center;
		padding: 0.65em 1.2em;
	}

	body.sf-has-catfish {
		padding-bottom: 9.5rem;
	}
}

/* --- Footer --- */

.sf-footer {
	background: var(--sf-footer-bg);
	border-top: 1px solid var(--sf-border);
	margin-top: 2rem;
	padding-block: 1.5rem;
	font-size: 0.85rem;
	color: var(--sf-text-muted);
}

.sf-footer__grid {
	display: flex;
	flex-direction: column;
	gap: 0.75rem;
	text-align: center;
}

.sf-footer__title {
	font-family: var(--sf-font-heading);
	font-weight: 700;
	color: var(--sf-text);
	margin: 0;
}

.sf-footer__subtitle {
	color: var(--sf-text-muted);
	margin: 0;
}

.sf-footer__logos {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 1rem 1.5rem;
	list-style: none;
	margin: 0.5rem 0;
	padding: 0;
}

.sf-footer__logo-img {
	max-height: 40px;
	width: auto;
	opacity: 0.8;
	transition: opacity 0.15s ease;
}

.sf-footer__logo a:hover .sf-footer__logo-img {
	opacity: 1;
}

.sf-footer__disclaimer {
	margin-bottom: 1rem;
}

.sf-footer__legal .sf-menu--footer {
	flex-wrap: wrap;
	white-space: normal;
	justify-content: center;
}

.sf-footer__legal a {
	color: var(--sf-text-muted);
}

.sf-footer__meta {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.5rem 1.5rem;
	margin-top: 0.75rem;
}
