/* ==========================================================================
   PHẬT GIÁO VIỆT NAM — BẢN ĐỒ TƯƠNG TÁC 34 TỈNH THÀNH
   Vector ViewBox Camera + Liên Hoa Bảo Ảnh Đài (Multi-Image Buddhist Morphing)
   ========================================================================== */

:root {
  --bg-primary: #1a110b;
  --bg-secondary: #26180f;
  --bg-surface: #2d1d12;
  --bg-elevated: #382417;

  --text-primary: #f9eed8;
  --text-secondary: #d8be92;
  --text-muted: #9e825c;

  --gold-bright: #ffdf7e;
  --gold-main: #d4af37;
  --gold-deep: #9b7419;
  --crimson: #8c2318;

  --map-fill: #3e2818;
  --map-fill-alt: #4a301d;
  --map-stroke: #c49a45;

  --border-gold: rgba(212, 175, 55, 0.32);
  --border-gold-strong: rgba(255, 223, 126, 0.78);

  --label-size: 23px;
  --label-active-size: 28px;
  --label-stroke: 5px;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Be Vietnam Pro', system-ui, -apple-system, sans-serif;
}

[data-theme="hoa-dang"] {
  --bg-primary: #090d16;
  --bg-secondary: #111827;
  --bg-surface: #182235;
  --bg-elevated: #1f2d46;

  --text-primary: #fef9ec;
  --text-secondary: #cbd5e1;
  --text-muted: #94a3b8;

  --map-fill: #17243d;
  --map-fill-alt: #1f3050;
  --map-stroke: #eab308;
  --border-gold: rgba(234, 179, 8, 0.34);
}

[data-theme="tinh-thuy"] {
  --bg-primary: #f5efe2;
  --bg-secondary: #eae0cc;
  --bg-surface: #fcf8f0;
  --bg-elevated: #ffffff;

  --text-primary: #2c1e14;
  --text-secondary: #5c4330;
  --text-muted: #8a6d56;

  --gold-bright: #8c2318;
  --gold-main: #a36a1e;
  --gold-deep: #6b4411;

  --map-fill: #dfd0b5;
  --map-fill-alt: #d4c2a2;
  --map-stroke: #8c6635;
  --border-gold: rgba(140, 102, 53, 0.3);
  --border-gold-strong: rgba(140, 35, 24, 0.65);
}

*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
  touch-action: manipulation;
}

.lotus-svg-icon {
  width: 1.15em;
  height: 1.15em;
  fill: currentColor;
  flex-shrink: 0;
}

.ambient-backdrop {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 50%, rgba(212, 175, 55, 0.14) 0%, transparent 68%),
    linear-gradient(160deg, var(--bg-primary) 0%, var(--bg-secondary) 100%);
  display: grid;
  place-items: center;
}

.mandala-watermark {
  width: min(82vw, 760px);
  height: min(82vw, 760px);
  color: var(--gold-main);
  opacity: 0.08;
}

/* ==========================================================================
   HEADER TỐI GIẢN (CAO 54PX)
   ========================================================================== */
.site-header {
  position: relative;
  z-index: 30;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 1rem;
  background: var(--bg-surface);
  border-bottom: 1px solid var(--border-gold);
}

.header-left {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.icon-pill-btn {
  appearance: none;
  border: 1px solid var(--border-gold);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}

.icon-pill-btn:hover {
  border-color: var(--border-gold-strong);
}

.brand-group {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  color: var(--gold-bright);
}

.brand-title {
  font-family: var(--font-display);
  font-size: clamp(1.05rem, 2vw, 1.38rem);
  font-weight: 700;
  letter-spacing: 0.04em;
  color: var(--gold-bright);
  white-space: nowrap;
}

.header-icons {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.icon-circle-btn {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  background: var(--bg-elevated);
  color: var(--text-primary);
  font-size: 0.95rem;
  display: grid;
  place-items: center;
  cursor: pointer;
}

.icon-circle-btn:hover {
  border-color: var(--border-gold-strong);
}

.icon-circle-btn.is-active {
  border-color: var(--gold-bright);
  box-shadow: inset 0 0 0 1px var(--gold-main);
}

/* ==========================================================================
   NGĂN KÉO DANH SÁCH 34 TỈNH (MẶC ĐỊNH ẨN)
   ========================================================================== */
.drawer-backdrop {
  position: fixed;
  inset: 54px 0 0 0;
  z-index: 40;
  background: rgba(0, 0, 0, 0.55);
}

.drawer-backdrop[hidden] {
  display: none;
}

.province-drawer {
  position: fixed;
  top: 54px;
  left: 0;
  bottom: 0;
  width: min(88vw, 340px);
  z-index: 45;
  background: var(--bg-surface);
  border-right: 1px solid var(--border-gold-strong);
  display: flex;
  flex-direction: column;
  transform: translateX(-102%);
  transition: transform 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}

.province-drawer.is-open {
  transform: translateX(0);
}

.drawer-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border-gold);
}

