/*
Theme Name: The Scotland China Brief
Theme URI: https://example.com/scotland-china-brief
Author: The Scotland China Brief
Author URI: https://example.com
Description: A serious editorial WordPress theme for The Scotland China Brief — a news platform covering the trade, investment and education links between Scotland and China. Hand-written PHP, one CSS file, one vanilla JS file. No build tooling, no page builder, no plugin dependencies.
Version: 1.0.0
Requires at least: 6.0
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: scb
Tags: news, editorial, magazine, custom-menu, featured-images, sticky-post, block-styles, wide-blocks, translation-ready

NOTE ON VERSIONING
------------------
The Version number above is passed to wp_enqueue_style() / wp_enqueue_script()
as the cache-busting query string (?ver=1.0.0). Bump it every time you edit
this file or js/theme.js, or browsers and caching plugins will keep serving
the old copy.
*/

/* =========================================================================
   1. DESIGN TOKENS
   ========================================================================= */

:root {
	/* Surfaces & text */
	--paper: #F6F7F9;			/* page background — cool blue-grey white */
	--card: #FFFFFF;			/* card / panel background */
	--ink: #17233A;				/* primary text — deep navy, not pure black */
	--ink-soft: #56637A;		/* secondary text */
	--ink-faint: #8894A6;		/* tertiary / meta text */
	--rule: rgba(23, 35, 58, 0.1);		/* hairline borders */

	/* Accents. Red = action & emphasis. Blue = structure & connection. */
	--china-red: #C81E3A;
	--china-red-deep: #9C1730;
	--china-red-tint: rgba(200, 30, 58, 0.08);
	--scot-blue: #1D5FA8;
	--scot-blue-tint: rgba(29, 95, 168, 0.08);

	/* Type */
	--font-display: "Newsreader", Georgia, "Times New Roman", serif;
	--font-body: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;

	/* Layout */
	--wrap: 1180px;
	--gutter: clamp(1.15rem, 4vw, 2rem);
	--radius: 4px;
	--shadow-sm: 0 1px 2px rgba(23, 35, 58, 0.04), 0 6px 18px rgba(23, 35, 58, 0.05);
	--shadow-md: 0 10px 30px rgba(23, 35, 58, 0.09);
	--shadow-lg: 0 24px 64px rgba(23, 35, 58, 0.18);
	--header-h: 60px;
}

/* =========================================================================
   2. RESET & BASE
   ========================================================================= */

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

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

body {
	margin: 0;
	background: var(--paper);
	color: var(--ink);
	font-family: var(--font-body);
	font-size: 1rem;
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

img,
svg,
video { max-width: 100%; }

img { height: auto; border: 0; }

a { color: var(--ink); text-decoration-color: var(--rule); text-underline-offset: 3px; }
a:hover { color: var(--china-red); }

h1, h2, h3, h4, h5, h6 {
	font-family: var(--font-display);
	font-weight: 600;
	line-height: 1.18;
	color: var(--ink);
	margin: 0 0 0.6em;
	letter-spacing: -0.012em;
}

p { margin: 0 0 1.15em; }
p:last-child { margin-bottom: 0; }

ul, ol { margin: 0 0 1.15em; padding-left: 1.3em; }

figure { margin: 0; }

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

hr { border: 0; border-top: 1px solid var(--rule); margin: 2.5rem 0; }

/* Accessibility -------------------------------------------------------- */

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

:focus-visible {
	outline: 2px solid var(--scot-blue);
	outline-offset: 2px;
	border-radius: 2px;
}

.skip-link:focus {
	position: fixed;
	top: 0.6rem;
	left: 0.6rem;
	z-index: 999;
	width: auto; height: auto;
	clip: auto; clip-path: none;
	margin: 0;
	padding: 0.7rem 1.1rem;
	background: var(--china-red);
	color: #fff;
	font-size: 0.85rem;
	font-weight: 600;
	border-radius: var(--radius);
}

/* Shared layout helpers ------------------------------------------------ */

.container {
	width: min(100% - (var(--gutter) * 2), var(--wrap));
	margin-inline: auto;
}

.container--narrow { --wrap: 820px; }
.container--article { --wrap: 1100px; }

.eyebrow {
	font-family: var(--font-body);
	font-size: 0.7rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-faint);
	margin: 0 0 0.5rem;
}

/* Small blue separator dot — structural, never an accent of emphasis. */
.sep-dot {
	display: inline-block;
	width: 3px; height: 3px;
	border-radius: 50%;
	background: var(--scot-blue);
	vertical-align: middle;
	margin: 0 0.15rem;
	flex: none;
}

/* =========================================================================
   3. SITE HEADER & NAVIGATION
   ========================================================================= */

