/*
 * Global stylesheet — loaded asynchronously (non-render-blocking).
 *
 * Contains everything below the fold and all non-critical refinement.
 * Mobile-first: base styles target small screens, min-width media queries
 * layer desktop on top. No framework, no utility bloat.
 */

/* ---------- Base typography & elements ---------- */

/* Anchor jumps glide instead of teleporting. The reduced-motion block at
   the end of this file switches it back off for visitors who ask for it. */
html {
	scroll-behavior: smooth;
}

/* Brand type: Playfair Display for headings, Helvetica stack for copy. */
h1,
h2,
h3,
h4 {
	font-family: var(--fk-font-serif);
	font-weight: 500;
	color: var(--fk-color-text);
	line-height: 1.2;
	margin: 0 0 0.5em;
	overflow-wrap: break-word;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.375rem; }
h3 { font-size: 1.125rem; }

p,
ul,
ol {
	margin: 0 0 1em;
}

a {
	color: var(--fk-color-accent);
}

a:hover,
a:focus {
	text-decoration-thickness: 2px;
}

:focus-visible {
	outline: 2px solid var(--fk-color-accent);
	outline-offset: 2px;
}

table {
	border-collapse: collapse;
	width: 100%;
}

th,
td {
	text-align: left;
	padding: 0.5rem;
	border-bottom: 1px solid #e5e0da;
}

/* ---------- Forms (native controls, no JS widgets) ---------- */

button,
input,
select,
textarea {
	font: inherit;
	color: inherit;
}

button,
input[type="submit"] {
	cursor: pointer;
	background: var(--fk-color-text);
	color: #fff;
	border: 0;
	padding: 0.625rem 1.25rem;
	border-radius: 0.25rem;
}

/* ---------- Search ---------- */

/*
 * The header's search panel and the form's own furniture.
 *
 * Async on purpose, and safe here: the panel sits inside a CLOSED
 * <details>, so not one of these rules is rendered at first paint. Only
 * the icon that opens it needs to be in the head, and that part stayed
 * in critical.css — it is the part that would otherwise shift.
 */

/*
 * The panel the summary opens. Absolutely positioned at the header's
 * bottom edge, so opening it never pushes the page down — the same trick
 * the mobile menu uses, and the reason the header is a positioned box.
 *
 * It spans the screen so the shadow closes the header off across its
 * whole width; the padding then puts the field back on a column, because
 * a search field 1.150 px wide is a trough and not a control. The
 * formula is the one every section uses, on a narrower column: the
 * header inset on a phone, a centred 34rem once there is room.
 */
.header-search .search-form {
	position: absolute;
	top: 100%;
	left: 0;
	right: 0;
	padding-block: 0.75rem 1rem;
	padding-inline: max(var(--fk-header-inset), (100% - 34rem) / 2);
	background: var(--fk-color-bg);
	color: var(--fk-color-text);
	box-shadow: 0 16px 24px rgba(0, 0, 0, 0.08);
}

.search-form {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	line-height: normal;
}

/*
 * The chain below is repeated on purpose. A few rules down, this same
 * file gathers every input with a three-attribute :not() chain at
 * (0,3,1) and caps it at 30rem — right in a text column, wrong in a
 * full-width panel, where it would leave the field short of its own
 * button. A class alone is (0,1,0) and loses; the repeated chain plus
 * the class is (0,4,1) and wins wherever the two end up in source order.
 */
.search-form input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]) {
	flex: 1 1 auto;
	min-width: 0;
	max-width: none;
}

.search-form__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	width: 2.5rem;
	height: 2.5rem;
	padding: 0;
	border: 0;
	border-radius: 0.25rem;
	background: var(--fk-color-sage);
	color: var(--fk-color-text);
	cursor: pointer;
	transition: background-color 0.2s ease;
}

/* Darker ground on hover, same dark mark on it: #1f1f1f on the dark sage
   is 4,4 : 1, well past the 3 : 1 a graphical element owes. White would
   have been 4,1 : 1 — legal too, but the lighter of the two. */
.search-form__submit:hover,
.search-form__submit:focus-visible {
	background: var(--fk-color-sage-dark);
}

/*
 * The open search panel is a white sheet, and above it a transparent
 * header would be white icons on white. Focus already solves this —
 * opening the <details> normally puts focus on the summary — but a click
 * that moves no focus would not, and the failure is invisible icons.
 * :has() takes the specificity of its argument, so this lands at (0,3,0)
 * and outranks the two rules above it.
 */
