* {
  box-sizing: border-box;
}

:root {
  --page-bg-tint: rgba(198, 216, 232, 0.9);
  --page-bg-deep: rgba(127, 162, 194, 0.86);
  --page-panel-bg: rgba(242, 247, 251, 0.74);
  --page-panel-border: rgba(92, 127, 158, 0.16);
  --page-text: #1e3651;
  --page-subtle: #57718d;
  --page-accent: #3f79ab;
  --page-accent-strong: #2c5f8d;
  --page-shadow: rgba(40, 73, 104, 0.18);
}

body {
  margin: 0;
  font-family: "Pretendard", "Noto Sans KR", sans-serif;
  background:
    radial-gradient(circle at top, rgba(255, 255, 255, 0.26), transparent 34%),
    linear-gradient(var(--page-bg-tint), var(--page-bg-deep)),
    url("img/bg-texture-placeholder.svg") center top / cover no-repeat;
  color: var(--page-text);
}

body.page-transition-shell {
  animation: pageFadeIn 0.38s cubic-bezier(0.22, 1, 0.36, 1) both;
}

body.page-transition-shell.is-page-leaving {
  animation: pageFadeOut 0.28s cubic-bezier(0.4, 0, 0.2, 1) both;
}

body.theme-home {
  --page-bg-tint: rgba(201, 218, 233, 0.92);
  --page-bg-deep: rgba(138, 170, 198, 0.9);
  --page-panel-bg: rgba(241, 247, 252, 0.72);
  --page-panel-border: rgba(100, 131, 161, 0.18);
  --page-text: #1f3750;
  --page-subtle: #5b7390;
  --page-accent: #467cab;
  --page-accent-strong: #2f5f8a;
  --page-shadow: rgba(45, 77, 106, 0.18);
}

body.theme-north {
  --page-bg-tint: rgba(203, 218, 235, 0.92);
  --page-bg-deep: rgba(124, 150, 196, 0.9);
  --page-panel-bg: rgba(240, 246, 252, 0.78);
  --page-panel-border: rgba(87, 117, 162, 0.18);
  --page-text: #213a58;
  --page-subtle: #5f7695;
  --page-accent: #547fc0;
  --page-accent-strong: #355f97;
  --page-shadow: rgba(47, 77, 116, 0.2);
}

body.theme-east {
  --page-bg-tint: rgba(196, 223, 232, 0.92);
  --page-bg-deep: rgba(109, 165, 186, 0.9);
  --page-panel-bg: rgba(238, 248, 250, 0.78);
  --page-panel-border: rgba(76, 133, 151, 0.18);
  --page-text: #1f3f4f;
  --page-subtle: #567685;
  --page-accent: #4f91a8;
  --page-accent-strong: #327085;
  --page-shadow: rgba(39, 88, 104, 0.2);
}

body.theme-central {
  --page-bg-tint: rgba(190, 208, 225, 0.92);
  --page-bg-deep: rgba(66, 104, 142, 0.9);
  --page-panel-bg: rgba(236, 243, 249, 0.8);
  --page-panel-border: rgba(52, 87, 122, 0.2);
  --page-text: #1b3148;
  --page-subtle: #556f89;
  --page-accent: #2d6f9d;
  --page-accent-strong: #184b71;
  --page-shadow: rgba(30, 58, 87, 0.22);
}

body.theme-south {
  --page-bg-tint: rgba(208, 216, 228, 0.92);
  --page-bg-deep: rgba(102, 125, 158, 0.9);
  --page-panel-bg: rgba(242, 245, 250, 0.8);
  --page-panel-border: rgba(86, 102, 132, 0.2);
  --page-text: #24364c;
  --page-subtle: #66778c;
  --page-accent: #607b9b;
  --page-accent-strong: #425a78;
  --page-shadow: rgba(49, 64, 84, 0.22);
}

body.theme-west {
  --page-bg-tint: rgba(205, 210, 234, 0.92);
  --page-bg-deep: rgba(98, 112, 170, 0.9);
  --page-panel-bg: rgba(242, 244, 251, 0.8);
  --page-panel-border: rgba(86, 93, 156, 0.2);
  --page-text: #273254;
  --page-subtle: #677195;
  --page-accent: #5f70ba;
  --page-accent-strong: #405095;
  --page-shadow: rgba(52, 58, 108, 0.22);
}

.layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  max-width: 900px;
  margin: 0 auto;
  padding: 24px 20px 56px;
}

.landing-board {
  width: 100%;
  max-width: 800px;
  padding: 32px 24px 28px;
  text-align: center;
  border-radius: 32px;
  background: var(--page-panel-bg);
  border: 1px solid var(--page-panel-border);
  box-shadow: 0 28px 60px var(--page-shadow);
  backdrop-filter: blur(10px);
}

.landing-kicker {
  margin: 0 0 16px;
  color: var(--page-subtle);
  font-size: clamp(16px, 2.2vw, 20px);
  font-weight: 700;
  line-height: 1.5;
}

.title-graphic-wrap {
  display: flex;
  justify-content: center;
  width: min(100%, 620px);
  margin: 0 auto 18px;
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
  box-shadow: none;
}

.title-graphic {
  display: block;
  width: min(100%, 500px);
  height: auto;
}

.landing-subcopy {
  min-height: 52px;
  max-width: 620px;
  margin: 0 auto 18px;
  color: var(--page-subtle);
  font-size: 17px;
  line-height: 1.8;
}

.landing-subcopy:empty::before {
  content: "부연 설명 자리";
  color: color-mix(in srgb, var(--page-subtle) 68%, white);
}

.map-section {
  width: 100%;
  padding: 0;
  text-align: center;
  background: transparent;
  border: none;
  border-radius: 0;
  box-shadow: none;
}

.map-frame {
  position: relative;
  width: 100%;
  max-width: 650px;
  margin: 0 auto;
  padding: 8px 0 0;
}

.map-frame svg {
  display: block;
  width: 100%;
  height: auto;
}

#base_map {
  pointer-events: none;
}

.map-static-layer {
  pointer-events: none;
}

.map-layer {
  transform-box: fill-box;
  transform-origin: center;
  pointer-events: none;
  transition:
    transform 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    filter 0.36s cubic-bezier(0.22, 1, 0.36, 1),
    opacity 0.28s ease;
  will-change: transform, filter;
}

.map-layer.is-hovered,
.map-layer.is-selected {
  transform: scale(1.025);
  filter: brightness(1.05);
}

body.sample-preview .map-layer.is-hovered,
body.sample-preview .map-layer.is-selected {
  transform: scale(1.04);
  filter: brightness(1.12) saturate(1.08);
}

.map-hit {
  cursor: pointer;
  pointer-events: auto;
  transition: opacity 0.28s ease;
}

.map-hit path {
  fill: transparent !important;
  pointer-events: all;
}

.map-hit:hover,
.map-hit:focus-visible,
.map-hit.is-selected {
  opacity: 0.4;
}

.map-layer.is-sample-disabled {
  opacity: 0.42;
  filter: grayscale(0.08);
}

.map-hit-disabled {
  cursor: default;
  pointer-events: none;
}

body.sample-preview .map-layer.is-previewing {
  transform: scale(1.055);
  filter: brightness(1.16) saturate(1.12);
}

body.sample-preview .map-hit:hover,
body.sample-preview .map-hit:focus-visible,
body.sample-preview .map-hit.is-selected {
  opacity: 0.55;
}

.map-hit:focus-visible {
  outline: none;
}

.sponsor-strip {
  margin-top: 8px;
  text-align: center;
}

.sponsor-label {
  margin: 0 0 12px;
  color: var(--page-subtle);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
}

.sponsor-logos {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
}

.sponsor-logo {
  display: block;
  width: min(100%, 220px);
  height: auto;
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(27, 44, 66, 0.42);
  backdrop-filter: blur(6px);
  z-index: 30;
}

.region-modal {
  position: fixed;
  top: 50%;
  left: 50%;
  width: min(92vw, 460px);
  max-height: min(86vh, 720px);
  overflow-y: auto;
  padding: 28px;
  border-radius: 28px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.98) 0%, rgba(235, 244, 251, 0.96) 100%);
  border: 1px solid rgba(89, 119, 149, 0.16);
  box-shadow: 0 28px 70px rgba(31, 53, 79, 0.2);
  transform: translate(-50%, -50%);
  text-align: center;
  z-index: 40;
}

.modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: 999px;
  background: #e8f1fb;
  color: #24415f;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.modal-label {
  margin: 0 0 8px;
  color: #5d7186;
  font-size: 14px;
}

