/* ------------------------------------------------ amenity location map */
/* template-parts/tien-ich-map.php (Tiện ích page only): the site render with
   numbered hotspots, the location sheet's legend beside it. Loaded after
   theme.css, uses its tokens. */

.tim-section { background: var(--moss-deep); }
.tim__head { margin-bottom: clamp(1.25rem, 2.5vw, 2rem); max-width: 56rem; }
.tim__title { font-family: var(--font-display); font-size: clamp(1.5rem, 2.6vw, 2.2rem); color: var(--bone); margin-top: 0.35rem; }
.tim__lead { color: var(--bone-dim); margin-top: 0.6rem; }
.tim__grid { display: grid; gap: clamp(1.25rem, 3vw, 2.5rem); }
.tim__stage, .tim__side { min-width: 0; }

/* status line above the picture */
.tim__status {
	min-height: 1.5em;
	margin-bottom: 0.6rem;
	color: var(--bone-dim);
	font-size: 0.92rem;
}
.tim__status strong { color: var(--bone); font-weight: 600; }

/* the picture; on a phone it keeps a readable width and scrolls sideways */
.tim__scroll {
	overflow-x: auto;
	overscroll-behavior-x: contain;
	border-radius: var(--r-md);
	border: 1px solid var(--moss-lift);
	scrollbar-width: thin;
}
.tim__map {
	position: relative;
	width: max(100%, 620px);
	margin: 0;
}
.tim__img { display: block; width: 100%; height: auto; }
.tim__scroll-hint { color: var(--bone-mute); font-size: 0.82rem; margin-top: 0.45rem; }
@media (min-width: 660px) { .tim__scroll-hint { display: none; } }

