/**
 * Kin & Folk — theme chrome. Typography, prose, blog, forms — chrome lives in chrome.css (ported verbatim from the approved design), prose,
 * blog, 404, forms. Everything reads from tokens.css.
 */

/* ── Base ─────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
	margin: 0;
	background: var(--kf-bg);
	color: var(--kf-text);
	font-family: var(--kf-font-sans);
	font-size: var(--kf-text-base);
	line-height: 1.65;
	-webkit-font-smoothing: antialiased;
}
/* v2.3.0 — BASE ELEMENT DEFAULTS ARE :where()-SCOPED.
 * These were plain element selectors, which is specificity (0,0,1) —
 * enough to tie or beat parts of a single-class section rule depending
 * on source order, and the package's stylesheet is enqueued BEFORE this
 * file. That is how `img { height:auto }` reaches inside a section's
 * cover-fitted media box, and how `a { color: … }` reaches a button's
 * label. Wrapped in :where() they carry ZERO specificity: a plain
 * element still gets the default, and any component class wins cleanly
 * without needing !important to do it. */
:where(img) { max-width: 100%; height: auto; display: block; }
:where(a) { color: var(--kf-primary); text-decoration-thickness: 1px; text-underline-offset: 3px; }
:where(a:hover) {
	/* v2.8.0 — was var(--kf-secondary) = crema, a pale sandy gold. That is the
	   "creamy" hover the client flagged: on cream paper it reads as the link
	   FADING on hover rather than responding. Terracotta is the accent now, so
	   hover deepens it instead. color-mix has a plain fallback for old engines. */
	color: #86604B;
	color: color-mix(in srgb, var(--kf-espresso) 82%, #000);
}
/* v2.5.0 — h5/h6 added: the base rule only ever covered h1-h4, so those two
   sat on the body sans and would have been the one place a heading did not
   take the new display face. */
:where(h1, h2, h3, h4, h5, h6) {
	font-family: var(--kf-font-display);
	/* v2.6.0 — headings are LIGHT. Darker Grotesque is drawn to carry a fine
	   weight at display sizes, and 700 was making every heading shout. Main
	   headings sit at 300; only SMALL headings (product titles, FAQ
	   questions) hold 500, where 300 would under-ink against the body text
	   beside them. The self-hosted file declares 300-900, so 300 is a real
	   instance, not a synthesised thin. */
	/* v2.8.0 — client: 300 was too light across the whole site. 400 is the
	   new base for headings; the two-line hero lockup and small headings take
	   deliberate steps up from here so there is real weight CONTRAST rather
	   than one uniform hairline. */
	font-weight: 400;
	color: var(--kf-heading);
	line-height: 1.02;
	letter-spacing: -0.01em;
	margin: 0 0 0.5em;
}
/* v2.5.0 — the MAIN hero line only, at the family's heaviest cut. Restricted
   to the first line: :not(.kf-display-italic) keeps the second line on 500,
   which is the contrast the two-line lockup now relies on since Darker
   Grotesque has no italic. These selectors are (0,3,0)/(0,2,0), so they sit
   above the package's own hero rules without !important. */
.kf-hero__h1,
.kf-hero__h1 .kf-line:not(.kf-display-italic),
main.kf-bakery .kf-bakery__hero-title .kf-line:not(.kf-display-italic),
.kf-loc__hero-title .kf-line:not(.kf-display-italic) {
	/* v2.8.0: 300 -> 400. Line ONE stays the lighter of the pair. */
	font-weight: 400;
}
.kf-hero__h1 .kf-display-italic,
main.kf-bakery .kf-bakery__hero-title .kf-display-italic,
.kf-loc__hero-title .kf-display-italic {
	/* v2.8.0 — the SECOND line carries the weight. Client asked for one light
	   heading and one noticeably bolder; 400 against 400 was no contrast at
	   all. 600 reads as a deliberate pair on a family with no italic. */
	font-weight: 600;
}

/* v2.5.1 — WEIGHT FLOOR for the display face.
   These elements take --kf-font-display from their own rules but kept the
   weight Playfair was calibrated at (400/500). Darker Grotesque at 400 is a
   hairline, so each is lifted to the 700 working weight. Listed explicitly
   rather than blanket-set, so nothing outside the display scope moves.
   The base :where(h1-h6) rule cannot do this job — :where() carries zero
   specificity, so any component rule beats it.
   v2.8.0: 500 -> 600. These are the SMALL headings — they sit directly beside
   body copy and have to out-ink it, so they hold 600 against the new 400 base. */
.kf-search-panel__title,
.kf-journey__word,
.kf-product__name,
.kf-bakery__tile-name {
	font-weight: 600;
}
/* The wordmark is display type too, but it is chrome, not a headline —
   600/500 keeps it from shouting over the nav while clearing the 500 floor
   (its <em> was 300, which on this face nearly disappeared). */
.kf-nav__brand { font-weight: 600; }
.kf-nav__brand em,
.kf-footer__brand em { font-weight: 500; }

/* Form controls do not inherit font-family by default, but the drawer's
   search button was picking up the display face from a parent rule. Buttons,
   inputs and labels stay on the body sans — per brief, UI text is untouched. */
button,
input,
select,
textarea,
.kf-btn {
	font-family: var(--kf-font-body);
}

:where(h1) { font-size: clamp(var(--kf-text-2xl), 5vw, var(--kf-text-3xl)); }
:where(h2) { font-size: clamp(var(--kf-text-xl), 3.4vw, var(--kf-text-2xl)); }
:where(h3) { font-size: var(--kf-text-lg); }
/* v2.8.0: focus ring was crema — too pale to see on cream paper. Terracotta. */
:focus-visible { outline: 2px solid var(--kf-espresso); outline-offset: 3px; border-radius: 2px; }

.kf-container { max-width: var(--kf-container); margin-inline: auto; padding-inline: clamp(20px, 4vw, 40px); }
.kf-container--narrow { max-width: var(--kf-container-narrow); }
.kf-main { min-height: 55vh; }
.kf-main:not(.kf-main--builder) { padding-block: var(--kf-space-lg) var(--kf-space-xl); }
.kf-main--builder { padding: 0; } /* builder sections own their own rhythm */

.kf-skip {
	position: absolute; left: -9999px; top: 0; z-index: 10000;
	background: var(--kf-heading); color: #fff; padding: 10px 18px; border-radius: 0 0 var(--kf-radius-md) 0;
}
.kf-skip:focus { left: 0; }

/* ── Buttons (Woo + native WP surfaces only) ──────────────────────────
 * v2.3.0: this is a SECOND button system — a solid pill — and it was
 * silently beating the package's editorial button on builder pages.
 * The plugin enqueues package CSS before the theme's sheets, so on
 * equal specificity this block won, handing `.kf-btn--ghost-dark` a
 * bronze fill under its dark-brown text (the unreadable "OUR STORY"
 * button). Scoped off builder pages now — those get the package's
 * button system, which is the designed one. Woo, 404 and search keep
 * this pill. `body.kf-builder-page` is set by the theme on any post
 * with a published HMG layout.
 */
body:not(.kf-builder-page) .kf-btn, .kf-prose .wp-block-button__link {
	display: inline-flex; align-items: center; justify-content: center; gap: 8px;
	min-height: 48px; padding: 0 28px;
	background: var(--kf-primary); color: #fff;
	border: 1px solid var(--kf-primary); border-radius: var(--kf-radius-pill);
	font-family: var(--kf-font-sans); font-size: var(--kf-text-sm); font-weight: 700; letter-spacing: 0.04em;
	text-decoration: none; cursor: pointer;
	transition: transform var(--kf-fast) var(--kf-ease), background var(--kf-fast) var(--kf-ease), box-shadow var(--kf-fast) var(--kf-ease);
}
body:not(.kf-builder-page) .kf-btn:hover { background: color-mix(in srgb, var(--kf-primary) 88%, #000); color: #fff; transform: translateY(-1px); box-shadow: var(--kf-shadow); }
body:not(.kf-builder-page) .kf-btn--ghost { background: transparent; color: var(--kf-primary); }
body:not(.kf-builder-page) .kf-btn--ghost:hover { background: var(--kf-wash); color: var(--kf-primary); box-shadow: none; }

/* ── Page head / prose ────────────────────────────────────────────── */
.kf-page-head { margin-bottom: var(--kf-space-md); max-width: 780px; }
.kf-page-head time { font-size: var(--kf-text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--kf-muted); }
.kf-prose { max-width: 70ch; }
.kf-prose p, .kf-prose ul, .kf-prose ol { margin: 0 0 1.25em; }
.kf-prose img { border-radius: var(--kf-radius-lg); }
.kf-prose blockquote {
	margin: 2em 0; padding: 0.25em 0 0.25em 1.25em;
	border-left: 3px solid var(--kf-accent);
	font-family: var(--kf-font-display); font-size: var(--kf-text-lg); color: var(--kf-heading);
}

/* ── Blog ─────────────────────────────────────────────────────────── */
.kf-post-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--kf-space-md); }
@media (max-width: 980px) { .kf-post-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .kf-post-grid { grid-template-columns: 1fr; } }
.kf-post-card__link { display: block; color: inherit; text-decoration: none; }
.kf-post-card__media { border-radius: var(--kf-radius-lg); overflow: hidden; background: var(--kf-wash); }
.kf-post-card__media img { aspect-ratio: 16 / 10; object-fit: cover; transition: transform var(--kf-slow) var(--kf-ease); }
.kf-post-card__link:hover img { transform: scale(1.04); }
.kf-post-card__body { padding-top: var(--kf-space-sm); }
.kf-post-card__body time { font-size: var(--kf-text-xs); letter-spacing: 0.1em; text-transform: uppercase; color: var(--kf-muted); }
.kf-post-card__body h2 { font-size: var(--kf-text-lg); margin: 0.35em 0; }
.kf-post-card__body p { margin: 0; color: var(--kf-muted); font-size: var(--kf-text-sm); }
.kf-article__hero { border-radius: var(--kf-radius-lg); overflow: hidden; margin-bottom: var(--kf-space-md); }

.kf-pagination { margin-top: var(--kf-space-lg); }
.kf-pagination .nav-links { display: flex; gap: 8px; justify-content: center; }
.kf-pagination .page-numbers {
	display: inline-flex; align-items: center; justify-content: center;
	min-width: 42px; height: 42px; padding: 0 10px; border-radius: var(--kf-radius-pill);
	border: 1px solid var(--kf-line); color: var(--kf-text); text-decoration: none; font-weight: 600;
}
.kf-pagination .page-numbers.current { background: var(--kf-primary); color: #fff; border-color: var(--kf-primary); }
.kf-pagination .page-numbers:hover:not(.current) { border-color: var(--kf-primary); color: var(--kf-primary); }

/* ── Search / empty / 404 ─────────────────────────────────────────── */
.kf-search-list { list-style: none; margin: 0; padding: 0; }
.kf-search-list li { padding: var(--kf-space-sm) 0; border-bottom: 1px solid var(--kf-line-soft); }
.kf-search-list a { font-family: var(--kf-font-display); font-size: var(--kf-text-lg); text-decoration: none; }
.kf-search-list p { margin: 4px 0 0; color: var(--kf-muted); font-size: var(--kf-text-sm); }
.kf-empty { color: var(--kf-muted); }
.kf-404 { text-align: center; max-width: 560px; }
.kf-404__code { font-family: var(--kf-font-display); font-size: 96px; line-height: 1; color: var(--kf-accent); margin: 0 0 8px; }
.kf-404__actions { display: flex; gap: 12px; justify-content: center; margin-top: var(--kf-space-md); flex-wrap: wrap; }
/* v2.1.2 mobile rule: everything ranges left below 768px. */
@media (max-width: 768px) {
	.kf-404 { text-align: left; }
	.kf-404__actions { justify-content: flex-start; }
}

/* ── Forms (search, comments, hmg-form inherits) ──────────────────── */
input[type="text"], input[type="email"], input[type="url"], input[type="tel"],
input[type="number"], input[type="password"], input[type="search"], select, textarea {
	width: 100%; padding: 12px 16px;
	background: var(--kf-surface); color: var(--kf-text);
	border: 1px solid var(--kf-line); border-radius: var(--kf-radius-md);
	font: inherit;
	transition: border-color var(--kf-fast) var(--kf-ease), box-shadow var(--kf-fast) var(--kf-ease);
}
input:focus, select:focus, textarea:focus {
	outline: none; border-color: var(--kf-primary);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--kf-primary) 18%, transparent);
}
.search-form { display: flex; gap: 8px; max-width: 460px; }
.search-form .search-submit { flex-shrink: 0; }

