/* =============================================================================
   Artwork single — per-template stylesheet.

   Enqueued only on is_singular('wwh_artwork'). Implements the Event-Single
   design grammar adapted for a gallery artwork: full-bleed featured-image hero with a "medium stamp" glass card
   on the left, breadcrumbs / title / meta on the right; two-column body
   with prose left + sticky maker-card rail right; a facts list below the
   prose; and a cream-2 "more by this handmaker" rail at the bottom.

   All values pulled from theme.json tokens.
   ========================================================================= */

/* -----------------------------------------------------------------------------
   Hero
   ----------------------------------------------------------------------------- */

body.wwh-magazine .wwh-single--artwork .wwh-artwork-hero {
	position: relative;
	min-height: 86vh;
	color: #fff;
	padding: clamp(7rem, 12vh, 9rem) clamp(1.5rem, 5vw, 3.5rem) clamp(3rem, 6vh, 4rem);
	display: flex;
	align-items: flex-end;
	overflow: hidden;
}

body.wwh-magazine .wwh-single--artwork .wwh-artwork-hero .wp-block-cover__background,
body.wwh-magazine .wwh-single--artwork .wwh-artwork-hero::after {
	background: linear-gradient(180deg,
		rgba(10, 8, 6, 0.35) 0%,
		rgba(10, 8, 6, 0.2) 35%,
		rgba(10, 8, 6, 0.85) 100%);
}

body.wwh-magazine .wwh-single--artwork .wwh-artwork-hero .wp-block-cover__inner-container {
	width: 100%;
	max-width: 1200px;
	margin: 0 auto;
	display: grid;
	grid-template-columns: auto 1fr;
	gap: clamp(1.5rem, 4vw, 3rem);
	align-items: end;
}

/* "Medium stamp" — glass card on the left (mirrors the event date-stamp) */
body.wwh-magazine .wwh-artwork-medium-stamp {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	justify-content: center;
	padding: var(--wp--preset--spacing--6) var(--wp--preset--spacing--8);
	background: rgba(255, 255, 255, 0.07);
	backdrop-filter: blur(14px);
	-webkit-backdrop-filter: blur(14px);
	border: 1px solid rgba(255, 255, 255, 0.2);
	min-width: 220px;
	max-width: 260px;
}

body.wwh-magazine .wwh-artwork-medium-stamp__lab {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--cap);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
	margin: 0;
}

body.wwh-magazine .wwh-artwork-medium-stamp__val {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-weight: 400;
	font-size: clamp(1.75rem, 2.6vw, 2.5rem);
	line-height: 1.05;
	letter-spacing: -0.01em;
	margin-top: var(--wp--preset--spacing--2);
	color: #fff;
}

/* The stamp is the medium label. If the medium meta is empty, the stamp
   has nothing to say — hide it entirely so the hero collapses to a single
   column (title + meta), which the cover grid already handles via 1fr. */
body.wwh-magazine .wwh-artwork-medium-stamp:has(.wwh-artwork-medium-stamp__val:empty) {
	display: none;
}
body.wwh-magazine .wwh-single--artwork .wwh-artwork-hero .wp-block-cover__inner-container:has(.wwh-artwork-medium-stamp__val:empty) {
	grid-template-columns: 1fr;
}

/* Hero copy column */
body.wwh-magazine .wwh-artwork-hero__copy {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--6);
}

body.wwh-magazine .wwh-artwork-hero__eyebrow {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--cap);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.7);
	margin: 0;
}

body.wwh-magazine .wwh-artwork-hero__title {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-weight: 400;
	font-size: var(--wp--preset--font-size--display-hero);
	line-height: 0.98;
	letter-spacing: -0.015em;
	text-wrap: balance;
	color: #fff;
	margin: 0;
}

body.wwh-magazine .wwh-artwork-hero__at {
	display: flex;
	gap: var(--wp--preset--spacing--8);
	flex-wrap: wrap;
	padding-top: var(--wp--preset--spacing--4);
	border-top: 1px solid rgba(255, 255, 255, 0.18);
	margin-top: var(--wp--preset--spacing--1);
}

