/* ===== Deep-dive country view ===== */

.deep-dive-btn {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  margin: 16px 0 20px;
  padding: 18px 20px;
  background: linear-gradient(135deg, var(--coral, #d4775c) 0%, #c2624c 100%);
  border: 0;
  border-radius: 10px;
  color: #fff5e8;
  font-family: 'Noto Serif KR', serif;
  letter-spacing: 0.04em;
  cursor: pointer;
  text-align: left;
  box-shadow: 0 8px 22px rgba(212,119,92,0.32), 0 2px 6px rgba(43,37,31,0.10);
  transition: all 0.22s cubic-bezier(0.2,0.8,0.2,1);
  position: relative;
  overflow: hidden;
}
.deep-dive-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 90% 30%, rgba(255,255,255,0.18), transparent 55%);
  pointer-events: none;
}
.deep-dive-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 30px rgba(212,119,92,0.42), 0 4px 8px rgba(43,37,31,0.14);
}
.deep-dive-btn .dd-icon {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 245, 232, 0.18);
  color: #fff5e8;
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.deep-dive-btn .dd-label {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
  position: relative;
  z-index: 1;
}
.deep-dive-btn .dd-overline {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.22em;
  opacity: 0.78;
}
.deep-dive-btn .dd-title {
  font-size: 17px;
  font-weight: 600;
}
.deep-dive-btn .dd-arrow {
  font-size: 22px;
  transition: transform 0.22s ease;
  position: relative;
  z-index: 1;
  flex-shrink: 0;
}
.deep-dive-btn:hover .dd-arrow { transform: translateX(4px); }
.deep-dive-btn:hover .dd-icon { background: rgba(255, 245, 232, 0.28); }