.site-header--overlay:has(.header-search[open]) {
	background: var(--fk-color-bg);
	color: var(--fk-color-text);
}

/*
 * The search form outside the header — 404 and the empty-results state.
 * In the header it is a full-width panel (critical.css); on a page it is
 * an ordinary control and has no business spanning the text column.
 */
.site-main .search-form {
	max-width: 30rem;
}

input:not([type="submit"]):not([type="checkbox"]):not([type="radio"]),
select,
textarea {
	width: 100%;
	max-width: 30rem;
	padding: 0.5rem;
	border: 1px solid #c9c2ba;
	border-radius: 0.25rem;
	background: #fff;
}

/* ---------- Layout parts ---------- */

/*
 * Listing grid — every template that loops cards uses this, so the
 * columns are defined once. The cards carry no margins of their own; the
 * gap belongs to the grid.
 */
.entry-list {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2.5rem 1.5rem;
}

@media (min-width: 40em) {
	.entry-list {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (min-width: 64em) {
	.entry-list {
		grid-template-columns: repeat(3, 1fr);
	}
}

/*
 * Listing card — one card for the magazine, the category archives and
 * search. White on the paper background, a hairline rather than a border,
 * and the whole card clickable through the title link, so the document
 * still holds exactly one link per card.
 */
.entry-card {
	position: relative;
	display: flex;
	flex-direction: column;
	margin: 0;
	background: var(--fk-color-bg);
	border: 1px solid rgba(31, 31, 31, 0.08);
	border-radius: 0.5rem;
	transition: transform 0.25s ease, border-color 0.25s ease;
}

/*
 * The deeper hover shadow lies on a pseudo-element and is faded in
 * instead of being animated on the card: a box-shadow transition redraws
 * the blur every frame, an opacity transition is only composited. No
 * background and no negative z-index on it — the lift creates a stacking
 * context, and a layer behind the card would vanish inside it.
 */
.entry-card::after {
	content: "";
	position: absolute;
	inset: -1px;
	border-radius: inherit;
	box-shadow: 0 14px 30px rgba(31, 31, 31, 0.14);
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none;
}

/* Rendered even without a featured image: the reserved ratio keeps a row
   of cards the same shape and nothing shifts while images load. */
.entry-card__media {
	aspect-ratio: 16 / 10;
	background: var(--fk-color-greige);
	border-radius: calc(0.5rem - 1px) calc(0.5rem - 1px) 0 0;
	overflow: hidden;
}

.entry-card__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.entry-card__body {
	padding: 1.5rem;
}

.entry-card__title {
	margin: 0;
	font-family: var(--fk-font-serif);
	font-weight: 500;
	font-size: 1.25rem;
	line-height: 1.3;
}

.entry-card__title a {
	color: var(--fk-color-text);
	text-decoration: none;
}

/* Stretched link: the target is the whole card. */
.entry-card__title a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

/* The visible focus ring, in the text colour rather than the accent:
   sage on the paper background reaches only ~2:1, under the 3:1 a focus
   indicator has to clear. */
.entry-card__title a:focus-visible {
	outline: 3px solid var(--fk-color-text);
	outline-offset: 4px;
}

/* Five pixels, because a card that leads somewhere lifts five. */
.entry-card:hover,
.entry-card:focus-within {
	transform: translateY(-5px);
	border-color: var(--fk-color-sage);
}

.entry-card:hover::after,
.entry-card:focus-within::after {
	opacity: 1;
}

@media (prefers-reduced-motion: reduce) {
	.entry-card {
		transition: none;
	}

	.entry-card:hover,
	.entry-card:focus-within {
		transform: none;
	}
}

.page-header {
	margin-bottom: 1.5rem;
}

.section-eyebrow {
	margin: 0 0 0.75rem;
	font-size: 0.875rem;
	letter-spacing: 0.04em;
	color: var(--fk-color-text);
}

.section-title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.875rem, 3.5vw, 2.5rem);
	line-height: 1.15;
}

.section-text {
	margin: 0;
	font-size: 1.125rem;
	max-width: 60rem;
}

/* ---------- Footer ---------- */

/*
 * Four columns, a hairline across the full width, the payment strip, a
 * closing row with social icons, copyright and the tagline.
 *
 * The rows run edge to edge and put their content on the column — the
 * same padding-inline formula as every section of this theme. That is
 * what lets the hairline reach both viewport edges without a second
 * wrapper around it.
 */
.site-footer {
	background: var(--fk-color-footer);
	color: #fff;
	margin-top: 0;
}

