/*
 * Paganini Congressi — home card & data components (Carta Tecnica).
 *
 * Owned by the home agent (§7): the drawing-sheet building blocks the home set-
 * pieces are assembled from —
 *   - .pc-folio-bar     ink DWG strips (FIG/PLATE caption + meta) under the hero.
 *   - .pc-plate         PlateCaption photo card (tag + scale chip + caption strip).
 *   - .pc-venues*       asymmetric venues showcase (V-01 feature + V-02/03/04 row).
 *   - .pc-stats__grid / .pc-stat*  the dark instrument-panel count-up numbers.
 *   - .pc-drawing / .pc-plan / .pc-legend  the TAV.01 axonometric drawing sheet.
 *   - .pc-downloads / .pc-download  the PDF scheda rows.
 *
 * Tokens come from theme.json presets (--wp--preset--*) and base.css :root
 * (--pc-*). Brand hex never appears outside the enumerated chip/scrim rgba()
 * strings the spec defines (§0/§8). The .pc-stats container + .pc-stat__number
 * class are the count-up contract main.js observes — do not rename (§6).
 *
 * The .pc-specrow / .pc-spec-dark base styles are owned by inner (page.css); the
 * home venues reuse them via class. This file only adds the home-scoped wrappers
 * (.pc-venues__*) that lay them out.
 */

/* =======================================================================
   FOLIO BAR — ink DWG strip (Carta Tecnica §3.9 / §4.1a)
   The thin ink label bars tucked under the hero photo: FIG caption strip then
   PLATE meta strip. Full-bleed flush to the section gutters.
   ======================================================================= */
.pc-folio-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--wp--preset--spacing--30);
	padding: 0.875rem var(--wp--preset--spacing--40);
	background: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--pc-fs-mono-sm);
	letter-spacing: var(--pc-ls-mono);
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
}

/* The FIG bar (top of the pair) gets a hairline divider from the PLATE bar. */
.pc-folio-bar--cap {
	border-bottom: 1px solid var(--pc-rule-ink);
}

.pc-folio-bar__left {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	min-width: 0;
}

.pc-folio-bar__tag {
	flex: 0 0 auto;
	color: var(--wp--preset--color--primary);
}

.pc-folio-bar__desc {
	color: var(--wp--preset--color--base);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pc-folio-bar__right {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	flex: 0 0 auto;
}

.pc-folio-bar__meta {
	color: var(--pc-mute-light);
}

.pc-folio-bar__scale {
	color: var(--pc-mute);
}

.pc-folio-bar__right--accent {
	color: var(--wp--preset--color--primary);
}

@media (max-width: 781px) {
	/* Mobile: the PLATE meta bar drops the project/scale split to fit. */
	.pc-folio-bar__meta {
		display: none;
	}
}

/* =======================================================================
   PLATE — PlateCaption photo card (Carta Tecnica §3.6)
   border + clipped white card: image slot with a V-0n chip (top-left) + scale
   chip (top-right), then an ink caption strip (FIG · meta). Photos read natural
   (no duotone/grain). Plan/scheda images opt out via .pc-plan (filter:none).
   ======================================================================= */
.pc-plate {
	margin: 0;
	display: flex;
	flex-direction: column;
	overflow: clip;
	background: var(--wp--preset--color--base);
	border: 1px solid var(--pc-hairline);
}

.pc-plate__img {
	position: relative;
	aspect-ratio: 4 / 3;
	overflow: clip;
}

.pc-plate__img img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--pc-ease);
}

@media (prefers-reduced-motion: no-preference) {
	.pc-plate:hover .pc-plate__img img,
	.pc-plate:focus-within .pc-plate__img img {
		transform: scale(1.03);
	}
}

/* Tag chip (V-0n): flat ink chip, accent code. Scale chip: 80%-ink chip, white. */
.pc-plate__tag,
.pc-plate__scale {
	position: absolute;
	top: 0.75rem;
	padding: 0.3rem 0.55rem;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--pc-fs-mono-xs);
	letter-spacing: var(--pc-ls-mono);
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
	line-height: 1;
}

.pc-plate__tag {
	left: 0.75rem;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--primary);
}

.pc-plate__scale {
	right: 0.75rem;
	background: var(--pc-ink-80);
	color: var(--wp--preset--color--base);
}

/* Caption strip: ink bar with FIG label (soft white) + right meta (accent). */
.pc-plate__cap {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.875rem 1.125rem;
	background: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--pc-fs-mono-sm);
	letter-spacing: var(--pc-ls-mono);
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
}

