/*
Theme Name: Kemble
Description: Modernised port of the Kemble (Anglo-Saxon Charters) site — original banner and structure, contemporary typography, motion and layout. Staging redesign (wpkemble2).
Version: 2.6
Author: Robinson College
Requires PHP: 7.4
*/

/* ================= Design tokens ================= */
:root {
	--ink: #1e2732;
	--ink-soft: #46556a;
	--paper: #f5f7fa;
	--card: #ffffff;
	--line: #e3e8ee;
	--accent: #0b6aa2;
	--accent-strong: #084d77;
	--accent-soft: #e8f2f9;
	--nav-bg: rgba(18, 26, 36, 0.94);
	--nav-ink: #dfe7ef;
	--gold: #c9a227;
	--radius: 14px;
	--shadow-sm: 0 1px 3px rgba(16, 30, 46, 0.08);
	--shadow-md: 0 6px 20px rgba(16, 30, 46, 0.12);
	--shadow-lg: 0 16px 40px rgba(16, 30, 46, 0.18);
	--font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--font-serif: "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, "Times New Roman", serif;
	--ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
	margin: 0;
	padding: 0;
	background:
		radial-gradient(1200px 400px at 85% -50px, rgba(11, 106, 162, 0.08), transparent 60%),
		var(--paper);
	color: var(--ink);
	font-family: var(--font-serif);
	font-size: 17px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--accent); text-decoration-color: rgba(11, 106, 162, 0.35); text-underline-offset: 3px; transition: color 0.25s var(--ease), text-decoration-color 0.25s var(--ease); }