.drawer-header h2 {
  font-family: var(--font-display);
  font-size: 1.2rem;
  color: var(--gold-bright);
}

.drawer-filters {
  padding: 0.75rem 0.9rem;
  border-bottom: 1px solid var(--border-gold);
}

.search-box {
  position: relative;
  margin-bottom: 0.55rem;
}

.search-box input {
  width: 100%;
  padding: 0.5rem 0.75rem 0.5rem 2.1rem;
  border-radius: 8px;
  border: 1px solid var(--border-gold);
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-body);
  font-size: 0.82rem;
  outline: none;
}

.search-box input:focus {
  border-color: var(--gold-bright);
}

.search-box .search-icon {
  position: absolute;
  left: 0.65rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.8rem;
  pointer-events: none;
}

.region-pills {
  display: flex;
  gap: 0.35rem;
  overflow-x: auto;
  padding-bottom: 0.2rem;
  scrollbar-width: none;
}

.region-pill {
  appearance: none;
  border: 1px solid var(--border-gold);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.7rem;
  padding: 0.24rem 0.6rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.region-pill.active {
  background: var(--gold-main);
  color: #1a110b;
  font-weight: 600;
}

.province-list {
  flex: 1;
  overflow-y: auto;
  padding: 0.5rem 0.65rem;
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.province-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.5rem 0.7rem;
  border-radius: 8px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
}

.province-item:hover,
.province-item.active {
  background: var(--bg-elevated);
  border-color: var(--border-gold-strong);
}

.province-item-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.province-num {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  border: 1px solid var(--border-gold);
  display: grid;
  place-items: center;
  font-size: 0.66rem;
  color: var(--gold-bright);
  flex-shrink: 0;
}

.province-meta {
  min-width: 0;
}

.province-meta h3 {
  font-size: 0.84rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.province-meta p {
  font-size: 0.68rem;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* ==========================================================================
   KHÔNG GIAN BẢN ĐỒ VECTOR
   ========================================================================== */
.map-viewport {
  position: relative;
  z-index: 10;
  width: 100vw;
  height: calc(100dvh - 54px);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  user-select: none;
}

.map-canvas-wrapper {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: grab;
}

.map-canvas-wrapper.is-dragging {
  cursor: grabbing;
}

#vn-svg-map {
  width: 100%;
  height: 100%;
  display: block;
  shape-rendering: geometricPrecision;
  text-rendering: geometricPrecision;
}

.province-group {
  cursor: pointer;
}

.province-group path {
  fill: var(--map-fill);
  stroke: var(--map-stroke);
  stroke-width: 1.35px;
  vector-effect: non-scaling-stroke;
  stroke-linejoin: round;
  transition: fill 0.14s ease, stroke 0.14s ease;
}

.province-group:nth-child(even) path {
  fill: var(--map-fill-alt);
}

.province-group.is-selected path {
  fill: url(#trucChiActiveGrad);
  stroke: #fff7d6;
  stroke-width: 2.4px;
}

@media (hover: hover) and (pointer: fine) {
  .province-group:hover:not(.is-selected) path {
    stroke: #ffe58f;
    stroke-width: 2px;
  }
}

.province-pin {
  pointer-events: none;
}

.province-pin circle.pin-core {
  fill: var(--gold-bright);
  stroke: #261306;
  stroke-width: 1.5px;
  vector-effect: non-scaling-stroke;
}

.province-label {
  font-family: var(--font-body);
  font-size: var(--label-size, 23px);
  font-weight: 600;
  fill: var(--text-primary);
  paint-order: stroke;
  stroke: rgba(14, 8, 4, 0.92);
  stroke-width: var(--label-stroke, 5px);
  stroke-linecap: round;
  stroke-linejoin: round;
  pointer-events: none;
}

[data-theme="tinh-thuy"] .province-label {
  stroke: rgba(255, 252, 245, 0.96);
  fill: #2c1e14;
}

.province-label.is-active {
  font-size: var(--label-active-size, 28px);
  fill: #ffe58f;
  font-weight: 700;
}

[data-theme="tinh-thuy"] .province-label.is-active {
  fill: #8c2318;
}

.archipelago-group {
  cursor: pointer;
}

.archipelago-hit-area {
  fill: transparent;
  stroke: none;
  pointer-events: all;
}

.archipelago-group path {
  stroke: var(--gold-bright);
  stroke-width: 2.2px;
  vector-effect: non-scaling-stroke;
  fill: rgba(255, 223, 126, 0.5);
  transition: fill 0.15s ease, stroke 0.15s ease;
}

.archipelago-group:hover path,
.archipelago-group.is-selected path {
  stroke: #ffffff;
  fill: #ffdf7e;
}

.archipelago-group:hover .archipelago-title,
.archipelago-group.is-selected .archipelago-title {
  fill: #fff7d6;
}

.archipelago-title {
  font-family: var(--font-display);
  font-size: var(--label-active-size, 27px);
  font-weight: 700;
  font-style: italic;
  fill: var(--gold-bright);
  paint-order: stroke;
  stroke: rgba(14, 8, 4, 0.92);
  stroke-width: var(--label-stroke, 5px);
}

[data-theme="tinh-thuy"] .archipelago-title {
  stroke: rgba(255, 252, 245, 0.96);
  fill: #8c2318;
}

.archipelago-sub {
  font-family: var(--font-body);
  font-size: calc(var(--label-size, 23px) * 0.82);
  font-weight: 500;
  fill: var(--text-secondary);
  paint-order: stroke;
  stroke: rgba(14, 8, 4, 0.92);
  stroke-width: calc(var(--label-stroke, 5px) * 0.85);
}

[data-theme="tinh-thuy"] .archipelago-sub {
  stroke: rgba(255, 252, 245, 0.96);
  fill: #5c4330;
}

/* ==========================================================================
   THANH CHỌN NHANH 3 MIỀN: ĐẶT Ở GÓC TRÁI TRÊN ĐỂ KHÔNG BAO GIỜ ĐÈ BẢN ĐỒ
   ========================================================================== */
.camera-region-bar {
  position: absolute;
  top: 1rem;
  left: 1rem;
  z-index: 22;
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  padding: 0.28rem;
  background: var(--bg-surface);
  border: 1px solid var(--border-gold-strong);
  border-radius: 999px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.5);
}

.cam-pill {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-body);
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.38rem 0.78rem;
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.cam-pill:hover {
  color: var(--text-primary);
}

.cam-pill.active {
  background: var(--gold-main);
  color: #1a110b;
}

[data-theme="tinh-thuy"] .cam-pill.active {
  color: #ffffff;
}

/* ==========================================================================
   LIÊN HOA BẢO ẢNH ĐÀI (THẺ ĐA ẢNH TỰ CHẠY & BIẾN ẢO PHONG CÁCH PHẬT GIÁO)
   Khóa cứng kích thước ngoài (contain: content) để không bao giờ gây lỗi nhảy khung
   ========================================================================== */
.floating-preview-card {
  position: absolute;
  top: 1rem;
  right: 1rem;
  z-index: 25;
  width: 300px;
  background: var(--bg-surface);
  border: 1.5px solid var(--border-gold-strong);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.62), 0 0 22px rgba(212, 175, 55, 0.18);
  cursor: pointer;
  contain: content;
}

.floating-preview-card[hidden] {
  display: none;
}

/* Tầng 1: Sân khấu Huyễn Ảnh Tự Chạy (2 lớp Crossfade + Ken Burns + Hào quang Kim Liên) */
.fp-morph-stage {
  position: relative;
  width: 300px;
  height: 176px;
  background: #120b06;
  overflow: hidden;
  cursor: pointer;
}

.fp-morph-layer {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.08);
  transition:
    opacity 0.95s cubic-bezier(0.22, 1, 0.36, 1),
    transform 3.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.fp-morph-layer.is-visible {
  opacity: 1;
  transform: scale(1);
}

/* Luồng Hào Quang Pháp Luân lóe sáng dịu khi biến đổi sang ảnh mới */
.fp-dharma-sweep {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(255, 229, 143, 0.42) 0%, rgba(212, 175, 55, 0.15) 45%, transparent 72%);
  opacity: 0;
  transition: opacity 0.45s ease;
}

