/* CRESTIAL — the shop archive.
 *
 * ⚑ HAND-WRITTEN, unlike every other file in this directory. The other ten are GENERATED from
 * the mockups by _source/_docs/build_page_css.py and must not be edited; there is no mockup for
 * the shop, because the product data only arrived on 16 Oct and the design review happened in
 * September. build_page_css.py reports this file as one it does not own, so the difference
 * stays visible.
 *
 * It is assembled from the design's own primitives rather than invented: the `.phero` band from
 * components.css, the homepage's `.card` proportions and label bar, the shared type scale, the
 * `.pill` buttons. It should read as the same site. It has NOT had a client design review —
 * cr-shop-design on the board.
 *
 * WooCommerce's own stylesheets are still loading on these screens (cr-woo-css), which is why a
 * few rules below are more specific than they would otherwise need to be. Each one says so.
 */

/* ============================================================================
 * The band
 * ========================================================================== */

/*
 * Shorter than the content pages'. Those bands introduce a page someone chose to read; this one
 * sits above a grid the visitor came to scan, and a 560px hero between them and the products is
 * in the way.
 */
.phero--shop {
	height: clamp(260px, 34vh, 360px);
}

/* ============================================================================
 * Toolbar and filters
 * ========================================================================== */

.woocommerce .shoptools {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 24px;
	flex-wrap: wrap;
	max-width: var(--wrap);
	margin: clamp(40px, 5vw, 72px) auto 0;
	padding: 0 var(--gut);
}

.shoptools__count {
	font-size: 12px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--taupe);
}

/* WooCommerce floats the count and the ordering form; inside a flex row that leaves
   both of them out of the baseline and the row collapses to zero height. */
.woocommerce .shoptools .woocommerce-result-count,
.woocommerce .shoptools .woocommerce-ordering {
	float: none;
	margin: 0;
}

.shoptools__sort select {
	font: inherit;
	font-size: 13px;
	color: var(--ink);
	background: transparent;
	border: 1px solid var(--line);
	border-radius: 999px;
	padding: 9px 16px;
	cursor: pointer;
}

/* ----------------------------------------------------------------------------
 * The filter panel — WooCommerce's layered navigation
 *
 * Rebuilt 22 Oct 2026. What was here styled a list of links to term ARCHIVES, one choice at a
 * time; inc/shop-layout.php now renders WooCommerce's own layered nav, so the markup inside
 * each fold is WooCommerce's — ul.woocommerce-widget-layered-nav-list, and a span.count per
 * option that the old one had no way to produce.
 *
 * ⚑ STYLING WOOCOMMERCE'S CLASS NAMES IS NOT THE MISTAKE IT WOULD BE ELSEWHERE. On the forms,
 * the same instinct produced a second copy of an approved design in a foreign vocabulary, and
 * it drifted within a day (see assets/css/gravityforms.css). THERE IS NO MOCKUP FOR THE SHOP —
 * this file is hand-written and is the only statement of the design — so these rules are not a
 * copy of anything. If a shop design ever is drawn and generated, this inverts: relabel the
 * widget's markup the way inc/gravityforms.php does and delete the duplication.
 *
 * THREE FOLDS STACKED, NOT THREE DROPDOWNS IN A ROW. Function alone has 44 options, which is a
 * scrolling panel in any dropdown narrow enough to sit three abreast, and a scrollbar inside a
 * filter is where options go to be missed. Folded rows cost three lines closed and show
 * everything open. The shop has never had a design review (cr-shop-design), and this is the
 * plainest thing that works until it does.
 * -------------------------------------------------------------------------- */

/* ⚑ THE FIRST VERSION WAS UNREADABLE AND THE NUMBERS SAY SO. Keith, 22 Oct: "the words are
 * barely visible, almost same colour as background." Measured rather than argued about:
 *
 *     --stone-2 #C4BCB7 on --paper #EEEBE4      1.57:1      labels, and the counts
 *     --stone   #D6D2C4 on --paper              1.27:1
 *     --taupe   #746661 on --paper              4.62:1      the option links
 *     --ink     #14120F on --paper             15.70:1
 *
 * AA asks 4.5:1 for text this size. The facet LABELS — the only words telling you what the
 * list underneath is — were at 1.57:1, a third of the floor. --stone-2 is Pantone 406 and it
 * is a RULE AND SWATCH colour in this palette; it had been used as type, which is the whole
 * mistake. Labels are --ink now and counts are --taupe.
 *
 * The panel itself is the design's own `.panel-card` primitive — --card ground, --rad corner —
 * rather than three rows loose on the page ground. On --card the figures are better again:
 * --ink 17.31:1, --taupe 5.10:1.
 */

