/**
 * [전시 지도]
 * - 역할: /exhibitions/map 분할·바텀시트·카드·오버레이 (갤러리 지도 UX 이식)
 * - 작성/수정일: 2026-08-10
 */

/* [전시 지도] 목록↔지도 모드 토글 — 작성/수정일: 2026-08-10 */
.an-ex-mode-toggle {
  display: inline-flex;
  border: 1px solid var(--line-color, #e5e5e5);
  background: var(--white-color, #fff);
}

.an-ex-mode-toggle__btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  font-size: var(--fs-caption, 12px);
  font-weight: 600;
  color: var(--muted-color, #7c7c7c);
  text-decoration: none;
}

.an-ex-mode-toggle__btn.is-active {
  color: var(--title-color, #171717);
  background: var(--bg-soft, #f6f6f6);
}

.an-ex-main__tools .an-ex-mode-toggle {
  border: 1px solid var(--border-color, #e5e5e5);
  border-radius: var(--radius-sm, 6px);
  overflow: hidden;
  background: var(--white-color, #fff);
}

.an-ex-main__tools .an-ex-mode-toggle__btn {
  height: 42px;
  box-sizing: border-box;
  padding: 0 12px;
  font-size: var(--fs-caption, 12px);
  color: var(--muted-color, #7c7c7c);
}

.an-ex-mode-toggle__label {
  display: inline;
}

.an-ex-main__tools .an-ex-mode-toggle__btn.is-active {
  background: var(--chip-color, #ececec);
  color: var(--title-color, #171717);
}

.an-ex-mapview__panel .an-ex-filter__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.an-ex-mapview__panel .an-ex-filter__actions .primary-btn2,
.an-ex-mapview__panel .an-ex-filter__actions .secondary-btn {
  flex: 1 1 calc(50% - 4px);
  width: auto;
  min-width: 0;
}

.an-ex-mapview__panel .an-ex-filter__actions--solo .secondary-btn {
  flex: 1 1 100%;
  width: 100%;
}
.an-ex-mapview {
  color: var(--title-color, #171717);
  position: relative;
}

/**
 * [지도 플로팅] 앱형 검색·모드 칩 — 작성/수정일: 2026-08-09
 */
.an-ex-mapview__floats {
  position: absolute;
  top: 12px;
  left: 12px;
  right: 12px;
  z-index: 35;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  pointer-events: none;
}

.an-ex-mapview__float {
  pointer-events: auto;
}

.an-ex-mapview__float--search {
  display: flex;
  align-items: stretch;
  gap: 0;
  position: relative;
  max-width: min(520px, calc(100% - 140px));
  background: var(--white-color, #fff);
  border: 1px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  overflow: visible;
}

.an-ex-mapview__search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1 1 auto;
  min-width: 0;
  max-width: none;
  padding: 0 14px;
  border: 0;
  background: transparent;
  height: 44px;
}

.an-ex-mapview__search i {
  color: var(--muted-color, #7c7c7c);
  flex-shrink: 0;
}

.an-ex-mapview__search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  /* [지도 검색] 헤더·필터 검색과 동일 14px — 작성/수정일: 2026-08-09 */
  font-size: var(--fs-label, 14px);
  color: var(--title-color, #171717);
  background: transparent;
  height: 100%;
}

.an-ex-mapview__search input::placeholder {
  color: var(--muted-color, #7c7c7c);
}

.an-ex-mapview__filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  border: 0;
  border-left: 1px solid var(--line-color, #e5e5e5);
  background: var(--white-color, #fff);
  padding: 0 14px;
  height: 44px;
  font-size: var(--fs-caption, 12px);
  font-weight: 600;
  color: var(--title-color, #171717);
  cursor: pointer;
  white-space: nowrap;
}

.an-ex-mapview__filter-btn:hover,
.an-ex-mapview__filter-btn.is-active {
  background: var(--bg-soft, #f6f6f6);
}

.an-ex-mapview__filter-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 9px;
  background: var(--title-color, #171717);
  color: var(--on-dark, #fff);
  font-size: var(--fs-xs, 11px);
  font-weight: 700;
  line-height: 1;
}

.an-ex-mapview__float--mode {
  flex-shrink: 0;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.12);
  background: var(--white-color, #fff);
}

.an-ex-mapview__float--mode .an-ex-mode-toggle {
  border: 1px solid rgba(0, 0, 0, 0.08);
}

.an-ex-mapview__float--mode .an-ex-mode-toggle__btn {
  height: 44px;
  padding: 0 14px;
  box-sizing: border-box;
}

.an-ex-mapview__float--mode .an-ex-mode-toggle__btn.is-active {
  background: var(--title-color, #171717);
  color: var(--on-dark, #fff);
}

/*
 * [지도 필터] 패널·backdrop — mapview 루트/body 포털용 fixed
 * - map-wrap(z:1) 안에 있으면 side(z:6)에 가림 → DOM을 스택 밖으로
 * - 작성/수정일: 2026-08-09
 */
.an-ex-mapview__panel {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 220;
  display: flex;
  flex-direction: column;
  width: min(360px, calc(100vw - 48px));
  max-height: min(70vh, 520px);
  overflow: hidden;
  padding: 16px;
  background: var(--white-color, #fff);
  border: 1px solid var(--line-color, #e5e5e5);
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.14);
  box-sizing: border-box;
}

.an-ex-mapview__panel-head {
  flex: 0 0 auto;
}

.an-ex-mapview__panel-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.an-ex-mapview__panel .an-ex-filter__actions {
  flex: 0 0 auto;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--line-color, #e5e5e5);
}

.an-ex-mapview__panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.an-ex-mapview__panel-head button {
  border: 0;
  background: none;
  padding: 6px;
  cursor: pointer;
}

/* [지도 필터] viewport fixed — 바텀시트·맵 스택과 분리 — 작성/수정일: 2026-08-09 */
.an-ex-mapview__backdrop {
  position: fixed;
  inset: 0;
  z-index: 210;
  background: rgba(0, 0, 0, 0.25);
}

.an-ex-mapview__split {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(280px, 0.55fr);
  height: calc(100dvh - 220px);
  min-height: 480px;
  border-top: 0;
}

.an-ex-mapview__map-wrap {
  position: relative;
  min-height: 0;
  background: var(--border-color, var(--border-color, #eee));
}

.an-ex-mapview__canvas {
  width: 100%;
  height: 100%;
}

.an-ex-mapview__no-key {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 100%;
  gap: 12px;
  color: var(--muted-color, #7c7c7c);
}

.an-ex-mapview__bounds-btn {
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 5;
  border: 0;
  padding: 10px 18px;
  background: var(--title-color, #171717);
  color: var(--on-dark, #fff);
  font-size: var(--fs-caption, 12px);
  font-weight: 700;
  cursor: pointer;
  box-shadow: 0 8px 20px rgba(0, 0, 0, 0.18);
}

.an-ex-mapview__side {
  display: flex;
  flex-direction: column;
  min-height: 0;
  border-left: 1px solid var(--line-color, #e5e5e5);
  background: var(--white-color, #fff);
}

.an-ex-mapview__sheet-handle {
  display: none;
}

.an-ex-mapview__side-head {
  flex: 0 0 auto;
  padding: 14px 16px 8px;
  border-bottom: 1px solid var(--line-color, #e5e5e5);
}

.an-ex-mapview__side-count {
  margin: 0;
  font-size: var(--fs-body, 15px);
}

.an-ex-mapview__cards {
  /* [지도 목록] flex 자식 축소 허용 — 작성/수정일: 2026-08-09 */
  flex: 1 1 0;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  padding: 8px;
}

.an-ex-map-card {
  border: 1px solid transparent;
  margin-bottom: 8px;
}

.an-ex-map-card.is-active,
.an-ex-map-card.is-hover {
  border-color: var(--title-color, #171717);
  background: var(--bg-soft, #f9f9f9);
}

.an-ex-map-card__link {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  padding: 8px;
  text-decoration: none;
  color: inherit;
}

.an-ex-map-card__media {
  width: auto;
  height: 88px;
  max-height: 88px;
  aspect-ratio: var(--ex-poster-ratio, 480 / 679);
  overflow: hidden;
  background: var(--bg-soft, #f0f0f0);
}

.an-ex-map-card__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.an-ex-map-card__ph {
  display: block;
  width: 100%;
  height: 100%;
  background: linear-gradient(135deg, var(--chip-color, #ececec), #d8d8d8);
}

.an-ex-map-card__body {
  display: flex;
  flex-direction: column;
  gap: 0px;
  min-width: 0;
}

.an-ex-map-card__name {
  font-size: var(--fs-body);
  font-weight: 700;
  line-height: 1.35;
  margin-bottom: 4px;
}

.an-ex-map-card__region,
.an-ex-map-card__ongoing,
.an-ex-map-card__ex-title {
  font-size: var(--fs-sm, 13px);
  color: var(--muted-color, #7c7c7c);
}

.an-ex-map-card__ex-title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.an-ex-mapview__empty {
  padding: 32px 12px;
}

@media (max-width: 991.98px) {
  /* [지도 모바일 바텀시트]
   * - 역할: 스냅 3단(min/mid/max) · 시트에 컨트롤 가림 · 드래그는 JS
   * - 작성/수정일: 2026-08-09
   */
  .an-ex-mapview__floats {
    top: 8px;
    left: 8px;
    right: 8px;
    flex-wrap: wrap;
    gap: 8px;
  }

  .an-ex-mapview__float--search {
    width: 100%;
    max-width: none;
    order: 1;
  }

  .an-ex-mapview__float--mode {
    order: 0;
    margin-left: auto;
  }

  .an-ex-mapview__split {
    display: block;
    position: relative;
    height: calc(100dvh - 180px);
    min-height: 520px;
    border-top: 0;
  }

  .an-ex-mapview__map-wrap {
    position: absolute;
    inset: 0;
    z-index: 1;
  }

  /* 맵 컨트롤: min에서만 표시(시트 위), mid/max는 숨김 — 작성/수정일: 2026-08-09 */
  .an-ex-mapview__map-wrap .an-map-ctrls {
    right: 10px;
    bottom: calc(var(--an-ex-sheet-h, 120px) + 12px);
    z-index: 4;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
  }

  .an-ex-mapview[data-sheet="min"] .an-ex-mapview__map-wrap .an-map-ctrls {
    opacity: 1;
    visibility: visible;
    pointer-events: none; /* 래퍼 — 자식만 auto (artnet-map-chrome) */
  }

  .an-ex-mapview[data-sheet="min"]
    .an-ex-mapview__map-wrap
    .an-map-ctrls
    .an-map-ctrls__zoom,
  .an-ex-mapview[data-sheet="min"]
    .an-ex-mapview__map-wrap
    .an-map-ctrls
    .an-map-ctrls__type {
    pointer-events: auto;
  }

  .an-ex-mapview__side {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 6;
    /* 높이는 JS(data-sheet / inline)가 스냅·드래그로 제어 */
    height: 38%;
    max-height: 85%;
    overflow: hidden;
    border-left: 0;
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 28px rgba(0, 0, 0, 0.12);
    transition:
      height 0.28s ease,
      max-height 0.28s ease;
  }

  .an-ex-mapview__side.is-dragging {
    transition: none;
    touch-action: none;
  }

  .an-ex-mapview__sheet-handle {
    display: flex;
    justify-content: center;
    flex: 0 0 auto;
    padding: 10px 0 4px;
    cursor: grab;
    touch-action: none;
  }

  .an-ex-mapview__side.is-dragging .an-ex-mapview__sheet-handle {
    cursor: grabbing;
  }

  .an-ex-mapview__sheet-handle span {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--divider-color, #cfcfcf);
  }

  .an-ex-mapview__side-head {
    flex: 0 0 auto;
    touch-action: none;
  }

  /* 목록 스크롤은 카드 영역만 — 작성/수정일: 2026-08-09 */
  .an-ex-mapview__cards {
    touch-action: pan-y;
  }

  .an-ex-mapview__float--mode .an-ex-mode-toggle__btn {
    padding: 0 12px;
  }

  /*
   * [지도 필터] 오픈 시 바텀시트 숨김
   * - 패널/backdrop은 body 포털(fixed z:210+)이라 시트보다 항상 위
   * - 시트는 시각적으로도 숨겨 하단 회색 바가 비치지 않게 함
   * - 작성/수정일: 2026-08-09
   */
  .an-ex-mapview.is-filter-open .an-ex-mapview__side {
    pointer-events: none;
    visibility: hidden;
  }
}

/**
 * [지도] PC 스플릿 복구
 * - 역할: 모바일 absolute 시트·인라인 height 잔존으로 맵 드래그 차단 방지
 * - 작성/수정일: 2026-08-09
 */
.an-ex-mapview.is-desktop-split .an-ex-mapview__split {
  display: grid;
}

.an-ex-mapview.is-desktop-split .an-ex-mapview__map-wrap {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  inset: auto !important;
  z-index: auto !important;
  width: auto;
  height: auto !important;
  max-height: none !important;
  min-height: 0;
  align-self: stretch;
}

.an-ex-mapview.is-desktop-split .an-ex-mapview__side {
  position: relative !important;
  top: auto !important;
  right: auto !important;
  bottom: auto !important;
  left: auto !important;
  z-index: auto !important;
  width: auto !important;
  /* 모바일 인라인 height(px) 무력화 후 그리드 stretch — 작성/수정일: 2026-08-09 */
  height: auto !important;
  max-height: none !important;
  min-height: 0 !important;
  align-self: stretch;
  overflow: hidden;
  border-radius: 0;
  box-shadow: none;
  touch-action: auto;
}

.an-ex-mapview.is-desktop-split .an-ex-mapview__sheet-handle {
  display: none;
}

.an-ex-mapview.is-desktop-split .an-ex-mapview__map-wrap .an-map-ctrls {
  opacity: 1 !important;
  visibility: visible !important;
  bottom: 12px !important;
  pointer-events: none;
}

.an-ex-mapview.is-desktop-split
  .an-ex-mapview__map-wrap
  .an-map-ctrls
  .an-map-ctrls__zoom,
.an-ex-mapview.is-desktop-split
  .an-ex-mapview__map-wrap
  .an-map-ctrls
  .an-map-ctrls__type {
  pointer-events: auto;
}

@media (min-width: 992px) {
  .an-ex-mapview__map-wrap {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    inset: auto !important;
    z-index: auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0;
    align-self: stretch;
  }

  .an-ex-mapview__side {
    position: relative !important;
    top: auto !important;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    z-index: auto !important;
    width: auto !important;
    height: auto !important;
    max-height: none !important;
    min-height: 0 !important;
    align-self: stretch;
    overflow: hidden;
    border-radius: 0;
    box-shadow: none;
    touch-action: auto;
  }

  .an-ex-mapview__sheet-handle {
    display: none;
  }

  .an-ex-mapview__map-wrap .an-map-ctrls {
    opacity: 1 !important;
    visibility: visible !important;
    bottom: 12px !important;
    pointer-events: none;
  }

  .an-ex-mapview__map-wrap .an-map-ctrls .an-map-ctrls__zoom,
  .an-ex-mapview__map-wrap .an-map-ctrls .an-map-ctrls__type {
    pointer-events: auto;
  }
}

/* [지도 목록 UX] 이중 액션·오버레이 — 작성/수정일: 2026-08-09 */
.an-ex-map-card {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 8px;
  align-items: stretch;
  padding: 8px;
  border-bottom: 1px solid var(--line-color, #e5e5e5);
}

.an-ex-map-card__focus {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  border: 0;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
  color: inherit;
  min-width: 0;
}

.an-ex-map-card__detail {
  align-self: center;
  flex-shrink: 0;
  padding: 6px 8px;
  border: 1px solid var(--line-color, #e5e5e5);
  font-size: var(--fs-xs, 11px);
  font-weight: 700;
  color: var(--title-color, #171717);
  text-decoration: none;
  white-space: nowrap;
}

.an-ex-map-card__detail:hover {
  background: var(--bg-soft, #f6f6f6);
}

.an-ex-map-card__link {
  display: contents;
}

.an-ex-mapview__more {
  padding: 8px 0 16px;
  text-align: center;
}

.an-ex-mapview__loading {
  margin: 0;
  font-size: var(--fs-caption, 12px);
  color: var(--muted-color, #7c7c7c);
}

.an-ex-mapview__sentinel {
  height: 1px;
}

/* [지도 오버레이] 좌 4:5 썸네일 + 우 텍스트 — 작성/수정일: 2026-08-10 */
.an-ex-map-ov {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: max-content;
  max-width: min(340px, 92vw);
  background: var(--white-color, #fff);
  border: 0;
  border-radius: 14px;
  box-shadow:
    0 2px 8px rgba(0, 0, 0, 0.08),
    0 12px 32px rgba(0, 0, 0, 0.16);
  color: var(--title-color, #171717);
  text-decoration: none;
  transform: translateY(-6px);
  opacity: 1;
  transition:
    transform 0.18s ease,
    box-shadow 0.18s ease;
}

.an-ex-map-ov:hover,
.an-ex-map-ov:focus,
.an-ex-map-ov:focus-visible {
  opacity: 1;
  color: var(--title-color, #171717);
  text-decoration: none;
  transform: translateY(-8px);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.1),
    0 16px 40px rgba(0, 0, 0, 0.18);
}

.an-ex-map-ov__media {
  flex: 0 0 auto;
  align-self: center;
  width: auto;
  height: 88px;
  max-height: 88px;
  aspect-ratio: var(--ex-poster-ratio, 480 / 679);
  overflow: hidden;
  border-radius: 10px;
  margin: 10px 0 10px 10px;
  background: var(--line-color, #f0f0f0);
}

.an-ex-map-ov__media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.an-ex-map-ov__body {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 148px;
  max-width: 200px;
  padding: 12px 14px;
  box-sizing: border-box;
}

.an-ex-map-ov:not(.an-ex-map-ov--media) .an-ex-map-ov__body {
  max-width: 240px;
}

.an-ex-map-ov__badge {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  margin: 0 0 6px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--title-color, #111);
  color: var(--on-dark, #fff);
  font-size: var(--fs-xs, 11px);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.4;
}

.an-ex-map-ov__name {
  display: block;
  margin: 0;
  font-size: var(--fs-label, 14px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
}

.an-ex-map-ov__meta,
.an-ex-map-ov__ex {
  margin: 5px 0 0;
  font-size: var(--fs-caption, 12px);
  color: #6b6b6b;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.an-ex-map-ov__ex {
  color: var(--muted-color, #8a8a8a);
}

.an-ex-map-ov__cta {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 8px;
  font-size: var(--fs-caption, 12px);
  font-weight: 700;
  color: var(--primary-color, #171717);
  text-decoration: none;
}

.an-ex-map-ov__cta::after {
  content: "→";
  font-weight: 700;
}

.an-ex-map-ov__tail {
  position: absolute;
  left: 50%;
  bottom: -7px;
  width: 14px;
  height: 14px;
  margin-left: -7px;
  background: var(--white-color, #fff);
  box-shadow: 2px 2px 4px rgba(0, 0, 0, 0.08);
  transform: rotate(45deg);
  border-radius: 2px;
}

/**
 * [갤러리 지도] full-bleed — 브라우저 가로 전체 · 헤더 아래 세로 채움
 * - 작성/수정일: 2026-08-09
 */
body.an-exhibitions-map {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  overflow: hidden;
}

body.an-exhibitions-map .an-header {
  flex: 0 0 auto;
}

body.an-exhibitions-map .an-page-main--map {
  flex: 1 1 auto;
  min-height: 0;
  padding-top: 0;
  padding-bottom: 0;
  display: flex;
  flex-direction: column;
}

body.an-exhibitions-map .an-page-main__body--map {
  max-width: none;
  width: 100%;
  margin-inline: 0;
  padding-inline: 0;
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.an-exhibitions-map .an-ex-mapview {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

body.an-exhibitions-map .an-ex-mapview__split {
  flex: 1 1 auto;
  height: auto;
  min-height: 0;
}

@media (max-width: 991.98px) {
  body.an-exhibitions-map .an-ex-mapview__split {
    height: auto;
    min-height: 0;
  }
}
