:root {
  --gold: #FFD23C;
  --pink: #FF6987;
  --bg: #eef0f4;
  --white: #ffffff;
  --dark: #1a2236;
  --text: #2d3748;
  --muted: #8896aa;
  --border: #dde2ea;
  --panel: #f4f6f9;
}

/* ── Card header ── */
/* ── Card header (세이지 그린 파스텔) ── */
.dgw-card-head {
  flex-shrink: 0;
  background: var(--dg-primary-gradient);
  border-radius: 14px;
  padding: 10px 20px;
  display: flex;
  align-items: center;
  gap: 16px;
  box-shadow: 0 2px 12px rgba(0,0,0,.06);
  border-bottom: none;
}

.dgw-head-icon {
  width: 48px; height: 48px;
  background: rgba(45,74,30,.10);
  border: none;
  border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 24px; flex-shrink: 0; color: #2d4a1e;
}

.dgw-head-eyebrow {
  font-size: 10px; font-weight: 700;
  color: rgba(45,74,30,.5);
  letter-spacing: 1.6px; text-transform: uppercase;
}

.dgw-head-title {
  font-size: 20px; font-weight: 800; color: #2d4a1e;
  letter-spacing: -0.3px; line-height: 1.15;
  font-family: 'Noto Serif KR', serif;
}

.dgw-head-desc {
  font-size: 12px; color: rgba(45,74,30,.5); margin-top: 2px;
}

