/* Macedonian History hub (/istorija/). Loaded only on hub pages. */

.kh {
	--kh-red: var(--k-red, #a3121a);
	--kh-redbg: var(--k-red, #a3121a);
	--kh-sun: var(--k-sun, #f6c21a);
	--kh-blue: #2f5bd8;
	--kh-bg: var(--bg, #fbf8f3);
	--kh-ink: var(--ink, #1a1214);
	--kh-muted: var(--muted, #5a4e50);
	--kh-line: var(--line, #e5ddd2);
	--kh-soft: var(--soft, #f4efe8);
	--kh-card: #fff;
	--kh-d-bg: #120d0e;
	--kh-d-bg2: #1c1416;
	--kh-d-ink: #f4efe8;
	--kh-d-muted: #c3b9bb;
	--kh-d-line: rgba(255, 255, 255, .12);
	--kh-war: #e2483d;
	--kh-church: #d9a514;
	--kh-culture: #3aa76d;
	--kh-pol: #4f7ef0;
	--kh-r: 18px;
	--kh-display: "Unbounded", var(--sans, system-ui), sans-serif;
	--kh-serif: var(--serif, "Literata", Georgia, serif);
	--kh-sans: var(--sans, "Geologica", system-ui, sans-serif);
	background: var(--kh-bg);
	color: var(--kh-ink);
	font-family: var(--kh-sans);
	overflow-x: clip;
	padding: 0 !important;
	max-width: none !important;
}
html[data-theme="dark"] .kh { --kh-card: #1c1617; --kh-church: #f2c02a; --kh-red: #ff8a7a; }

/* Language: Macedonian by default, English when chosen. */
html:not([data-mh-lang="en"]) .kh .mh-l-en,
html[data-mh-lang="en"] .kh .mh-l-mk { display: none !important; }

.kh *, .kh *::before, .kh *::after { box-sizing: border-box; }
.kh img { max-width: 100%; display: block; }
.kh a { color: inherit; }
.kh :focus-visible { outline: 3px solid var(--kh-sun); outline-offset: 2px; border-radius: 4px; }
.kh-wrap { width: min(1240px, 100% - 32px); margin-inline: auto; }
.kh-dark { background: var(--kh-d-bg); color: var(--kh-d-ink); }
.kh-dark a { color: var(--kh-d-ink); }

.kh-eyebrow { margin: 0; font: 600 13px/1.4 var(--kh-sans); letter-spacing: .18em; text-transform: uppercase; color: var(--kh-red); }
.kh-dark .kh-eyebrow { color: var(--kh-sun); }
.kh-h1 { margin: 12px 0 0; font: 800 clamp(40px, 7vw, 92px)/.98 var(--kh-display); letter-spacing: -.02em; text-wrap: balance; }
.kh-h1--page { font-size: clamp(34px, 5.2vw, 68px); line-height: 1.03; }
.kh-h2 { margin: 8px 0 0; font: 700 clamp(28px, 3.6vw, 46px)/1.08 var(--kh-serif); text-wrap: balance; }
.kh-h3 { margin: 0 0 14px; font: 700 clamp(22px, 2.2vw, 28px)/1.2 var(--kh-serif); }
.kh-h3 a { text-decoration: none; }
.kh-h3 a:hover { text-decoration: underline; }
.kh-h4 { margin: 0 0 12px; font: 700 19px/1.25 var(--kh-serif); }
.kh-lead { margin: 18px 0 0; max-width: 62ch; font: 400 clamp(17px, 1.6vw, 21px)/1.6 var(--kh-serif); color: var(--kh-muted); }
.kh-dark .kh-lead { color: var(--kh-d-muted); }
.kh-sub { margin: 10px 0 0; max-width: 66ch; color: var(--kh-muted); font-size: 17px; line-height: 1.6; }
.kh-meta { margin: 14px 0 0; color: var(--kh-d-muted); font-size: 15px; }
.kh-small { font-size: 14px; color: var(--kh-muted); }

.kh-btn { display: inline-flex; align-items: center; gap: 8px; min-height: 46px; padding: 0 20px; border-radius: 999px; border: 1px solid transparent; font: 600 15px/1 var(--kh-sans); text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
.kh-btn:hover { transform: translateY(-1px); }
.kh .kh-btn--sun { background: var(--kh-sun); color: #1a1214; }
.kh .kh-btn--ink { background: var(--kh-ink); color: var(--kh-bg); }
.kh .kh-btn--ghost { border-color: var(--kh-d-line); color: var(--kh-d-ink); background: rgba(255, 255, 255, .04); }

/* Sub-navigation */
.kh-subnav { position: sticky; top: var(--k-header-h, 0px); z-index: 30; background: color-mix(in srgb, var(--kh-bg) 92%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--kh-line); }
.kh-subnav .kh-wrap { display: flex; align-items: center; gap: 18px; min-height: 54px; }
.kh-subnav-brand { font: 700 15px var(--kh-serif); text-decoration: none; white-space: nowrap; color: var(--kh-red) !important; }
.kh-subnav ul { display: flex; gap: 4px; list-style: none; margin: 0 0 0 auto; padding: 0; overflow-x: auto; scrollbar-width: none; }
.kh-subnav a:not(.kh-subnav-brand) { display: inline-flex; align-items: center; min-height: 40px; padding: 0 14px; border-radius: 999px; font-weight: 600; font-size: 15px; text-decoration: none; white-space: nowrap; }
.kh-subnav a:hover { background: var(--kh-soft); }
.kh-subnav a[aria-current="page"] { background: var(--kh-ink); color: var(--kh-bg); }
@media (max-width: 640px) { .kh-subnav-brand { display: none; } .kh-subnav ul { margin-left: 0; } }

/* Hero */
.kh-hero { position: relative; isolation: isolate; overflow: hidden; padding: clamp(56px, 9vw, 120px) 0 clamp(48px, 7vw, 96px); }
.kh-hero-in { position: relative; z-index: 2; }
.kh-hero .kh-h1 { max-width: 13ch; }
.kh-pic.kh-hero-pic { position: absolute; inset: 0 0 0 auto; width: min(58%, 820px); margin: 0; z-index: 0; opacity: .5; -webkit-mask-image: linear-gradient(90deg, transparent, #000 45%); mask-image: linear-gradient(90deg, transparent, #000 45%); }
.kh-hero-pic img { width: 100%; height: 100%; object-fit: cover; filter: saturate(.85) contrast(1.05); }
.kh-hero-pic figcaption { position: absolute; right: 12px; bottom: 10px; font-size: 12px; }
.kh-hero-pic figcaption a { color: var(--kh-d-muted); }
.kh-sun { position: absolute; z-index: 1; left: -18vw; top: -24vw; width: 64vw; aspect-ratio: 1; border-radius: 50%; pointer-events: none;
	background: repeating-conic-gradient(from 0deg, rgba(246, 194, 26, .16) 0 5.5deg, transparent 5.5deg 22.5deg); -webkit-mask-image: radial-gradient(circle, #000 12%, transparent 70%); mask-image: radial-gradient(circle, #000 12%, transparent 70%); }
.kh-sun::after { content: ""; position: absolute; inset: 41%; border-radius: 50%; background: radial-gradient(circle, rgba(246, 194, 26, .5), rgba(163, 18, 26, .25) 70%, transparent); }
.kh-sun--sm { width: 44vw; left: auto; right: -12vw; top: -18vw; }
@media (prefers-reduced-motion: no-preference) { .kh-sun { animation: kh-spin 160s linear infinite; } }
@keyframes kh-spin { to { transform: rotate(360deg); } }
@media (max-width: 560px) { .kh-search--big input { min-height: 52px; font-size: 16px; } .kh-search--big .kh-btn { min-height: 52px; padding: 0 16px; } }
@media (max-width: 760px) { .kh-pic.kh-hero-pic { width: 100%; opacity: .25; -webkit-mask-image: linear-gradient(180deg, transparent, #000 60%); mask-image: linear-gradient(180deg, transparent, #000 60%); } }

.kh-search { display: flex; flex-wrap: nowrap; gap: 10px; margin-top: 22px; max-width: 720px; }
.kh-search input { flex: 1 1 auto; min-width: 0; min-height: 50px; padding: 0 18px; border-radius: 14px; border: 1px solid var(--kh-line); background: var(--kh-card); color: var(--kh-ink); font: 17px var(--kh-sans); }
.kh-dark .kh-search input { background: rgba(255, 255, 255, .08); border-color: var(--kh-d-line); color: var(--kh-d-ink); }
.kh-dark .kh-search input::placeholder { color: var(--kh-d-muted); }
.kh-search--big input { min-height: 58px; font-size: 18px; }
.kh-search--big .kh-btn { min-height: 58px; padding: 0 26px; }
.kh-stats { display: flex; flex-wrap: wrap; gap: 10px 28px; list-style: none; margin: 30px 0 0; padding: 0; color: var(--kh-d-muted); }
.kh-stats strong { display: block; font: 800 34px/1 var(--kh-display); color: var(--kh-d-ink); }
.kh-jump { display: flex; flex-wrap: wrap; gap: 8px; list-style: none; margin: 28px 0 0; padding: 0; }
.kh-jump a { display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px; border: 1px solid var(--kh-d-line); border-radius: 999px; text-decoration: none; font-weight: 600; font-size: 14px; background: rgba(255, 255, 255, .04); }
.kh-jump a:hover { border-color: var(--kh-sun); color: var(--kh-sun); }

/* Sections */
.kh-sec { padding: clamp(48px, 7vw, 96px) 0; }
.kh-sec--tight { padding: clamp(32px, 4vw, 56px) 0; }
.kh-sec-head { margin-bottom: 28px; }
.kh-sec-head--row { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 18px; }
.kh-sec-head--row > div { max-width: 760px; }

/* Era tabs */
.kh-eras { background: linear-gradient(180deg, var(--kh-d-bg), var(--kh-d-bg2)); border-top: 1px solid var(--kh-d-line); }
.kh-tabs { display: flex; gap: 8px; overflow-x: auto; padding: 4px 2px 14px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.kh-tabs [role="tab"] { flex: 0 0 auto; scroll-snap-align: start; display: grid; gap: 4px; text-align: left; min-height: 64px; padding: 10px 16px; max-width: 220px; border-radius: 14px; border: 1px solid var(--kh-d-line); background: rgba(255, 255, 255, .03); color: var(--kh-d-ink); cursor: pointer; font: 600 14px/1.25 var(--kh-sans); }
.kh-tabs [role="tab"]:hover { border-color: rgba(246, 194, 26, .6); }
.kh-tabs [role="tab"][aria-selected="true"] { background: var(--kh-sun); color: #1a1214; border-color: var(--kh-sun); }
.kh-tab-y { font-size: 12px; font-weight: 500; opacity: .75; }
.kh-panel { padding-top: 20px; }
.kh-panel[hidden] { display: none; }
.kh-no-js .kh-panel + .kh-panel, .kh-panel + .kh-panel { border-top: 1px solid var(--kh-d-line); margin-top: 32px; }
.kh-js .kh-panel + .kh-panel { border-top: 0; margin-top: 0; }
.kh-panel-intro { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(20px, 4vw, 48px); align-items: center; margin-bottom: 28px; }
.kh-panel-intro p { color: var(--kh-d-muted); font: 18px/1.6 var(--kh-serif); }
.kh-panel-y { margin: 0; color: var(--kh-sun) !important; font: 700 15px var(--kh-sans) !important; }
.kh-panel .kh-h3 { font-size: clamp(26px, 3vw, 38px); margin: 6px 0 0; }
.kh-panel-pic { margin: 0; border-radius: var(--kh-r); overflow: hidden; aspect-ratio: 4 / 3; background: var(--kh-d-bg2); position: relative; }
.kh-panel-pic img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 760px) { .kh-panel-intro { grid-template-columns: 1fr; } }

/* Pictures and credits */
.kh-pic { position: relative; }
.kh-pic figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 18px 10px 6px; font-size: 11px; line-height: 1.3; background: linear-gradient(transparent, rgba(0, 0, 0, .7)); color: #eee; opacity: 0; transition: opacity .2s; }
.kh-pic:hover figcaption, .kh-pic:focus-within figcaption { opacity: 1; }
.kh-pic figcaption a { color: #fff !important; text-decoration: none; }
@media (hover: none) { .kh-pic figcaption { opacity: 1; } }

/* Event list */
.kh-evlist { list-style: none; margin: 0; padding: 0 0 0 22px; border-left: 2px solid var(--kh-line); display: grid; gap: 22px; }
.kh-evlist--dark { border-color: var(--kh-d-line); grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); border-left: 0; padding-left: 0; gap: 14px; }
.kh-evlist--dark .kh-ev { padding: 18px 18px 18px 22px; border-radius: 14px; background: rgba(255, 255, 255, .04); border: 1px solid var(--kh-d-line); }
.kh-ev { position: relative; }
.kh-ev-dot { position: absolute; left: -30px; top: 6px; width: 14px; height: 14px; border-radius: 50%; background: var(--kh-pol); box-shadow: 0 0 0 4px var(--kh-bg); }
.kh-evlist--dark .kh-ev-dot { left: 0; top: 18px; width: 4px; height: calc(100% - 36px); border-radius: 4px; box-shadow: none; }
.kh-ev--war .kh-ev-dot { background: var(--kh-war); }
.kh-ev--church .kh-ev-dot { background: var(--kh-church); }
.kh-ev--culture .kh-ev-dot { background: var(--kh-culture); }
.kh-ev-when { margin: 0; font-size: 13px; font-weight: 600; color: var(--kh-red); letter-spacing: .02em; }
.kh-dark .kh-ev-when { color: var(--kh-sun); }
.kh-ev-kind { font-weight: 500; opacity: .85; }
.kh-ev-title { display: inline-block; margin-top: 4px; font: 700 20px/1.3 var(--kh-serif); text-decoration: none; }
.kh-ev-title:hover { text-decoration: underline; text-underline-offset: 3px; }
.kh-ev-sum { margin: 6px 0 0; color: var(--kh-muted); line-height: 1.55; font-size: 15.5px; }
.kh-dark .kh-ev-sum { color: var(--kh-d-muted); }
.kh-more { margin: 22px 0 0; }
.kh-more a, .kh-more-link { font-weight: 600; color: var(--kh-sun); }
.kh-more-link { color: var(--kh-red); display: inline-block; margin-top: 12px; }

/* River of time */
.kh-river-sec { background: var(--kh-soft); }
.kh-river { position: relative; border-radius: var(--kh-r); background: var(--kh-card); border: 1px solid var(--kh-line); padding: 14px; min-height: 120px; }
.kh-river-fallback { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 8px; }
.kh-river-fallback a { display: block; padding: 10px 12px; border-radius: 10px; background: var(--kh-soft); text-decoration: none; font-weight: 600; }
.kh-river-fallback span { display: block; font-size: 12px; color: var(--kh-muted); font-weight: 500; }
.kh-rv-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.kh-rv-zoom { display: flex; gap: 6px; flex-wrap: wrap; }
.kh-rv-zoom button, .kh-chips button { min-height: 40px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--kh-line); background: var(--kh-card); color: var(--kh-ink); font: 600 14px var(--kh-sans); cursor: pointer; }
.kh-rv-zoom button[aria-pressed="true"], .kh-chips button[aria-pressed="true"] { background: var(--kh-redbg); border-color: var(--kh-redbg); color: #fff; }
.kh-chips button span { opacity: .65; font-weight: 500; margin-left: 2px; }
.kh-dark .kh-chips button { background: transparent; color: var(--kh-d-ink); border-color: var(--kh-d-line); }
.kh-rv-legend { display: flex; flex-wrap: wrap; gap: 14px; font-size: 13px; color: var(--kh-muted); }
.kh-rv-legend i { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 6px; vertical-align: -1px; }
.kh-rv-scroll { overflow-x: auto; overscroll-behavior-x: contain; border-radius: 12px; scrollbar-width: thin; }
.kh-rv-canvas { position: relative; height: 360px; min-width: 100%; }
.kh-rv-era { position: absolute; top: 0; height: 28px; padding: 0 8px; display: flex; align-items: center; font: 600 12px var(--kh-sans); color: #fff; border-radius: 6px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; text-decoration: none; }
.kh-rv-era { background: var(--kh-redbg); }
.kh-rv-era.is-alt { background: #6f0c12; }
.kh-rv-era:hover { background: #1a1214; }
.kh-rv-lane { position: absolute; left: 0; right: 0; height: 64px; border-top: 1px dashed var(--kh-line); }
.kh-rv-lane-l { position: sticky; left: 0; display: inline-block; padding: 2px 8px; margin-top: 4px; font-size: 12px; font-weight: 600; color: var(--kh-muted); background: var(--kh-card); border-radius: 6px; z-index: 2; }
.kh-rv-pt { position: absolute; width: 16px; height: 16px; margin: -8px 0 0 -8px; border-radius: 50%; border: 2px solid var(--kh-card); background: var(--kh-pol); cursor: pointer; padding: 0; transition: transform .12s; }
.kh-rv-pt:hover, .kh-rv-pt:focus-visible, .kh-rv-pt[aria-pressed="true"] { transform: scale(1.5); z-index: 3; }
.kh-rv-pt.is-war { background: var(--kh-war); }
.kh-rv-pt.is-church { background: var(--kh-church); }
.kh-rv-pt.is-culture { background: var(--kh-culture); }
.kh-rv-axis { position: absolute; left: 0; right: 0; bottom: 0; height: 26px; border-top: 1px solid var(--kh-line); }
.kh-rv-tick { position: absolute; top: 4px; font-size: 11px; color: var(--kh-muted); white-space: nowrap; }
.kh-rv-card { display: grid; grid-template-columns: 120px minmax(0, 1fr); gap: 16px; align-items: start; margin-top: 14px; padding: 16px; border-radius: 14px; background: var(--kh-soft); min-height: 112px; }
.kh-rv-card img { width: 120px; height: 90px; object-fit: cover; border-radius: 10px; }
.kh-rv-card h3 { margin: 4px 0 6px; font: 700 20px/1.25 var(--kh-serif); }
.kh-rv-card p { margin: 0; color: var(--kh-muted); line-height: 1.5; }
.kh-rv-card .kh-ev-when { margin: 0; }
@media (max-width: 560px) { .kh-rv-card { grid-template-columns: 1fr; } .kh-rv-card img { width: 100%; height: 160px; } }

/* Map */
.kh-mapsec { background: var(--kh-d-bg2); }
.kh-map { position: relative; border-radius: var(--kh-r); overflow: hidden; background: #1b2230; border: 1px solid var(--kh-d-line); }
.kh-map--home { height: min(70vh, 620px); }
.kh-map--full { height: min(78vh, 760px); }
.kh-map--mini { height: 420px; }
.kh-map--side { height: 260px; border-radius: 12px; }
.kh-map-wait { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; color: #c3b9bb; font-size: 15px; }
.kh-map .maplibregl-canvas { outline: none; }
.kh-map-ui { position: absolute; z-index: 3; left: 12px; right: 12px; bottom: 12px; padding: 12px 14px; border-radius: 14px; background: rgba(18, 13, 14, .88); color: #f4efe8; backdrop-filter: blur(8px); }
.kh-map-ui label { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; font-weight: 600; }
.kh-map-ui label output { color: var(--kh-sun); font-weight: 700; text-align: right; }
.kh-map-ui input[type="range"] { width: 100%; accent-color: var(--kh-sun); margin: 8px 0 4px; min-height: 28px; }
.kh-map-ui .kh-map-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px; }
.kh-map-ui .kh-rv-legend { color: #c3b9bb; }
.kh-map-ui button { min-height: 36px; padding: 0 12px; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .25); background: transparent; color: #f4efe8; font: 600 13px var(--kh-sans); cursor: pointer; }
.kh-map-pin { width: 18px; height: 18px; border-radius: 50%; border: 2px solid #fff; background: var(--kh-pol); box-shadow: 0 2px 6px rgba(0, 0, 0, .5); cursor: pointer; padding: 0; }
.kh-map-pin.is-war { background: var(--kh-war); }
.kh-map-pin.is-church { background: var(--kh-church); }
.kh-map-pin.is-culture { background: var(--kh-culture); }
.kh-map-pin.is-fig { background: var(--kh-sun); border-color: #1a1214; }
.kh-map-pin.is-main { width: 24px; height: 24px; background: var(--kh-red); }
.kh .maplibregl-popup-content { border-radius: 12px; padding: 12px 14px; font: 14px/1.45 var(--kh-sans); color: #1a1214; max-width: 280px; }
.kh .maplibregl-popup-content img { width: 100%; height: 120px; object-fit: cover; border-radius: 8px; margin-bottom: 8px; }
.kh .maplibregl-popup-content b { display: block; font: 700 16px/1.3 var(--kh-serif); margin: 2px 0 4px; }
.kh .maplibregl-popup-content small { color: #a3121a; font-weight: 700; }
.kh .maplibregl-popup-content a { color: #a3121a; font-weight: 600; }
.kh .maplibregl-popup-close-button { width: 32px; height: 32px; font-size: 20px; }
.kh-maplist { margin-top: 18px; padding: 16px 18px; border-radius: 14px; border: 1px solid var(--kh-line); }
.kh-maplist summary { cursor: pointer; font-weight: 700; min-height: 32px; }
.kh-maplist ul { margin: 0 0 14px; padding-left: 20px; line-height: 1.7; }

/* People */
.kh-people { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 250px), 1fr)); gap: 16px; }
.kh-people--sm { grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: 12px; }
.kh-person { display: flex; flex-direction: column; height: 100%; border-radius: var(--kh-r); overflow: hidden; background: var(--kh-card); border: 1px solid var(--kh-line); text-decoration: none; transition: transform .15s, box-shadow .15s; }
.kh-person:hover { transform: translateY(-3px); box-shadow: 0 14px 30px rgba(26, 18, 20, .12); }
.kh-person-pic { display: block; aspect-ratio: 4 / 5; background: linear-gradient(160deg, #3a2a1e, #1a1214); overflow: hidden; }
.kh-people--sm .kh-person-pic { aspect-ratio: 1; }
.kh-person-pic img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.kh-ini { display: grid; place-items: center; height: 100%; font: 800 56px var(--kh-display); color: var(--kh-sun); }
.kh-person-body { display: grid; gap: 4px; padding: 14px 16px 16px; }
.kh-person-name { font: 700 19px/1.25 var(--kh-serif); }
.kh-person-dates { font-size: 13px; font-weight: 600; color: var(--kh-red); }
.kh-person-role { font-size: 14px; color: var(--kh-muted); line-height: 1.4; }

/* Church strip */
.kh-church { background: linear-gradient(180deg, var(--kh-bg), var(--kh-soft)); }
.kh-strip { list-style: none; margin: 0; padding: 4px 2px 18px; display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 260px); gap: 14px; overflow-x: auto; scroll-snap-type: x proximity; scrollbar-width: thin; }
.kh-strip li { scroll-snap-align: start; }
.kh-card { display: flex; flex-direction: column; height: 100%; border-radius: var(--kh-r); overflow: hidden; background: var(--kh-card); border: 1px solid var(--kh-line); text-decoration: none; }
.kh-card img, .kh-card-cross { width: 100%; height: 160px; object-fit: cover; }
.kh-card-cross { display: grid; place-items: center; font-size: 56px; color: var(--kh-church); background: #2a1d10; }
.kh-card-y { padding: 12px 14px 0; font-size: 13px; font-weight: 700; color: var(--kh-red); }
.kh-card-t { padding: 4px 14px 16px; font: 700 17px/1.3 var(--kh-serif); }

/* On this day */
.kh-otd { padding-top: 0; }
.kh-otd-in { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: 40px; padding: clamp(28px, 4vw, 48px); border-radius: 24px; background: var(--kh-card); border: 1px solid var(--kh-line); }
.kh-otd[hidden] { display: none; }
@media (max-width: 760px) { .kh-otd-in { grid-template-columns: 1fr; gap: 20px; } }

/* Research */
.kh-research { background: var(--kh-soft); }
.kh-research-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); gap: 18px; }
.kh-box { padding: 22px; border-radius: var(--kh-r); background: var(--kh-card); border: 1px solid var(--kh-line); }
.kh-box + .kh-box { margin-top: 0; }
.kh-steps { margin: 0; padding-left: 20px; line-height: 1.7; }
.kh-doclist { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.kh-doclist a { font-weight: 600; }
.kh-doclist span { display: block; font-size: 13px; color: var(--kh-muted); }
.kh-reading { margin: 0; padding-left: 20px; line-height: 1.55; display: grid; gap: 8px; }
.kh-reading cite { font-style: italic; }

/* Page heroes */
.kh-page-hero { position: relative; isolation: isolate; overflow: hidden; padding: 28px 0 clamp(40px, 6vw, 72px); min-height: 380px; display: flex; align-items: flex-end; }
.kh-page-hero-pic { position: absolute; inset: 0; margin: 0; z-index: -1; }
.kh-page-hero-pic img { width: 100%; height: 100%; object-fit: cover; }
.kh-page-hero-pic::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(18, 13, 14, .55), rgba(18, 13, 14, .78) 55%, var(--kh-d-bg)); }
.kh-page-hero-pic figcaption { z-index: 2; opacity: 1; background: none; text-align: right; }
.kh-page-hero-in { position: relative; }
.kh-page-hero .kh-lead { color: #e4dcde; }
.kh-index-hero { position: relative; overflow: hidden; isolation: isolate; padding: 28px 0 clamp(40px, 5vw, 64px); }
.kh-index-hero .kh-wrap { position: relative; z-index: 2; }
.kh-crumbs ol { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; margin: 0 0 clamp(24px, 4vw, 56px); padding: 0; font-size: 14px; color: var(--kh-d-muted); }
.kh-crumbs li + li::before { content: "/"; margin-right: 6px; opacity: .6; }
.kh-crumbs a { color: var(--kh-d-muted) !important; text-decoration: none; }
.kh-crumbs a:hover { color: var(--kh-sun) !important; }
.kh-crumbs [aria-current] { color: var(--kh-d-ink); font-weight: 600; }
.kh-tag { display: inline-block; padding: 3px 10px; border-radius: 999px; background: var(--kh-pol); color: #fff; font-size: 12px; letter-spacing: .08em; margin-right: 8px; }
.kh-tag--war { background: var(--kh-war); }
.kh-tag--church { background: var(--kh-church); color: #1a1214; }
.kh-tag--culture { background: var(--kh-culture); }

/* Figure hero */
.kh-fig-hero { padding: 28px 0 clamp(40px, 6vw, 72px); }
.kh-fig-hero-in { display: flex; flex-wrap: wrap; gap: clamp(24px, 4vw, 56px); align-items: center; }
.kh-fig-pic { flex: 0 1 360px; margin: 0; border-radius: 24px; overflow: hidden; aspect-ratio: 4 / 5; background: linear-gradient(170deg, #3a2a1e, #1a1214); border: 1px solid var(--kh-d-line); }
.kh-fig-pic img { width: 100%; height: 100%; object-fit: cover; object-position: center 20%; }
.kh-fig-pic--none { display: grid; place-items: center; font: 800 120px var(--kh-display); color: var(--kh-sun); }
.kh-fig-text { flex: 1 1 420px; min-width: 0; }
.kh-alt-name { margin: 8px 0 0; font: 400 clamp(22px, 2.6vw, 30px) var(--kh-serif); color: var(--kh-sun); }
.kh-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 18px; margin: 28px 0 0; max-width: 640px; }
.kh-facts dt { font-size: 13px; color: var(--kh-d-muted); }
.kh-facts dd { margin: 4px 0 0; font-size: 18px; font-weight: 600; }
.kh-facts a { color: var(--kh-sun) !important; }

/* Article layout */
.kh-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(280px, 360px); gap: clamp(28px, 5vw, 64px); padding-block: clamp(36px, 5vw, 64px); }
@media (max-width: 960px) { .kh-layout { grid-template-columns: 1fr; } }
.kh-side { display: grid; gap: 18px; align-content: start; }
.kh-box--sticky { position: sticky; top: calc(var(--k-header-h, 0px) + 70px); max-height: calc(100vh - 100px); overflow: auto; }
@media (max-width: 960px) { .kh-box--sticky { position: static; max-height: none; } }
.kh-prose { font: 400 clamp(18px, 1.5vw, 20px)/1.75 var(--kh-serif); max-width: 70ch; }
.kh-prose p { margin: 0 0 1.1em; }
.kh-prose h2 { margin: 1.6em 0 .5em; font: 700 clamp(24px, 2.4vw, 30px)/1.2 var(--kh-serif); scroll-margin-top: calc(var(--k-header-h, 0px) + 80px); }
.kh-prose--lead p:first-child { font-size: 1.15em; }
.kh-toc { margin: 0 0 28px; padding: 18px 22px; border-left: 4px solid var(--kh-sun); background: var(--kh-soft); border-radius: 0 14px 14px 0; }
.kh-toc-h { margin: 0 0 6px; font-weight: 700; font-size: 13px; letter-spacing: .14em; text-transform: uppercase; color: var(--kh-muted); }
.kh-toc ol { margin: 0; padding-left: 20px; line-height: 1.8; }
.kh-minitl { list-style: none; margin: 0; padding: 0 0 0 16px; border-left: 2px solid var(--kh-line); display: grid; gap: 12px; }
.kh-minitl li { position: relative; }
.kh-minitl li::before { content: ""; position: absolute; left: -22px; top: 5px; width: 10px; height: 10px; border-radius: 50%; background: var(--kh-pol); }
.kh-minitl li.kh-ev--war::before { background: var(--kh-war); }
.kh-minitl li.kh-ev--church::before { background: var(--kh-church); }
.kh-minitl li.kh-ev--culture::before { background: var(--kh-culture); }
.kh-minitl-y { display: block; font-size: 12.5px; font-weight: 700; color: var(--kh-red); }
.kh-minitl a, .kh-minitl li > span:last-child { font-size: 15px; line-height: 1.4; }
.kh-minitl .is-cur { font-weight: 700; }
.kh-era-link { display: grid; gap: 2px; margin-bottom: 14px; text-decoration: none; }
.kh-era-link span { font-size: 13px; color: var(--kh-muted); }

.kh-contested { margin: 32px 0; padding: 20px 22px; border-radius: var(--kh-r); border: 1px solid color-mix(in srgb, var(--kh-blue) 45%, transparent); background: color-mix(in srgb, var(--kh-blue) 7%, transparent); }
.kh-contested-h { margin: 0 0 6px; font: 700 13px var(--kh-sans); letter-spacing: .14em; text-transform: uppercase; color: var(--kh-blue); }
html[data-theme="dark"] .kh-contested-h { color: #8fb8ff; }
.kh-contested p { margin: 0; line-height: 1.6; }

/* Sources and citation */
.kh-refs { background: var(--kh-soft); border-top: 1px solid var(--kh-line); }
.kh-refs-grid { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: 40px; }
@media (max-width: 860px) { .kh-refs-grid { grid-template-columns: 1fr; } }
.kh-refs .kh-h3 + * { margin-bottom: 28px; }
.kh-sources { margin: 0; padding-left: 22px; line-height: 1.6; display: grid; gap: 6px; overflow-wrap: anywhere; }
.kh-cite { align-self: start; padding: 22px; border-radius: var(--kh-r); background: var(--kh-card); border: 1px solid var(--kh-line); }
.kh-cite h2 { margin: 0 0 12px; font: 700 22px var(--kh-serif); }
.kh-cite .kh-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.kh-cite-text { margin: 14px 0; padding: 14px; border-radius: 10px; background: var(--kh-soft); font: 16px/1.5 var(--kh-serif); overflow-wrap: anywhere; }
.kh-prevnext { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; margin-top: 40px; }
.kh-pn { display: grid; gap: 4px; padding: 18px; border-radius: var(--kh-r); border: 1px solid var(--kh-line); background: var(--kh-card); text-decoration: none; }
.kh-pn--next { text-align: right; }
.kh-pn:hover { border-color: var(--kh-red); }
.kh-pn-dir { font-size: 13px; font-weight: 700; color: var(--kh-red); }
.kh-pn-t { font: 700 18px/1.3 var(--kh-serif); }
.kh-pn-s { font-size: 13px; color: var(--kh-muted); }
@media (max-width: 560px) { .kh-prevnext { grid-template-columns: 1fr; } .kh-pn--next { text-align: left; } }

/* Index pages */
.kh-group { margin-bottom: 44px; }
.kh-group-y { font: 500 14px var(--kh-sans); color: var(--kh-muted); margin-left: 6px; }
.kh-group[hidden] { display: none; }
.kh-toolbar { display: grid; gap: 14px; margin-bottom: 30px; }
.kh-filter { display: grid; gap: 6px; max-width: 560px; margin-bottom: 26px; font-weight: 600; }
.kh-toolbar .kh-filter { margin: 0; }
.kh-filter input, .kh-select select { min-height: 50px; padding: 0 16px; border-radius: 14px; border: 1px solid var(--kh-line); background: var(--kh-card); color: var(--kh-ink); font: 17px var(--kh-sans); width: 100%; }
.kh-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.kh-empty { padding: 24px; border-radius: 14px; background: var(--kh-soft); }

/* Library */
.kh-lib-tools { display: grid; gap: 14px; margin-bottom: 26px; }
.kh-lib-tools .kh-search { margin-top: 0; max-width: none; }
.kh-lib-row { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; }
.kh-select select { min-width: 240px; }
.kh-lib-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(260px, 340px); gap: 36px; }
@media (max-width: 960px) { .kh-lib-grid { grid-template-columns: 1fr; } }
.kh-count { margin: 0 0 12px; color: var(--kh-muted); font-size: 14px; }
.kh-results { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.kh-res { display: flex; gap: 16px; padding: 16px; border: 1px solid var(--kh-line); border-radius: 16px; background: var(--kh-card); }
.kh-res[hidden], .kh-res.is-more { display: none; }
.kh-showmore { margin-top: 16px; }
.kh-res-pic { flex: 0 0 76px; height: 76px; border-radius: 12px; overflow: hidden; background: var(--kh-soft); display: grid; place-items: center; font: 700 26px var(--kh-serif); color: var(--kh-red); }
.kh-res-pic img { width: 100%; height: 100%; object-fit: cover; }
.kh-res-body { min-width: 0; }
.kh-res-meta { margin: 0; font-size: 12.5px; font-weight: 700; letter-spacing: .04em; color: var(--kh-muted); }
.kh-res-t { display: inline-block; margin-top: 2px; font: 700 20px/1.3 var(--kh-serif); text-decoration: none; }
.kh-res-t:hover { text-decoration: underline; }
.kh-res-s { margin: 4px 0 0; font-size: 15px; line-height: 1.5; color: var(--kh-muted); }
.kh-res-src { margin: 6px 0 0; font-size: 12.5px; color: var(--kh-red); font-weight: 600; }
.kh-res mark { background: color-mix(in srgb, var(--kh-sun) 55%, transparent); color: inherit; border-radius: 3px; }
.kh-lib details { border-top: 1px solid var(--kh-line); padding: 10px 0; }
.kh-lib details summary { cursor: pointer; font-weight: 600; min-height: 28px; }
.kh-lib details .kh-reading { margin-top: 10px; font-size: 14.5px; }
.kh-tips { margin: 0; padding-left: 20px; line-height: 1.6; font-size: 15px; }

.kh-note { margin-block: 0; padding: 28px 0 40px; font-size: 14px; color: var(--kh-muted); max-width: 900px; }

@media print {
	.kh-subnav, .kh-map, .kh-river, .kh-search, .kh-chips, .kh-cite button, .kh-jump, .kh-sun { display: none !important; }
	.kh-dark { background: #fff; color: #000; }
	.kh-page-hero-pic, .kh-hero-pic { display: none; }
}
