/* ==========================================================================
   Kungfutv child theme · design tokens, layout, typography
   Plugin blocks (.kft-*) read the same tokens.
   ========================================================================== */

:root {
	--kft-bg: #faf7f2;
	--kft-surface: #fffdf9;
	--kft-surface-2: #f6f1ea;
	--kft-text: #1d1916;
	--kft-muted: #6b6259;
	--kft-line: #e4dccf;
	--kft-ink: #14110f;
	--kft-accent: #b42318;
	--kft-accent-strong: #8f1b12;
	--kft-gold: #b7791f;
	--kft-radius: 8px;
	--kft-read: 820px;     /* comfortable line length for long text blocks */
	--kft-article: 1040px; /* single views: card, featured image and breadcrumbs share this width */
	--kft-pad: clamp(20px, 4vw, 56px);
	--kft-font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
	--kft-font-head: Georgia, "Iowan Old Style", "Times New Roman", serif;
}

@media (prefers-color-scheme: dark) {
	:root {
		--kft-bg: #121010;
		--kft-surface: #1b1817;
		--kft-surface-2: #231f1d;
		--kft-text: #ece6df;
		--kft-muted: #a89e93;
		--kft-line: #342e2a;
		--kft-ink: #0b0a09;
		--kft-accent: #ef6a5a;
		--kft-accent-strong: #ff8a7c;
		--kft-gold: #e0a84a;
	}
}

/* Base ------------------------------------------------------------------- */
body {
	background: var(--kft-bg);
	color: var(--kft-text);
	font-family: var(--kft-font);
	font-size: 18px;
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}
a { color: var(--kft-accent); text-underline-offset: 2px; }
a:hover, a:focus { color: var(--kft-accent-strong); }
h1, h2, h3, h4 { font-family: var(--kft-font-head); color: var(--kft-text); line-height: 1.25; letter-spacing: -.01em; }
h1 { font-size: clamp(30px, 4.2vw, 44px); font-weight: 700; }
h2 { font-size: clamp(24px, 3vw, 30px); font-weight: 700; margin-top: 1.6em; }
h3 { font-size: 21px; font-weight: 700; }
:focus-visible { outline: 3px solid var(--kft-gold); outline-offset: 2px; }

