/**
 * SKI NY Resort Map
 * Brand values taken from the live SKI NY theme.
 */

/* Values below are read from the live SKI NY theme, not assumed:
   headings Museo-Slab 500 #1C3664, body Roboto 500, buttons Roboto 800
   uppercase white on #223764 with a 40px pill radius, accent green #9CCB3B. */
.skiny-map,
.skiny-index {
	--skiny-navy: #1c3664;
	--skiny-button: #223764;
	--skiny-green: #9ccb3b;
	--skiny-lime: #e7fa78;
	--skiny-ink: #1d2430;
	--skiny-muted: #5b6676;
	--skiny-rule: #dfe4ea;
	--skiny-map-height: 520px;
	--skiny-slab: "Museo-Slab", "Roboto Slab", Georgia, serif;
	--skiny-sans: "Roboto", -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
}

/* The theme styles type on its own Elementor widget classes rather than on
   body, so shortcode output does not inherit it. Set it explicitly. */
.skiny-map,
.skiny-index,
.skiny-map__info {
	font-family: var(--skiny-sans);
}

/* ---------- Map ---------- */

.skiny-map {
	position: relative;
	margin: 0 0 1.75rem;
}

.skiny-map__canvas {
	width: 100%;
	height: var(--skiny-map-height);
	min-height: 320px;
	background: #eef1f4;
	border-radius: 6px;
	overflow: hidden;
}

.skiny-map.is-loading .skiny-map__canvas::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(100deg, #eef1f4 30%, #f6f8fa 50%, #eef1f4 70%);
	background-size: 200% 100%;
	animation: skiny-map-shimmer 1.4s linear infinite;
	border-radius: 6px;
}

@keyframes skiny-map-shimmer {
	0% { background-position: 150% 0; }
	100% { background-position: -50% 0; }
}

@media (prefers-reduced-motion: reduce) {
	.skiny-map.is-loading .skiny-map__canvas::after {
		animation: none;
	}
}

.skiny-map__legend {
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	margin-top: 0.6rem;
	font-family: var(--skiny-sans);
	font-size: 0.85rem;
	font-weight: 500;
	color: var(--skiny-muted);
}

.skiny-map__legend-item {
	display: inline-flex;
	align-items: center;
	gap: 0.35rem;
}

.skiny-map__fallback {
	padding: 1.25rem;
	background: #f6f8fa;
	border: 1px solid var(--skiny-rule);
	border-radius: 6px;
	color: var(--skiny-muted);
	margin: 0 0 1rem;
}

.skiny-map__admin-hint {
	padding: 0.6rem 0.9rem;
	background: #fff8e1;
	border-left: 3px solid #c89b1b;
	color: #6b5310;
	font-size: 0.9rem;
	margin: 0 0 1rem;
}

/* ---------- Info window ---------- */

.skiny-map__info {
	min-width: 180px;
	max-width: 240px;
	padding: 2px 2px 4px;
	line-height: 1.4;
}

.skiny-map__info-name {
	margin: 0 0 0.15rem;
	font-family: var(--skiny-slab);
	font-size: 1.05rem;
	font-weight: 500;
	color: var(--skiny-navy);
}

.skiny-map__info-town {
	margin: 0 0 0.15rem;
	font-size: 0.85rem;
	color: var(--skiny-ink);
}

.skiny-map__info-meta {
	margin: 0 0 0.5rem;
	font-size: 0.78rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	color: var(--skiny-muted);
}

/* Matches the theme's own buttons: Roboto 800, uppercase, white on navy,
   40px pill radius. */
.skiny-map__info-link {
	display: inline-block;
	padding: 0.55rem 1.3rem;
	background: var(--skiny-button);
	color: #fff;
	font-family: var(--skiny-sans);
	font-weight: 800;
	font-size: 0.8rem;
	text-transform: uppercase;
	text-decoration: none;
	border-radius: 40px;
}

.skiny-map__info-link:hover,
.skiny-map__info-link:focus {
	background: var(--skiny-navy);
	color: #fff;
	text-decoration: none;
}

/* ---------- Regional index ---------- */

.skiny-index {
	margin: 0 0 1.5rem;
}

