/*
Theme Name: Nittsjö Keramik
Theme URI: https://nittsjokeramik.se/
Author: Balonka
Description: Block theme for Nittsjö Keramik — a fast, responsive full-site-editing theme for the handcrafted ceramics factory in Rättvik. Layout, colour and typography live in theme.json; this file carries only the rules blocks cannot express.
Version: 1.0.0
Requires at least: 6.6
Tested up to: 6.8
Requires PHP: 7.4
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: nittsjokeramik
Tags: e-commerce, full-site-editing, block-patterns, custom-colors, custom-logo, wide-blocks, accessibility-ready
*/

/* -------------------------------------------------------------------------
 * Base
 * ---------------------------------------------------------------------- */

html {
	-webkit-text-size-adjust: 100%;
	/* Must be `clip`, not `hidden`: `hidden` turns <html> into a scroll
	   container, which silently stops the sticky header from sticking.
	   `clip` prevents sideways scrolling without creating that container. */
	overflow-x: clip;
	/* So in-page anchors do not land underneath the sticky header. Measured
	   header row is 121px on desktop and 81px once the menu collapses. */
	--nk-header-height: 121px;
	scroll-padding-top: calc(var(--nk-header-height) + 1rem);
}

@media (max-width: 1139px) {
	html {
		--nk-header-height: 81px;
	}
}

/* Logged-in editors also have the admin bar above the sticky header. */
html:has(body.admin-bar) {
	scroll-padding-top: calc(var(--nk-header-height) + 32px + 1rem);
}

@media screen and (max-width: 782px) {
	html:has(body.admin-bar) {
		scroll-padding-top: calc(var(--nk-header-height) + 46px + 1rem);
	}
}

@media screen and (max-width: 600px) {
	html:has(body.admin-bar) {
		scroll-padding-top: calc(var(--nk-header-height) + 1rem);
	}
}

/* Nothing should ever make the page scroll sideways. Wide content (tables,
   galleries) gets its own scroll container instead -- see further down. */
body {
	overflow-x: clip;
	max-width: 100vw;
}

/* Long unbroken words (Swedish compounds, URLs) must not push the layout out. */
h1, h2, h3, h4, h5, h6, p, li, a {
	overflow-wrap: break-word;
}

body {
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
	text-rendering: optimizeLegibility;
}

/* Visible, on-brand focus ring for keyboard users only. */
:where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
	outline: 2px solid var(--wp--preset--color--clay);
	outline-offset: 2px;
}

/* Visually hidden, still read by screen readers and still in the document
   outline. Used for the page h1 on templates that show no visible title. */
.screen-reader-text:not(:focus) {
	position: absolute !important;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
}

/* Skip link — hidden until focused. */
.nk-skip-link {
	position: absolute;
	left: -9999px;
	z-index: 999999;
	padding: 0.85rem 1.5rem;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	font-size: 0.875rem;
	text-decoration: none;
}

.nk-skip-link:focus {
	left: 1rem;
	top: 1rem;
}

@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;
	}
}

/* -------------------------------------------------------------------------
 * Announcement bar
 * ---------------------------------------------------------------------- */

.nk-announcement {
	font-size: 0.75rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.nk-announcement p {
	margin: 0;
}

/* -------------------------------------------------------------------------
 * Sticky header
 *
 * The whole header block sticks, announcement strip included. A sticky element
 * can only move within its own parent's box, so sticking just the logo/menu row
 * would pin it for the height of the announcement bar and then release --
 * making the outer wrapper the sticky element is what keeps it fixed for the
 * whole page. Requires <html> to use overflow-x: clip rather than hidden.
 * ---------------------------------------------------------------------- */

/* Collapse the template-part wrapper so it generates no box of its own. Its
   two children -- the announcement strip and the header row -- then become
   direct children of .wp-site-blocks, which spans the whole page. That is what
   gives the sticky row room to travel: a sticky box can only move within its
   parent's box, and any wrapper here would be exactly as tall as the header.
   The class comes from the template's template-part call, so the footer part is
   unaffected. Safe on a plain div -- no background, border or semantics are
   lost, and the <header> landmark still generates its own box below. */
.wp-block-template-part.nk-header-part {
	display: contents;
}

/* Height of the WordPress admin bar, so the sticky header pins below it rather
   than underneath it when an editor is logged in. WordPress uses 32px from
   783px up, 46px below that, and switches the bar from fixed to absolute at
   600px and under -- where it scrolls away, so the header goes back to 0. */
body {
	--nk-admin-bar: 0px;
}

body.admin-bar {
	--nk-admin-bar: 32px;
}

@media screen and (max-width: 782px) {
	body.admin-bar {
		--nk-admin-bar: 46px;
	}
}

@media screen and (max-width: 600px) {
	body.admin-bar {
		--nk-admin-bar: 0px;
	}
}

/* Only the logo/menu/icons row pins; the announcement strip scrolls away. */
.wp-block-group.nk-header {
	position: sticky;
	top: var(--nk-admin-bar, 0px);
	/* Above page content and the hero video, below WooCommerce's cart drawer
	   and the navigation overlay, which set their own much higher values. */
	z-index: 100;
}

/* The strip sits in normal flow above it, with no block-gap of its own. */
.wp-block-group.nk-announcement {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Separates the header from the page content below it, and gives the sticky
   bar a defined edge as content passes underneath. */
.nk-header {
	border-bottom: 1px solid var(--wp--preset--color--stone);
	/* Restated here so the sticky row is never transparent over scrolling
	   content, whatever the block attribute says. */
	background-color: var(--wp--preset--color--white);
}

/* The header row is a sibling of the announcement bar inside the same group, so
   WordPress's block gap lands 1.5rem of margin-block-start on it and nothing
   below -- which reads as extra space above the logo. Zero the gap and own the
   vertical rhythm here instead, so the padding above and below is genuinely
   equal. Padding lives in CSS rather than as an inline block style so this rule
   does not have to fight an inline declaration. */
.wp-block-group.nk-header {
	margin-block-start: 0;
	margin-block-end: 0;
	padding-top: 1.25rem;
	padding-bottom: 1.25rem;
}

/* -------------------------------------------------------------------------
 * Buttons — the "quiet link" variant used for editorial CTAs
 * ---------------------------------------------------------------------- */

.wp-block-button.is-style-underline-link .wp-block-button__link {
	background: transparent;
	color: var(--wp--preset--color--ink);
	padding: 0 0 0.35rem;
	border-bottom: 1px solid var(--wp--preset--color--ink);
	border-radius: 0;
}

.wp-block-button.is-style-underline-link .wp-block-button__link:hover,
.wp-block-button.is-style-underline-link .wp-block-button__link:focus {
	background: transparent;
	color: var(--wp--preset--color--clay);
	border-bottom-color: var(--wp--preset--color--clay);
}

/* Outline buttons sit on photography, so they need a solid border. */
.wp-block-button.is-style-outline .wp-block-button__link {
	border-width: 1px;
}

/* -------------------------------------------------------------------------
 * Editorial helpers
 * ---------------------------------------------------------------------- */

/* Small uppercase eyebrow label above a heading. */
.nk-eyebrow {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone-dark);
}

/* Images that should fill their column edge to edge at any aspect ratio. */
.nk-image-cover img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* Closing photograph on the front page: fills the width, held to a band
   proportion rather than the image's own tall ratio. */
.nk-closing-image img {
	display: block;
	width: 100%;
	aspect-ratio: 16 / 7;
	max-height: 620px;
	object-fit: cover;
}

@media (max-width: 781px) {
	.nk-closing-image img {
		aspect-ratio: 3 / 2;
		max-height: 360px;
	}
}

/* -------------------------------------------------------------------------
 * Feature bands — the five two-column sections between hero and products
 * ---------------------------------------------------------------------- */

/* Full-bleed halves, matching the bands on Produktion: the photograph runs to
   the band edge and fills the full height, the copy carries the padding. */
/* Desktop only. None of this applies once the band stacks -- absolute
   positioning and a column flex context both fight the stacked layout, so
   the phone simply gets ordinary block flow instead. */
@media (min-width: 782px) {
	.nk-feature .nk-feature-media {
		display: flex;
		flex-direction: column;
		padding: 0;
		align-self: stretch;
	}

	/* The photograph is taken out of flow so it contributes no intrinsic height:
	   the copy decides how tall the band is and the image crops to fill it. Left in
	   flow, an <img> keeps its own aspect (a 720px-wide portrait stands 1080px
	   tall) and drags the whole band with it -- flex-basis:0 on the figure is not
	   enough, because the height comes from the image itself. */
	.nk-feature .nk-feature-image {
		margin: 0;
		position: relative;
		flex: 1 1 auto;
		/* A portrait-leaning crop: the band was reading wide and shallow when its
		   height came only from the copy. aspect-ratio gives the picture its own say
		   again, and the floor keeps short-copy bands from collapsing. */
		aspect-ratio: 6 / 5;
		min-height: 600px;
		width: 100%;
	}

	.nk-feature-image img {
		position: absolute;
		inset: 0;
		width: 100%;
		height: 100%;
		object-fit: cover;
		display: block;
	}

	.nk-feature .nk-feature-body {
		max-width: none;
		padding-top: clamp(2.5rem, 4vw, 4.5rem);
		padding-bottom: clamp(2.5rem, 4vw, 4.5rem);
		padding-left: clamp(1.5rem, 3vw, 3.5rem);
		padding-right: clamp(1.5rem, 3vw, 3.5rem);
	}

	/* Hold the copy to a readable measure inside its half. */
	.nk-feature .nk-feature-body > * {
		max-width: 34rem;
	}
}

.nk-feature-body p:last-of-type {
	margin-bottom: 0;
}

/* Links inside a dark band need to pick up the light text colour. */
.nk-feature--dark a:not(.wp-block-button__link) {
	color: var(--wp--preset--color--white);
}

@media (max-width: 781px) {
	/* Stacked: the photograph leads, then the copy. Nothing else is needed --
	   the desktop rules are gated behind min-width: 782px. */
	.nk-feature .nk-feature-media {
		order: 1;
	}

	.nk-feature .nk-feature-body {
		order: 2;
		/* The desktop padding lives behind min-width:782px, so the stacked copy
		   needs its own or it runs flush to the screen edge. Same clamps as
		   desktop, which bottom out at 40px / 24px on a phone. */
		padding-top: clamp(2.5rem, 4vw, 4.5rem);
		padding-bottom: clamp(2.5rem, 4vw, 4.5rem);
		padding-left: clamp(1.5rem, 3vw, 3.5rem);
		padding-right: clamp(1.5rem, 3vw, 3.5rem);
	}

	.nk-feature .nk-feature-image {
		margin: 0;
	}

	.nk-feature-image img {
		width: 100%;
		height: auto;
		aspect-ratio: 4 / 3;
		object-fit: cover;
	}
}

/* Editorial images in a two-column band: hold a portrait crop so a very tall
   source photograph cannot stretch the whole section. */
.nk-portrait img {
	aspect-ratio: 4 / 5;
	max-height: 620px;
	object-fit: cover;
}

@media (max-width: 781px) {
	.nk-portrait img {
		aspect-ratio: 3 / 2;
		max-height: 340px;
	}
}

/* Subtle zoom on hover for linked editorial imagery. */
.nk-zoom-on-hover {
	overflow: hidden;
}

.nk-zoom-on-hover img {
	transition: transform 0.6s cubic-bezier(0.2, 0.6, 0.2, 1);
}

.nk-zoom-on-hover:hover img {
	transform: scale(1.04);
}

/* -------------------------------------------------------------------------
 * Header layout
 *
 * Desktop: one row -- [logo] [centred nav] [icons], matching the current site.
 * Mobile:  one row -- [hamburger] [logo] [icons].
 *
 * NOTE ON SPECIFICITY
 * WordPress prints its per-block layout rules (.wp-container-core-group-is-
 * layout-xxxx { display:flex }) as inline <style> in the head, i.e. AFTER this
 * stylesheet. Those selectors are a single class, so a single-class selector
 * here loses on source order. Every rule that overrides a block's own layout
 * is therefore written with two classes to win outright.
 * ---------------------------------------------------------------------- */

/* Three tracks: the outer two share the leftover space equally so the nav sits
   optically centred even though logo and icon groups differ in width. */
.wp-block-group.nk-header-bar {
	display: grid;
	grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
	align-items: center;
	gap: var(--wp--preset--spacing--30);
	width: 100%;
}

.wp-block-group.nk-header-brand {
	justify-content: flex-start;
	min-width: 0;
}

.wp-block-group.nk-header-nav {
	justify-content: center;
	min-width: 0;
	margin: 0;
}

.wp-block-group.nk-header-icons {
	justify-content: flex-end;
	min-width: 0;
	gap: 0.35rem;
}

/* Logo: 80px tall on desktop, matching the current site. Driven from height so
   the mark stays a fixed size whatever the source aspect ratio; width:auto is
   !important because the Site Logo block writes an inline width on the <img>,
   which a stylesheet rule cannot otherwise beat. The block's width attribute is
   kept in step (176 = 80 x the logo's 2.19 aspect) so WordPress still picks a
   sensibly sized file and srcset entry rather than upscaling a thumbnail. */
.nk-header .wp-block-site-logo img {
	height: 80px;
	width: auto !important;
	max-width: 100%;
	max-height: none;
}

/* When a custom logo is set, the text site-title is redundant. */
.wp-custom-logo .nk-site-title-fallback {
	display: none;
}

/* --- Icon cluster ------------------------------------------------------- */

/* One consistent hit target for every icon, whichever block renders it. */
.nk-header-icons .nk-icon,
.nk-header-icons .wp-block-woocommerce-mini-cart,
.nk-header-icons .wp-block-woocommerce-customer-account {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	min-height: 2.5rem;
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.nk-header-icons a,
.nk-header-icons button {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
	transition: color 0.2s ease;
}

.nk-header-icons a:hover,
.nk-header-icons button:hover {
	color: var(--wp--preset--color--clay);
}

.nk-header-icons svg {
	width: 22px;
	height: 22px;
}

/* Search collapses to an icon and expands on click (core search interactivity). */
.nk-icon-search .wp-block-search__inside-wrapper {
	border: 0;
	background: transparent;
	padding: 0;
}

.nk-icon-search .wp-block-search__button {
	background: transparent;
	border: 0;
	color: var(--wp--preset--color--ink);
	padding: 0.4rem;
	min-width: 2.5rem;
	min-height: 2.5rem;
	display: inline-flex;
	align-items: center;
	justify-content: center;
}

.nk-icon-search .wp-block-search__input {
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 0;
	background: var(--wp--preset--color--white);
	padding: 0.45rem 0.7rem;
	font-size: 0.875rem;
	max-width: 200px;
}

/* WooCommerce's own account/cart chrome, brought in line with the theme. */
.nk-header-icons .wc-block-customer-account__account-icon,
.nk-header-icons .wc-block-mini-cart__icon {
	width: 22px;
	height: 22px;
}

.nk-header-icons .wc-block-mini-cart__button {
	padding: 0.4rem;
	background: transparent;
}

/* Item-count bubble on the cart. */
.nk-header-icons .wc-block-mini-cart__badge {
	background: var(--wp--preset--color--clay);
	color: var(--wp--preset--color--white);
	font-size: 0.6875rem;
	font-weight: 600;
	border-radius: 999px;
	min-width: 1.15rem;
	line-height: 1.15rem;
	padding: 0 0.25rem;
}

/* Account block renders a text label by default; icon_only still leaves a
   whitespace node that can add stray width. */
.nk-header-icons .wc-block-customer-account__account-label {
	display: none;
}

/* --- Navigation --------------------------------------------------------- */

.nk-header .wp-block-navigation .wp-block-navigation-item__content {
	position: relative;
	padding-bottom: 2px;
	white-space: nowrap;
}

.nk-header .wp-block-navigation .wp-block-navigation-item__content::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 1px;
	background: currentColor;
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.25s ease;
}

/* Hover and the current page both show the underline. aria-current is the
   reliable hook -- WordPress only adds current-menu-item when a menu item
   references a real object, and it sets aria-current at the same time, so both
   are matched here (including ancestors of the current page). */
.nk-header .wp-block-navigation .wp-block-navigation-item__content:hover::after,
.nk-header .wp-block-navigation .wp-block-navigation-item__content:focus-visible::after,
.nk-header .wp-block-navigation .wp-block-navigation-item__content[aria-current]::after,
.nk-header .wp-block-navigation .current-menu-item > .wp-block-navigation-item__content::after,
.nk-header .wp-block-navigation .current-menu-ancestor > .wp-block-navigation-item__content::after,
.nk-header .wp-block-navigation .current_page_parent > .wp-block-navigation-item__content::after {
	transform: scaleX(1);
}

/* Submenus: square, quiet, aligned to the parent item. */
.nk-header .wp-block-navigation .wp-block-navigation-submenu__container {
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 0;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--preset--shadow--soft);
	padding: 0.5rem 0;
}

