/**
 * Lookbook, front-end styles.
 *
 * The photo is a styled flat-lay; each marker is a brass push-pin pressed into
 * the scene, and its product card is the styling tag the pin holds. The image is
 * the canvas and markers are positioned by percentage so the layout is fully
 * fluid. The image carries its intrinsic dimensions so there is no Cumulative
 * Layout Shift, motion is guarded by prefers-reduced-motion, and the card
 * palette is dark-mode aware.
 *
 * Tokens are themeable: override --lookbook-* on the .lookbook element (or an
 * ancestor) and everything, pin, tag, type, follows. Defaults inherit the
 * theme's own font stack and fall back to an editorial ink + brass palette.
 */

.lookbook {
	/* The pin. */
	--lookbook-marker-size: 30px;
	--lookbook-accent: #b8843f; /* warm brass, the pin head */
	--lookbook-accent-deep: #8a5e26; /* shadowed underside of the pin */
	--lookbook-accent-sheen: #f3d9a8; /* light catching the brass */
	--lookbook-pin-ring: rgba( 255, 255, 255, 0.92 );

	/* The tag. */
	--lookbook-card-bg: #14110f; /* ink, a darkroom mat behind the product */
	--lookbook-card-fg: #f6f1e8;
	--lookbook-card-muted: #b7ab97;
	--lookbook-card-border: rgba( 184, 132, 63, 0.72 ); /* brass hairline, WCAG AA 3:1 on ink */
	--lookbook-radius: 10px;
	--lookbook-shadow: 0 18px 44px rgba( 20, 17, 15, 0.42 ),
		0 2px 6px rgba( 20, 17, 15, 0.3 );

	/* Type inherits the theme; editorial serif only as a graceful fallback. */
	--lookbook-card-title-font: inherit;

	max-width: 100%;
	margin: 0 auto;
}

.lookbook__scenes {
	position: relative;
}

.lookbook__nav {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 12px;
}

.lookbook__nav-btn {
	appearance: none;
	border: 1px solid var( --lookbook-card-border );
	background: transparent;
	color: inherit;
	padding: 6px 14px;
	border-radius: 999px;
	font: inherit;
	cursor: pointer;
	line-height: 1.4;
}

.lookbook__nav-btn.is-active,
.lookbook__nav-btn[aria-selected="true"] {
	background: var( --lookbook-accent );
	border-color: var( --lookbook-accent );
	color: #fff;
}

.lookbook__nav-btn:focus-visible {
	outline: 2px solid var( --lookbook-accent );
	outline-offset: 2px;
}

.lookbook__scene {
	display: none;
}

.lookbook__scene.is-active {
	display: block;
}

.lookbook__stage {
	position: relative;
	display: inline-block;
	max-width: 100%;
	line-height: 0;
}

.lookbook__image {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var( --lookbook-radius );
}

.lookbook__video {
	display: block;
	max-width: 100%;
	height: auto;
	border-radius: var( --lookbook-radius );
	object-fit: cover;
}

@media ( prefers-reduced-motion: reduce ) {
	.lookbook__video {
		animation: none;
	}
}