.skiny-index__grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
	gap: 1.5rem 2rem;
}

/* ---------- Filter bar ---------- */

.skiny-index__bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 0.75rem 1rem;
	min-height: 2rem;
	margin: 0 0 1rem;
}

.skiny-index__status {
	margin: 0;
	font-family: var(--skiny-sans);
	font-size: 0.9rem;
	font-weight: 500;
	color: var(--skiny-muted);
}

/* Themes commonly force a display value on buttons, which beats the browser's
   own [hidden] rule. Restate it so the reset really does hide. */
.skiny-index__reset[hidden],
.skiny-index__chip[hidden],
.skiny-index__list[hidden],
.skiny-index__item[hidden],
.skiny-index__region[hidden] {
	display: none !important;
}

/* Passport Program chip, a filter that cuts across the regions. */
.skiny-index__chip {
	appearance: none;
	display: inline-flex;
	align-items: center;
	gap: 0.4rem;
	min-height: 44px;
	padding: 0.5rem 1.15rem;
	border: 1px solid var(--skiny-navy);
	border-radius: 40px;
	background: #fff;
	cursor: pointer;
	font-family: var(--skiny-sans);
	font-size: 0.75rem;
	font-weight: 800;
	text-transform: uppercase;
	color: var(--skiny-navy);
}

.skiny-index__chip:hover,
.skiny-index__chip:focus-visible {
	background: var(--skiny-navy);
	color: #fff;
}

.skiny-index__chip.is-active {
	background: var(--skiny-navy);
	color: #fff;
}

.skiny-index__chip.is-active .skiny-index__count {
	background: var(--skiny-green);
	color: #22310c;
	padding: 0.05rem 0.45rem;
	border-radius: 20px;
}

/* A green dot marks a Passport Program area. Weight and color are the same
   for every area, so the dot is the only signal. */
.skiny-index__dot {
	display: inline-block;
	width: 0.5rem;
	height: 0.5rem;
	margin-right: 0.4rem;
	border-radius: 50%;
	background: var(--skiny-green);
	box-shadow: 0 0 0 1px rgba(28, 54, 100, 0.2);
	vertical-align: 0.06em;
}

/* The dot carries no meaning for assistive tech, so pair it with hidden text. */
.skiny-index__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.skiny-index__key {
	margin: 0 0 0.9rem;
	font-family: var(--skiny-sans);
	font-size: 0.82rem;
	color: var(--skiny-muted);
}

.skiny-index__key .skiny-index__dot {
	margin-right: 0.3rem;
}

.skiny-index__reset {
	appearance: none;
	border: 1px solid var(--skiny-rule);
	background: #fff;
	cursor: pointer;
	/* Kept at a 44px tap target for phones. */
	min-height: 44px;
	padding: 0.5rem 1.15rem;
	border-radius: 40px;
	font-family: var(--skiny-sans);
	font-size: 0.75rem;
	font-weight: 800;
	text-transform: uppercase;
	color: var(--skiny-navy);
}

.skiny-index__reset:hover,
.skiny-index__reset:focus-visible {
	background: var(--skiny-navy);
	border-color: var(--skiny-navy);
	color: #fff;
}

/* ---------- Region heading, which is also the filter control ---------- */

.skiny-index__filter {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	cursor: pointer;
	text-align: left;
	font: inherit;
	color: inherit;
}

.skiny-index__filter:hover .skiny-index__label,
.skiny-index__filter:focus-visible .skiny-index__label {
	text-decoration: underline;
	text-underline-offset: 3px;
}

.skiny-index__filter:focus-visible {
	outline: 2px solid var(--skiny-navy);
	outline-offset: 3px;
	border-radius: 2px;
}

/* The active region keeps a filled rule so it reads as selected. */
.skiny-index__region:has(.skiny-index__filter.is-active) .skiny-index__heading {
	border-bottom-width: 4px;
}

.skiny-index__filter.is-active .skiny-index__count {
	background: var(--skiny-green);
	color: #22310c;
	padding: 0.05rem 0.4rem;
	border-radius: 20px;
}

/* A region that is filtered out keeps its heading so it stays one tap away. */
.skiny-index__region.is-collapsed .skiny-index__heading {
	border-bottom-color: var(--skiny-rule);
	opacity: 0.72;
}