.nk-header .wp-block-navigation .wp-block-navigation-submenu__container .wp-block-navigation-item__content {
	padding: 0.4rem 1.25rem;
	text-transform: none;
	letter-spacing: 0.01em;
	font-size: 0.875rem;
}

.nk-header .wp-block-navigation .wp-block-navigation-submenu__container .wp-block-navigation-item__content::after {
	display: none;
}

/* Current item inside a dropdown: no room for the sliding rule, so mark it
   with weight instead. */
.nk-header .wp-block-navigation .wp-block-navigation-submenu__container .wp-block-navigation-item__content[aria-current] {
	font-weight: 700;
}

/* Between the nav's natural width and the breakpoint, tighten it up rather
   than letting it push the logo or icons out of the row. */
/* --- Where the menu collapses -------------------------------------------
 * At 14px with 1.25rem between items the six menu items need ~644px, plus a
 * 176px logo and ~150px of icons: the row fits from 1140px up. Measured below
 * that, the logo starts being squeezed as the grid's outer track collapses
 * (172px at 1120, 163px at 1100). WordPress's Navigation block collapses to
 * its overlay at 600px, so without this the 600-1140px range would show a full
 * menu with nowhere to put it.
 *
 * So the overlay breakpoint is moved to 950px to match where the layout
 * actually stops fitting. Core drives this purely with min-width: 600px
 * rules, so reverting them across 600-1139px is enough; the open/close
 * behaviour itself is untouched.
 * --------------------------------------------------------------------- */
@media (min-width: 600px) and (max-width: 1139px) {
	/* Show the hamburger again... */
	.nk-header .wp-block-navigation__responsive-container-open:not(.always-shown) {
		display: flex;
	}

	/* ...and keep the inline menu hidden until it is opened. */
	.nk-header .wp-block-navigation__responsive-container:not(.hidden-by-default):not(.is-menu-open) {
		display: none;
	}
}

/* Mobile arrangement: hamburger, centred logo, icons -- applied wherever the
   menu is collapsed, so it stays in step with the breakpoint above. */
@media (max-width: 1139px) {
	/* Two tracks only: the logo takes the left, the hamburger the right. The
	   icons are relocated into the menu overlay by assets/js/header-icons.js,
	   which keeps a single copy of the mini-cart rather than cloning its
	   interactive markup. */
	.wp-block-group.nk-header-bar {
		grid-template-columns: 1fr auto;
		gap: 0.5rem;
	}

	.wp-block-group.nk-header-brand {
		order: 1;
		grid-column: 1;
		justify-content: flex-start;
	}

	.wp-block-group.nk-header-nav {
		order: 2;
		grid-column: 2;
		justify-content: flex-end;
	}

	/* Bigger than the old 32px -- the mark was getting lost against the
	   hamburger. */
	.nk-header .wp-block-site-logo img {
		height: 48px;
	}

	/* Icons sitting inside the open menu overlay, pinned to its bottom and
	   centred. The overlay content is already a full-height flex column, so
	   margin-top:auto is what pushes the cluster down; justify-content overrides
	   the flex-end used when these sit in the header row. */
	.nk-header-icons.nk-header-icons--in-menu {
		display: flex;
		flex-wrap: wrap;
		align-items: center;
		justify-content: center;
		gap: 0.75rem 1.25rem;
		width: 100%;
		margin-top: auto;
		padding-top: var(--wp--preset--spacing--30);
		padding-bottom: var(--wp--preset--spacing--20);
		border-top: 1px solid rgba(20, 17, 15, 0.15);
	}

	.nk-header-icons--in-menu .nk-icon,
	.nk-header-icons--in-menu .wp-block-woocommerce-mini-cart,
	.nk-header-icons--in-menu .wp-block-woocommerce-customer-account {
		min-width: 2.75rem;
		min-height: 2.75rem;
	}

	/* The search opens to a field rather than staying an icon in here. */
	.nk-header-icons--in-menu .nk-icon-search {
		display: block;
		flex: 1 1 100%;
		order: -1;
	}

	.nk-header-icons--in-menu .nk-icon-search .wp-block-search__inside-wrapper {
		border: 1px solid var(--wp--preset--color--stone);
		background: var(--wp--preset--color--white);
	}

	.nk-header-icons--in-menu .nk-icon-search .wp-block-search__input {
		display: block;
		width: 100%;
		max-width: none;
	}

}

/* Phone-only refinements. */
@media (max-width: 599px) {
	.nk-header-icons .nk-icon,
	.nk-header-icons .wp-block-woocommerce-mini-cart,
	.nk-header-icons .wp-block-woocommerce-customer-account {
		min-width: 2.1rem;
	}

	.nk-header-icons svg {
		width: 20px;
		height: 20px;
	}
}

