/**
 * Viora Design System — primitives.
 *
 * Every value here reads from a token printed by Viora_Design_System.
 * Widgets must compose these primitives instead of inventing their own styles.
 */

/* -------------------------------------------------- *
 * Display face (Butler)
 *
 * Butler is not a Google font, so it is self-hosted from assets/fonts/butler/.
 * Three weights are shipped — the ones the design actually uses, plus bold for
 * anyone who picks it in Elementor. The stack in --viora-font-display still
 * names Playfair Display behind it, which covers the swap window and any
 * weight not shipped here.
 *
 * The family is also registered with Elementor's font picker (see
 * Viora_Fonts), so it can be chosen under Site Settings like any other face.
 * -------------------------------------------------- */

@font-face {
	font-family: "Butler";
	src:
		url("../fonts/butler/butler-regular.woff2") format("woff2"),
		url("../fonts/butler/butler-regular.woff") format("woff");
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Butler";
	src:
		url("../fonts/butler/butler-medium.woff2") format("woff2"),
		url("../fonts/butler/butler-medium.woff") format("woff");
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}

@font-face {
	font-family: "Butler";
	src:
		url("../fonts/butler/butler-bold.woff2") format("woff2"),
		url("../fonts/butler/butler-bold.woff") format("woff");
	font-weight: 700;
	font-style: normal;
	font-display: swap;
}

/* -------------------------------------------------- *
 * Layout primitives
 * -------------------------------------------------- */

.viora-container {
	width: 100%;
	max-width: var(--viora-layout-container);
	margin-inline: auto;
	padding-inline: var(--viora-layout-container-pad);
}

.viora-container--wide {
	max-width: var(--viora-layout-container-wide);
}

.viora-section {
	position: relative;
	padding-block: var(--viora-layout-section-y);
}

.viora-stack {
	display: flex;
	flex-direction: column;
	gap: var(--viora-space-sm);
}

/* -------------------------------------------------- *
 * Typography primitives
 * -------------------------------------------------- */

/*
 * Subheading — the letter-spaced label used above section titles
 * (Inter Medium 14 / 0.37em tracking in the design file).
 */
.viora-subheading {
	margin: 0;
	color: var(--viora-color-heading);
	font-family: var(--viora-font-ui);
	font-size: clamp(0.75rem, 0.97vw, 0.875rem);
	font-weight: var(--viora-weight-medium);
	line-height: 2.14;
	letter-spacing: 0.37em;
	text-transform: uppercase;
}

/* Thin rule that trails a subheading. */
.viora-rule {
	flex: 1 1 auto;
	height: 1px;
	min-width: 2rem;
	background-color: var(--viora-color-heading);
	opacity: 0.25;
}

/* -------------------------------------------------- *
 * Colour schemes
 *
 * A section declares one scheme class and every primitive inside it reads
 * `--viora-ink` / `--viora-hairline` / `--viora-surface`. That is the only way
 * a widget is allowed to go dark: no per-widget colour overrides, no
 * `.is-dark .foo` chains fighting each other for specificity.
 * -------------------------------------------------- */

.viora-scheme--cream,
.viora-scheme--light,
.viora-scheme--sand,
.viora-scheme--dark {
	color: var(--viora-ink);
	background-color: var(--viora-surface);
}

.viora-scheme--cream {
	--viora-ink: var(--viora-color-heading);
	--viora-ink-soft: var(--viora-color-heading-soft);
	--viora-hairline: rgba(17, 17, 17, 0.14);
	--viora-surface: var(--viora-color-surface-cream);
}

.viora-scheme--light {
	--viora-ink: var(--viora-color-heading);
	--viora-ink-soft: var(--viora-color-heading-soft);
	--viora-hairline: rgba(17, 17, 17, 0.12);
	--viora-surface: var(--viora-color-surface);
}

.viora-scheme--sand {
	--viora-ink: var(--viora-color-heading);
	--viora-ink-soft: var(--viora-color-heading-soft);
	--viora-hairline: rgba(17, 17, 17, 0.18);
	--viora-surface: var(--viora-color-surface-sand);
}

.viora-scheme--dark {
	--viora-ink: var(--viora-color-on-invert);
	--viora-ink-soft: rgba(255, 255, 255, 0.62);
	--viora-hairline: rgba(255, 255, 255, 0.18);
	--viora-surface: var(--viora-color-surface-invert);
}

/* -------------------------------------------------- *
 * Section head
 *
 * The label + rule + display title + lead paragraph opening that every
 * editorial section shares, tuned on the About frame (140px display, 24.6
 * below the label, 0.92 leading).
 * -------------------------------------------------- */

.viora-head {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	min-width: 0;
}

