/**
 * Typesee font archive — cinematic specimen catalog.
 * Follows DESIGN.md: black stage, paper-white ink, signal-red accent,
 * thin rules, quiet text controls, specimen-first tiles.
 */

.typesee-shop {
	--shop-base: var(--wp--preset--color--base, #0d0d0d);
	--shop-surface: var(--wp--preset--color--surface, #161616);
	--shop-ink: var(--wp--preset--color--contrast, #f5f5f2);
	--shop-muted: var(--wp--preset--color--muted, #8f8f8a);
	--shop-accent: var(--wp--preset--color--accent, #e72a00);
	--shop-line: #2e2e2c;
	--shop-soft: #1c1c1a;
	color: var(--shop-ink);
}

.typesee-shop *,
.typesee-shop *::before,
.typesee-shop *::after {
	box-sizing: border-box;
}

.typesee-shop [hidden] {
	display: none !important;
}

/* ---------------------------------------------------------------- hero */

/* Centered cinematic masthead, one giant word */
.typesee-shop__hero {
	padding: clamp(3rem, 7vw, 6.5rem) 0 clamp(1.5rem, 3vw, 2.5rem);
	text-align: center;
}

.typesee-shop__eyebrow {
	margin: 0 0 1rem;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--shop-muted);
}

.typesee-shop__title {
	position: relative;
	margin: 0;
	font-size: clamp(4rem, 15vw, 13rem);
	font-weight: 900;
	letter-spacing: -0.05em;
	line-height: 0.85;
	text-transform: uppercase;
}

.typesee-shop__title-count {
	position: relative;
	top: -0.5em;
	margin-left: 0.12em;
	font-size: clamp(0.9rem, 2vw, 1.4rem);
	font-weight: 700;
	letter-spacing: 0;
	color: var(--shop-accent);
	font-family: "Courier New", monospace;
}

.typesee-shop__lede {
	max-width: 46ch;
	margin: clamp(1rem, 2.5vw, 1.75rem) auto 0;
	font-size: clamp(0.9rem, 1.3vw, 1.05rem);
	line-height: 1.5;
	color: var(--shop-muted);
}

/* ------------------------------------------------------------- toolbar */

.typesee-shop__toolbar {
	margin-top: clamp(1.5rem, 3vw, 2.5rem);
	border-top: 1px solid var(--shop-ink);
	border-bottom: 1px solid var(--shop-line);
}

.typesee-shop__search-row {
	display: flex;
	align-items: center;
	gap: 1rem;
	padding: 0.4rem 0;
	border-bottom: 1px solid var(--shop-line);
}

.typesee-shop__search-wrap {
	position: relative;
	display: flex;
	align-items: center;
	flex: 1 1 auto;
	min-width: 0;
	gap: 0.75rem;
}

.typesee-shop__search-icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	color: var(--shop-muted);
	transition: color 160ms ease;
}

.typesee-shop__search-wrap:focus-within .typesee-shop__search-icon {
	color: var(--shop-accent);
}

.typesee-shop__search {
	flex: 1 1 auto;
	min-width: 0;
	height: 56px;
	padding: 0;
	border: 0;
	background: transparent;
	color: var(--shop-ink);
	font-family: inherit;
	font-size: clamp(1.05rem, 1.8vw, 1.35rem);
	font-weight: 600;
	letter-spacing: -0.01em;
}

.typesee-shop__search::placeholder {
	color: var(--shop-muted);
	opacity: 0.75;
	font-weight: 500;
}

.typesee-shop__search:focus {
	outline: none;
}

.typesee-shop__search::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.typesee-shop__kbd {
	flex: 0 0 auto;
	padding: 0.15rem 0.5rem;
	border: 1px solid var(--shop-line);
	border-radius: 4px;
	font-family: "Courier New", monospace;
	font-size: 0.72rem;
	color: var(--shop-muted);
}

.typesee-shop__count {
	flex: 0 0 auto;
	font-family: "Courier New", monospace;
	font-size: 0.78rem;
	color: var(--shop-muted);
	white-space: nowrap;
}

.typesee-shop__sort-wrap {
	position: relative;
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
}

/* Sort reads as quiet uppercase text, not a control chip */
.typesee-shop__sort {
	height: 34px;
	padding: 0 1.4rem 0 0;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--shop-muted);
	font-family: inherit;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
	transition: color 160ms ease;
}

.typesee-shop__sort:hover {
	color: var(--shop-ink);
}

.typesee-shop__sort-wrap::after {
	content: "";
	position: absolute;
	right: 0.35rem;
	width: 7px;
	height: 7px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: translateY(-2px) rotate(45deg);
	pointer-events: none;
}

.typesee-shop__filter-row {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.25rem;
	padding: 0.7rem 0;
	flex-wrap: wrap;
}

.typesee-shop__pills {
	display: flex;
	align-items: center;
	gap: 0.35rem;
	flex-wrap: wrap;
}

/* Category filters as quiet text with a red underline when active */
.typesee-shop__pill {
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	height: 32px;
	padding: 0 0.2rem;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--shop-muted);
	font-family: inherit;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-decoration: none;
	text-transform: uppercase;
	cursor: pointer;
	box-shadow: inset 0 -2px 0 0 transparent;
	transition: color 160ms ease, box-shadow 160ms ease;
}

.typesee-shop__pill:hover {
	color: var(--shop-ink);
}

.typesee-shop__pill.is-active {
	background: transparent;
	color: var(--shop-ink);
	box-shadow: inset 0 -2px 0 0 var(--shop-accent);
}

.typesee-shop__pill-count {
	font-family: "Courier New", monospace;
	font-size: 0.68rem;
	color: var(--shop-muted);
}

.typesee-shop__pill.is-active .typesee-shop__pill-count {
	color: var(--shop-accent);
}

/* --------------------------------------------------- preview controls */

.typesee-shop__try {
	display: flex;
	align-items: center;
	gap: 0.75rem;
	flex: 1 1 320px;
	max-width: 480px;
	min-width: 240px;
}

.typesee-shop__try-label {
	flex: 0 0 auto;
	font-size: 0.62rem;
	font-weight: 800;
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: var(--shop-muted);
}

/* Preview input: bare text over a hairline, no chrome */
.typesee-shop__try-input {
	flex: 1 1 auto;
	min-width: 0;
	height: 34px;
	padding: 0 0.2rem;
	border: 0;
	border-bottom: 1px solid var(--shop-line);
	border-radius: 0;
	background: transparent;
	color: var(--shop-ink);
	font-family: inherit;
	font-size: 0.82rem;
	font-weight: 600;
	transition: border-color 160ms ease;
}

.typesee-shop__try-input:hover {
	border-bottom-color: var(--shop-muted);
}

.typesee-shop__try-input:focus {
	outline: none;
	border-bottom-color: var(--shop-accent);
}

.typesee-shop__size {
	flex: 0 0 96px;
	height: 34px;
	margin: 0;
	background: transparent;
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.typesee-shop__size::-webkit-slider-runnable-track {
	height: 2px;
	background: var(--shop-line);
}

.typesee-shop__size::-moz-range-track {
	height: 2px;
	background: var(--shop-line);
}

.typesee-shop__size::-webkit-slider-thumb {
	-webkit-appearance: none;
	appearance: none;
	width: 14px;
	height: 14px;
	margin-top: -6px;
	border: 2px solid var(--shop-ink);
	border-radius: 50%;
	background: var(--shop-base);
	transition: border-color 160ms ease;
}

.typesee-shop__size::-moz-range-thumb {
	width: 10px;
	height: 10px;
	border: 2px solid var(--shop-ink);
	border-radius: 50%;
	background: var(--shop-base);
}

.typesee-shop__size:hover::-webkit-slider-thumb,
.typesee-shop__size:focus-visible::-webkit-slider-thumb {
	border-color: var(--shop-accent);
}

.typesee-shop__size:hover::-moz-range-thumb,
.typesee-shop__size:focus-visible::-moz-range-thumb {
	border-color: var(--shop-accent);
}

/* ----------------------------------------------------------------- grid */

/* Transparent grid — tiles sit directly on the page background */
.typesee-shop__grid {
	--typesee-specimen-scale: 1;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
	gap: 1px;
	margin: clamp(1.5rem, 3vw, 2.5rem) 0 0;
	padding: 0;
	list-style: none;
}

.typesee-shop__grid--embed {
	margin-top: 0;
}

.typesee-shop__item {
	margin: 0;
}

.typesee-shop-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	min-height: clamp(240px, 28vw, 340px);
	text-decoration: none;
	color: inherit;
}

.typesee-shop-card__discount {
	position: absolute;
	z-index: 2;
	top: 0.9rem;
	left: 0.9rem;
	padding: 0.35rem 0.55rem;
	border: 1px solid var(--shop-accent);
	color: #fff;
	background: var(--shop-accent);
	font-family: "Courier New", monospace;
	font-size: 0.68rem;
	font-weight: 800;
	letter-spacing: 0.04em;
}

/* Specimen sits centered in its tile, cinema-title style */
.typesee-shop-card__specimen {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	overflow: hidden;
	padding: clamp(1.25rem, 2.5vw, 2rem);
	text-align: center;
}

.typesee-shop-card__preview {
	display: block;
	width: 100%;
	font-size: calc(clamp(2.1rem, 3.4vw, 3.1rem) * var(--typesee-specimen-scale, 1));
	font-weight: 400;
	line-height: 1.02;
	letter-spacing: 0;
	overflow-wrap: anywhere;
	opacity: 0.82;
	transition: opacity 300ms ease, transform 300ms ease;
}

.typesee-shop-card__preview.is-live {
	opacity: 1;
}

.typesee-shop-card__specimen img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	position: absolute;
	inset: 0;
	transition: transform 350ms ease;
}

