@charset "UTF-8";

/* ==========================================================================
   KWT.ONE — مقالات الكويت
   Dark-first Arabic editorial theme, built to the project mockups.

   Reading order:
     1  Fonts
     2  Tokens
     3  Reset and base
     4  Layout primitives
     5  Header, chips, bottom nav
     6  Cards
     7  Sections
     8  Hero
     9  Article
    10  Archive and search
    11  Pagination, footer, 404
    12  Print
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Fonts — Almarai only.

   Almarai ships 300/400/700/800 and has no 500 or 600, so the hierarchy is
   built on the weights that exist rather than faked with synthetic ones:
   800 for the display headline, 700 for section headings and emphasis, 400
   for everything that is read at length. 300 is deliberately not shipped —
   light Arabic loses its dots and teeth at body sizes on a dark background.

   Arabic and Latin are split by unicode-range, so an Arabic page never
   downloads the Latin files. ~33 KB per weight on a typical page.
   -------------------------------------------------------------------------- */

@font-face {
	font-family: "Almarai";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/almarai-ar-400.woff2") format("woff2");
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1,
		U+08E3-08FF, U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7E, U+1EE00-1EEFF;
}
@font-face {
	font-family: "Almarai";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/almarai-ar-700.woff2") format("woff2");
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1,
		U+08E3-08FF, U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7E, U+1EE00-1EEFF;
}
@font-face {
	font-family: "Almarai";
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: url("../fonts/almarai-ar-800.woff2") format("woff2");
	unicode-range: U+0600-06FF, U+0750-077F, U+0870-088E, U+0890-0891, U+0898-08E1,
		U+08E3-08FF, U+FB50-FDFF, U+FE70-FEFF, U+10E60-10E7E, U+1EE00-1EEFF;
}