.pc-plate__fig {
	color: var(--pc-mute-light);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pc-plate__cap-meta {
	flex: 0 0 auto;
	color: var(--wp--preset--color--primary);
}

/* Plan/scheda images (DO-NOT-BREAK §8.6): crisp 1:1, no filter, no hover zoom. */
.pc-plan {
	filter: none;
}

.pc-plate:hover .pc-plan,
.pc-plate:focus-within .pc-plan {
	transform: none;
}

/* =======================================================================
   VENUES — asymmetric showcase (Carta Tecnica §4.1c)
   Header (eyebrow + serif H2 / right count), a feature row (big plate + body |
   dark spec panel), then a 3-up small-card row.
   ======================================================================= */
.pc-venues__head {
	gap: var(--wp--preset--spacing--40);
	margin-bottom: clamp(2.5rem, 5vw, 3rem);
}

.pc-venues__heading .pc-eyebrow {
	margin-bottom: 1rem;
}

.pc-venues__heading > h2 {
	margin: 0;
	color: var(--wp--preset--color--ink);
}

.pc-venues__count {
	margin: 0;
	color: var(--pc-mute);
	letter-spacing: var(--pc-ls-mono-wide);
}

/* --- Feature row: big plate + body (left) · dark spec panel (right) --------- */
.pc-venues__feature {
	display: grid;
	gap: var(--wp--preset--spacing--40);
	margin-bottom: var(--wp--preset--spacing--40);
}

@media (min-width: 782px) {
	.pc-venues__feature {
		grid-template-columns: 1fr minmax(20rem, 24rem);
		gap: var(--wp--preset--spacing--40);
		align-items: stretch;
	}
}

/* Column 1: the big plate + its body, stacked. Wrapping them keeps the feature
   grid at exactly 2 children (plate-col | dark spec) so the spec panel sits
   beside the plate rather than wrapping under it. */
.pc-venues__feature-col {
	display: flex;
	flex-direction: column;
}

.pc-venues__feature-plate {
	margin: 0;
}

.pc-venues__feature-plate .pc-plate__img {
	aspect-ratio: 16 / 10;
}

/* The feature body sits under the big plate (kicker · serif name · cap row). */
.pc-venues__feature-body {
	padding-top: var(--wp--preset--spacing--40);
}

.pc-venues__kicker {
	margin: 0 0 0.75rem;
	color: var(--pc-mute);
	letter-spacing: var(--pc-ls-mono);
}

.pc-venues__name {
	margin: 0;
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: clamp(1.875rem, 3vw, 2.5rem);
	line-height: 1.05;
	letter-spacing: -0.01em;
	color: var(--wp--preset--color--ink);
}

.pc-venues__name--sm {
	font-size: clamp(1.5rem, 2.4vw, 1.625rem);
}

.pc-venues__name a {
	color: inherit;
	text-decoration: none;
	background-image: linear-gradient(currentColor, currentColor);
	background-position: 0 100%;
	background-repeat: no-repeat;
	background-size: 0% 1px;
}

@media (prefers-reduced-motion: no-preference) {
	.pc-venues__name a {
		transition: background-size var(--pc-dur-fast, 0.28s) var(--pc-ease);
	}
}

.pc-venues__name a:hover,
.pc-venues__name a:focus-visible {
	background-size: 100% 1px;
}

/* Cap row: capacity mono label (left) + SCOPRI arrow link (right). */
.pc-venues__cap-row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	margin: 0.875rem 0 0;
}

.pc-venues__cap {
	color: var(--pc-mute);
	letter-spacing: var(--pc-ls-mono);
	font-weight: 600;
}

.pc-venues__go {
	flex: 0 0 auto;
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--pc-fs-mono-sm);
	letter-spacing: var(--pc-ls-mono);
	text-transform: uppercase;
	color: var(--wp--preset--color--primary-strong);
	text-decoration: none;
}

.pc-venues__go span {
	display: inline-block;
	transition: transform var(--pc-dur-fast, 0.25s) var(--pc-ease);
}

.pc-venues__go:hover span,
.pc-venues__go:focus-visible span {
	transform: translateX(0.3rem);
}

/* The dark spec panel inside the feature row stretches to the plate+body height
   and pins its link to the bottom. .pc-spec-dark base styles are inner-owned. */
.pc-venues__feature .pc-spec-dark {
	display: flex;
	flex-direction: column;
}

.pc-venues__spec-link {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-top: auto;
	padding: 1.125rem 1.5rem;
	border-top: 1px solid var(--pc-rule-ink);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--pc-fs-mono-sm);
	letter-spacing: var(--pc-ls-mono);
	text-transform: uppercase;
	color: var(--wp--preset--color--primary);
	text-decoration: none;
}

