/*
 * Phase 05 archive presentation.
 * WooCommerce owns the query, filters, sorting, cards and pagination.
 */
.tm-archive {
	padding-block: clamp(2rem, 5vw, 4.5rem) clamp(4rem, 8vw, 8rem);
}

.tm-archive__hero {
	display: grid;
	min-height: clamp(13.75rem, 18vw, 20rem);
	align-content: center;
	border-bottom: 1px solid var(--tm-color-border);
	margin-bottom: clamp(2rem, 5vw, 4rem);
	padding-block: clamp(1.25rem, 3vw, 2.5rem) clamp(2rem, 4vw, 3.25rem);
}

.tm-archive__hero:has(.tm-archive__category-image) {
	grid-template-columns: minmax(0, 3fr) minmax(14rem, 2fr);
	align-items: center;
	column-gap: clamp(2rem, 6vw, 6rem);
}

.tm-archive__hero-content { min-width: 0; }

.tm-archive__category-image {
	width: 100%;
	height: auto;
	max-height: 24rem;
	object-fit: cover;
}

.tm-archive__hero .wp-block-query-title,
.tm-archive__hero h1 {
	max-width: 12ch;
	margin-block: .45rem .8rem;
	font-family: var(--tm-font-display);
	font-size: clamp(2.7rem, 6vw, 5rem);
	font-weight: 500;
	line-height: .98;
	letter-spacing: -.025em;
}

.tm-archive__hero .wp-block-term-description {
	max-width: 58ch;
	margin: 0;
	color: var(--tm-color-muted);
	font-size: clamp(.95rem, 1.2vw, 1.1rem);
}

.tm-archive__eyebrow,
.tm-archive__filter-title {
	color: var(--tm-color-primary);
	font-size: .68rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}

.tm-archive__intro {
	max-width: 57ch;
	margin: 0 0 clamp(2rem, 4vw, 3rem);
	color: var(--tm-color-muted);
}

.tm-archive__toolbar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	border-block: 1px solid var(--tm-color-border);
	min-height: 4.25rem;
	margin-bottom: 1.5rem;
}

.tm-archive__toolbar .wc-block-product-results-count,
.tm-archive__toolbar .wc-block-components-result-count {
	margin: 0;
	color: var(--tm-color-muted);
	font-size: .78rem;
}

.tm-archive__toolbar .wc-block-components-sort-select,
.tm-archive__toolbar select {
	min-height: 2.75rem;
	border: 0;
	border-left: 1px solid var(--tm-color-border);
	border-radius: 0;
	background: transparent;
	color: var(--tm-color-text);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .08em;
	padding: .5rem 2rem .5rem 1rem;
	text-transform: uppercase;
}

.tm-archive__layout {
	display: grid;
	grid-template-columns: minmax(14rem, 16.25rem) minmax(0, 1fr);
	gap: clamp(2rem, 5vw, 4.5rem);
	align-items: start;
}

.tm-archive__filters {
	position: sticky;
	top: 6rem;
}

.tm-archive__filters h2 {
	margin: 0 0 1rem;
	font-family: var(--tm-font-body);
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .14em;
	text-transform: uppercase;
}
.tm-archive__filters .tm-archive__filter-close { display: none; }
@media (min-width: 782px) {
	.tm-archive__filters { display: block; }
}

.tm-archive__filters details {
	border-top: 1px solid var(--tm-color-border);
	padding-block: .9rem;
}

.tm-archive__filters details:last-child {
	border-bottom: 1px solid var(--tm-color-border);
}

.tm-archive__filters summary {
	cursor: pointer;
	list-style: none;
	color: var(--tm-color-text);
	font-size: .75rem;
	font-weight: 700;
	letter-spacing: .1em;
	text-transform: uppercase;
}

.tm-archive__filters summary::-webkit-details-marker { display: none; }
.tm-archive__filters summary::after { content: "+"; float: right; color: var(--tm-color-accent); font-size: 1rem; font-weight: 400; }
.tm-archive__filters details[open] summary::after { content: "−"; }

.tm-archive__filters .wp-block-woocommerce-product-filters {
	gap: 1.5rem;
}
.tm-archive__filters .wp-block-woocommerce-product-filter-price,
.tm-archive__filters .wp-block-woocommerce-product-filter-status,
.tm-archive__filters .wp-block-woocommerce-product-filter-taxonomy {
	border-bottom: 1px solid var(--tm-color-border);
	padding-bottom: 1.25rem;
}
.tm-archive__filters .wp-block-heading {
	margin: 0 0 .75rem;
	color: var(--tm-color-primary);
	font-size: .7rem;
	font-weight: 700;
	letter-spacing: .12em;
	text-transform: uppercase;
}
.tm-archive__filters .wp-block-woocommerce-product-filter-removable-chips button {
	text-transform: uppercase;
}

.tm-archive__filters .wc-block-components-filter-reset-button,
.tm-archive__filters .wc-block-components-checkbox label,
.tm-archive__filters .wc-block-components-product-filter__option {
	font-size: .82rem;
}

