/* Component (PL-74): the homepage collection carousel (.coll__grid, a WooCommerce Product Collection block).
   Moved verbatim from section-patterns.css; prints straight after it, only where
   the root renders (inc/css-components.php). */

/* ---------- collection (asymmetric grid) ---------- */
.tjw .coll__grid{display:grid;grid-template-columns:repeat(var(--tjw-cols),minmax(0,1fr));gap:var(--sp-24) var(--sp-12)}
.tjw .pcard{display:block}
.tjw .pcard--a{grid-column:1/6}
.tjw .pcard--b{grid-column:8/13;margin-top:140px}
.tjw .pcard--c{grid-column:2/7;margin-top:var(--sp-10)}
.tjw .pcard--d{grid-column:8/13;margin-top:160px}
.tjw .pcard__media{position:relative;overflow:hidden;border-radius:var(--r-sm);background:var(--bg-2);display:flex;align-items:center;justify-content:center}
.tjw .pcard--a .pcard__media{aspect-ratio:4/5}
.tjw .pcard--b .pcard__media{aspect-ratio:1/1.1}
.tjw .pcard--c .pcard__media{aspect-ratio:1/1}
.tjw .pcard--d .pcard__media{aspect-ratio:4/5}
.tjw .pcard__media svg{width:48%;transition:transform 800ms var(--ease-big)}
.tjw .pcard:hover .pcard__media svg{transform:scale(1.06)}
/* editable card media = a core/image block (figure.pcard__media) holding a real
   photo that fills the staggered media box */
.tjw .pcard__media.wp-block-image{margin:0}
.tjw .pcard__media img{width:100%;height:100%;object-fit:cover;display:block;transition:transform 800ms var(--ease-big)}
.tjw .pcard:hover .pcard__media img{transform:scale(1.04)}
.tjw .pcard__tag{position:absolute;top:var(--sp-4);right:var(--sp-4);font-family:var(--mono);font-size:var(--fs-2xs);font-weight:400;letter-spacing:.06em;text-transform:uppercase;background:var(--dark);color:var(--bg);border-radius:var(--r-sm);padding:5px 10px}
.tjw .pcard__row{display:flex;justify-content:space-between;align-items:baseline;gap:var(--sp-5);border-bottom:1px solid var(--line);padding:var(--sp-4) 0 12px}
.tjw .pcard__name{font-family:var(--serif);font-size:23px;font-weight:var(--serif-w);letter-spacing:var(--tr-snug)}
.tjw .pcard__price{font-size:var(--fs-sm);color:var(--ink-60)}
.tjw .pcard__meta{font-family:var(--mono);font-size:var(--fs-3xs);letter-spacing:.04em;color:var(--ink-40);padding-top:var(--sp-3)}
.tjw .coll__foot{grid-column:1/-1;display:flex;justify-content:center;margin-top:56px}
/* tablet & mobile: drop the editorial stagger to a tidy 2-up grid (2 rows) */
@media(max-width:900px){
	.tjw .coll__grid{grid-template-columns:1fr 1fr;gap:var(--sp-12) var(--sp-6)}
	.tjw .pcard--a,.tjw .pcard--b,.tjw .pcard--c,.tjw .pcard--d{grid-column:auto;margin-top:0}
}
@media(max-width:480px){
	.tjw .coll__grid{gap:var(--sp-8) var(--sp-4)}
	/* row: stack title/price instead of squeezing title
	   against the fixed-width price on narrow phones */
	.tjw .pcard__row{flex-direction:column;align-items:flex-start;gap:4px}
}