.fp-dharma-sweep.is-pulsing {
  opacity: 1;
}

.fp-lotus-mandala {
  width: 84px;
  height: 84px;
  color: #fff3c4;
  transform: scale(0.75) rotate(0deg);
  transition: transform 0.85s cubic-bezier(0.22, 1, 0.36, 1);
}

.fp-dharma-sweep.is-pulsing .fp-lotus-mandala {
  transform: scale(1.18) rotate(45deg);
}

/* Hạt sáng Hoa đăng bay nhẹ trong khung ảnh */
.fp-lantern-sparks {
  position: absolute;
  inset: 0;
  pointer-events: none;
  overflow: hidden;
}

.fp-lantern-sparks span {
  position: absolute;
  bottom: -8px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #ffe58f;
  box-shadow: 0 0 8px #ffdf7e;
  opacity: 0;
  animation: floatLantern 4.8s ease-in-out infinite;
}

.fp-lantern-sparks span:nth-child(1) { left: 18%; animation-delay: 0s; }
.fp-lantern-sparks span:nth-child(2) { left: 46%; animation-delay: 1.2s; }
.fp-lantern-sparks span:nth-child(3) { left: 72%; animation-delay: 2.5s; }
.fp-lantern-sparks span:nth-child(4) { left: 86%; animation-delay: 3.6s; }