body.wwh-magazine .wwh-artwork-hero__at-item {
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--1);
}

body.wwh-magazine .wwh-artwork-hero__at-lab {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--cap);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
	margin: 0;
}

body.wwh-magazine .wwh-artwork-hero__at-val {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-size: var(--wp--preset--font-size--card-title);
	color: #fff;
	margin: 0;
}

body.wwh-magazine .wwh-artwork-hero__at-item:has(.wwh-artwork-hero__at-val:empty) {
	display: none;
}

/* -----------------------------------------------------------------------------
   Two-column body: prose left, sticky maker-card rail right
   ----------------------------------------------------------------------------- */

body.wwh-magazine .wwh-artwork-body {
	max-width: 1280px;
	margin: 0 auto;
	padding: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 5vw, 3.5rem);
	display: grid;
	grid-template-columns: minmax(0, 1fr) 360px;
	gap: clamp(2rem, 5vw, 5rem);
	align-items: start;
}

body.wwh-magazine .wwh-artwork-body__prose {
	max-width: 60ch;
}

body.wwh-magazine .wwh-artwork-body__lede {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--lede);
	line-height: 1.55;
	color: var(--wp--preset--color--ink-primary);
	margin: 0 0 var(--wp--preset--spacing--8);
}

/* Drop-cap initial on the lede paragraph */
body.wwh-magazine .wwh-artwork-body__lede:not(:empty)::first-letter {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-weight: 400;
	font-size: 5.4em;
	line-height: 0.85;
	float: left;
	margin: 0.05em 0.12em -0.05em 0;
	color: var(--wp--preset--color--ink-primary);
}

body.wwh-magazine .wwh-artwork-body__prose .wp-block-post-content {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--prose);
	line-height: 1.65;
	color: var(--wp--preset--color--ink-primary);
}

body.wwh-magazine .wwh-artwork-body__prose .wp-block-post-content > * + * {
	margin-top: var(--wp--preset--spacing--6);
}

body.wwh-magazine .wwh-artwork-body__prose .wp-block-post-content h2 {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-weight: 400;
	font-size: var(--wp--preset--font-size--display-prose);
	line-height: 1.1;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--ink-primary);
	margin-top: var(--wp--preset--spacing--12);
}

body.wwh-magazine .wwh-artwork-body__prose .wp-block-post-content blockquote,
body.wwh-magazine .wwh-artwork-body__prose .wp-block-post-content .wp-block-quote {
	border-left: 0;
	margin: var(--wp--preset--spacing--12) 0;
	padding: 0;
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-weight: 400;
	font-size: var(--wp--preset--font-size--display-h3);
	line-height: 1.35;
	color: var(--wp--preset--color--ink-primary);
}

/* Sticky rail — the "From the studio of" maker card */
body.wwh-magazine .wwh-artwork-body__rail {
	position: sticky;
	top: calc(var(--wwh-header-height, 72px) + var(--wp--preset--spacing--6));
	align-self: start;
}

/* Wrap the existing product-maker-card in obsidian-card chrome when it
   appears on an artwork rail. The product-maker-card block emits an
   <aside class="wwh-product-maker-card">, so we restyle in-place. */
