/* ==========================================================================
   RSUD SMART — denah interaktif
   ========================================================================== */
.rs-denah { display: grid; gap: 1.25rem; }
.rs-denah-page { padding-block: clamp(2rem, 5vw, 3.5rem) clamp(3rem, 7vw, 5rem); }
.rs-denah-page > * { margin-block: 0; }

.rs-denah__map { position: relative; border-radius: var(--rs-r-l); background: #fff; border: 1px solid var(--rs-line); box-shadow: var(--rs-shadow); overflow: hidden; scroll-margin-top: calc(var(--rs-header-h) + 16px); }
.rs-denah__view { position: relative; overflow: hidden; aspect-ratio: 1101 / 430; min-height: 340px; max-height: 78vh; cursor: grab; touch-action: pan-y; user-select: none; -webkit-user-select: none; background: #fff; outline: none; }
.rs-denah__view:focus-visible { box-shadow: inset 0 0 0 3px var(--rs-accent); }
.rs-denah.is-zoomed .rs-denah__view { touch-action: none; }
.rs-denah.is-zoomed .rs-denah__view:active { cursor: grabbing; }
.rs-denah__canvas { --s: 1; position: absolute; left: 0; top: 0; width: 100%; transform-origin: 0 0; will-change: transform; }
.rs-denah__canvas img { display: block; width: 100%; height: auto; pointer-events: none; image-rendering: auto; }
.rs-denah.is-zoomed .rs-denah__canvas img { image-rendering: -webkit-optimize-contrast; }

/* Titik ruang: tak terlihat sampai dipilih; area ketuk tetap ada */
.rs-denah__pin { position: absolute; width: 22px; height: 22px; margin: 0; padding: 0; border: 0; border-radius: 50%; background: transparent; cursor: pointer; transform: translate(-50%, -50%) scale(calc(1 / var(--s))); transform-origin: center; }
.rs-denah__pin:focus-visible { outline: 3px solid var(--rs-accent); outline-offset: 2px; }
.rs-denah__pin > span { position: absolute; left: 50%; bottom: calc(100% + 12px); transform: translateX(-50%); padding: .45rem .75rem; border-radius: 10px; background: var(--rs-ink); color: #fff; font-size: 13px; font-weight: 700; line-height: 1.3; white-space: nowrap; box-shadow: 0 8px 24px -8px rgba(14, 26, 58, .5); opacity: 0; visibility: hidden; transition: opacity .2s; pointer-events: none; }
.rs-denah__pin > span::after { content: ""; position: absolute; left: 50%; top: 100%; transform: translateX(-50%); border: 6px solid transparent; border-top-color: var(--rs-ink); }
.rs-denah__pin:hover > span, .rs-denah__pin:focus-visible > span, .rs-denah__pin.is-active > span { opacity: 1; visibility: visible; }
.rs-denah__pin.is-active { z-index: 3; box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--rs-emergency); animation: rs-denah-pulse 1.4s ease-out infinite; }
@keyframes rs-denah-pulse {
	0% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--rs-emergency), 0 0 0 6px rgba(226, 54, 75, .5); }
	100% { box-shadow: 0 0 0 3px #fff, 0 0 0 6px var(--rs-emergency), 0 0 0 26px rgba(226, 54, 75, 0); }
}

.rs-denah__tools { position: absolute; right: 12px; top: 12px; display: grid; gap: 6px; z-index: 4; }
.rs-denah__tools button { width: 42px; height: 42px; border-radius: 12px; border: 1px solid var(--rs-line); background: #fff; color: var(--rs-primary); font-family: inherit; font-weight: 700; font-size: 1.3rem; line-height: 1; cursor: pointer; box-shadow: var(--rs-shadow); }
.rs-denah__tools button:hover { background: var(--rs-surface); }
.rs-denah__hint { margin: 0; padding: .6rem 1rem; border-top: 1px solid var(--rs-line); font-size: .82rem; color: var(--rs-muted); background: var(--rs-surface); }
.rs-denah__map:fullscreen { display: flex; flex-direction: column; border-radius: 0; }
.rs-denah__map:fullscreen .rs-denah__view { flex: 1; max-height: none; aspect-ratio: auto; }

.rs-denah__keys { display: flex; flex-wrap: wrap; gap: .5rem 1.25rem; font-size: .86rem; color: var(--rs-muted); }
.rs-denah__keys span { display: inline-flex; align-items: center; gap: .45rem; }
.rs-denah__keys i { display: inline-block; width: 22px; height: 14px; border-radius: 3px; }
.rs-denah__keys i.is-arrow { height: 4px; background: #2EBD3C; position: relative; }
.rs-denah__keys i.is-arrow::after { content: ""; position: absolute; right: -4px; top: -4px; border: 6px solid transparent; border-left-color: #2EBD3C; border-right: 0; }
.rs-denah__keys i.is-kumpul { width: 16px; height: 16px; background: #1FA34A; }
.rs-denah__keys b { color: var(--rs-ink); font-size: 1.1rem; }

.rs-denah__list { display: grid; gap: 1rem; padding: 1.4rem; border-radius: var(--rs-r-l); background: #fff; border: 1px solid var(--rs-line); box-shadow: var(--rs-shadow); }
.rs-denah__search label { display: block; font-weight: 800; margin-bottom: .35rem; }
.rs-denah__search input { width: 100%; box-sizing: border-box; height: 52px; padding: 0 1rem; border-radius: 14px; border: 1.5px solid var(--rs-line); font: inherit; font-size: 1rem; }
.rs-denah__search input:focus { outline: none; border-color: var(--rs-secondary); box-shadow: 0 0 0 4px rgba(58, 132, 196, .15); }
.rs-denah__search p { margin: .4rem 0 0; min-height: 1.2em; font-size: .86rem; color: var(--rs-muted); }
.rs-denah__groups { columns: 3 260px; column-gap: 1.5rem; }
.rs-denah__groups section { break-inside: avoid; margin-bottom: 1.1rem; }
.rs-denah__groups section[hidden] { display: none; }
.rs-denah__groups h3 { margin: 0 0 .4rem; font-size: .8rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--rs-secondary); }
.rs-denah__groups ul { list-style: none; margin: 0; padding: 0; }
.rs-denah__groups li[hidden] { display: none; }
.rs-denah__groups button { display: flex; align-items: flex-start; gap: .6rem; width: 100%; padding: .4rem .5rem; border: 0; border-radius: 10px; background: transparent; font: inherit; font-size: .92rem; text-align: left; color: var(--rs-ink); cursor: pointer; }
.rs-denah__groups button:hover { background: var(--rs-surface); }
.rs-denah__groups button.is-active { background: #FDECEE; }
.rs-denah__groups b { flex: none; display: inline-grid; place-content: center; min-width: 1.9rem; height: 1.6rem; border-radius: 7px; background: var(--rs-primary); color: #fff; font-size: .8rem; }
.rs-denah__groups button.is-active b { background: var(--rs-emergency); }
.rs-denah__dl { margin: 0; }

@media (max-width: 700px) {
	.rs-denah__view { aspect-ratio: auto; height: 62vh; min-height: 320px; }
	.rs-denah__list { padding: 1.1rem; }
}
@media (prefers-reduced-motion: reduce) {
	.rs-denah__pin.is-active { animation: none; }
}