.pc-venues__spec-link span {
	display: inline-block;
	transition: transform var(--pc-dur-fast, 0.25s) var(--pc-ease);
}

.pc-venues__spec-link:hover span,
.pc-venues__spec-link:focus-visible span {
	transform: translateX(0.3rem);
}

/* --- 3-up small-card row (V-02/03/04) -------------------------------------- */
.pc-venues__row {
	display: grid;
	gap: var(--wp--preset--spacing--40);
}

@media (min-width: 600px) {
	.pc-venues__row {
		grid-template-columns: repeat(3, 1fr);
	}
}

.pc-venues__card .pc-plate {
	margin-bottom: var(--wp--preset--spacing--40);
}

.pc-venues__card .pc-plate__img {
	aspect-ratio: 4 / 3;
}

.pc-venues__card .pc-venues__cap-row {
	margin-top: 0.75rem;
}

/* =======================================================================
   STATS — dark instrument-panel count-up grid (Carta Tecnica §4.1d)
   The .pc-stats container is observed by main.js for count-up; .pc-stat__number
   carries the animated value (parse rule keeps 2001 = 2001). Tabular mono so the
   counting numerals never reflow.
   ======================================================================= */
.pc-stats__grid {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
}

@media (min-width: 782px) {
	.pc-stats__grid {
		grid-template-columns: repeat(4, 1fr);
	}
}

.pc-stat {
	padding: var(--wp--preset--spacing--40) var(--wp--preset--spacing--40) var(--wp--preset--spacing--50);
	border-top: 1px solid var(--pc-rule-ink);
}

/* Vertical hairlines between cells (left rule on all but the first per row). */
.pc-stat:nth-child(n + 2) {
	border-left: 1px solid var(--pc-rule-ink);
}

@media (min-width: 782px) {
	.pc-stat:nth-child(4n + 1) {
		border-left: 0;
		padding-left: 0;
	}

	.pc-stat:not(:nth-child(4n + 1)) {
		padding-left: var(--wp--preset--spacing--40);
	}
}

@media (max-width: 781px) {
	.pc-stat:nth-child(odd) {
		border-left: 0;
		padding-left: 0;
	}
}

/* Top meta: index (mute) + unit (accent), spread to the cell edges. */
.pc-stat__top {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5rem;
	margin-bottom: 0.875rem;
}

.pc-stat__idx {
	color: var(--pc-mute);
	letter-spacing: var(--pc-ls-mono);
	font-size: var(--pc-fs-mono-xs);
}

.pc-stat__unit {
	color: var(--wp--preset--color--primary);
	letter-spacing: var(--pc-ls-mono);
	font-size: var(--pc-fs-mono-xs);
}

/* The numeral: IBM Plex Mono, white, oversized, tabular so count-up is stable. */
.pc-stat__number {
	margin: 0;
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 600;
	font-size: clamp(3.25rem, 6vw, 5.5rem);
	line-height: 0.9;
	letter-spacing: -0.04em;
	color: var(--wp--preset--color--base);
	font-variant-numeric: tabular-nums;
	font-feature-settings: "tnum" 1;
}

.pc-stat__label {
	margin: 0.875rem 0 0;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.4;
	color: var(--pc-mute-light);
}

/* Per-stat reveal stagger so the numerals settle in sequence. */
.pc-stats__grid > .pc-stat:nth-child(1) { --pc-i: 0; }
.pc-stats__grid > .pc-stat:nth-child(2) { --pc-i: 1; }
.pc-stats__grid > .pc-stat:nth-child(3) { --pc-i: 2; }
.pc-stats__grid > .pc-stat:nth-child(4) { --pc-i: 3; }

/* =======================================================================
   TECH — drawing sheet (TAV.01 pianta-complesso) + PDF downloads (§4.1e)
   ======================================================================= */
.pc-tech__head {
	gap: var(--wp--preset--spacing--40);
	margin-bottom: clamp(2.5rem, 5vw, 3rem);
}

.pc-tech__heading .pc-eyebrow {
	margin-bottom: 1rem;
}

.pc-tech__heading > h2 {
	margin: 0;
	color: var(--wp--preset--color--ink);
}

.pc-tech__meta {
	margin: 0;
	color: var(--pc-mute);
	letter-spacing: var(--pc-ls-mono-wide);
}

.pc-tech__body {
	display: grid;
	gap: clamp(2.5rem, 5vw, 4rem);
	align-items: start;
}

/* Grid children default to min-width:auto, which floors the track at the
   content's intrinsic size — at 390px the drawing's nowrap descriptor + legend
   blow the track (and the document) past the viewport. Let the track shrink. */
