/*
 * Component primitives — CALEN Official theme.
 * Buttons, links, skip link, navigation + mobile toggle structure.
 * No decorative motion, no shadows/gradients by default.
 */

/* ==========================================================
   Skip link
   ========================================================== */

.skip-link {
	position: absolute;
	z-index: 100;
	top: -100%;
	left: var(--space-3);
	padding: var(--space-3) var(--space-4);
	background-color: var(--color-bg);
	color: var(--color-text);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	text-decoration: none;
	transition: top var(--duration-fast) var(--ease-standard);
}

.skip-link:focus {
	top: var(--space-3);
}

/* Keep clear of the WP admin toolbar (32px desktop / 46px <783px) when logged in. */
.admin-bar .skip-link:focus {
	top: calc(var(--space-3) + 32px);
}

@media (max-width: 782px) {
	.admin-bar .skip-link:focus {
		top: calc(var(--space-3) + 46px);
	}
}

/* ==========================================================
   Links
   Hover is never the only indicator: focus-visible outline and
   underline changes both accompany hover.
   ========================================================== */

a {
	color: var(--color-accent);
	text-underline-offset: 0.15em;
}

a:hover {
	color: var(--color-accent-hover);
}

/* Header/Hero rebuild (frozen 78): wordmark size/tracking and nav
   color/gap match the frozen header exactly (15px/weight 600/
   letter-spacing .28em; nav links #6B6E73 at 26px gap, not full Ink). */
.site-wordmark {
	font-size: 0.9375rem;
	font-weight: 600;
	line-height: normal;
	letter-spacing: 0.28em;
	color: var(--color-text);
	text-decoration: none;
}

.site-wordmark:hover {
	color: var(--color-text);
}

.primary-navigation ul {
	display: flex;
	flex-wrap: wrap;
	gap: var(--space-3) 1.625rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Frozen desktop navigation contains the five section links only. The
   provisioned Contact link remains available elsewhere in the site. */
.primary-navigation .menu-item:last-child {
	display: none;
}

.primary-navigation a {
	color: var(--color-text-muted);
	font-size: 0.78125rem;
	line-height: normal;
	text-decoration: none;
}

.primary-navigation a:hover,
.primary-navigation a[aria-current="page"] {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

.site-footer__links a {
	color: var(--color-text);
	font-size: var(--font-size-body-sm);
}

.site-footer__links a:hover {
	text-decoration: underline;
	text-underline-offset: 0.25em;
}

/* ==========================================================
   Nav toggle (mobile)
   Hidden by default: no-JS visitors get the nav inline (it wraps,
   see .primary-navigation ul above), so the toggle only appears
   once JS confirms it can drive the disclosure behavior.
   ========================================================== */

.nav-toggle {
	display: none;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	background: none;
	border: 1px solid var(--color-border);
	border-radius: var(--radius-sm);
	color: var(--color-text);
	cursor: pointer;
}

.nav-toggle__label {
	display: none;
}

html.js .nav-toggle {
	display: inline-flex;
}

.nav-toggle__icon,
.nav-toggle__icon::before,
.nav-toggle__icon::after {
	display: block;
	width: 18px;
	height: 2px;
	background-color: currentColor;
	border-radius: 1px;
}

.nav-toggle__icon {
	position: relative;
}

.nav-toggle__icon::before,
.nav-toggle__icon::after {
	content: "";
	position: absolute;
	left: 0;
}

.nav-toggle__icon::before {
	top: -6px;
}

.nav-toggle__icon::after {
	top: 6px;
}

@media (max-width: 767px) {
	.site-wordmark {
		font-size: 0.875rem; /* 14px */
	}

	html.js .nav-toggle {
		display: inline-flex;
		width: auto;
		height: auto;
		min-width: 44px;
		min-height: 44px;
		justify-content: flex-end;
		padding: 0;
		background: none;
		border: 0;
		border-radius: 0;
		font-family: var(--font-family-mono);
		font-size: 0.65625rem; /* 10.5px */
		font-weight: 400;
		line-height: normal;
		letter-spacing: 0.12em;
		color: var(--color-text-muted);
	}

	.nav-toggle__label {
		display: inline;
	}

	.nav-toggle__icon {
		display: none;
	}

	html.js .primary-navigation {
		display: none;
	}

	html.js .primary-navigation[data-open] {
		display: block;
		position: absolute;
		inset-inline: 0;
		top: 100%;
		padding: var(--space-4) 1.125rem;
		background-color: var(--color-bg);
		border-bottom: 1px solid var(--color-border);
	}

	html.js .primary-navigation[data-open] ul {
		flex-direction: column;
		gap: var(--space-3);
	}

	.primary-navigation[data-open] a {
		display: flex;
		align-items: center;
		min-height: 44px;
	}
}

@media (min-width: 768px) {
	.nav-toggle {
		display: none !important;
	}
}

/* ==========================================================
   Buttons
   Padding matches the frozen source's own primary CTA
   ("padding:19px 38px") — bumped from the original --space-3/--space-5
   during the Production Visual Fidelity gate (Hero's CTA read as too
   small relative to the corrected Hero H1 scale).
   ========================================================== */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--space-2);
	min-height: 44px;
	padding-inline: var(--space-6);
	padding-block: var(--space-4);
	border: 1px solid transparent;
	border-radius: var(--radius-md);
	font-size: var(--font-size-button);
	font-weight: 500;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--duration-base) var(--ease-standard),
		border-color var(--duration-base) var(--ease-standard),
		color var(--duration-base) var(--ease-standard);
}

.btn-primary {
	background-color: var(--color-button-primary-bg);
	color: var(--color-button-primary-text);
}

.btn-primary:hover {
	background-color: var(--color-button-primary-bg-hover);
}

.btn-primary:disabled,
.btn-primary[aria-disabled="true"] {
	background-color: var(--gray-300);
	color: var(--gray-600);
	cursor: not-allowed;
}

.btn-secondary {
	background-color: var(--color-button-secondary-bg);
	color: var(--color-button-secondary-text);
	border-color: var(--color-button-secondary-border);
}

.btn-secondary:hover {
	background-color: var(--color-button-secondary-bg-hover);
}

.btn-secondary:disabled,
.btn-secondary[aria-disabled="true"] {
	color: var(--gray-400);
	border-color: var(--gray-200);
	cursor: not-allowed;
}

.btn-text {
	min-height: auto;
	padding: 0;
	background: none;
	border: none;
	color: var(--color-accent);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.btn-text:hover {
	color: var(--color-accent-hover);
}

.btn-text:disabled,
.btn-text[aria-disabled="true"] {
	color: var(--gray-400);
	cursor: not-allowed;
}

/* ==========================================================
   Product proof frame
   Structural container for a real product screenshot — no fake UI,
   no browser chrome, no shadow/glow/glass treatment. Falls back to
   a plain surface-colored frame if used without an image.
   ========================================================== */

.product-proof-frame {
	width: 100%;
	max-width: 72rem;
	margin-inline: auto;
	aspect-ratio: 16 / 10;
	background-color: var(--color-surface);
	border: 1px solid var(--color-border);
	border-radius: var(--radius-lg);
}

.product-proof-frame img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

/*
 * Natural variant: no forced aspect-ratio or crop. For screenshots that
 * are already precisely cropped at the source and must not be cropped
 * again (e.g. Product Proof's input/result pair and mobile crops).
 */
.product-proof-frame--natural {
	aspect-ratio: auto;
}

.product-proof-frame--natural img {
	height: auto;
	object-fit: contain;
}