.site-header {
	position: sticky;
	top: 0;
	z-index: 50;
	background: var(--card);
	border-bottom: 1px solid var(--rule);
}

/* Red rule across the very top of the masthead. */
.site-header::before {
	content: "";
	display: block;
	height: 3px;
	background: var(--china-red);
}

/*
 * The header bar is the positioned ancestor for the mobile nav panel
 * (which is position:absolute; top:100%). Without this, the panel would
 * resolve against <body> and render far down the page.
 */
.header-bar { position: relative; background: var(--card); }

.header-bar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	min-height: var(--header-h);
}

.header-brand {
	font-family: var(--font-display);
	font-size: 1.05rem;
	font-weight: 600;
	letter-spacing: -0.01em;
	text-decoration: none;
	color: var(--ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.header-brand:hover { color: var(--china-red); }

/* Nav ------------------------------------------------------------------ */

.primary-nav { font-size: 0.9rem; }

.nav-menu {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.nav-menu li { position: relative; }

.nav-menu a {
	display: block;
	padding: 0.55rem 0.7rem;
	text-decoration: none;
	color: var(--ink);
	font-weight: 500;
}

/* Red hover underline on top-level items. */
.nav-menu > li > a::after {
	content: "";
	display: block;
	height: 2px;
	margin-top: 4px;
	background: var(--china-red);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.18s ease;
}
.nav-menu > li > a:hover::after,
.nav-menu > li > a:focus-visible::after,
.nav-menu > li.current-menu-item > a::after,
.nav-menu > li.current-menu-parent > a::after,
.nav-menu > li.current-cat > a::after { transform: scaleX(1); }

.nav-menu > li > a:hover { color: var(--china-red); }

/* Submenu toggle button (injected by js/theme.js on items with children) */
.submenu-toggle {
	position: absolute;
	top: 50%;
	right: -0.15rem;
	transform: translateY(-50%);
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px; height: 26px;
	padding: 0;
	background: none;
	border: 0;
	color: var(--ink-faint);
	cursor: pointer;
}
.submenu-toggle svg { transition: transform 0.18s ease; }
.submenu-toggle[aria-expanded="true"] svg { transform: rotate(180deg); }
.menu-item-has-children > a { padding-right: 1.5rem; }

/* Desktop dropdown */
.sub-menu {
	position: absolute;
	top: 100%;
	left: -0.4rem;
	z-index: 60;
	min-width: 220px;
	margin: 0;
	padding: 0.35rem 0;
	list-style: none;
	background: var(--card);
	border: 1px solid var(--rule);
	border-top: 2px solid var(--china-red);
	border-radius: 0 0 var(--radius) var(--radius);
	box-shadow: var(--shadow-md);
	opacity: 0;
	visibility: hidden;
	transform: translateY(5px);
	transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s;
}
.menu-item-has-children:hover > .sub-menu,
.menu-item-has-children:focus-within > .sub-menu,
.menu-item-has-children.is-expanded > .sub-menu {
	opacity: 1;
	visibility: visible;
	transform: none;
}
.sub-menu a {
	padding: 0.5rem 1rem;
	font-size: 0.875rem;
	color: var(--ink-soft);
}
.sub-menu a:hover,
.sub-menu a:focus-visible { color: var(--china-red); background: var(--china-red-tint); }

/* Hamburger */
.nav-toggle {
	display: none;
	align-items: center;
	gap: 0.5rem;
	padding: 0.45rem 0.7rem;
	background: none;
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	color: var(--ink);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
}
.nav-toggle:hover { border-color: var(--china-red); color: var(--china-red); }
.nav-toggle__bars { display: block; width: 16px; height: 10px; position: relative; }
.nav-toggle__bars::before,
.nav-toggle__bars::after,
.nav-toggle__bars span {
	content: "";
	position: absolute;
	left: 0;
	width: 100%; height: 1.5px;
	background: currentColor;
	transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav-toggle__bars::before { top: 0; }
.nav-toggle__bars span { top: 4.25px; }
.nav-toggle__bars::after { bottom: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::before { transform: translateY(4.25px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars span { opacity: 0; }
.nav-toggle[aria-expanded="true"] .nav-toggle__bars::after { transform: translateY(-4.25px) rotate(-45deg); }

/* =========================================================================
   4. MASTHEAD & ROUTE GRAPHIC
   ========================================================================= */

.masthead {
	background: var(--card);
	border-bottom: 1px solid var(--rule);
	padding: clamp(2rem, 6vw, 3.4rem) 0 clamp(1.6rem, 4vw, 2.4rem);
	text-align: center;
}

.masthead__title {
	font-size: clamp(2.1rem, 6.4vw, 3.9rem);
	font-weight: 600;
	line-height: 1.02;
	margin: 0;
	letter-spacing: -0.028em;
}
.masthead__title a { text-decoration: none; color: inherit; }
.masthead__title a:hover { color: inherit; }

.masthead__subtitle {
	font-family: var(--font-display);
	font-size: clamp(1rem, 2.6vw, 1.3rem);
	font-weight: 500;
	color: var(--china-red);
	margin: 0.55rem 0 0;
	letter-spacing: 0.22em;
	text-indent: 0.22em;
}

.masthead__tagline {
	max-width: 46ch;
	margin: 0.9rem auto 0;
	color: var(--ink-soft);
	font-size: 0.975rem;
}

.masthead__route { margin-top: clamp(1.3rem, 3vw, 1.9rem); }

/* Route graphic — the one decorative flourish in the design. */
.route-graphic {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
}

.route-graphic__label {
	font-size: 0.66rem;
	font-weight: 600;
	letter-spacing: 0.2em;
	text-transform: uppercase;
	color: var(--ink-faint);
	white-space: nowrap;
}

.route-graphic__art { width: min(240px, 42vw); height: auto; display: block; overflow: visible; }
.route-graphic__arc { stroke: var(--scot-blue); stroke-width: 1.25; opacity: 0.75; }
.route-graphic__dot { fill: var(--scot-blue); }
.route-graphic__plane { fill: var(--china-red); }
.route-graphic__plane path:last-child { fill: var(--china-red-deep); }

/* Ambient drift along the arc — decorative only. */
@media (prefers-reduced-motion: no-preference) {
	.route-graphic__arc {
		stroke-dashoffset: 0;
		animation: scb-dash 9s linear infinite;
	}
	.route-graphic__plane { animation: scb-lift 5.5s ease-in-out infinite; }
}
@keyframes scb-dash { to { stroke-dashoffset: -36; } }
@keyframes scb-lift {
	0%, 100% { transform: translate(120px, 14px); }
	50% { transform: translate(120px, 11.5px); }
}

/* =========================================================================
   5. BUTTONS & LINKS
   ========================================================================= */

.btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 0.4rem;
	padding: 0.72rem 1.35rem;
	border: 1px solid transparent;
	border-radius: var(--radius);
	font-size: 0.875rem;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none;
	cursor: pointer;
	transition: background-color 0.16s ease, color 0.16s ease, border-color 0.16s ease;
}

.btn--primary { background: var(--china-red); color: #fff; }
.btn--primary:hover { background: var(--china-red-deep); color: #fff; }

.btn--ghost { border-color: var(--rule); color: var(--ink); background: var(--card); }
.btn--ghost:hover { border-color: var(--china-red); color: var(--china-red); }

.link-more {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
	font-size: 0.82rem;
	font-weight: 600;
	color: var(--china-red);
	text-decoration: none;
	white-space: nowrap;
}
.link-more:hover { color: var(--china-red-deep); text-decoration: underline; text-decoration-color: currentColor; }

/* =========================================================================
   6. META, CATEGORY TAGS, BYLINES
   ========================================================================= */

.meta-line {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0 0 0.7rem;
	font-size: 0.72rem;
	font-weight: 500;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-faint);
}

.cat-tag {
	color: var(--china-red);
	font-weight: 600;
	text-decoration: none;
	letter-spacing: 0.1em;
}
.cat-tag:hover { color: var(--china-red-deep); text-decoration: underline; }

.byline {
	display: flex;
	align-items: center;
	gap: 0.55rem;
	margin: 0;
	font-size: 0.85rem;
	color: var(--ink-soft);
}
.byline img,
.byline .avatar { border-radius: 50%; display: block; }
.byline a { color: var(--scot-blue); text-decoration: none; font-weight: 500; }
.byline a:hover { text-decoration: underline; }
.byline__date { color: var(--ink-faint); }

/* =========================================================================
   7. CARDS (homepage featured block)
   ========================================================================= */

.featured { padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(1.5rem, 4vw, 2.5rem); }

.featured__grid {
	display: grid;
	grid-template-columns: 1.55fr 1fr;
	gap: clamp(1.25rem, 3vw, 2rem);
	align-items: start;
}

.featured__side {
	display: grid;
	gap: clamp(1.25rem, 3vw, 2rem);
}

.card {
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}
.card:hover { box-shadow: var(--shadow-md); }

.card__media { display: block; background: var(--scot-blue-tint); }
.card__media img {
	display: block;
	width: 100%;
	object-fit: cover;
	aspect-ratio: 16 / 9;
}
.card--lead .card__media img { aspect-ratio: 16 / 8.4; }
.card--side .card__media img { aspect-ratio: 16 / 7.5; }

.card__body { padding: clamp(1.1rem, 2.4vw, 1.6rem); }

.card__title {
	font-size: 1.15rem;
	margin: 0 0 0.5rem;
	line-height: 1.24;
}
.card--lead .card__title { font-size: clamp(1.6rem, 3.4vw, 2.25rem); }
.card__title a { text-decoration: none; color: inherit; }
.card__title a:hover { color: var(--china-red); }

.card__excerpt {
	color: var(--ink-soft);
	font-size: 0.94rem;
	margin: 0 0 1rem;
}
.card--side .card__excerpt { font-size: 0.88rem; }
.card--lead .card__excerpt { font-size: 1.02rem; }

/* =========================================================================
   8. NEWSLETTER (banner, modal, shared form)
   ========================================================================= */

.newsletter-banner {
	background: var(--ink);
	color: #fff;
	padding: clamp(1.9rem, 5vw, 3rem) 0;
	border-top: 3px solid var(--china-red);
}

.newsletter-banner__inner {
	display: grid;
	grid-template-columns: 1.1fr 1fr;
	gap: clamp(1.25rem, 4vw, 3rem);
	align-items: center;
}

.newsletter-banner .eyebrow { color: rgba(255, 255, 255, 0.55); }
.newsletter-banner h2 {
	color: #fff;
	font-size: clamp(1.4rem, 3.2vw, 2rem);
	margin: 0 0 0.45rem;
}
.newsletter-banner p { color: rgba(255, 255, 255, 0.75); margin: 0; font-size: 0.95rem; }

.newsletter-form { display: flex; flex-wrap: wrap; gap: 0.6rem; margin: 0; }

.newsletter-form__input {
	flex: 1 1 220px;
	min-width: 0;
	padding: 0.72rem 0.9rem;
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	font-size: 0.9rem;
	color: var(--ink);
}
.newsletter-form__input::placeholder { color: var(--ink-faint); }
.newsletter-form__input:focus-visible { outline-color: var(--china-red); }

.newsletter-form__message {
	flex: 1 0 100%;
	margin: 0;
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--china-red);
}
.newsletter-banner .newsletter-form__message { color: #fff; }
.newsletter-form__message[hidden] { display: none; }

.newsletter-form__note {
	flex: 1 0 100%;
	margin: 0;
	font-size: 0.75rem;
	color: rgba(255, 255, 255, 0.5);
}
.scb-modal .newsletter-form__note { color: var(--ink-faint); }

/* Modal ---------------------------------------------------------------- */

.scb-modal { display: none; }
.scb-modal:not([hidden]) {
	display: flex;
	position: fixed;
	inset: 0;
	z-index: 200;
	align-items: center;
	justify-content: center;
	padding: var(--gutter);
}

.scb-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(23, 35, 58, 0.55);
	border: 0;
	padding: 0;
	width: 100%;
	cursor: pointer;
}

.scb-modal__dialog {
	position: relative;
	width: min(100%, 460px);
	max-height: calc(100vh - 2rem);
	overflow-y: auto;
	background: var(--card);
	border-radius: var(--radius);
	border-top: 3px solid var(--china-red);
	box-shadow: var(--shadow-lg);
	padding: clamp(1.6rem, 4vw, 2.25rem);
}
.scb-modal__dialog h2 { font-size: 1.5rem; margin: 0 0 0.5rem; }
.scb-modal__dialog > p { color: var(--ink-soft); font-size: 0.92rem; }

.scb-modal__close {
	position: absolute;
	top: 0.55rem;
	right: 0.55rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px; height: 34px;
	background: none;
	border: 0;
	border-radius: var(--radius);
	color: var(--ink-faint);
	cursor: pointer;
}
.scb-modal__close:hover { color: var(--china-red); background: var(--china-red-tint); }

@media (prefers-reduced-motion: no-preference) {
	.scb-modal:not([hidden]) .scb-modal__dialog { animation: scb-modal-in 0.24s ease-out both; }
}
@keyframes scb-modal-in {
	from { opacity: 0; transform: translateY(12px); }
	to { opacity: 1; transform: none; }
}

/* =========================================================================
   9. HOMEPAGE SECTION ROWS
   ========================================================================= */

.section-row { padding: clamp(1.75rem, 4vw, 2.75rem) 0; }
.section-row + .section-row { padding-top: 0; }
.section-row:last-of-type { padding-bottom: clamp(2.5rem, 6vw, 4rem); }

.section-head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	border-top: 2px solid var(--china-red);
	padding-top: 0.8rem;
	margin-bottom: 1.4rem;
}

.section-head__title {
	font-size: 1.35rem;
	margin: 0;
	letter-spacing: -0.01em;
}

.section-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: clamp(1.1rem, 2.6vw, 1.75rem);
}

/* =========================================================================
   10. POST LIST ROWS (index, archive, search)
   ========================================================================= */

.page-header {
	padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(1.1rem, 2.5vw, 1.6rem);
	border-bottom: 1px solid var(--rule);
	margin-bottom: clamp(1.5rem, 4vw, 2.25rem);
}
.page-header__title { font-size: clamp(1.7rem, 4.4vw, 2.6rem); margin: 0; }
.page-header__desc { color: var(--ink-soft); margin: 0.6rem 0 0; max-width: 60ch; }
.page-header .eyebrow { color: var(--china-red); }

.post-list {
	display: grid;
	gap: clamp(1rem, 2.5vw, 1.4rem);
	padding-bottom: clamp(2rem, 5vw, 3rem);
}

.post-row {
	display: grid;
	grid-template-columns: 260px 1fr;
	gap: clamp(1rem, 3vw, 1.9rem);
	align-items: start;
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	overflow: hidden;
	transition: box-shadow 0.2s ease;
}
.post-row:hover { box-shadow: var(--shadow-md); }
.post-row--no-media { grid-template-columns: 1fr; }

.post-row__media { display: block; height: 100%; background: var(--scot-blue-tint); }
.post-row__media img {
	display: block;
	width: 100%;
	object-fit: cover;
	aspect-ratio: 4 / 3;
}

.post-row__body { padding: clamp(1.15rem, 2.6vw, 1.7rem) clamp(1.15rem, 2.6vw, 1.7rem) clamp(1.15rem, 2.6vw, 1.7rem) 0; }
.post-row--no-media .post-row__body { padding-left: clamp(1.15rem, 2.6vw, 1.7rem); }

.post-row__title { font-size: clamp(1.2rem, 2.6vw, 1.5rem); margin: 0 0 0.55rem; }
.post-row__title a { text-decoration: none; color: inherit; }
.post-row__title a:hover { color: var(--china-red); }

.post-row__excerpt { color: var(--ink-soft); font-size: 0.94rem; margin: 0 0 0.9rem; }

.post-row__footer {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 0.75rem;
}

/* Pagination ----------------------------------------------------------- */

.navigation.pagination { padding-bottom: clamp(2.5rem, 6vw, 4rem); }
.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	align-items: center;
	justify-content: center;
}
.pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 40px;
	padding: 0.5rem 0.75rem;
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	font-size: 0.85rem;
	font-weight: 500;
	text-decoration: none;
	color: var(--ink-soft);
}
.pagination .page-numbers:hover { border-color: var(--china-red); color: var(--china-red); }
.pagination .page-numbers.current {
	background: var(--china-red);
	border-color: var(--china-red);
	color: #fff;
}
.pagination .page-numbers.dots { border-color: transparent; background: none; }

/* =========================================================================
   11. SINGLE ARTICLE & PAGE
   ========================================================================= */

.article-head { padding: clamp(2rem, 5vw, 3.25rem) 0 clamp(1.25rem, 3vw, 1.9rem); }
.article-head__inner { max-width: 820px; }

.article-title {
	font-size: clamp(1.85rem, 5vw, 3.05rem);
	line-height: 1.08;
	margin: 0 0 1rem;
	letter-spacing: -0.022em;
}

.article-standfirst {
	font-size: clamp(1.02rem, 2.2vw, 1.18rem);
	color: var(--ink-soft);
	margin: 0 0 1.1rem;
	max-width: 62ch;
}

/* Hero image — wider than the text column. aspect-ratio + object-fit are
   set on the <img> itself, which stays reliable at every viewport width. */
.article-hero { margin: 0 0 clamp(1.5rem, 3.5vw, 2.25rem); }
.article-hero__img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 7;
	object-fit: cover;
	border-radius: var(--radius);
	background: var(--scot-blue-tint);
}
.article-hero__caption {
	margin: 0.6rem 0 0;
	font-size: 0.8rem;
	color: var(--ink-faint);
	line-height: 1.5;
}

.article-panel {
	--panel-pad: clamp(1.25rem, 4vw, 3.25rem);
	max-width: 800px;
	margin: 0 auto;
	padding: var(--panel-pad);
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
}

.article-body {
	font-size: 1.0625rem;
	line-height: 1.75;
	color: var(--ink);
}
.article-body > *:last-child { margin-bottom: 0; }
.article-body a { color: var(--china-red); text-decoration: underline; text-decoration-color: var(--china-red-tint); }
.article-body a:hover { text-decoration-color: currentColor; }

.article-body h2 { font-size: clamp(1.35rem, 3vw, 1.7rem); margin: 2.1rem 0 0.7rem; }
.article-body h3 { font-size: clamp(1.15rem, 2.4vw, 1.32rem); margin: 1.7rem 0 0.55rem; }
.article-body h4 { font-size: 1.08rem; margin: 1.5rem 0 0.5rem; }

.article-body ul,
.article-body ol { padding-left: 1.35em; margin-bottom: 1.35em; }
.article-body li { margin-bottom: 0.4em; }

.article-body figure { margin: 1.9rem 0; }
.article-body img { border-radius: var(--radius); }

/* Key points callout — applied automatically when an article opens with a
   list (see scb_key_points_callout() in functions.php). */
.scb-key-points {
	margin: 0 0 1.9rem;
	padding: 1.15rem 1.35rem 1.2rem;
	background: var(--china-red-tint);
	border-left: 3px solid var(--china-red);
	border-radius: 0 var(--radius) var(--radius) 0;
}
.scb-key-points__label {
	margin: 0 0 0.6rem;
	font-family: var(--font-body);
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--china-red-deep);
}
.scb-key-points ul {
	margin: 0;
	padding: 0;
	list-style: none;
}
.scb-key-points li {
	position: relative;
	padding-left: 1.15rem;
	margin-bottom: 0.5rem;
	font-size: 0.99rem;
	line-height: 1.6;
}
.scb-key-points li:last-child { margin-bottom: 0; }
.scb-key-points li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.62em;
	width: 5px; height: 5px;
	border-radius: 50%;
	background: var(--china-red);
}
.scb-key-points ul ul { margin-top: 0.5rem; padding-left: 0.9rem; }