.footer-inner,
.footer-payments,
.footer-bottom,
.footer-legal-row {
	padding-inline: max(var(--fk-space), (100% - var(--fk-max-width)) / 2);
}

/* minmax(0, …) rather than 1fr: a track's minimum is its content, and a
   link that cannot wrap would otherwise push the page sideways. */
.footer-inner {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 2.5rem;
	padding-block: 3rem 2.5rem;
}

@media (min-width: 40em) {
	.footer-inner {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 3rem 2.5rem;
	}
}

@media (min-width: 64em) {
	.footer-inner {
		grid-template-columns: repeat(4, minmax(0, 1fr));
		padding-block: 4.5rem 3.5rem;
	}
}

/* Stacked into one column, a left-aligned block of links reads as a
   ragged strip down one edge of the phone. Centred, each column is its
   own little block — so centring is the base and the columns go back to
   the flush left edge as soon as there are two of them side by side. */
.footer-column {
	text-align: center;
}

@media (min-width: 40em) {
	.footer-column {
		text-align: start;
	}
}

/* Column headings and the shop name are the same label: Playfair, small,
   in capitals. They sit above lists, not above prose, so they carry the
   letter-spacing of the eyebrow rather than the size of a heading. */
.footer-heading,
.footer-shop-name {
	font-family: var(--fk-font-serif);
	font-size: 1.0625rem;
	font-weight: 500;
	line-height: 1.3;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #fff;
	margin: 0 0 1.75rem;
}

.footer-column:not(.footer-shop) ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	gap: 1.25rem;
}

.footer-column:not(.footer-shop) a,
.footer-legal a,
.footer-address a {
	color: rgba(255, 255, 255, 0.78);
	text-decoration: none;
	font-size: 0.9375rem;
	line-height: 1.5;
}

/* The visible text stays where it is; the padding grows the hit area to
   the 24 px a finger needs. */
.footer-column:not(.footer-shop) a,
.footer-legal a {
	display: inline-block;
	padding-block: 0.125rem;
}

.footer-column:not(.footer-shop) a:hover,
.footer-column:not(.footer-shop) a:focus-visible,
.footer-legal a:hover,
.footer-legal a:focus-visible,
.footer-address a:hover,
.footer-address a:focus-visible {
	color: #fff;
	text-decoration: underline;
}

/* ---------- Fourth column: badges, shop name, address ---------- */

.footer-badges {
	list-style: none;
	margin: 0 0 2.5rem;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 1rem;
}

@media (min-width: 40em) {
	.footer-badges {
		justify-content: flex-start;
	}
}

.footer-badges a {
	display: inline-flex;
	border-radius: 0.25rem;
}

/* Trust seals arrive at wildly different sizes. The cap is on the
   height, so a wide seal and a square one end up on one line. */
.footer-badge {
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 5rem;
}

.footer-address {
	font-style: normal;
	display: grid;
	gap: 0.125rem;
	font-size: 0.9375rem;
	line-height: 1.5;
	color: rgba(255, 255, 255, 0.78);
}

.footer-address a {
	justify-self: center;
}

@media (min-width: 40em) {
	.footer-address a {
		justify-self: start;
	}
}

/* ---------- Payment strip ---------- */

.footer-payments {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding-block: 3rem 1.5rem;
	text-align: center;
}

/* Images are display: block globally, so text-align cannot centre this
   one — the margin does. */
.footer-payments-image {
	width: auto;
	height: auto;
	max-width: min(100%, 44rem);
	margin-inline: auto;
}

/* ---------- Closing row ---------- */

/* The hairline belongs above the payment strip when there is one and
   above this row when there is not — the footer keeps exactly one. */
.footer-bottom {
	border-top: 1px solid rgba(255, 255, 255, 0.12);
	padding-block: 2.5rem 3rem;
	display: grid;
	gap: 1.5rem;
	justify-items: center;
	text-align: center;
}

.footer-payments + .footer-bottom {
	border-top: 0;
	padding-block: 2rem 3rem;
}

@media (min-width: 48em) {
	.footer-bottom {
		grid-template-columns: 1fr auto 1fr;
		align-items: center;
	}

	.footer-bottom .footer-social {
		justify-self: start;
	}

	.footer-tagline {
		justify-self: end;
		text-align: right;
	}
}

/* Rows of controls wrap: a dozen 24 px targets fit a narrow phone only
   if they are allowed to. */