/* Accordion mode, phones. Every region is collapsed until tapped, so the
   headings need to read as controls rather than as dimmed leftovers. */
.skiny-index.is-accordion .skiny-index__region.is-collapsed .skiny-index__heading {
	opacity: 1;
}

.skiny-index.is-accordion .skiny-index__filter::after {
	content: "";
	margin-left: auto;
	width: 0.6rem;
	height: 0.6rem;
	border-right: 2px solid var(--skiny-navy);
	border-bottom: 2px solid var(--skiny-navy);
	transform: rotate(45deg) translate(-0.15rem, -0.15rem);
	transition: transform 0.15s ease;
	flex: none;
}

.skiny-index.is-accordion .skiny-index__filter.is-active::after {
	transform: rotate(-135deg) translate(-0.1rem, -0.1rem);
}

@media (prefers-reduced-motion: reduce) {
	.skiny-index.is-accordion .skiny-index__filter::after {
		transition: none;
	}
}

.skiny-index__region.is-collapsed .skiny-index__filter:hover,
.skiny-index__region.is-collapsed .skiny-index__filter:focus-visible {
	opacity: 1;
}

/* With a single region expanded, the collapsed ones tuck into a compact
   stack rather than leaving five tall empty columns. Filters that leave
   several regions open, such as the Passport Program, keep the grid. */
.skiny-index.is-single .skiny-index__grid {
	grid-template-columns: 1fr;
	gap: 0.4rem;
}

.skiny-index.is-single .skiny-index__region:not(.is-collapsed) {
	margin-bottom: 0.75rem;
}

.skiny-index__heading {
	display: flex;
	align-items: baseline;
	gap: 0.5rem;
	margin: 0 0 0.5rem;
	padding-bottom: 0.35rem;
	border-bottom: 2px solid var(--skiny-green);
	font-family: var(--skiny-slab);
	font-size: 1.35rem;
	font-weight: 500;
	color: var(--skiny-navy);
}

.skiny-index__count {
	font-size: 0.75rem;
	font-weight: 600;
	color: var(--skiny-muted);
}

.skiny-index__list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.skiny-index__item {
	margin: 0;
	padding: 0.32rem 0;
	border-bottom: 1px solid var(--skiny-rule);
	font-family: var(--skiny-sans);
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.45;
}

.skiny-index__item:last-child {
	border-bottom: 0;
}

.skiny-index__item a {
	color: var(--skiny-navy);
	text-decoration: none;
}

.skiny-index__item a:hover,
.skiny-index__item a:focus {
	color: var(--skiny-navy);
	text-decoration: underline;
}

/* A fixed gutter the Passport dot sits in, so all 41 names share one left edge
   and wrapped names stay aligned. 0.9rem = dot width plus its margin. */
.skiny-index__item > a {
	display: inline-block;
	padding-left: 0.9rem;
}

.skiny-index__item.is-passport > a {
	text-indent: -0.9rem;
}

.skiny-index__tag {
	display: inline-block;
	font-family: var(--skiny-sans);
	margin-left: 0.35rem;
	padding: 0.05rem 0.4rem;
	background: var(--skiny-lime);
	color: #3f4a16;
	border-radius: 2px;
	font-size: 0.68rem;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	vertical-align: middle;
}

/* Affiliated areas sit apart from the five New York regions. */
.skiny-index__region--affiliated .skiny-index__heading {
	border-bottom-color: var(--skiny-muted);
}

@media (max-width: 600px) {
	.skiny-map {
		--skiny-map-height: 360px;
	}

	.skiny-index__grid {
		grid-template-columns: 1fr;
		gap: 1.1rem;
	}

	/* Comfortable thumb targets throughout. */
	.skiny-index__filter {
		min-height: 44px;
		align-items: center;
	}

	.skiny-index__item {
		padding: 0.6rem 0;
	}

	.skiny-index__item a {
		display: inline-block;
		padding: 0.1rem 0;
	}

	.skiny-index__bar {
		gap: 0.5rem 0.75rem;
	}

	.skiny-map__info {
		min-width: 150px;
		max-width: 200px;
	}
}