/* Standard blockquote */
.article-body blockquote {
	margin: 1.9rem 0;
	padding: 0.15rem 0 0.15rem 1.25rem;
	border-left: 3px solid var(--china-red);
	color: var(--ink-soft);
	font-size: 1.05rem;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body blockquote cite {
	display: block;
	margin-top: 0.6rem;
	font-family: var(--font-body);
	font-size: 0.78rem;
	font-style: normal;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--ink-faint);
}

/* Pullquote — deliberately distinct from a blockquote. */
.article-body .wp-block-pullquote {
	margin: 2.4rem 0;
	padding: 1.6rem 0;
	border-top: 2px solid var(--china-red);
	border-bottom: 1px solid var(--rule);
	background: none;
	text-align: center;
}
.article-body .wp-block-pullquote blockquote {
	margin: 0;
	padding: 0;
	border: 0;
	color: var(--ink);
}
.article-body .wp-block-pullquote p {
	font-family: var(--font-display);
	font-style: italic;
	font-weight: 500;
	font-size: clamp(1.3rem, 3.2vw, 1.72rem);
	line-height: 1.35;
	margin: 0;
	letter-spacing: -0.01em;
}
.article-body .wp-block-pullquote cite {
	display: block;
	margin-top: 0.9rem;
	font-family: var(--font-body);
	font-style: normal;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--china-red);
}

