/* ==========================================================================
   The Book section bar + "Continue reading" (About the book, Editor's
   perspective, Writing process). Her hub bar's look (paper band, hairline,
   gold underline on the current page), sized for every reader.
   ========================================================================== */

.ek-section-nav {
	position: sticky;
	top: 0;
	z-index: 100;
	background: var(--ek-paper);
	border-bottom: 1px solid var(--ek-line);
	font-family: var(--ek-font-sans-skye);
}
.ek-section-nav__inner { max-width: calc(var(--ek-grid) + 2 * var(--ek-edge)); margin: 0 auto; padding: 0 var(--ek-edge); display: flex; align-items: center; gap: 36px; }
.ek-section-nav__title {
	font-family: var(--ek-font-serif-skye);
	font-size: 22px;
	font-weight: 600;
	color: var(--ek-ink);
	padding-right: 36px;
	border-right: 1px solid var(--ek-line);
	white-space: nowrap;
}
/* Book One bar: the title is the link back to About the book (23 Nov). Same
   underline as the tabs on its own page and on hover; it never sticks on touch. */
a.ek-section-nav__title {
	position: relative;
	display: inline-flex;
	align-items: center;
	min-height: 60px;
	text-decoration: none;
}
a.ek-section-nav__title.is-active::after {
	content: '';
	position: absolute;
	left: 0;
	right: 36px;
	bottom: 0;
	height: 3px;
	background: var(--ek-veld-gold);
}
@media (hover: hover) and (pointer: fine) {
	a.ek-section-nav__title:hover::after {
		content: '';
		position: absolute;
		left: 0;
		right: 36px;
		bottom: 0;
		height: 3px;
		background: var(--ek-veld-gold);
	}
}
.ek-section-nav__roman { margin-right: 0.3em; }
a.ek-section-nav__title:focus-visible { outline: 3px solid var(--ek-veld-gold); outline-offset: -3px; }
.ek-section-nav__list { list-style: none; margin: 0; padding: 0; display: flex; gap: 34px; overflow-x: auto; scrollbar-width: none; }
.ek-section-nav__list::-webkit-scrollbar { display: none; }
.ek-section-nav__link {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	min-height: 60px;
	font-size: 16px;
	font-weight: 600;
	letter-spacing: 0.2px;
	color: var(--ek-muted-strong);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.2s ease;
}
.ek-section-nav__num { color: var(--ek-gold-text); font-weight: 700; }
.ek-section-nav__link:hover,
.ek-section-nav__link.is-active { color: var(--ek-ink); }
.ek-section-nav__link.is-active::after,
.ek-section-nav__link:hover::after {
	content: '';
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: var(--ek-veld-gold);
}
.ek-section-nav__link:focus-visible { outline: 3px solid var(--ek-veld-gold); outline-offset: -3px; }

.ek-continue { background: var(--ek-linen-deep); border-top: 1px solid var(--ek-line); padding: 100px 0 110px; font-family: var(--ek-font-sans-skye); }
.ek-continue__inner { max-width: calc(var(--ek-grid) + 2 * var(--ek-edge)); margin: 0 auto; padding: 0 var(--ek-edge); } /* the shared edge (tokens.css) */
.ek-continue__heading {
	font-family: var(--ek-font-serif-skye);
	font-size: 48px;
	font-weight: 500;
	line-height: 1.1;
	color: var(--ek-ink);
	margin: 0 0 40px;
}
.ek-continue__grid { display: grid; grid-template-columns: 1fr 1fr; gap: 30px; }
@media (min-width: 1025px) {
	.ek-continue__grid:has(> :nth-child(3)) { grid-template-columns: repeat(3, 1fr); } /* the Library's "Inside EK": all three Book One pages */
}
.ek-continue__card {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 44px 44px 40px;
	background: var(--ek-white);
	border: 1px solid var(--ek-line);
	border-top: 3px solid var(--ek-veld-gold);
	color: var(--ek-ink);
	text-decoration: none;
	transition: box-shadow 0.3s ease, transform 0.3s ease;
}
.ek-continue__card:hover { box-shadow: 0 18px 36px var(--ek-ink-a08); transform: translateY(-3px); }
.ek-continue__card:focus-visible { outline: 3px solid var(--ek-gold-text); outline-offset: 3px; } /* AA gold: 4.51:1 on the band (bright gold was 2.24:1, under the 3:1 a focus ring needs; 3 Nov) */
.ek-continue__title { font-family: var(--ek-font-serif-skye); font-size: 38px; font-weight: 500; line-height: 1.15; }
.ek-continue__text { font-size: 19px; line-height: 1.6; color: var(--ek-muted-strong); }
.ek-continue__go { margin-top: 8px; font-size: 15px; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; color: var(--ek-ink); border-bottom: 2px solid var(--ek-veld-gold); align-self: flex-start; padding-bottom: 4px; }

