/*
 * Surroundings: the Slavnik feature card, the paths and landmark grids, the
 * west-to-east corridor and the long-distance trail list.
 */

/* --- Slavnik feature ---------------------------------------------------- */

.peak-card {
	display: grid;
	grid-template-columns: 1fr;
	overflow: hidden;
	border: 1px solid rgba(196, 163, 90, 0.15);
	border-radius: 2.5rem;
	background: rgba(15, 26, 19, 0.8);
}

.peak-card__media {
	position: relative;
	width: 100%;
	aspect-ratio: 4 / 3;
	min-height: 20rem;
	background: var(--wp--preset--color--brand-bark);
}

.peak-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	transition: transform 8s;
}

.peak-card__media:hover .peak-card__image {
	transform: scale(1.05);
}

.peak-card__wash {
	position: absolute;
	inset: 0;
	background: linear-gradient(to top, rgba(15, 26, 19, 0.6), transparent 60%);
}

.peak-card__stamp {
	position: absolute;
	top: 2rem;
	left: 2rem;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	color: #fff;
}

.peak-card__altitude {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 3rem;
	font-weight: 900;
	line-height: 1;
	text-shadow: 0 10px 15px rgba(0, 0, 0, 0.3);
}

.peak-card__nickname {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	font-weight: 900;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-gold);
}

.peak-card__body {
	display: flex;
	flex-direction: column;
	gap: 2rem;
	padding: 2rem;
}

.peak-card__text {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.875rem;
	line-height: 1.7;
	color: rgba(245, 240, 232, 0.8);
}

.peak-card__text + .peak-card__text {
	font-family: var(--wp--preset--font-family--serif);
	color: rgba(245, 240, 232, 0.7);
}

.peak-stats {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 1.5rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(196, 163, 90, 0.2);
	text-align: center;
}

.peak-stats__value {
	display: block;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
	font-weight: 900;
	color: var(--wp--preset--color--brand-gold);
}

.peak-stats__label {
	display: block;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.5625rem;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: rgba(245, 240, 232, 0.5);
}

@media (min-width: 768px) {
	.peak-card__media {
		aspect-ratio: 1 / 1;
	}

	.peak-card__altitude {
		font-size: 3.75rem;
	}
}

@media (min-width: 1024px) {
	.peak-card {
		grid-template-columns: repeat(2, 1fr);
		align-items: center;
		border-radius: 3.75rem;
	}

	.peak-card__body {
		padding: 4rem;
	}
}

/* --- Paths -------------------------------------------------------------- */

.path-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
}

.path-card {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 1.5rem;
	padding: 2.5rem;
	border: 1px solid rgba(196, 163, 90, 0.15);
	border-radius: 2.5rem;
	background: var(--wp--preset--color--brand-cream);
	box-shadow: var(--luxury-shadow);
	transition: transform 0.5s var(--ease-luxury), background-color 0.5s, border-color 0.5s;
}

.path-card:hover {
	transform: scale(1.02);
	background: #fff;
	border-color: rgba(196, 163, 90, 0.35);
}

.path-card__mark {
	display: block;
	margin-bottom: 1rem;
	font-size: 2.25rem;
	line-height: 1;
}

.path-card__dist {
	display: block;
	margin-bottom: 1rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.5rem;
	font-weight: 700;
	letter-spacing: 0.25em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-gold);
}

.path-card__title {
	margin-bottom: 1rem;
	font-size: 1.25rem;
	font-weight: 700;
}

.path-card__body {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	line-height: 1.7;
	color: var(--wp--preset--color--brand-stone);
}

.path-card__stats {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	padding-top: 1.5rem;
	border-top: 1px solid rgba(196, 163, 90, 0.1);
	list-style: none;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	font-weight: 700;
	color: var(--wp--preset--color--brand-stone);
}