/* Captions ------------------------------------------------------------- */

.article-body .wp-caption { max-width: 100%; }
.article-body .wp-caption-text,
.article-body .wp-block-image figcaption,
.article-body figcaption {
	margin: 0.55rem 0 0;
	font-size: 0.8rem;
	line-height: 1.5;
	color: var(--ink-faint);
	text-align: left;
}

/* Alignments ----------------------------------------------------------- */

.article-body .aligncenter { display: block; margin-inline: auto; text-align: center; }
.article-body .aligncenter figcaption { text-align: center; }

.article-body .alignleft {
	float: left;
	margin: 0.35rem 1.5rem 1.1rem 0;
	max-width: 50%;
}
.article-body .alignright {
	float: right;
	margin: 0.35rem 0 1.1rem 1.5rem;
	max-width: 50%;
}
.article-body::after { content: ""; display: table; clear: both; }

/* Wide & full images bleed to the edge of the article panel. */
.article-body .alignwide,
.article-body .alignfull {
	width: auto;
	max-width: none;
	margin-left: calc(var(--panel-pad) * -1);
	margin-right: calc(var(--panel-pad) * -1);
}
.article-body .alignwide img,
.article-body .alignfull img { width: 100%; border-radius: 0; }
.article-body .alignwide figcaption,
.article-body .alignfull figcaption { padding-inline: var(--panel-pad); }