/* ---- Collection as a WooCommerce Product Collection CAROUSEL (hand-picked) ----
   Same .pcard look, but each card is a <li> rendered by woocommerce/product-
   template. The four-card editorial stagger on the static .pcard markup above is
   untouched — other pages use it.

   2026-08-03: the fixed row of three became a carousel of eight (owner call).
   It is WooCommerce's OWN carousel layout (`displayLayout.type:"carousel"`, Woo
   10.8.1), not Alpine and not Greyd's slider, because Woo's is a *CSS* carousel:
   overflow-x + scroll-snap. Every product is in the DOM and in flow, so swipe and
   trackpad scrolling work with JS entirely absent — the house rule that nothing
   may DEPEND on JS to reveal content. A translated-track carousel would hide
   slides until its script binds, which under delay-JS is exactly the failure the
   rule exists to prevent. The prev/next arrows are the only JS part and they are
   pure enhancement.

   Everything the scroller needs is declared HERE rather than inherited from
   Woo's product-template stylesheet, which the front page does not depend on
   loading. Two of these deliberately contradict Woo's defaults:
     - `scroll-snap-align:start` (Woo: center) and `scroll-padding-inline:0`
       (Woo: 0 30%). Woo parks a snapped card in the MIDDLE of the band with half
       a card either side; here a snapped card's left edge lands on the container's
       left edge, which is the page's left edge. Anything sitting off that edge
       reads as a mistake.
     - the theme supplies `display:flex`. Carousel mode emits only
       `is-product-collection-layout-carousel wc-block-product-template` — it drops
       the `__responsive`/`is-flex-container` classes, so Woo ships no `display`
       for the scroll container at all.
   Scoped under .coll__pc so it never touches the static .pcard markup. */
.tjw .coll__pc .wp-block-woocommerce-product-template.coll__grid{display:flex;flex-wrap:nowrap;gap:var(--coll-gap);list-style:none;
	overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scroll-padding-inline:0;overscroll-behavior-x:contain;
	/* the scrollbar is hidden (house look); the peek below and the arrows are the
	   affordance instead. Both are load-bearing — without them nothing says the
	   band scrolls. */
	scrollbar-width:none;
	/* 4px of vertical room so a focus ring on a card link is not clipped by the
	   scroll box (overflow-x:auto forces overflow-y to compute to a clipping
	   value), cancelled by the matching negative margin so the band's vertical
	   rhythm measures exactly as it did before the carousel. */
	padding:4px 0;margin:-4px 0;
	/* Four numbers set the whole layout, so a breakpoint is four values, not a
	   pile of width maths:
	     --coll-per   cards fully visible at rest
	     --coll-gap   space between cards
	     --coll-peek  visible sliver of the NEXT card. Deliberately one spacing
	                  step LARGER than the gap — at or below it, the sliver reads
	                  as a mis-sized gap rather than as more to come.
	     --coll-step  stagger depth */
	--coll-per:3;
	--coll-gap:var(--sp-12);
	--coll-peek:var(--sp-16);
	--coll-step:var(--sp-10)}
.tjw .coll__pc .wp-block-woocommerce-product-template.coll__grid::-webkit-scrollbar{display:none}
/* Card width is derived, never typed: --coll-per cards + --coll-per gaps + the
   peek fill the visible width exactly. min-width:0 and max-width:none are not
   cosmetic — Woo's carousel CSS sets `min-width:42.5%` (stepped down by container
   queries) and `max-width:400px` on .wc-block-product, and a min-width would
   silently win over this flex-basis.
   align-self:flex-start so each card is content-height and the step below is the
   ONLY thing setting its offset. Under the default `stretch` the boxes all
   equalise and a margin-top silently shortens the box instead of moving it. */
.tjw .coll__pc .coll__grid > li{display:block;margin:0;padding:0;background:transparent;
	flex:0 0 calc((100% - var(--coll-peek) - var(--coll-gap) * var(--coll-per)) / var(--coll-per));
	min-width:0;max-width:none;align-self:flex-start;scroll-snap-align:start;
	/* the card is a query container so the title's reserved line box can key off
	   the CARD's width instead of the viewport's — see .pcard__name */
	container-type:inline-size;container-name:pcard}
/* Stagger, alternating rather than descending. The old fixed row of three
   stepped 0/40/80; past three cards that cannot repeat — card 4 would reset to 0
   beside card 3 at 80 and the row would read as a sawtooth. A two-step
   alternation repeats indefinitely and keeps the same gentle rhythm. */