.region-modal h2 {
  margin: 0 0 10px;
  font-size: 32px;
}

.modal-text {
  margin: 0 0 22px;
  color: #52667e;
  line-height: 1.6;
}

.modal-text-region-list {
  text-align: center;
  white-space: normal;
  overflow-wrap: anywhere;
  word-break: keep-all;
}

.modal-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  width: 100%;
}

.modal-action-button {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 112px;
  padding: 20px 16px;
  border: none;
  border-radius: 22px;
  background: linear-gradient(180deg, var(--page-accent) 0%, var(--page-accent-strong) 100%);
  color: #ffffff;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  box-shadow: 0 14px 28px color-mix(in srgb, var(--page-accent-strong) 28%, transparent);
  transition: transform 0.2s ease, box-shadow 0.2s ease, filter 0.2s ease;
}

.modal-action-button.secondary {
  background: linear-gradient(180deg, #6f8fa7 0%, #4f6c82 100%);
  box-shadow: 0 14px 28px rgba(79, 108, 130, 0.22);
}

.modal-action-button:hover {
  transform: translateY(-2px);
  filter: brightness(1.03);
}

.modal-action-button[disabled],
.modal-action-button[aria-disabled="true"] {
  opacity: 0.58;
  cursor: not-allowed;
  filter: grayscale(0.08);
  box-shadow: none;
}

.modal-action-button[disabled]:hover,
.modal-action-button[aria-disabled="true"]:hover {
  transform: none;
  filter: grayscale(0.08);
}

.detail-page {
  max-width: 960px;
  margin: 0 auto;
  padding: 32px 24px 48px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: left;
}

.detail-page h1 {
  width: 100%;
  max-width: 760px;
  margin: 8px 0 0;
  color: var(--page-text);
  text-align: left;
}

.detail-nav {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
  width: 100%;
  max-width: 760px;
  margin-bottom: 20px;
}

.detail-nav-link,
.detail-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid color-mix(in srgb, var(--page-accent) 18%, transparent);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.84);
  color: var(--page-accent-strong);
  text-decoration: none;
  font-weight: 700;
  font-size: 15px;
  cursor: pointer;
}

.detail-nav-button {
  font-family: inherit;
}

.detail-nav-link:hover,
.detail-nav-button:hover {
  background: rgba(255, 255, 255, 0.96);
}

.detail-image {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: min(75vh, 900px);
  border: none;
  border-radius: 0;
  background: transparent;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  cursor: zoom-in;
}

.gallery {
  max-width: 760px;
  width: 100%;
  margin-top: 20px;
}

.gallery-viewport {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  touch-action: pan-y;
  background: rgba(255, 255, 255, 0.36);
  box-shadow: 0 18px 36px var(--page-shadow);
}

.gallery-track {
  display: flex;
  align-items: flex-start;
  transition: transform 0.35s ease;
  will-change: transform;
}

.gallery-slide {
  flex: 0 0 100%;
  min-width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  margin: 0;
}

.gallery-button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.88);
  color: var(--page-accent-strong);
  font-size: 24px;
  cursor: pointer;
  box-shadow: 0 8px 18px var(--page-shadow);
}

.gallery-button:hover {
  background: #ffffff;
}

.gallery-button.prev {
  left: 14px;
}

.gallery-button.next {
  right: 14px;
}

.gallery-footer {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 16px;
  margin-top: 14px;
}

.gallery-dots {
  display: flex;
  justify-content: center;
  width: 100%;
  gap: 8px;
}

.gallery-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: none;
  border-radius: 999px;
  background: color-mix(in srgb, var(--page-accent) 24%, white);
  cursor: pointer;
}

.gallery-dot.is-active {
  background: var(--page-accent-strong);
}

.image-lightbox {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(11, 21, 34, 0.88);
  backdrop-filter: blur(10px);
  z-index: 120;
}

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

.image-lightbox-close {
  position: absolute;
  top: 18px;
  right: 18px;
  width: 48px;
  height: 48px;
  border: none;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: #ffffff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
}

.image-lightbox-image {
  display: block;
  max-width: min(92vw, 1400px);
  max-height: 88vh;
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.3);
}

body.is-lightbox-open {
  overflow: hidden;
}