.article-body .wp-block-embed,
.article-body .wp-block-table { margin: 1.9rem 0; }
.article-body table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.article-body th,
.article-body td { padding: 0.6rem 0.75rem; border: 1px solid var(--rule); text-align: left; }
.article-body th { background: var(--scot-blue-tint); font-weight: 600; }

/* Tags ----------------------------------------------------------------- */

.article-tags {
	margin-top: clamp(1.75rem, 4vw, 2.5rem);
	padding-top: 1.4rem;
	border-top: 1px solid var(--rule);
}
.article-tags__label {
	margin: 0 0 0.75rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--ink-faint);
}
.article-tags__list { display: flex; flex-wrap: wrap; gap: 0.5rem; list-style: none; margin: 0; padding: 0; }
.tag-chip {
	display: inline-block;
	padding: 0.45rem 0.9rem;
	background: var(--china-red-tint);
	border: 1px solid rgba(200, 30, 58, 0.18);
	border-radius: 100px;
	font-size: 0.82rem;
	font-weight: 500;
	color: var(--china-red-deep);
	text-decoration: none;
}
.tag-chip:hover { background: var(--china-red); border-color: var(--china-red); color: #fff; }

/* Post-to-post navigation ---------------------------------------------- */

.article-nav {
	max-width: 800px;
	margin: clamp(1.5rem, 3.5vw, 2.25rem) auto 0;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 1rem;
}
.article-nav__link {
	display: block;
	padding: 1.05rem 1.25rem;
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	text-decoration: none;
}
.article-nav__link:hover { border-color: var(--china-red); }
.article-nav__dir {
	display: block;
	margin-bottom: 0.35rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: var(--china-red);
}
.article-nav__title {
	font-family: var(--font-display);
	font-size: 1.02rem;
	font-weight: 600;
	line-height: 1.25;
	color: var(--ink);
}
.article-nav__link--next { text-align: right; }

.single-article,
.page-article { padding-bottom: clamp(2.5rem, 6vw, 4rem); }

/* =========================================================================
   12. SEARCH FORM & 404
   ========================================================================= */

.search-form { display: flex; gap: 0.6rem; flex-wrap: wrap; max-width: 460px; }
.search-form .search-field {
	flex: 1 1 200px;
	min-width: 0;
	padding: 0.72rem 0.9rem;
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	font-size: 0.9rem;
}
.search-form .search-submit {
	padding: 0.72rem 1.3rem;
	background: var(--china-red);
	border: 0;
	border-radius: var(--radius);
	color: #fff;
	font-size: 0.875rem;
	font-weight: 600;
	cursor: pointer;
}
.search-form .search-submit:hover { background: var(--china-red-deep); }

.no-results {
	max-width: 640px;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	background: var(--card);
	border: 1px solid var(--rule);
	border-radius: var(--radius);
	margin-bottom: clamp(2.5rem, 6vw, 4rem);
}
.no-results h2 { font-size: 1.35rem; }
.no-results p { color: var(--ink-soft); }

.error-404 { padding: clamp(2.5rem, 8vw, 5rem) 0; text-align: center; }
.error-404__code {
	font-family: var(--font-display);
	font-size: clamp(3.5rem, 14vw, 7rem);
	font-weight: 600;
	line-height: 1;
	color: var(--china-red);
	margin: 0 0 0.5rem;
	letter-spacing: -0.03em;
}
.error-404 .page-header__desc { margin-inline: auto; }
.error-404 .search-form { margin: 1.75rem auto 0; justify-content: center; }
.error-404__recent { margin-top: 2.75rem; text-align: left; max-width: 560px; margin-inline: auto; }
.error-404__recent ul { list-style: none; margin: 0; padding: 0; }
.error-404__recent li { border-top: 1px solid var(--rule); padding: 0.75rem 0; }
.error-404__recent a { font-family: var(--font-display); font-size: 1.05rem; font-weight: 600; text-decoration: none; }

/* =========================================================================
   13. FOOTER
   ========================================================================= */

.site-footer {
	background: var(--ink);
	color: rgba(255, 255, 255, 0.7);
	padding: clamp(2.25rem, 5vw, 3.5rem) 0 clamp(1.5rem, 3vw, 2rem);
	border-top: 3px solid var(--china-red);
}

.site-footer__top {
	display: grid;
	grid-template-columns: 1.2fr 1fr;
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: start;
	padding-bottom: clamp(1.5rem, 3.5vw, 2.25rem);
	border-bottom: 1px solid rgba(255, 255, 255, 0.12);
}

.site-footer__brand {
	font-family: var(--font-display);
	font-size: 1.25rem;
	font-weight: 600;
	color: #fff;
	text-decoration: none;
	display: inline-block;
	margin-bottom: 0.4rem;
}
.site-footer__blurb { font-size: 0.9rem; margin: 0; max-width: 46ch; }

.footer-nav__heading,
.footer-social__heading {
	margin: 0 0 0.85rem;
	font-size: 0.68rem;
	font-weight: 600;
	letter-spacing: 0.14em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.45);
}