a:hover { color: var(--accent-strong); text-decoration-color: currentColor; }
img { max-width: 100%; height: auto; }
::selection { background: var(--accent); color: #fff; }

.site-wrap { max-width: 1160px; margin: 0 auto; animation: page-enter 0.55s var(--ease) both; }
@keyframes page-enter { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

/* ================= Page transitions (native, zero delay) =================
   Cross-document View Transitions: the browser snapshots the old page and
   animates to the new one during navigation — links stay instant. Browsers
   without support simply navigate normally. */
@view-transition { navigation: auto; }
@media (prefers-reduced-motion: no-preference) {
	::view-transition-old(root) { animation: vt-out 0.24s var(--ease) both; }
	::view-transition-new(root) { animation: vt-in 0.3s var(--ease) both; }
}
@keyframes vt-out { to { opacity: 0; transform: translateY(-14px) scale(0.995); } }
@keyframes vt-in { from { opacity: 0; transform: translateY(16px) scale(0.995); } }

/* ================= Scroll progress bar ================= */
.scroll-progress {
	position: fixed;
	top: 0;
	left: 0;
	width: 100%;
	height: 3px;
	z-index: 1200;
	background: linear-gradient(90deg, var(--gold), var(--accent) 45%, #0e8f8b);
	transform: scaleX(0);
	transform-origin: 0 50%;
	pointer-events: none;
}
@supports (animation-timeline: scroll()) {
	.scroll-progress { animation: progress-grow linear both; animation-timeline: scroll(root); }
}
@keyframes progress-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

/* ================= Header / hero ================= */
.site-header { background: transparent; }
.site-header .banner {
	position: relative;
	overflow: hidden;
	border-radius: 0 0 var(--radius) var(--radius);
	min-height: 250px;
	display: flex;
	align-items: center;
	padding: 0 40px;
	isolation: isolate;
	box-shadow: var(--shadow-md);
}
.site-header .banner::before {
	content: "";
	position: absolute;
	inset: -4%;
	z-index: -2;
	background: url('header.jpg') center / cover no-repeat;
	animation: hero-drift 26s var(--ease) infinite alternate;
}
.site-header .banner::after {
	content: "";
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(115deg, rgba(8, 20, 34, 0.88) 0%, rgba(9, 46, 74, 0.62) 45%, rgba(11, 106, 162, 0.28) 100%);
}
@keyframes hero-drift { from { transform: scale(1) translateX(0); } to { transform: scale(1.09) translateX(1.5%); } }

.site-branding { display: flex; align-items: center; gap: 22px; }
.site-branding img.site-logo {
	width: 56px;
	height: 87px;
	filter: drop-shadow(0 3px 8px rgba(0, 0, 0, 0.45));
	animation: rise-in 0.7s var(--ease) 0.1s both;
}
.site-branding > div { animation: rise-in 0.7s var(--ease) 0.22s both; }
@keyframes rise-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

.site-title { margin: 0; font-size: 44px; letter-spacing: 0.5px; line-height: 1.05; }
.site-title a { color: #fff; text-decoration: none; text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5); }
.site-description {
	margin: 8px 0 0;
	color: #dbe9f4;
	font-size: 17px;
	font-style: italic;
	text-shadow: 0 1px 6px rgba(0, 0, 0, 0.5);
}

/* ================= Main navigation ================= */
.main-nav {
	position: sticky;
	top: 0;
	z-index: 800;
	margin-top: 10px;
	background: var(--nav-bg);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	border-radius: 12px;
	box-shadow: var(--shadow-sm);
	font-family: var(--font-ui);
	font-size: 14.5px;
	transition: box-shadow 0.3s var(--ease), border-radius 0.3s var(--ease);
}
.main-nav.is-stuck { border-radius: 0 0 12px 12px; box-shadow: var(--shadow-lg); }
.main-nav ul { margin: 0; padding: 0; list-style: none; }
.main-nav > ul { display: flex; flex-wrap: wrap; padding: 0 10px; }
.main-nav li { position: relative; }
.main-nav a {
	position: relative;
	display: block;
	padding: 13px 15px;
	color: var(--nav-ink);
	text-decoration: none;
	white-space: nowrap;
	transition: color 0.25s var(--ease), background 0.25s var(--ease);
}
.main-nav > ul > li > a::after {
	content: "";
	position: absolute;
	left: 15px;
	right: 15px;
	bottom: 7px;
	height: 2px;
	background: linear-gradient(90deg, var(--gold), #f0d27a);
	border-radius: 2px;
	transform: scaleX(0);
	transform-origin: left center;
	transition: transform 0.3s var(--ease);
}
.main-nav > ul > li:hover > a::after,
.main-nav > ul > li:focus-within > a::after,
.main-nav > ul > li.current-menu-item > a::after { transform: scaleX(1); }
.main-nav li:hover > a, .main-nav a:focus { color: #fff; }
.main-nav > ul > li.current-menu-item > a { color: #fff; }

/* Dropdowns: animated fade + slide (replaces display:none toggling) */
.main-nav li ul {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 240px;
	max-height: 70vh;
	overflow-y: auto;
	padding: 8px;
	background: rgba(24, 33, 45, 0.97);
	backdrop-filter: blur(8px);
	border-radius: 12px;
	box-shadow: var(--shadow-lg);
	opacity: 0;
	visibility: hidden;
	transform: translateY(12px);
	transition: opacity 0.28s var(--ease), transform 0.28s var(--ease), visibility 0s linear 0.28s;
	z-index: 100;
}
.main-nav li:hover > ul, .main-nav li:focus-within > ul {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
	transition-delay: 0s;
}
.main-nav li ul a { padding: 9px 13px; border-radius: 8px; white-space: normal; }
.main-nav li ul a:hover, .main-nav li ul a:focus { background: var(--accent); color: #fff; }
.main-nav li ul li ul { top: 0; left: 100%; transform: translateX(10px); }
.main-nav li ul li:hover > ul, .main-nav li ul li:focus-within > ul { transform: translateX(0); }

/* Account links pushed to the right */
.main-nav li.account-link { margin-left: auto; }

/* Mobile menu toggle */
.nav-toggle {
	display: none;
	width: 100%;
	padding: 13px 16px;
	background: none;
	border: 0;
	color: var(--nav-ink);
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.4px;
	text-align: left;
	cursor: pointer;
}
.nav-toggle::before { content: "\2630\00a0\00a0"; color: var(--gold); }
.nav-open .nav-toggle::before { content: "\2715\00a0\00a0"; }

/* ================= Layout: sidebar + main ================= */
.content-area { display: grid; grid-template-columns: 260px minmax(0, 1fr); gap: 26px; padding: 26px 0 46px; }

.site-sidebar { font-family: var(--font-ui); font-size: 13.5px; }
.sidebar-block {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	padding: 18px 20px;
	margin-bottom: 20px;
	transition: transform 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.sidebar-block:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }
.sidebar-block h2 {
	position: relative;
	margin: 0 0 12px;
	padding-bottom: 8px;
	font-size: 15px;
	letter-spacing: 0.3px;
	border-bottom: 1px solid var(--line);
}
.sidebar-block h2::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: -1px;
	width: 44px;
	height: 2px;
	background: linear-gradient(90deg, var(--accent), #0e8f8b);
	border-radius: 2px;
}
.sidebar-block ul { margin: 0; padding-left: 16px; }
.sidebar-block li { margin-bottom: 7px; }
.sidebar-block a { text-decoration: none; }
.sidebar-block a:hover { text-decoration: underline; }

/* Quick links as rollover chips */
.sidebar-quicklinks ul { padding: 0; list-style: none; }
.sidebar-quicklinks a {
	position: relative;
	display: block;
	padding: 8px 26px 8px 13px;
	border-radius: 9px;
	background: #f2f6fa;
	border: 1px solid var(--line);
	font-weight: 500;
	transition: background 0.25s var(--ease), color 0.25s var(--ease), transform 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.sidebar-quicklinks a::after {
	content: "\2192";
	position: absolute;
	right: 11px;
	top: 50%;
	translate: -6px -50%;
	opacity: 0;
	color: #f0d27a;
	transition: opacity 0.25s var(--ease), translate 0.25s var(--ease);
}
.sidebar-quicklinks a:hover, .sidebar-quicklinks a:focus {
	background: linear-gradient(115deg, var(--accent), #0e8f8b);
	color: #fff;
	text-decoration: none;
	transform: translateX(4px);
	box-shadow: var(--shadow-sm);
}
.sidebar-quicklinks a:hover::after, .sidebar-quicklinks a:focus::after { opacity: 1; translate: 0 -50%; }
.sidebar-section-menu ul ul { padding-left: 14px; margin-top: 5px; }
.sidebar-section-menu .current-item > a { font-weight: 700; color: var(--ink); }

.sidebar-login label { display: block; font-weight: 600; margin-bottom: 4px; color: var(--ink-soft); }
.sidebar-login input[type="text"],
.sidebar-login input[type="password"] {
	width: 100%;
	padding: 8px 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	font: inherit;
	background: #fbfcfe;
	transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.sidebar-login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.sidebar-login button {
	width: 100%;
	padding: 10px 16px;
	background: linear-gradient(115deg, var(--accent), #0e8f8b);
	color: #fff;
	border: 0;
	border-radius: 9px;
	font: inherit;
	font-weight: 600;
	letter-spacing: 0.3px;
	cursor: pointer;
	box-shadow: var(--shadow-sm);
	transition: transform 0.22s var(--ease), box-shadow 0.22s var(--ease), filter 0.22s var(--ease);
}
.sidebar-login button:hover, .sidebar-login button:focus { transform: translateY(-1px); box-shadow: var(--shadow-md); filter: brightness(1.06); }
.sidebar-login .login-links { list-style: none; padding: 0; margin-top: 12px; }
.sidebar-login .g-recaptcha { transform: scale(0.72); transform-origin: 0 0; }

/* ================= Content ================= */
.site-main { min-width: 0; }
.site-main article {
	background: var(--card);
	border: 1px solid var(--line);
	border-radius: var(--radius);
	box-shadow: var(--shadow-sm);
	padding: 34px 42px 42px;
}
.site-main h1.page-title {
	position: relative;
	margin: 0 0 22px;
	padding-bottom: 14px;
	font-size: 34px;
	line-height: 1.2;
	letter-spacing: 0.2px;
	background: linear-gradient(115deg, var(--ink) 30%, var(--accent-strong) 85%);
	-webkit-background-clip: text;
	background-clip: text;
	-webkit-text-fill-color: transparent;
}
.site-main h1.page-title::after {
	content: "";
	position: absolute;
	left: 0;
	bottom: 0;
	width: 74px;
	height: 3px;
	border-radius: 3px;
	background: linear-gradient(90deg, var(--accent), #0e8f8b);
	animation: title-bar 0.9s var(--ease) 0.15s both;
}
@keyframes title-bar { from { width: 0; } to { width: 74px; } }

/* Titles that link to a Wikipedia article (archives & religious houses) */
.page-title a.wiki-link { text-decoration: none; }
.page-title a.wiki-link:hover { text-decoration: underline; text-decoration-color: var(--gold); text-decoration-thickness: 3px; text-underline-offset: 6px; }
.wiki-mark {
	display: inline-block;
	vertical-align: super;
	margin-left: 9px;
	width: 24px;
	height: 24px;
	line-height: 22px;
	text-align: center;
	font-size: 14px;
	font-family: var(--font-serif);
	font-weight: 700;
	color: var(--accent);
	-webkit-text-fill-color: var(--accent);
	border: 1.5px solid var(--accent);
	border-radius: 50%;
	opacity: 0.55;
	transition: opacity 0.25s var(--ease), transform 0.25s var(--ease), background 0.25s var(--ease), color 0.25s var(--ease);
}
.page-title a.wiki-link:hover .wiki-mark {
	opacity: 1;
	transform: translateY(-3px) rotate(8deg);
	background: var(--accent);
	color: #fff;
	-webkit-text-fill-color: #fff;
}
.entry-content { font-size: 17px; }
.entry-content > p, .entry-content > ul, .entry-content > ol { max-width: 76ch; }
.entry-content p { margin: 0 0 1.15em; }

/* Lede: the opening paragraph reads larger */
.entry-content > p:first-of-type { font-size: 19.5px; line-height: 1.72; color: #2a3646; }
/* Drop cap on the home page opening */
.home .entry-content > p:first-of-type::first-letter {
	float: left;
	padding: 6px 12px 0 0;
	font-size: 3.6em;
	line-height: 0.82;
	font-weight: 700;
	color: var(--accent);
	text-shadow: 2px 3px 0 rgba(201, 162, 39, 0.35);
}

/* Paragraph rollover: a soft highlight and accent bar follow the reader */
.entry-content p {
	position: relative;
	padding: 3px 10px;
	margin-left: -10px;
	border-radius: 8px;
	transition: background 0.35s var(--ease);
}
.entry-content p::before {
	content: "";
	position: absolute;
	left: 0;
	top: 12%;
	bottom: 12%;
	width: 3px;
	border-radius: 3px;
	background: linear-gradient(180deg, var(--accent), var(--gold));
	transform: scaleY(0);
	transform-origin: top center;
	transition: transform 0.35s var(--ease);
}
.entry-content p:hover { background: linear-gradient(115deg, rgba(11, 106, 162, 0.055), rgba(201, 162, 39, 0.07)); }
.entry-content p:hover::before { transform: scaleY(1); }

/* List items step forward on rollover */
.entry-content li { transition: transform 0.25s var(--ease); }
.entry-content li:hover { transform: translateX(5px); }
.entry-content li::marker { color: var(--accent); }
.entry-content h3 { transition: color 0.3s var(--ease), letter-spacing 0.3s var(--ease); }
.entry-content h3:hover { color: var(--accent); letter-spacing: 0.4px; }

/* Rollover links: underline sweeps up into a full highlight */
.entry-content a {
	text-decoration: none;
	padding: 0 3px;
	margin: 0 -1px;
	border-radius: 4px;
	background-image: linear-gradient(120deg, rgba(11, 106, 162, 0.18), rgba(14, 143, 139, 0.18));
	background-repeat: no-repeat;
	background-size: 100% 2px;
	background-position: 0 100%;
	transition: background-size 0.28s var(--ease), color 0.2s var(--ease);
}
.entry-content a:hover, .entry-content a:focus { background-size: 100% 100%; color: var(--accent-strong); }

/* Emphasis reads as a highlighter stroke */
.entry-content strong, .entry-content b {
	background: linear-gradient(180deg, transparent 60%, rgba(201, 162, 39, 0.3) 60%);
	padding: 0 3px;
	border-radius: 3px;
}

/* Images: framed "relief" plates that tilt toward the pointer (kemble.js) */
.img-frame {
	display: inline-block;
	max-width: 100%;
	border-radius: 12px;
	background: #fff;
	padding: 8px;
	box-shadow:
		0 14px 34px rgba(16, 30, 46, 0.24),
		0 3px 8px rgba(16, 30, 46, 0.16),
		inset 0 0 0 1px var(--line);
	transform-style: preserve-3d;
	transition: transform 0.35s var(--ease), box-shadow 0.35s var(--ease);
	will-change: transform;
}
.img-frame:hover {
	box-shadow:
		0 26px 60px rgba(16, 30, 46, 0.32),
		0 6px 14px rgba(16, 30, 46, 0.2),
		inset 0 0 0 1px var(--line);
}
.img-frame img { display: block; border-radius: 6px; }
/* The home-page charter floats gently until touched */
.home .entry-content .img-frame { animation: charter-float 7s ease-in-out infinite alternate; }
.home .entry-content .img-frame:hover { animation-play-state: paused; }
@keyframes charter-float {
	from { transform: translateY(0) rotate(-0.25deg); }
	to { transform: translateY(-10px) rotate(0.35deg); }
}
/* Image captions (the em line under the charter) */
.entry-content .rtecenter em { display: inline-block; margin-top: 10px; color: var(--ink-soft); font-size: 15px; }
.entry-content h2 {
	margin: 1.6em 0 0.7em;
	font-size: 24px;
	padding-left: 14px;
	border-left: 4px solid var(--accent);
	line-height: 1.3;
	transition: border-color 0.3s var(--ease), padding-left 0.3s var(--ease), color 0.3s var(--ease);
}
.entry-content h2:hover { border-color: var(--gold); padding-left: 20px; color: var(--accent-strong); }
.entry-content h3 { margin: 1.4em 0 0.55em; font-size: 19px; color: var(--accent-strong); }
.entry-content li { margin-bottom: 0.45em; }
.entry-content blockquote {
	margin: 1.4em 0;
	padding: 14px 22px;
	border-left: 4px solid var(--gold);
	background: #fbf7ec;
	border-radius: 0 10px 10px 0;
	font-style: italic;
	color: var(--ink-soft);
}
.entry-content hr { border: 0; height: 1px; margin: 2em 0; background: linear-gradient(90deg, var(--line), transparent); }

/* Tables — content tables and TablePress */
.entry-content table { border-collapse: collapse; width: 100%; font-family: var(--font-ui); font-size: 14.5px; }
.entry-content td, .entry-content th { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.entry-content thead th, .entry-content tr:first-child th {
	background: var(--ink);
	color: #fff;
	text-align: left;
	letter-spacing: 0.3px;
}
.entry-content tbody tr { transition: background 0.2s var(--ease); }
.entry-content tbody tr:nth-child(even) { background: #f4f7fa; }
.entry-content tbody tr:hover { background: var(--accent-soft); }

.tablepress { font-family: var(--font-ui); font-size: 14px; }
.tablepress thead th {
	background: var(--ink) !important;
	color: #fff;
	letter-spacing: 0.3px;
}
.tablepress tbody tr { transition: background 0.2s var(--ease); }
.tablepress tbody tr:hover td { background: var(--accent-soft) !important; }
.tablepress .cell-clamp {
	max-height: 8em;
	overflow-y: auto;
	min-width: 320px;
	padding-right: 6px;
}
.dataTables_wrapper .dataTables_filter input {
	padding: 7px 10px;
	border: 1px solid var(--line);
	border-radius: 8px;
	transition: border-color 0.25s var(--ease), box-shadow 0.25s var(--ease);
}
.dataTables_wrapper .dataTables_filter input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }

/* Bartik-era alignment classes used in migrated content */
.rteleft { text-align: left; }
.rtecenter { text-align: center; }
.rteright { text-align: right; }
.rteindent1 { margin-left: 40px; }
.rteindent2 { margin-left: 80px; }
.rtejustify { text-align: justify; }

/* ================= Scroll-reveal ================= */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s var(--ease), transform 0.7s var(--ease); }
.reveal.is-visible { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }

/* ================= Interactive charter (interactive-charter page) ========= */
.ic-hint { color: var(--ink-soft); }
.ic-stage { position: relative; border-radius: 12px; overflow: hidden; box-shadow: var(--shadow-md); }
.ic-stage img { display: block; width: 100%; height: auto; }
.ic-hotspot {
	position: absolute;
	border: 2px dashed transparent;
	border-radius: 8px;
	cursor: help;
	transition: border-color 0.3s var(--ease), background 0.3s var(--ease), box-shadow 0.3s var(--ease);
}
.ic-stage:hover .ic-hotspot, .ic-stage:focus-within .ic-hotspot { border-color: rgba(201, 162, 39, 0.5); }
.ic-hotspot:hover, .ic-hotspot:focus {
	background: rgba(201, 162, 39, 0.12);
	border-color: var(--gold);
	border-style: solid;
	/* spotlight: dim everything except the hovered region */
	box-shadow: 0 0 0 2000px rgba(8, 14, 22, 0.38);
	z-index: 5;
	outline: none;
}
.ic-label {
	position: absolute;
	top: 6px;
	left: 6px;
	padding: 3px 10px;
	background: var(--ink);
	color: #fff;
	font-family: var(--font-ui);
	font-size: 12px;
	letter-spacing: 0.3px;
	border-radius: 999px;
	white-space: nowrap;
	opacity: 0;
	transform: translateY(4px);
	transition: opacity 0.25s var(--ease), transform 0.25s var(--ease);
	pointer-events: none;
}
.ic-hotspot:hover .ic-label, .ic-hotspot:focus .ic-label { opacity: 1; transform: none; }
.ic-panel {
	margin-top: 14px;
	min-height: 128px;
	padding: 16px 20px;
	background: #f8fafc;
	border: 1px solid var(--line);
	border-radius: 12px;
}
.ic-box { display: none; }
.ic-box.is-on, .ic-box.ic-default { display: block; animation: rise-in 0.35s var(--ease); }
.ic-box h3 { margin: 0 0 6px; font-size: 18px; color: var(--accent-strong); }
.ic-box p { margin: 0; }
.ic-default { color: var(--ink-soft); font-style: italic; }

/* ================= Charter watermarks on text-only pages ================= */
.site-main article { position: relative; isolation: isolate; overflow: hidden; }
.site-main article.has-watermark::before {
	content: "";
	position: absolute;
	z-index: -1;
	top: 0;
	right: -60px;
	bottom: 0;
	width: 560px;
	background-repeat: repeat-y;
	background-position: right top;
	background-size: 100% auto;
	opacity: 0.09;
	filter: grayscale(30%) sepia(50%) contrast(1.02);
	-webkit-mask-image: linear-gradient(to left, #000 35%, transparent 92%);
	mask-image: linear-gradient(to left, #000 35%, transparent 92%);
	pointer-events: none;
}
.site-main article.wm-1::before { background-image: url('wm-1.jpg'); }
.site-main article.wm-2::before { background-image: url('wm-2.jpg'); }
.site-main article.wm-3::before { background-image: url('wm-3.jpg'); }
@media (max-width: 900px) {
	.site-main article.has-watermark::before { width: 340px; right: -50px; }
}

/* ================= Home footer logos ================= */
.entry-content > p.home-logos { max-width: none; }
.home-logos {
	display: flex;
	justify-content: space-between;
	align-items: center;
	gap: 28px;
	flex-wrap: wrap;
	margin-top: 2.2em;
	padding: 22px 10px 0;
	border-top: 1px solid var(--line);
}
.entry-content p.home-logos:hover { background: none; }
.entry-content p.home-logos::before { display: none; }
.home-logos a { background: none; padding: 0; margin: 0; }
.home-logos img {
	display: block;
	filter: saturate(0.85);
	transition: transform 0.3s var(--ease), filter 0.3s var(--ease);
}
.home-logos a:hover img, .home-logos a:focus img { transform: translateY(-4px) scale(1.05); filter: saturate(1.2); }
@media (max-width: 700px) {
	.home-logos { justify-content: center; }
}

/* ================= Manuscript lightbox ================= */
.ms-lightbox {
	position: fixed;
	inset: 0;
	z-index: 2000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vh 4vw;
	background: rgba(8, 14, 22, 0.82);
	backdrop-filter: blur(6px);
	-webkit-backdrop-filter: blur(6px);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.32s var(--ease), visibility 0s linear 0.32s;
}
.ms-lightbox.is-open { opacity: 1; visibility: visible; transition-delay: 0s; }
.ms-lightbox figure { margin: 0; text-align: center; transform: scale(0.93); transition: transform 0.32s var(--ease); }
.ms-lightbox.is-open figure { transform: none; }
.ms-lightbox img {
	max-width: 92vw;
	max-height: 82vh;
	width: auto;
	height: auto;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 30px 90px rgba(0, 0, 0, 0.6);
}
.ms-lightbox figcaption { margin-top: 14px; color: #dfe7ef; font-family: var(--font-ui); font-size: 14.5px; letter-spacing: 0.3px; }
.ms-close {
	position: absolute;
	top: 18px;
	right: 22px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.14);
	color: #fff;
	font-size: 19px;
	cursor: pointer;
	transition: background 0.25s var(--ease), transform 0.25s var(--ease);
}
.ms-close:hover, .ms-close:focus { background: var(--accent); transform: rotate(90deg); }

/* ================= Footer ================= */
.site-footer {
	margin-top: 4px;
	padding: 26px 30px 34px;
	background: #141b24;
	color: #9fb0c1;
	border-radius: var(--radius) var(--radius) 0 0;
	font-size: 13.5px;
	font-family: var(--font-ui);
	border-top: 3px solid transparent;
	border-image: linear-gradient(90deg, var(--accent), #0e8f8b, var(--gold)) 1;
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 24px;
	flex-wrap: wrap;
}
.site-footer p { margin: 0; }
.site-footer a { color: #cfdce8; }
.site-credit { text-align: right; margin-left: auto; }
.site-credit .k-email-link {
	color: #cfdce8;
	text-decoration-color: rgba(201, 162, 39, 0.5);
	transition: color 0.25s var(--ease), text-decoration-color 0.25s var(--ease);
}
.site-credit .k-email-link:hover { color: #f0d27a; text-decoration-color: currentColor; }
@media (max-width: 700px) {
	.site-footer { display: block; }
	.site-credit { text-align: left; margin-top: 8px; }
}

/* ================= Responsive ================= */
@media (max-width: 900px) {
	.site-header .banner { min-height: 170px; padding: 0 24px; }
	.site-title { font-size: 32px; }
	.content-area { grid-template-columns: 1fr; padding: 18px 12px 40px; }
	.site-sidebar { order: 2; }
	.site-main { order: 1; }
	.site-main article { padding: 24px 20px 30px; }
	.nav-toggle { display: block; }
	.main-nav { position: static; border-radius: 12px; }
	.main-nav > ul {
		flex-direction: column;
		max-height: 0;
		overflow: hidden;
		padding: 0 10px;
		transition: max-height 0.45s var(--ease), padding 0.45s var(--ease);
	}
	.nav-open .main-nav > ul, .main-nav.nav-open > ul { max-height: 80vh; overflow-y: auto; padding: 6px 10px 12px; }
	.main-nav li ul {
		position: static;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		background: rgba(255, 255, 255, 0.05);
		max-height: none;
		margin: 2px 0 6px 12px;
	}
	.main-nav li.account-link { margin-left: 0; }
	.main-nav > ul > li > a::after { display: none; }
}

/* ================= Reduced motion ================= */
@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	*, *::before, *::after {
		animation-duration: 0.001s !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.001s !important;
	}
	.reveal { opacity: 1; transform: none; }
	.scroll-progress { display: none; }
	.img-frame, .home .entry-content .img-frame { animation: none; transform: none !important; }
}