/* ⚑ THE WIDTH IS --wrap MINUS TWO GUTTERS, not --wrap with gutter padding. Every other block
   on this page is `max-width: var(--wrap); padding: 0 var(--gut)`, which puts the CONTENT on
   the gutter line and the element's own edge off-screen. That is right for a transparent
   block and wrong for one with a visible ground: the card would have run wider than the
   product grid it sits above. Subtracting the gutters instead lines the card's EDGE up with
   the grid's first column. */
.shopfilters {
	/* ⚑ `width: min(...)`, not `max-width`. max-width alone is capped by --wrap and then lets
	   the card fill the viewport on anything narrower — at 375px it ran edge to edge with no
	   gutter at all, while the product grid under it kept its 22px. The second term keeps the
	   gutter at every width; the first stops it exceeding the grid at wide ones. */
	width: min(calc(var(--wrap) - var(--gut) * 2), calc(100% - var(--gut) * 2));
	margin: 18px auto 0;
	padding: clamp(18px, 2vw, 26px) clamp(20px, 2.2vw, 30px);
	background: var(--card);
	border-radius: var(--rad);
}

.shopfilter + .shopfilter {
	margin-top: 4px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}

/*
 * The whole row is the control, not just the word. A 10.5px label is a small target for
 * something a visitor is meant to open and close repeatedly, and a summary that is only as
 * wide as its text gives no sign that the empty space beside it is clickable too.
 */
.shopfilter summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	padding: 7px 0;
	cursor: pointer;
	list-style: none;
	min-width: 0;
}

.shopfilter summary:focus-visible {
	outline: 2px solid var(--orange);
	outline-offset: 3px;
	border-radius: 4px;
}

/* Safari draws its own disclosure triangle through ::-webkit-details-marker even when
   list-style is none, so it needs naming separately. */
.shopfilter summary::-webkit-details-marker {
	display: none;
}

/* 11px rather than 10.5, because at .2em tracking in uppercase the half-pixel is the
   difference between a label and a texture — and --ink at 17.31:1 can carry it. */
.shopfilter__label {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	font-size: 11px;
	font-weight: 500;
	letter-spacing: .2em;
	text-transform: uppercase;
	color: var(--ink);
}

.shopfilter summary::after {
	content: "+";
	font-size: 15px;
	line-height: 1;
	letter-spacing: 0;
	color: var(--taupe);
	transition: color .3s var(--ease);
}

.shopfilter summary:hover::after {
	color: var(--ink);
}

.shopfilter details[open] > summary::after {
	content: "–";
}

/* How many options are chosen inside a fold that is closed. Without it, collapsing a facet
   hides the fact that it is still narrowing the grid, and the result count looks wrong. */
.shopfilter__n {
	display: inline-grid;
	place-items: center;
	min-width: 17px;
	height: 17px;
	padding: 0 5px;
	border-radius: 999px;
	background: var(--ink);
	color: var(--cream);
	font-size: 9.5px;
	letter-spacing: .06em;
}

.shopfilter__list {
	margin: 4px 0 12px;
}

.shopfilter ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/*
 * ⚑ OPTIONS ARE BUTTONS NOW, NOT A RUN OF SMALL LINKS. Forty-four function names at 13.5px
 * separated by 18px of space read as a paragraph of grey words: nothing says which are
 * clickable, nothing says which are on, and on a phone they are a 14px-tall tap target in a
 * wrapped block of other tap targets. A bordered chip answers all three, and it is the
 * design's own `.pill`, one size down.
 *
 * --taupe on --card is 5.10:1 at rest. --cream on --ink, which is the chosen state, is 18.07:1.
 */
/* ⚑ THE CHIP IS THE <li>, NOT THE <a>, AND WOOCOMMERCE'S MARKUP IS WHY. It emits
   `<li><a>Matt Black</a> <span class="count">(66)</span></li>` — the count is a SIBLING of the
   link, not inside it. Styling the <a> as the pill left every count stranded outside its own
   chip, which merely looked loose on the unchosen ones and was a genuine defect on a chosen
   one: the count is cream so it can sit on the filled pill, and outside it that is cream text
   on the cream panel, invisible and overlapping the chip's edge. Caught at 375px, where the
   rows are tight enough to see it. */