.lookbook__hotspots {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.lookbook__hotspot {
	position: absolute;
	margin: 0;
	transform: translate( -50%, -50% );
}

/* ---- The pin -------------------------------------------------------------
 * THE BOLD MOVE: the marker is not a flat blue dot but a brass push-pin
 * pressed into the photo. A metallic radial highlight reads as a domed pin
 * head; a soft cast shadow sits it ON the image. On hover/focus the pin lifts
 * a touch and its shadow spreads, like a pin you could pluck back out.
 */
.lookbook__marker {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: var( --lookbook-marker-size );
	height: var( --lookbook-marker-size );
	padding: 0;
	border: 0;
	border-radius: 50%;
	background:
		radial-gradient(
			circle at 32% 28%,
			var( --lookbook-accent-sheen ) 0%,
			var( --lookbook-accent ) 42%,
			var( --lookbook-accent-deep ) 100%
		);
	color: #1b1206;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	box-shadow:
		0 0 0 2px var( --lookbook-pin-ring ),
		0 1px 1px rgba( 255, 255, 255, 0.6 ) inset,
		0 5px 10px rgba( 20, 17, 15, 0.45 );
	transition: transform 0.18s cubic-bezier( 0.34, 1.56, 0.64, 1 ),
		box-shadow 0.18s ease;
}

.lookbook__marker:hover,
.lookbook__marker:focus-visible {
	transform: translateY( -2px ) scale( 1.12 );
	box-shadow:
		0 0 0 2px var( --lookbook-pin-ring ),
		0 1px 1px rgba( 255, 255, 255, 0.7 ) inset,
		0 10px 18px rgba( 20, 17, 15, 0.5 );
}

.lookbook__marker:focus-visible {
	outline: 2px solid var( --lookbook-accent );
	outline-offset: 4px;
}

.lookbook__marker-number {
	pointer-events: none;
	transform: translateZ( 0 );
}

/* ---- The tag (product card popover) -------------------------------------- */
.lookbook__card {
	width: 248px;
	max-width: calc( 100vw - 32px );
	margin: 0;
	padding: 14px;
	border: 1px solid var( --lookbook-card-border );
	border-radius: var( --lookbook-radius );
	background: var( --lookbook-card-bg );
	color: var( --lookbook-card-fg );
	box-shadow: var( --lookbook-shadow );
	/* The stage sets line-height: 0 to drop the gap under the photo; the card
	 * lives inside it, so without this reset its price and button collapse to
	 * zero-height lines. */
	line-height: 1.5;
	/* The pin point lives at the top: the tag hangs from it. */
	transform-origin: top center;
	/* Popover positioning is refined by the script; this is the closed state. */
	inset: auto;
}

/* THE EARNED MICRO-INTERACTION: the tag swings down from the pin like a paper
 * label tethered to it, settling with one short pendulum overshoot. */
.lookbook__card:popover-open,
.lookbook__card--fallback:not( [hidden] ) {
	animation: lookbook-tag-drop 0.34s cubic-bezier( 0.22, 1.2, 0.4, 1 );
}

@keyframes lookbook-tag-drop {
	0% {
		opacity: 0;
		transform: translateY( -8px ) rotate( -3.5deg );
	}

	60% {
		opacity: 1;
		transform: translateY( 0 ) rotate( 1.5deg );
	}

	100% {
		opacity: 1;
		transform: translateY( 0 ) rotate( 0 );
	}
}

.lookbook__card-link {
	display: block;
	text-decoration: none;
	color: inherit;
}

.lookbook__card-thumb {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
	margin-bottom: 10px;
}

.lookbook__card-title {
	display: block;
	font-family: var( --lookbook-card-title-font );
	font-size: 15px;
	font-weight: 600;
	line-height: 1.3;
	letter-spacing: 0.01em;
}

.lookbook__card-price {
	display: block;
	margin: 7px 0 12px;
	font-size: 14px;
	color: var( --lookbook-card-muted );
}

.lookbook__card-price del {
	opacity: 0.7;
	margin-right: 4px;
}

.lookbook__card-price ins {
	text-decoration: none;
	color: var( --lookbook-accent-sheen );
	font-weight: 600;
}

.lookbook__card-cta.button {
	display: inline-block;
	width: 100%;
	text-align: center;
	box-sizing: border-box;
	text-decoration: none;
}

/* Fallback button for themes that give .button no styles of their own (block
 * themes such as Twenty Twenty-Five), where the CTA would otherwise render as
 * bare underlined text. Zero specificity, so a theme's .button rules (Storefront)
 * still win. */
:where( .lookbook__card-cta ) {
	padding: 9px 16px;
	border: 1px solid var( --lookbook-card-border );
	border-radius: 6px;
	font-weight: 600;
}

@media ( prefers-reduced-motion: reduce ) {
	.lookbook__marker,
	.lookbook__marker:hover,
	.lookbook__marker:focus-visible {
		transition: none;
		transform: none;
	}

	.lookbook__card:popover-open,
	.lookbook__card--fallback:not( [hidden] ) {
		animation: none;
	}
}

/* Dark styling follows the page's color-scheme (set by the theme), not the
   visitor's OS. Tokens sit in @supports: a custom property is never dropped
   at parse time, so an unsupported light-dark() would blank every use site. */
@supports ( color: light-dark( white, black ) ) {
	.lookbook {
		--lookbook-card-bg: light-dark( #14110f, #1c1814 );
		--lookbook-card-fg: light-dark( #f6f1e8, #f6f1e8 );
		--lookbook-card-muted: light-dark( #b7ab97, #c2b6a1 );
		--lookbook-card-border: light-dark( rgba( 184, 132, 63, 0.72 ), rgba( 184, 132, 63, 0.78 ) );
		--lookbook-pin-ring: light-dark( rgba( 255, 255, 255, 0.92 ), rgba( 246, 241, 232, 0.85 ) );
	}
}

/* Browsers without light-dark() keep the previous OS-based dark pass. */
@supports not ( color: light-dark( white, black ) ) {
	@media ( prefers-color-scheme: dark ) {
		.lookbook {
			--lookbook-card-bg: #1c1814;
			--lookbook-card-fg: #f6f1e8;
			--lookbook-card-muted: #c2b6a1;
			--lookbook-card-border: rgba( 184, 132, 63, 0.78 );
			--lookbook-pin-ring: rgba( 246, 241, 232, 0.85 );
		}
	}
}