/*
 * Five paths into rows of two and three, with the short last row centred.
 *
 * Two cards hard against the left edge under a full row read as a grid that
 * ran out rather than one that ends. Centring needs a half-column of offset,
 * which a three-track grid cannot express, so the tracks are halved and each
 * card spans two of them — same card width, same gap, same everything the eye
 * can measure.
 *
 * The offset rule is a quantity query and applies to nothing else: it fires
 * only for a card that both starts a row and has exactly one sibling left
 * after it. Add a sixth path and the last row fills, the selector stops
 * matching, and the grid goes back to being a plain grid.
 */
@media (min-width: 768px) and (max-width: 1023px) {
	.path-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}

	.path-card {
		grid-column: span 2;
	}

	/* A last row holding one of two columns. */
	.path-card:nth-child(2n+1):last-child {
		grid-column: 2 / span 2;
	}
}

@media (min-width: 1024px) {
	.path-grid {
		grid-template-columns: repeat(6, minmax(0, 1fr));
	}

	.path-card {
		grid-column: span 2;
	}

	/* A last row holding two of three columns. */
	.path-card:nth-child(3n+1):nth-last-child(2) {
		grid-column: 2 / span 2;
	}
}

/* --- Landmarks ---------------------------------------------------------- */

.surroundings-culture__head {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	margin-bottom: 4rem;
	text-align: center;
}

.landmark-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	margin-bottom: 4rem;
}

.landmark-card {
	display: flex;
	flex-direction: column;
	gap: 1rem;
	padding: 2rem;
	border: 1px solid rgba(196, 163, 90, 0.1);
	border-radius: 2.5rem;
	background: #fff;
	box-shadow: var(--luxury-shadow);
	transition: transform 0.5s var(--ease-luxury), border-color 0.5s;
}

.landmark-card:hover {
	transform: scale(1.02);
	border-color: rgba(196, 163, 90, 0.3);
}

.landmark-card__top {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
}

.landmark-card__mark {
	font-size: 1.875rem;
	line-height: 1;
}

.landmark-card__dist {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.5rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-gold);
}

.landmark-card__title {
	font-size: 1.25rem;
	font-weight: 700;
}

.landmark-card__body {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	line-height: 1.7;
	color: var(--wp--preset--color--brand-stone);
}

@media (min-width: 768px) {
	.landmark-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/*
 * The same treatment, and the same halved tracks, for the landmarks.
 *
 * Eight cards land as two wide, then four, then two — and that last pair sat
 * under the left half of a full row of four. Trst and Škocjanske jame keep
 * their double width; every other card spans two of the eight tracks, which is
 * one of the four columns this grid has always had.
 *
 * The guard is narrower than it looks. `nth-child(4n+3)` is where a row starts
 * once the two wide cards have taken a whole row between them, and
 * `nth-last-child(2)` is the pair at the end; both must hold, and the card must
 * not itself be wide. Any other number of landmarks — or a third wide one —
 * fails the test and gets the ordinary grid rather than a wrong offset.
 */
@media (min-width: 1024px) {
	.landmark-grid {
		grid-template-columns: repeat(8, minmax(0, 1fr));
	}

	.landmark-card {
		grid-column: span 2;
	}

	.landmark-card.is-wide {
		grid-column: span 4;
	}

	/* A last row holding two of four columns. */
	.landmark-card:not(.is-wide):nth-child(4n+3):nth-last-child(2) {
		grid-column: 3 / span 2;
	}
}

/* --- Cycling banner ----------------------------------------------------- */

.cycling-banner {
	display: grid;
	grid-template-columns: 1fr;
	gap: 2rem;
	align-items: center;
}

.cycling-banner__eyebrow {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.4em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-gold);
}

.cycling-banner__body {
	display: flex;
	flex-direction: column;
	gap: 1rem;
}

.cycling-banner__title {
	font-size: 1.5rem;
}

.cycling-banner__body p {
	max-width: 36rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.875rem;
	line-height: 1.7;
	color: rgba(245, 240, 232, 0.8);
}