@media (max-width: 850px) {
	.ek-section-nav { top: var(--ek-header-visible, 0px); transition: top 0.3s ease; }
	.ek-section-nav__inner { padding: 0 20px; gap: 20px; }
	.ek-section-nav__title { display: none; }
	/* Book One bar on phones: a compact "EK" before the two tabs, so the way back is always there. */
	a.ek-section-nav__title { display: inline-flex; flex: 0 0 auto; min-height: 54px; padding: 0 14px 0 18px; font-size: 20px; }
	a.ek-section-nav__title.is-active::after,
	a.ek-section-nav__title:hover::after { left: 18px; right: 14px; }
	/* Room for both tabs beside it (AF labels keep to two lines at 390). */
	.ek-section-nav__inner:has(> a.ek-section-nav__title) .ek-section-nav__list { padding: 0 14px 0 4px; }
	.ek-section-nav__roman { display: none; }
	.ek-section-nav__list { gap: 24px; }
	.ek-section-nav__link { min-height: 54px; font-size: 14px; }
	.ek-continue { padding: 70px 0 80px; }
	.ek-continue__inner { padding: 0 var(--ek-edge); }
	.ek-continue__heading { font-size: 38px; margin-bottom: 26px; }
	.ek-continue__grid { grid-template-columns: 1fr; gap: 20px; }
	.ek-continue__card { padding: 30px 26px; }
	.ek-continue__title { font-size: 32px; }
	.ek-continue__text { font-size: 18px; }
}

/* Pages that end with Continue reading run straight into the footer. */
body:has(.ek-continue) .site-footer { margin-top: 0; }

/* Section bars on phones: one
   swipeable row from edge to edge. nav.js marks the side with more links
   (data-more) and that edge fades over the side padding, so a label runs
   out softly ("more this way") instead of being cut off mid-word. Snap and
   scroll-padding keep a link, and keyboard focus, clear of the fade. */
@media (max-width: 850px) {
	.ek-section-nav__inner { padding: 0; }
	.ek-section-nav__list {
		padding: 0 24px;
		scroll-snap-type: x proximity;
		scroll-padding-inline: 24px;
	}
	.ek-section-nav__list > li { scroll-snap-align: start; }
	/* A label wider than the clear window between the fades (24px + 48px of
	   the row, so 100% of the padded list minus 24px; "01. Reading Community
	   & Trilogy" at 320) wraps onto a second line
	   instead of running under the end fade. Shorter labels keep their one
	   line (no shrinking), and every link fills the row's height, so the
	   text stays centred and the gold underline stays on the bar's edge. */
	.ek-section-nav__list > li { display: flex; flex: 0 0 auto; max-width: calc(100% - 24px); }
	.ek-section-nav__link { display: flex; align-items: center; white-space: normal; line-height: 1.35; }
	.ek-section-nav__list[data-more="end"] {
		-webkit-mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
		mask-image: linear-gradient(to right, #000 calc(100% - 48px), transparent);
	}
	.ek-section-nav__list[data-more="start"] {
		-webkit-mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
		mask-image: linear-gradient(to left, #000 calc(100% - 24px), transparent);
	}
	.ek-section-nav__list[data-more="both"] {
		-webkit-mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 48px), transparent);
		mask-image: linear-gradient(to right, transparent, #000 24px, #000 calc(100% - 48px), transparent);
	}
}

/* The Book One bar has two tabs since 2 Nov (Editor's perspective, Author's
   perspective): on phones they share the row (a long label, e.g. Afrikaans
   "Die redakteur se perspektief", wraps onto a second line), so both are
   always in view and nothing hides under the fade. The Community bar keeps
   its swipeable row. */
@media (max-width: 850px) {
	.ek-section-nav__list[data-count="2"] { overflow: visible; scroll-snap-type: none; -webkit-mask-image: none; mask-image: none; gap: 16px; }
	.ek-section-nav__list[data-count="2"] > li { flex: 1 1 0; max-width: none; min-width: 0; }
	.ek-section-nav__list[data-count="2"] .ek-section-nav__link { width: 100%; }
}

/* Community bar (2 Nov, same component as Book One's, title "Community"):
   on phones its three sections stack as a short list (number, label, gold
   bar on the current one) instead of a strip that cut labels off; it then
   scrolls away with the page instead of sticking. */
@media (max-width: 850px) {
	.ek-section-nav--hub { position: static; }
	.ek-section-nav--hub .ek-section-nav__list { display: block; overflow: visible; padding: 6px 20px 8px; -webkit-mask-image: none; mask-image: none; scroll-snap-type: none; }
	.ek-section-nav--hub .ek-section-nav__list > li { display: block; max-width: none; }
	.ek-section-nav--hub .ek-section-nav__list > li + li { border-top: 1px solid var(--ek-line); }
	.ek-section-nav--hub .ek-section-nav__link { min-height: 48px; padding: 0 0 0 14px; font-size: 16px; white-space: normal; }
	.ek-section-nav--hub .ek-section-nav__link.is-active::after,
	.ek-section-nav--hub .ek-section-nav__link:hover::after { top: 10px; bottom: 10px; left: 0; right: auto; width: 3px; height: auto; }
}

/* Book One bar at 380px and under: a little less padding around "EK" so the
   two tabs keep to two lines (Afrikaans "Die redakteur se perspektief"). */
@media (max-width: 380px) {
	a.ek-section-nav__title { padding: 0 10px 0 14px; }
	a.ek-section-nav__title.is-active::after,
	a.ek-section-nav__title:hover::after { left: 14px; right: 10px; }
	.ek-section-nav__inner:has(> a.ek-section-nav__title) .ek-section-nav__list { padding: 0 10px 0 2px; gap: 10px; }
	.ek-section-nav__inner:has(> a.ek-section-nav__title) .ek-section-nav__link { gap: 6px; }
}
