/* ==========================================================================
   Base: reset, document, typography, links, focus, utilities.
   Component styles live in assets/css/components/.
   ========================================================================== */

/* --- Reset ------------------------------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
	-webkit-text-size-adjust: 100%;
	scroll-behavior: smooth;
}

body,
h1, h2, h3, h4, h5, h6,
p, figure, blockquote, dl, dd, ol, ul {
	margin: 0;
}

ul[role="list"],
ol[role="list"] { list-style: none; padding: 0; }

img, picture, svg, video, canvas {
	display: block;
	max-width: 100%;
	height: auto;
}

input, button, textarea, select { font: inherit; color: inherit; }

/* --- Document ---------------------------------------------------------- */
body {
	background-color: var(--ek-bg);
	color: var(--ek-text);
	font-family: var(--ek-font-sans);
	font-size: var(--ek-text-md);
	font-weight: var(--ek-weight-regular);
	line-height: var(--ek-leading-normal);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
	min-height: 100vh;
	display: flex;
	flex-direction: column;
}

.ek-site-main { flex: 1 0 auto; }

/* --- Headings ---------------------------------------------------------- */
h1, h2, h3, h4, h5, h6 {
	font-family: var(--ek-font-serif);
	font-weight: var(--ek-weight-semibold);
	line-height: var(--ek-leading-tight);
	letter-spacing: var(--ek-tracking-tight);
	text-wrap: balance;
	color: var(--ek-text);
}

h1 { font-size: var(--ek-text-3xl); font-weight: var(--ek-weight-regular); }
h2 { font-size: var(--ek-text-2xl); }
h3 { font-size: var(--ek-text-xl); }
h4 { font-size: var(--ek-text-lg); }
h5 { font-size: var(--ek-text-md); }
h6 { font-size: var(--ek-text-base); }

/* --- Text -------------------------------------------------------------- */
p { text-wrap: pretty; }

a {
	color: var(--ek-link);
	text-decoration-thickness: 1px;
	text-underline-offset: 0.2em;
	transition: color var(--ek-duration-sm) var(--ek-ease);
}
a:hover { color: var(--ek-link-hover); }

strong, b { font-weight: var(--ek-weight-semibold); }

blockquote {
	font-family: var(--ek-font-serif);
	font-size: var(--ek-text-xl);
	font-style: italic;
	line-height: var(--ek-leading-snug);
	border-left: 2px solid var(--ek-rule-accent);
	padding-left: var(--ek-space-5);
	color: var(--ek-text);
}

code, kbd, pre, samp {
	font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
	font-size: 0.9em;
}

hr {
	border: 0;
	height: var(--ek-hairline);
	background-color: var(--ek-rule);
	margin-block: var(--ek-space-7);
}

/* --- Focus ------------------------------------------------------------- */
/* Visible on every interactive element. The reference theme had none. */
:focus-visible {
	outline: 2px solid var(--ek-focus);
	outline-offset: 2px;
	border-radius: var(--ek-radius);
}
:focus:not(:focus-visible) { outline: none; }

/* --- Skip link --------------------------------------------------------- */
.ek-skip-link {
	position: absolute;
	top: 0;
	left: var(--ek-space-4);
	z-index: 9999;
	transform: translateY(-120%);
	background-color: var(--ek-earth-dark);
	color: var(--ek-on-dark);
	padding: var(--ek-space-3) var(--ek-space-5);
	font-size: var(--ek-text-sm);
	font-weight: var(--ek-weight-semibold);
	text-decoration: none;
	transition: transform var(--ek-duration-sm) var(--ek-ease);
}
.ek-skip-link:focus {
	transform: translateY(0);
	color: var(--ek-on-dark);
}

/* --- Layout ------------------------------------------------------------ */
.ek-container {
	width: 100%;
	max-width: calc(var(--ek-grid) + 2 * var(--ek-edge)); /* the shared edge (tokens.css, 3 Nov) */
	margin-inline: auto;
	padding-inline: var(--ek-edge);
}
.ek-container--narrow { max-width: var(--ek-container-narrow); }

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