/* -------------------------------------------------------------------------
 * Archive header (shop + product categories)
 * ---------------------------------------------------------------------- */

.nk-archive-header {
	margin-top: var(--wp--preset--spacing--40);
}

/* Matches the h1 scale in theme.json (this heading is rendered by a PHP block,
   so it does not pick up the element styles automatically). */
.nk-archive-title {
	font-family: var(--wp--preset--font-family--body);
	font-weight: 700;
	letter-spacing: -0.01em;
	line-height: 1.1;
	font-size: clamp(2.125rem, 1.35rem + 3.1vw, 3.5rem);
	margin: 0;
}

.nk-archive-description {
	max-width: 62ch;
	margin-top: var(--wp--preset--spacing--20);
	color: var(--wp--preset--color--ink-soft);
}

.nk-archive-description p:last-child {
	margin-bottom: 0;
}

/* Child-category pills. */
.nk-pills {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin-top: var(--wp--preset--spacing--30);
}

.nk-pill {
	display: inline-block;
	padding: 0.45rem 1.05rem;
	border: 1px solid var(--wp--preset--color--stone);
	border-radius: 999px;
	font-size: 0.8125rem;
	line-height: 1.3;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	background: transparent;
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nk-pill:hover,
.nk-pill:focus {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--alabaster);
}

/* -------------------------------------------------------------------------
 * Breadcrumbs
 * ---------------------------------------------------------------------- */

.nk-breadcrumbs,
.woocommerce-breadcrumb {
	color: var(--wp--preset--color--stone-dark);
	font-size: 0.8125rem;
}

.nk-breadcrumbs a,
.woocommerce-breadcrumb a {
	color: var(--wp--preset--color--stone-dark);
	text-decoration: none;
}

.nk-breadcrumbs a:hover,
.woocommerce-breadcrumb a:hover {
	color: var(--wp--preset--color--ink);
	text-decoration: underline;
}

.nk-breadcrumb-sep {
	display: inline-block;
	width: 1em;
	height: 0.7em;
	margin: 0 0.15em;
	background-color: currentColor;
	opacity: 0.6;
	-webkit-mask: no-repeat center / 0.55em auto url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M1.5 1 6.5 6l-5 5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask: no-repeat center / 0.55em auto url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M1.5 1 6.5 6l-5 5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* -------------------------------------------------------------------------
 * Shop toolbar (result count + sorting)
 * ---------------------------------------------------------------------- */

.nk-shop-toolbar {
	border-bottom: 1px solid var(--wp--preset--color--stone);
	color: var(--wp--preset--color--stone-dark);
}

.nk-shop-toolbar p,
.nk-shop-toolbar .woocommerce-result-count {
	margin: 0;
}

.nk-shop-toolbar select,
.woocommerce-ordering select {
	appearance: none;
	-webkit-appearance: none;
	border: 1px solid var(--wp--preset--color--stone);
	background-color: transparent;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5 6 6.5l5-5' fill='none' stroke='%2314110f' stroke-width='1.5' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 0.75rem center;
	background-size: 0.7rem auto;
	padding: 0.5rem 2.25rem 0.5rem 0.9rem;
	border-radius: 0;
	font-family: inherit;
	font-size: 0.8125rem;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
}

/* -------------------------------------------------------------------------
 * Product cards
 * ---------------------------------------------------------------------- */

/* Two across on phones.
 *
 * WordPress core deliberately forces post-template grids to a single column
 * below 600px, and does it with a specificity hack -- the same class repeated
 * four times:
 *
 *   @media (max-width: 600px) {
 *     .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid
 *     .wp-block-post-template-is-layout-grid.wp-block-post-template-is-layout-grid
 *       { grid-template-columns: 1fr; }
 *   }
 *
 * That is 0-4-0, so no reasonable selector here outranks it and !important is
 * the honest way to override rather than stacking five class names. Matching
 * core's 600px edge so there is no gap between the two rules. */
@media (max-width: 600px) {
	.nk-product-grid.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 1rem 0.75rem;
	}

	/* Tighter type so two cards per row still read cleanly. */
	.nk-product-grid .nk-product-card .wp-block-post-title,
	.nk-product-grid .nk-product-card .wp-block-woocommerce-product-title {
		font-size: 0.9375rem;
		line-height: 1.3;
	}

	.nk-product-grid .nk-card-button .wp-block-button__link,
	.nk-product-grid .nk-product-card .wc-block-components-product-button__button {
		padding: 0.6rem 0.5rem;
		font-size: 0.6875rem;
		letter-spacing: 0.06em;
	}
}

.nk-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.nk-product-media {
	position: relative;
	background: var(--wp--preset--color--white);
	margin-bottom: 0;
}

.nk-product-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.nk-product-card .wp-block-post-title,
.nk-product-card .wp-block-woocommerce-product-title {
	font-family: var(--wp--preset--font-family--body);
	letter-spacing: 0;
	line-height: 1.35;
}

.nk-product-card .wp-block-post-title a {
	text-decoration: none;
}

.nk-product-card .wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.nk-product-card .wp-block-woocommerce-product-price {
	margin-top: 0;
	color: var(--wp--preset--color--ink-soft);
}

.nk-product-card del {
	opacity: 0.55;
	margin-right: 0.4em;
}

.nk-product-card ins {
	text-decoration: none;
	color: var(--wp--preset--color--clay-dark);
}

/* Sale badge, pinned to the image corner. */
.nk-sale-badge,
.nk-product-media .wc-block-components-product-sale-badge {
	position: absolute;
	top: 0.75rem;
	right: 0.75rem;
	z-index: 2;
	background: var(--wp--preset--color--clay);
	color: var(--wp--preset--color--white);
	border-radius: 0;
	padding: 0.3rem 0.6rem;
	font-size: 0.6875rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

/* Add-to-cart on the card: a quiet outline button that fills on hover. */
.nk-card-button {
	margin-top: auto;
}

/* WooCommerce styles .wc-block-components-product-button .wp-block-button__link
   at two classes and loads after this file, so these need three to win. */
.nk-product-card .wp-block-button .wp-block-button__link,
.nk-product-card .wc-block-components-product-button .wp-block-button__link,
.nk-product-card .wc-block-components-product-button__button {
	display: block;
	width: 100%;
	text-align: center;
	background-color: transparent;
	color: var(--wp--preset--color--ink);
	border: 1px solid var(--wp--preset--color--ink);
	border-radius: 0;
	padding: 0.7rem 1rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	text-decoration: none;
	transition: background-color 0.2s ease, color 0.2s ease;
}

.nk-product-card .wp-block-button .wp-block-button__link:hover,
.nk-product-card .wc-block-components-product-button .wp-block-button__link:hover,
.nk-product-card .wc-block-components-product-button__button:hover {
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--alabaster);
}

/* "Added to cart" state keeps the same footprint. */
.nk-product-card .added_to_cart {
	display: block;
	margin-top: 0.4rem;
	text-align: center;
	font-size: 0.6875rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

/* -------------------------------------------------------------------------
 * Single product
 * ---------------------------------------------------------------------- */

.nk-product-gallery img,
.woocommerce-product-gallery img {
	width: 100%;
	height: auto;
	display: block;
}

.woocommerce-product-gallery {
	position: relative;
	background: var(--wp--preset--color--white);
	/* The zoom feature injects an oversized .zoomImg positioned over the
	   gallery; without this it sticks out past the viewport on phones. */
	overflow: hidden;
}

.woocommerce-product-gallery .zoomImg {
	max-width: none;
}

.woocommerce-product-gallery__trigger {
	position: absolute;
	top: 1rem;
	right: 1rem;
	z-index: 2;
	background: var(--wp--preset--color--white);
	border-radius: 999px;
	width: 2.5rem;
	height: 2.5rem;
	display: grid;
	place-items: center;
	text-decoration: none;
	box-shadow: var(--wp--preset--shadow--soft);
}

/* margin stays 0 here on purpose -- WooCommerce's stylesheet loads after this
   file and resets .flex-control-thumbs margin at a higher specificity, so a
   margin-top set here never survives. The row gap is applied to .flex-viewport
   above instead, where nothing competes for it. */
.woocommerce-product-gallery .flex-control-thumbs {
	display: flex;
	gap: 1.125rem;
	list-style: none;
	margin: 0;
	padding: 0;
	width: 100%;
}

/* Four across, sharing the gallery's width, as in the Figma (143px wide on a
   627px gallery with 18px gutters) rather than a fixed 88px huddled left. */
.woocommerce-product-gallery .flex-control-thumbs li {
	flex: 1 1 0;
	min-width: 0;
}

.nk-product-summary .wp-block-post-terms {
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.16em;
	text-transform: uppercase;
	color: var(--wp--preset--color--stone-dark);
}

.nk-product-summary .wp-block-post-terms a {
	text-decoration: none;
	color: inherit;
}

.nk-product-summary .wp-block-woocommerce-product-price {
	color: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--body);
}

.nk-product-excerpt {
	color: var(--wp--preset--color--ink-soft);
	max-width: 52ch;
}

.nk-stock {
	color: var(--wp--preset--color--moss-light);
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
}

/* Add-to-cart form: quantity stepper + full-width primary button. */
.nk-add-to-cart form.cart,
.woocommerce div.product form.cart {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem;
	align-items: stretch;
	margin: 0;
}

.woocommerce div.product form.cart .quantity {
	display: flex;
}

.woocommerce .quantity input.qty {
	width: 5rem;
	height: 100%;
	min-height: 3.1rem;
	padding: 0.5rem;
	text-align: center;
	border: 1px solid var(--wp--preset--color--stone-dark);
	border-radius: 0;
	background: var(--wp--preset--color--white);
	font-family: inherit;
	font-size: 1rem;
}

.woocommerce div.product form.cart button.single_add_to_cart_button {
	flex: 1 1 14rem;
	min-height: 3.1rem;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--alabaster);
	border: 0;
	border-radius: 0;
	padding: 0.95rem 2.25rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 0.2s ease;
}

.woocommerce div.product form.cart button.single_add_to_cart_button:hover {
	background: var(--wp--preset--color--clay);
	color: var(--wp--preset--color--white);
}

.nk-usp p {
	position: relative;
	padding-left: 1.4rem;
	margin: 0;
}