@keyframes floatLantern {
  0%   { transform: translateY(0) scale(0.6); opacity: 0; }
  30%  { opacity: 0.75; }
  80%  { opacity: 0.45; }
  100% { transform: translateY(-150px) scale(1.1); opacity: 0; }
}

/* Tầng 2: Lưới 4 Ảnh Nhỏ Tĩnh Tại (Đã bỏ dòng chữ & thanh chạy ngang) */
.fp-thumbs-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 6px 8px;
  background: rgba(14, 8, 4, 0.65);
  border-top: 1px solid var(--border-gold);
  border-bottom: 1px solid var(--border-gold);
}

.fp-mini-thumb {
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  background: #140c06;
  cursor: pointer;
  opacity: 0.72;
  transition: opacity 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.fp-mini-thumb:hover,
.fp-mini-thumb.is-current {
  opacity: 1;
  border-color: #fff3c4;
  transform: scale(1.04);
}

.fp-mini-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Tầng 3: Thông tin Tỉnh */
.fp-body {
  padding: 0.65rem 0.85rem 0.72rem;
}

.fp-body h3 {
  font-family: var(--font-display);
  font-size: 1.22rem;
  font-weight: 700;
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0.12rem;
}

.fp-body p {
  font-size: 0.73rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 0;
}

/* Nút Zoom góc dưới phải */
.map-zoom-controls {
  position: absolute;
  bottom: 1.15rem;
  right: 1.15rem;
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  z-index: 20;
}

.zoom-btn {
  width: 36px;
  height: 36px;
  border-radius: 9px;
  border: 1px solid var(--border-gold);
  background: var(--bg-surface);
  color: var(--gold-bright);
  font-size: 1.05rem;
  font-weight: 600;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.zoom-btn:hover {
  border-color: var(--gold-bright);
  background: var(--bg-elevated);
}

/* ==========================================================================
   DIALOG TRIỂN LÃM 60 HÌNH ẢNH (NATIVE <DIALOG>)
   ========================================================================== */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  overflow: hidden;
  overscroll-behavior: contain;
}

#exhibition-dialog {
  margin: auto;
  width: min(95vw, 1340px);
  max-width: min(95vw, 1340px);
  height: min(91dvh, 900px);
  max-height: min(91dvh, 900px);
  border: 1.5px solid var(--border-gold-strong);
  border-radius: 18px;
  background: var(--bg-surface);
  color: var(--text-primary);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.8);
  padding: 0;
  overflow: hidden;

  opacity: 0;
  transform: scale(0.96);
  transition-property: opacity, transform, display, overlay;
  transition-duration: 0.22s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