.dgw-head-pills {
  margin-left: auto;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.dgw-pill {
  padding: 5px 14px; border-radius: 20px;
  font-size: 11px; font-weight: 700; letter-spacing: .3px;
  display: inline-flex; align-items: center; gap: 5px;
}
.dgw-pill-pink {
  background: #FF6987;
  border: none;
  color: #fff;
}
.dgw-pill-gold {
  background: #e6a817;
  border: none;
  color: #fff;
}
.dgw-pill-dot {
  width: 6px; height: 6px; border-radius: 50%;
}
.dgw-pill-pink .dgw-pill-dot { background: #fff; }
.dgw-pill-gold .dgw-pill-dot { background: #fff; }

/* ── Main body ── */
.dgw-card-body {
  flex: 1; display: flex; gap: 12px; overflow: hidden;
  align-items: flex-start;
}

/* ── LEFT map ── */
.dgw-map-col {
  flex: 0 0 auto; position: relative; overflow: hidden;
  align-self: flex-start;
  border-radius: 14px;
  box-shadow: 0 2px 12px rgba(0,0,0,0.10);
}
/* 기본 (PC) */
.dgw-map-img {
  display: block;
  height: auto;        /* 100% → auto 로 변경 */
  width: 100%;
  max-width: 100%;
}

/* Number spots */
.dgw-spot {
  position: absolute; transform: translate(-50%,-50%);
  cursor: pointer; z-index: 10;
}
.dgw-spot-ring {
  width: 44px; height: 44px;
  background: rgba(255,105,135,0.18);
  border: 2px solid rgba(255,105,135,0.52);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: all .22s; animation: none;
}
.dgw-spot:hover .dgw-spot-ring {
  background: rgba(255,105,135,0.55);
  border-color: #FF6987;
  transform: scale(1.22); animation: none;
}
.dgw-spot-num {
  width: 22px; height: 22px; background: #FF6987;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 700; color: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.3);
}
@keyframes pulse {
  0%,100% { box-shadow: 0 0 0 0 rgba(255,105,135,0.45); }
  50%      { box-shadow: 0 0 0 8px rgba(255,105,135,0); }
}

/* Utility badge */
.dgw-util {
  position: absolute; transform: translate(-50%,-50%);
  cursor: pointer; z-index: 11;
}
.dgw-util-badge {
  width: 26px; height: 26px; background: #FFD23C;
  border-radius: 5px;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 2px 6px rgba(0,0,0,0.25);
  transition: transform .18s;
}
.dgw-util:hover .dgw-util-badge { transform: scale(1.28); }
.dgw-util-badge i { font-size: 13px; color: #1a1a1a; }

/* Tooltip */
.dgw-tip {
  position: absolute; bottom: calc(100% + 7px); left: 50%;
  transform: translateX(-50%);
  background: rgba(26,34,54,0.95);
  border: 1px solid rgba(255,105,135,0.4);
  color: #fff; padding: 4px 10px; border-radius: 7px;
  font-size: 11px; font-weight: 600; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity .15s;
  z-index: 60;
}
.dgw-tip::after {
  content: ''; position: absolute; top: 100%; left: 50%;
  transform: translateX(-50%);
  border: 4px solid transparent;
  border-top-color: rgba(255,105,135,0.4);
}
.dgw-spot:hover .dgw-tip,
.dgw-util:hover .dgw-tip { opacity: 1; }

/* ── RIGHT sidebar ── */
.dgw-sidebar {
  width: 299px; flex-shrink: 0;
  display: flex; flex-direction: column;
  gap: 10px; overflow: hidden;
  align-self: stretch;
}

/* Section card */
.dgw-sec-card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.07);
  display: flex; flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--border);
}
.dgw-sec-card.dgw-tour   { flex: 1; min-height: 0; }
.dgw-sec-card.dgw-amenity { flex-shrink: 0; }

.dgw-sec-head {
  display: flex; align-items: center; gap: 8px;
  padding: 11px 14px 10px;
  background: var(--panel);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.dgw-sec-bar {
  width: 3px; height: 15px; border-radius: 2px; flex-shrink: 0;
}
.dgw-sec-bar.dgw-pink { background: #FF6987; }
.dgw-sec-bar.dgw-gold { background: #FFD23C; }
.dgw-sec-title {
  font-size: 12px; font-weight: 700;
  color: var(--text); letter-spacing: .2px;
}
.dgw-sec-badge {
  margin-left: auto;
  font-size: 9px; font-weight: 700;
  color: var(--muted);
  background: var(--bg);
  border: 1px solid var(--border);
  padding: 2px 8px; border-radius: 10px;
}

/* Tour list */
.dgw-tour-scroll {
  flex: 1; overflow-y: auto; padding: 7px 8px;
}
.dgw-tour-scroll::-webkit-scrollbar { width: 3px; }
.dgw-tour-scroll::-webkit-scrollbar-track { background: transparent; }
.dgw-tour-scroll::-webkit-scrollbar-thumb { background: var(--border); border-radius: 4px; }

.dgw-tour-item {
  display: flex; align-items: center; gap: 9px;
  padding: 6px 8px; border-radius: 8px;
  cursor: pointer; transition: background .15s;
}
.dgw-tour-item:hover  { background: rgba(255,105,135,0.07); }
.dgw-tour-item.dgw-active { background: rgba(255,105,135,0.10); }

.dgw-t-num {
  width: 20px; height: 20px; background: #FF6987;
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 9px; font-weight: 700; color: #ffffff; flex-shrink: 0;
}
.dgw-t-name {
  font-size: 11.5px; color: var(--text); font-weight: 500; line-height: 1.3;
}
.dgw-t-arrow {
  margin-left: auto; color: var(--muted); font-size: 13px;
  opacity: 0; transition: opacity .15s;
}
.dgw-tour-item:hover .dgw-t-arrow { opacity: 1; }

/* Amenity */
.dgw-amenity-body { padding: 8px 10px; }
.dgw-amenity-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 5px;
}
.dgw-amenity-grid .dgw-a-item,
.dgw-a-item {
  display: flex; align-items: center; gap: 8px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 8px; padding: 7px 9px;
  transition: background .15s, border-color .15s;
  cursor: pointer;
}
.dgw-amenity-grid .dgw-a-item:hover,
.dgw-a-item:hover {
  background: rgba(255,210,60,0.08);
  border-color: rgba(255,210,60,0.4);
}
.dgw-amenity-grid .dgw-a-item.dgw-active,
.dgw-a-item.dgw-active {
  background: rgba(255,210,60,0.18);
  border-color: rgba(255,210,60,0.7);
}
.dgw-amenity-grid .dgw-a-icon,
.dgw-a-icon {
  width: 26px; height: 26px; background: #FFD23C;
  border-radius: 5px; display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.dgw-amenity-grid .dgw-a-icon i,
.dgw-a-icon i { font-size: 13px; color: #1a1a1a; }
.dgw-amenity-grid .dgw-a-name,
.dgw-a-name { font-size: 10.5px; color: var(--text); font-weight: 500; line-height: 1.25; }

/* CMS 부모 컨테이너 대상 */
@media (max-width: 900px) {
  .dgw-map-col * {
    max-width: 100%;
    box-sizing: border-box;
  }
}

/* ════════════════════════════
   반응형 — 태블릿/모바일 공통
════════════════════════════ */
@media (max-width: 900px) {

  /* 전체 가로 넘침 원천 차단 */
  html, body {
    overflow-x: hidden !important;
  }

  /* dgw 전체 요소 box-sizing 통일 */
  .dgw-card-head,
  .dgw-card-body,
  .dgw-map-col,
  .dgw-sidebar,
  .dgw-sec-card,
  .dgw-sec-head,
  .dgw-sec-badge,
  .dgw-tour-scroll,
  .dgw-tour-item,
  .dgw-t-name,
  .dgw-amenity-body,
  .dgw-amenity-grid,
  .dgw-a-item,
  .dgw-a-name {
    box-sizing: border-box !important;
    min-width: 0 !important;
    max-width: 100% !important;
  }

  /* 헤더 */
  .dgw-card-head {
    width: 100% !important;
    padding: 10px 14px;
    gap: 10px;
    overflow: hidden;
  }
  .dgw-head-pills { display: none; }
  .dgw-head-desc  { display: none; }
  .dgw-head-title { font-size: 16px; }
  .dgw-head-icon  { width: 38px; height: 38px; font-size: 20px; flex-shrink: 0; }

  /* 바디 — 세로 배치 */
  .dgw-card-body {
    width: 100% !important;
    flex-direction: column !important;
    align-items: stretch !important;
    overflow: hidden !important;
    gap: 10px;
  }

  /* 지도 영역 — 내부만 가로 스크롤 */
  .dgw-map-col {
    position: relative !important;
    flex: none !important;
    width: 100% !important;
    max-width: 100% !important;
    height: 420px !important;
    overflow-x: auto !important;
    overflow-y: hidden !important;
    -webkit-overflow-scrolling: touch;
    border-radius: 10px;
  }

  .dgw-map-img {
    width: auto !important;
    height: 420px !important;
    min-width: 900px !important;
    max-width: none !important;
    display: block !important;
  }

  /* 사이드바 */
  .dgw-sidebar {
    width: 100% !important;
    flex-direction: column !important;
    overflow: hidden !important;
    gap: 8px;
  }

  /* 섹션 카드 */
  .dgw-sec-card {
    width: 100% !important;
    overflow: hidden !important;
    border-radius: 10px;
  }
  .dgw-sec-card.dgw-tour {
    flex: 0 0 auto !important;
    max-height: 280px;
  }
  .dgw-sec-card.dgw-amenity {
    flex-shrink: 0;
  }

  /* 관람순서 */
  .dgw-tour-scroll {
    overflow-x: hidden !important;
    overflow-y: auto !important;
  }
  .dgw-tour-item {
    overflow: hidden !important;
  }
  .dgw-t-name {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
  }

  /* 편의시설 — 2열 고정 */
  .dgw-amenity-body {
    padding: 8px !important;
    overflow: hidden !important;
  }
  .dgw-amenity-grid {
    grid-template-columns: 1fr 1fr !important;
    gap: 5px !important;
    width: 100% !important;
  }
  .dgw-a-item {
    overflow: hidden !important;
    padding: 6px 8px !important;
  }
  .dgw-a-name {
    overflow: hidden !important;
    text-overflow: ellipsis !important;
    white-space: nowrap !important;
    font-size: 10px !important;
  }

  /* 툴팁 */
  .dgw-tip {
    white-space: nowrap !important;
    width: max-content !important;
    max-width: none !important;
    z-index: 9999 !important;
    font-size: 11px;
    padding: 4px 10px;
  }

}

/* ════════════════════════════
   반응형 — 모바일 (≤ 480px)
════════════════════════════ */
@media (max-width: 480px) {

  .dgw-card-head  { padding: 10px 14px; gap: 10px; }
  .dgw-head-icon  { width: 38px; height: 38px; font-size: 20px; }
  .dgw-head-title { font-size: 15px; }

  .dgw-amenity-grid { grid-template-columns: 1fr; }

  .dgw-spot-ring  { width: 30px; height: 30px; }
  .dgw-spot-num   { width: 17px; height: 17px; font-size: 8px; }
  .dgw-util-badge { width: 20px; height: 20px; }
  .dgw-util-badge i { font-size: 10px; }
  .dgw-tip        { font-size: 10px; padding: 3px 8px; }

}

/* Accessibility and layout: keep the entire map and its text alternatives in view. */
.dgw-sr-only { position: absolute !important; width: 1px !important; height: 1px !important; padding: 0 !important; margin: -1px !important; overflow: hidden !important; clip: rect(0,0,0,0) !important; white-space: nowrap !important; border: 0 !important; }
:root { --muted: #475569; }
.dgw-card-head .dgw-head-desc { color: #385a2d; }
.dgw-card-head .dgw-pill-pink { background: #a51d3d; color: #fff; }
.dgw-card-head .dgw-pill-gold { background: #e6a817; color: #1f2937; }
.dgw-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1.8fr) minmax(280px, 1fr);
  grid-template-rows: auto 1fr;
  align-items: start;
  overflow: visible;
  gap: 12px;
}
.dgw-card-body .dgw-map-help { grid-column: 1 / -1; }
.dgw-card-body .dgw-map-panel { grid-column: 1; grid-row: 2; position: sticky; top: 12px; align-self: start; width: 100%; min-width: 0; }
.dgw-card-body .dgw-map-col { width: 100%; min-width: 0; max-width: 100%; overflow: hidden; }
.dgw-card-body .dgw-sidebar { grid-column: 2; grid-row: 2; width: 100%; min-width: 0; overflow: visible; }
.dgw-card-body .dgw-map-img { width: 100%; max-width: 100%; height: auto; }
.dgw-map-help { margin: 0; color: #334155; font-size: 14px; line-height: 1.5; }
.dgw-selection-status { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; overflow: hidden; clip: rect(0,0,0,0); clip-path: inset(50%); white-space: nowrap; }
.dgw-sec-title { margin: 0; color: #1e293b; font-size: 16px; line-height: 1.5; }
.dgw-sec-badge { color: #475569; font-size: 12px; }
.dgw-sec-card.dgw-tour { flex: none; max-height: none; }
.dgw-tour-scroll { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 6px; margin: 0; padding: 12px; list-style: none; overflow: visible; }
.dgw-tour-scroll li { min-width: 0; }
button.dgw-tour-item { width: 100%; min-height: 44px; border: 1px solid #cbd5e1; background: #fff; text-align: left; font: inherit; }
button.dgw-tour-item:hover,button.dgw-tour-item.is-selected { border-color: #a51d3d; background: #fff1f2; }
.dgw-t-num,.dgw-spot-num { background: #a51d3d; color: #fff; }
.dgw-t-name { font-size: 14px; font-weight: 600; line-height: 1.4; white-space: normal; overflow-wrap: anywhere; }
.dgw-amenity-grid { grid-template-columns: repeat(5,minmax(0,1fr)); gap: 8px; }
button.dgw-a-item { min-height: 46px; border: 1px solid #cbd5e1; background: #fff; font: inherit; text-align: left; }
button.dgw-a-item:hover,button.dgw-a-item.is-selected { border-color: #6b4f00; background: #fff8df; }
.dgw-a-name { color: #1e293b; font-size: 13px; font-weight: 600; white-space: normal; overflow-wrap: anywhere; }
button.dgw-spot,button.dgw-util { position: absolute; margin: 0; padding: 0; border: 0; background: transparent; font: inherit; line-height: 1; }
button.dgw-spot { z-index: 12; }
button.dgw-util { z-index: 11; }
.dgw-spot-num { font-size: 11px; }
button.dgw-spot.is-selected .dgw-spot-ring { background: #a51d3d; border-color: #7f1734; animation: none; }
button.dgw-util.is-selected .dgw-util-badge { background: #e6a817; outline: 3px solid #1f2937; }
button.dgw-spot:focus-visible,button.dgw-util:focus-visible,button.dgw-tour-item:focus-visible,button.dgw-a-item:focus-visible { outline: 3px solid #111827 !important; outline-offset: 3px !important; }
button.dgw-spot:hover,button.dgw-util:hover,button.dgw-spot:focus-visible,button.dgw-util:focus-visible { z-index: 100 !important; }
button.dgw-spot.has-visible-tip,button.dgw-util.has-visible-tip { z-index: 90; }
.dgw-tip { width: max-content; max-width: 190px; white-space: normal; overflow-wrap: anywhere; visibility: hidden; color: #fff; background: #111827; border-color: #111827; font-size: 12px; line-height: 1.4; }
.dgw-tip--left { left: auto; right: 0; transform: none; }
.dgw-tip--right { left: 0; transform: none; }
.dgw-tip--below { top: calc(100% + 8px); bottom: auto; }
.dgw-tip--below::after { top: auto; bottom: 100%; border-top-color: transparent; border-bottom-color: #111827; }
button.dgw-spot:hover .dgw-tip,button.dgw-util:hover .dgw-tip,button.dgw-spot:focus-visible .dgw-tip,button.dgw-util:focus-visible .dgw-tip,button.dgw-spot.has-visible-tip .dgw-tip,button.dgw-util.has-visible-tip .dgw-tip { opacity: 1; visibility: visible; }
@media (prefers-reduced-motion: reduce) { .dgw-spot-ring { animation: none !important; transition: none !important; } .dgw-tip { transition: none !important; } }
@media (max-width: 1199px) {
  .dgw-card-body { display: flex; flex-direction: column; align-items: stretch; }
  .dgw-card-body .dgw-map-panel { position: static; }
  .dgw-card-body .dgw-map-col,
  .dgw-card-body .dgw-sidebar { width: 100%; max-width: 100%; }
}
@media (max-width: 900px) {
  .dgw-card-body { display: flex; }
  .dgw-card-body { overflow: visible !important; }
  .dgw-card-body .dgw-map-col { width: 100% !important; max-width: 100% !important; overflow-x: auto !important; overflow-y: hidden !important; scroll-padding-inline: 110px; }
  .dgw-card-body .dgw-map-img { width: auto !important; height: 420px !important; min-width: 900px !important; max-width: none !important; }
  .dgw-card-body .dgw-sidebar { width: 100% !important; overflow: visible !important; }
  .dgw-sec-card.dgw-tour { max-height: none !important; }
  .dgw-tour-scroll { overflow: visible !important; }
  button.dgw-tour-item { overflow: visible !important; }
  .dgw-t-name,.dgw-a-name { overflow: visible !important; text-overflow: clip !important; white-space: normal !important; }
  button.dgw-a-item { overflow: visible !important; }
  .dgw-tip { max-width: 190px !important; width: max-content !important; white-space: normal !important; }
}
@media (max-width: 600px) {
  .dgw-tour-scroll { grid-template-columns: 1fr; }
  .dgw-amenity-grid { grid-template-columns: repeat(2,minmax(0,1fr)) !important; }
}

/* Map and directions tabs. The panels remain in the document when scripts are unavailable. */
.dgw-page-tabs { display: flex; width: 100%; margin: 0 0 14px; overflow: hidden; border: 1px solid #d7ded3; border-radius: 10px; background: #fff; }
.dgw-page-tab { flex: 1 1 50%; min-width: 0; min-height: 48px; padding: 10px 16px; border: 0; border-radius: 0; background: #fff; color: #1e3320; font: inherit; font-size: 16px; font-weight: 700; cursor: pointer; }
.dgw-page-tab + .dgw-page-tab { border-left: 1px solid #d7ded3; }
.dgw-page-tab:hover:not([aria-selected="true"]) { background: #edf3e9; }
.dgw-page-tab[aria-selected="true"] { background: linear-gradient(90deg,#627a53,#3d5b2d); color: #fff; }
.dgw-page-tab:focus-visible { position: relative; z-index: 1; outline: 3px solid #a51d3d; outline-offset: -4px; }
.dgw-tabpanel:focus-visible { outline: 3px solid #a51d3d; outline-offset: 3px; }
.dgw-tabpanel[hidden] { display: none !important; }
@media (max-width: 600px) {
  .dgw-page-tab { padding: 10px 8px; }
}
