/*
Theme Name: KnitHeaven
Theme URI: https://knitheaven.com
Author: KnitHeaven
Description: A colorful theme for the KnitHeaven vintage needlework library. Craft sections, pattern pages, book chapters, a library shelf, a glossary, and fiber events.
Version: 1.0.0
Requires at least: 6.2
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: knitheaven
*/

:root {
	--kh-plum: #3B1F4A;
	--kh-red: #C8442E;
	--kh-ink: #24182B;
	--kh-text: #4A3D52;
	--kh-teal: #1F6F6B;
	--kh-teal-dark: #185A57;
	--kh-gold: #F2B33D;
	--kh-pink: #F4B6B0;
	--kh-cream: #FFF8EC;
	--kh-white: #FFFFFF;
	--kh-darkred: #8E2A1C;
	--kh-line: #E6DCCB;
	--kh-display: 'Fraunces', Georgia, serif;
	--kh-body: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
	--kh-max: 1240px;
}

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

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

body {
	margin: 0;
	background: var(--kh-cream);
	color: var(--kh-ink);
	font-family: var(--kh-body);
	font-size: 18px;
	line-height: 1.6;
	overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }

a { color: var(--kh-plum); }
a:hover, a:focus { color: var(--kh-red); }

.screen-reader-text {
	position: absolute !important;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px);
	white-space: nowrap;
}
.screen-reader-text:focus {
	clip: auto; width: auto; height: auto;
	position: fixed !important; top: 8px; left: 8px; z-index: 1000;
	background: var(--kh-gold); color: var(--kh-ink); padding: 12px 18px; border-radius: 8px;
}

.kh-wrap { max-width: var(--kh-max); margin: 0 auto; padding: 0 24px; }

/* ---------- Yarn stripe ---------- */
.kh-stripe {
	height: 14px;
	background: repeating-linear-gradient(90deg, var(--kh-red) 0 60px, var(--kh-gold) 60px 120px, var(--kh-teal) 120px 180px, var(--kh-pink) 180px 240px, var(--kh-plum) 240px 300px);
}
.kh-stripe--thin { height: 10px; }

/* ---------- Headings ---------- */
.kh-display, .kh-h1, .kh-h2, .kh-h3 {
	font-family: var(--kh-display);
	font-weight: 900;
	letter-spacing: -0.02em;
	margin: 0;
}
.kh-h1 { font-size: clamp(48px, 8vw, 104px); line-height: 0.95; }
.kh-h2 { font-size: clamp(36px, 5vw, 56px); line-height: 1.02; color: var(--kh-plum); }
.kh-h3 { font-size: clamp(24px, 3vw, 32px); line-height: 1.1; }
.kh-h1 em, .kh-h2 em, .kh-h3 em { font-style: italic; font-weight: 400; color: var(--kh-accent, var(--kh-red)); }