@font-face {
	font-family: "Almarai";
	font-style: normal;
	font-weight: 400;
	font-display: swap;
	src: url("../fonts/almarai-la-400.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F,
		U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Almarai";
	font-style: normal;
	font-weight: 700;
	font-display: swap;
	src: url("../fonts/almarai-la-700.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F,
		U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
	font-family: "Almarai";
	font-style: normal;
	font-weight: 800;
	font-display: swap;
	src: url("../fonts/almarai-la-800.woff2") format("woff2");
	unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+2000-206F,
		U+2074, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   2. Tokens
   -------------------------------------------------------------------------- */

:root {
	color-scheme: dark;

	/* Surfaces. Warm-shifted near-black, not neutral grey — the page should
	   read as ink on paper photographed at night, not as a UI chrome. */
	--page: #100f0e;
	--surface: #1a1918;
	--surface-2: #242220;
	--rule: #2e2b28;

	--ink: #ece7e0;
	--ink-soft: #a8a199;
	--ink-faint: #736c65;

	/* Brand ramp. #9d1824 is the identity colour but only carries 3.7:1 against
	   the page, so it stays on large surfaces (chips, badges, fills) and the
	   lighter step handles anything read as text. */
	--brand: #9d1824;
	--brand-400: #c8323f;
	--brand-300: #e8737a;

	/* Cream island — the من ذاكرة الكويت treatment from the mockups. */
	--cream: #e8ddc8;
	--cream-2: #f6efe0;
	--cream-ink: #241d13;
	--cream-soft: #5f5241;
	--cream-rule: #d3c3a4;
	--sand: #d9c6a5;

	/* Fluid scale, 360px → 1200px. px, so a browser or plugin changing the root
	   font size cannot silently rescale the hierarchy. */
	--fs-xs: clamp(12px, 11.57px + 0.119vw, 13px);
	--fs-sm: clamp(13px, 12.14px + 0.238vw, 15px);
	--fs-base: clamp(16px, 14.71px + 0.357vw, 19px);
	--fs-body: clamp(17px, 15.29px + 0.476vw, 21px);
	--fs-lead: clamp(18px, 15.86px + 0.595vw, 23px);
	--fs-h3: clamp(19px, 17.29px + 0.476vw, 23px);
	--fs-h2: clamp(22px, 19.43px + 0.714vw, 28px);
	--fs-h1: clamp(28px, 20.29px + 2.143vw, 46px);
	--fs-hero: clamp(30px, 19.71px + 2.857vw, 54px);

	/* Arabic carries dots above and below the baseline and needs more leading
	   than Latin at the same size to stop lines interlocking. */
	--lh-body: 1.95;
	--lh-head: 1.35;

	--measure: 660px;
	--shell: 1180px;
	--gutter: clamp(16px, 4vw, 40px);

	--r-sm: 10px;
	--r-md: 14px;
	--r-lg: 20px;

	--pad-section: clamp(28px, 5vw, 56px);
}

/* --------------------------------------------------------------------------
   3. Reset and base
   -------------------------------------------------------------------------- */

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

html {
	/* Not just cosmetic: body's background stops at body's box, so an
	   overscroll bounce on iOS and Android exposes the browser canvas — white —
	   behind a dark page, and the footer becomes unreadable grey-on-white. */
	background: var(--page);

	/*
	 * Both axes locked. On iOS the elastic stretch and the pull-to-refresh
	 * gesture are the same affordance behind this one property — there is no
	 * value that keeps refresh and drops the bounce. So the bounce goes, and
	 * refresh is rebuilt in assets/js/pull-refresh.js as an indicator that
	 * follows the finger while the page itself stays still.
	 *
	 * Locking X also stops a sideways swipe through a card rail from chaining
	 * into the browser's back gesture.
	 */
	overscroll-behavior: none;

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

@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;
	}
}

body {
	margin: 0;
	background: var(--page);

	/*
	 * Removes double-tap-to-zoom and the 300ms tap delay that comes with it, so
	 * a quick double tap on a card scrolls rather than zooming to a random
	 * crop. Deliberately NOT user-scalable=no in the viewport meta: pinch-zoom
	 * is how readers with low vision use a phone, iOS has ignored that flag
	 * since iOS 10 anyway, and blocking it is a WCAG failure. This kills the
	 * accidental zoom and keeps the intentional one.
	 */
	touch-action: manipulation;
	color: var(--ink);
	font-family: "Almarai", "Segoe UI", system-ui, sans-serif;
	font-size: var(--fs-base);
	font-weight: 400;
	line-height: var(--lh-body);
	/* Arabic is a joining script — letter-spacing severs the connections. */
	letter-spacing: normal;
	word-spacing: normal;
	hyphens: none;
	-webkit-font-smoothing: antialiased;
}

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

a {
	color: var(--brand-300);
	text-decoration-thickness: 0.08em;
	text-underline-offset: 0.22em;
	text-decoration-skip-ink: auto;
}

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

h1, h2, h3, h4, h5, h6 {
	margin: 0;
	line-height: var(--lh-head);
	font-weight: 700;
	text-wrap: balance;
	letter-spacing: normal;
}

p {
	margin: 0;
	text-wrap: pretty;
}

ul, ol {
	margin: 0;
	padding: 0;
}

:focus-visible {
	outline: 3px solid var(--brand-300);
	outline-offset: 3px;
	border-radius: 4px;
}

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

.skip-link:focus {
	position: fixed;
	inset-block-start: 12px;
	inset-inline-start: 12px;
	z-index: 999;
	width: auto;
	height: auto;
	clip-path: none;
	margin: 0;
	padding: 12px 20px;
	background: var(--brand);
	color: #fff;
	border-radius: var(--r-sm);
	font-weight: 700;
}

/* --------------------------------------------------------------------------
   4. Layout primitives
   -------------------------------------------------------------------------- */

.shell {
	width: 100%;
	max-width: var(--shell);
	margin-inline: auto;
	padding-inline: var(--gutter);
}

.stack > * + * {
	margin-block-start: var(--stack-gap, 1rem);
}

.site {
	/*
	 * svh, not dvh. dvh tracks the *dynamic* viewport, so on iOS Safari the
	 * container's height changes continuously as the address bar collapses and
	 * re-expands during a scroll — the page visibly stretches and settles while
	 * the reader is mid-article. svh is the stable small-viewport value: the
	 * layout is computed once and never moves. Content taller than the viewport
	 * overflows it normally, which is the common case anyway.
	 */
	min-height: 100svh;
	display: flex;
	flex-direction: column;
}

.site-content {
	flex: 1;
	/* Clears the fixed bottom nav on mobile. */
	padding-block-end: 84px;
}

@media (min-width: 800px) {
	.site-content { padding-block-end: 0; }
}

/* --------------------------------------------------------------------------
   5. Header, chips, bottom nav
   -------------------------------------------------------------------------- */

.site-header {
	position: sticky;
	inset-block-start: 0;
	z-index: 50;
	background: color-mix(in oklab, var(--page) 86%, transparent);
	backdrop-filter: blur(16px);
	border-block-end: 1px solid var(--rule);
}

.site-header__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding-block: 14px;
}

/* Mark and name sit on one row, separated by a hairline rule. */
.site-brand {
	display: flex;
	align-items: center;
	gap: 12px;
	min-inline-size: 0;
}

/*
 * The logotype is deliberately NOT Almarai. The mockup sets it in Arial 900,
 * and Almarai's Latin tops out at 800 — a noticeably lighter cut that also
 * renders differently between platforms, which is why the mark looked right on
 * a phone and wrong on desktop. A heavy grotesk stack keeps it identical
 * everywhere. This is the one place in the theme using another family, and it
 * is a logotype, not text.
 */
.site-brand__mark {
	font-family: "Arial Black", "Helvetica Neue", Helvetica, Arial, sans-serif;
	font-weight: 900;
	font-size: clamp(21px, 18.86px + 0.595vw, 26px);
	letter-spacing: -0.01em;
	color: #fff;
	text-decoration: none;
	display: inline-flex;
	align-items: baseline;
	gap: 1px;
	direction: ltr;
	flex: none;
}

.site-brand__dot { color: var(--brand-400); }

.site-brand__text {
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 1px;
	text-decoration: none;
	color: var(--ink);
	border-inline-start: 1px solid var(--rule);
	padding-inline-start: 12px;
	min-inline-size: 0;
}

.site-brand__name {
	font-weight: 800;
	font-size: clamp(15px, 13.71px + 0.357vw, 18px);
	line-height: 1.3;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

@media (hover: hover) {
	.site-brand__text:hover .site-brand__name { color: var(--brand-300); }
}

.site-brand__name {
	overflow: hidden;
	text-overflow: ellipsis;
}

.custom-logo-link { display: inline-block; }

.custom-logo {
	max-block-size: 46px;
	inline-size: auto;
}

.site-footer .custom-logo { max-block-size: 40px; margin-inline: auto; }

.site-brand__tagline {
	display: block;
	font-size: var(--fs-xs);
	font-weight: 400;
	color: var(--ink-faint);
	line-height: 1.4;
	letter-spacing: normal;
}

.icon-btn {
	display: inline-grid;
	place-items: center;
	inline-size: 42px;
	block-size: 42px;
	/*
	 * Fixed-size control: never let the flex row shrink it. Without this the
	 * search button is the first casualty on a narrow viewport — it collapsed
	 * to zero width on a 375px screen and simply disappeared, while the brand
	 * block beside it kept its full width.
	 */
	flex: none;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: var(--ink);
	cursor: pointer;
	transition: background-color .18s ease;
}

@media (hover: hover) {
	.icon-btn:hover { background: var(--surface-2); }
}
.icon-btn svg { inline-size: 22px; block-size: 22px; }

/* --- category chips ------------------------------------------------------ */

.chips {
	/* Hidden on phones: the drawer already carries the full category list, and
	   a second scrolling nav directly under the logo pushes the story that the
	   page exists to show below the fold. Desktop has the room, so it keeps it. */
	display: none;
	gap: 8px;
	overflow-x: auto;
	scrollbar-width: none;
	padding-block: 12px;
	/* Bleed to the viewport edge so the row reads as scrollable on mobile. */
	margin-inline: calc(var(--gutter) * -1);
	padding-inline: var(--gutter);
	scroll-snap-type: x proximity;
	overscroll-behavior-x: contain;
}

.chips::-webkit-scrollbar { display: none; }

.chip {
	flex: none;
	scroll-snap-align: start;
	white-space: nowrap;
	background: var(--surface-2);
	color: var(--ink);
	padding: 8px 15px;
	border-radius: 999px;
	font-size: var(--fs-sm);
	font-weight: 700;
	text-decoration: none;
	transition: background-color .18s ease, color .18s ease;
}

@media (hover: hover) {
	.chip:hover { background: #302d2a; }
}

.chip.is-current,
.chip[aria-current="page"] {
	background: var(--brand);
	color: #fff;
}

/* --- fixed bottom nav (mobile only, per the mockups) --------------------- */

.bottom-nav {
	position: fixed;
	inset-block-end: 0;
	inset-inline: 0;
	z-index: 60;
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: 1fr;
	background: color-mix(in oklab, var(--page) 94%, transparent);
	backdrop-filter: blur(16px);
	border-block-start: 1px solid var(--rule);
	padding-block: 8px;
	padding-block-end: max(8px, env(safe-area-inset-bottom));
}

.bottom-nav a {
	display: grid;
	justify-items: center;
	gap: 3px;
	font-size: var(--fs-xs);
	font-weight: 700;
	color: var(--ink-soft);
	text-decoration: none;
	padding-block: 4px;
}

.bottom-nav a[aria-current="page"] { color: var(--brand-300); }
.bottom-nav svg { inline-size: 21px; block-size: 21px; }

@media (min-width: 800px) {
	.bottom-nav { display: none; }
}

/* --- desktop nav --------------------------------------------------------- */

.primary-nav { display: none; }

@media (min-width: 800px) {
	.chips { display: flex; }

	.primary-nav {
		display: flex;
		gap: 22px;
		list-style: none;
	}
	.primary-nav a {
		color: var(--ink);
		text-decoration: none;
		font-size: var(--fs-sm);
		font-weight: 700;
	}
	.primary-nav a:hover { color: var(--brand-300); }
	.site-header__menu-toggle { display: none; }
}

/* --------------------------------------------------------------------------
   6. Cards
   -------------------------------------------------------------------------- */

.card {
	display: flex;
	flex-direction: column;
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: var(--r-md);
	overflow: hidden;
	block-size: 100%;
	transition: border-color .18s ease, transform .18s ease;
}

@media (hover: hover) {
	.card:hover {
		border-color: color-mix(in oklab, var(--brand-400) 60%, var(--rule));
		transform: translateY(-2px);
	}
}

.card__media {
	display: block;
	aspect-ratio: 16 / 9;
	background: var(--surface-2);
	overflow: hidden;
}

.card__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.card__body {
	display: flex;
	flex-direction: column;
	gap: 8px;
	flex: 1;
	padding: 14px 16px 16px;
}

.card__eyebrow {
	font-size: var(--fs-xs);
	font-weight: 700;
	color: var(--brand-300);
}

.card__title {
	font-size: var(--fs-h3);
	font-weight: 700;
	line-height: 1.5;
}

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

@media (hover: hover) {
	.card__title a:hover { color: var(--brand-300); }
}

/* Uneven excerpts are what make a card grid look untidy. */
.card__excerpt {
	font-size: var(--fs-sm);
	line-height: 1.8;
	color: var(--ink-soft);
	display: -webkit-box;
	-webkit-line-clamp: 3;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.card__meta {
	margin-block-start: auto;
	padding-block-start: 4px;
	font-size: var(--fs-xs);
	color: var(--ink-faint);
	display: flex;
	gap: 8px;
	align-items: center;
	flex-wrap: wrap;
}

.card__meta .sep { color: var(--rule); }

/* --- list card: small square thumb beside the headline (يحدث الآن) ------- */

.card-row {
	display: grid;
	grid-template-columns: 96px 1fr;
	gap: 14px;
	align-items: start;
	padding-block: 14px;
	border-block-end: 1px solid var(--rule);
}

.card-row:last-child { border-block-end: 0; }

.card-row__media {
	aspect-ratio: 1;
	border-radius: var(--r-sm);
	overflow: hidden;
	background: var(--surface-2);
}

.card-row__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.card-row__title {
	font-size: var(--fs-base);
	font-weight: 700;
	line-height: 1.55;
}

.card-row__title a { color: var(--ink); text-decoration: none; }

@media (hover: hover) {
	.card-row__title a:hover { color: var(--brand-300); }
}

/* --- badges -------------------------------------------------------------- */

.badge {
	display: inline-block;
	font-size: var(--fs-xs);
	font-weight: 800;
	padding: 4px 11px;
	border-radius: 999px;
	line-height: 1.6;
}

.badge--now      { background: var(--brand); color: #fff; }
.badge--opened   { background: #0d7a4526; color: #4fd18e; box-shadow: inset 0 0 0 1px #0d7a455c; }
.badge--new      { background: var(--brand-400); color: #fff; }
.badge--soon     { background: var(--sand); color: #3d3121; }
.badge--outline  { background: transparent; color: var(--ink-soft); box-shadow: inset 0 0 0 1px var(--rule); }

/* --------------------------------------------------------------------------
   7. Sections
   -------------------------------------------------------------------------- */

.section {
	padding-block: var(--pad-section);
	border-block-end: 1px solid var(--rule);
}

.section:last-of-type { border-block-end: 0; }

.section__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	margin-block-end: 20px;
}

.section__title {
	font-size: var(--fs-h2);
	font-weight: 800;
}

.section__more {
	font-size: var(--fs-sm);
	font-weight: 700;
	color: var(--brand-300);
	text-decoration: none;
	white-space: nowrap;
}

@media (hover: hover) {
	.section__more:hover { text-decoration: underline; }
}

/* Card grid. auto-fill with a px floor — a rem floor would rescale with the
   root font size and silently change the column count. */
.grid {
	display: grid;
	gap: clamp(14px, 2vw, 20px);
	grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
}

.grid--2 { grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); }

/* Horizontal rail on mobile, grid on desktop — the mockup's card behaviour. */
.rail {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(230px, 78%);
	gap: 14px;
	overflow-x: auto;
	scrollbar-width: none;
	scroll-snap-type: x mandatory;
	overscroll-behavior-x: contain;
	margin-inline: calc(var(--gutter) * -1);
	padding-inline: var(--gutter);
}

.rail::-webkit-scrollbar { display: none; }
.rail > * { scroll-snap-align: start; }

@media (min-width: 700px) {
	.rail {
		grid-auto-flow: row;
		grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
		overflow: visible;
		margin-inline: 0;
		padding-inline: 0;
	}
}

/* --- section variants ---------------------------------------------------- */

.section--raised { background: var(--surface); }

/* The cream island: من ذاكرة الكويت. A light block inside a dark page, which
   is the mockups' way of signalling "this is the past". */
.section--cream {
	background: var(--cream);
	color: var(--cream-ink);
}

.section--cream .section__title,
.section--cream .card__title a,
.section--cream .card-row__title a { color: var(--cream-ink); }

.section--cream .section__more,
.section--cream .card__eyebrow { color: var(--brand); }

.section--cream .card {
	background: var(--cream-2);
	border-color: var(--cream-rule);
}

.section--cream .card__excerpt { color: var(--cream-soft); }
.section--cream .card__meta { color: #7c6c56; }
.section--cream .card-row { border-block-end-color: var(--cream-rule); }

/* --- الأكثر قراءة: numbered list ---------------------------------------- */

.ranked { list-style: none; counter-reset: rank; }

.ranked li {
	counter-increment: rank;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: 14px;
	align-items: baseline;
	padding-block: 14px;
	border-block-end: 1px solid var(--rule);
}

.ranked li:last-child { border-block-end: 0; }

.ranked li::before {
	content: counter(rank);
	font-size: clamp(22px, 19.43px + 0.714vw, 28px);
	font-weight: 800;
	color: var(--brand-400);
	line-height: 1;
	font-variant-numeric: tabular-nums;
}

.ranked a {
	color: var(--ink);
	text-decoration: none;
	font-weight: 700;
	line-height: 1.55;
}

@media (hover: hover) {
	.ranked a:hover { color: var(--brand-300); }
}

/* --- قبل وبعد ------------------------------------------------------------ */

.before-after {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 4px;
	border-radius: var(--r-md);
	overflow: hidden;
}

.before-after figure { margin: 0; position: relative; }

.before-after img {
	inline-size: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

@media (min-width: 700px) {
	.before-after img { aspect-ratio: 4 / 3; }
}

.before-after figcaption {
	position: absolute;
	inset-block-end: 0;
	inset-inline: 0;
	padding: 10px 12px;
	font-size: var(--fs-xs);
	font-weight: 700;
	color: #fff;
	background: linear-gradient(0deg, rgb(0 0 0 / .75), transparent);
}

/* --------------------------------------------------------------------------
   8. Hero
   -------------------------------------------------------------------------- */

.hero {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	/* svh for the same reason as .site — a hero that grows as the toolbar
	   hides is the most visible version of the problem. */
	min-block-size: clamp(400px, 62svh, 560px);
	padding: var(--gutter);
	padding-block-end: clamp(24px, 4vw, 48px);
	border-radius: var(--r-lg);
	overflow: hidden;
	isolation: isolate;
	color: #fff;
}

/*
 * All three layers sit at zero or above. The obvious version of this uses
 * z-index -1 and -2 so the text needs no z-index of its own, but a negative
 * z-index child paints behind the nearest opaque ancestor background rather
 * than behind its own parent, so the image vanished into the page colour.
 */
.hero__media {
	position: absolute;
	inset: 0;
	z-index: 0;
}

.hero__media img {
	inline-size: 100%;
	block-size: 100%;
	object-fit: cover;
}

.hero::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: 1;
	background: linear-gradient(0deg, rgb(0 0 0 / .82) 0%, rgb(0 0 0 / .35) 45%, rgb(0 0 0 / .12) 100%);
}

.hero__eyebrow,
.hero__title,
.hero__dek {
	position: relative;
	z-index: 2;
}

.hero__eyebrow {
	font-size: var(--fs-sm);
	font-weight: 700;
	color: #ffd9dc;
	margin-block-end: 8px;
}

.hero__title {
	font-size: var(--fs-hero);
	font-weight: 800;
	line-height: 1.2;
	max-width: 20ch;
	text-shadow: 0 2px 24px rgb(0 0 0 / .5);
}

.hero__title a { color: inherit; text-decoration: none; }

.hero__dek {
	margin-block-start: 12px;
	font-size: var(--fs-base);
	color: #e6e1db;
	max-width: 46ch;
}

/* --------------------------------------------------------------------------
   9. Article
   -------------------------------------------------------------------------- */

.article-intro {
	max-width: 880px;
	margin-inline: auto;
	padding-block: clamp(20px, 4vw, 40px);
}

.breadcrumb {
	font-size: var(--fs-xs);
	color: var(--ink-faint);
	margin-block-end: 14px;
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
}

.breadcrumb a { color: var(--ink-faint); text-decoration: none; }
@media (hover: hover) {
	.breadcrumb a:hover { color: var(--brand-300); }
}

.article-eyebrow {
	font-size: var(--fs-sm);
	font-weight: 800;
	color: var(--brand-300);
	margin-block-end: 10px;
}

.article-title {
	font-size: var(--fs-h1);
	font-weight: 800;
	line-height: 1.22;
}

.article-dek {
	margin-block-start: 14px;
	font-size: var(--fs-lead);
	line-height: 1.75;
	color: var(--ink-soft);
	max-width: 52ch;
}

.article-meta {
	display: flex;
	align-items: center;
	gap: 14px;
	flex-wrap: wrap;
	margin-block-start: 20px;
	padding-block-start: 16px;
	border-block-start: 1px solid var(--rule);
	font-size: var(--fs-sm);
	color: var(--ink-faint);
}

.article-meta__actions { margin-inline-start: auto; display: flex; gap: 8px; }

.article-meta__actions .icon-btn {
	inline-size: 38px;
	block-size: 38px;
	border: 1px solid var(--rule);
}

.article-hero {
	margin-block: 8px 0;
	border-radius: var(--r-md);
	overflow: hidden;
}

.article-hero img {
	inline-size: 100%;
	max-block-size: 620px;
	object-fit: cover;
}

.article-hero figcaption,
.entry-content figcaption,
.wp-caption-text {
	margin-block-start: 10px;
	font-size: var(--fs-xs);
	line-height: 1.7;
	color: var(--ink-faint);
	border-inline-start: 2px solid var(--rule);
	padding-inline-start: 10px;
}

/* --- body ---------------------------------------------------------------- */

.article-layout {
	display: block;
	max-width: 880px;
	margin-inline: auto;
}

@media (min-width: 1000px) {
	.article-layout {
		display: grid;
		grid-template-columns: minmax(0, var(--measure)) 220px;
		gap: 56px;
		align-items: start;
		max-width: var(--shell);
	}
}

.entry-content {
	font-size: var(--fs-body);
	line-height: var(--lh-body);
	padding-block: clamp(24px, 4vw, 40px);
}

.entry-content > * { max-width: var(--measure); margin-inline: auto; }
.entry-content > * + * { margin-block-start: 1.15em; }

.entry-content h2 {
	font-size: var(--fs-h2);
	font-weight: 800;
	margin-block-start: 2.2em;
	margin-block-end: 0.6em;
}

.entry-content h2::after {
	content: "";
	display: block;
	inline-size: 40px;
	block-size: 3px;
	margin-block-start: 0.5em;
	background: var(--brand-400);
	border-radius: 2px;
}

.entry-content h3 {
	font-size: var(--fs-h3);
	font-weight: 700;
	margin-block-start: 1.8em;
	margin-block-end: 0.5em;
}

/* Arabic is never justified without kashida — it opens rivers of white. */
.entry-content p { text-align: start; }

.entry-content ul,
.entry-content ol {
	padding-inline-start: 1.6em;
}

.entry-content li + li { margin-block-start: 0.5em; }

.entry-content a { color: var(--brand-300); text-decoration: underline; }

.entry-content strong,
.entry-content b {
	/* Almarai has no 600, so emphasis is 700. Kept to inline runs only. */
	font-weight: 700;
	color: #fff;
}

.entry-content img,
.entry-content figure > img {
	border-radius: var(--r-md);
}

.entry-content figure { margin-block: 2em; }

.entry-content .alignwide { max-width: 860px; }
.entry-content .alignfull { max-width: none; }

/* --- pull quote ---------------------------------------------------------- */

.entry-content blockquote {
	font-size: var(--fs-lead);
	font-weight: 700;
	line-height: 1.7;
	color: var(--ink);
	border-block: 1px solid var(--rule);
	border-inline: 0;
	padding-block: 24px;
	margin-block: 2em;
}

.entry-content blockquote p + p { margin-block-start: 0.6em; }

/* --- fact box (القصة باختصار) ------------------------------------------- */

.factbox {
	background: var(--surface);
	border-inline-start: 4px solid var(--brand-400);
	border-radius: var(--r-sm);
	padding: 18px 20px;
	margin-block: 2em;
	font-size: var(--fs-sm);
	line-height: 1.85;
}

.factbox__title {
	font-weight: 800;
	color: var(--brand-300);
	margin-block-end: 6px;
}

/* --- in-this-article rail ------------------------------------------------ */

.toc {
	position: sticky;
	inset-block-start: 96px;
	font-size: var(--fs-sm);
	display: none;
}

@media (min-width: 1000px) {
	.toc { display: block; }
}

.toc__title {
	font-size: var(--fs-sm);
	font-weight: 800;
	color: var(--ink-faint);
	margin-block-end: 12px;
}

.toc ol { list-style: none; counter-reset: toc; }

.toc li {
	counter-increment: toc;
	padding-block: 7px;
	border-block-end: 1px solid var(--rule);
}

.toc li:last-child { border-block-end: 0; }

.toc a {
	color: var(--ink-soft);
	text-decoration: none;
	line-height: 1.6;
	display: block;
}

@media (hover: hover) {
	.toc a:hover { color: var(--brand-300); }
}

/* --- sources ------------------------------------------------------------- */

.sources {
	max-width: var(--measure);
	margin-inline: auto;
	margin-block: 40px;
	border-block-start: 2px solid var(--ink);
	padding-block-start: 20px;
	font-size: var(--fs-sm);
	line-height: 1.85;
}

.sources h2 { font-size: var(--fs-h3); margin-block-end: 10px; }
.sources ol { padding-inline-start: 1.4em; color: var(--ink-soft); }

/* --- next article -------------------------------------------------------- */

.next-article {
	display: block;
	background: var(--surface);
	border-radius: var(--r-lg);
	padding: clamp(24px, 4vw, 40px);
	text-decoration: none;
	color: var(--ink);
	margin-block: 40px;
}

.next-article small {
	font-size: var(--fs-xs);
	font-weight: 700;
	color: var(--brand-300);
}

.next-article h2 { font-size: var(--fs-h2); margin-block-start: 8px; }

@media (hover: hover) {
	.next-article:hover h2 { color: var(--brand-300); }
}

/* --------------------------------------------------------------------------
   10. Archive and search
   -------------------------------------------------------------------------- */

.page-head {
	padding-block: clamp(24px, 4vw, 44px) 4px;
}

.page-head__title {
	font-size: var(--fs-h1);
	font-weight: 800;
}

.page-head__title::after {
	content: "";
	display: block;
	inline-size: 40px;
	block-size: 3px;
	margin-block-start: 0.45em;
	background: var(--brand-400);
	border-radius: 2px;
}

.page-head__desc {
	margin-block-start: 14px;
	color: var(--ink-soft);
	font-size: var(--fs-base);
	max-width: 56ch;
}

.search-form {
	display: flex;
	gap: 8px;
	max-width: 460px;
}

.search-form input[type="search"] {
	flex: 1;
	background: var(--surface);
	border: 1px solid var(--rule);
	border-radius: var(--r-sm);
	padding: 12px 14px;
	color: var(--ink);
}

.search-form input[type="search"]::placeholder { color: var(--ink-faint); }

.search-form button {
	background: var(--brand);
	color: #fff;
	border: 0;
	border-radius: var(--r-sm);
	padding: 12px 22px;
	font-weight: 700;
	cursor: pointer;
	/* Same failure as .icon-btn: the input beside it is flex:1, so without this
	   the button is squeezed to nothing in the drawer's narrow column. */
	flex: none;
}

@media (hover: hover) {
	.search-form button:hover { background: var(--brand-400); }
}

/* --------------------------------------------------------------------------
   11. Pagination, footer, 404
   -------------------------------------------------------------------------- */

.pagination {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
	justify-content: center;
	padding-block: 36px;
}

.pagination .page-numbers {
	display: inline-grid;
	place-items: center;
	min-inline-size: 42px;
	block-size: 42px;
	padding-inline: 12px;
	border-radius: var(--r-sm);
	background: var(--surface);
	border: 1px solid var(--rule);
	color: var(--ink);
	text-decoration: none;
	font-weight: 700;
}

.pagination .page-numbers.current {
	background: var(--brand);
	border-color: var(--brand);
	color: #fff;
}

@media (hover: hover) {
	.pagination .page-numbers:hover:not(.current) { border-color: var(--brand-400); }
}

.site-footer {
	border-block-start: 1px solid var(--rule);
	padding-block: clamp(32px, 5vw, 56px);
	text-align: center;
	color: var(--ink);
}

.site-footer .site-brand {
	justify-content: center;
	flex-direction: column;
	gap: 10px;
}

.site-footer .site-brand__text {
	border-inline-start: 0;
	padding-inline-start: 0;
	align-items: center;
	gap: 6px;
}

.site-footer .site-brand__name { font-size: var(--fs-h3); }
.site-footer .site-brand__tagline { font-size: var(--fs-sm); color: var(--ink-soft); }

.site-footer__tag {
	margin-block-start: 10px;
	font-size: var(--fs-base);
	font-weight: 700;
	color: var(--ink-soft);
}

.site-footer__nav {
	display: flex;
	gap: 20px;
	justify-content: center;
	flex-wrap: wrap;
	list-style: none;
	margin-block-start: 22px;
	font-size: var(--fs-base);
}

.site-footer__nav a {
	color: var(--ink);
	text-decoration: none;
	font-weight: 700;
}

@media (hover: hover) {
	.site-footer__nav a:hover { color: var(--brand-300); }
}

.site-footer__legal {
	margin-block-start: 24px;
	font-size: var(--fs-xs);
	color: var(--ink-faint);
}

.error-404 {
	text-align: center;
	padding-block: clamp(60px, 12vw, 120px);
}

.error-404 h1 { font-size: var(--fs-h1); font-weight: 800; }
.error-404 p { margin-block: 16px 28px; color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   13. Navigation drawer

   popover="manual" puts the panel in the top layer, so no stacking context in
   the page can trap it. The swipe is a scroll-snap container rather than a
   JS transform: the browser supplies momentum, velocity and interruption, and
   the panel tracks the finger instead of playing a fixed tween.
   -------------------------------------------------------------------------- */

.drawer {
	/* min() caps the sheet on tablets; on a phone it leaves ~20% of the page
	   peeking, which is the affordance that says "tap outside to dismiss". */
	--drawer-width: min(21rem, 82dvw);
	--drawer-backdrop: 0;

	/* Reset the UA popover box, which is centred, auto-sized and bordered. */
	inline-size: auto;
	block-size: auto;
	max-inline-size: none;
	max-block-size: none;
	inset: 0;
	padding: 0;
	margin: 0;
	border: 0;
	background: transparent;
	overflow: visible;
	color: var(--ink);
}

.drawer::backdrop {
	background: #000;
	opacity: calc(var(--drawer-backdrop) * 0.6);
}

.drawer__scroller {
	display: grid;
	grid-template-columns: var(--drawer-width) 100%;
	block-size: 100svh;
	overflow-x: scroll;
	overflow-y: hidden;
	/* Stop the swipe chaining into the page scroll at either snap edge. */
	overscroll-behavior: none;
	scrollbar-width: none;
	/* mandatory: the drawer always settles fully open or fully closed. */
	scroll-snap-type: x mandatory;
}

.drawer__scroller::-webkit-scrollbar { display: none; }

@media (prefers-reduced-motion: no-preference) {
	.drawer__scroller { scroll-behavior: smooth; }
}

.drawer__sheet {
	display: flex;
	flex-direction: column;
	gap: 22px;
	/*
	 * pan-y: the sheet owns vertical panning outright, so a scroll down the
	 * menu cannot leak into the horizontal snap track underneath and rock the
	 * panel left and right as you read it.
	 *
	 * The cost is swipe-to-dismiss from on top of the sheet. Dismissal still
	 * works three other ways — tap the dimmed area, press Escape, or follow a
	 * link — and a panel that stays still while being read is worth more than a
	 * fourth way to close it.
	 */
	touch-action: pan-y;
	overscroll-behavior: contain;
	/* svh, not vh or dvh: the sheet must not resize when the iOS address bar
	   collapses mid-swipe. */
	block-size: 100svh;
	/*
	 * The sheet fills the viewport including the area behind the status bar and
	 * the Dynamic Island, so the top inset has to be respected explicitly or the
	 * brand and the search field sit underneath the clock.
	 */
	padding-block: max(22px, env(safe-area-inset-top)) calc(22px + env(safe-area-inset-bottom));
	padding-inline: 20px;
	background: var(--surface);
	border-inline-start: 1px solid var(--rule);
	overflow-y: auto;
	scroll-snap-align: start;
	scrollbar-width: thin;
}

.drawer__sheet:focus { outline: none; }

.drawer__spacer {
	scroll-snap-align: end;
	/* Opens already scrolled shut, so the slide-in is visible. */
	scroll-initial-target: nearest;
}

.drawer__head {
	padding-block-end: 18px;
	border-block-end: 1px solid var(--rule);
}

.drawer__menu {
	list-style: none;
	display: flex;
	flex-direction: column;
}

.drawer__menu li + li { border-block-start: 1px solid var(--rule); }

.drawer__menu a {
	display: block;
	padding-block: 13px;
	color: var(--ink);
	text-decoration: none;
	font-size: var(--fs-base);
	font-weight: 700;
}

/* Current page only. :hover is gated below — iOS keeps the hover state on the
   last element tapped, which left a random menu item looking like the active
   one long after the drawer had been used. */
.drawer__menu .current-menu-item > a,
.drawer__menu .current-menu-ancestor > a {
	color: var(--brand-300);
}

@media (hover: hover) {
	.drawer__menu a:hover { color: var(--brand-300); }
}

.drawer__menu .sub-menu {
	list-style: none;
	padding-inline-start: 14px;
}

.drawer__menu .sub-menu a {
	font-weight: 400;
	font-size: var(--fs-sm);
	color: var(--ink-soft);
}

/*
 * @supports is mandatory. Without it, browsers that cannot run
 * animation-timeline still parse the keyframes and apply the 0% value
 * (--drawer-backdrop: 1), leaving the backdrop permanently black. The gate
 * keeps the JS fallback the only writer there.
 */
@supports (animation-timeline: scroll()) {
	@property --drawer-backdrop {
		syntax: "<number>";
		inherits: true;
		initial-value: 0;
	}

	.drawer {
		timeline-scope: --drawer-fade;
		animation: kwtone-drawer-fade linear both;
		animation-timeline: --drawer-fade;
	}

	.drawer__scroller { scroll-timeline: --drawer-fade x; }

	@keyframes kwtone-drawer-fade {
		0% { --drawer-backdrop: 1; }
		100% { --drawer-backdrop: 0; }
	}
}

/* The drawer carries the menu on every size; the toggle is only hidden once
   the primary nav is visible in the header. */
@media (min-width: 800px) {
	.drawer { --drawer-width: min(24rem, 60dvw); }
}

/* --------------------------------------------------------------------------
   14. Pull to refresh

   The page does not move — only this indicator does. --ptr-pull is written by
   the script in pixels of committed pull.
   -------------------------------------------------------------------------- */

.ptr {
	--ptr-pull: 0;
	position: fixed;
	/* Anchored above the fold and pulled down by the gesture. The previous
	   version centred it inside a zero-height grid, which put the circle in the
	   middle of the page instead of at the top edge. */
	inset-block-start: -34px;
	inset-inline: 0;
	z-index: 40;
	display: flex;
	justify-content: center;
	pointer-events: none;
	opacity: 0;
}

.ptr.is-active { opacity: calc(var(--ptr-pull) / 78); }

.ptr__spinner {
	inline-size: 26px;
	block-size: 26px;
	border-radius: 50%;
	background: var(--surface-2);
	border: 2px solid var(--rule);
	border-block-start-color: var(--brand-400);
	translate: 0 calc(var(--ptr-pull) * 1px);
	rotate: calc(var(--ptr-pull) * 3deg);
	box-shadow: 0 4px 16px rgb(0 0 0 / .4);
}

.ptr.is-ready .ptr__spinner {
	border-color: var(--brand-400);
	border-block-start-color: var(--brand-300);
}

.ptr.is-loading .ptr__spinner {
	animation: ptr-spin 0.7s linear infinite;
}

@keyframes ptr-spin {
	to { rotate: 360deg; }
}

@media (prefers-reduced-motion: reduce) {
	.ptr__spinner { rotate: none; }
	.ptr.is-loading .ptr__spinner { animation: none; }
}

/* --------------------------------------------------------------------------
   12. Print — history articles get saved and shared as PDFs.
   -------------------------------------------------------------------------- */

@media print {
	.site-header,
	.bottom-nav,
	.site-footer,
	.toc,
	.next-article,
	.section--related,
	#wpadminbar { display: none !important; }

	body { background: #fff; color: #000; }

	.entry-content { font-size: 12pt; line-height: 1.7; }
	.entry-content a::after { content: " (" attr(href) ")"; font-size: 9pt; color: #444; }
	.article-title, .entry-content h2, .entry-content h3 { color: #000; }
}