/* hotspots */
.tim__pin {
	--pin: 22px;
	position: absolute;
	width: var(--pin);
	height: var(--pin);
	margin: calc(var(--pin) / -2) 0 0 calc(var(--pin) / -2);
	padding: 0;
	display: grid;
	place-items: center;
	border: 2px solid #fff;
	border-radius: 50%;
	font-family: var(--font-ui);
	font-weight: 700;
	font-size: 0.68rem;
	line-height: 1;
	cursor: pointer;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
	transition: transform 0.18s var(--ease), opacity 0.18s ease, box-shadow 0.18s ease;
	z-index: 1;
}
.tim__pin--a { background: var(--gold); color: var(--ink); }
.tim__pin--b { background: var(--ink); color: var(--bone); }
.tim__pin--c { background: #B5432F; color: #fff; }
.tim__pin--base { border-style: dashed; border-color: #fff; outline: 2px dashed var(--ink); outline-offset: 1px; }
.tim__pin:hover,
.tim__pin:focus-visible { transform: scale(1.25); z-index: 3; outline-color: var(--gold-lift); }
.tim__pin:focus-visible { box-shadow: 0 0 0 3px var(--gold-lift); }

.tim.is-picking .tim__pin { opacity: 0.22; }
.tim.is-picking .tim__pin.is-on {
	opacity: 1;
	transform: scale(1.3);
	z-index: 2;
	box-shadow: 0 0 0 4px rgba(228, 198, 126, 0.85), 0 2px 8px rgba(0, 0, 0, 0.45);
	animation: tim-pulse 1.6s ease-out infinite;
}
.tim.is-picking .tim__pin.is-on:hover { transform: scale(1.45); }
@keyframes tim-pulse {
	0%   { box-shadow: 0 0 0 0 rgba(228, 198, 126, 0.95), 0 2px 8px rgba(0, 0, 0, 0.45); }
	70%  { box-shadow: 0 0 0 12px rgba(228, 198, 126, 0), 0 2px 8px rgba(0, 0, 0, 0.45); }
	100% { box-shadow: 0 0 0 0 rgba(228, 198, 126, 0), 0 2px 8px rgba(0, 0, 0, 0.45); }
}
@media (prefers-reduced-motion: reduce) {
	.tim.is-picking .tim__pin.is-on { animation: none; }
}

/* tooltip */
.tim__tip {
	position: absolute;
	z-index: 4;
	max-width: 240px;
	padding: 0.4rem 0.6rem;
	border-radius: var(--r-sm);
	background: rgba(12, 62, 47, 0.95);
	color: var(--bone);
	font-family: var(--font-ui);
	font-size: 0.8rem;
	line-height: 1.35;
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
	pointer-events: none;
	transform: translate(-50%, calc(-100% - 18px));
	white-space: normal;
}
.tim__tip[hidden] { display: none; }
.tim__tip.is-below { transform: translate(-50%, 18px); }
.tim__tip small { display: block; color: var(--gold-lift); font-size: 0.72rem; margin-top: 0.1rem; }

/* compass: --north = degrees clockwise from the top of the picture */
.tim__compass {
	position: absolute;
	top: 0.6rem;
	right: 0.6rem;
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.92) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='-24 -24 48 48'%3E%3Ccircle r='16' fill='none' stroke='%23777' stroke-width='1.5'/%3E%3Cpath d='M0-15 6 7 0 2-6 7z' fill='%23A2271B'/%3E%3Ctext y='-17' text-anchor='middle' font-family='Arial' font-weight='700' font-size='9' fill='%23A2271B'%3EB%3C/text%3E%3C/svg%3E") center / 100% no-repeat;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.25);
	transform: rotate(var(--north, 0deg));
	pointer-events: none;
	z-index: 2;
}

/* colour keys under the picture */
.tim__keys {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem 1.1rem;
	margin: 0.8rem 0 0;
	padding: 0;
	list-style: none;
	color: var(--bone-dim);
	font-size: 0.85rem;
}
.tim__keys li { display: inline-flex; align-items: center; gap: 0.45rem; }
.tim__key { width: 14px; height: 14px; border-radius: 50%; border: 2px solid #fff; flex: none; }
.tim__key--a { background: var(--gold); }
.tim__key--b { background: var(--ink); }
.tim__key--c { background: #B5432F; }
.tim__key--base { background: transparent; border-style: dashed; }

/* legend list */
.tim__all {
	padding: 0.45rem 0.95rem;
	border: 1px solid var(--moss-lift);
	border-radius: 999px;
	background: transparent;
	color: var(--bone-mute);
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 0.85rem;
	cursor: pointer;
}
.tim__all:hover { color: var(--bone); border-color: var(--bone-mute); }
.tim__all[aria-pressed="true"] { background: var(--gold); border-color: var(--gold); color: var(--ink); }
.tim__group { margin-top: 1.25rem; }
.tim__group-title {
	display: flex;
	align-items: baseline;
	gap: 0.55rem;
	font-family: var(--font-ui);
	font-weight: 600;
	font-size: 0.95rem;
	line-height: 1.35;
	color: var(--bone);
}
.tim__group-key { color: var(--gold-lift); font-weight: 700; }
.tim__sub {
	margin: 0.75rem 0 0.35rem;
	color: var(--gold-lift);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
}
.tim__list { margin: 0; padding: 0; list-style: none; display: grid; gap: 0.2rem; }
.tim__item {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	padding: 0.4rem 0.55rem;
	border: 1px solid transparent;
	border-radius: var(--r-sm);
	background: transparent;
	color: var(--bone-dim);
	font-family: var(--font-ui);
	font-size: 0.92rem;
	text-align: left;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.tim__item:hover,
.tim__item:focus-visible { background: rgba(12, 62, 47, 0.45); color: var(--bone); outline: none; border-color: var(--moss-lift); }
.tim__item[aria-pressed="true"] { background: rgba(201, 162, 74, 0.16); border-color: var(--gold); color: var(--bone); }
.tim__num {
	flex: none;
	display: grid;
	place-items: center;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	border: 2px solid #fff;
	font-weight: 700;
	font-size: 0.68rem;
	line-height: 1;
}
.tim__num--a { background: var(--gold); color: var(--ink); }
.tim__num--b { background: var(--ink); color: var(--bone); }
.tim__num--c { background: #B5432F; color: #fff; }
.tim__name { flex: 1; min-width: 0; line-height: 1.35; }
.tim__code { display: block; color: var(--bone-mute); font-size: 0.75rem; }
.tim__count {
	flex: none;
	min-width: 1.6rem;
	padding: 0.1rem 0.4rem;
	border-radius: 999px;
	background: rgba(12, 62, 47, 0.6);
	color: var(--bone-dim);
	font-size: 0.75rem;
	text-align: center;
}
.tim__note { margin-top: clamp(1.25rem, 2.5vw, 2rem); color: var(--bone-mute); font-size: 0.85rem; max-width: 60rem; }

@media (min-width: 1024px) {
	/* whole picture in view: its width follows the window height (1400 x 1763) */
	.tim__grid {
		--tim-w: max(480px, calc((100vh - var(--header-h) - 7.5rem) * 0.794));
		grid-template-columns: minmax(0, var(--tim-w)) minmax(320px, 1fr);
		align-items: start;
	}
	.tim__stage { position: sticky; top: calc(var(--header-h) + 1rem); }
	.tim__scroll { overflow: visible; }
	.tim__map { width: 100%; }
	.tim__side { max-height: calc(100vh - var(--header-h) - 2rem); overflow-y: auto; padding-right: 0.4rem; scrollbar-width: thin; }
}
