/* Homepage #UrbanExplore (plans/urbanexplore-map.md Unit 4, docs/design-brief.md › Homepage
   sections › 3). The map is drawn by Route's renderer like a post map (blocks/map/style.css
   gives the frame and the spinner); this file sets the tag, the map height, the loading look
   and the cards over the map bottom. Values copied from the theme: frame pad 20 px, leaf-deep
   #4F6F50, 4 px corners. --iu-explore-strip (set by view.js): px of the map under the cards. */
.iu-explore {
	--iu-explore-leaf: #4f6f50;
	--iu-explore-ink: #1c2330;
	--iu-explore-soft: #6b7076;
}

.iu-explore__tag {
	display: inline-block;
	margin: 0 0 16px;
	padding: 2px 12px;
	background: var(--iu-explore-leaf);
	color: #fff;
	font-family: var(--wp--preset--font-family--display, inherit);
	font-size: 16px;
	font-style: italic;
	font-weight: 700;
	line-height: 1.5;
	letter-spacing: normal;
}

.iu-explore__stage {
	position: relative;
}

/* At most 70% of the screen so the page still scrolls above and below it (018, A7). */
.iurban-map__frame.iu-explore__frame {
	height: min(70vh, 720px);
	height: min(70svh, 720px);
	min-height: 420px;
	max-height: none;
	border-radius: 4px;
	/* Route's pins and name tags sit at z-index 1000+: keep them inside the frame so the cards (z 4) paint above. */
	isolation: isolate;
}

/* Loading: a calm shimmer over the paper box and a leaf-deep spinner, until the first full
   frame (is-live); a light veil and the spinner while a card's map comes (is-switching). */
.iu-explore__shimmer,
.iu-explore__veil {
	position: absolute;
	inset: 0;
	z-index: 2;
	pointer-events: none;
}

.iu-explore__shimmer {
	background: linear-gradient(100deg, rgba(255, 255, 255, 0) 30%, rgba(255, 255, 255, 0.6) 50%, rgba(255, 255, 255, 0) 70%) var(--wp--preset--color--ivory, #f8f5ee);
	background-size: 220% 100%;
	animation: iu-explore-shimmer 1.6s ease-in-out infinite;
	transition: opacity 400ms ease;
}

.iu-explore__frame.is-live .iu-explore__shimmer,
.iu-explore__frame.is-failed .iu-explore__shimmer {
	opacity: 0;
	animation: none;
}

.iu-explore__veil {
	background: rgba(248, 245, 238, 0.55);
	opacity: 0;
	transition: opacity 200ms ease;
}

.iu-explore__frame.is-switching .iu-explore__veil {
	opacity: 1;
}

.iu-explore__frame .iurban-map__spin {
	z-index: 3;
	top: calc((100% - var(--iu-explore-strip, 0px)) / 2);
	border-color: rgba(79, 111, 80, 0.22);
	border-top-color: var(--iu-explore-leaf);
}

.iurban-map__frame.iu-explore__frame.is-live.is-switching .iurban-map__spin {
	display: block;
}

.iu-explore__frame .iurban-map__fail {
	z-index: 3;
	bottom: var(--iu-explore-strip, 0px);
}

@keyframes iu-explore-shimmer {
	from {
		background-position: 110% 0;
	}

	to {
		background-position: -110% 0;
	}
}

/* Full screen fills the screen (the cards stay on the page, not over it). */
.iurban-map__frame.iu-explore__frame:fullscreen {
	height: 100%;
	min-height: 0;
	border-radius: 0;
}

.iurban-map__frame.iu-explore__frame:-webkit-full-screen {
	height: 100%;
	min-height: 0;
	border-radius: 0;
}

/* Same spacing ladder as .iu-home-update: 48 / 64 / 80 px above (A3). */
.iu-home > .iu-explore {
	margin-top: 48px;
}

@media (min-width: 768px) {
	.iu-home > .iu-explore {
		margin-top: 64px;
	}
}

@media (min-width: 1024px) {
	.iu-home > .iu-explore {
		margin-top: 80px;
	}
}

/* The map credit stays above the cards. */
.iu-explore__frame .maplibregl-ctrl-bottom-right,
.iu-explore__frame .maplibregl-ctrl-bottom-left {
	bottom: var(--iu-explore-strip, 0px);
}

/* Cards over the map bottom: desktop 5 equal columns. */
.iu-explore__cards {
	position: absolute;
	right: 20px;
	bottom: 20px;
	left: 20px;
	z-index: 4;
	display: grid;
	grid-template-columns: repeat(5, minmax(0, 1fr));
	gap: 14px;
	margin: 0;
	padding: 0;
	list-style: none;
	pointer-events: none;
}

.iu-explore__card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	margin: 0;
	border-radius: 8px;
	background: #fff;
	box-shadow: 0 1px 3px rgba(28, 35, 48, 0.1);
	color: var(--iu-explore-ink);
	pointer-events: auto;
	transform-origin: 50% 100%;
	transition: transform 420ms cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 200ms ease;
}