/* --- Prose (post/page content) ----------------------------------------- */
.ek-prose { max-width: var(--ek-measure); }
.ek-prose > * + * { margin-top: var(--ek-space-5); }
.ek-prose h2 { margin-top: var(--ek-space-8); }
.ek-prose h3 { margin-top: var(--ek-space-7); }
.ek-prose ul,
.ek-prose ol { padding-left: 1.4em; }
.ek-prose li + li { margin-top: var(--ek-space-2); }
.ek-prose li::marker { color: var(--ek-text-accent); }
.ek-prose img { margin-block: var(--ek-space-6); }

/* --- Eyebrow / label --------------------------------------------------- */
.ek-eyebrow {
	display: block;
	font-family: var(--ek-font-serif);
	font-style: italic;
	font-size: var(--ek-text-lg);
	font-weight: var(--ek-weight-regular);
	line-height: 1.3;
	color: var(--ek-text-accent);
}

/* --- Pre-order line ---------------------------------------------------- */
/* Written once in inc/woocommerce.php (ek_preorder_notice), shown wherever a
   physical edition appears. */
.ek-preorder-note {
	font-family: var(--ek-font-serif);
	font-style: italic;
	font-size: var(--ek-text-lg);
	color: var(--ek-text-accent);
	margin: 0;
}

/* --- Afrikaans terms --------------------------------------------------- */
/* Never translated. Marked with lang="af" (or "nl") so screen readers switch
   voice. Set in the surrounding font, bold (JD, 29 Oct: the italic serif was
   hard to read); in a heading that is the heading's font. */
.ek-af {
	font-style: normal;
	font-family: inherit;
	font-size: inherit;
	font-weight: 700;
}


/* A neutral frame in her palette where an image is still to come: no text. */
.ek-placeholder-frame {
	display: block;
	width: 100%;
	height: auto;
	background-color: var(--ek-frame-ground);
	background-image:
		linear-gradient(160deg, var(--ek-white-a55) 0%, var(--ek-white-a00) 55%),
		linear-gradient(0deg, var(--ek-earth-dark-a06) 0%, var(--ek-earth-dark-a00) 40%);
	border: 1px solid var(--ek-border);
	box-shadow: inset 0 0 0 10px var(--ek-linen), inset 0 0 0 11px var(--ek-frame-line);
}
.ek-placeholder-frame--cover     { aspect-ratio: 2 / 3; }
.ek-placeholder-frame--portrait  { aspect-ratio: 4 / 5; }
.ek-placeholder-frame--landscape { aspect-ratio: 3 / 2; }
.ek-placeholder-frame--hero      { aspect-ratio: 16 / 9; }
.ek-placeholder-frame--square    { aspect-ratio: 1 / 1; }

/* --- WordPress core classes -------------------------------------------- */
.screen-reader-text {
	border: 0;
	clip-path: inset(50%);
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	white-space: nowrap;
}
.screen-reader-text:focus {
	clip-path: none;
	height: auto;
	width: auto;
	margin: 0;
	padding: var(--ek-space-3) var(--ek-space-4);
	background-color: var(--ek-surface);
	z-index: 10000;
	position: fixed;
	top: var(--ek-space-4);
	left: var(--ek-space-4);
}

.alignleft  { float: left;  margin: 0 var(--ek-space-5) var(--ek-space-4) 0; }
.alignright { float: right; margin: 0 0 var(--ek-space-4) var(--ek-space-5); }
.aligncenter { margin-inline: auto; }
.alignwide  { max-width: var(--ek-container); }
.alignfull  { max-width: none; }

.wp-caption-text,
figcaption {
	font-size: var(--ek-text-sm);
	color: var(--ek-text-muted);
	margin-top: var(--ek-space-2);
}

.sticky, .gallery-caption, .bypostauthor { /* required by the theme check */ }

/* Afrikaans compounds are long ("Gemeenskapsintekening"): on narrow screens a
   heading hyphenates or breaks inside the word instead of running off the page.
   English headings are unchanged. */
:lang(af) h1,
:lang(af) h2,
:lang(af) h3 {
	hyphens: auto;
	overflow-wrap: anywhere; /* "anywhere" also lets a grid column shrink below the long word */
}

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