#exhibition-dialog::backdrop {
  background-color: rgb(10 6 3 / 0);
  transition-property: background-color, display, overlay;
  transition-duration: 0.22s;
  transition-timing-function: ease-out;
  transition-behavior: allow-discrete;
}

:is(#exhibition-dialog[open]):where(:not([data-closing])) {
  display: flex;
  flex-direction: column;
  opacity: 1;
  transform: scale(1);

  @starting-style {
    opacity: 0;
    transform: scale(0.96);
  }

  &::backdrop {
    background-color: rgb(10 6 3 / 0.8);

    @starting-style {
      background-color: rgb(10 6 3 / 0);
    }
  }
}

.exhibition-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.9rem 1.35rem;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border-gold);
}

.exhibition-title-group {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-width: 0;
}

.lotus-crest {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--gold-main);
  display: grid;
  place-items: center;
  color: var(--gold-bright);
  font-size: 1.2rem;
  flex-shrink: 0;
}

.exhibition-title-text {
  min-width: 0;
}

.exhibition-title-text h2 {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 2vw, 1.7rem);
  color: var(--gold-bright);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.exhibition-title-text p {
  font-size: 0.78rem;
  color: var(--text-secondary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.dialog-close-btn {
  appearance: none;
  border: 1px solid var(--border-gold-strong);
  background: var(--crimson);
  color: #fff;
  padding: 0.42rem 0.85rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 600;
  cursor: pointer;
  flex-shrink: 0;
}

.exhibition-toolbar {
  padding: 0.6rem 1.35rem;
  border-bottom: 1px solid var(--border-gold);
  background: var(--bg-primary);
}

.category-tabs {
  display: flex;
  gap: 0.4rem;
  overflow-x: auto;
  scrollbar-width: none;
}

.cat-tab {
  appearance: none;
  border: 1px solid var(--border-gold);
  background: transparent;
  color: var(--text-secondary);
  padding: 0.36rem 0.8rem;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 0.76rem;
  cursor: pointer;
  white-space: nowrap;
}

.cat-tab.active {
  background: var(--gold-main);
  color: #1a110b;
  font-weight: 600;
}

[data-theme="tinh-thuy"] .cat-tab.active {
  color: #fff;
}

.exhibition-gallery-scroll {
  flex: 1;
  overflow-y: auto;
  padding: 1.1rem 1.35rem;
}

.buddhist-photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 0.9rem;
}

.dharma-photo-card {
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--border-gold);
  background: var(--bg-primary);
  display: flex;
  flex-direction: column;
  cursor: pointer;
  content-visibility: auto;
  contain-intrinsic-size: 240px;
}

.dharma-photo-card:hover {
  border-color: var(--gold-bright);
}

.photo-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #140c06;
  overflow: hidden;
}

.photo-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-index-badge {
  position: absolute;
  top: 0.4rem;
  right: 0.4rem;
  background: rgba(15, 9, 4, 0.82);
  color: var(--gold-bright);
  font-size: 0.64rem;
  font-weight: 600;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
}

.photo-cat-pill {
  position: absolute;
  top: 0.4rem;
  left: 0.4rem;
  background: rgba(140, 35, 24, 0.88);
  color: #fff6e0;
  font-size: 0.62rem;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
}

.photo-info {
  padding: 0.55rem 0.7rem;
}