.country-overlay {
  position: fixed;
  inset: 0;
  background: rgba(38, 33, 28, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  z-index: 200;
  pointer-events: none;
  transition: background 0.55s ease, backdrop-filter 0.55s ease;
}
.country-overlay.enter {
  background: rgba(38, 33, 28, 0.45);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  pointer-events: auto;
}

.country-zoom {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  transform-origin: var(--origin-x, 50%) var(--origin-y, 50%);
  transform: scale(0.04);
  opacity: 0;
  transition:
    transform 0.62s cubic-bezier(0.22, 0.85, 0.28, 1),
    opacity 0.40s ease;
}
.country-overlay.enter .country-zoom {
  transform: scale(1);
  opacity: 1;
}
.country-overlay.exit .country-zoom {
  transition:
    transform 0.50s cubic-bezier(0.55, 0.05, 0.7, 0.2),
    opacity 0.45s ease;
}

.country-stage {
  position: relative;
  width: min(1280px, 96vw);
  height: min(820px, 92vh);
  background: var(--paper, #f5efe2);
  background-image:
    radial-gradient(circle at 20% 15%, rgba(184, 146, 76, 0.05), transparent 50%),
    radial-gradient(circle at 80% 85%, rgba(122, 141, 107, 0.04), transparent 50%);
  border: 1px solid rgba(43, 37, 31, 0.18);
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(38, 33, 28, 0.35);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

.country-header {
  position: relative;
  padding: 22px 28px 18px;
  border-bottom: 1px solid rgba(43, 37, 31, 0.10);
}
.ch-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--ink-soft, #6b6256);
  text-transform: uppercase;
  margin-bottom: 6px;
}
.ch-title {
  font-family: 'Noto Serif KR', serif;
  font-size: 32px;
  font-weight: 600;
  color: var(--ink, #2a2520);
  letter-spacing: 0.08em;
  line-height: 1;
}
.ch-sub {
  font-family: 'JetBrains Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--ink-soft, #6b6256);
  margin-top: 4px;
}
.ch-close {
  position: absolute;
  top: 22px;
  right: 28px;
  background: transparent;
  border: 1px solid rgba(43, 37, 31, 0.20);
  color: var(--ink, #2a2520);
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  padding: 7px 14px;
  border-radius: 3px;
  cursor: pointer;
  letter-spacing: 0.06em;
  transition: all 0.2s ease;
}
.ch-close:hover {
  background: rgba(43, 37, 31, 0.06);
  border-color: rgba(43, 37, 31, 0.40);
}

.country-body {
  flex: 1;
  display: grid;
  grid-template-columns: 1.35fr 1fr;
  min-height: 0;
}

.country-map-wrap {
  position: relative;
  padding: 24px;
  border-right: 1px solid rgba(43, 37, 31, 0.10);
  display: flex;
  align-items: center;
  justify-content: center;
}
.country-svg {
  width: 100%;
  height: 100%;
  max-height: 100%;
}
.country-land {
  fill: #ede4d2;
  stroke: rgba(43, 37, 31, 0.32);
  stroke-width: 0.25;
  stroke-linejoin: round;
}
.country-province {
  fill: none;
  stroke: rgba(43, 37, 31, 0.22);
  stroke-width: 0.18;
  stroke-dasharray: 0.9 0.7;
  stroke-linejoin: round;
  pointer-events: none;
}
.province-label {
  font-family: 'Noto Serif KR', 'JetBrains Mono', serif;
  font-size: 1.8px;
  fill: rgba(43, 37, 31, 0.42);
  letter-spacing: 0.06em;
  pointer-events: none;
  font-weight: 400;
  /* halo so labels stay readable when overlapping coastlines / dots */
  paint-order: stroke;
  stroke: var(--paper, #f5efe2);
  stroke-width: 0.42;
  stroke-linejoin: round;
}

.sub-city { cursor: pointer; }
.sub-city .sub-halo {
  fill: var(--coral, #d4775c);
  opacity: 0;
  transition: opacity 0.2s ease;
}
.sub-city .sub-dot {
  fill: var(--ink, #2a2520);
  stroke: var(--paper, #f5efe2);
  stroke-width: 0.4;
  transition: all 0.2s ease;
}
.sub-city.primary .sub-dot {
  fill: var(--gold, #b8924c);
  r: 2;
}
.sub-city .sub-label {
  font-family: 'Noto Serif KR', serif;
  font-size: 2.4px;
  fill: var(--ink, #2a2520);
  letter-spacing: 0.04em;
  pointer-events: none;
  transition: fill 0.2s ease;
  font-weight: 500;
  /* halo: stops sub-city labels colliding into a jumble when zoomed out */
  paint-order: stroke;
  stroke: var(--paper, #f5efe2);
  stroke-width: 0.55;
  stroke-linejoin: round;
}
.sub-city.primary .sub-label {
  font-size: 2.8px;
  font-weight: 600;
}
.sub-city .sub-label-en { display: none; }  /* single-language only */
.sub-city:hover .sub-halo { opacity: 0.25; }
.sub-city.open .sub-halo { opacity: 0.45; }
.sub-city.open .sub-dot {
  fill: var(--coral, #d4775c);
}
.sub-city.open .sub-label {
  fill: var(--coral, #d4775c);
  font-weight: 600;
}

.country-panel {
  padding: 24px 28px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}
.country-panel::-webkit-scrollbar { width: 6px; }
.country-panel::-webkit-scrollbar-thumb { background: rgba(43, 37, 31, 0.18); border-radius: 3px; }

.cc-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: var(--ink-soft, #6b6256);
  text-transform: uppercase;
}
.cc-name {
  font-family: 'Noto Serif KR', serif;
  font-size: 26px;
  font-weight: 600;
  color: var(--ink, #2a2520);
  margin-top: 4px;
  letter-spacing: 0.06em;
}
.cc-brief {
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  color: var(--ink, #2a2520);
  opacity: 0.78;
  margin-top: 10px;
  line-height: 1.6;
  font-style: italic;
}
.cc-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-soft, #6b6256);
  text-transform: uppercase;
  margin: 22px 0 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid rgba(43, 37, 31, 0.10);
}
.cc-media {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

@media (max-width: 760px) {
  /* on phones the deep-dive overlay scrolls with the page instead of being a fixed-height pane */
  .country-overlay {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }
  .country-zoom {
    position: relative;
    inset: auto;
    padding: 12px;
    align-items: flex-start;
    min-height: 100vh;
  }
  .country-stage {
    height: auto;
    min-height: calc(100vh - 24px);
    width: 100%;
    max-width: 100%;
  }
  .country-body {
    grid-template-columns: 1fr;
    grid-template-rows: 60vh auto; /* map fixed; deck/panel grows with content */
  }
  .country-map-wrap {
    border-right: none;
    border-bottom: 1px solid rgba(43, 37, 31, 0.10);
    height: 60vh;
  }
  /* the right panel (city deck) expands to fit content, no internal scroll */
  .country-panel { overflow: visible !important; }
  .city-deck { height: auto; min-height: 60vh; }
  .deck-stack {
    position: relative;
    min-height: 540px;
    flex: 0 0 auto;
  }
  .city-card { position: relative; inset: auto; height: auto; }
  .city-card.depth-1, .city-card.depth-2 { display: none; }
  .cc-content {
    overflow: visible !important;
    max-height: none !important;
  }
  /* deck controls follow naturally */
  .deck-controls {
    padding: 14px 0 8px;
    position: sticky;
    bottom: 0;
    background: linear-gradient(180deg, transparent, rgba(245,239,226,0.95) 30%);
    z-index: 5;
  }
}

/* ===== sub-city travel route on country map ===== */
.sub-route {
  fill: none;
  stroke: var(--coral, #d4775c);
  stroke-width: 0.45;
  stroke-dasharray: 1.2 0.8;
  opacity: 0.9;
  animation: subRouteDash 1.2s linear infinite;
}
@keyframes subRouteDash { to { stroke-dashoffset: -2; } }

.sub-city.here .sub-dot {
  fill: var(--coral, #d4775c);
  r: 2.2;
}
.sub-city.here .sub-halo {
  fill: var(--coral, #d4775c);
  opacity: 0.35;
}

/* ===== city deck (Tinder-style + Airbnb cards) ===== */
.country-panel { padding: 0 !important; overflow: hidden !important; }

.city-deck {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  padding: 18px 20px 14px;
  box-sizing: border-box;
  background: linear-gradient(180deg, rgba(245,239,226,0.85), rgba(245,239,226,1));
  position: relative;
}
.deck-stack {
  position: relative;
  flex: 1;
  min-height: 0;
}
.city-card {
  position: absolute;
  inset: 0;
  background: #fffaf2;
  border-radius: 22px;
  box-shadow: 0 16px 36px rgba(43,37,31,0.14), 0 2px 8px rgba(43,37,31,0.06);
  overflow: hidden;
  transition: transform 0.35s cubic-bezier(0.2,0.8,0.2,1),
              opacity 0.35s ease,
              box-shadow 0.35s ease;
  user-select: none;
  display: flex;
  flex-direction: column;
}
.city-card.depth-0 {
  transform: translateY(0) scale(1);
  z-index: 3;
}
.city-card.depth-1 {
  transform: translateY(10px) scale(0.965);
  opacity: 0.88;
  z-index: 2;
  pointer-events: none;
}
.city-card.depth-2 {
  transform: translateY(20px) scale(0.93);
  opacity: 0.62;
  z-index: 1;
  pointer-events: none;
}
.cc-inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  width: 100%;
  overflow-y: auto;            /* allow culture cards to scroll within the card */
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
}
.cc-inner::-webkit-scrollbar { width: 6px; }
.cc-inner::-webkit-scrollbar-thumb { background: rgba(43, 37, 31, 0.18); border-radius: 3px; }
/* All children stay at intrinsic size — no flex shrinking that causes overlap */
.cc-inner > .cc-hero,
.cc-inner > .domestic-bar,
.cc-inner > .cc-content,
.cc-inner > .job-board {
  flex-shrink: 0;
}
.cc-inner > .job-board {
  margin: 14px 16px 14px;
}
.cc-inner > .cc-content + .job-board {
  margin-top: 4px;
}
.cc-hero {
  position: relative;
  flex-shrink: 0;
  height: 162px;
  background-size: cover;
  background-position: center;
  background-color: #d4c8a8;
  display: flex;
  align-items: flex-end;
  padding: 18px 22px 16px;
  color: #fff5e8;
  cursor: grab;
  touch-action: pan-y;
}
.cc-hero:active { cursor: grabbing; }
.cc-hero-tint {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(43,37,31,0.10) 0%, rgba(43,37,31,0.55) 100%),
    linear-gradient(135deg, rgba(212,119,92,0.18), rgba(43,37,31,0.18));
  pointer-events: none;
}
.cc-hero-watermark {
  position: absolute;
  right: 14px;
  top: 8px;
  font-family: 'Noto Serif KR', serif;
  font-size: 110px;
  font-weight: 800;
  color: rgba(255, 245, 232, 0.18);
  line-height: 1;
  pointer-events: none;
  user-select: none;
  letter-spacing: -0.04em;
}
.cc-hero-meta {
  position: relative;
  z-index: 1;
  flex: 1;
}
.cc-hero .cc-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.2em;
  color: rgba(255, 245, 232, 0.78);
  text-transform: uppercase;
  margin: 0;
  text-shadow: 0 1px 2px rgba(0,0,0,0.25);
}
.cc-hero .cc-name {
  font-family: 'Noto Serif KR', serif;
  font-size: 32px;
  font-weight: 600;
  color: #fff5e8;
  margin-top: 4px;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 6px rgba(0,0,0,0.35);
}
.cc-here {
  display: inline-block;
  margin-top: 8px;
  padding: 3px 10px;
  background: var(--coral, #d4775c);
  color: #fff5e8;
  font-family: 'JetBrains Mono', monospace;
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  border-radius: 100px;
  text-shadow: none;
}
.cc-content {
  flex: 1;
  overflow-y: auto;
  padding: 18px 22px 16px;
  min-height: 0;
}
.cc-content::-webkit-scrollbar { width: 6px; }
.cc-content::-webkit-scrollbar-thumb { background: rgba(43,37,31,0.18); border-radius: 3px; }

.cc-content .cc-brief {
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  color: var(--ink, #2a2520);
  opacity: 0.78;
  line-height: 1.65;
  font-style: italic;
  margin: 0 0 14px;
}
.cc-content .cc-section-title {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.18em;
  color: var(--ink-soft, #6b6256);
  text-transform: uppercase;
  margin: 0 0 8px;
}
.cc-content .cc-media {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

/* domestic transport bar at bottom of non-current cards */
.domestic-bar {
  flex-shrink: 0;
  padding: 12px 22px 16px;
  background: linear-gradient(180deg, rgba(245,239,226,0), rgba(245,239,226,0.6));
  border-top: 1px solid rgba(43,37,31,0.08);
}
.domestic-bar .db-from {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  color: var(--ink-soft, #6b6256);
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.domestic-bar .db-from strong { color: var(--ink, #2a2520); font-weight: 600; }
.domestic-bar .db-transports {
  display: flex;
  gap: 6px;
  margin-bottom: 8px;
  flex-wrap: wrap;
}
.db-pill {
  flex: 1;
  min-width: 56px;
  padding: 8px 6px;
  background: #fff;
  border: 1px solid rgba(43,37,31,0.16);
  border-radius: 8px;
  font-family: 'Noto Serif KR', serif;
  font-size: 13px;
  color: var(--ink, #2a2520);
  cursor: pointer;
  transition: all 0.16s ease;
}
.db-pill:hover { border-color: var(--coral, #d4775c); color: var(--coral, #d4775c); }
.db-pill.active {
  background: var(--ink, #2a2520);
  color: #fff5e8;
  border-color: var(--ink, #2a2520);
}
.db-classes {
  display: flex;
  gap: 6px;
  margin-bottom: 10px;
  flex-wrap: wrap;
}
.db-class {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid rgba(43,37,31,0.18);
  border-radius: 100px;
  font-family: 'Noto Serif KR', serif;
  font-size: 12px;
  color: var(--ink, #2a2520);
  cursor: pointer;
  transition: all 0.16s ease;
}
.db-class:hover { border-color: var(--gold, #b8924c); color: var(--gold, #b8924c); }
.db-class.active {
  background: var(--gold, #b8924c);
  border-color: var(--gold, #b8924c);
  color: #fff5e8;
}
.db-depart {
  width: 100%;
  padding: 11px 14px;
  background: var(--coral, #d4775c);
  color: #fff5e8;
  border: 0;
  border-radius: 10px;
  font-family: 'Noto Serif KR', serif;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: all 0.18s ease;
  box-shadow: 0 4px 12px rgba(212,119,92,0.28);
}
.db-depart:hover {
  background: #c2624c;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(212,119,92,0.40);
}

/* deck controls */
.deck-controls {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 12px 0 0;
  flex-shrink: 0;
}
.deck-btn {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(43,37,31,0.18);
  background: #fff;
  color: var(--ink, #2a2520);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.16s ease;
}
.deck-btn:hover:not(:disabled) {
  border-color: var(--coral, #d4775c);
  color: var(--coral, #d4775c);
  transform: translateY(-1px);
}
.deck-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.deck-btn.primary {
  background: var(--ink, #2a2520);
  color: #fff5e8;
  border-color: var(--ink, #2a2520);
}
.deck-btn.primary:hover:not(:disabled) {
  background: var(--coral, #d4775c);
  border-color: var(--coral, #d4775c);
  color: #fff5e8;
}
.deck-count {
  font-family: 'JetBrains Mono', monospace;
  font-size: 13px;
  color: var(--ink, #2a2520);
  min-width: 56px;
  text-align: center;
  letter-spacing: 0.1em;
}
.deck-count .dim { color: var(--ink-soft, #6b6256); }

/* in-country travel veil */
.transit-veil {
  position: absolute;
  inset: 0;
  background: rgba(43, 37, 31, 0.5);
  backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 30;
  animation: tvFade 0.3s ease;
}
.transit-card {
  background: #fffaf2;
  border-radius: 16px;
  padding: 24px 32px;
  text-align: center;
  box-shadow: 0 24px 60px rgba(0,0,0,0.3);
  min-width: 260px;
}
.transit-card .tv-tag {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.2em;
  color: var(--coral, #d4775c);
  text-transform: uppercase;
  margin-bottom: 10px;
}
.transit-card .tv-route {
  font-family: 'Noto Serif KR', serif;
  font-size: 18px;
  color: var(--ink, #2a2520);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 14px;
}
.transit-card .tv-arrow {
  color: var(--coral, #d4775c);
  letter-spacing: -0.05em;
}
.transit-card .tv-dots {
  display: inline-flex;
  gap: 6px;
}
.transit-card .tv-dots span {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--coral, #d4775c);
  opacity: 0.3;
  animation: tvDot 1s ease-in-out infinite;
}
.transit-card .tv-dots span:nth-child(2) { animation-delay: 0.15s; }
.transit-card .tv-dots span:nth-child(3) { animation-delay: 0.3s; }
@keyframes tvFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes tvDot {
  0%, 80%, 100% { opacity: 0.3; transform: scale(1); }
  40% { opacity: 1; transform: scale(1.2); }
}

/* domestic-bar depart cost */
.db-depart {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.db-depart .dbd-label { flex-shrink: 0; }
.db-depart .dbd-cost {
  font-family: 'JetBrains Mono', monospace;
  font-size: 11px;
  letter-spacing: 0.06em;
  padding: 2px 8px;
  background: rgba(255, 245, 232, 0.20);
  border-radius: 100px;
  color: rgba(255, 245, 232, 0.92);
}
.db-depart.insufficient {
  background: #6b6256;
  cursor: not-allowed;
  opacity: 0.7;
  box-shadow: none;
}
.db-depart:disabled { transform: none !important; }

/* sub-city visited flag */
.sub-city.visited .sub-dot {
  fill: var(--coral, #d4775c);
}
.sub-city.visited .sub-halo { fill: var(--coral, #d4775c); opacity: 0.35; }
.sub-flag {
  font-size: 4px;
  text-anchor: middle;
  dominant-baseline: central;
  pointer-events: none;
}