/* ── Builder page seam ────────────────────────────────────────────── */
/* Sections render inside .hmg-page (full-bleed). Give non-hero first
   sections breathing room under the sticky header. */
.kf-main--builder .hmg-page > :first-child { scroll-margin-top: 96px; }

/* ── Reduced motion ───────────────────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { transition-duration: 0.01ms !important; animation-duration: 0.01ms !important; }
}
/* ── Fixed-chrome offset ──────────────────────────────────────────────
   v2.7.0: the announcement bar is in NORMAL FLOW and takes its own 40px, so
   --kf-header-h is now only the still-fixed part below it (4px gap + 64px
   nav = 68px). Net clearance is unchanged — 40 in flow + 68 padding is the
   same 108 the old fixed stack reserved, so nothing moves. The homepage and
   the Woo/kf templates start with full-bleed heroes that run UNDER the
   transparent nav by design; everything else needs the clearance. The
   espresso context strip that used to back the nav on light pages is GONE
   (the header is transparent in every state) — body.kf-nav-on-light flips
   the nav's marks to ink instead. */
body:not(.home) .kf-main:not(.kf-main--builder) {
	padding-top: calc(var(--kf-header-h) + var(--kf-space-md));
}
body:not(.home) .kf-main--builder { padding-top: var(--kf-header-h); }
/* …except when the page OPENS with a full-bleed hero (about-us, locations,
   coffee). Those heroes are built to run UNDER the transparent nav and pad
   their own copy clear of it (200px on .kf-loc__hero); the offset above was
   pushing the whole section down, so the photograph started below the nav
   and the espresso strip sat on top of it as a solid bar. */