.shopfilter li {
	position: relative;
	display: inline-flex;
	align-items: baseline;
	gap: 7px;
	padding: 7px 14px;
	border: 1px solid var(--line);
	border-radius: 999px;
	font-size: 13px;
	line-height: 1.2;
	transition: border-color .3s var(--ease), background .3s var(--ease);
}

.shopfilter li > a {
	color: var(--taupe);
	transition: color .3s var(--ease);
}

/* The whole pill is the target, count included — otherwise a third of a chip that looks like
   one button is dead to a thumb. */
.shopfilter li > a::after {
	content: "";
	position: absolute;
	inset: 0;
	border-radius: inherit;
}

.shopfilter li:hover {
	border-color: var(--ink);
}

.shopfilter li:hover > a {
	color: var(--ink);
}

.shopfilter li:focus-within {
	outline: 2px solid var(--orange);
	outline-offset: 2px;
}

/* WooCommerce marks a chosen option on the <li>, not the <a> — the link is the one that
   REMOVES it. `chosen` is the short class it has emitted since 2.x; the long BEM one came
   later, and both are named so this survives whichever a future version keeps.

   Solid, not an underline. An underline on one of forty-four chips is a detail you have to go
   looking for; filled, the row answers "what have I asked for" at a glance, which is the
   question the panel exists to answer. */
.shopfilter li.chosen,
.shopfilter li.woocommerce-widget-layered-nav-list__item--chosen {
	background: var(--ink);
	border-color: var(--ink);
}

.shopfilter li.chosen > a,
.shopfilter li.woocommerce-widget-layered-nav-list__item--chosen > a,
.shopfilter li.chosen:hover > a,
.shopfilter li.woocommerce-widget-layered-nav-list__item--chosen:hover > a {
	color: var(--cream);
}

.shopfilter li.chosen:hover,
.shopfilter li.woocommerce-widget-layered-nav-list__item--chosen:hover {
	background: var(--orange);
	border-color: var(--orange);
}

/* The count of what each option would still leave. Quieter than the name but NOT the
   --stone-2 it was: that measured 1.57:1 on the page ground, which is a swatch colour being
   used as type. --taupe is 5.10:1 here, and inside a chosen chip it has to lift off the ink. */
.shopfilter .count {
	font-size: 11px;
	color: var(--taupe);
}

.shopfilter li.chosen .count,
.shopfilter li.woocommerce-widget-layered-nav-list__item--chosen .count {
	color: rgba(252, 251, 248, .7);
}

/* ----------------------------------------------------------------------------
 * What is currently chosen
 *
 * Every chip is a link that removes itself, and the row is the only place a visitor can see
 * the whole of what they have asked for — the folds show one facet each, and a closed one
 * shows only a number.
 * -------------------------------------------------------------------------- */

.shopfilter__chosen {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px 12px;
	margin-top: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--line);
}

.shopfilter__chosen ul {
	list-style: none;
	margin: 0;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
}

/* Filled, the same as a chosen option in the folds above — "on" should look like one thing on
   this page, and the row is a summary of what is on. */
.shopfilter__chosen li a {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	padding: 7px 14px;
	border: 1px solid var(--ink);
	border-radius: 999px;
	background: var(--ink);
	font-size: 12.5px;
	color: var(--cream);
	transition: border-color .3s var(--ease), background .3s var(--ease);
}

/* The × is drawn rather than written into the markup: WooCommerce supplies the term name as
   the link text and nothing else, and a chip that says only "Matt Black" gives no sign that
   clicking it takes the filter OFF rather than putting it on. */
.shopfilter__chosen li a::after {
	content: "×";
	font-size: 15px;
	line-height: 1;
	color: rgba(252, 251, 248, .75);
}

.shopfilter__chosen li a:hover {
	background: var(--orange);
	border-color: var(--orange);
}

.shopfilter__clear {
	font-size: 11px;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--taupe);
	border-bottom: 1px solid var(--line);
	transition: color .3s var(--ease);
}

.shopfilter__clear:hover {
	color: var(--ink);
}

/* ============================================================================
 * The grid
 * ========================================================================== */

