/*
 * Zone page (taxonomy-zone.php · DESIGN-SPEC §4.3 + §4.3b · §3.6 tile · frames 3117:3684 / 3713 / 3742, 2026-11).
 * Desktop 1440 (zone 1, text block folded): cover [160,150 1120×410] · banner [160,580 1120×166] shadow-200 ·
 * text block [160,826 1120×193] · grid from 826+H+60 (tile 184, gap 50) · Back = grid bottom + 74 (P-243) ·
 * page end = Back bottom + 75 (frame 1930). Same values for zones 1–3. Tablet/mobile: same order, fluid (D5).
 */

.sh-zone {
	--sh-zone-banner-gap: var(--sh-space-20); /* cover bottom y=560 → banner y=580 */
	--sh-zone-intro-gap: 80px;     /* banner bottom y=746 → text block y=826 */
	--sh-zone-grid-gap: var(--sh-tile-gap);
	--sh-zone-grid-top: 60px;      /* Frame 114482 gap: text block → grid */
	--sh-zone-back-gap: 74px;      /* grid bottom → Back (P-243 rule) */
	--sh-zone-bottom: 75px;        /* Back bottom y=1855 → page end y=1930 */
	--sh-zone-cover-mobile-scale: 0.5; /* mobile: cover shown at 50% of desktop size */
	--sh-zone-banner-strip: 840px; /* mobile: banner image width (labels ≈ 15px) */
}

/* ---- Text block "Detail text Zone 1" (3117:5051): column gap 20 · heading 34/42.5 · text 20/22 centred ---- */
.sh-zone__intro {
	display: flex;
	flex-direction: column;
	gap: var(--sh-space-20);
	margin-top: var(--sh-zone-intro-gap);
}

.sh-zone__intro-title {
	margin: 0;
}

/* One paragraph per line, no paragraph gap (the Figma text is one node with line breaks). */
.sh-zone__intro-text > p {
	margin: 0;
}

.sh-zone__intro-body.is-animating {
	overflow: hidden;
	transition: height var(--sh-duration-tile) var(--sh-ease); /* smart-animate 0.3s */
}

/* JS folds the full text away; without JS the full text shows and the toggle stays hidden. */
.sh-zone__intro.has-more .sh-zone__intro-text--short,
.sh-zone__intro .sh-read-more-row {
	display: none;
}

.sh-js .sh-zone__intro.has-more:not(.is-open) .sh-zone__intro-text--short,
.sh-js .sh-zone__intro .sh-read-more-row {
	display: block;
}

.sh-js .sh-zone__intro.has-more:not(.is-open) .sh-zone__intro-text--full {
	display: none;
}

.sh-zone__intro .sh-read-more-row {
	font: var(--sh-type-read-more-home); /* strut = 22px so the row is 22 tall */
}

/* ---- Cover (1120×410) · 2026-11 banners are plain FILL (4096×1503 → cover) ---- */
.sh-zone__cover {
	aspect-ratio: 1120 / 410;
	overflow: hidden;
}

.sh-zone__cover-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/*
 * ---- Banner (1120×166 · Drop Shadow/200) ----
 * Figma `Frame 12684` has radius 22 but clipsContent=false, so the image keeps square corners in the
 * rendered frame (verified on frame PNG) — no border-radius here. Its Drop Shadow/200 follows the image's
 * opaque pixels (none above the white area), so it is a drop-shadow filter, not a box-shadow.
 */
.sh-zone__banner {
	margin-top: var(--sh-zone-banner-gap);
	/* drop-shadow() takes the standard deviation (= half of a box-shadow blur): Figma blur 4 → 2px. */
	filter: drop-shadow(0 1px 2px rgba(12, 12, 13, 0.05)) drop-shadow(0 1px 2px rgba(12, 12, 13, 0.1));
}

.sh-zone__banner-view {
	overflow: hidden;
}

.sh-zone__banner-strip {
	position: relative;
	aspect-ratio: 1120 / 166;
	overflow: hidden;
}

.sh-zone__banner-img {
	width: 100%;
	height: 100%;
	object-fit: fill;
}

/* Figma imageTransform: the 4096×965 export is cropped to x 2.556%–97.46% · y 14.10%–73.80% of the image. */
.sh-zone__banner--crop .sh-zone__banner-img {
	position: absolute;
	top: -23.617%;
	left: -2.693%;
	width: 105.372%;
	height: 167.489%;
	max-width: none;
}