.tjw .coll__pc .coll__grid > li:nth-child(even){margin-top:var(--coll-step)}
/* prev/next arrows (woocommerce/product-gallery-large-image-next-previous, in a
   group above the row). Pure enhancement: Woo hides them by JS when there is
   nothing to scroll, and they simply do nothing until the delayed script binds —
   the scroll itself never waits for them. Restyled off Woo's white 40px chip to
   a bare glyph, because a filled button here would out-shout the photography. */
.tjw .coll__pc .coll__nav{display:flex;justify-content:flex-end;margin:0 0 var(--sp-4)}
.tjw .coll__pc .wc-block-next-previous-buttons{display:flex;gap:var(--sp-1)}
.tjw .coll__pc .wc-block-next-previous-buttons__button{background:none;border:0;padding:0;width:32px;height:32px;color:var(--ink-60);cursor:pointer;transition:color 200ms var(--ease)}
.tjw .coll__pc .wc-block-next-previous-buttons__button:hover{color:var(--ink)}
.tjw .coll__pc .wc-block-next-previous-buttons__button[aria-disabled=true]{opacity:.3;cursor:default}
.tjw .coll__pc .wc-block-next-previous-buttons__button[aria-disabled=true]:hover{color:var(--ink-60)}
/* media box wraps the product-image block. ONE ratio across the row: the cards
   sit side by side now, so mixed ratios would stagger the title baselines and
   the rules under them. 4/5 is the house portrait ratio. */
.tjw .coll__pc .pcard__media{position:relative;overflow:hidden;border-radius:var(--r-sm);background:var(--bg-2);margin:0;display:block;aspect-ratio:4/5}
.tjw .coll__pc .pcard__media a{display:block;width:100%;height:100%}
.tjw .coll__pc .pcard__media img{width:100%;height:100%;object-fit:cover;display:block;transition:transform 800ms var(--ease-big)}
.tjw .coll__pc .coll__grid > li:hover .pcard__media img{transform:scale(1.04)}
/* row: title above price. The four-card layout set these side by side on one
   baseline, which needed the 513px card it had; at 3-up the widest card is
   446px and the narrowest ~210px, and a title sharing that width with a
   nowrap price overflows its box across whole bands of the range. Stacking
   unconditionally removes the width dependency instead of chasing it with
   breakpoints. */
.tjw .coll__pc .pcard__row{display:flex;flex-direction:column;align-items:flex-start;gap:2px;border-bottom:1px solid var(--line);padding:var(--sp-4) 0 12px;margin:0}
/* A fixed line box, so the hairline under the row lands at the same y on every
   card at the same stagger level — side by side, a ragged rule reads as a
   mistake. --coll-lines is the one number: line-height is 1.25, so N lines is
   N * 1.25em and the reserve is never a stray literal.
   Deliberately height + overflow, NOT -webkit-line-clamp, and the reason has
   changed since this was first written. The old reason (a flex item's display is
   blockified, which silently drops -webkit-box) still holds, but the clamp fails
   here even with the row set to display:block: on Chrome 150 the declarations all
   compute correctly on this h3 — display, box-orient, clamp, overflow — and the
   text still lays out unclamped, so the only thing containing it is the height.
   An ellipsis would read better than a hard cut on names this long; the repair
   that actually earns it is fixing the stock-code product titles at source.
   The size is fluid because the cards narrow to ~280px at tablet — at a fixed
   size these titles need 4-5 lines there.
   Weight is --serif-w (300), not the 400 the four-card layout used: names side
   by side at 400 read as competing headlines and pull attention off the
   photography. Same reason the size came down from 23px. */
.tjw .coll__pc .pcard__name{margin:0;font-family:var(--serif);font-size:clamp(15px,1.25vw,18px);font-weight:var(--serif-w);letter-spacing:var(--tr-snug);line-height:1.25;
	--coll-lines:3;
	height:calc(var(--coll-lines) * 1.25em);overflow:hidden}