/* Label 70 wide, 42 gap, rule 125 — the About proportions. */
.viora-head__label {
	display: flex;
	align-items: center;
	gap: clamp(1rem, 2.917vw, 2.625rem);
	/* Sized by its content, not capped: a two-word label inside a fixed max
	   width wraps onto a second line and drags the rule down with it. */
	width: fit-content;
	max-width: 100%;
}

.viora-head__label .viora-subheading {
	white-space: nowrap;
}

/* Fixed rather than flexible, since the row no longer has a width to fill. */
.viora-head__label .viora-rule {
	flex: 0 0 auto;
	width: clamp(2rem, 8.68vw, 7.8125rem);   /* 125 */
}

.viora-head__title {
	margin: clamp(1rem, 1.708vw, 1.54rem) 0 0;
	color: var(--viora-ink, var(--viora-color-heading));
	font-family: var(--viora-font-display);
	font-size: var(--viora-head-size, clamp(2.75rem, 6.11vw, 5.5rem));
	font-weight: 400;
	line-height: 0.96;
	letter-spacing: -0.035em;
}

/* The one italic word that carries the line — used sparingly, as in the
   design's "From _the_ Journal". */
.viora-head__title em {
	font-style: italic;
	font-weight: 400;
}

.viora-head__text {
	margin: clamp(1rem, 1.667vw, 1.5rem) 0 0;
	max-width: clamp(18rem, 31.95vw, 28.75rem);
	color: var(--viora-ink, var(--viora-color-heading));
	font-family: var(--viora-font-ui);
	font-size: clamp(1rem, 1.25vw, 1.125rem);
	line-height: 1.643;
}

.viora-head__text p {
	margin: 0 0 var(--viora-space-2xs);
}

.viora-head__text p:last-child {
	margin-bottom: 0;
}

/*
 * Centred variant. The label row is a measure on the left-aligned head — a
 * flexible rule that fills the remaining width. Centred, that rule has to
 * become a fixed ornament, or a label that wraps drags a long line with it.
 */
.viora-head--center {
	align-items: center;
	text-align: center;
}

.viora-head--center .viora-head__label {
	justify-content: center;
	max-width: none;
	gap: clamp(0.75rem, 1.4vw, 1.25rem);
}

.viora-head--center .viora-head__label .viora-rule {
	flex: 0 0 auto;
	width: clamp(2rem, 4vw, 3.5rem);
	min-width: 0;
}

.viora-head--center .viora-head__text {
	margin-inline: auto;
}

/* Inherits the section ink, so it reads on cream and on black alike. */
.viora-head .viora-subheading,
.viora-scheme--dark .viora-subheading {
	color: var(--viora-ink, var(--viora-color-heading));
}

.viora-head .viora-rule,
.viora-scheme--dark .viora-rule {
	background-color: var(--viora-ink, var(--viora-color-heading));
}

/* -------------------------------------------------- *
 * Text link with a trailing arrow
 * -------------------------------------------------- */

.viora-link {
	display: inline-flex;
	align-items: center;
	gap: clamp(0.625rem, 1.1vw, 1rem);
	color: var(--viora-ink, var(--viora-color-heading));
	font-family: var(--viora-font-ui);
	font-size: 0.8125rem;
	font-weight: var(--viora-weight-medium);
	line-height: 1.7;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	text-decoration: none;
}

.viora-link__label {
	position: relative;
}

/* Sweeps in from the left on hover — the same 0.22/1/0.36/1 curve as
   everything else that moves on this site. */
.viora-link__label::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -0.25em;
	height: 1px;
	background-color: currentColor;
	transform: scaleX(0);
	transform-origin: right center;
	transition: transform var(--viora-motion-slow) var(--viora-motion-easing);
}

.viora-link:hover .viora-link__label::after,
.viora-link:focus-visible .viora-link__label::after {
	transform: scaleX(1);
	transform-origin: left center;
}

.viora-link__arrow {
	display: block;
	width: 1.625rem;
	height: 0.75rem;
	transition: transform var(--viora-motion-slow) var(--viora-motion-easing);
}

.viora-link:hover .viora-link__arrow {
	transform: translateX(0.3rem);
}

/* -------------------------------------------------- *
 * Editorial index number
 * -------------------------------------------------- */

.viora-index {
	display: block;
	color: var(--viora-ink-soft, var(--viora-color-heading-soft));
	font-family: var(--viora-font-ui);
	font-size: 0.75rem;
	font-weight: var(--viora-weight-medium);
	line-height: 1.7;
	letter-spacing: 0.24em;
}

.viora-hairline {
	display: block;
	width: 100%;
	height: 1px;
	border: 0;
	margin: 0;
	background-color: var(--viora-hairline, rgba(17, 17, 17, 0.14));
}

/* -------------------------------------------------- *
 * Button primitive
 * -------------------------------------------------- */

