/* Kern — shop and category archives. */

.shop-hero { position: relative; overflow: hidden; }
.shop-hero__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 2rem; min-height: clamp(15rem, 23vw, 20rem); }
.shop-hero__text { align-self: end; padding-block: clamp(2rem, 4vw, 3rem) clamp(2.5rem, 5vw, 4rem); }
.shop-hero__title { margin: 1rem 0 0.9rem; font-size: var(--fs-h1); }
.shop-hero__desc { max-width: 32rem; font-size: 1.1rem; line-height: 1.5; }
.shop-hero__desc p { margin: 0; }
.shop-hero__art { position: relative; min-height: 18rem; }
.shop-hero__sun { position: absolute; right: 6%; bottom: -26%; width: min(78%, 34rem); aspect-ratio: 1; border-radius: 50%; background: var(--tone-2); }
.shop-hero__img { position: absolute; bottom: 7%; height: auto; object-fit: contain; }
.shop-hero__art--1 .shop-hero__img--1 { right: 14%; width: 58%; max-height: 86%; }
/* Three pieces stand side by side on one floor at their real heights (lounge chair 78 cm, stilt lamp 160 cm,
   sideboard 72 cm; 292 cm across with the gaps). One scale, --s (px per cm), is whatever fits the frame both ways,
   so at any window size the group is whole, never cut by the header or the edge. */
.shop-hero__art--3 { container-type: size; display: flex; align-items: flex-end; justify-content: center; }
.shop-hero__art--3 .shop-hero__img {
	--s: min(calc(90cqw / 292), calc(84cqh / 160));
	position: relative; left: auto; right: auto; bottom: auto;
	width: auto; max-width: none; max-height: none; height: calc(var(--cm) * var(--s));
	margin: 0 calc(5 * var(--s)) 7cqh;
}
.shop-hero__art--3 .shop-hero__img--1 { --cm: 78; order: 1; }
.shop-hero__art--3 .shop-hero__img--3 { --cm: 160; order: 2; }
.shop-hero__art--3 .shop-hero__img--2 { --cm: 72; order: 3; }

.shop-bar { position: sticky; top: calc(var(--bar-h) - 1px); z-index: 20; background: rgb(var(--paper-rgb) / 0.92); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); transition: top 0.6s var(--ease-out); }
html.header-hidden .shop-bar { top: 0; }
.shop-bar__inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 0.8rem 2rem; padding-block: 0.8rem; }
.shop-bar__cats { min-width: 0; max-width: 100%; }
.shop-bar__cats .chips { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding: 2px; }
.shop-bar__cats .chips::-webkit-scrollbar { display: none; }
.shop-bar__cats .chip { white-space: nowrap; }
/* the category pill that replaces the chips when they do not fit (.is-compact, set by js/modules/shop.js) */
.shop-bar__pick { display: none; }
.shop-bar.is-compact .shop-bar__cats .chips { display: none; }
.shop-bar.is-compact .shop-bar__pick { display: block; }
.shop-bar__pick select { width: auto; max-width: 100%; min-height: 2.5rem; padding: 0.4rem 2.6rem 0.4rem 1.1rem; border-color: var(--ink); border-radius: 999px; background-color: transparent; font-size: 0.95rem; font-weight: 500; cursor: pointer; }
.shop-bar__tools { display: flex; align-items: center; gap: 1.4rem; }
/* the gap keeps two chosen rings (4px each) apart with air between them */
.wood-filter { display: flex; align-items: center; gap: 0.85rem; padding: 4px; }
.wood-filter .label { margin: 0 0.35rem 0 0; }
.wood-filter__dot { position: relative; width: 1.9rem; height: 1.9rem; border-radius: 50%; background: var(--swatch) center / cover; box-shadow: 0 0 0 1px var(--line-2); transition: box-shadow 0.3s, transform 0.35s var(--ease-out); }
.wood-filter__dot:hover { transform: scale(1.1); }
.wood-filter__dot.is-active { box-shadow: 0 0 0 2.5px var(--paper), 0 0 0 4px var(--ink); }
.wood-filter__dot:hover, .wood-filter__dot:focus-visible { z-index: 1; }
.wood-filter__tip { position: absolute; left: 50%; bottom: calc(100% + 8px); padding: 0.3rem 0.6rem; border-radius: 6px; background: var(--ink); color: var(--cream); font-size: 0.75rem; white-space: nowrap; transform: translate(-50%, 4px); opacity: 0; pointer-events: none; transition: 0.3s var(--ease-out); }
.wood-filter__dot:hover .wood-filter__tip { opacity: 1; transform: translate(-50%, 0); }
.sort select { width: auto; min-height: 2.5rem; padding: 0.4rem 2.5rem 0.4rem 1rem; border-radius: 999px; background-color: transparent; font-size: 0.9rem; font-weight: 500; }
.shop-bar__count { margin: 0; font-size: 0.9rem; color: var(--ink-3); white-space: nowrap; }