/* Hover looks the same with or without reduced motion (JD, 3 Nov). Under
   reduced motion only the travel is skipped (transitions are 0.01ms, above):
   cards still end lifted, arrows still end nudged, exactly as in normal motion.
   A lifted card could leave a pointer resting on its lower edge, drop back
   under it and flicker (seen on the Shop editions, 2 Nov), so while hovered each
   lifting card keeps an invisible strip below it as tall as its largest lift
   (6px): the pointer stays on the card. The strip works in both modes.
   `html` lifts these above the page files, which load after this one. */
html .ek-card,
html .ek-continue__card,
html .ek-skye-community .review-card,
html .ek-skye-community .channel-box,
html .ek-skye-contact .social-card,
html .ek-skye-book .theme-card { position: relative; }
/* Its strip sits outside the card; nothing inside overflows it (measured at
   320, 390 and 1440 in English and Afrikaans, 3 Nov). */
html .ek-skye-author .social-card { overflow: visible; }
html .ek-card:hover::after,
html .ek-continue__card:hover::after,
html .ek-skye-shop .edition-card:hover::after,
html .ek-skye-community .review-card:hover::after,
html .ek-skye-community .channel-box:not(.is-soon):hover::after,
html .ek-skye-contact .social-card:not(.is-soon):hover::after,
html .ek-skye-author .social-card:not(.is-soon):hover::after,
html .ek-skye-book .theme-card:hover::after {
	content: '';
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	height: 6px;
}

/* ==========================================================================
   Skye components (design decision 1): the reference theme's vocabulary,
   rebuilt on tokens. Used sitewide.
   ========================================================================== */

/* Small uppercase gold label above a title. */
.ek-kicker {
	display: block;
	font-family: var(--ek-font-sans);
	font-size: var(--ek-text-xs);
	font-weight: var(--ek-weight-semibold);
	letter-spacing: var(--ek-tracking-label);
	text-transform: uppercase;
	color: var(--ek-text-accent); /* gold-ink, 4.76:1 on sand */
	margin: 0 0 var(--ek-space-3);
}

/* Uppercase tracked serif title with a hairline beneath (her .section-title). */
.ek-section-title {
	font-family: var(--ek-font-serif);
	font-size: 1.625rem;           /* 26px */
	font-weight: var(--ek-weight-semibold);
	line-height: 1.2;
	letter-spacing: 0.077em;       /* 2px at 26px */
	text-transform: uppercase;
	color: var(--ek-text);
	margin: 0 0 2.1875rem;         /* 35px */
	padding-bottom: 0.75rem;       /* 12px */
	border-bottom: var(--ek-hairline) solid var(--ek-rule);
}
.ek-section-title--plain { border-bottom: 0; padding-bottom: 0; margin-bottom: var(--ek-space-5); }

/* Bordered card (her .card-box): lifts and turns gold on hover. */
.ek-card {
	background-color: var(--ek-surface);
	border: var(--ek-hairline) solid var(--ek-rule);
	padding: clamp(1.5rem, 1rem + 2vw, 2.1875rem);   /* 35px on desktop */
	transition: transform 300ms ease, border-color 300ms ease, box-shadow 300ms ease;
}
@media (hover: hover) {
	.ek-card:hover {
		transform: translateY(-4px);
		border-color: var(--ek-veld-gold);
		box-shadow: 0 12px 24px var(--ek-ink-home-a05);
	}
}
.ek-card h3 { font-size: 1.375rem; margin: 0 0 0.75rem; }

.ek-cards {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(min(100%, 18.75rem), 1fr));  /* her 300px */
	gap: 1.875rem;                                                              /* her 30px */
}

/* Uppercase gold link with an underline that draws in. */
.ek-read-more {
	position: relative;
	display: inline-block;
	font-family: var(--ek-font-sans);
	font-size: var(--ek-text-xs);
	font-weight: var(--ek-weight-semibold);
	letter-spacing: var(--ek-tracking-label);
	text-transform: uppercase;
	color: var(--ek-text-accent);
	text-decoration: none;
	padding-bottom: 2px;
}
.ek-read-more::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 100%;
	height: 1px;
	background-color: currentColor;
	transform: scaleX(0);
	transform-origin: right;
	transition: transform var(--ek-duration) var(--ek-ease);
}
.ek-read-more:hover,
.ek-read-more:focus-visible { color: var(--ek-text); }
.ek-read-more:hover::after,
.ek-read-more:focus-visible::after { transform: scaleX(1); transform-origin: left; }