.typesee-shop-card__meta {
	display: flex;
	flex-direction: column;
	gap: 0.3rem;
	padding: 0.75rem clamp(1.25rem, 2.5vw, 2rem) 0.9rem;
	border-top: 1px solid var(--shop-line);
	transition: border-color 220ms ease;
}

.typesee-shop-card__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
}

.typesee-shop-card__name {
	font-size: 0.8rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	transition: color 160ms ease;
}

.typesee-shop-card__price {
	font-family: "Courier New", monospace;
	font-size: 0.82rem;
	font-weight: 700;
	white-space: nowrap;
}

.typesee-shop-card__price .typesee-shop-card__from {
	font-size: 0.68rem;
	font-weight: 400;
	color: var(--shop-muted);
	margin-right: 0.25rem;
}

.typesee-shop-card__price del {
	color: var(--shop-muted);
	margin-right: 0.35rem;
}

.typesee-shop-card__price ins {
	text-decoration: none;
}

.typesee-shop-card__price .typesee-discount-price {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.typesee-shop-card__sub {
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	color: var(--shop-muted);
}

/* Hover: no fill — specimen brightens, name goes red. */
.typesee-shop-card:hover .typesee-shop-card__name,
.typesee-shop-card:focus-visible .typesee-shop-card__name {
	color: var(--shop-accent);
}

.typesee-shop-card:hover .typesee-shop-card__preview,
.typesee-shop-card:focus-visible .typesee-shop-card__preview {
	opacity: 1;
	transform: scale(1.02);
}

.typesee-shop-card:hover .typesee-shop-card__specimen img,
.typesee-shop-card:focus-visible .typesee-shop-card__specimen img {
	transform: scale(1.04);
}

.typesee-shop-card:focus-visible {
	outline: 2px solid var(--shop-accent);
	outline-offset: -2px;
}

/* Staggered entrance. */
.typesee-shop.is-ready .typesee-shop__item {
	animation: typesee-shop-reveal 500ms ease backwards;
}

.typesee-shop.is-ready .typesee-shop__item:nth-child(2) { animation-delay: 60ms; }
.typesee-shop.is-ready .typesee-shop__item:nth-child(3) { animation-delay: 120ms; }
.typesee-shop.is-ready .typesee-shop__item:nth-child(4) { animation-delay: 180ms; }
.typesee-shop.is-ready .typesee-shop__item:nth-child(5) { animation-delay: 240ms; }
.typesee-shop.is-ready .typesee-shop__item:nth-child(6) { animation-delay: 300ms; }

@keyframes typesee-shop-reveal {
	from {
		opacity: 0;
		transform: translateY(14px);
	}
	to {
		opacity: 1;
		transform: none;
	}
}

/* ----------------------------------------------------------- empty state */

.typesee-shop__empty {
	padding: clamp(3rem, 8vw, 6rem) 0;
	text-align: left;
}

.typesee-shop__empty-title {
	margin: 0 0 0.75rem;
	font-size: clamp(1.8rem, 4.5vw, 3.2rem);
	font-weight: 800;
	letter-spacing: -0.03em;
	line-height: 0.95;
}

.typesee-shop__empty-copy {
	margin: 0 0 1.5rem;
	max-width: 44ch;
	color: var(--shop-muted);
}

.typesee-shop__reset {
	display: inline-flex;
	align-items: center;
	height: 44px;
	padding: 0 1.4rem;
	border: 0;
	background: var(--shop-ink);
	color: var(--shop-base);
	font-family: inherit;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	cursor: pointer;
	transition: background-color 160ms ease;
}

.typesee-shop__reset:hover {
	background: var(--shop-accent);
	color: #fff;
}

/* -------------------------------------------------------- shared focus */

.typesee-shop button:focus-visible,
.typesee-shop select:focus-visible,
.typesee-shop input:focus-visible {
	outline: 2px solid var(--shop-accent);
	outline-offset: 1px;
}

.typesee-shop .screen-reader-text {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ------------------------------------------------------------ responsive */

@media (max-width: 920px) {
	.typesee-shop__filter-row {
		align-items: flex-start;
		flex-direction: column;
	}

	.typesee-shop__try {
		width: 100%;
		max-width: none;
	}
}

@media (max-width: 760px) {
	.typesee-shop-card {
		min-height: 260px;
	}

	.typesee-shop__search {
		height: 48px;
	}

	.typesee-shop__kbd {
		display: none;
	}
}

@media (max-width: 520px) {
	.typesee-shop__search-row {
		flex-wrap: wrap;
	}

	.typesee-shop__count {
		order: 3;
	}

	.typesee-shop__size {
		flex-basis: 72px;
	}

	.typesee-shop-card__preview {
		font-size: calc(2rem * var(--typesee-specimen-scale, 1));
	}
}

@media (prefers-reduced-motion: reduce) {
	.typesee-shop.is-ready .typesee-shop__item {
		animation: none;
	}

	.typesee-shop-card,
	.typesee-shop-card__preview,
	.typesee-shop-card__specimen img {
		transition: none;
	}
}