.tm-archive__products .wp-block-woocommerce-product-collection {
	margin: 0;
}

.tm-archive__products .wc-block-product-template {
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: clamp(1.5rem, 3vw, 3rem) clamp(1rem, 2.4vw, 2.25rem);
}

.tm-archive__products .wp-block-woocommerce-product-image img {
	aspect-ratio: 4 / 5;
	border: 0;
	background: var(--tm-color-surface);
	object-fit: contain;
}

.tm-archive__products .wp-block-post-title {
	margin-top: .9rem;
	text-align: left;
	font-family: var(--tm-font-body);
	font-size: .9rem;
	font-weight: 600;
	line-height: 1.35;
}

.tm-archive__products .wp-block-post-title a { text-decoration: none; }
.tm-archive__products .wp-block-woocommerce-product-price { text-align: left; color: var(--tm-color-primary); font-size: .85rem; }
.tm-archive__products .wp-block-woocommerce-product-price del { color: var(--tm-color-muted); }
.tm-archive__products .wp-block-woocommerce-product-price ins { color: var(--tm-color-primary); text-decoration: none; }
.tm-archive__products .wp-block-woocommerce-product-button { text-align: left; margin-top: .45rem; }
.tm-archive__products .wp-block-woocommerce-product-button a { padding-inline: 0; border: 0; background: transparent; color: var(--tm-color-primary); text-decoration: underline; text-underline-offset: .25em; }

.tm-archive__products .wp-block-query-pagination {
	margin-top: clamp(3rem, 7vw, 6rem);
	border-top: 1px solid var(--tm-color-border);
	padding-top: 1.25rem;
}
.tm-archive__products .wp-block-query-pagination a,
.tm-archive__products .wp-block-query-pagination span { min-height: 2.75rem; padding: .65rem .8rem; color: var(--tm-color-primary); font-size: .75rem; text-decoration: none; }
.tm-archive__products .wp-block-query-pagination .current { border-bottom: 1px solid var(--tm-color-primary); }

.tm-archive__empty {
	border-block: 1px solid var(--tm-color-border);
	padding: clamp(2.5rem, 7vw, 6rem) 1rem;
	text-align: center;
}
.tm-archive__empty h2 { margin-top: 0; font-size: clamp(1.8rem, 3vw, 2.8rem); }
.tm-archive__empty p { max-width: 42ch; margin-inline: auto; color: var(--tm-color-muted); }

.tm-archive__mobile-controls { display: none; }

@media (max-width: 1100px) {
	.tm-archive__products .wc-block-product-template { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
@media (max-width: 781px) {
	.tm-archive { padding-top: 1.25rem; }
	.tm-archive__hero { min-height: clamp(10.625rem, 48vw, 15rem); margin-bottom: 1.5rem; padding-block: 1rem 2rem; }
	.tm-archive__hero h1, .tm-archive__hero .wp-block-query-title { font-size: clamp(2.5rem, 13vw, 4rem); }
	.tm-archive__hero:has(.tm-archive__category-image) { grid-template-columns: 1fr; row-gap: 1.5rem; }
	.tm-archive__category-image { max-height: none; }
	.tm-archive__layout { display: block; }
	.tm-archive__filters { display: none; }
	.tm-archive__filters:target,
	.tm-archive__filters.is-open {
		display: block;
		position: fixed;
		z-index: 20;
		inset: 0;
		overflow-y: auto;
		background: var(--tm-color-surface);
		padding: 1.25rem 1.25rem 3rem;
	}
	body.tm-filter-open { overflow: hidden; }
	.tm-archive__filters:target .tm-archive__filter-close,
	.tm-archive__filters.is-open .tm-archive__filter-close {
		display: inline-block;
		float: right;
		min-height: 2.75rem;
		color: var(--tm-color-primary);
		font-size: .7rem;
		font-weight: 700;
		letter-spacing: .12em;
		text-decoration: none;
		text-transform: uppercase;
	}
	.tm-archive__toolbar { min-height: 3.75rem; }
	.tm-archive__toolbar .wc-block-product-results-count { max-width: 12rem; }
	.tm-archive__mobile-controls { display: flex; border-bottom: 1px solid var(--tm-color-border); }
	.tm-archive__mobile-controls a { flex: 1; min-height: 2.75rem; padding: .7rem; color: var(--tm-color-primary); font-size: .7rem; font-weight: 700; letter-spacing: .12em; text-align: center; text-decoration: none; text-transform: uppercase; }
	.tm-archive__mobile-controls a + a { border-left: 1px solid var(--tm-color-border); }
	.tm-archive__products .wc-block-product-template { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 2.25rem .75rem; }
	.tm-archive__products .wp-block-post-title { font-size: .82rem; }
}
@media (max-width: 339px) {
	.tm-archive__products .wc-block-product-template { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	.tm-archive *, .tm-archive *::before, .tm-archive *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}