.cycling-banner__value {
	display: block;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 2.25rem;
	font-weight: 900;
	color: var(--wp--preset--color--brand-gold);
}

.cycling-banner__label {
	display: block;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.5625rem;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: rgba(245, 240, 232, 0.5);
}

@media (min-width: 1024px) {
	.cycling-banner {
		grid-template-columns: 2fr 7fr 3fr;
		gap: 3rem;
	}

	.cycling-banner__eyebrow {
		padding-right: 2rem;
		border-right: 1px solid rgba(196, 163, 90, 0.2);
	}

	.cycling-banner__stat {
		padding-left: 2rem;
		border-left: 1px solid rgba(196, 163, 90, 0.2);
	}

	.cycling-banner__title {
		font-size: 1.875rem;
	}
}

/* --- Corridor ----------------------------------------------------------- */

.corridor-intro {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	max-width: 56rem;
	margin-bottom: 5rem;
}

.corridor-intro__text {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 1rem;
	line-height: 1.75;
	color: rgba(245, 240, 232, 0.8);
}

.corridor-intro__text.is-dim {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 0.875rem;
	color: rgba(245, 240, 232, 0.6);
}

.corridor {
	position: relative;
	padding-block: 3rem;
	margin-bottom: 5rem;
	border-block: 1px solid rgba(196, 163, 90, 0.25);
}

.corridor__caption {
	margin-bottom: 2rem;
	text-align: center;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.3em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-gold);
}

.corridor__ends {
	display: flex;
	justify-content: space-between;
	margin-bottom: 2rem;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-gold-dim);
}

/*
 * The twelve stops need roughly 900px to stay legible, so instead of
 * shrinking the labels the row scrolls inside its own box — the same
 * decision the source made, kept here.
 */
.corridor__viewport {
	overflow-x: auto;
	padding-bottom: 1rem;
	overscroll-behavior-x: contain;
}

/*
 * `ol.` rather than `.corridor__track`, because base.css resets `ol[class]` to
 * `padding: 0` and that beats a bare class on specificity. The 1rem of headroom
 * this rule has always asked for was therefore never applied — which is what
 * sliced the flat top off the halo around the Slavnik marker: the ring reaches
 * 7.5px above the dot, and the viewport below is a scroll container, so
 * anything above its content edge is clipped rather than overflowing.
 */
ol.corridor__track {
	position: relative;
	display: flex;
	align-items: flex-start;
	min-width: 56rem;
	padding-top: 1rem;
	margin: 0;
	list-style: none;
}

/*
 * Through the dots, not between them.
 *
 * The line sat at 1.75rem — below every dot and 2px above the labels — so it
 * read as a rule crowding the names rather than as a route joining the stops.
 * 1.4375rem is the dot's own centre (1rem of track padding plus half of the
 * 0.875rem dot), and every dot is opaque, so the line passes behind them and
 * the labels get the whole of the gap back.
 */
.corridor__track::before {
	content: "";
	position: absolute;
	top: 1.4375rem;
	left: 4%;
	right: 4%;
	height: 1px;
	background: linear-gradient(to right, transparent, rgba(196, 163, 90, 0.4), transparent);
}

.corridor__stop {
	position: relative;
	z-index: 1;
	flex: 1;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 1rem;
	text-align: center;
}

.corridor__dot {
	width: 0.875rem;
	height: 0.875rem;
	border: 1px solid var(--wp--preset--color--brand-gold);
	border-radius: 999px;
	background: var(--wp--preset--color--brand-wood-deep);
}

.corridor__stop.is-active .corridor__dot {
	background: var(--wp--preset--color--brand-gold);
	transform: scale(1.25);
	box-shadow: 0 0 0 6px rgba(196, 163, 90, 0.18);
}

.corridor__name {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	color: rgba(245, 240, 232, 0.7);
}

.corridor__stop.is-flag .corridor__name {
	font-weight: 600;
	color: var(--wp--preset--color--brand-gold);
}