.viora-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: var(--viora-space-2xs);
	padding: 0.9em 1.6em;
	border: 1px solid transparent;
	border-radius: var(--viora-radius-full);
	font-family: var(--viora-font-body);
	font-size: var(--viora-size-sm);
	font-weight: var(--viora-weight-semibold);
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
	transition:
		background-color var(--viora-motion-base) var(--viora-motion-easing),
		color var(--viora-motion-base) var(--viora-motion-easing),
		border-color var(--viora-motion-base) var(--viora-motion-easing),
		transform var(--viora-motion-fast) var(--viora-motion-easing),
		box-shadow var(--viora-motion-base) var(--viora-motion-easing);
}

.viora-btn:hover {
	transform: translateY(-2px);
}

.viora-btn:focus-visible {
	outline: 2px solid var(--viora-color-primary);
	outline-offset: 3px;
}

.viora-btn.viora-btn--primary {
	background-color: var(--viora-color-primary);
	color: var(--viora-color-on-primary);
	box-shadow: var(--viora-shadow-sm);
}

.viora-btn.viora-btn--primary:hover {
	background-color: var(--viora-color-primary-hover);
	color: var(--viora-color-on-primary);
	box-shadow: var(--viora-shadow-md);
}

.viora-btn.viora-btn--secondary {
	background-color: var(--viora-color-secondary);
	color: var(--viora-color-on-primary);
}

.viora-btn.viora-btn--secondary:hover {
	background-color: var(--viora-color-heading);
	color: var(--viora-color-on-primary);
}

.viora-btn.viora-btn--ghost {
	background-color: transparent;
	border-color: var(--viora-color-border);
	color: var(--viora-color-heading);
}

.viora-btn.viora-btn--ghost:hover {
	border-color: var(--viora-color-primary);
	color: var(--viora-color-primary);
}

.viora-btn.viora-btn--outline {
	background-color: transparent;
	border-color: var(--viora-color-heading);
	color: var(--viora-color-heading);
}

.viora-btn.viora-btn--outline:hover {
	background-color: var(--viora-color-heading);
	color: var(--viora-color-on-invert);
}

.viora-btn.viora-btn--link {
	padding-inline: 0;
	background: none;
	color: var(--viora-color-primary);
}

.viora-btn.viora-btn--link:hover {
	color: var(--viora-color-primary-hover);
	text-decoration: underline;
}

/*
 * The gold call to action from the design: 231×58, uppercase Inter 15/1.7,
 * a 38 gap and a long arrow. About tunes its own copy of this to the pixel;
 * every other section uses this one.
 */
.viora-btn.viora-btn--fill {
	gap: clamp(1.25rem, 2.639vw, 2.375rem);
	padding: 1rem 1.4375rem 1rem 1.875rem;
	border: 0;
	background-color: var(--viora-color-accent);
	color: var(--viora-color-on-invert);
	font-family: var(--viora-font-ui);
	font-size: 0.9375rem;
	font-weight: var(--viora-weight-medium);
	line-height: 1.7;
	letter-spacing: -0.025em;
	text-transform: uppercase;
	box-shadow: none;
}

.viora-btn.viora-btn--fill:hover {
	background-color: var(--viora-color-heading-soft);
	color: var(--viora-color-on-invert);
	box-shadow: none;
}

.viora-btn--fill .viora-btn__arrow {
	display: block;
	width: 1.875rem;
	height: 0.875rem;
}

.viora-btn__icon {
	display: inline-flex;
	align-items: center;
	font-size: 1.1em;
	line-height: 0;
}

.viora-btn__icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
}

/* -------------------------------------------------- *
 * Card primitive
 * -------------------------------------------------- */

.viora-card {
	padding: var(--viora-space-md);
	border: 1px solid var(--viora-color-border);
	border-radius: var(--viora-radius-lg);
	background: var(--viora-color-surface);
	box-shadow: var(--viora-shadow-xs);
	transition:
		transform var(--viora-motion-base) var(--viora-motion-easing),
		box-shadow var(--viora-motion-base) var(--viora-motion-easing);
}

.viora-card:hover {
	transform: translateY(-4px);
	box-shadow: var(--viora-shadow-md);
}

/* -------------------------------------------------- *
 * Prose
 *
 * The measure is set in ch so it holds at every size: ~68 characters is the
 * comfortable line for this face.
 * -------------------------------------------------- */

.viora-prose {
	max-width: 40rem;
	color: var(--viora-ink, var(--viora-color-heading));
	font-family: var(--viora-font-ui);
	font-size: clamp(1rem, 1.25vw, 1.125rem);
	line-height: 1.75;
}

.viora-prose > * {
	margin-block: 0 clamp(1rem, 1.5vw, 1.35rem);
}