/* Three lines everywhere rather than a count per breakpoint, and that is a
   judgement about this SET, not a shortcut. These eight names run from
   "Emerald & Diamond Roma Ring" to a 120-character stock code, so at any width
   where the long ones need three the short ones sit in a box with two empty
   lines — the cost is already paid at desktop and paying it again elsewhere buys
   nothing. What a per-breakpoint count would buy is a saved line in the two
   bands where the cards happen to run wide, at the price of six viewport rules
   that all have to be re-measured whenever --coll-per, --coll-gap, --coll-peek or
   the gutter clamp moves. Not worth it.
   The one real exception is a card under ~260px, where a fourth line is needed
   rather than merely tidy — and that is a question about the CARD, so the card
   answers it. Measured on this set at the 15px floor of the size clamp:
   271px card → 3 lines, 251 → 4. Where a browser has no container queries the
   default of 3 stands and the longest names are cut short on a small phone — a
   degradation, not a break. */
@container pcard (max-width:260px){
	.tjw .coll__pc .pcard__name{--coll-lines:4}
}
.tjw .coll__pc .pcard__name a{color:var(--ink)}
.tjw .coll__pc .pcard__price{margin:0;font-size:var(--fs-sm);color:var(--ink-60);white-space:nowrap}
.tjw .coll__pc .pcard__price .woocommerce-Price-amount{font-size:inherit;color:inherit;font-weight:inherit}
.tjw .coll__pc .pcard__price del{opacity:.5;margin-right:6px}
.tjw .coll__pc .pcard__price ins{text-decoration:none}
/* materials line = product short description (clamped to 2 lines) */
.tjw .coll__pc .pcard__meta{margin:0;padding-top:var(--sp-3);font-family:var(--mono);font-size:var(--fs-3xs);letter-spacing:.04em;color:var(--ink-40);display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
.tjw .coll__pc .pcard__meta p{margin:0}
/* Fewer cards per view as the screen narrows, rather than the same three getting
   thinner. A carousel does not have to fit the whole set on screen, so the card
   can stay a generous size all the way down — which is why this reads better on
   a phone than the column of eight a stacked layout would give.

   Each step is placed where the band it opens would otherwise take the card
   under ~272px, which is where these stock-code names start needing a fourth
   line. Measured, not inferred: card width is a function of the gutter (itself a
   clamp), so it does not track viewport width proportionally. The title box
   follows on its own via the container query above — nothing here has to know
   about line counts. */
@media(max-width:1200px){
	/* two up. Three across is already down to 251px at the top of this band and
	   218px at the bottom of it — a card that keeps shrinking while its title box
	   has to grow. */
	.tjw .coll__pc .wp-block-woocommerce-product-template.coll__grid{--coll-per:2;--coll-gap:var(--sp-8);--coll-peek:var(--sp-12);--coll-step:var(--sp-6)}
}
/* Phones: one card in view with a generous sliver of the next. The stagger goes
   — with a single card in view there is nothing to stagger against, and the
   offset would just look like the row had slipped. */
@media(max-width:768px){
	.tjw .coll__pc .wp-block-woocommerce-product-template.coll__grid{--coll-per:1;--coll-gap:var(--sp-4);--coll-peek:var(--sp-16);--coll-step:0px}
}
/* small phones — a 64px sliver off a card this narrow eats too much of it */
@media(max-width:480px){
	.tjw .coll__pc .wp-block-woocommerce-product-template.coll__grid{--coll-peek:var(--sp-10)}
}
/* Arrows off where the finger is the control. Woo ships this rule too, but only
   in product-collection-style.css, which the front page has no other reason to
   load — so it is restated here rather than depended on. */
@media(max-width:600px) and (hover:none) and (pointer:coarse){
	.tjw .coll__pc .coll__nav{display:none}
}

/* Moved from section-patterns.css's reduced-motion block so it still follows the
   .pcard__media svg transition above. */
@media(prefers-reduced-motion:reduce){
	.tjw .pcard__media svg{transition:none}
}