.corridor__stop.is-active .corridor__name {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 0.75rem;
	font-style: italic;
	font-weight: 700;
	color: var(--wp--preset--color--brand-gold-light);
}

.corridor__fade {
	position: absolute;
	top: 3rem;
	bottom: 4rem;
	right: 0;
	width: 3rem;
	pointer-events: none;
	background: linear-gradient(to left, var(--wp--preset--color--brand-wood-deep), transparent);
}

@media (min-width: 1024px) {
	.corridor__fade {
		display: none;
	}
}

/* --- Long-distance trails ----------------------------------------------- */

.trail-list {
	display: flex;
	flex-direction: column;
	gap: 1.5rem;
	margin-bottom: 5rem;
}

.trail {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1.5rem;
	align-items: center;
	padding: 2rem;
	border: 1px solid rgba(196, 163, 90, 0.1);
	border-radius: 2rem;
	background: rgba(26, 42, 30, 0.4);
	transition: border-color 0.5s;
}

.trail:hover {
	border-color: var(--wp--preset--color--brand-gold);
}

.trail__mark {
	font-size: 2.25rem;
	line-height: 1;
	text-align: center;
}

.trail__title {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem;
	margin-bottom: 0.5rem;
	font-size: 1.25rem;
	font-weight: 700;
}

.trail__badge {
	padding: 0.25rem 0.75rem;
	border-radius: 999px;
	background: var(--wp--preset--color--brand-gold);
	color: var(--wp--preset--color--brand-wood);
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.5rem;
	font-weight: 900;
	letter-spacing: 0.1em;
	text-transform: uppercase;
}

.trail__text {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	line-height: 1.7;
	color: rgba(245, 240, 232, 0.7);
}

.trail__type {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-gold);
}

.trail__scale-value {
	display: block;
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.5rem;
	font-style: italic;
	color: var(--wp--preset--color--brand-gold-light);
}

.trail__scale-sub {
	display: block;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	color: rgba(245, 240, 232, 0.4);
}

@media (min-width: 1024px) {
	.trail {
		grid-template-columns: 1fr 7fr 2fr 2fr;
		gap: 1.5rem;
		border-radius: 2rem;
	}

	.trail__scale {
		text-align: right;
	}
}

/* --- Traveller quote ---------------------------------------------------- */

.traveller-quote {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2rem;
	max-width: 56rem;
	margin: 0 auto;
	padding: 2rem;
	border: 1px solid rgba(196, 163, 90, 0.2);
	border-radius: 1.5rem;
	background: rgba(26, 42, 30, 0.6);
	text-align: center;
}

.traveller-quote blockquote {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.125rem;
	font-style: italic;
	color: var(--wp--preset--color--brand-gold-light);
}

.traveller-quote figcaption {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	flex: none;
}

.traveller-quote strong {
	font-family: var(--wp--preset--font-family--serif);
	font-size: 1.125rem;
	font-weight: 300;
	color: var(--wp--preset--color--brand-cream);
}

.traveller-quote span {
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.625rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	color: var(--wp--preset--color--brand-gold);
}

@media (min-width: 768px) {
	.traveller-quote {
		flex-direction: row;
		justify-content: space-between;
		text-align: left;
	}

	.traveller-quote figcaption {
		padding-left: 1.5rem;
		border-left: 1px solid rgba(196, 163, 90, 0.2);
		text-align: right;
	}
}

/*
 * The Slavnik photography band.
 *
 * Sits between the peak card and the paths grid, and carries the only images
 * on this page that were shot by somebody the site has to credit. The caption
 * is a caption, not the credit — the credit is inside the frame, on the
 * photograph it belongs to (see .slider__credit).
 */
.surroundings-vista__caption {
	margin: 1.25rem 0 0;
	font-family: var(--wp--preset--font-family--sans);
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	line-height: 1.6;
	text-align: center;
	color: rgba(245, 240, 232, 0.55);
}