.kh-eyebrow {
	display: inline-block;
	margin: 0 0 16px;
	font-size: 15px;
	font-weight: 700;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.kh-eyebrow--dashed { padding: 6px 16px; border: 2px dashed currentColor; border-radius: 999px; }

.kh-lead { font-size: 21px; max-width: 640px; margin: 0; }

.kh-section { padding: 88px 0; }
.kh-section--tight { padding: 48px 0; }
.kh-section-head {
	display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end;
	gap: 16px; margin-bottom: 36px;
}
.kh-section-head p { margin: 0; max-width: 420px; color: var(--kh-text); }

/* ---------- Buttons ---------- */
.kh-btn {
	display: inline-flex; align-items: center; justify-content: center;
	min-height: 52px; padding: 0 26px;
	border-radius: 999px; border: 3px solid transparent;
	font-family: var(--kh-body); font-size: 17px; font-weight: 700;
	text-decoration: none; cursor: pointer; line-height: 1.2;
}
.kh-btn--gold { background: var(--kh-gold); color: var(--kh-ink); box-shadow: 5px 5px 0 var(--kh-ink); }
.kh-btn--plum { background: var(--kh-plum); color: var(--kh-cream); }
.kh-btn--red { background: var(--kh-red); color: var(--kh-cream); box-shadow: 5px 5px 0 var(--kh-plum); }
.kh-btn--teal { background: var(--kh-teal); color: var(--kh-cream); }
.kh-btn--outline { border-color: currentColor; background: transparent; color: inherit; }
.kh-btn:hover, .kh-btn:focus { filter: brightness(1.08); color: inherit; }
.kh-btn--gold:hover, .kh-btn--gold:focus { color: var(--kh-ink); }
.kh-btn--plum:hover, .kh-btn--red:hover, .kh-btn--teal:hover,
.kh-btn--plum:focus, .kh-btn--red:focus, .kh-btn--teal:focus { color: var(--kh-cream); }
.kh-btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* ---------- Header ---------- */
.kh-header { background: var(--kh-plum); color: var(--kh-cream); }
.kh-header__top {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between;
	gap: 16px; padding-top: 18px; padding-bottom: 18px;
}
.kh-brand { display: flex; align-items: center; gap: 14px; color: var(--kh-cream); text-decoration: none; }
.kh-brand:hover, .kh-brand:focus { color: var(--kh-cream); }
.kh-brand__logo img { max-height: 64px; width: auto; }
.kh-brand__text { display: flex; flex-direction: column; }
.kh-brand__name { font-family: var(--kh-display); font-size: 32px; font-weight: 900; line-height: 1; }
.kh-brand__name em { font-style: italic; color: var(--kh-gold); }
.kh-brand__tag { font-size: 13px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--kh-pink); }

.kh-search { display: flex; }
.kh-search input[type="search"] {
	font: inherit; font-size: 16px; min-height: 48px; width: 280px; max-width: 55vw;
	padding: 0 18px; border: 0; border-radius: 999px 0 0 999px;
	background: var(--kh-cream); color: var(--kh-ink);
}
.kh-search button {
	font: inherit; font-size: 16px; font-weight: 700; min-height: 48px; padding: 0 22px;
	border: 0; border-radius: 0 999px 999px 0; background: var(--kh-gold); color: var(--kh-ink); cursor: pointer;
}

.kh-nav { border-top: 1px solid #5A3A6B; }
.kh-nav ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; align-items: center; gap: 4px 28px; }
.kh-nav li { margin: 0; }
.kh-nav a { display: inline-block; color: var(--kh-cream); text-decoration: none; font-weight: 600; padding: 12px 0; }
.kh-nav a:hover, .kh-nav a:focus { color: var(--kh-gold); }
.kh-nav .current-menu-item > a, .kh-nav .current-cat > a, .kh-nav .current_page_item > a, .kh-nav a[aria-current="page"] {
	color: var(--kh-gold); text-decoration: underline; text-underline-offset: 6px;
}
.kh-nav .kh-pill > a {
	background: var(--kh-gold); color: var(--kh-ink); padding: 6px 16px; margin: 6px 0; border-radius: 999px; font-weight: 700; text-decoration: none;
}
.kh-nav ul ul { display: none; }

/* ---------- Welcome banner for forwarded domains ---------- */
.kh-banner { background: var(--kh-gold); color: var(--kh-ink); border-bottom: 3px solid var(--kh-ink); }
.kh-banner .kh-wrap { display: flex; flex-wrap: wrap; gap: 8px 16px; padding-top: 14px; padding-bottom: 14px; }
.kh-banner strong { font-weight: 700; }