/* Small check mark before each reassurance line. */
.nk-usp p::before {
	content: "";
	position: absolute;
	left: 0;
	top: 0.45em;
	width: 0.85rem;
	height: 0.85rem;
	background-color: var(--wp--preset--color--clay);
	-webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5 6 12.5 14 3.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpath d='M2 8.5 6 12.5 14 3.5' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* -------------------------------------------------------------------------
 * Product info redesign — Figma "Produktinfo" frame (node 370:1594)
 *
 * Gallery tiles get the same light background the theme already uses for
 * photo placeholders (.nk-designer-photo--empty), price leads over the
 * product name, and the summary picks up colour swatches, a clamped
 * "Mer"-toggle excerpt, a borderless quantity stepper and a spec list.
 * ---------------------------------------------------------------------- */

/* --- Gallery: tiled product shots on a light neutral field ------------- */

.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image {
	background: var(--wp--preset--color--stone-light);
}

/* Landscape, not square: the Figma frame's image tile is 627x461 (~1.36).
   4/3 is within 2% of that and a cleaner ratio to reason about. */
.woocommerce-product-gallery__wrapper .woocommerce-product-gallery__image img {
	aspect-ratio: 4 / 3;
	object-fit: contain;
	padding: clamp(1.25rem, 4vw, 2.75rem);
	box-sizing: border-box;
}

/* 143x167 in the Figma -- a shade taller than wide, not square. */
.woocommerce-product-gallery .flex-control-thumbs li img {
	background: var(--wp--preset--color--stone-light);
	width: 100%;
	aspect-ratio: 6 / 7;
	object-fit: contain;
	padding: 0.75rem;
	box-sizing: border-box;
	cursor: pointer;
	transition: opacity 0.2s ease;
}

.woocommerce-product-gallery .flex-control-thumbs li img:hover {
	opacity: 0.82;
}

/* --- Price-then-name heading ---------------------------------------------
 * Three-class selectors throughout, not two: WooCommerce Blocks prints its
 * own CSS for .wp-block-woocommerce-product-price during block render,
 * which lands after this stylesheet in the page -- see the near-identical
 * note on .nk-product-card .wp-block-button .wp-block-button__link further
 * up. At equal specificity, later wins, so the size/weight/colour below need
 * the extra .nk-product-summary ancestor class to actually outrank it. */

.nk-product-summary .nk-price-hero.wp-block-woocommerce-product-price {
	font-size: 2.875rem;
	font-weight: 700;
	color: var(--wp--preset--color--ink-soft);
}

/* The price text itself sits inside nested spans from wc_price() -- set the
   size directly on them too rather than relying on inheritance, so nothing
   in between can reintroduce its own font-size. */
.nk-product-summary .nk-price-hero .wc-block-components-product-price__value,
.nk-product-summary .nk-price-hero .woocommerce-Price-amount {
	font-size: 2.875rem;
	font-weight: 700;
	color: inherit;
}

.nk-product-summary .nk-title-hero.wp-block-post-title {
	font-size: 2.25rem;
	font-weight: 600;
	line-height: 1.15;
	color: var(--wp--preset--color--ink-soft);
}

/* --- Colour swatches ----------------------------------------------------- */

.nk-swatches-group {
	margin-bottom: var(--wp--preset--spacing--30);
}

.nk-swatches-label {
	margin: 0 0 0.5rem;
	font-size: 1rem;
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

.nk-swatches {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.nk-swatch {
	display: inline-block;
	width: 1.35rem;
	height: 1.35rem;
	border: 1px solid rgba(20, 17, 15, 0.12);
}

/* --- Clamped excerpt with a "Mer" / "Mindre" toggle ---------------------- */

.nk-excerpt-toggle {
	margin-bottom: var(--wp--preset--spacing--30);
	max-width: 46rem;
}

.nk-excerpt-toggle .nk-excerpt-body {
	overflow: hidden;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	line-clamp: 3;
	color: var(--wp--preset--color--ink-soft);
}

.nk-excerpt-toggle .nk-excerpt-body p {
	margin: 0;
}

.nk-excerpt-toggle.is-expanded .nk-excerpt-body {
	display: block;
	-webkit-line-clamp: unset;
	line-clamp: unset;
}

.nk-excerpt-more {
	display: inline-block;
	margin-top: 0.4rem;
	background: none;
	border: 0;
	padding: 0;
	font-family: inherit;
	font-size: inherit;
	font-weight: 700;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.nk-excerpt-more:hover {
	color: var(--wp--preset--color--clay);
}

/* --- Borderless quantity stepper ----------------------------------------- */

/* No box around the stepper: the Figma shows a bare "-  1  +" sitting on the
   page, with only the add-to-cart button carrying a fill. */
.nk-add-to-cart .quantity {
	display: inline-flex;
	align-items: center;
	border: 0;
}

.nk-add-to-cart .quantity input.qty {
	width: 2.75rem;
	min-height: auto;
	height: auto;
	border: 0;
	background: transparent;
	padding: 0.6rem 0.25rem;
	font-size: 1.25rem;
	-moz-appearance: textfield;
}

.nk-add-to-cart .quantity input.qty::-webkit-outer-spin-button,
.nk-add-to-cart .quantity input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.nk-qty-btn {
	background: none;
	border: 0;
	padding: 0.5rem 0.75rem;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	color: var(--wp--preset--color--ink);
}

.nk-qty-btn:hover {
	color: var(--wp--preset--color--clay);
}

/* --- Spec list (Ø / H / Vikt) --------------------------------------------- */

.nk-specs {
	margin-top: var(--wp--preset--spacing--30);
	color: var(--wp--preset--color--ink-soft);
}

.nk-specs-label {
	margin: 0 0 0.25rem;
	font-weight: 700;
	color: var(--wp--preset--color--ink);
}

.nk-specs-list {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* woocommerce/product-meta declares no spacing/style support in its own
   block.json, so this can't be set as a block attribute (that mismatch was
   exactly what tripped block validation here) -- it has to live in CSS
   instead. */
.nk-product-summary .wp-block-woocommerce-product-meta {
	margin-top: var(--wp--preset--spacing--30);
}

/* -------------------------------------------------------------------------
 * WooCommerce generic overrides
 * ---------------------------------------------------------------------- */

.woocommerce-message,
.woocommerce-info,
.woocommerce-error,
.wc-block-components-notice-banner {
	border-radius: 0;
	border-left: 3px solid var(--wp--preset--color--clay);
	background: var(--wp--preset--color--white);
	font-size: 0.9375rem;
}

.woocommerce .button,
.wc-block-components-button {
	border-radius: 0 !important;
	font-family: var(--wp--preset--font-family--body);
	letter-spacing: 0.1em;
	text-transform: uppercase;
	font-size: 0.8125rem;
	font-weight: 600;
}

/* Cart and checkout blocks inherit the theme's square, quiet form styling. */
.wc-block-components-text-input input,
.wc-block-components-select select,
.wc-block-components-textarea {
	border-radius: 0 !important;
}

/* WooCommerce's legacy product-grid markup (used by the cart cross-sells)
   scales type down with compounding em units -- .wc-block-grid__product is
   .88889em and the button a further .75em -- which lands at ~10.6px on a
   phone. wc-blocks.css loads after this file, so these resets need one more
   class than WooCommerce's own selectors to win. */
.wc-block-grid .wc-block-grid__product,
.wc-block-grid__products .wc-block-grid__product {
	font-size: 1rem;
}

.wc-block-grid .wc-block-grid__product-title,
.wc-block-grid .wc-block-grid__product-link {
	font-size: 0.9375rem;
	line-height: 1.35;
	text-decoration: none;
}

.wc-block-grid .wc-block-grid__product-price,
.wc-block-grid .wc-block-grid__product .woocommerce-Price-amount {
	font-size: 0.875rem;
}

.wc-block-grid .wc-block-grid__product-add-to-cart.wp-block-button .wp-block-button__link {
	font-size: 0.75rem;
}

/* -------------------------------------------------------------------------
 * Footer
 * ---------------------------------------------------------------------- */

/* Footer copied from the live site: three text columns, the emblem on the
   right, and a full-bleed address strip underneath.

   The markup lives in patterns/footer.php (a PHP pattern, so links and the
   emblem resolve correctly in a subfolder install -- see the note in
   parts/footer.html). */

.nk-footer a {
	color: var(--wp--preset--color--ink);
	text-decoration: none;
}

.nk-footer a:hover,
.nk-footer a:focus-visible {
	color: var(--wp--preset--color--clay);
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.nk-footer {
	padding: clamp(2.5rem, 5vw, 4.5rem) clamp(1.25rem, 5vw, 5rem);
}

.nk-footer-row {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: clamp(2rem, 4vw, 3.5rem);
	width: 100%;
}

.nk-footer-col {
	display: flex;
	flex-direction: column;
	gap: 1.15rem;
	margin: 0;
	flex: 1 1 auto;
	min-width: 0;
}

/* 14px bold headings and 14px links, matching the live site. */
.nk-footer .nk-footer-heading {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 700;
	line-height: 1.5;
	color: var(--wp--preset--color--ink);
}

.nk-footer .nk-footer-lines {
	margin: 0;
	font-size: 0.875rem;
	font-weight: 400;
	line-height: 1.75;
	color: var(--wp--preset--color--ink);
}

/* The emblem renders 132px on the live site; 168px here, as asked. The figure
   must not stretch with the flex row, hence the explicit basis. */
.nk-footer .nk-footer-emblem {
	margin: 0;
	flex: 0 0 auto;
	align-self: center;
	line-height: 0;
}

.nk-footer .nk-footer-emblem img {
	display: block;
	width: 168px;
	height: auto;
}

/* Full-bleed address strip. Its own block so the stone ground runs edge to
   edge while the text stays centred on the page. */
.nk-footer-bottombar {
	padding-top: 0.65rem;
	padding-bottom: 0.65rem;
}

.nk-footer-bottombar .nk-footer-address {
	margin: 0;
	font-size: 0.625rem;
	letter-spacing: 0.02em;
	line-height: 1.6;
}

/* The three columns plus the emblem stop fitting side by side well before the
   phone breakpoint, so they wrap into a block and the emblem centres. */
@media (max-width: 900px) {
	.nk-footer-row {
		flex-wrap: wrap;
		gap: 2.5rem 3rem;
	}

	.nk-footer-col {
		flex: 1 1 40%;
	}

	.nk-footer .nk-footer-emblem {
		flex: 1 1 100%;
		align-self: auto;
	}

	.nk-footer .nk-footer-emblem img {
		margin-inline: auto;
	}
}

@media (max-width: 600px) {
	.nk-footer-row {
		gap: 2rem;
	}

	.nk-footer-col {
		flex: 1 1 100%;
	}
}

/* -------------------------------------------------------------------------
 * Imported (classic) page content
 *
 * The editorial pages were brought over from the old theme as HTML, so their
 * images and tables need sane defaults to sit inside the new layout.
 *
 * They also need the Columns block's OWN core CSS restated here, which is
 * not a duplicate-for-no-reason: WordPress only enqueues each block's
 * stylesheet (wp-includes/blocks/columns/style.css, which normally supplies
 * .wp-block-columns{display:flex} etc.) when it detects a real `<!-- wp:
 * columns -->` comment in the content via has_block(). This imported content
 * is raw HTML that only *looks* like Columns block output (right classes,
 * no block comments) -- has_block() returns false for it, core's Columns
 * CSS never loads, and every multi-column band on these pages collapses to
 * a single stacked column despite the classes being exactly right. This is
 * the minimum needed to restore it; see wp-includes/blocks/columns/style.css
 * for the authoritative version if core's own rules change. */

.wp-block-post-content .wp-block-columns {
	display: flex;
	flex-wrap: wrap;
	box-sizing: border-box;
	align-items: initial;
}

@media (min-width: 782px) {
	.wp-block-post-content .wp-block-columns {
		flex-wrap: nowrap;
	}

	.wp-block-post-content .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
		flex-basis: 0;
		flex-grow: 1;
	}

	.wp-block-post-content .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column[style*="flex-basis"] {
		flex-grow: 0;
	}
}

@media (max-width: 781px) {
	.wp-block-post-content .wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column {
		flex-basis: 100%;
	}
}

.wp-block-post-content .wp-block-column {
	flex-grow: 1;
	min-width: 0;
	word-break: break-word;
	overflow-wrap: break-word;
}

/* Same gap as above: this content sets are-/is-vertically-aligned-* classes
   (e.g. a text column meant to sit centred beside a taller image), but
   without core's Columns CSS loaded there is no rule attaching any meaning
   to them -- the text just sits at the top like everything else. */
.wp-block-post-content .wp-block-columns.are-vertically-aligned-top {
	align-items: flex-start;
}

.wp-block-post-content .wp-block-columns.are-vertically-aligned-center {
	align-items: center;
}

.wp-block-post-content .wp-block-columns.are-vertically-aligned-bottom {
	align-items: flex-end;
}

.wp-block-post-content .wp-block-column.is-vertically-aligned-top {
	align-self: flex-start;
}

.wp-block-post-content .wp-block-column.is-vertically-aligned-center {
	align-self: center;
}

.wp-block-post-content .wp-block-column.is-vertically-aligned-bottom {
	align-self: flex-end;
}

.wp-block-post-content .wp-block-column.is-vertically-aligned-top,
.wp-block-post-content .wp-block-column.is-vertically-aligned-center,
.wp-block-post-content .wp-block-column.is-vertically-aligned-bottom {
	width: 100%;
}

.wp-block-post-content img {
	max-width: 100%;
	height: auto;
}

/* Full-bleed bands stack flush against each other. WordPress's block gap would
   otherwise leave a strip of page background between two coloured sections,
   which reads as a seam rather than as separate bands. Ordinary blocks
   (paragraphs, headings) keep their normal spacing. */
.wp-block-post-content > .alignfull {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* Images are inline by default, so the line box leaves a few pixels of
   descender space under every one -- which reads as a stray gap between
   image-only blocks. Making them block-level removes it at the source. */
.wp-block-image img,
.wp-block-post-content figure img {
	display: block;
}

/* A full-bleed image must actually fill the width. max-width:100% only stops an
   image growing past its container; it never stretches a smaller file up, and
   these sources are 1024px wide inside a 1440px band. */
.wp-block-post-content > .wp-block-image.alignfull img {
	width: 100%;
	height: auto;
}

/* Standalone videos: cap the height so a square source does not dominate. */
.wp-block-video video {
	display: block;
	width: 100%;
	max-height: 620px;
	object-fit: cover;
}

@media (max-width: 781px) {
	.wp-block-video video {
		max-height: 420px;
	}
}

/* Video sitting in one half of a two-column row fills the full height of that
   row instead of leaving a band of background above and below it. flex-basis 0
   with min-height 0 means the video does not push the row taller than the text
   column beside it -- the text sets the height, the video fills it. */
.wp-block-columns .wp-block-column:has(> .wp-block-video) {
	display: flex;
	flex-direction: column;
}

.wp-block-column > .wp-block-video {
	display: flex;
	flex: 1 1 0%;
	min-height: 0;
	margin-top: 0;
	margin-bottom: 0;
}

.wp-block-column > .wp-block-video video {
	width: 100%;
	height: 100%;
	max-height: none;
	object-fit: cover;
}

/* Full-bleed bands run their two halves flush together -- a gutter between a
   photograph and the colour block beside it reads as a seam. The breathing room
   moves inside, as padding on the copy, so the media still reaches the edge. */
.wp-block-post-content .wp-block-columns.alignfull {
	gap: 0;
}

/* Split the band exactly down the middle. border-box is the point: without it
   the padding on the copy column is added outside its flex basis, so the text
   half ends up wider than the media half by exactly the padding. */
.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column {
	box-sizing: border-box;
	flex-basis: 50%;
	flex-grow: 1;
	min-width: 0;
}

/* Breathing room around the text in a two-column band. Only columns holding
   copy are padded -- a column holding the photograph or video stays flush to
   the band's edges. The horizontal padding is what replaces the gutter removed
   above. */
.wp-block-columns .wp-block-column.content-col:not(:has(> .wp-block-video)):not(:has(> .wp-block-image)):not(:has(iframe[src*="/maps/"])) {
	padding-top: clamp(2.5rem, 4vw, 4.5rem);
	padding-bottom: clamp(2.5rem, 4vw, 4.5rem);
	padding-left: clamp(1.5rem, 3vw, 3.5rem);
	padding-right: clamp(1.5rem, 3vw, 3.5rem);
}

/* -------------------------------------------------------------------------
 * Map embeds
 *
 * The Google Maps iframes are authored with width="1400", so inside a half
 * width column they render ~1180px wide and spill straight across the text
 * beside them -- which reads as the text sitting on top of the map. Constrain
 * the embed to its column and let it fill that half like a photograph does.
 * ---------------------------------------------------------------------- */

.wp-block-post-content iframe[src]:not([src="about:blank"]) {
	display: block;
	width: 100%;
	max-width: 100%;
	border: 0;
}

/* Full-bleed media halves on content pages (Produktion, Besök oss): the same
   taller proportion as the Start page bands, so the two pages read alike. */
.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column:has(> .wp-block-video),
.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column:has(> .wp-block-image) {
	min-height: 600px;
}

.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column > .wp-block-image {
	margin: 0;
	height: 100%;
}

.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column > .wp-block-image img {
	width: 100%;
	height: 100%;
	min-height: 600px;
	object-fit: cover;
	display: block;
}

@media (max-width: 781px) {
	.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column:has(> .wp-block-video),
	.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column:has(> .wp-block-image) {
		min-height: 0;
	}

	.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column > .wp-block-image img {
		min-height: 0;
		height: auto;
		aspect-ratio: 4 / 3;
	}
}

/* The half holding a map runs flush to the band edges, no inner padding.
   !important because the imported markup sets the column padding inline, and
   an inline declaration cannot be beaten by specificity alone. */
.wp-block-post-content .wp-block-column:has(iframe[src*="/maps/"]) {
	display: flex;
	flex-direction: column;
	padding: 0 !important;
	min-height: 0;
}

.wp-block-post-content .wp-block-column:has(iframe[src*="/maps/"]) > .wp-block-group {
	display: flex;
	flex: 1 1 auto;
	min-height: 0;
	max-width: none;
	padding-left: 0;
	padding-right: 0;
}

.wp-block-post-content .wp-block-column:has(iframe[src*="/maps/"]) iframe[src*="/maps/"] {
	flex: 1 1 auto;
	min-height: 380px;
	height: 100%;
}

/* Generous vertical padding on the text half of a map band. The text column is
   what sets the row height, and the map fills that height -- so padding here is
   what makes the map taller, and stops the copy sitting flush against the band
   edges (the bottom "Öppettider" had none at all). !important because the
   imported markup sets the column padding inline. */
.wp-block-post-content .wp-block-columns:has(iframe[src*="/maps/"]) > .wp-block-column:not(:has(iframe[src*="/maps/"])) {
	padding-top: clamp(3.5rem, 7vw, 7rem) !important;
	padding-bottom: clamp(3.5rem, 7vw, 7rem) !important;
	padding-left: clamp(1.5rem, 3vw, 3.5rem) !important;
	padding-right: clamp(1.5rem, 3vw, 3.5rem) !important;
}

@media (max-width: 781px) {
	.wp-block-post-content .wp-block-column:has(iframe[src*="/maps/"]) iframe[src*="/maps/"] {
		min-height: 300px;
	}
}

/* -------------------------------------------------------------------------
 * Designer portraits — shared base rules
 *
 * Originally built for a single long /formgivare/ page listing every
 * designer stacked vertically, portrait beside biography. That page has
 * been retired in favour of individual designer posts with their own grid
 * (.nk-designer-card, further down) and single page (.nk-designer-single-*);
 * these two rules are the part still in use -- the shared photo treatment,
 * including the lettered fallback tile for a designer with no photo on file
 * (currently Mats Nyman) -- rendered by nittsjokeramik_render_designer_photo()
 * in functions.php on both.
 * ---------------------------------------------------------------------- */

.nk-designer-photo {
	margin: 0;
}

.nk-designer-photo img {
	display: block;
	width: 100%;
	aspect-ratio: 3 / 4;
	object-fit: cover;
	object-position: center top;
	background-color: var(--wp--preset--color--stone-light);
}

.nk-designer-photo--empty {
	display: grid;
	place-items: center;
	width: 100%;
	aspect-ratio: 3 / 4;
	background-color: var(--wp--preset--color--stone-light);
	color: var(--wp--preset--color--stone-dark);
	/* On the archive grid this renders as an <a> (isLink:true), which
	   otherwise picks up the browser's default link underline under the
	   initials. */
	text-decoration: none;
}

.nk-designer-photo--empty span {
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
}

/* -------------------------------------------------------------------------
 * Återförsäljare — image left, Gravity Form right
 * ---------------------------------------------------------------------- */

.wp-block-post-content .wp-block-columns.nk-reseller {
	padding-left: 0;
	padding-right: 0;
	align-items: stretch;
}

/* The photograph runs flush to the band edge and fills its half, matching the
   editorial bands on the other pages. */
.nk-reseller .nk-reseller-media {
	padding: 0 !important;
	display: flex;
}

.nk-reseller .nk-reseller-image,
.nk-reseller .nk-reseller-image img {
	margin: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

/* Gravity Forms sets its own font stack; keep the form in the theme's face. */
.nk-reseller-body .gform_wrapper,
.nk-reseller-body .gform_wrapper input,
.nk-reseller-body .gform_wrapper textarea,
.nk-reseller-body .gform_wrapper select,
.nk-reseller-body .gform_wrapper button {
	font-family: var(--wp--preset--font-family--body);
}

.nk-reseller-body .gform_wrapper .gform_footer input[type="submit"] {
	background-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--alabaster);
	border: 0;
	border-radius: 0;
	padding: 0.95rem 2.25rem;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	cursor: pointer;
}

.nk-reseller-body .gform_wrapper .gform_footer input[type="submit"]:hover {
	background-color: var(--wp--preset--color--clay);
	color: var(--wp--preset--color--white);
}

@media (max-width: 781px) {
	/* Stacked: cap the photograph so it does not push the form off-screen. */
	.nk-reseller .nk-reseller-image img {
		max-height: 360px;
	}
}

/* Membership tiers: three separate coloured cards, so they need a gutter
   between them -- unlike the full-bleed editorial bands above, which are meant
   to run flush. Equal thirds, stacking on narrow screens. */
.wp-block-post-content .wp-block-columns.nk-plans {
	gap: clamp(1rem, 2vw, 2rem);
	align-items: stretch;
}

.wp-block-post-content .wp-block-columns.nk-plans > .wp-block-column {
	box-sizing: border-box;
	flex-basis: 33.333%;
	display: flex;
	flex-direction: column;
}

/* Push the price button to the bottom so the three cards line up however
   different the list lengths are. */
.nk-plans > .wp-block-column > .wp-block-buttons {
	margin-top: auto;
	padding-top: 1.5rem;
}

.nk-plans .wp-block-heading {
	margin-top: 0;
}

/* Rule above the feature list. WordPress centres separators with auto side
   margins, which collapse to zero width inside the flex column above -- hence
   width:100% and align-self:stretch. Drawn as a top border in a translucent
   ink so it reads on all three card colours. */
.nk-plans .wp-block-separator {
	width: 100%;
	align-self: stretch;
	height: 0;
	margin: 1.35rem 0;
	border: 0;
	border-top: 1px solid rgba(20, 17, 15, 0.28);
	background: none;
	opacity: 1;
}

.nk-plans ul {
	margin-top: 0;
	padding-left: 1.1rem;
}

.nk-plans ul li {
	margin-bottom: 0.45rem;
}

@media (max-width: 781px) {
	.wp-block-post-content .wp-block-columns.nk-plans > .wp-block-column {
		flex-basis: 100%;
	}
}

/* WordPress applies block-layout justification through generated
   .wp-container-* rules. Content imported from the old theme carries the
   is-content-justification-* marker classes but never got those rules, so the
   classes are inert -- an "add to cart" button meant to be centred sat hard
   left. Give the markers their meaning directly. */
.wp-block-buttons.is-content-justification-center {
	justify-content: center;
}

.wp-block-buttons.is-content-justification-right {
	justify-content: flex-end;
}

.wp-block-buttons.is-content-justification-left {
	justify-content: flex-start;
}

.wp-block-buttons.is-content-justification-space-between {
	justify-content: space-between;
}

.wp-block-post-content table {
	width: 100%;
	border-collapse: collapse;
	display: block;
	overflow-x: auto;
}

.wp-block-post-content td,
.wp-block-post-content th {
	border: 1px solid var(--wp--preset--color--stone);
	padding: 0.6rem 0.8rem;
	text-align: left;
}

/* -------------------------------------------------------------------------
 * Hero
 * ---------------------------------------------------------------------- */

/* WordPress separates top-level blocks with the global block gap, which lands
   1.5rem of margin-block-start on <main> and shows as a strip of page
   background between the header and the hero. Collapse it only where <main>
   actually opens with the hero -- every other template keeps the breathing
   room. Keyed on the hero rather than on a body class so it follows the block,
   whichever page the hero is used on. Browsers without :has() simply keep the
   existing gap, which is a cosmetic fallback rather than a broken layout. */
main.wp-block-group:has(> .nk-hero:first-child) {
	margin-block-start: 0;
}

/* Same idea at the bottom of the page. WordPress's block gap puts 1.5rem on the
   footer template part, which stops a full-bleed band meeting the footer. Only
   remove it after a flush page -- pages that end in ordinary text still want
   that separation, so the default page template is untouched. */
.nk-page-flush + .wp-block-template-part,
.nk-front + .wp-block-template-part {
	margin-block-start: 0;
}

/* The front page is a stack of full-bleed bands, each carrying its own vertical
   padding. WordPress's block gap adds 1.5rem between every top-level block on
   top of that, which shows as a strip of page background between sections.
   Collapse it so the bands meet edge to edge.

   The second selector matters since the content moved into the Start page: the
   bands are now children of .wp-block-post-content rather than of <main>, so
   the first selector alone no longer reaches them. */
.nk-front > *,
.nk-front .wp-block-post-content > * {
	margin-block-start: 0;
	margin-block-end: 0;
}

/* The hero is sized by the video's own 16:9 frame rather than a fraction of the
   viewport, so the footage is never cropped top and bottom.
   Both declarations need !important: the Cover block writes its sizing as an
   inline style, and an inline style outranks any selector here. Without it the
   ratio computes to `auto` and, with min-height already zeroed, the hero
   collapses to a 34px sliver. */
.nk-hero {
	aspect-ratio: 1920 / 1080 !important;
	min-height: 0 !important;
	height: auto;

	/* Still image behind the video: paints immediately, covers the gap before
	   the first frame decodes, and is what remains if the video is blocked,
	   fails, or is suppressed for reduced motion. */
	background-image: url("assets/images/workshop.jpg");
	background-size: cover;
	background-position: center;
	background-repeat: no-repeat;
}

.nk-hero .wp-block-cover__video-background {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	/* Sits above the still image but below the overlay and the copy. */
	z-index: 0;
}

/* Honour a reduced-motion preference: drop the moving footage and let the
   still image show through. */
@media (prefers-reduced-motion: reduce) {
	.nk-hero .wp-block-cover__video-background {
		display: none;
	}
}

/* Keep the hero copy legible even where the photograph is light. */
.nk-hero .wp-block-cover__inner-container {
	text-shadow: 0 1px 24px rgba(20, 17, 15, 0.45);
}

.nk-tile .wp-block-cover__inner-container h3 a {
	text-decoration: none;
	color: inherit;
}

/* Make the whole tile clickable-looking. */
.nk-tile:hover .wp-block-cover__inner-container h3 a {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* -------------------------------------------------------------------------
 * Shop archive product cards (Figma "Produkter", node 238:2271)
 *
 * A departure from the cards used on the front page: the photograph sits
 * *contained* on a soft grey tile rather than cropped edge to edge, and the
 * add-to-cart button is replaced by a price row with favourite + bag icons.
 *
 * Scoped to .nk-tile-card so the front-page and related-product grids keep
 * their existing look until that rollout is asked for.
 * ---------------------------------------------------------------------- */

:root {
	/* Tile ground behind archive product shots. */
	--nk-tile-bg: #f4f3f1;
}

.nk-tile-card {
	position: relative;
	display: flex;
	flex-direction: column;
}

/* The grey square. Padding insets the shot so it never touches the edge. */
.nk-tile-card .nk-tile-media {
	background: var(--nk-tile-bg);
	padding: 1rem;
	margin-bottom: 0;
}

/* post-featured-image emits inline `aspect-ratio:1;object-fit:contain` from
   the block's aspectRatio/scale attributes, which is what keeps the whole pot
   visible -- the generic `.nk-product-media img { object-fit: cover }` rule
   above cannot reach past an inline style. */
.nk-tile-card .nk-image-contain,
.nk-tile-card .nk-image-contain img {
	display: block;
	width: 100%;
}

.nk-tile-card .nk-tile-body {
	display: flex;
	flex-direction: column;
	gap: 0;
	padding: 1rem 0.5rem;
	margin-top: 0;
}

.nk-tile-card .nk-tile-title {
	margin: 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1.25rem;
	font-weight: 700;
	line-height: 1.7;
	letter-spacing: 0;
	color: var(--wp--preset--color--ink);
}

.nk-tile-card .nk-tile-title a {
	color: inherit;
	text-decoration: none;
}

.nk-tile-card .nk-tile-title a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

/* Price left, icon pair right. nowrap so a long price never pushes the icons
   onto a second line -- the price truncates instead. */
.nk-tile-card .nk-tile-meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	flex-wrap: nowrap;
	margin-top: 0;
	min-height: 1.75rem;
}

/* Three classes: WooCommerce ships its own price rules and loads after this
   file, and the .nk-product-card colour rule above is equally specific. */
.nk-tile-card .nk-tile-meta .nk-tile-price {
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	font-size: 1.25rem;
	font-weight: 400;
	line-height: 1.7;
	color: var(--wp--preset--color--ink);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.nk-tile-card .nk-tile-actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	flex: 0 0 auto;
	flex-wrap: nowrap;
	margin: 0;
}

/* --- The two icon controls ------------------------------------------- */

/* Shared footprint. Both glyphs are painted as masks from the SVGs exported
   from Figma, so they inherit currentColor and can change on hover/active --
   an <img> could not be recoloured.
   Three selectors for "add to cart" because it can render as three different
   things depending on where the card came from: the woocommerce/product-button
   *block* (shop archive, .wc-block-components-product-button__button, with a
   .wp-block-button__link fallback for e.g. out-of-stock), or the classic
   woocommerce_template_loop_add_to_cart() template function (product slider,
   .add_to_cart_button) -- used there because it works over plain ajax rather
   than needing the Blocks Interactivity API wired up by hand. */
.nk-tile-card .nk-fav,
.nk-tile-card .nk-tile-bag .wc-block-components-product-button__button,
.nk-tile-card .nk-tile-bag .wp-block-button__link,
.nk-tile-card .nk-tile-bag .add_to_cart_button {
	display: block;
	width: 24px;
	height: 24px;
	min-width: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	background-color: transparent;
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	/* Collapses the button's own label to nothing while leaving it in the
	   accessibility tree, so the control still announces itself. */
	font-size: 0;
	line-height: 0;
	text-indent: 0;
	overflow: hidden;
	transition: color 0.2s ease, transform 0.2s ease;
}

.nk-tile-card .nk-fav__icon,
.nk-tile-card .nk-tile-bag .wc-block-components-product-button__button::before,
.nk-tile-card .nk-tile-bag .wp-block-button__link::before,
.nk-tile-card .nk-tile-bag .add_to_cart_button::before {
	content: "";
	display: block;
	width: 24px;
	height: 24px;
	background-color: currentColor;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.nk-tile-card .nk-fav__icon {
	-webkit-mask-image: url("assets/icons/favorite.svg");
	mask-image: url("assets/icons/favorite.svg");
}

.nk-tile-card .nk-tile-bag .wc-block-components-product-button__button::before,
.nk-tile-card .nk-tile-bag .wp-block-button__link::before,
.nk-tile-card .nk-tile-bag .add_to_cart_button::before {
	-webkit-mask-image: url("assets/icons/local-mall.svg");
	mask-image: url("assets/icons/local-mall.svg");
}

.nk-tile-card .nk-fav:hover,
.nk-tile-card .nk-tile-bag .wc-block-components-product-button__button:hover,
.nk-tile-card .nk-tile-bag .wp-block-button__link:hover,
.nk-tile-card .nk-tile-bag .add_to_cart_button:hover {
	background-color: transparent;
	color: var(--wp--preset--color--clay);
	transform: translateY(-1px);
}

/* Saved state. The exported glyph is the outline heart, so "on" reads as a
   colour change rather than a fill swap. */
.nk-tile-card .nk-fav.is-active {
	color: var(--wp--preset--color--clay);
}

.nk-tile-card .nk-fav:focus-visible,
.nk-tile-card .nk-tile-bag .wc-block-components-product-button__button:focus-visible,
.nk-tile-card .nk-tile-bag .add_to_cart_button:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 3px;
}

/* WooCommerce appends a "View cart" link after an ajax add; it would break the
   24px icon row, so it moves under the card instead. */
.nk-tile-card .nk-tile-actions .added_to_cart {
	position: absolute;
	left: 0;
	bottom: -1.35rem;
	font-size: 0.6875rem;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	white-space: nowrap;
}

.nk-tile-card .nk-tile-bag {
	margin: 0;
	line-height: 0;
}

/* Two per row on phones, matching the rest of the theme. The core 4x-repeated
   grid rule is overridden for .nk-product-grid further up; these just retune
   the type so the card still reads at half width. */
@media (max-width: 600px) {
	.nk-tile-grid .nk-tile-card .nk-tile-title {
		font-size: 0.9375rem;
		line-height: 1.4;
	}

	.nk-tile-grid .nk-tile-card .nk-tile-meta .nk-tile-price {
		font-size: 0.875rem;
	}

	.nk-tile-card .nk-tile-body {
		padding: 0.75rem 0.25rem;
	}

	.nk-tile-card .nk-tile-media {
		padding: 0.75rem;
	}
}

/* Column counts. WP derives these from minimumColumnWidth with auto-fill,
   which drops to 2 across the tablet range; pinning them keeps the design's
   four-up on desktop and a sensible three-up between. Two classes so these
   outrank the .wp-container-* layout rule WP prints after this file.
   Below 601px the .nk-product-grid rule further up forces two. */
@media (min-width: 601px) {
	.nk-tile-grid.is-layout-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (min-width: 1200px) {
	.nk-tile-grid.is-layout-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* -------------------------------------------------------------------------
 * Product slider block — Figma "Items_window" (node 367:1310)
 *
 * The cards themselves are .nk-tile-card, styled above for the shop archive;
 * this section only adds the horizontal scroll-snap track and its controls.
 * ---------------------------------------------------------------------- */

.nk-slider-block {
	padding-top: var(--wp--preset--spacing--70);
	padding-bottom: var(--wp--preset--spacing--70);
}

.nk-slider-header {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	margin-bottom: var(--wp--preset--spacing--50);
}

.nk-slider-heading {
	margin: 0;
	font-size: var(--wp--preset--font-size--x-large);
}

.nk-slider-all-link {
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.05em;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	border-bottom: 1px solid var(--wp--preset--color--ink);
	padding-bottom: 0.2rem;
	white-space: nowrap;
}

.nk-slider-all-link:hover {
	color: var(--wp--preset--color--clay);
	border-bottom-color: var(--wp--preset--color--clay);
}

.nk-slider {
	position: relative;
}

.nk-slider-track {
	display: flex;
	gap: 1.75rem;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding-bottom: 0.25rem;
	/* The arrows (and swipe/trackpad scrolling, which still works underneath)
	   are the intended controls -- no visible scrollbar competing with them. */
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.nk-slider-track::-webkit-scrollbar {
	display: none;
}

.nk-slider-slide {
	flex: 0 0 auto;
	width: 284px;
	scroll-snap-align: start;
}

/* The card component sizes its image from a CSS class + inline aspect-ratio
   normally written by the post-featured-image block's own attributes (see
   the .nk-tile-card comment above); this render builds the <img> directly
   with $product->get_image(), so the same sizing is stated here instead. */
.nk-slider-slide .nk-tile-media img {
	aspect-ratio: 1 / 1;
	object-fit: contain;
	width: 100%;
	height: auto;
	display: block;
}

/* Arrows float over the image row rather than sitting beside the track
   (Figma node 344:1485) -- a single soft circular button, vertically
   centred on the square image tile, overlapping its trailing edge. The
   tile is a fixed square (.nk-slider-slide's width, set above), so that
   width doubles as the vertical centre-point: no JS measurement needed. */
.nk-slider-arrow {
	position: absolute;
	top: 142px; /* half of .nk-slider-slide's 284px */
	transform: translateY(-50%);
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 2.75rem;
	height: 2.75rem;
	border: 0;
	border-radius: 50%;
	background: var(--wp--preset--color--white);
	box-shadow: var(--wp--preset--shadow--lifted);
	color: var(--wp--preset--color--ink);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease;
}

/* Absent, not just dimmed, once the track can't scroll further that way --
   matches the reference design, which only ever shows the one arrow that
   still does something. */
.nk-slider-arrow[hidden] {
	display: none;
}

.nk-slider-prev {
	left: 0.75rem;
}

.nk-slider-next {
	right: 0.75rem;
}

.nk-slider-arrow:hover {
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--alabaster);
}

.nk-slider-arrow-icon {
	display: block;
	width: 13px;
	height: 13px;
	background-color: currentColor;
	-webkit-mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M1.5 1 6.5 6l-5 5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
	mask: no-repeat center / contain url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 8 12'%3E%3Cpath d='M1.5 1 6.5 6l-5 5' fill='none' stroke='%23000' stroke-width='1.6' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* The base path already points right (it's the same chevron used for the
   breadcrumb separator); mirror it for "previous". */
.nk-slider-prev .nk-slider-arrow-icon {
	transform: scaleX(-1);
}

@media (max-width: 600px) {
	.nk-slider-slide {
		width: 220px;
	}

	.nk-slider-arrow {
		top: 110px; /* half of .nk-slider-slide's 220px on phones */
		width: 2.25rem;
		height: 2.25rem;
	}

	.nk-slider-track {
		gap: 1rem;
	}
}

/* -------------------------------------------------------------------------
 * Designers — grid archive (Figma nodes 376:2474 grid, 376:2308 with hero)
 * and single designer page (Figma node 238:3404)
 * ---------------------------------------------------------------------- */

/* --- Hero: big logo + intro text ----------------------------------------
 * The header's own small logo starts invisible on this page only -- the
 * big logo below stands in for it until the visitor scrolls past it, at
 * which point assets/js/designer-hero.js adds .nk-header-logo-visible to
 * <body> to reveal it. A crossfade rather than a literal moving/morphing
 * logo: it reads the same as the spec ("the logo appears in the corner
 * when you scroll") without a fragile shared-element transform animation
 * this theme has no infrastructure for. */

.nk-designer-hero {
	padding-top: clamp(2.5rem, 6vw, 5rem);
	padding-bottom: clamp(2.5rem, 6vw, 4rem);
	text-align: center;
}

.nk-designer-hero-logo {
	margin-bottom: var(--wp--preset--spacing--30);
}

.nk-designer-hero-text {
	max-width: 46rem;
	margin-inline: auto;
	color: var(--wp--preset--color--ink-soft);
}

.post-type-archive-designer .nk-header .wp-block-site-logo,
.post-type-archive-designer .nk-header .nk-site-title-fallback {
	opacity: 0;
	transition: opacity 0.3s ease;
}

.post-type-archive-designer.nk-header-logo-visible .nk-header .wp-block-site-logo,
.post-type-archive-designer.nk-header-logo-visible .nk-header .nk-site-title-fallback {
	opacity: 1;
}

/* --- Grid ------------------------------------------------------------- */

.nk-designer-grid.is-layout-grid {
	gap: 4rem clamp(2rem, 6vw, 7.75rem);
}

/* Two classes to outrank the .wp-container-* layout rule WordPress prints
   after this file -- same reasoning as .nk-tile-grid further up. */
@media (min-width: 601px) {
	.nk-designer-grid.is-layout-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (min-width: 900px) {
	.nk-designer-grid.is-layout-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

.nk-designer-card {
	display: flex;
	flex-direction: column;
	gap: 1.6rem;
}

.nk-designer-card .nk-designer-photo {
	margin: 0;
	width: 100%;
	aspect-ratio: 13 / 16;
	overflow: hidden;
}

.nk-designer-card .nk-designer-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: filter 0.25s ease;
}

/* Hover cue from the spec: the image lightens and the cursor becomes a
   pointer, making it unambiguous the photo is clickable. */
.nk-designer-card:hover .nk-designer-photo img {
	filter: brightness(1.12);
}

.nk-designer-card .nk-designer-photo,
.nk-designer-card .nk-designer-photo a {
	cursor: pointer;
}

.nk-designer-card .wp-block-post-title {
	margin: 0;
	font-size: 1.5rem;
	font-weight: 600;
	line-height: 1.3;
}

.nk-designer-card .wp-block-post-title a {
	color: inherit;
	text-decoration: none;
}

.nk-designer-card .wp-block-post-title a:hover {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.nk-designer-card .wp-block-post-excerpt {
	margin: 0;
	color: var(--wp--preset--color--ink-soft);
}

.nk-designer-card .wp-block-post-excerpt p {
	margin: 0;
}

/* --- Single designer page -------------------------------------------- */

.nk-designer-single-header {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2.4rem;
	padding-top: clamp(2rem, 5vw, 4rem);
	padding-bottom: clamp(3rem, 6vw, 5rem);
	text-align: center;
}

.nk-designer-single-photo {
	margin: 0;
	width: 22.5rem;
	max-width: 100%;
	aspect-ratio: 6 / 7;
}

.nk-designer-single-photo img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.nk-designer-single-name.wp-block-post-title {
	margin: 0;
	font-size: 2.5rem;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.01em;
}

.nk-designer-single-bio {
	max-width: 47.5rem;
	color: var(--wp--preset--color--ink);
}

.nk-designer-single-bio > * {
	margin-bottom: 1rem;
}

.nk-designer-single-bio > *:last-child {
	margin-bottom: 0;
}

@media (max-width: 600px) {
	.nk-designer-single-photo {
		width: 16rem;
	}

	.nk-designer-single-name.wp-block-post-title {
		font-size: 1.75rem;
	}
}

/* -------------------------------------------------------------------------
 * Shop pagination
 *
 * Never appeared in local testing because the catalogue fitted on one page;
 * it only shows up once a store has more products than its per-page setting,
 * so it was still carrying WordPress's bare default links.
 *
 * Two classes throughout: WP prints the block's own .wp-container-* layout
 * rules after this stylesheet, so single-class selectors lose on source order.
 * ---------------------------------------------------------------------- */

.nk-pagination.wp-block-query-pagination {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 0.5rem;
	margin-top: var(--wp--preset--spacing--60);
}

.nk-pagination .wp-block-query-pagination-numbers {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.25rem;
	margin: 0;
}

/* Square targets, matching the flat card/button language rather than the
   rounded category chips above the grid. 44px keeps them tappable. */
.nk-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	/* border-box so min-width/height are the *outer* size: without it the
	   padding and border are added on top and a single digit renders 65x46. */
	box-sizing: border-box;
	min-width: 44px;
	height: 44px;
	padding: 0 0.6rem;
	border: 1px solid transparent;
	font-family: var(--wp--preset--font-family--body);
	font-size: 0.9375rem;
	line-height: 1;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	transition: background-color 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.nk-pagination a.page-numbers:hover,
.nk-pagination a.page-numbers:focus-visible {
	background-color: var(--nk-tile-bg);
	border-color: var(--wp--preset--color--stone);
	color: var(--wp--preset--color--ink);
}

/* The page you are on: solid, so it reads at a glance. */
.nk-pagination .page-numbers.current {
	background-color: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--white);
	font-weight: 700;
}

/* The gap marker is not a control. */
.nk-pagination .page-numbers.dots {
	min-width: 1.5rem;
	padding: 0;
	color: var(--wp--preset--color--stone-dark);
	pointer-events: none;
}

/* Prev / next read as the theme's other quiet actions: uppercase and tracked. */
.nk-pagination .wp-block-query-pagination-previous,
.nk-pagination .wp-block-query-pagination-next {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	box-sizing: border-box;
	height: 44px;
	padding: 0 0.9rem;
	border: 1px solid var(--wp--preset--color--stone);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.11em;
	text-transform: uppercase;
	text-decoration: none;
	color: var(--wp--preset--color--ink);
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.nk-pagination .wp-block-query-pagination-previous:hover,
.nk-pagination .wp-block-query-pagination-next:hover,
.nk-pagination .wp-block-query-pagination-previous:focus-visible,
.nk-pagination .wp-block-query-pagination-next:focus-visible {
	background-color: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--alabaster);
}

/* Arrows, added in CSS so the block keeps its plain text label. */
.nk-pagination .wp-block-query-pagination-previous::before {
	content: "\2190";
	font-size: 1rem;
	letter-spacing: 0;
}

.nk-pagination .wp-block-query-pagination-next::after {
	content: "\2192";
	font-size: 1rem;
	letter-spacing: 0;
}

.nk-pagination .page-numbers:focus-visible,
.nk-pagination .wp-block-query-pagination-previous:focus-visible,
.nk-pagination .wp-block-query-pagination-next:focus-visible {
	outline: 2px solid var(--wp--preset--color--ink);
	outline-offset: 2px;
}

/* On a phone the two word labels plus the numbers will not sit on one line.
   Put prev/next on their own row, with the numbers centred between them. */
@media (max-width: 600px) {
	.nk-pagination.wp-block-query-pagination {
		gap: 0.75rem;
	}

	.nk-pagination .wp-block-query-pagination-numbers {
		order: -1;
		flex-basis: 100%;
		justify-content: center;
	}

	.nk-pagination .page-numbers {
		min-width: 40px;
		height: 40px;
		font-size: 0.875rem;
	}

	.nk-pagination .wp-block-query-pagination-previous,
	.nk-pagination .wp-block-query-pagination-next {
		font-size: 0.6875rem;
		padding: 0 0.75rem;
	}
}

/* -------------------------------------------------------------------------
 * Front page: title band and the three centred feature bands
 *
 * The hero is now video only, so the page's h1 moved out of it into its own
 * band, and the feature bands switched from left-aligned editorial copy to the
 * live site's centred stack: cut-out product shot, title, caption, button.
 *
 * These build on the .nk-feature rules further up -- only the differences are
 * declared here.
 * ---------------------------------------------------------------------- */

/* WordPress leaves .wp-block-column as content-box, so on a padded column
   flex-basis:50% measures the content box only. The copy column's side padding
   is then added on top, the two halves total more than the row, and flex-shrink
   splits them unevenly (677/763 rather than 720/720 at 1440px). border-box
   makes the declared 50% mean the whole column, restoring the exact split. */
.nk-feature .wp-block-column {
	box-sizing: border-box;
}

/* Hero with no copy: nothing to keep legible, so no overlay tint. */
.nk-hero--bare .wp-block-cover__background {
	background: none;
}

.nk-hero--bare .wp-block-cover__inner-container {
	/* The empty inner container would otherwise still claim the cover's
	   min-height's worth of stacking context and catch pointer events. */
	pointer-events: none;
}

/* No width cap on the title. Dropping the theme's own max-width is not enough:
   the band is a constrained container, and WordPress caps every child of one at
   the global content size (1180px). `none` opts this heading out of that. */
.nk-page-title-band .nk-page-title {
	margin: 0;
	max-width: none;
}

/* --- centred band variant --------------------------------------------- */

.nk-feature--centered .nk-feature-body {
	text-align: center;
}

/* The base .nk-feature rules cap copy width for left-aligned editorial text;
   centred content should sit centred in the column instead. */
@media (min-width: 782px) {
	.nk-feature--centered .nk-feature-body > * {
		max-width: 30rem;
		margin-inline: auto;
	}
}

/* `margin: 0 0 X` would reset the side margins to 0 and cancel the
   `margin-inline: auto` above, leaving the title and caption sitting hard
   against the column's left padding while the (auto-margined) cut-out and
   button stayed centred -- a 77px mismatch at 1440px. Keep the auto. */
.nk-feature--centered .nk-feature-title {
	margin: 0 auto 0.5rem;
	font-size: clamp(1.75rem, 3vw, 2.5rem);
	line-height: 1.2;
}

.nk-feature--centered .nk-feature-caption {
	margin: 0 auto 1.75rem;
	font-size: 1rem;
	line-height: 1.6;
}

/* The cut-out product shot above the title. Height-capped rather than
   width-capped so the three -- which have very different aspect ratios --
   read as the same visual weight.

   Each rule is written twice. The "Full-bleed media halves on content pages"
   block further down forces height:100% / min-height:600px / object-fit:cover
   onto any image sitting directly in an alignfull column inside post-content.
   That was only ever meant for Produktion and Besök oss, but once the Start
   page's content moved out of the theme pattern and into a page, the feature
   bands began matching it too. It is the right treatment for the band
   photograph and the wrong one for the small cut-out -- and min-height beats
   max-height in the cascade, so a cap alone cannot win. The second selector in
   each pair outranks it (0,6,1 against 0,5,1) and resets what it imposes. */
.nk-feature--centered .nk-feature-cutout,
.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column > .wp-block-image.nk-feature-cutout {
	margin: 0 auto 1.5rem;
	height: auto;
	min-height: 0;
	display: flex;
	justify-content: center;
}

.nk-feature--centered .nk-feature-cutout img,
.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column > .wp-block-image.nk-feature-cutout img {
	width: auto;
	max-width: 100%;
	height: auto;
	min-height: 0;
	max-height: 260px;
	object-fit: contain;
}

@media (max-width: 781px) {
	/* The editorial rule has a mobile companion that additionally imposes
	   aspect-ratio: 4/3. Left in place it squares every cut-out to the same
	   240x180 box; `auto` gives each one its own proportions back. */
	.nk-feature--centered .nk-feature-cutout img,
	.wp-block-post-content .wp-block-columns.alignfull > .wp-block-column > .wp-block-image.nk-feature-cutout img {
		max-height: 180px;
		aspect-ratio: auto;
	}
}

/* The band photograph must not inherit the product-card contain treatment. */
.nk-feature--centered .nk-feature-image img {
	object-fit: cover;
}

/* -------------------------------------------------------------------------
 * Single product: gallery fit and the description moved into the summary
 * ---------------------------------------------------------------------- */

/* The gallery was rendering at its image's own width (512px) inside a much
   wider column, which is what produced the ~254px void before the summary --
   the column gap itself was only 36px. Forcing the gallery and the flexslider
   viewport it builds to fill the column closes it.

   Deliberately NOT .woocommerce-product-gallery__wrapper: that is FlexSlider's
   sliding track, which it sets to `width: 800%` inline so every slide can sit
   side by side and be translated into view. An inline width outranks this
   rule, but `max-width` here is unopposed -- clamping the track to 100% pins
   all the slides on top of each other and the thumbnails stop doing anything.
   The track's width is FlexSlider's to manage; leave it alone. */
.nk-product-gallery-col .wp-block-woocommerce-product-image-gallery,
.nk-product-gallery-col .woocommerce-product-gallery,
.nk-product-gallery-col .flex-viewport {
	width: 100%;
	max-width: 100%;
}

/* Row gap between the main image and the thumbnail strip (~23px in the Figma).
   It lives on the slider viewport rather than on .flex-control-thumbs because
   WooCommerce's stylesheet loads after this one and resets that list's margin
   at a specificity this file cannot beat without stacking selectors. */
.nk-product-gallery-col .flex-viewport {
	margin-bottom: 1.5rem;
}

/* --- "Beskrivning:" inside the summary column ------------------------- */

.nk-product-summary .nk-product-description {
	margin-top: var(--wp--preset--spacing--40);
}

/* A label rather than a section heading: small, bold, tight to the copy it
   introduces -- the Figma sets it at the body size, not a display size. */
.nk-product-summary .nk-description-label.wp-block-heading {
	margin: 0 0 0.35rem;
	font-family: var(--wp--preset--font-family--body);
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.5;
	letter-spacing: 0;
	color: var(--wp--preset--color--ink);
}

/* WooCommerce prints its own description styles after this file, so the
   summary-scoped selector needs the extra class to win. */
.nk-product-summary .nk-product-description .wp-block-woocommerce-product-description {
	margin: 0;
	font-size: 1rem;
	line-height: 1.6;
	color: var(--wp--preset--color--ink-soft);
}

.nk-product-summary .nk-product-description p {
	margin: 0 0 0.35rem;
}

.nk-product-summary .nk-product-description p:last-child {
	margin-bottom: 0;
}

/* -------------------------------------------------------------------------
 * Mini-cart title
 *
 * Rendered as a <p> rather than an <h2> so the drawer stays out of every
 * page's heading outline (see nittsjokeramik_demote_mini_cart_headings() in
 * functions.php). WooCommerce styles that title through h2-scoped rules, so
 * those stop matching once the tag changes -- these restore the typography the
 * <h2> computed to: 32px/700, 1.14 line-height.
 *
 * The bottom margin is 0, not the -2rem WooCommerce shipped: that negative
 * value pulled the item list up under the title, leaving the two almost
 * touching.
 *
 * Two classes: WooCommerce's block stylesheet loads after this file, so a
 * single-class selector would lose on source order at equal specificity.
 * ---------------------------------------------------------------------- */

.wp-block-woocommerce-mini-cart-contents .wc-block-mini-cart__title {
	margin: 1rem 1rem 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: 2rem;
	font-weight: 700;
	line-height: 1.14;
	color: var(--wp--preset--color--ink);
}