/* A tap on the map's main pin (plans/pin-focus.md A5): two soft rings, about 1.2 s; reduced motion: a still outline for the same time. */
.iu-explore__card.is-pulse::after {
	content: '';
	position: absolute;
	inset: 0;
	border-radius: 8px;
	pointer-events: none;
	animation: iu-explore-pulse 600ms ease-out 2;
}

@keyframes iu-explore-pulse {
	from {
		box-shadow: 0 0 0 0 rgba(79, 111, 80, 0.55);
	}

	to {
		box-shadow: 0 0 0 16px rgba(79, 111, 80, 0);
	}
}

@media (prefers-reduced-motion: reduce) {
	.iu-explore__card.is-pulse::after {
		animation: none;
		box-shadow: 0 0 0 3px var(--iu-explore-leaf);
	}
}

.iu-explore__card.is-active {
	z-index: 1;
	box-shadow: 0 8px 24px rgba(28, 35, 48, 0.16);
	transform: scale(1.05);
}

/* Selects only: type, number, project name. */
.iu-explore__pick {
	display: grid;
	gap: 4px;
	width: 100%;
	margin: 0;
	padding: 12px 12px 2px;
	border: 0;
	border-radius: 8px 8px 0 0;
	background: none;
	color: inherit;
	font: inherit;
	text-align: left;
	cursor: pointer;
}

.iu-explore__pick:focus-visible,
.iu-explore__title:focus-visible,
.iu-explore__go:focus-visible {
	outline: 2px solid var(--iu-explore-leaf);
	outline-offset: 2px;
}

.iu-explore__meta {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 8px;
	min-height: 18px;
	color: var(--iu-explore-soft);
	font-size: 11px;
	font-weight: 600;
	line-height: 1.4;
}

.iu-explore__type {
	overflow: hidden;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.iu-explore__icon {
	display: block;
	width: 18px;
	height: 18px;
}

.iu-explore__num {
	flex: none;
	font-variant-numeric: tabular-nums;
}

/* "/ 03" is decoration: fainter than the card's own number. */
.iu-explore__of {
	opacity: .55;
}

.iu-explore__project {
	overflow: hidden;
	font-size: 15px;
	font-weight: 700;
	line-height: 1.35;
	white-space: nowrap;
	text-overflow: ellipsis;
}

.iu-explore__project:empty {
	display: none;
}

/* Opens the post: the title (2 lines then …) and ↗, each 44 px+ tall. */
.iu-explore__title {
	display: block;
	box-sizing: border-box;
	min-height: 44px;
	padding: 4px 52px 12px 12px;
	color: inherit;
	font-size: 13px;
	line-height: 1.45;
	text-decoration: none;
}

.iu-explore__title span {
	display: -webkit-box;
	overflow: hidden;
	overflow-wrap: anywhere;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
}

.iu-explore__title:hover,
.iu-explore__title:focus-visible,
.iu-explore__card.is-active .iu-explore__title {
	color: var(--iu-explore-leaf);
}

.iu-explore__go {
	position: absolute;
	right: 4px;
	bottom: 4px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	color: var(--iu-explore-ink);
	text-decoration: none;
}

.iu-explore__go span {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 30px;
	height: 30px;
	border: 1px solid rgba(28, 35, 48, 0.18);
	border-radius: 50%;
	transition: background-color 150ms, border-color 150ms, color 150ms;
}

/* The arrow (owner 2026-11-09): short, thick, round ends; its box is centred on the circle's centre. */
.iu-explore__go svg {
	display: block;
	width: 18px;
	height: 18px;
	fill: none;
	stroke: currentColor;
	stroke-width: 2.4;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.iu-explore__go:hover span {
	border-color: var(--iu-explore-leaf);
	color: var(--iu-explore-leaf);
}

.iu-explore__card.is-active .iu-explore__go span {
	border-color: var(--iu-explore-leaf);
	background: var(--iu-explore-leaf);
	color: #fff;
}

/* Phones and tablets: full width, a swipe row; the next card peeks. A swipe scrolls the row
   (the cards are not inside the map, so it never pans it); only a tap selects. */
@media (max-width: 1023px) {
	.iu-explore.alignwide {
		margin-right: calc(-1 * var(--wp--style--root--padding-right, 16px)) !important;
		margin-left: calc(-1 * var(--wp--style--root--padding-left, 16px)) !important;
	}

	.iu-explore__tag {
		margin-left: var(--wp--style--root--padding-left, 16px);
	}

	.iurban-map__frame.iu-explore__frame {
		height: min(70vh, 560px);
		height: min(70svh, 560px);
		min-height: 380px;
		border-radius: 0;
	}

	.iu-explore__cards {
		right: 0;
		bottom: 8px;
		left: 0;
		display: flex;
		overflow-x: auto;
		padding: 10px 16px 6px;
		scroll-padding-inline: 16px;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
		overscroll-behavior-x: contain;
		pointer-events: auto;
	}

	.iu-explore__cards::-webkit-scrollbar {
		display: none;
	}

	.iu-explore__card {
		flex: 0 0 min(78%, 300px);
		scroll-snap-align: start;
	}
}

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

	.iu-explore__card {
		transition: none;
	}

	.iu-explore__card.is-active {
		transform: none;
	}
}
