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

:root {
  /* 좌(map-stack)·우(panel) 공통 흰 막 — 낮을수록 배경이 더 비침 */
  --ui-column-alpha: 0;
  --ui-banner-alpha: 0;
  --ui-hover-card-alpha: 0;
  --font-detail: 'AppleSDGothicNeoEB00', 'Apple SD Gothic Neo', 'Malgun Gothic',
    sans-serif;
}

@font-face {
  font-family: 'AppleSDGothicNeoEB00';
  src: url('./assets/fonts/AppleSDGothicNeoEB00.ttf') format('truetype');
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

html {
  height: 100%;
  overflow: hidden;
  background-color: #fff;
  background-image: url('./assets/Background.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
  background-attachment: fixed;
}

body {
  margin: 0;
  height: 100%;
  overflow: hidden;
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
  color: #1a1a1a;
  background: transparent;
}

.page-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-color: #fff;
  background-image: url('./assets/Background.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center bottom;
}

.hidden {
  display: none !important;
}

.app {
  position: relative;
  z-index: 1;
  display: flex;
  height: 100%;
  max-height: 100%;
  overflow: hidden;
  gap: 0;
  background: transparent;
}

.map-stack {
  /* 상세 열림 시 map·detail 1:1 분할과 동일한 지도 슬롯 높이 */
  --map-slot-h: 50vh;
  flex: 0 1 auto;
  align-self: stretch;
  min-width: 0;
  min-height: 0;
  max-height: 100%;
  width: min(
    calc(
      var(--map-slot-h) * var(--map-aspect-w, 1190) /
        var(--map-aspect-h, 840)
    ),
    min(920px, 62vw),
    100%
  );
  max-width: min(920px, 62vw);
  display: flex;
  flex-direction: column;
  border-right: 1px solid #e0e0e0;
  background: rgba(255, 255, 255, var(--ui-column-alpha));
}

.map-stack--detail-open {
  flex: 0 1 auto;
  min-height: 0;
  max-height: 100%;
}

.map-shell {
  position: relative;
  flex: 0 0 var(--map-slot-h);
  box-sizing: border-box;
  width: 100%;
  height: var(--map-slot-h);
  min-height: 220px;
  padding: 10px;
  background: transparent;
  --face-overlay-opacity: 0.88;
  --face-overlay-width: 52%;
  --face-overlay-top: 50%;
  --face-overlay-left: 50%;
  --face-overlay-translate-x: -50%;
  --face-overlay-translate-y: -50%;
}

.map {
  box-sizing: border-box;
  width: 100%;
  height: 100%;
  background: transparent;
}

.map .leaflet-container {
  background: rgba(255, 255, 255, var(--ui-column-alpha));
}

.map-reveal-markers {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 1100;
  padding: 0.35rem 0.55rem;
  border: 1px solid #0952a5;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: #0952a5;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.map-reveal-markers:hover:not(:disabled) {
  background: #0952a5;
  color: #fff;
}

.map-reveal-markers:disabled {
  opacity: 0.55;
  cursor: default;
}

body.app-phone-viewer-open {
  overflow: hidden;
}

.app-phone-viewer {
  position: fixed;
  inset: 0;
  z-index: 2500;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: auto;
}

.app-phone-viewer__backdrop {
  position: absolute;
  inset: 0;
  padding: 0;
  border: none;
  background: rgba(12, 18, 28, 0.62);
  cursor: pointer;
}

.app-phone-viewer__phone {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  width: min(402px, 92vw);
  max-height: min(874px, 88vh);
  aspect-ratio: 402 / 874;
  border-radius: 2.75rem;
  overflow: hidden;
  background: #0a0a0a;
  box-shadow:
    0 0 0 2px rgba(255, 255, 255, 0.12),
    0 24px 64px rgba(0, 0, 0, 0.45);
  touch-action: none;
  cursor: grab;
}

.app-phone-viewer__phone:active {
  cursor: grabbing;
}

.app-phone-viewer__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

.map-face-toggle {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 1100;
  padding: 0.35rem 0.55rem;
  border: 1px solid #ccc;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.92);
  font: inherit;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: lowercase;
  color: #333;
  cursor: pointer;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
}

.map-face-toggle:hover {
  border-color: #ee252b;
  color: #ee252b;
}

.map-face-toggle--active {
  border-color: #2563eb;
  color: #2563eb;
  background: #fff;
}

.map-face-overlay {
  position: absolute;
  z-index: 800;
  pointer-events: none;
  object-fit: contain;
  opacity: var(--face-overlay-opacity);
  width: var(--face-overlay-width);
  top: var(--face-overlay-top);
  left: var(--face-overlay-left);
  transform: translate(
    var(--face-overlay-translate-x),
    var(--face-overlay-translate-y)
  );
}

.panel {
  flex: 1 1 378px;
  width: 378px;
  min-width: 378px;
  min-height: 0;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  padding: 3px;
  background: rgba(255, 255, 255, var(--ui-column-alpha));
  overflow: hidden;
}

.error-banner {
  padding: 0.75rem 1rem;
  background: #fde8e8;
  color: #9b1c1c;
  font-size: 0.875rem;
  flex-shrink: 0;
}

.banner-bar {
  box-sizing: border-box;
  width: 100%;
  height: auto;
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 0.25rem;
  padding: 0.35rem 0;
  border-bottom: 1px solid #eee;
  background: rgba(255, 255, 255, var(--ui-banner-alpha));
}

.banner-bar__title {
  margin: 0;
  line-height: 0;
}

.banner-bar__logo {
  display: block;
  width: 372px;
  height: 60px;
}

.banner-bar__nav {
  box-sizing: border-box;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  width: 372px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.banner-bar__link {
  font-family: 'Jersey 10', sans-serif;
  font-size: 20px;
  font-weight: 400;
  color: #333;
  padding: 0 15px;
  text-decoration: none;
  text-transform: lowercase;
}

.banner-bar__link:hover {
  color: #0952a5;
}

.banner-bar__link--active {
  color: #0952a5;
}

.banner-bar__title a {
  display: block;
  line-height: 0;
}

.photo-scroller-chrome {
  position: relative;
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

.photo-list-scroller {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

/* 아래로 더 스크롤 가능할 때 뷰포트 하단을 어둡게 페이드 */
.photo-list-scroller--scroll-fade {
  box-shadow: inset 0 -2.75rem 2rem -0.75rem rgba(9, 82, 165, 0.22);
}

.photo-scroller-chrome--scroll-fade::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 4.75rem;
  pointer-events: none;
  z-index: 2;
  background: linear-gradient(
    to top,
    rgba(255, 255, 255, 0.98) 0%,
    rgba(255, 255, 255, 0.82) 42%,
    rgba(9, 82, 165, 0.14) 68%,
    rgba(255, 255, 255, 0) 100%
  );
}

.photo-scroll-hint {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.65rem;
  z-index: 3;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.15rem;
  pointer-events: none;
  font-family: 'Jersey 10', sans-serif;
  font-size: 18px;
  font-weight: 400;
  color: #333;
  text-transform: lowercase;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.photo-scroll-hint--dismissed {
  opacity: 0;
}

.photo-scroll-hint__chevron {
  display: block;
  font-size: 1.15rem;
  line-height: 1;
  color: #0952a5;
  animation: photo-scroll-hint-bob 1.6s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .photo-scroll-hint__chevron {
    animation: none;
  }
}

@keyframes photo-scroll-hint-bob {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(4px);
  }
}

.photo-list-scroller::-webkit-scrollbar {
  display: none;
}

.photo-scatter-stage {
  position: relative;
}

.photo-list {
  list-style: none;
  margin: 0;
  padding: 0;
  position: sticky;
  top: 0;
  z-index: 1;
  width: 100%;
  overflow: visible;
}

.photo-scatter-spacer {
  width: 100%;
  pointer-events: none;
}

.photo-scatter-item {
  position: absolute;
  margin: 0;
  transform: translate(-50%, -50%) scale(0.65);
  z-index: 1;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.18s ease;
}

.photo-scatter-item--revealed {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
  pointer-events: auto;
}

.photo-scatter-item--map-out {
  display: none;
}

.photo-scatter-item--emphasis {
  z-index: 3;
}

.photo-card {
  display: flex;
  width: 100%;
  gap: 0.65rem;
  padding: 0.5rem;
  border-radius: 8px;
  cursor: pointer;
  border: 2px solid transparent;
  transition: background 0.15s ease;
  font: inherit;
  text-align: left;
  background: transparent;
  color: inherit;
}

.marker-icon-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
}

.photo-card--scatter {
  position: relative;
  display: block;
  padding: 0;
  border: none;
  background: transparent;
  overflow: visible;
}

.photo-card--scatter:hover {
  background: transparent;
}

.photo-card--hovered {
  z-index: 2;
}

.photo-card--selected .photo-card-thumb {
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
}

.photo-card-hover-detail {
  display: none;
  position: absolute;
  right: calc(100% - 1px);
  top: 0;
  box-sizing: border-box;
  width: max-content;
  max-width: min(280px, 42vw);
  padding: 4px 10px;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  background: rgba(255, 255, 255);
  border: 2px solid #2563eb;
  border-right: none;
  border-radius: 8px 0 0 8px;
  text-align: left;
  overflow: hidden;
  pointer-events: none;
  z-index: 0;
}

.photo-card--show-detail .photo-card-hover-detail {
  display: flex;
}

.photo-card--detail-flip-right .photo-card-hover-detail {
  right: auto;
  left: calc(100% - 1px);
  border-right: 2px solid #2563eb;
  border-left: none;
  border-radius: 0 8px 8px 0;
}

.photo-card-hover-title {
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-card-hover-caption {
  font-size: 0.625rem;
  line-height: 1.2;
  color: #444;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.photo-card--show-detail .photo-card-hover-caption {
  white-space: normal;
  overflow: visible;
  text-overflow: unset;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.photo-card--scatter .photo-card-thumb {
  display: block;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  background: #e8e8e8;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  position: relative;
  z-index: 1;
  transform-origin: center center;
}

.photo-card--show-detail .photo-card-thumb {
  border-color: #2563eb;
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

/* 지도 점 hover 시 우측 목록 썸네일만 살짝 확대 (히트 영역은 버튼 크기와 동일) */
.photo-card--hovered .photo-card-thumb {
  transform: scale(1.1);
  box-shadow: 0 2px 10px rgba(37, 99, 235, 0.35);
}

.photo-card-body {
  min-width: 0;
  align-self: center;
}

.photo-card-title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
}

.photo-card-date {
  margin: 0.2rem 0 0;
  font-size: 0.75rem;
  color: #666;
}

.detail {
  position: relative;
  flex: 1 1 0;
  min-height: 0;
  padding: 3px;
  border-top: 1px solid #e0e0e0;
  background: rgba(255, 255, 255, var(--ui-column-alpha));
  overflow: hidden;
}

.detail.hidden {
  display: none;
}

.detail-close {
  position: absolute;
  top: 0.5rem;
  right: 0.5rem;
  z-index: 2;
  width: clamp(1.75rem, 3vw, 2.25rem);
  height: clamp(1.75rem, 3vw, 2.25rem);
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1;
  cursor: pointer;
}

.detail-inner {
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  padding: 0.65rem 2.25rem 0.65rem 0.75rem;
  gap: 0.5rem;
}

.detail-photo {
  flex: 1 1 0;
  min-height: 0;
  overflow: hidden;
  border-radius: 8px;
  background: transparent;
}

.detail-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: transparent;
}

.detail-coords {
  margin: 0;
  flex: 0 0 auto;
  padding: 0.35rem 0.65rem;
  font-family: var(--font-detail);
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  color: #ee252b;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.detail-caption {
  margin: 0;
  flex: 0 1 auto;
  min-height: 0;
  font-family: var(--font-detail);
  font-size: 20px;
  font-weight: 800;
  line-height: 1.4;
  color: #000;
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-radius: 6px;
  overflow-y: auto;
}

.detail-date {
  margin: auto 0 0;
  flex: 0 0 auto;
  align-self: flex-start;
  padding: 0.35rem 0.75rem;
  font-family: var(--font-detail);
  font-size: 16px;
  font-weight: 800;
  line-height: 1.2;
  color: #fff;
  background: #0952a5;
  border-radius: 4px;
}

.leaflet-div-icon {
  background: transparent;
  border: none;
}

.marker-dot {
  display: block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0952A5;
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  transition: transform 0.12s ease, background-color 0.12s ease;
}

.marker-dot--pop-in {
  animation: marker-dot-pop 0.35s ease-out;
}

@keyframes marker-dot-pop {
  from {
    transform: scale(0);
    opacity: 0;
  }
  to {
    transform: scale(1);
    opacity: 1;
  }
}

.marker-dot--hovered {
  background: #1d4ed8;
  transform: scale(1.08);
}

.marker-dot--selected {
  background: #1e40af;
  transform: scale(1.12);
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.45), 0 1px 6px rgba(0, 0, 0, 0.35);
}

.dev-coords {
  position: fixed;
  bottom: 0.75rem;
  left: 0.75rem;
  z-index: 1000;
  padding: 0.35rem 0.6rem;
  font-family: ui-monospace, monospace;
  font-size: 0.75rem;
  background: rgba(0, 0, 0, 0.75);
  color: #a5f3fc;
  border-radius: 4px;
  pointer-events: none;
}

@media (max-width: 768px) {
  .app {
    flex-direction: column;
  }

  .map-stack {
    max-width: none;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
  }

  .map-stack {
    --map-slot-h: 38vh;
    width: 100%;
  }

  .map-shell {
    min-height: 200px;
  }

  .panel {
    width: 100%;
    min-width: 0;
    height: 38vh;
    flex: 0 0 auto;
  }
}

/* ——— Crew / Works / More ——— */
.info-page {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  min-height: 100vh;
  max-height: 100vh;
  overflow-y: auto;
  padding: 3px;
  background: rgba(255, 255, 255, var(--ui-column-alpha));
}

.info-page__header {
  margin-left: auto;
  max-width: 100%;
}

.info-page__main {
  box-sizing: border-box;
  max-width: 42rem;
  margin: 0 auto;
  padding: 1.25rem 1rem 2.5rem;
}

.info-page__title {
  margin: 0 0 1rem;
  font-family: 'Jersey 10', sans-serif;
  font-size: 2rem;
  font-weight: 400;
  color: #ee252b;
  letter-spacing: 0.02em;
}

.info-page__body {
  background: rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-family: var(--font-detail);
  font-size: 1rem;
  line-height: 1.65;
  color: #1a1a1a;
  padding: 1rem;
  border-radius: 6px;
}

.info-page__body p {
  margin: 0 0 1rem;
}

.info-page__body p:last-child {
  margin-bottom: 0;
}

.info-crew__team {
  margin: 0 0 0.75rem;
  font-size: 1.25rem;
  font-weight: 800;
}

.info-crew__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.125rem;
  line-height: 1.8;
}

.info-crew__role {
  font-size: 0.9em;
  color: #555;
}

.info-spec__heading {
  margin: 0 0 0.75rem;
  font-family: 'Jersey 10', sans-serif;
  font-size: 1.25rem;
  font-weight: 400;
  color: #0952a5;
  letter-spacing: 0.04em;
}

.info-spec__list {
  margin: 0;
  padding-left: 1.15rem;
  line-height: 1.75;
}

.info-spec__list li {
  margin-bottom: 0.35rem;
}