body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card {
	background: var(--wp--preset--color--warm-obsidian);
	color: #fff;
	padding: var(--wp--preset--spacing--8);
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--4);
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__eyebrow {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--cap);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.55);
	margin: 0;
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__row {
	display: flex;
	gap: var(--wp--preset--spacing--4);
	align-items: flex-start;
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__portrait {
	flex: 0 0 88px;
	width: 88px;
	height: 88px;
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__portrait img {
	width: 88px;
	height: 88px;
	object-fit: cover;
	border-radius: 9999px;
	display: block;
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__body {
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: var(--wp--preset--spacing--2);
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__name {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-weight: 400;
	font-size: var(--wp--preset--font-size--card-title);
	color: #fff;
	margin: 0;
	line-height: 1.15;
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__name a {
	color: inherit;
	text-decoration: none;
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__meta {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--cap);
	letter-spacing: 0.18em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, 0.65);
	margin: 0;
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__bio {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--caption);
	line-height: 1.55;
	color: rgba(255, 255, 255, 0.85);
	margin: 0;
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__cta {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--cap);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: #fff;
	text-decoration: none;
	border-top: 1px solid rgba(255, 255, 255, 0.18);
	padding-top: var(--wp--preset--spacing--4);
	margin-top: var(--wp--preset--spacing--2);
}

body.wwh-magazine .wwh-artwork-body__rail .wwh-product-maker-card__cta:hover {
	color: rgba(255, 255, 255, 0.7);
}

/* -----------------------------------------------------------------------------
   Facts list — sat below the prose
   ----------------------------------------------------------------------------- */

body.wwh-magazine .wwh-artwork-facts {
	margin-top: var(--wp--preset--spacing--12);
	border-top: 1px solid var(--wwh-hair-light, rgba(26, 22, 19, 0.12));
}

body.wwh-magazine .wwh-artwork-facts__row {
	display: grid;
	grid-template-columns: 200px 1fr;
	gap: var(--wp--preset--spacing--6);
	padding: var(--wp--preset--spacing--6) 0;
	border-bottom: 1px solid var(--wwh-hair-light, rgba(26, 22, 19, 0.12));
	align-items: baseline;
}

body.wwh-magazine .wwh-artwork-facts__lab {
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--cap);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	color: var(--wp--preset--color--ink-caption);
	margin: 0;
}

body.wwh-magazine .wwh-artwork-facts__val {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-size: var(--wp--preset--font-size--card-title);
	color: var(--wp--preset--color--ink-primary);
	margin: 0;
	line-height: 1.2;
}

body.wwh-magazine .wwh-artwork-facts__row:has(.wwh-artwork-facts__val:empty) {
	display: none;
}

body.wwh-magazine .wwh-artwork-facts__row--feat {
	background: var(--wp--preset--color--warm-cream-2);
	padding: var(--wp--preset--spacing--6);
	margin-left: calc(var(--wp--preset--spacing--6) * -1);
	margin-right: calc(var(--wp--preset--spacing--6) * -1);
}

/* -----------------------------------------------------------------------------
   "More by this handmaker" rail — cream-2 wash, same width grammar as facts
   ----------------------------------------------------------------------------- */

body.wwh-magazine .wwh-artwork-gallery {
	background: var(--wp--preset--color--warm-cream-2);
	padding: clamp(3rem, 8vh, 6rem) clamp(1.5rem, 5vw, 3.5rem);
}

body.wwh-magazine .wwh-artwork-gallery__inner {
	max-width: 1280px;
	margin: 0 auto;
}

body.wwh-magazine .wwh-artwork-gallery .wwh-related-artworks__heading {
	font-family: var(--wp--preset--font-family--display);
	font-style: italic;
	font-weight: 400;
	font-size: var(--wp--preset--font-size--display-prose);
	line-height: 1.1;
	color: var(--wp--preset--color--ink-primary);
	margin: 0 0 var(--wp--preset--spacing--8);
}

/* -----------------------------------------------------------------------------
   Responsive
   ----------------------------------------------------------------------------- */

@media (max-width: 1024px) {
	body.wwh-magazine .wwh-artwork-body {
		grid-template-columns: 1fr;
	}
	body.wwh-magazine .wwh-artwork-body__rail {
		position: static;
		order: 2;
	}
	body.wwh-magazine .wwh-artwork-body__prose {
		order: 1;
		max-width: none;
	}
}

@media (max-width: 720px) {
	body.wwh-magazine .wwh-single--artwork .wwh-artwork-hero .wp-block-cover__inner-container {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--8);
	}
	body.wwh-magazine .wwh-artwork-medium-stamp {
		min-width: 0;
		align-self: flex-start;
	}
	body.wwh-magazine .wwh-artwork-facts__row {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--2);
	}
}

/* -----------------------------------------------------------------------------
   Photo plate — full-width band between hero and prose.
   Standalone "photo of the piece" (artwork_photo_id) rendered by
   wwh/artwork-photo-plate. Click on the figure opens a native <dialog>
   lightbox with the full-size source.
   ----------------------------------------------------------------------------- */

body.wwh-magazine .wwh-artwork-plate {
	background: var(--wp--preset--color--warm-cream);
	padding: clamp(3rem, 6vh, 5rem) clamp(1.5rem, 5vw, 3.5rem);
	display: flex;
	justify-content: center;
}

body.wwh-magazine .wwh-artwork-plate__figure {
	margin: 0;
	max-width: 880px;
	width: 100%;
	position: relative;
}

body.wwh-magazine .wwh-artwork-plate__zoom {
	display: block;
	width: 100%;
	padding: 0;
	background: transparent;
	border: 1px solid rgba(26, 22, 19, 0.08);
	cursor: zoom-in;
	position: relative;
	box-shadow: 0 18px 40px rgba(10, 8, 6, 0.12);
	transition: box-shadow 200ms ease, transform 200ms ease;
}

body.wwh-magazine .wwh-artwork-plate__zoom:hover,
body.wwh-magazine .wwh-artwork-plate__zoom:focus-visible {
	box-shadow: 0 24px 56px rgba(10, 8, 6, 0.18);
	transform: translateY(-2px);
	outline: none;
}

body.wwh-magazine .wwh-artwork-plate__zoom img {
	display: block;
	width: 100%;
	height: auto;
}

body.wwh-magazine .wwh-artwork-plate__zoom-hint {
	position: absolute;
	bottom: var(--wp--preset--spacing--4);
	right: var(--wp--preset--spacing--4);
	background: rgba(10, 8, 6, 0.78);
	color: #fff;
	font-family: var(--wp--preset--font-family--ui);
	font-size: var(--wp--preset--font-size--cap);
	letter-spacing: 0.22em;
	text-transform: uppercase;
	padding: var(--wp--preset--spacing--2) var(--wp--preset--spacing--4);
	opacity: 0;
	transition: opacity 200ms ease;
	pointer-events: none;
}

body.wwh-magazine .wwh-artwork-plate__zoom:hover .wwh-artwork-plate__zoom-hint,
body.wwh-magazine .wwh-artwork-plate__zoom:focus-visible .wwh-artwork-plate__zoom-hint {
	opacity: 1;
}

/* -----------------------------------------------------------------------------
   Lightbox dialog
   ----------------------------------------------------------------------------- */

body.wwh-magazine .wwh-artwork-lightbox {
	border: 0;
	padding: 0;
	background: transparent;
	max-width: 96vw;
	max-height: 96vh;
	width: 96vw;
	height: 96vh;
	color: #fff;
}

body.wwh-magazine .wwh-artwork-lightbox::backdrop {
	background: rgba(10, 8, 6, 0.92);
	backdrop-filter: blur(8px);
	-webkit-backdrop-filter: blur(8px);
}

body.wwh-magazine .wwh-artwork-lightbox[open] {
	display: flex;
	align-items: center;
	justify-content: center;
}

body.wwh-magazine .wwh-artwork-lightbox__img {
	max-width: 100%;
	max-height: 100%;
	width: auto;
	height: auto;
	object-fit: contain;
	display: block;
}

body.wwh-magazine .wwh-artwork-lightbox__close {
	position: fixed;
	top: clamp(1rem, 3vh, 2rem);
	right: clamp(1rem, 3vw, 2rem);
	width: 48px;
	height: 48px;
	border-radius: 9999px;
	border: 1px solid rgba(255, 255, 255, 0.4);
	background: rgba(10, 8, 6, 0.6);
	color: #fff;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	font-family: var(--wp--preset--font-family--body);
}

body.wwh-magazine .wwh-artwork-lightbox__close:hover,
body.wwh-magazine .wwh-artwork-lightbox__close:focus-visible {
	background: rgba(255, 255, 255, 0.15);
	border-color: rgba(255, 255, 255, 0.7);
	outline: none;
}
