/* Hindu Temple Atlas — layout adapted from VedicStellar components/temple-atlas.css,
   recoloured for the KaalChakra dark-and-gold theme. Only loaded on /mandir/ pages. */
.templeAtlas {
  --panel: rgba(20, 13, 6, .96);
  --line: rgba(212, 164, 55, .28);
  --ink: var(--cream);
  --muted: var(--cream-dim);
  position: relative;
  width: 100%;
  height: calc(100dvh - var(--atlas-top, 72px));
  min-height: 540px;
  overflow: hidden;
  background: #a6c8ec;
  isolation: isolate;
  color: var(--ink);
  font-family: var(--sans);
}
.templeAtlas.isFullscreen { height: 100dvh; min-height: 0; }
.templeAtlas button { cursor: pointer; font: inherit; }
.templeAtlas :is(button, a, input, select):focus-visible { outline: 3px solid var(--gold-bright); outline-offset: 3px; }
.atlasVisuallyHidden { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.templeAtlas .eyebrow { margin: 0 0 4px; color: var(--gold); font-size: 11px; letter-spacing: .12em; text-transform: uppercase; font-weight: 700; }

/* map */
.atlasMap { position: absolute; inset: 0; }
.atlasSouthMask { position: absolute; left: 0; right: 0; bottom: 0; height: 0; z-index: 1; background: #a6c8ec; pointer-events: none; }
.atlasMapStatus { position: absolute; inset: 0; z-index: 6; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 30px; text-align: center; background: var(--black-2); }
.atlasMapStatus[hidden] { display: none; }
.atlasMapStatus p { max-width: 360px; color: var(--muted); font-size: 14px; line-height: 1.6; }
.atlasMapStatus button, .atlasMapActions button {
  min-height: 42px; padding: 9px 13px; border: 1px solid var(--line); border-radius: 9px;
  background: var(--panel); color: var(--cream); box-shadow: 0 2px 10px rgba(0, 0, 0, .35); font-size: 13px; font-weight: 600;
}
.atlasMapActions { position: absolute; z-index: 4; top: 14px; right: 364px; display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; }
.atlasMapActions button:hover { border-color: var(--gold); }
.atlasMapActions button[hidden] { display: none; }
.templeAtlas .maplibregl-ctrl-top-right { top: 66px; right: 364px; }
.templeAtlas .maplibregl-ctrl-attrib { font-size: 10px; color: #222; }
.templeAtlas .maplibregl-ctrl-attrib a { color: #222; }
.templeAtlas .maplibregl-popup { z-index: 5; }
.templeAtlas .maplibregl-popup-content { padding: 12px; border-radius: 10px; background: var(--black-2); box-shadow: 0 3px 16px rgba(0, 0, 0, .5); }
.templeAtlas .maplibregl-popup-tip { border-top-color: var(--black-2) !important; border-bottom-color: var(--black-2) !important; }
.templeAtlas .maplibregl-popup-close-button { color: var(--cream); font-size: 18px; padding: 0 6px; }

.atlasCompass, .atlasMusic {
  position: absolute; z-index: 7; display: grid; place-items: center; padding: 0;
  border: 2px solid var(--gold); border-radius: 50%; background: var(--black-2); color: var(--cream);
  box-shadow: 0 3px 12px rgba(0, 0, 0, .45);
}
.atlasCompass { right: 376px; bottom: 100px; width: 34px; height: 34px; }
.atlasCompass svg { display: block; transition: transform 120ms linear; }
.atlasMusic { right: 368px; bottom: 40px; width: 50px; height: 50px; transition: transform 140ms ease, background-color 140ms ease; }
.atlasMusic:hover { transform: translateY(-2px); }
.atlasMusic.isOn { background: var(--gold-dim); }
.atlasMusic svg { display: block; }

/* markers */
.templePhotoMarker {
  width: 44px; height: 52px; padding: 0; overflow: hidden;
  display: grid; place-items: center;
  border: 3px solid #fffdf8; border-radius: 50% 50% 50% 8px; transform: rotate(-45deg);
  background: var(--black-2); color: var(--gold-bright); box-shadow: 0 2px 8px rgba(0, 0, 0, .45);
  font-size: 22px !important; cursor: pointer;
}
.templePhotoMarker img { width: 100%; height: 100%; object-fit: cover; transform: rotate(45deg) scale(1.4); }
.templePhotoMarker.isOverview { width: 22px; height: 28px; border-width: 2px; font-size: 11px !important; }
.templePhotoMarker.isRegional { width: 32px; height: 38px; border-width: 2px; font-size: 17px !important; }
.templePhotoMarker:not(.hasPhoto) { border-color: var(--gold); border-radius: 50%; transform: none; }

.atlasMapPopup { display: grid; gap: 7px; color: var(--cream); font-family: var(--sans); }
.atlasMapPopup img, .atlasMapPopupPlaceholder { width: 100%; height: 125px; border-radius: 6px; object-fit: cover; }
.atlasMapPopupPlaceholder, .atlasDetailPhotoPlaceholder {
  display: grid; place-items: center; align-content: center; justify-items: center; gap: 6px;
  background: linear-gradient(145deg, #2a1a08, #aa7422); color: var(--gold-bright); font-family: var(--serif); font-size: 42px;
}
.atlasMapPopupPlaceholder small, .atlasDetailPhotoPlaceholder small { color: var(--cream); font: 12px var(--sans); }
.atlasMapPopup strong { font: 700 18px var(--serif); color: var(--gold-bright); }
.atlasMapPopup span { color: var(--muted); font-size: 12px; }
.atlasMapPopup a { color: var(--gold-bright); font-size: 12px; text-decoration: underline; }

/* sidebar: filters + list */
.atlasSidebar { position: absolute; z-index: 4; top: 14px; left: 14px; bottom: 14px; width: min(380px, calc(100vw - 28px)); display: flex; flex-direction: column; gap: 10px; pointer-events: none; }
.atlasSidebar > * { pointer-events: auto; }
.atlasFilters, .atlasDirectory, .atlasDetails { border: 1px solid var(--line); border-radius: 12px; background: var(--panel); box-shadow: 0 3px 18px rgba(0, 0, 0, .45); }
.atlasFilters { display: grid; gap: 10px; padding: 12px; flex: 0 0 auto; }
.atlasSearchRow { display: flex; gap: 8px; }
.atlasSearch { flex: 1; min-width: 0; }
.atlasFilters label { display: grid; gap: 6px; font-size: 12px; font-weight: 700; color: var(--muted); }
.atlasFilters input, .atlasFilters select {
  width: 100%; min-width: 0; height: 44px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 8px; background: var(--black); color: var(--cream); font: inherit; font-size: 15px;
}
.atlasFilters input::placeholder { color: var(--cream-dim); opacity: .7; }
.atlasFilterToggle { display: none; align-items: center; gap: 6px; padding: 0 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--black); color: var(--cream); font-size: 13px; font-weight: 700; }
.atlasFilterToggle b { display: grid; place-items: center; min-width: 20px; height: 20px; border-radius: 10px; background: var(--gold); color: var(--black); font-size: 11px; }
.atlasFilterToggle b[hidden] { display: none; }
.atlasFilterExtra { display: grid; gap: 10px; }
.atlasChips { display: flex; flex-wrap: wrap; gap: 6px; min-width: 0; margin: 0; padding: 0; border: 0; }
.atlasChips button { display: inline-flex; align-items: center; gap: 6px; min-height: 34px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--black); color: var(--cream); font-size: 13px; font-weight: 600; }
.atlasChips button[data-deity]::before { content: ''; width: 8px; height: 8px; border-radius: 50%; background: var(--deity, #8a6d2a); }
.atlasChips button:hover { border-color: var(--gold); }
.atlasChips button[aria-pressed='true'] { background: var(--gold); border-color: var(--gold); color: var(--black); }
.atlasClear { justify-self: start; padding: 2px 0; border: 0; background: none; color: var(--gold-bright); font-size: 13px; font-weight: 700; text-decoration: underline; }
.atlasClear[hidden] { display: none; }
[data-deity='Shiva'] { --deity: #8fa3cc; }
[data-deity='Vishnu'] { --deity: #5fa8dd; }
[data-deity='Devi'] { --deity: #e0627a; }
[data-deity='Ganesha'] { --deity: #f0963a; }
[data-deity='Murugan'] { --deity: #4fc184; }
[data-deity='Multiple'] { --deity: #d4a437; }

.atlasDirectory { position: relative; display: flex; flex-direction: column; flex: 1 1 auto; min-height: 0; overflow: hidden; }
.atlasDirectory.isCollapsed { display: none; }
.atlasResultHeading { position: relative; display: grid; gap: 6px; padding: 14px 48px 14px 18px; border-bottom: 1px solid var(--line); }
.atlasResultHeading h1 { margin: 0; font: 600 24px var(--serif); color: var(--gold-bright); line-height: 1.2; }
.atlasResultHeading output { color: var(--muted); font-size: 12px; }
.atlasPanelToggle { position: absolute; top: 12px; right: 12px; width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 50%; background: var(--black); color: var(--cream); font-size: 20px; line-height: 1; }
.atlasSheetHandle { display: none; }
.atlasResultList { flex: 1; min-height: 0; overflow: auto; scrollbar-width: thin; }
.atlasResult {
  content-visibility: auto; contain-intrinsic-size: auto 86px;
  width: 100%; display: grid; gap: 4px; padding: 12px 16px; text-align: left;
  background: transparent; color: var(--cream); border: 0; border-bottom: 1px solid rgba(212, 164, 55, .14); border-left: 4px solid var(--deity, transparent);
}
.atlasResult:hover { background: rgba(212, 164, 55, .08); }
.atlasResult.isSelected { background: rgba(212, 164, 55, .16); box-shadow: inset 0 0 0 1px rgba(212, 164, 55, .4); }
.atlasResult strong { font: 600 18px var(--serif); line-height: 1.25; }
.atlasResultDeity { color: var(--deity, var(--gold)); text-transform: uppercase; font-size: 10px; letter-spacing: .12em; font-weight: 700; }
.atlasResultPlace { color: var(--muted); font-size: 13px; }
.atlasResult small { display: flex; justify-content: space-between; align-items: center; margin-top: 2px; color: var(--muted); font-size: 12px; }
.atlasPinned, .atlasUnpinned { padding: 2px 8px; border-radius: 999px; font-size: 11px; font-weight: 700; }
.atlasPinned { background: rgba(79, 193, 132, .16); color: #7fd8a6; }
.atlasUnpinned { background: rgba(255, 255, 255, .08); color: var(--muted); }
.atlasEmpty { padding: 24px; line-height: 1.7; color: var(--muted); }
.atlasAbout { flex: 0 0 auto; border-top: 1px solid var(--line); padding: 10px 16px; font-size: 12px; color: var(--muted); }
.atlasAbout summary { cursor: pointer; font-weight: 700; color: var(--gold-bright); }
.atlasAbout p { margin: 8px 0 0; line-height: 1.6; }
.atlasAbout a { color: var(--gold-bright); }

/* details card */
.atlasDetails { position: absolute; z-index: 5; top: 68px; right: 14px; width: min(340px, calc(100vw - 28px)); max-height: calc(100% - 150px); padding: 18px; overflow: auto; }
.atlasDetails h2 { margin: 8px 0 10px; font: 600 25px var(--serif); color: var(--gold-bright); line-height: 1.2; }
.atlasDetails h3 { margin: 18px 0 4px; font: 700 18px var(--serif); color: var(--cream); }
.atlasDetails p:not(.eyebrow) { margin: 0 0 8px; color: var(--muted); font-size: 14px; line-height: 1.7; }
.atlasDetails small { display: block; color: var(--muted); font-size: 11px; line-height: 1.6; opacity: .85; }
.atlasDetailHeading { display: flex; justify-content: space-between; gap: 10px; align-items: center; }
.atlasDetailHeading button { flex: 0 0 auto; width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; background: var(--black); color: var(--cream); font-size: 22px; line-height: 1; }
.atlasDetailPhoto { margin: 0 0 16px; }
.atlasDetailPhoto img, .atlasDetailPhotoPlaceholder { display: block; width: 100%; max-height: 180px; min-height: 130px; border-radius: 8px; object-fit: cover; }
.atlasDetailPhotoPlaceholder { margin-bottom: 16px; }
.atlasDetailPhoto figcaption { margin-top: 6px; font-size: 11px; color: var(--muted); }
.atlasDetailPhoto figcaption a { color: var(--muted); }
.atlasDetailLinks { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.atlasDetailLinks a { padding: 7px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--gold-bright); font-size: 13px; font-weight: 600; text-decoration: none; }
.atlasDetailLinks a:hover { border-color: var(--gold); }

.atlasCredits { position: absolute; z-index: 2; bottom: 6px; left: 408px; max-width: calc(100% - 430px); margin: 0; padding: 5px 9px; border-radius: 6px; background: rgba(255, 255, 255, .88); color: #333; font-size: 10px; line-height: 1.4; }
.atlasCredits a { color: #5b3f08; }

/* The site's floating WhatsApp button would cover the bottom sheet on phones; the header and the CTA below keep WhatsApp reachable. */
@media (max-width: 760px) { body:has(.templeAtlas) .wa-float { display: none; } }

/* About section below the map, for search engines and readers */
.atlasIntro { padding: 56px 24px; }
.atlasIntro .container { max-width: 820px; }

@media (max-width: 760px) {
  .templeAtlas { min-height: 480px; }
  .atlasSidebar { top: 10px; left: 10px; right: 10px; bottom: 10px; width: auto; }
  .atlasFilters { padding: 10px; }
  .atlasFilters input, .atlasFilters select { font-size: 16px; } /* avoids iOS zoom on focus */
  .atlasFilterToggle { display: inline-flex; }
  .atlasFilterExtra { display: none; }
  .atlasFilterExtra.isOpen { display: grid; }
  .atlasDirectory { margin-top: auto; flex: 0 1 34%; border-radius: 16px 16px 12px 12px; }
  .templeAtlas.sheetExpanded .atlasDirectory { flex-basis: 74%; }
  .templeAtlas.hasSelection .atlasDirectory { display: none; }
  .atlasSheetHandle { position: absolute; top: 0; left: 50%; display: block; width: 80px; height: 24px; transform: translateX(-50%); border: 0; background: none; padding: 0; }
  .atlasSheetHandle::before { content: ''; position: absolute; top: 8px; left: 18px; width: 44px; height: 5px; border-radius: 3px; background: var(--gold-dim); }
  .atlasResultHeading { padding-top: 22px; }
  .atlasResultHeading h1 { font-size: 21px; }
  .atlasAbout { display: none; }
  .templeAtlas.sheetExpanded .atlasAbout { display: block; }
  .atlasMapActions { top: 72px; right: 10px; flex-direction: column; align-items: flex-end; }
  .atlasMapActions button { min-height: 38px; padding: 7px 10px; font-size: 12px; }
  .templeAtlas .maplibregl-ctrl-top-right { top: 214px; right: 10px; }
  .templeAtlas .maplibregl-ctrl-bottom-right { right: auto; left: 10px; bottom: calc(34% + 8px); }
  .templeAtlas.sheetExpanded .maplibregl-ctrl-bottom-right { bottom: calc(74% + 8px); }
  .templeAtlas.hasSelection .maplibregl-ctrl-bottom-right { bottom: calc(56% + 8px); }
  .atlasMusic { right: 10px; bottom: calc(34% + 26px); width: 44px; height: 44px; }
  .atlasCompass { right: 15px; bottom: calc(34% + 80px); }
  .templeAtlas.sheetExpanded .atlasMusic { bottom: calc(74% + 26px); }
  .templeAtlas.sheetExpanded .atlasCompass { bottom: calc(74% + 80px); }
  .templeAtlas.hasSelection .atlasMusic { bottom: calc(56% + 26px); }
  .templeAtlas.hasSelection .atlasCompass { bottom: calc(56% + 80px); }
  .atlasDetails { top: auto; right: 10px; bottom: 10px; width: calc(100vw - 20px); max-height: 56%; }
  .atlasDetails[data-empty] { display: none; }
  .templeAtlas .maplibregl-popup { display: none; }
  .atlasCredits { display: none; }
}

/* ---- Individual temple pages (/mandir/<id>/) ---- */
.templeCrumbs { margin-bottom: 14px; color: var(--cream-dim); font-size: 13px; }
.templeCrumbs a { color: var(--gold-bright); }
.templeAlt { margin-top: -6px; font-style: italic; }
.templeBody { max-width: 760px; }
.templePhoto { margin: 0 0 24px; }
.templePhoto img { display: block; width: 100%; height: auto; max-height: 460px; border-radius: 12px; object-fit: cover; border: 1px solid var(--line, rgba(212,164,55,.28)); }
.templePhoto figcaption { margin-top: 6px; font-size: 12px; color: var(--cream-dim); }
.templePhoto figcaption a { color: var(--cream-dim); }
.templeActions { display: flex; flex-wrap: wrap; gap: 12px; margin: 24px 0; }
.templeBody h2 { margin: 32px 0 10px; font: 600 24px var(--serif); color: var(--gold-bright); }
.templeNearby { list-style: none; margin: 0; padding: 0; }
.templeNearby li { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid rgba(212,164,55,.16); }
.templeNearby a { color: var(--cream); }
.templeNearby span { color: var(--cream-dim); font-size: 13px; }
.templeSources { margin: 32px 0 20px; padding: 16px 18px; border-left: 3px solid var(--gold-dim); background: rgba(212,164,55,.06); font-size: 13px; color: var(--cream-dim); line-height: 1.7; }
.templeSources small { color: var(--gold); text-transform: uppercase; letter-spacing: .1em; font-weight: 700; }
.templeSources a, .templeBody > p > a:not(.btn) { color: var(--gold-bright); }
.templeSources p { margin: 6px 0 0; }
.templeNote { opacity: .85; font-size: 12px; }

/* ---- Temple list pages (/mandir/suchi/) ---- */
.templeList { list-style: none; margin: 24px 0 0; padding: 0; columns: 2 300px; column-gap: 36px; }
.templeList li { break-inside: avoid; display: flex; flex-direction: column; gap: 2px; padding: 10px 0; border-bottom: 1px solid rgba(212, 164, 55, .16); }
.templeList a { color: var(--cream); font-weight: 600; }
.templeList a:hover { color: var(--gold-bright); }
.templeList small { color: var(--cream-dim); font-size: 13px; }