.pc-tech__body > * {
	min-width: 0;
}

@media (min-width: 920px) {
	.pc-tech__body {
		grid-template-columns: 1fr minmax(22rem, 26rem);
	}
}

/* --- Drawing sheet: ink title bar + surface frame + legend row -------------- */
.pc-drawing {
	border: 1px solid var(--pc-hairline);
	background: var(--wp--preset--color--base);
	overflow: clip;
	min-width: 0;       /* allow the sheet to shrink below its nowrap content */
}

.pc-drawing__bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.75rem 1rem;
	background: var(--wp--preset--color--ink);
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--pc-fs-mono-sm);
	letter-spacing: var(--pc-ls-mono);
	text-transform: uppercase;
	font-variant-numeric: tabular-nums;
}

.pc-drawing__bar-left {
	display: flex;
	align-items: center;
	gap: 0.875rem;
	min-width: 0;
}

.pc-drawing__tag {
	flex: 0 0 auto;
	color: var(--wp--preset--color--primary);
}

.pc-drawing__desc {
	color: var(--wp--preset--color--base);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.pc-drawing__scale {
	flex: 0 0 auto;
	color: var(--pc-mute);
}

/* Plan frame: surface ground, the axonometric line drawing contained inside,
   never exceeding 750px wide (DO-NOT-BREAK §8.6). filter:none / no zoom (.pc-plan
   above). */
.pc-drawing__frame {
	display: flex;
	justify-content: center;
	padding: clamp(1.5rem, 4vw, 2.5rem);
	background: var(--wp--preset--color--surface);
}

.pc-drawing__frame .pc-plan {
	display: block;
	width: 100%;
	max-width: 750px;
	height: auto;
	object-fit: contain;
}

/* Legend row (A/B/C/D chips) under the plan on a white ground. */
.pc-legend {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem 1.5rem;
	padding: 0.875rem 1rem;
	border-top: 1px solid var(--pc-hairline);
}

.pc-legend__item {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
}

.pc-legend__code {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--primary);
	font-family: var(--wp--preset--font-family--mono);
	font-weight: 600;
	font-size: var(--pc-fs-mono-xs);
	line-height: 1;
}

.pc-legend__label {
	font-family: var(--wp--preset--font-family--mono);
	font-size: var(--pc-fs-mono-xs);
	letter-spacing: var(--pc-ls-mono);
	text-transform: uppercase;
	color: var(--wp--preset--color--ink);
}

/* --- Downloads: PDF scheda rows ------------------------------------------- */
.pc-downloads__title {
	margin: 0 0 0.75rem;
	color: var(--wp--preset--color--primary-strong);
	letter-spacing: var(--pc-ls-mono-wide);
}

.pc-downloads__note {
	margin: 0 0 var(--wp--preset--spacing--40);
	font-size: var(--wp--preset--font-size--small);
	line-height: 1.55;
	color: var(--wp--preset--color--ink-soft);
}

.pc-download {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding: 1.125rem 0;
	border-top: 1px solid var(--pc-hairline);
	text-decoration: none;
}

.pc-download:last-child {
	border-bottom: 1px solid var(--pc-hairline);
}

.pc-download__text {
	display: flex;
	flex-direction: column;
	gap: 0.35rem;
	min-width: 0;
}

.pc-download__name {
	font-family: var(--wp--preset--font-family--display);
	font-weight: 400;
	font-size: 1.5rem;
	line-height: 1.05;
	color: var(--wp--preset--color--ink);
}

.pc-download__file {
	color: var(--pc-mute);
	letter-spacing: var(--pc-ls-mono);
	text-transform: none;
}

/* Download icon box: surface square with an arrow, fills ink on hover. */
.pc-download__icon {
	flex: 0 0 auto;
	width: 42px;
	height: 42px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	background: var(--wp--preset--color--surface);
	border: 1px solid var(--pc-hairline);
	color: var(--wp--preset--color--ink);
	font-size: 1.1rem;
	line-height: 1;
	transition:
		background 0.3s var(--pc-ease),
		color 0.3s var(--pc-ease),
		border-color 0.3s var(--pc-ease);
}

.pc-download:hover .pc-download__icon,
.pc-download:focus-visible .pc-download__icon {
	background: var(--wp--preset--color--ink);
	border-color: var(--wp--preset--color--ink);
	color: var(--wp--preset--color--primary);
}

.pc-download:hover .pc-download__name,
.pc-download:focus-visible .pc-download__name {
	text-decoration: underline;
	text-underline-offset: 0.18em;
}