.viora-prose > *:last-child {
	margin-bottom: 0;
}

.viora-prose h2,
.viora-prose h3,
.viora-prose h4 {
	margin-top: clamp(2rem, 3.3vw, 3rem);
	margin-bottom: clamp(0.6rem, 0.9vw, 0.85rem);
	color: var(--viora-ink, var(--viora-color-heading));
	font-family: var(--viora-font-display);
	font-weight: 400;
	line-height: 1.14;
	letter-spacing: -0.03em;
}

.viora-prose h2 {
	font-size: clamp(1.5rem, 2.36vw, 2.125rem);
}

.viora-prose h3 {
	font-size: clamp(1.25rem, 1.8vw, 1.625rem);
}

.viora-prose h4 {
	font-size: clamp(1.125rem, 1.5vw, 1.375rem);
}

.viora-prose a {
	color: var(--viora-ink, var(--viora-color-heading));
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-repeat: no-repeat;
	background-position: 0 100%;
	background-size: 100% 1px;
	transition: color var(--viora-motion-base) var(--viora-motion-easing);
}

.viora-prose a:hover {
	color: var(--viora-color-accent);
}

.viora-prose ul,
.viora-prose ol {
	padding-left: 1.25rem;
}

.viora-prose li {
	margin-bottom: 0.4rem;
}

.viora-prose li::marker {
	color: var(--viora-color-accent);
}

.viora-prose blockquote {
	margin-inline: 0;
	padding-left: clamp(1rem, 1.7vw, 1.5rem);
	border-left: 2px solid var(--viora-color-accent);
	color: var(--viora-ink, var(--viora-color-heading));
	font-family: var(--viora-font-display);
	font-size: clamp(1.25rem, 1.8vw, 1.625rem);
	font-style: italic;
	line-height: 1.36;
	letter-spacing: -0.02em;
}

.viora-prose blockquote p:last-child {
	margin-bottom: 0;
}

.viora-prose img,
.viora-prose figure {
	max-width: 100%;
	height: auto;
}

.viora-prose figure {
	margin-inline: 0;
}

.viora-prose figcaption {
	margin-top: 0.6rem;
	color: var(--viora-ink-soft, var(--viora-color-heading-soft));
	font-size: 0.8125rem;
	line-height: 1.6;
}

.viora-prose hr {
	height: 1px;
	border: 0;
	margin-block: clamp(2rem, 3.3vw, 3rem);
	background-color: var(--viora-hairline, rgba(17, 17, 17, 0.14));
}

.viora-prose code {
	padding: 0.15em 0.4em;
	border-radius: var(--viora-radius-xs);
	background-color: var(--viora-color-surface-alt);
	font-family: var(--viora-font-mono);
	font-size: 0.9em;
}

.viora-prose pre {
	padding: clamp(1rem, 1.7vw, 1.5rem);
	overflow-x: auto;
	border-radius: var(--viora-radius-sm);
	background-color: var(--viora-color-surface-invert);
	color: var(--viora-color-on-invert);
	font-family: var(--viora-font-mono);
	font-size: 0.875rem;
	line-height: 1.7;
}

.viora-prose pre code {
	padding: 0;
	background: none;
	color: inherit;
}

.viora-prose table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.9375rem;
}

.viora-prose th,
.viora-prose td {
	padding: 0.6rem 0.75rem;
	border-bottom: 1px solid var(--viora-hairline, rgba(17, 17, 17, 0.14));
	text-align: left;
}

/* -------------------------------------------------- *
 * Utilities
 * -------------------------------------------------- */

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

/*
 * Site-wide scroll reveal, for everything Elementor does not build. The
 * widgets run the same choreography through their own `__item` classes; these
 * numbers are kept in step with them on purpose, so a blog page and a home
 * page section arrive at the same speed.
 *
 * `--viora-reveal-delay` is written by the motion layer to stagger siblings.
 */
.viora-reveal {
	opacity: 0;
	transform: translateY(var(--viora-reveal-shift, 24px));
	transition:
		opacity 0.9s var(--viora-motion-easing),
		transform 0.9s var(--viora-motion-easing);
	transition-delay: var(--viora-reveal-delay, 0ms);
}

.viora-reveal.is-visible {
	opacity: 1;
	transform: none;
}

/* A smaller lift for dense rows: list items, meta lines, sidebar blocks. */
.viora-reveal--soft {
	--viora-reveal-shift: 14px;
}

@media (prefers-reduced-motion: reduce) {
	.viora-btn,
	.viora-card,
	.viora-reveal {
		transition: none;
	}

	.viora-btn:hover,
	.viora-card:hover {
		transform: none;
	}

	.viora-reveal {
		opacity: 1;
		transform: none;
	}
}