.woocommerce ul.products {
	max-width: var(--wrap);
	margin: clamp(34px, 4vw, 56px) auto 0;
	padding: 0 var(--gut);
	display: grid;
	/* Four across, on the client's instruction of 23 Oct 2026 (was three). The step down to
	   two happens earlier as a result: a quarter of 1080px is 230px of card, which is below
	   the point where the article number and the name stop fitting on their own lines. */
	grid-template-columns: repeat(4, 1fr);
	gap: clamp(34px, 4vw, 64px) clamp(20px, 2.6vw, 40px);
	list-style: none;
}

/* WooCommerce's own grid is floats plus nth-child margins at a specificity our grid has to
   beat, and `clear:both` on every third item would break the rows. */
.woocommerce ul.products li.product {
	width: auto;
	float: none;
	margin: 0;
	clear: none;
	text-align: left;
}

.woocommerce ul.products li.product a img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	/* The client's product shots are cut out on white, so `contain` on the card's own ground
	   keeps the object whole. `cover` would crop a tap spout at the top of the frame. */
	object-fit: contain;
	background: var(--card);
	border-radius: var(--rad);
	margin: 0;
	padding: clamp(14px, 2vw, 28px);
	transition: background .5s var(--ease);
}

.woocommerce ul.products li.product:hover a img {
	background: var(--stone);
}

/*
 * ⚑ THE SERIES LABEL IS NOT ORANGE, THOUGH IT CARRIES `.eyebrow`.
 *
 * The shared `.eyebrow` is `color: var(--orange)`, which is right where the design uses it: one
 * per section, on nine pages, as the accent the brand guide allows. A product grid puts twelve
 * on one screen and more than forty by the bottom of a scroll — the guide says Pantone 151 is
 * "max 20% of any material, use sparingly", and a wall of orange capitals is neither. It keeps
 * the class so it keeps the size, tracking and case; only the colour changes.
 */
.woocommerce ul.products li.product .pcard__series {
	margin: 16px 0 6px;
	font-size: 10.5px;
	letter-spacing: .2em;
	/* --taupe, measured at 4.62:1 on --paper. --stone-2 was the first choice and is 1.57:1,
	   which is not a subtle label, it is an invisible one. */
	color: var(--taupe);
}

/* Woo sets its own size and weight on the loop title at two classes deep. */
.woocommerce ul.products li.product h2.woocommerce-loop-product__title {
	font-size: 17px;
	font-weight: 300;
	line-height: 1.35;
	color: var(--ink);
	padding: 0;
	margin: 0;
}

.pcard__sku {
	margin: 6px 0 0;
	font-size: 11.5px;
	letter-spacing: .1em;
	/* The article number is the line this audience scans for; it cannot be the faintest thing
	   on the card. --taupe is 4.62:1 on --paper, --stone-2 was 1.57:1. */
	color: var(--taupe);
	font-variant-numeric: tabular-nums;
}

/* ============================================================================
 * Finish swatches
 *
 * ========================================================================== */

.pcard__fin {
	list-style: none;
	margin: 12px 0 0;
	padding: 0;
	display: flex;
	gap: 7px;
	flex-wrap: wrap;
}

/* The swatches themselves live in theme.css — the product page needs them too and only
   one of shop.css / product.css is ever loaded. */

/* ============================================================================
 * The call to action
 * ========================================================================== */

/* Only eleven of the 306 cards carry one — the priced spare parts. It sits
   where the SKU does, in the card's own type rather than WooCommerce's. */
.pcard__price {
	margin: 10px 0 0;
	font-size: 15px;
	color: var(--ink);
}

.pcard__cta,
.woocommerce ul.products li.product .button {
	display: inline-block;
	margin-top: 14px;
	font-size: 11.5px;
	letter-spacing: .16em;
	text-transform: uppercase;
	padding: 11px 22px;
	border: 1px solid var(--line);
	border-radius: 999px;
	color: var(--ink);
	background: transparent;
	transition: background .35s var(--ease), color .35s var(--ease), border-color .35s var(--ease);
}

.pcard__cta:hover,
.woocommerce ul.products li.product .button:hover {
	background: var(--ink);
	border-color: var(--ink);
	color: var(--cream);
}

/* .pill--l is the light-on-dark variant, correct over the band and wrong on the cream grid.
   The card carries it so the markup matches the rest of the site; this undoes the inversion. */
.pcard__cta.pill--l {
	border-color: var(--line);
	color: var(--ink);
	background: transparent;
	backdrop-filter: none;
}