/* Italic serif quote with a gold rule, from the reference excerpt box. */
.ek-quote-box {
	margin: 0;
	padding: var(--ek-space-6) var(--ek-space-6) var(--ek-space-6) var(--ek-space-7);
	background-color: var(--ek-paper-warm);
	border: var(--ek-hairline) solid var(--ek-rule);
	border-left: 3px solid var(--ek-veld-gold);
}
.ek-quote-box blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	font-family: var(--ek-font-serif);
	font-style: italic;
	font-size: var(--ek-text-xl);
	line-height: var(--ek-leading-snug);
}
.ek-quote-box blockquote p { margin: 0; }
.ek-quote-box figcaption {
	margin-top: var(--ek-space-4);
	font-size: var(--ek-text-xs);
	font-weight: var(--ek-weight-semibold);
	letter-spacing: var(--ek-tracking-label);
	text-transform: uppercase;
	color: var(--ek-text-accent);
}

/* Her hero kicker: a small gold-tinted pill. */
.ek-kicker--pill {
	display: inline-block;
	padding: 0.3125rem 0.75rem;
	background-color: var(--ek-veld-gold-a08);
	border: var(--ek-hairline) solid var(--ek-veld-gold-a25);
	border-radius: 2px;
	letter-spacing: 0.25em;
	font-weight: var(--ek-weight-bold);
}

/* --------------------------------------------------------------------------
   "Coming soon" (round 2): future parts of the brief (channels, books 2 and 3,
   excerpts, book club guide) as a quiet hairline tag in her kicker type.
   Cards that carry it are not links and don't react to hover.
   (.ek-skye .ek-soon: beats her scoped reset in skye.css.)
   -------------------------------------------------------------------------- */
.ek-soon,
.ek-skye .ek-soon {
	display: inline-block;
	padding: 5px 12px;
	border: 1px solid var(--ek-gold-text-a45);
	border-radius: 2px;
	background-color: var(--ek-veld-gold-a07);
	font-family: var(--ek-font-sans);
	font-size: 13px;
	font-style: normal;
	font-weight: 600;
	letter-spacing: 2px;
	line-height: 1.4;
	text-transform: uppercase;
	color: var(--ek-gold-link); /* AA on sand, white and its own gold wash */
	white-space: nowrap;
}
.is-soon { cursor: default; }
.is-soon .ek-soon,
.ek-skye .is-soon .ek-soon { margin-top: 16px; }
/* A teaser isn't a link, so it doesn't lift. `html` lifts this above the page
   files' card hovers (same specificity, loaded later), which made it lift away
   from a pointer near its lower edge and flicker (3 Nov). */
html .ek-skye .is-soon:hover { transform: none; box-shadow: none; border-color: var(--hairline, var(--ek-border)); }
html .ek-skye .is-soon:hover::before { transform: scaleX(0); }
.ek-skye .is-soon .social-handle,
.ek-skye .is-soon .channel-handle { color: var(--ek-muted-soon); }

/* R600 incl. delivery (JD, 23 Nov): the note after the numbered edition's price.
   Quiet and smaller than the price; inherits its colour so it reads on light and dark bands. */
.ek-price-incl {
	display: inline-block;
	font-size: 0.72em;
	font-weight: 400;
	letter-spacing: 0.02em;
	text-transform: none;
	opacity: 0.85;
	white-space: nowrap;
}
/* After the purchase: where to find the order again (order received, My account > view order). */
.ek-account-route {
	margin: var(--ek-space-4, 1rem) 0;
	color: var(--ek-muted);
	font-size: 0.95em;
	max-width: 60ch;
}
.ek-account-route a { color: inherit; text-decoration: underline; text-underline-offset: 0.15em; }

/* Ordinary softcover: its "Where to buy" chooser lives in polish.css (24 Nov). */
