/**
 * Tokyo Trip Guide — Interactive Transport Map
 * Matches the tripguide.tokyo theme tokens (cream, ink, brand red, Fraunces).
 */

.ttt-map {
	--ttt-w: #faf7f2;
	--ttt-ink: #1a1714;
	--ttt-ink3: #3e3a35;
	--ttt-r: #c1281a;
	--ttt-rd: #9e200f;
	--ttt-serif: 'Fraunces', Georgia, serif;
	--ttt-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, sans-serif;
	--ttt-sh: 0 6px 32px rgba(26, 23, 20, .14), 0 2px 8px rgba(26, 23, 20, .07);

	position: relative;
	width: 100%;
	height: var(--ttt-h, 640px);
	max-height: 86vh;
	border-radius: 14px;
	overflow: hidden;
	background: var(--ttt-w);
	box-shadow: var(--ttt-sh);
	font-family: var(--ttt-sans);
	isolation: isolate;
}

@media (max-width: 760px) {
	.ttt-map { height: min(var(--ttt-h, 640px), 78vh); border-radius: 10px; }
}

.ttt-canvas { position: absolute; inset: 0; }

.ttt-error {
	padding: 32px 24px;
	text-align: center;
	color: var(--ttt-ink3);
	font-size: 14px;
}

/* inline SVG icons */
.ttt-ic { display: inline-flex; align-items: center; flex: 0 0 auto; }
.ttt-ic svg { width: 16px; height: 16px; display: block; }
.ttt-btn .ttt-ic { margin-right: 7px; }
.ttt-btn .ttt-ic svg { width: 15px; height: 15px; }
.ttt-fs-btn .ttt-ic, .ttt-panel-close .ttt-ic { margin: 0 auto; }
.ttt-panel-close .ttt-ic svg { width: 13px; height: 13px; }

/* ── fullscreen ─────────────────────────────────────────────────────────── */
.ttt-map:fullscreen { max-height: none; border-radius: 0; }
.ttt-map.ttt-fake-fs {
	position: fixed;
	inset: 0;
	z-index: 99999;
	height: 100dvh;
	max-height: none;
	border-radius: 0;
}
.ttt-no-scroll, .ttt-no-scroll body { overflow: hidden !important; }

/* ── UI chrome ──────────────────────────────────────────────────────────── */
.ttt-ui { position: absolute; inset: 0; z-index: 2; pointer-events: none; }
.ttt-ui > * { pointer-events: auto; }

.ttt-seg {
	position: absolute;
	top: 12px;
	left: 12px;
	display: flex;
	background: rgba(255, 255, 255, .97);
	border: 1px solid rgba(26, 23, 20, .06);
	border-radius: 9999px;
	box-shadow: var(--ttt-sh);
	padding: 3px;
}
.ttt-seg-btn {
	border: 0;
	background: transparent;
	font: 700 12px/1 var(--ttt-sans);
	letter-spacing: .04em;
	color: var(--ttt-ink3);
	padding: 8px 14px;
	border-radius: 9999px;
	cursor: pointer;
	transition: background .2s, color .2s;
}
.ttt-seg-btn.is-active { background: var(--ttt-ink); color: #fff; }

.ttt-fs-btn {
	position: absolute;
	top: 12px;
	left: 106px;
	width: 38px;
	height: 38px;
	border: 1px solid rgba(26, 23, 20, .06);
	border-radius: 9999px;
	background: rgba(255, 255, 255, .97);
	box-shadow: var(--ttt-sh);
	color: var(--ttt-ink);
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform .15s;
}
.ttt-fs-btn:hover { transform: scale(1.06); }
.ttt-fs-btn .ttt-ic svg { stroke-width: 2.1; }

/* bottom action buttons */
.ttt-btn {
	position: absolute;
	bottom: 14px;
	border: 0;
	border-radius: 9999px;
	padding: 11px 18px;
	font: 700 13px/1 var(--ttt-sans);
	cursor: pointer;
	box-shadow: var(--ttt-sh);
	transition: transform .15s, background .2s;
	white-space: nowrap;
}
.ttt-btn:hover { transform: translateY(-1px); }
.ttt-btn-layers { left: 12px; background: rgba(255, 255, 255, .95); color: var(--ttt-ink); }
.ttt-btn-passes { right: 12px; background: var(--ttt-r); color: #fff; }
.ttt-btn-passes:hover { background: var(--ttt-rd); }

/* ── panels ─────────────────────────────────────────────────────────────── */
.ttt-panel {
	position: absolute;
	top: 0;
	bottom: 0;
	width: min(340px, 88%);
	background: var(--ttt-w);
	box-shadow: var(--ttt-sh);
	display: flex;
	flex-direction: column;
	transition: transform .28s cubic-bezier(.4, 0, .2, 1), visibility .28s;
	visibility: hidden;
}
.ttt-panel-layers { left: 0; transform: translateX(-102%); }
.ttt-panel-passes { right: 0; transform: translateX(102%); }
.ttt-panel.is-open { transform: translateX(0); visibility: visible; }

.ttt-panel-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 16px 18px 12px;
	border-bottom: 1px solid rgba(26, 23, 20, .08);
	flex: 0 0 auto;
}
.ttt-panel-title {
	margin: 0;
	font: 600 19px/1.2 var(--ttt-serif);
	color: var(--ttt-ink);
}
.ttt-panel-close {
	border: 0;
	background: transparent;
	font-size: 15px;
	color: var(--ttt-ink3);
	cursor: pointer;
	padding: 6px 8px;
	border-radius: 8px;
}
.ttt-panel-close:hover { background: rgba(26, 23, 20, .06); }

.ttt-panel-body { padding: 14px 18px 18px; overflow-y: auto; flex: 1 1 auto; }

.ttt-group-label {
	font: 700 10.5px/1 var(--ttt-sans);
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ttt-ink3);
	margin: 14px 0 9px;
}
.ttt-group-label:first-child { margin-top: 2px; }