/* Header ----------------------------------------------------------------- */
.site-header { background: var(--kft-ink); border-bottom: 3px solid var(--kft-accent); }
.site-header .main-title a,
.site-header .main-title a:hover { color: #fff; font-family: var(--kft-font-head); font-weight: 700; letter-spacing: .02em; }
.site-description { color: #b9afa5; }
.main-navigation,
.main-navigation ul ul { background: var(--kft-ink); }
.main-navigation .main-nav ul li a,
.main-navigation .menu-toggle,
.main-navigation .menu-bar-items { color: #f1ebe4; font-weight: 600; font-size: 15px; }
.main-navigation .main-nav ul li:hover > a,
.main-navigation .main-nav ul li.current-menu-item > a,
.main-navigation .main-nav ul li.current-menu-ancestor > a { color: #fff; background: rgba(255, 255, 255, .08); }

/* Content containers ----------------------------------------------------- */
.separate-containers .inside-article,
.one-container .site-content,
.separate-containers .page-header,
.inside-page-header {
	background: var(--kft-surface);
	color: var(--kft-text);
	border-radius: var(--kft-radius);
}
.separate-containers .inside-article { border: 1px solid var(--kft-line); }

/* Single views: one centred column. Card, featured image and breadcrumbs share
   one width so their edges line up; text fills the card for a fuller page. */
.single .site-main,
.page:not(.kft-home) .site-main { max-width: var(--kft-article); margin-left: auto; margin-right: auto; }
.single .inside-article,
.page:not(.kft-home) .inside-article {
	max-width: var(--kft-article);
	margin-left: auto;
	margin-right: auto;
	padding: var(--kft-pad);
}
.single .entry-content > *,
.page .entry-content > * { max-width: 100%; }
.single .entry-title,
.page .entry-title { font-size: clamp(32px, 4.2vw, 50px); line-height: 1.12; margin-bottom: 10px; }
.single .entry-header,
.page .entry-header { margin-bottom: 28px; }

/* Featured image: same width as the card, inside it, 16:9, never offset. */
.featured-image.page-header-image-single,
.featured-image.page-header-image {
	max-width: none;
	width: 100%;
	margin: 0 0 28px;
	padding: 0;
	float: none;
}
.inside-article > .featured-image:first-child { margin-top: 0; }
.featured-image img {
	display: block;
	width: 100%;
	height: auto;
	aspect-ratio: 16 / 9;
	object-fit: cover;
	border-radius: var(--kft-radius);
}
/* Safety net if the image is printed outside the card (e.g. a GP Premium layout). */
.site > .featured-image.page-header-image,
.site-content > .featured-image.page-header-image,
body > .featured-image.page-header-image { max-width: var(--kft-article); margin: 24px auto 0; }

@media (min-width: 1200px) {
	.single .entry-content,
	.page:not(.kft-home) .entry-content { font-size: 19px; }
}
.entry-content img { border-radius: 6px; }
.entry-content blockquote { border-left: 3px solid var(--kft-gold); font-style: normal; color: var(--kft-text); }
.entry-content table { border-color: var(--kft-line); }
.entry-content th, .entry-content td { border-color: var(--kft-line); }
.entry-meta { color: var(--kft-muted); font-size: 14px; }
.featured-image img, .post-image img { border-radius: var(--kft-radius); }

/* Author box */
.kft-author {
	display: flex;
	gap: 16px;
	align-items: flex-start;
	max-width: 100%;
	margin: 36px 0 0;
	padding: 18px 20px;
	background: var(--kft-surface-2);
	border-radius: var(--kft-radius);
}
.kft-author__img { border-radius: 50%; flex: none; }
.kft-author__name { margin: 0 0 4px; font-weight: 700; }
.kft-author__bio { margin: 0; font-size: 15px; color: var(--kft-muted); }

/* Breadcrumbs */
.kft-breadcrumbs {
	max-width: var(--kft-article);
	margin: 0 auto 12px;
	font-size: 14px;
	color: var(--kft-muted);
}
.kft-breadcrumbs a { color: var(--kft-muted); text-decoration: none; }
.kft-breadcrumbs a:hover { color: var(--kft-accent); text-decoration: underline; }

/* Archives: card grid ---------------------------------------------------- */
.kft-grid .site-main {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 24px;
	align-items: start;
}
.kft-grid .site-main > :not(article) { grid-column: 1 / -1; }
.kft-grid .site-main > article { margin: 0; }
.kft-grid .inside-article { padding: 0 0 18px; overflow: hidden; height: 100%; }
.kft-grid .post-image { margin: 0 0 14px; }
.kft-grid .post-image img { border-radius: 0; aspect-ratio: 16 / 9; object-fit: cover; width: 100%; }
.kft-grid .entry-header,
.kft-grid .entry-summary,
.kft-grid footer.entry-meta { padding: 0 18px; }
.kft-grid .entry-title { font-size: 20px; margin: 0 0 6px; }
.kft-grid .entry-title a { color: var(--kft-text); text-decoration: none; }
.kft-grid .entry-title a:hover { color: var(--kft-accent); }
.kft-grid .entry-summary { font-size: 15px; color: var(--kft-muted); }
.kft-grid .entry-summary p { margin-bottom: 0; }
.kft-grid .page-header { padding: 28px 32px; }
.kft-grid .page-header h1 { margin-bottom: 4px; }
.kft-grid .paging-navigation { padding: 8px 0; }

@media (max-width: 1024px) {
	.kft-grid .site-main { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
	body { font-size: 17px; }
	.kft-grid .site-main { grid-template-columns: 1fr; gap: 16px; }
	.separate-containers .inside-article { padding: 22px 18px; }
	.single .site-content, .page:not(.kft-home) .site-content { padding-left: 12px; padding-right: 12px; }
	.kft-grid .inside-article { padding: 0 0 16px; }
}

/* Footer ----------------------------------------------------------------- */
.site-info { background: var(--kft-ink); color: #b9afa5; font-size: 14px; }
.site-info a { color: #f1ebe4; }
.kft-footer-nav { margin-bottom: 8px; }
.kft-footer-menu { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px 18px; }
.kft-footer-menu a { text-decoration: none; }
.kft-footer-menu a:hover { text-decoration: underline; }

/* Forms ------------------------------------------------------------------ */
input[type="text"], input[type="search"], input[type="email"], select, textarea {
	background: var(--kft-surface);
	color: var(--kft-text);
	border: 1px solid var(--kft-line);
	border-radius: 6px;
}
button, .button, input[type="submit"] {
	background: var(--kft-accent);
	color: #fff;
	border-radius: 6px;
}
button:hover, .button:hover, input[type="submit"]:hover { background: var(--kft-accent-strong); color: #fff; }