/* ---------- Hero ---------- */
.kh-hero { position: relative; overflow: hidden; background: var(--kh-bg, var(--kh-red)); color: var(--kh-fg, var(--kh-cream)); }
.kh-hero__motif { position: absolute; right: -120px; top: -80px; width: 560px; max-width: 70vw; opacity: 0.2; pointer-events: none; }
.kh-hero__motif svg { width: 100%; height: auto; display: block; }
.kh-hero__inner { position: relative; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; padding-top: 80px; padding-bottom: 96px; }
.kh-hero__text { flex: 1 1 560px; min-width: 0; }
.kh-hero__text .kh-lead { margin-bottom: 32px; }
.kh-hero__text .kh-h1 { margin-bottom: 24px; }
.kh-hero__photo { flex: 1 1 360px; min-width: 0; margin: 0; position: relative; }
.kh-polaroid {
	background: var(--kh-cream); padding: 16px 16px 56px; transform: rotate(3deg);
	box-shadow: 12px 14px 0 var(--kh-plum); position: relative; color: var(--kh-plum);
}
.kh-polaroid img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.kh-polaroid figcaption {
	position: absolute; left: 16px; right: 16px; bottom: 14px; text-align: center;
	font-family: var(--kh-display); font-style: italic; font-size: 19px;
}
.kh-badge {
	position: absolute; top: -26px; left: -26px; width: 116px; height: 116px; border-radius: 50%;
	background: var(--kh-teal); color: var(--kh-cream); display: flex; align-items: center; justify-content: center;
	text-align: center; font-weight: 700; font-size: 15px; line-height: 1.2; transform: rotate(-12deg);
	border: 3px dashed var(--kh-gold); padding: 10px;
}
.kh-placeholder {
	display: flex; align-items: center; justify-content: center; text-align: center; padding: 24px;
	background: repeating-linear-gradient(45deg, var(--kh-pink) 0 14px, #FBD3CD 14px 28px);
	color: var(--kh-plum); font-weight: 600; font-size: 16px; aspect-ratio: 1 / 1;
}
.kh-crumbs { margin: 0 0 16px; font-size: 15px; }
.kh-crumbs a { color: inherit; }

/* ---------- Marquee band ---------- */
.kh-band {
	background: var(--kh-gold); color: var(--kh-plum);
	border-top: 3px solid var(--kh-plum); border-bottom: 3px solid var(--kh-plum);
	padding: 14px 0; white-space: nowrap; overflow: hidden;
	font-family: var(--kh-display); font-size: 28px; font-weight: 700; font-style: italic;
}

/* ---------- Craft tiles ---------- */
.kh-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.kh-tile {
	position: relative; overflow: hidden; display: flex; flex-direction: column; gap: 10px;
	min-height: 240px; padding: 30px; border-radius: 22px; text-decoration: none;
	background: var(--kh-bg); color: var(--kh-fg);
}
.kh-tile:hover, .kh-tile:focus { color: var(--kh-fg); transform: translateY(-3px); }
.kh-tile--outline { border: 3px solid var(--kh-plum); }
.kh-tile__name { font-family: var(--kh-display); font-size: 40px; font-weight: 900; line-height: 1.05; position: relative; }
.kh-tile__desc { font-size: 17px; max-width: 290px; position: relative; opacity: 0.92; }
.kh-tile__more { margin-top: auto; font-weight: 700; color: var(--kh-accent); position: relative; }
.kh-tile__motif { position: absolute; right: -14px; bottom: -14px; width: 150px; height: 150px; opacity: 0.35; }
.kh-tile__motif svg { width: 100%; height: 100%; }

/* ---------- Featured pattern ---------- */
.kh-feature { background: var(--kh-teal); color: var(--kh-cream); }
.kh-scallop { height: 18px; background: radial-gradient(circle at 9px 0, var(--kh-cream) 8px, transparent 9px) 0 0 / 18px 18px repeat-x; }
.kh-feature__inner { display: flex; flex-wrap: wrap; gap: 64px; align-items: center; padding-top: 80px; padding-bottom: 96px; }
.kh-feature__media { flex: 1 1 400px; min-width: 0; position: relative; }
.kh-feature__media img, .kh-feature__media .kh-placeholder {
	width: 100%; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 50%; border: 10px dashed var(--kh-gold);
}
.kh-feature__media .kh-placeholder { background: repeating-radial-gradient(circle, #2A8580 0 12px, #23797A 12px 24px); color: var(--kh-cream); padding: 60px; }
.kh-stamp {
	position: absolute; bottom: 10px; right: 0; padding: 14px 22px; background: var(--kh-red); color: var(--kh-cream);
	font-weight: 700; font-size: 16px; letter-spacing: 0.08em; text-transform: uppercase;
	transform: rotate(-6deg); border: 3px solid var(--kh-cream); border-radius: 6px;
}
.kh-feature__text { flex: 1 1 460px; min-width: 0; }
.kh-feature__text .kh-h2 { color: var(--kh-cream); margin-bottom: 20px; --kh-accent: var(--kh-pink); }
.kh-feature__text p { color: #E2F2F0; font-size: 19px; }

/* ---------- Bookshelf ---------- */
.kh-shelf-scroll { overflow-x: auto; }
.kh-shelf { display: flex; align-items: flex-end; gap: 10px; min-width: 760px; padding: 0 8px; border-bottom: 18px solid #8A5A3B; }
.kh-spine {
	flex: 1 1 0; max-width: 150px; display: flex; flex-direction: column; align-items: center; justify-content: space-between;
	padding: 22px 0; border-radius: 6px 6px 0 0; text-decoration: none;
	background: var(--kh-bg); color: var(--kh-fg); border-top: 10px solid var(--kh-accent);
}
.kh-spine:hover, .kh-spine:focus { color: var(--kh-fg); transform: translateY(-6px); }
.kh-spine__title { writing-mode: vertical-rl; transform: rotate(180deg); font-family: var(--kh-display); font-size: 22px; font-weight: 700; max-height: 85%; overflow: hidden; }
.kh-spine__year { font-size: 14px; font-weight: 700; }

/* ---------- Ad slots ---------- */
.kh-ad { margin: 40px auto; text-align: center; }
.kh-ad:empty { display: none; }

/* ---------- Events ---------- */
.kh-events { background: var(--kh-plum); color: var(--kh-cream); }
.kh-events .kh-h2 { color: var(--kh-cream); --kh-accent: var(--kh-pink); }
.kh-tickets { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 24px; }
.kh-ticket { display: flex; background: var(--kh-cream); color: var(--kh-ink); border-radius: 16px; overflow: hidden; text-decoration: none; }
.kh-ticket:hover, .kh-ticket:focus { color: var(--kh-ink); }
.kh-ticket__date {
	flex: 0 0 104px; display: flex; flex-direction: column; align-items: center; justify-content: center;
	background: var(--kh-bg, var(--kh-red)); color: var(--kh-fg, var(--kh-cream)); border-right: 4px dashed var(--kh-cream); padding: 16px 0;
}
.kh-ticket__month { font-family: var(--kh-display); font-size: 34px; font-weight: 900; line-height: 1; text-transform: uppercase; }
.kh-ticket__body { padding: 22px; display: flex; flex-direction: column; gap: 4px; }
.kh-ticket__name { font-family: var(--kh-display); font-size: 23px; font-weight: 700; line-height: 1.2; color: var(--kh-plum); }
.kh-ticket__where { font-size: 16px; color: var(--kh-text); }

/* ---------- Glossary cards ---------- */
.kh-cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 22px; margin: 0; }
.kh-card-term { padding: 24px; background: var(--kh-white); border-top: 10px solid var(--kh-accent); border-radius: 6px; box-shadow: 6px 6px 0 var(--kh-shadow); }
.kh-card-term:nth-child(odd) { transform: rotate(-1.5deg); }
.kh-card-term:nth-child(even) { transform: rotate(1.2deg); }
.kh-card-term dt { font-family: var(--kh-display); font-weight: 900; font-size: 28px; color: var(--kh-plum); }
.kh-card-term dd { margin: 6px 0 0; font-size: 17px; color: var(--kh-text); }

/* ---------- Newsletter ---------- */
.kh-news { background: var(--kh-gold); border-top: 3px solid var(--kh-plum); }
.kh-news .kh-wrap { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; justify-content: space-between; padding-top: 64px; padding-bottom: 64px; }

/* ---------- Footer ---------- */
.kh-footer { background: var(--kh-ink); color: #E6DDE9; }
.kh-footer__inner { display: flex; flex-wrap: wrap; gap: 32px; justify-content: space-between; padding-top: 48px; padding-bottom: 40px; }
.kh-footer__about { flex: 1 1 340px; min-width: 0; }
.kh-footer__about p { margin: 0; font-size: 16px; }
.kh-footer__about .kh-footer__name { font-family: var(--kh-display); font-size: 32px; font-weight: 900; color: var(--kh-cream); margin: 0 0 10px; line-height: 1.1; }
.kh-footer__name em { font-style: italic; color: var(--kh-gold); }
.kh-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 12px 28px; }
.kh-footer a { color: var(--kh-cream); }
.kh-footer a:hover, .kh-footer a:focus { color: var(--kh-gold); }
.kh-footer__copy { margin: 0; padding: 16px 0; font-size: 14px; color: #C9BFCC; }

/* ---------- Cards grid (archives) ---------- */
.kh-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 24px; }
.kh-card {
	display: flex; flex-direction: column; background: var(--kh-white); border-radius: 18px; overflow: hidden;
	text-decoration: none; color: var(--kh-ink); border: 1px solid var(--kh-line);
}
.kh-card:hover, .kh-card:focus { color: var(--kh-ink); box-shadow: 6px 6px 0 var(--kh-gold); }
.kh-card__img { aspect-ratio: 1 / 1; overflow: hidden; background: var(--kh-bg, var(--kh-teal)); color: var(--kh-cream); display: flex; align-items: center; justify-content: center; }
.kh-card__img img { width: 100%; height: 100%; object-fit: cover; }
.kh-card__img svg { width: 55%; height: auto; opacity: 0.5; }
.kh-card__body { padding: 18px; display: flex; flex-direction: column; gap: 4px; }
.kh-card__meta { font-size: 13px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--kh-red); }
.kh-card__title { font-family: var(--kh-display); font-size: 22px; font-weight: 700; line-height: 1.2; color: var(--kh-plum); }
.kh-card__excerpt { font-size: 16px; color: var(--kh-text); }
.kh-empty { padding: 32px; background: var(--kh-white); border: 3px dashed var(--kh-line); border-radius: 18px; text-align: center; color: var(--kh-text); }

.kh-pagination { margin-top: 40px; display: flex; flex-wrap: wrap; gap: 10px; }
.kh-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center; min-width: 48px; min-height: 48px; padding: 0 14px;
	border: 3px solid var(--kh-ink); border-radius: 999px; text-decoration: none; font-weight: 700; color: var(--kh-ink); background: var(--kh-white);
}
.kh-pagination .current { background: var(--kh-ink); color: var(--kh-cream); }

/* ---------- Single pattern ---------- */
.kh-post-head { background: var(--kh-gold); border-bottom: 3px solid var(--kh-ink); }
.kh-post-head .kh-wrap { display: flex; flex-wrap: wrap; gap: 32px; align-items: flex-end; padding-top: 48px; padding-bottom: 56px; }
.kh-post-head__text { flex: 1 1 640px; min-width: 0; }
.kh-post-head .kh-h1 { font-size: clamp(42px, 6vw, 72px); color: var(--kh-ink); margin-bottom: 12px; }
.kh-subtitle { margin: 0; font-family: var(--kh-display); font-style: italic; font-size: 24px; color: #3B2A12; }
.kh-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.kh-tag { font-size: 14px; font-weight: 700; padding: 4px 14px; border-radius: 999px; background: var(--kh-cream); color: var(--kh-ink); border: 2px solid var(--kh-ink); text-decoration: none; }
.kh-tag--dark { background: var(--kh-plum); color: var(--kh-cream); border-color: var(--kh-plum); }
.kh-tag:hover, .kh-tag:focus { color: var(--kh-red); }
.kh-tag--dark:hover, .kh-tag--dark:focus { color: var(--kh-gold); }
.kh-post-hero { margin: 56px auto 0; }
.kh-post-hero img { width: 100%; max-height: 640px; object-fit: cover; border-radius: 22px; border: 3px solid var(--kh-ink); }

.kh-entry { max-width: 860px; margin: 0 auto; padding: 56px 24px 72px; }
.kh-entry > * { margin-top: 0; margin-bottom: 1.2em; }
.kh-entry h2, .kh-entry h3, .kh-entry h4 { font-family: var(--kh-display); color: var(--kh-plum); line-height: 1.1; margin-top: 1.6em; margin-bottom: 0.5em; }
.kh-entry h2 { font-size: 40px; font-weight: 900; }
.kh-entry h3 { font-size: 28px; font-weight: 900; }
.kh-entry h4 { font-size: 22px; font-weight: 700; }
.kh-entry p, .kh-entry li { color: #33283A; }
.kh-entry img { border-radius: 14px; }
.kh-entry figure { margin-left: 0; margin-right: 0; }
.kh-entry figcaption { font-size: 15px; color: var(--kh-text); text-align: center; font-style: italic; margin-top: 8px; }
.kh-entry blockquote { margin: 1.5em 0; padding: 20px 28px; background: var(--kh-white); border-left: 8px solid var(--kh-red); border-radius: 6px; font-family: var(--kh-display); font-size: 20px; }
.kh-entry table { width: 100%; border-collapse: collapse; background: var(--kh-white); font-size: 17px; }
.kh-entry th { background: var(--kh-teal); color: var(--kh-cream); text-align: left; padding: 12px 16px; }
.kh-entry td { padding: 12px 16px; border-bottom: 1px solid var(--kh-line); }
.kh-entry .wp-block-table { overflow-x: auto; }
.kh-entry .alignwide { max-width: 1200px; margin-left: calc(50% - min(600px, 50vw - 24px)); margin-right: calc(50% - min(600px, 50vw - 24px)); }
.kh-entry .wp-block-columns { display: flex; flex-wrap: wrap; gap: 28px; align-items: stretch !important; margin-bottom: 28px; }
.kh-entry .wp-block-column { flex: 1 1 320px !important; min-width: 0; }
.kh-entry .wp-block-column > .kh-box { height: 100%; margin-bottom: 0; }
.kh-entry .wp-block-button__link { display: inline-flex; align-items: center; min-height: 52px; padding: 0 26px; border-radius: 999px; background: var(--kh-plum); color: var(--kh-cream); font-weight: 700; text-decoration: none; }

/* Boxes used by the KnitHeaven block patterns */
.kh-box { padding: 28px 32px; border-radius: 22px; margin-bottom: 28px; position: relative; }
.kh-box > :first-child { margin-top: 0; }
.kh-box > :last-child { margin-bottom: 0; }
.kh-box h2, .kh-box h3 { margin-top: 0; }
.kh-box--glance { background: var(--kh-white); border: 3px solid var(--kh-ink); box-shadow: 8px 8px 0 var(--kh-teal); }
.kh-box--note { background: var(--kh-pink); }
.kh-box--note p { color: #3D1F1A; }
.kh-box--original { background: #FFFDF6; border: 3px solid var(--kh-ink); }
.kh-box--original p { font-family: var(--kh-display); font-size: 19px; line-height: 1.7; }
.kh-box--modern { background: var(--kh-white); border: 3px solid var(--kh-ink); box-shadow: 8px 8px 0 var(--kh-gold); }
.kh-box--teal { background: var(--kh-teal); }
.kh-box--teal h2, .kh-box--teal h3 { color: var(--kh-gold); }
.kh-box--teal p, .kh-box--teal li { color: #E2F2F0; }
.kh-box--gold { background: var(--kh-gold); border: 3px solid var(--kh-ink); }
.kh-box--gold h2, .kh-box--gold h3 { color: var(--kh-ink); }
.kh-box--gold p { color: var(--kh-ink); }

.kh-fix-box { margin-top: 8px; padding: 28px; background: var(--kh-teal-dark); color: var(--kh-cream); border-radius: 22px; }
.kh-fix-box h2 { font-family: var(--kh-display); font-size: 26px; font-weight: 900; color: var(--kh-gold); margin: 0 0 8px; }
.kh-fix-box p { color: var(--kh-cream); margin: 0 0 18px; }

.kh-print { font: inherit; font-size: 17px; font-weight: 700; min-height: 52px; padding: 0 24px; border: 0; border-radius: 999px; background: var(--kh-plum); color: var(--kh-cream); box-shadow: 4px 4px 0 var(--kh-ink); cursor: pointer; }

/* ---------- Pages and books ---------- */
.kh-page-head { background: var(--kh-bg, var(--kh-pink)); color: var(--kh-fg, var(--kh-plum)); border-bottom: 3px solid var(--kh-ink); }
.kh-page-head .kh-wrap { padding-top: 64px; padding-bottom: 72px; }
.kh-page-head .kh-h1 { font-size: clamp(44px, 7vw, 88px); }
.kh-page-head .kh-lead { margin-top: 16px; }

.kh-book-bar { background: var(--kh-teal); color: var(--kh-cream); border-bottom: 3px solid var(--kh-ink); }
.kh-book-bar .kh-wrap { display: flex; flex-wrap: wrap; gap: 28px; align-items: center; padding-top: 36px; padding-bottom: 40px; }
.kh-book-bar__spine { flex: 0 0 72px; height: 100px; background: var(--kh-gold); border-top: 10px solid var(--kh-red); border-radius: 4px; box-shadow: 6px 6px 0 var(--kh-ink); }
.kh-book-bar__title { flex: 1 1 420px; min-width: 0; }
.kh-book-bar__title a { color: var(--kh-cream); text-decoration: none; }
.kh-book-bar__name { margin: 0; font-family: var(--kh-display); font-size: 38px; font-weight: 900; line-height: 1.05; }
.kh-book-bar__sub { margin: 4px 0 0; font-family: var(--kh-display); font-style: italic; font-size: 20px; color: #E2F2F0; }
.kh-progress { flex: 1 1 240px; min-width: 0; }
.kh-progress p { margin: 0 0 8px; font-size: 15px; font-weight: 700; }
.kh-progress__bar { height: 14px; background: var(--kh-teal-dark); border-radius: 999px; overflow: hidden; border: 2px solid var(--kh-cream); }
.kh-progress__bar span { display: block; height: 100%; background: var(--kh-gold); }

.kh-book { display: flex; flex-wrap: wrap; gap: 40px; align-items: flex-start; padding-top: 48px; padding-bottom: 72px; }
.kh-toc { flex: 1 1 260px; min-width: 0; padding: 24px; background: var(--kh-white); border: 3px solid var(--kh-ink); border-radius: 20px; }
.kh-toc__title { margin: 0 0 12px; font-family: var(--kh-display); font-size: 24px; font-weight: 900; color: var(--kh-plum); }
.kh-toc ol { margin: 0; padding-left: 26px; display: flex; flex-direction: column; gap: 6px; font-size: 16px; max-height: 520px; overflow-y: auto; }
.kh-toc .is-current a { color: var(--kh-red); font-weight: 700; }
.kh-book__main { flex: 999 1 640px; min-width: 0; }
.kh-book__main .kh-entry { padding: 0; max-width: none; }
.kh-book__main .kh-entry p { font-family: var(--kh-display); font-size: 20px; line-height: 1.75; }
.kh-book__kicker { margin: 0 0 6px; font-size: 15px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase; color: var(--kh-red); }
.kh-book__main .kh-h1 { font-size: clamp(38px, 5vw, 58px); color: var(--kh-plum); margin-bottom: 24px; }
.kh-prevnext { display: flex; flex-wrap: wrap; gap: 16px; justify-content: space-between; margin-top: 36px; }
.kh-prevnext a {
	flex: 1 1 260px; display: flex; flex-direction: column; padding: 20px 24px; border: 3px solid var(--kh-ink);
	border-radius: 18px; background: var(--kh-white); text-decoration: none; color: var(--kh-ink);
}
.kh-prevnext a span { font-size: 14px; font-weight: 700; color: var(--kh-teal); }
.kh-prevnext a strong { font-family: var(--kh-display); font-size: 22px; }
.kh-prevnext a.kh-next { align-items: flex-end; text-align: right; background: var(--kh-plum); color: var(--kh-cream); border-color: var(--kh-plum); box-shadow: 6px 6px 0 var(--kh-gold); }
.kh-prevnext a.kh-next span { color: var(--kh-pink); }
.kh-chapters { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; padding: 0; list-style: none; }
.kh-chapters a { display: block; padding: 16px 20px; background: var(--kh-white); border: 2px solid var(--kh-ink); border-radius: 14px; text-decoration: none; font-weight: 600; }

/* ---------- Library ---------- */
.kh-library-hero { background: #8A5A3B; color: var(--kh-cream); position: relative; }
.kh-library-hero::before { content: ""; position: absolute; inset: 0; background: repeating-linear-gradient(0deg, rgba(36,24,43,0) 0 118px, rgba(36,24,43,0.35) 118px 132px); }
.kh-library-hero .kh-wrap { position: relative; padding-top: 80px; padding-bottom: 88px; }
.kh-books { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: 22px; }
.kh-book-card { display: flex; gap: 18px; padding: 20px; background: var(--kh-white); border: 3px solid var(--kh-ink); border-radius: 18px; text-decoration: none; color: var(--kh-ink); box-shadow: 6px 6px 0 var(--kh-bg); }
.kh-book-card:hover, .kh-book-card:focus { color: var(--kh-ink); transform: translateY(-3px); }
.kh-book-card__spine { flex: 0 0 64px; height: 92px; background: var(--kh-bg); border-top: 8px solid var(--kh-accent); border-radius: 3px; }
.kh-book-card__title { display: block; font-family: var(--kh-display); font-size: 22px; font-weight: 900; line-height: 1.15; color: var(--kh-plum); }
.kh-book-card__sub { display: block; font-size: 15px; color: var(--kh-text); }

/* ---------- Vintage Terms glossary page ---------- */
.kh-page-vintage-terms .kh-entry h3 {
	margin: 28px 0 4px; padding: 14px 20px 0; font-size: 26px;
	background: var(--kh-white); border-left: 8px solid var(--kh-red); border-radius: 6px 6px 0 0;
}
.kh-page-vintage-terms .kh-entry h3 + p {
	margin-top: 0; padding: 0 20px 16px; background: var(--kh-white); border-left: 8px solid var(--kh-red); border-radius: 0 0 6px 6px;
}
.kh-page-vintage-terms .kh-entry h3:nth-of-type(3n+2), .kh-page-vintage-terms .kh-entry h3:nth-of-type(3n+2) + p { border-left-color: var(--kh-teal); }
.kh-page-vintage-terms .kh-entry h3:nth-of-type(3n), .kh-page-vintage-terms .kh-entry h3:nth-of-type(3n) + p { border-left-color: var(--kh-gold); }

/* ---------- 404 and search ---------- */
.kh-404 { text-align: center; padding: 96px 24px; }

/* ---------- WordPress core classes ---------- */
.alignleft { float: left; margin: 0 24px 16px 0; }
.alignright { float: right; margin: 0 0 16px 24px; }
.aligncenter { margin-left: auto; margin-right: auto; }
.wp-caption-text { font-size: 15px; color: var(--kh-text); }
.sticky, .gallery-caption, .bypostauthor { }

/* ---------- Small screens ---------- */
@media (max-width: 720px) {
	body { font-size: 17px; }
	.kh-section { padding: 64px 0; }
	.kh-hero__inner { padding-top: 56px; padding-bottom: 72px; gap: 48px; }
	.kh-badge { left: -8px; top: -30px; width: 96px; height: 96px; font-size: 13px; }
	.kh-tile { min-height: 200px; }
	.kh-tile__name { font-size: 34px; }
	.kh-box { padding: 22px; }
	.kh-search input[type="search"] { width: 200px; }
	.kh-ticket__date { flex-basis: 88px; }
}

/* ---------- Printing a pattern ---------- */
@media print {
	.kh-stripe, .kh-header, .kh-footer, .kh-ad, .kh-print, .kh-banner, .kh-fix-box, .kh-related, .kh-post-actions, .kh-toc, .kh-prevnext { display: none !important; }
	body { background: #fff; font-size: 12pt; }
	.kh-post-head { background: #fff; border: 0; }
	.kh-box { box-shadow: none !important; border: 1px solid #999; }
	a { color: #000; text-decoration: none; }
}