/* ----------------------------------------------------------------------------
 * The card's own link.
 *
 * WooCommerce's default loop hooks wrap each card in
 * <a class="woocommerce-LoopProduct-link">, and woocommerce-general made it a
 * block. That sheet is gone, and an inline <a> collapses the card to the width
 * of its text — so the rule has to live here now. It is the ONLY thing that
 * sheet was giving these two screens that this theme did not already have;
 * everything else it did was override something written here. Measured by
 * diffing the computed style of every element on both screens with the sheet
 * toggled off, not guessed.
 * -------------------------------------------------------------------------- */

.woocommerce-LoopProduct-link {
	display: block;
}

/* ============================================================================
 * Pagination
 * ========================================================================== */

.woocommerce nav.woocommerce-pagination {
	max-width: var(--wrap);
	margin: clamp(48px, 6vw, 84px) auto 0;
	padding: 0 var(--gut);
}

.woocommerce nav.woocommerce-pagination ul {
	border: 0;
	display: flex;
	justify-content: center;
	gap: 6px;
	/* The list reset used to come from woocommerce-general, which was dropped on
	   21 Oct. Without these three the browser's own ul styling returns: 16px
	   vertical margin, 40px of left padding and a disc on every page number. */
	margin: 0;
	padding: 0;
	list-style: none;
}

.woocommerce nav.woocommerce-pagination ul li {
	border: 0;
	overflow: visible;
}

.woocommerce nav.woocommerce-pagination ul li a,
.woocommerce nav.woocommerce-pagination ul li span {
	min-width: 38px;
	padding: 9px 12px;
	border-radius: 999px;
	font-size: 13px;
	color: var(--taupe);
	background: transparent;
}

.woocommerce nav.woocommerce-pagination ul li span.current,
.woocommerce nav.woocommerce-pagination ul li a:hover {
	background: var(--ink);
	color: var(--cream);
}

/* ----------------------------------------------------------------------------
 * Hover reveals the second photograph
 *
 * ⚑ THE WRAPPER IS ONLY PRINTED WHEN THERE IS A SECOND IMAGE (inc/shop-layout.php), so
 * everything here is scoped to it. A product with one photograph has no .pcard__media at
 * all and therefore no transition, no cursor change and no half-second of nothing — which
 * is what the client asked for in as many words.
 * -------------------------------------------------------------------------- */

.pcard__media {
	position: relative;
	display: block;
}

.pcard__media img {
	display: block;
	width: 100%;
	height: auto;
}

.pcard__alt {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity .45s var(--ease);
}

li.product:hover .pcard__media--hoverable .pcard__alt,
li.product:focus-within .pcard__media--hoverable .pcard__alt {
	opacity: 1;
}

/* ⚑ focus-within as well as hover: the whole card is a link, so a keyboard user tabbing
   through the grid should see the same thing a mouse user does. */

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

/* ⚑ AND NOTHING ON A TOUCH SCREEN. A phone has no hover; what it has is a :hover that
   sticks after a tap, so the second image would appear and stay until something else was
   tapped — on a grid of cards that reads as images swapping at random. */
@media (hover: none) {
	.pcard__alt { display: none; }
}

/* ============================================================================
 * Responsive
 * ========================================================================== */

/* Three across before two, now that the top of the range is four — dropping 4 -> 2 in one
   step leaves a 1200px laptop showing half the cards it has room for. */
@media (max-width: 1280px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(3, 1fr);
	}
}

@media (max-width: 1080px) {
	.woocommerce ul.products {
		grid-template-columns: repeat(2, 1fr);
	}
}

@media (max-width: 860px) {
	.shopfilter {
		flex-direction: column;
		gap: 8px;
	}
}

@media (max-width: 560px) {
	.woocommerce ul.products {
		grid-template-columns: 1fr;
	}
}

/* ----------------------------------------------------------------------------
 * Availability — one chip, no fold
 *
 * The three attribute facets are <details> because they hold 20, 44 and 9 options. This holds
 * one, so there is nothing to open: a disclosure triangle over a single chip is a control that
 * exists to be clicked twice. The label sits on the same line as the chip instead.
 * -------------------------------------------------------------------------- */

.shopfilter--flat {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 10px 16px;
	padding: 7px 0;
}

.shopfilter--flat .shopfilter__list {
	margin: 0;
}