.footer-menu {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.5rem;
	list-style: none;
	margin: 0 0 1.75rem;
	padding: 0;
}
.footer-menu a {
	color: rgba(255, 255, 255, 0.8);
	text-decoration: none;
	font-size: 0.9rem;
	font-weight: 500;
	padding-bottom: 2px;
	border-bottom: 1px solid transparent;
}
.footer-menu a:hover { color: #fff; border-bottom-color: var(--china-red); }

.footer-social { display: flex; flex-wrap: wrap; gap: 0.5rem; margin: 0; padding: 0; list-style: none; }
.footer-social a {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px; height: 38px;
	border: 1px solid rgba(255, 255, 255, 0.16);
	border-radius: var(--radius);
	color: rgba(255, 255, 255, 0.75);
	transition: color 0.16s ease, border-color 0.16s ease, background-color 0.16s ease;
}
.footer-social a:hover {
	color: #fff;
	border-color: var(--china-red);
	background: var(--china-red);
}
.footer-social svg { width: 19px; height: 19px; }

.site-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1.5rem;
	justify-content: space-between;
	align-items: center;
	padding-top: 1.25rem;
	font-size: 0.8rem;
	color: rgba(255, 255, 255, 0.5);
}
.site-footer__bottom a { color: rgba(255, 255, 255, 0.7); }
.site-footer__bottom a:hover { color: #fff; }

/* =========================================================================
   14. RESPONSIVE
   ========================================================================= */

@media (max-width: 900px) {
	.nav-toggle { display: inline-flex; }

	/* Panel is anchored to .header-bar, which is position: relative. */
	.primary-nav {
		display: none;
		position: absolute;
		top: 100%;
		left: 0;
		right: 0;
		max-height: calc(100vh - var(--header-h));
		overflow-y: auto;
		background: var(--card);
		border-top: 1px solid var(--rule);
		box-shadow: 0 20px 40px rgba(23, 35, 58, 0.14);
		padding: 0.4rem 0 1rem;
	}
	.primary-nav.is-open { display: block; }

	.nav-menu {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		width: min(100% - (var(--gutter) * 2), var(--wrap));
		margin-inline: auto;
	}
	.nav-menu > li { border-bottom: 1px solid var(--rule); }
	.nav-menu > li:last-child { border-bottom: 0; }
	.nav-menu a { padding: 0.8rem 0.1rem; font-size: 0.98rem; }
	.nav-menu > li > a::after { display: none; }

	.submenu-toggle { right: 0; width: 40px; height: 40px; }

	.sub-menu {
		position: static;
		display: none;
		opacity: 1;
		visibility: visible;
		transform: none;
		min-width: 0;
		border: 0;
		border-left: 2px solid var(--china-red);
		border-radius: 0;
		box-shadow: none;
		background: var(--china-red-tint);
		margin: 0 0 0.7rem;
		padding: 0.35rem 0 0.35rem 0.85rem;
		transition: none;
	}
	.menu-item-has-children:hover > .sub-menu,
	.menu-item-has-children:focus-within > .sub-menu { display: none; }
	.menu-item-has-children.is-expanded > .sub-menu { display: block; }
	.sub-menu a { padding: 0.55rem 0.1rem; }
}

@media (max-width: 860px) {
	.featured__grid { grid-template-columns: 1fr; }
	.section-grid { grid-template-columns: 1fr; }
	.newsletter-banner__inner { grid-template-columns: 1fr; }
	.site-footer__top { grid-template-columns: 1fr; }
	.post-row { grid-template-columns: 1fr; }
	.post-row__body { padding: clamp(1.15rem, 4vw, 1.7rem); }
	.post-row__media img { aspect-ratio: 16 / 9; }
	.article-hero__img { aspect-ratio: 4 / 3; border-radius: 0; }
	.article-body .alignleft,
	.article-body .alignright { float: none; margin: 1.5rem 0; max-width: 100%; }
	.article-nav { grid-template-columns: 1fr; }
	.article-nav__link--next { text-align: left; }
}

@media (max-width: 560px) {
	.header-brand { font-size: 0.95rem; }
	.route-graphic { gap: 0.5rem; }
	.route-graphic__label { font-size: 0.58rem; letter-spacing: 0.14em; }
	.card--lead .card__media img,
	.card--side .card__media img { aspect-ratio: 16 / 9; }
	.newsletter-form__input { flex-basis: 100%; }
	.newsletter-form .btn { width: 100%; }
}

/* =========================================================================
   15. MOTION PREFERENCES
   ========================================================================= */

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