.footer-social {
	display: flex;
	flex-wrap: wrap;
	gap: 0.625rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.footer-social a {
	display: inline-flex;
	padding: 0.375rem;
	color: rgba(255, 255, 255, 0.85);
	transition: color 0.2s ease;
}

.footer-social a:hover,
.footer-social a:focus-visible {
	color: #fff;
}

.site-info,
.footer-tagline {
	margin: 0;
	font-size: 0.875rem;
	color: rgba(255, 255, 255, 0.78);
}

/* ---------- Legal row (only when a menu is assigned) ---------- */

.footer-legal-row {
	padding-block: 0 2.5rem;
}

.footer-legal ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 0.25rem 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

/* The footer sits on a dark ground: the global sage focus ring would be
   hard to see, so switch it to white here. */
.site-footer :focus-visible {
	outline-color: #fff;
}

/* ---------- Desktop refinements ---------- */
/* (Mobile nav collapse rules live in critical.css — above-the-fold state.) */

@media (min-width: 48em) {
	h1 { font-size: 2.25rem; }
	h2 { font-size: 1.625rem; }
}

.products-action,
.section-action {
	margin-top: 2.5rem;
	text-align: center;
}

/* Shared section CTA — defined once, used by every front-page section:
   outlined, fills black with a white label and a soft shadow on hover. */
a.button--outline {
	display: inline-block;
	background: transparent;
	color: var(--fk-color-text);
	border: 1px solid var(--fk-color-text);
	border-radius: 0.25rem;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	text-decoration: none;
	transition: background-color 0.25s ease, color 0.25s ease, box-shadow 0.25s ease;
}

a.button--outline:hover,
a.button--outline:focus-visible {
	background: var(--fk-color-text);
	color: #fff;
	box-shadow: 0 10px 24px rgba(31, 31, 31, 0.28);
}

/* Shared solid CTA — counterpart to a.button--outline. */
a.button--solid {
	display: inline-block;
	background: var(--fk-color-text);
	color: #fff;
	border: 1px solid var(--fk-color-text);
	border-radius: 0.25rem;
	padding: 0.75rem 1.5rem;
	font-size: 1rem;
	text-decoration: none;
	transition: transform 0.2s ease, box-shadow 0.2s ease;
}

a.button--solid:hover,
a.button--solid:focus-visible {
	transform: translate(-2px, -2px);
	box-shadow: 6px 6px 16px rgba(31, 31, 31, 0.28);
}

/* ---------- Pagination ---------- */

.pagination .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.pagination a,
.pagination .current {
	padding: 0.375rem 0.75rem;
	border: 1px solid #c9c2ba;
	border-radius: 0.25rem;
	text-decoration: none;
}

.pagination .current {
	background: var(--fk-color-accent);
	color: #fff;
	border-color: var(--fk-color-accent);
}

/* ---------- Motion: respect user preference, no decorative animation ---------- */

@media (prefers-reduced-motion: reduce) {
	*,
	*::before,
	*::after {
		animation-duration: 0.01ms !important;
		animation-iteration-count: 1 !important;
		transition-duration: 0.01ms !important;
		scroll-behavior: auto !important;
	}
}

/* ---------- Video facade (click to load) ---------- */

/* Costs one gradient and no requests until the visitor clicks. The
   aspect-ratio holds the space, so swapping in the player shifts nothing. */
.video-facade {
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 0.75rem;
	aspect-ratio: 16 / 9;
	width: 100%;
	padding: 1.5rem;
	border-radius: 0.5rem;
	background: linear-gradient(165deg, var(--fk-color-sage) 0%, var(--fk-color-sage-dark) 100%);
	text-align: center;
	color: #fff;
	/* The whole placeholder starts the video, so it should say so. */
	cursor: pointer;
}

.video-facade__button {
	background: none;
	border: 0;
	padding: 0;
	cursor: pointer;
	line-height: 0;
	border-radius: 50%;
	transition: transform 0.2s ease;
}

.video-facade__button:hover,
.video-facade__button:focus-visible {
	transform: scale(1.06);
}

.video-facade__button:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 4px;
}

.video-facade__title {
	font-family: var(--fk-font-serif);
	font-size: clamp(1.125rem, 2.2vw, 1.5rem);
	line-height: 1.25;
	max-width: 30ch;
}

.video-facade__note {
	font-size: 0.8125rem;
	color: rgba(255, 255, 255, 0.85);
}

/* The player replaces the facade in place. */
.category-description > iframe,
.entry-content > iframe {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 9;
	height: auto;
	border: 0;
	border-radius: 0.5rem;
}