.ttt-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.ttt-chip {
	display: inline-flex;
	align-items: center;
	gap: 7px;
	border: 1px solid rgba(26, 23, 20, .16);
	background: #fff;
	border-radius: 9999px;
	padding: 7px 12px;
	font: 600 12px/1 var(--ttt-sans);
	color: var(--ttt-ink3);
	cursor: pointer;
	opacity: .55;
	transition: opacity .15s, border-color .15s, box-shadow .15s;
}
.ttt-chip.is-active {
	opacity: 1;
	color: var(--ttt-ink);
	border-color: rgba(26, 23, 20, .3);
	box-shadow: 0 1px 4px rgba(26, 23, 20, .08);
}
.ttt-chip-dot {
	width: 11px;
	height: 11px;
	border-radius: 50%;
	flex: 0 0 auto;
}
.ttt-chip-dot--poi { background: var(--ttt-r); }

/* ── pass cards ─────────────────────────────────────────────────────────── */
.ttt-passes-intro { margin: 2px 0 12px; font-size: 12.5px; line-height: 1.5; color: var(--ttt-ink3); }
.ttt-pass {
	background: #fff;
	border: 1px solid rgba(26, 23, 20, .09);
	border-radius: 12px;
	padding: 13px 14px;
	margin-bottom: 10px;
}
.ttt-pass-top { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.ttt-pass-name { margin: 0; font: 600 15px/1.25 var(--ttt-serif); color: var(--ttt-ink); }
.ttt-pass-badge {
	flex: 0 0 auto;
	font: 700 9.5px/1 var(--ttt-sans);
	letter-spacing: .07em;
	text-transform: uppercase;
	color: var(--ttt-rd);
	background: #f8edeb;
	border-radius: 9999px;
	padding: 4px 8px;
}
.ttt-pass-tagline { margin: 7px 0 0; font-size: 12px; line-height: 1.5; color: var(--ttt-ink3); }
.ttt-pass-price { margin-top: 9px; font: 700 12.5px/1 var(--ttt-sans); color: var(--ttt-ink); }

/* Klook brand CTA — mirrors the theme's .attraction-booking-card.
   Doubled-up selectors keep specificity above the theme's content-link
   rules (.page-content-inner a etc.), which otherwise repaint the text. */
.ttt-map .ttt-pass a.ttt-pass-cta {
	--ttt-klook: #ff5722;
	--ttt-klook-hover: #e64a19;
	display: flex;
	align-items: center;
	gap: 10px;
	margin-top: 11px;
	padding: 9px 13px;
	background: var(--ttt-klook);
	border-radius: 8px;
	text-decoration: none;
	transition: background .2s, transform .15s, box-shadow .2s;
}
.ttt-map .ttt-pass a.ttt-pass-cta:hover {
	background: var(--ttt-klook-hover);
	transform: translateY(-1px);
	box-shadow: 0 4px 12px rgba(0, 0, 0, .15);
}
.ttt-pass-cta-icon {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ttt-pass-cta-icon img { display: block; width: 100%; height: 100%; object-fit: contain; }
.ttt-pass-cta-text { flex: 1; display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ttt-map .ttt-pass .ttt-pass-cta-label {
	font: 600 9.5px/1.2 var(--ttt-sans);
	letter-spacing: .05em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .85);
}
.ttt-map .ttt-pass .ttt-pass-cta-platform {
	font: 700 15px/1.2 var(--ttt-sans);
	color: #fff;
}
.ttt-map .ttt-pass .ttt-pass-cta-arrow { flex: 0 0 auto; color: rgba(255, 255, 255, .9); font-size: 15px; transition: transform .2s; }
.ttt-map .ttt-pass a.ttt-pass-cta:hover .ttt-pass-cta-arrow { transform: translateX(3px); }
.ttt-passes-disclosure { margin: 4px 0 0; font-size: 10.5px; color: var(--ttt-ink3); opacity: .75; }

/* ── search ─────────────────────────────────────────────────────────────── */
/* sits in the same top strip as the 2D/3D toggle and fullscreen button */
.ttt-search {
	position: absolute;
	top: 12px;
	left: 156px;
	display: flex;
	align-items: center;
	gap: 9px;
	width: min(264px, calc(100% - 156px - 64px));
	background: rgba(255, 255, 255, .97);
	border: 1px solid rgba(26, 23, 20, .08);
	border-radius: 9999px;
	box-shadow: var(--ttt-sh);
	padding: 9px 15px;
	color: var(--ttt-ink3);
	transition: border-color .2s, box-shadow .2s;
}
.ttt-search:focus-within {
	border-color: rgba(193, 40, 26, .45);
	box-shadow: 0 0 0 3px rgba(193, 40, 26, .12), var(--ttt-sh);
}
.ttt-search-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border: 0;
	padding: 0;
	background: transparent;
	color: var(--ttt-r);
	cursor: pointer;
	flex: 0 0 auto;
}
.ttt-search-toggle .ttt-ic svg { width: 15px; height: 15px; stroke-width: 2.2; }
.ttt-search-input {
	flex: 1;
	min-width: 0;
	border: 0;
	background: transparent;
	font: 600 13px/1.3 var(--ttt-sans);
	color: var(--ttt-ink);
	outline: none;
	padding: 0;
	box-shadow: none;
}
.ttt-search-input::placeholder { color: var(--ttt-ink3); opacity: .65; font-weight: 500; }
.ttt-search-input::-webkit-search-cancel-button { -webkit-appearance: none; }
.ttt-search-list {
	display: none;
	position: absolute;
	top: calc(100% + 8px);
	left: 0;
	right: 0;
	background: #fff;
	border: 1px solid rgba(26, 23, 20, .07);
	border-radius: 16px;
	box-shadow: var(--ttt-sh);
	overflow: hidden;
	max-height: 300px;
	overflow-y: auto;
	padding: 5px;
}
.ttt-search-list.is-open { display: block; }
.ttt-search-item {
	display: flex;
	align-items: center;
	gap: 11px;
	width: 100%;
	border: 0;
	border-radius: 11px;
	background: transparent;
	padding: 8px 10px;
	cursor: pointer;
	text-align: left;
	transition: background .12s;
}
.ttt-search-item:hover, .ttt-search-item:focus-visible { background: #faf7f2; outline: none; }
.ttt-search-item > .ttt-ic {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: #f8edeb;
	color: var(--ttt-r);
	justify-content: center;
}
.ttt-search-item > .ttt-ic svg { width: 15px; height: 15px; stroke-width: 2; }
.ttt-search-text { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.ttt-search-name { font: 600 12.5px/1.25 var(--ttt-sans); color: var(--ttt-ink); }
.ttt-search-sub {
	font: 500 10.5px/1.3 var(--ttt-sans);
	color: var(--ttt-ink3);
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

/* ── line-spotlight hint ────────────────────────────────────────────────── */
.ttt-hint {
	position: absolute;
	top: 12px;
	left: 50%;
	transform: translate(-50%, -46px);
	background: var(--ttt-ink);
	color: #fff;
	font: 600 11.5px/1.3 var(--ttt-sans);
	border-radius: 9999px;
	padding: 8px 15px;
	box-shadow: var(--ttt-sh);
	transition: transform .25s cubic-bezier(.4, 0, .2, 1);
	pointer-events: none;
	max-width: 84%;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}
.ttt-hint.is-visible { transform: translate(-50%, 0); }

/* ── popup actions & content links ──────────────────────────────────────── */
.ttt-popup-actions { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.ttt-map .ttt-popup a.ttt-mini {
	display: inline-flex;
	align-items: center;
	gap: 5px;
	border-radius: 9999px;
	padding: 6px 11px;
	font: 700 11px/1 var(--ttt-sans);
	text-decoration: none;
	transition: filter .15s;
}
.ttt-map .ttt-popup a.ttt-mini:hover { filter: brightness(.92); }
.ttt-mini .ttt-ic svg { width: 12px; height: 12px; }
.ttt-map .ttt-popup a.ttt-mini--guide { background: var(--ttt-ink); color: #fff; }
.ttt-map .ttt-popup a.ttt-mini--klook { background: #ff5722; color: #fff; }
.ttt-map .ttt-popup a.ttt-mini--dir {
	background: #fff;
	color: var(--ttt-ink);
	border: 1px solid rgba(26, 23, 20, .25);
}
.ttt-map .ttt-popup a.ttt-popup-hood {
	display: inline-block;
	margin-top: 9px;
	font: 700 11px/1 var(--ttt-sans);
	color: var(--ttt-r);
	text-decoration: none;
}
.ttt-map .ttt-popup a.ttt-popup-hood:hover { text-decoration: underline; }

.ttt-popup-connect-label {
	margin: 9px 0 4px;
	font: 700 9.5px/1 var(--ttt-sans);
	letter-spacing: .07em;
	text-transform: uppercase;
	color: #8a8378;
}
.ttt-popup-connect { display: flex; gap: 6px; flex-wrap: wrap; }
.ttt-map .ttt-popup a.ttt-mini--ninjawifi { background: #d81f26; color: #fff; }
.ttt-map .ttt-popup a.ttt-mini--holidaycom { background: #f15a3b; color: #fff; }

/* airport popup option rows */
.ttt-popup-airopt {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 10px;
	margin-top: 9px;
	padding-top: 9px;
	border-top: 1px solid rgba(26, 23, 20, .08);
}
.ttt-popup-airopt-label { font: 600 11.5px/1.4 var(--ttt-sans); color: var(--ttt-ink); }

/* airport markers */
.ttt-air {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background: linear-gradient(160deg, #3a6fa5, #2e5c8a);
	color: #fff;
	border: 2.5px solid #fff;
	box-shadow: 0 4px 12px rgba(26, 23, 20, .35);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	padding: 0;
	transition: transform .15s;
}
.ttt-air:hover { transform: scale(1.1); }
.ttt-air .ttt-ic svg { width: 16px; height: 16px; stroke-width: 2; }

/* ── attraction pins ────────────────────────────────────────────────────── */
.ttt-poi {
	width: 36px;
	height: 36px;
	border-radius: 50% 50% 50% 5px;
	background: linear-gradient(160deg, #d63a2b, var(--ttt-rd));
	border: 2.5px solid #fff;
	color: #fff;
	box-shadow: 0 4px 12px rgba(26, 23, 20, .35), 0 1px 3px rgba(26, 23, 20, .2);
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	transform: rotate(-45deg);
	transition: transform .15s, box-shadow .15s;
	padding: 0;
}
/* pin shape is rotated; counter-rotate the icon itself */
.ttt-poi > .ttt-ic { transform: rotate(45deg); }
.ttt-poi .ttt-ic svg { width: 16px; height: 16px; stroke-width: 2.1; }
.ttt-poi:hover {
	transform: rotate(-45deg) scale(1.12);
	box-shadow: 0 6px 18px rgba(26, 23, 20, .45), 0 2px 5px rgba(26, 23, 20, .25);
}

/* ── MapLibre native controls, reskinned to the theme ───────────────────── */
.ttt-map .maplibregl-ctrl-group {
	border-radius: 12px;
	box-shadow: var(--ttt-sh);
	background: rgba(255, 255, 255, .97);
	overflow: hidden;
}
.ttt-map .maplibregl-ctrl-group button {
	width: 36px;
	height: 36px;
	border-color: rgba(26, 23, 20, .07);
}
.ttt-map .maplibregl-ctrl-group button:hover { background: #faf7f2; }
.ttt-map .maplibregl-ctrl-attrib {
	font: 500 10px/1.4 var(--ttt-sans);
	background: rgba(255, 255, 255, .82);
	border-radius: 10px 0 0 0;
	padding: 2px 8px;
}
.ttt-map .maplibregl-ctrl-attrib a { color: var(--ttt-ink3); }
.ttt-map .maplibregl-ctrl-attrib-button { border-radius: 50%; }

/* ── popups ─────────────────────────────────────────────────────────────── */
.ttt-map .maplibregl-popup-content {
	font-family: var(--ttt-sans);
	border-radius: 14px;
	box-shadow: var(--ttt-sh);
	padding: 15px 17px;
}
.ttt-map .maplibregl-popup-close-button {
	width: 24px;
	height: 24px;
	top: 6px;
	right: 6px;
	border-radius: 50%;
	font-size: 15px;
	line-height: 1;
	color: var(--ttt-ink3);
}
.ttt-map .maplibregl-popup-close-button:hover { background: #f8edeb; color: var(--ttt-rd); }
.ttt-popup-title { font: 600 15px/1.25 var(--ttt-serif); color: var(--ttt-ink); }
.ttt-popup-ja { font-size: 11.5px; color: var(--ttt-ink3); margin-top: 2px; }
.ttt-popup-desc { font-size: 12px; line-height: 1.5; color: var(--ttt-ink3); margin-top: 7px; }
.ttt-popup-station {
	display: flex;
	align-items: flex-start;
	gap: 6px;
	font-size: 11.5px;
	font-weight: 600;
	color: var(--ttt-ink);
	margin-top: 8px;
}
.ttt-popup-station .ttt-ic svg { width: 13px; height: 13px; margin-top: 1px; }
.ttt-popup-lines { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 9px; }
.ttt-chip-mini {
	font: 700 10px/1 var(--ttt-sans);
	color: #fff;
	border-radius: 9999px;
	padding: 4px 8px;
	text-shadow: 0 1px 2px rgba(0, 0, 0, .25);
}

/* ── mobile: panels become bottom sheets ────────────────────────────────── */
@media (max-width: 640px) {
	.ttt-panel {
		top: auto;
		bottom: 0;
		left: 0;
		right: 0;
		width: 100%;
		max-height: 62%;
		border-radius: 16px 16px 0 0;
		transform: translateY(105%);
	}
	.ttt-panel.is-open { transform: translateY(0); }
	.ttt-btn { bottom: 12px; padding: 10px 14px; font-size: 12px; }
	/* the bottom sheet covers the action buttons — hide them while open */
	.ttt-map.ttt-panel-open .ttt-btn { display: none; }

	/* phones: search collapses to an icon button in the top strip; tapping
	   it expands the field OVER the strip so nothing overlaps */
	.ttt-search {
		top: 12px;
		left: 150px;
		width: 38px;
		height: 38px;
		padding: 0;
		justify-content: center;
	}
	.ttt-search .ttt-search-input { display: none; }
	/* :not(.is-open) — expanded, the toggle must shrink back to icon size,
	   or it fills the pill and squeezes the input to zero width */
	.ttt-search:not(.is-open) .ttt-search-toggle {
		width: 100%;
		height: 100%;
		border-radius: 9999px;
	}
	.ttt-search.is-open {
		left: 12px;
		right: 12px;
		width: auto;
		height: auto;
		padding: 9px 15px;
		justify-content: flex-start;
		z-index: 5; /* covers the 2D/3D toggle + fullscreen while typing */
	}
	.ttt-search.is-open .ttt-search-input {
		display: block;
		font-size: 16px; /* <16px makes iOS Safari auto-zoom on focus */
	}
}