.shop-results { padding-top: clamp(2rem, 4vw, 3.5rem); transition: opacity 0.3s; }
/* only a slow answer dims the pieces; a quick one never blinks */
#main.is-loading .shop-results { opacity: 0.6; transition-delay: 0.2s; }
/* Filtering in place is animated piece by piece in js/modules/shop.js. No page snapshot is involved, so the
   header, the colour plate and the bar never move while the pieces rearrange. */

.story-tile { grid-column: span 2; min-width: 0; }
.story-tile__link { position: relative; display: block; height: 100%; min-height: 21rem; overflow: hidden; border-radius: 4px; color: var(--cream); text-decoration: none; }
.story-tile__link picture { position: absolute; inset: 0; }
.story-tile__link img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.6s var(--ease-out); }
.story-tile__link:hover img { transform: scale(1.04); }
/* the fade starts well above the first line, so the cream text reads even over the sunlit bench */
.story-tile__text { position: absolute; inset: auto 0 0; display: grid; gap: 0.7rem; justify-items: start; padding: clamp(4rem, 9vw, 7rem) clamp(1.4rem, 3vw, 2.4rem) clamp(1.4rem, 3vw, 2.4rem); background: linear-gradient(rgb(20 14 10 / 0), rgb(20 14 10 / 0.68) 28%, rgb(20 14 10 / 0.88)); }
.story-tile__text .label { color: var(--cream); margin: 0; }
.story-tile__quote { max-width: 24ch; font: italic 300 clamp(1.4rem, 1rem + 1.2vw, 2.3rem) / 1.2 var(--serif); font-variation-settings: 'SOFT' 100; }
.story-tile__by { font-size: 0.9rem; opacity: 0.8; }
@media (max-width: 900px) { .story-tile { grid-column: 1 / -1; } }

.woocommerce-pagination { margin-top: clamp(3rem, 6vw, 5rem); }
.woocommerce-pagination ul { display: flex; justify-content: center; gap: 0.4rem; list-style: none; margin: 0; padding: 0; }
.woocommerce-pagination a, .woocommerce-pagination span { display: grid; place-items: center; min-width: 2.6rem; height: 2.6rem; padding: 0 0.8rem; border: 1px solid var(--line-2); border-radius: 999px; text-decoration: none; font-weight: 500; }
.woocommerce-pagination .current { background: var(--ink); color: var(--cream); border-color: var(--ink); }
.no-results { padding: 4rem 0; text-align: center; }
.no-results h2 { font-size: var(--fs-h3); }

@media (max-width: 900px) {
	.shop-hero__inner { grid-template-columns: 1fr; min-height: 0; }
	.shop-hero__art { min-height: 13rem; margin: 0 calc(var(--gutter) * -1); order: -1; }
	.shop-hero__art--3 { min-height: clamp(13rem, 42vw, 20rem); }
	.shop-hero__text { padding-top: 0.5rem; }
	.shop-hero__title { margin-top: 0.8rem; }
	.shop-bar__tools { width: 100%; justify-content: space-between; }
}
@media (max-width: 560px) {
	.wood-filter .label, .shop-bar__count { display: none; }
}
@media (max-width: 640px) {
	/* phones: the two pickers side by side, the woods underneath */
	.shop-bar.is-compact .shop-bar__inner { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 0.65rem 0.6rem; }
	.shop-bar.is-compact .shop-bar__tools { display: contents; }
	.shop-bar.is-compact .shop-bar__cats { grid-column: 1; grid-row: 1; }
	.shop-bar.is-compact .sort { grid-column: 2; grid-row: 1; }
	.shop-bar.is-compact .shop-bar__pick select, .shop-bar.is-compact .sort select { width: 100%; padding-left: 1rem; padding-right: 2.3rem; }
	.shop-bar.is-compact .wood-filter { grid-column: 1 / -1; grid-row: 2; }
	.shop-bar.is-compact .shop-bar__count { grid-column: 2; grid-row: 2; justify-self: end; align-self: center; }
}