.photo-info h4 {
  font-family: var(--font-display);
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.25;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.lightbox-overlay {
  position: absolute;
  inset: 0;
  z-index: 40;
  background: rgba(10, 6, 3, 0.95);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox-overlay[hidden] {
  display: none;
}

.lightbox-stage {
  max-width: min(92vw, 980px);
  max-height: 72dvh;
  border: 1.5px solid var(--gold-main);
  border-radius: 10px;
  overflow: hidden;
  background: #0d0704;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 70dvh;
  display: block;
  object-fit: contain;
}

.lightbox-caption-bar {
  margin-top: 0.75rem;
  text-align: center;
  max-width: 680px;
}

.lightbox-caption-bar h3 {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--gold-bright);
}

.lightbox-caption-bar p {
  font-size: 0.8rem;
  color: var(--text-secondary);
}

.lightbox-nav-row {
  display: flex;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 0.65rem;
  flex-wrap: wrap;
}

.nav-pill {
  border: 1px solid var(--border-gold);
  background: var(--bg-elevated);
  color: var(--text-primary);
  padding: 0.38rem 0.75rem;
  border-radius: 999px;
  font-size: 0.76rem;
  cursor: pointer;
}

@media (prefers-reduced-motion: reduce) {
  #exhibition-dialog {
    transform: none;
    transition-duration: 0.1s;
  }

  @starting-style {
    #exhibition-dialog[open] {
      transform: none;
    }
  }

  .fp-filmstrip-track,
  .fp-lantern-sparks span {
    animation: none;
  }
}

/* ==========================================================================
   TỐI ƯU MOBILE (KHÔNG ĐÈ HEADER, KHÔNG CHE ĐẦU BẮC & MŨI CÀ MAU)
   ========================================================================== */
@media (max-width: 768px) {
  .site-header {
    height: 48px;
    padding: 0 0.55rem;
    gap: 0.35rem;
  }

  .header-left {
    gap: 0.4rem;
    min-width: 0;
    flex: 1;
  }

  .btn-label {
    display: none;
  }

  .icon-pill-btn {
    width: 32px;
    height: 32px;
    padding: 0;
    justify-content: center;
    flex-shrink: 0;
  }

  .brand-group {
    gap: 0.3rem;
    min-width: 0;
    flex: 1;
  }

  .brand-group .lotus-svg-icon {
    width: 17px;
    height: 17px;
  }

  .brand-title {
    font-size: clamp(0.76rem, 3.5vw, 0.96rem);
    letter-spacing: 0.02em;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .header-icons {
    gap: 0.35rem;
    flex-shrink: 0;
  }

  .icon-circle-btn {
    width: 32px;
    height: 32px;
    font-size: 0.85rem;
  }

  .map-viewport {
    height: calc(100dvh - 48px);
  }

  /* Chừa khoảng đệm trên (cho thanh 3 miền) & dưới (cho thẻ tỉnh thành) để bản đồ hiển thị trọn vẹn 100% từ Cao Bằng tới Cà Mau */
  .map-canvas-wrapper {
    padding: 46px 6px 90px;
  }

  .camera-region-bar {
    top: 0.45rem;
    left: 50%;
    transform: translateX(-50%);
    padding: 0.2rem;
    max-width: calc(100vw - 1rem);
  }

  .cam-pill {
    font-size: 0.68rem;
    padding: 0.28rem 0.56rem;
  }

  /* Trên Mobile: Thanh Bottom Bar gọn dưới đáy, ảnh bên trái tự chạy biến ảo */
  .floating-preview-card {
    top: auto;
    bottom: 0.55rem;
    left: 0.6rem;
    right: 3.4rem;
    width: auto;
    display: flex;
    align-items: center;
    height: 74px;
    border-radius: 12px;
  }

  .fp-morph-stage {
    width: 88px;
    height: 74px;
    flex-shrink: 0;
  }

  .fp-thumbs-row {
    display: none;
  }

  .fp-body {
    flex: 1;
    min-width: 0;
    padding: 0.4rem 0.65rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  .fp-body h3 {
    font-size: 0.98rem;
  }

  .fp-body p {
    font-size: 0.7rem;
  }

  .map-zoom-controls {
    bottom: 0.55rem;
    right: 0.55rem;
    gap: 0.25rem;
  }

  .zoom-btn {
    width: 32px;
    height: 32px;
    font-size: 0.95rem;
  }

  #exhibition-dialog {
    width: 100%;
    max-width: 100%;
    height: 92dvh;
    max-height: 92dvh;
    margin: auto 0 0 0;
    inset: auto 0 0 0;
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
  }

  .exhibition-header {
    padding: 0.75rem 0.85rem;
  }

  .exhibition-toolbar {
    padding: 0.5rem 0.85rem;
  }

  .exhibition-gallery-scroll {
    padding: 0.8rem 0.85rem;
  }

  .buddhist-photo-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.6rem;
  }
}