@keyframes pageFadeIn {
  from {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }

  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes pageFadeOut {
  from {
    opacity: 1;
    transform: translateY(0) scale(1);
  }

  to {
    opacity: 0;
    transform: translateY(18px) scale(0.985);
  }
}

@media (max-width: 1024px) {
  .layout {
    max-width: 820px;
    padding: 20px 18px 48px;
  }

  .landing-board {
    max-width: 760px;
    padding: 28px 20px 24px;
    border-radius: 28px;
  }

  .title-graphic {
    width: min(100%, 500px);
  }

  .map-frame {
    max-width: 600px;
  }
}

@media (max-width: 900px) {
  .layout {
    padding: 18px 16px 44px;
  }

  .landing-board {
    padding: 24px 16px 22px;
    border-radius: 24px;
  }

  .landing-kicker {
    margin-bottom: 12px;
    font-size: 15px;
  }

  .title-graphic-wrap {
    width: min(100%, 560px);
    margin-bottom: 14px;
    padding: 0;
    border-radius: 0;
  }

  .title-graphic {
    width: min(100%, 440px);
  }

  .landing-subcopy {
    min-height: 44px;
    margin-bottom: 14px;
    font-size: 15px;
    line-height: 1.7;
  }

  .map-frame {
    max-width: 100%;
    padding-top: 2px;
  }

  .map-layer.is-hovered,
  .map-layer.is-selected {
    transform: scale(1.02);
  }

  .sponsor-strip {
    margin-top: 2px;
  }

  .sponsor-logo {
    width: min(100%, 180px);
  }

  .region-modal {
    width: min(94vw, 420px);
    padding: 24px 20px 20px;
    border-radius: 24px;
  }

  .modal-actions {
    grid-template-columns: 1fr;
  }

  .region-modal h2 {
    font-size: 28px;
  }

  .modal-action-button {
    min-height: 82px;
    font-size: 18px;
  }

  .detail-page {
    padding: 28px 16px 40px;
  }

  .detail-nav {
    justify-content: flex-start;
  }

  .gallery {
    margin-top: 16px;
  }

  .gallery-button {
    width: 42px;
    height: 42px;
  }

  .gallery-footer {
    flex-direction: column;
    align-items: flex-start;
  }

  .sponsor-logos {
    gap: 12px;
  }
}

@media (max-width: 640px) {
  body {
    background-attachment: scroll;
    background-size: auto, cover;
  }

  .layout {
    padding: 14px 12px 36px;
  }

  .landing-board {
    padding: 18px 12px 18px;
    border-radius: 20px;
  }

  .landing-kicker {
    font-size: 14px;
    line-height: 1.4;
  }

  .title-graphic {
    width: 100%;
    max-width: 360px;
  }

  .landing-subcopy {
    min-height: 38px;
    font-size: 14px;
  }

  .sponsor-label {
    margin-bottom: 10px;
    font-size: 12px;
  }

  .sponsor-logos {
    flex-direction: column;
    gap: 10px;
  }

  .sponsor-logo {
    width: min(100%, 210px);
  }

  .region-modal {
    width: calc(100vw - 20px);
    max-height: 82vh;
    padding: 18px 14px 16px;
    border-radius: 20px;
  }

  .modal-close {
    top: 10px;
    right: 10px;
    width: 38px;
    height: 38px;
    font-size: 22px;
  }

  .modal-label {
    font-size: 12px;
  }

  .region-modal h2 {
    font-size: 24px;
  }

  .modal-text {
    margin-bottom: 16px;
    font-size: 14px;
  }

  .modal-actions {
    gap: 10px;
  }

  .modal-action-button {
    min-height: 70px;
    padding: 16px 12px;
    border-radius: 18px;
    font-size: 16px;
  }

  .detail-page {
    padding: 22px 12px 32px;
  }

  .detail-nav {
    gap: 10px;
    margin-bottom: 16px;
    justify-content: flex-start;
  }

  .detail-nav-link,
  .detail-nav-button {
    flex: 1 1 180px;
    font-size: 14px;
  }

  .gallery-viewport {
    border-radius: 18px;
  }

  .gallery-button {
    width: 38px;
    height: 38px;
    font-size: 20px;
  }

  .gallery-button.prev {
    left: 8px;
  }

  .gallery-button.next {
    right: 8px;
  }

  .gallery-help {
    font-size: 13px;
  }

}