/* ---- ZONE 1–5 tab hotspots (D56 · template-parts/zone/tabs.php): 5 × 20 % over the tab row (y 833–876 of 710–876 = from 74.1 %) ---- */
.sh-zbar__nav,
.sh-zbar__tabs {
	position: absolute;
	inset: 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.sh-zbar__tab {
	position: absolute;
	top: 74.1%;
	bottom: 0;
	left: calc(var(--sh-zbar-i, 0) * 20%);
	width: 20%;
}

.sh-zbar__hit {
	display: block;
	width: 100%;
	height: 100%;
}

.sh-zbar__hit--link:focus-visible {
	outline: 2px solid var(--sh-color-neutral-800);
	outline-offset: -2px;
}

/* ---- Trail grid: 5 × 184 (gap 50) at 1440 ---- */
.sh-zone__grid {
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: var(--sh-zone-grid-gap);
	margin-top: var(--sh-zone-grid-top);
	padding: 0;
	list-style: none;
}

.sh-tile {
	position: relative;
	aspect-ratio: 1;
	background: var(--sh-tile-bg, var(--sh-color-tile-beige));
}

.sh-tile__link {
	position: absolute;
	inset: 0;
	display: block;
}

.sh-tile__link:focus-visible {
	outline: 2px solid var(--sh-color-neutral-800);
	outline-offset: 2px;
}

.sh-tile__img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sh-tile__name {
	position: absolute;
	inset: 0;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: var(--sh-space-10);
	text-align: center;
}

/* Hover image 210 on a 184 tile: 13px out on every side (7.065%). Not shown until hover. */
.sh-tile__img--hover {
	position: absolute;
	top: -7.065%;
	left: -7.065%;
	width: 114.13%;
	height: 114.13%;
	max-width: none;
	opacity: 0;
	transform: scale(0.876);
	pointer-events: none;
	transition: opacity var(--sh-duration-tile) var(--sh-ease), transform var(--sh-duration-tile) var(--sh-ease);
}

.sh-tile__img {
	transition: transform var(--sh-duration-tile) var(--sh-ease);
}

@media (hover: hover) {
	.sh-tile:hover {
		z-index: 2;
	}

	.sh-tile:hover .sh-tile__img--hover {
		opacity: 1;
		transform: none;
	}

	/* No hover image uploaded: grow the default image to 210 instead. */
	.sh-tile--no-hover:hover .sh-tile__img {
		transform: scale(1.1413);
	}
}

@media (prefers-reduced-motion: reduce) {
	.sh-tile__img,
	.sh-tile__img--hover {
		transition: none;
	}
}

/* ---- Back + page end ---- */
.sh-zone__back {
	margin-top: var(--sh-zone-back-gap);
	padding-bottom: var(--sh-zone-bottom);
}

/* ---- Tablet / mobile (no Figma frame — D5) ---- */
@media (max-width: 1023px) {
	.sh-zone[data-zone] {
		--sh-zone-grid-gap: var(--sh-space-20);
		--sh-zone-banner-gap: var(--sh-space-20);
		--sh-zone-intro-gap: var(--sh-space-40);
		--sh-zone-grid-top: var(--sh-space-40);
		--sh-zone-back-gap: var(--sh-space-40);
		--sh-zone-bottom: var(--sh-space-40);
	}
}

@media (max-width: 767px) {
	.sh-zone[data-zone] {
		--sh-zone-grid-gap: var(--sh-space-12);
		--sh-zone-banner-gap: var(--sh-space-16);
	}

	.sh-zone__grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}

	/*
	 * The zone name is baked into the cover image: show the cover at half desktop scale (205px tall, centred crop)
	 * so the title keeps a cap height ≥ ~12px instead of shrinking with the width.
	 */
	.sh-zone__cover {
		height: calc(var(--sh-zone-cover-mobile-scale) * 410px);
		aspect-ratio: auto;
	}

	.sh-zone[data-zone] .sh-zone__cover-img {
		width: 100%;
		height: 100%;
		object-fit: cover;
		object-position: 50% 50%;
	}

	/* The ZONE 1–5 labels are baked into the image: keep them ≥14px by scrolling the strip inside the box. */
	.sh-zone__banner-view {
		overflow-x: auto;
		overscroll-behavior-x: contain;
	}

	.sh-zone__banner-strip {
		width: var(--sh-zone-banner-strip);
	}
}