body.kf-hero-top .kf-main--builder { padding-top: 0; }

/* ── About-split film card → YouTube embed (v2.4.3) ───────────────────
   The section shipped a 4:5 self-hosted .webm card. It now carries a 16:9
   YouTube iframe, which changes the shape of the media column: at 0.72fr
   a 16:9 box is short and wide, so top-aligning it against a tall text
   block left a large void underneath. The column is widened and the two
   are centred against each other — that is what makes the video read as
   sitting WITH the copy rather than beside it.

   Package CSS loads BEFORE the theme's, so these single-class rules win
   on source order at equal specificity (see the package/theme cascade
   note in the builder docs). */
.kf-about__grid--film {
	grid-template-columns: minmax(0, 1fr) minmax(320px, 0.95fr);
	align-items: center;
}
/* The field is type `video`, so the BUILDER renders the player — it turns
   any YouTube/Vimeo/MP4 link into `<div class="hmg-video"><iframe>`. That
   is deliberate: it normalises a pasted youtu.be share link (which cannot
   load in an iframe — it 302s to /watch, which sends X-Frame-Options and
   fails with "refused to connect") into a real /embed/ URL. So style the
   wrapper the plugin emits, not a hand-rolled iframe. */
.kf-about__video,
.kf-about__video .hmg-video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
}
.kf-about__video .hmg-video {
	border-radius: var(--kf-r-media, 14px);
	overflow: hidden;
	background: #0a0604;
	box-shadow: 0 18px 50px -28px rgba(26, 18, 11, .55);
}
.kf-about__video iframe,
.kf-about__video video {
	position: absolute;
	inset: 0;
	display: block;
	width: 100%;
	height: 100%;
	border: 0;
}
/* The caption was a pill floated over the corner of the photo card. Over
   a video it would cover the player controls, so it sits under it. */
.kf-about__caption--film {
	position: static;
	margin-top: .85rem;
	padding: 0;
	background: none;
	box-shadow: none;
	color: var(--kf-ink-meta, rgba(62, 44, 28, .6));
}
@media (max-width: 900px) {
	.kf-about__grid--film { grid-template-columns: minmax(0, 1fr); }
}

/* Raw HTML pages converted from the old site (.kfl-* / .kfa* scoped
   markup pasted into the editor) manage their own full-bleed layout. */
body.kf-rawpage .kf-main { padding: 0; }
body.kf-rawpage .kf-container { max-width: 100%; padding: 0; }
