/*
 * country-status-modal.css — 국가 모달·지도 스테이지 스타일(country-status 전용 로드).
 * /main 은 로드하지 않으므로 동일 클래스명을 덮어써도 /main 에 영향 없음.
 * 1) 위험도순 국가 요약 = 풀폭 2열 그리드 (세부정보 패널 제거 후)
 * 2) 국가 클릭 모달 (국가 세부정보 + 상품별 추이 차트)
 * 3) 지구본 아래 경보(Alert) 설명문
 */

/* 1) 요약 그리드 — 세부 패널 제거 → 요약이 좌측 컬럼 풀폭, 리스트는 2열 */
.home-content .home-globe-summary-grid {
  grid-template-columns: 1fr;
}

.home-content .home-hidden-corner {
  width: 100%;
}

.home-content .home-hidden-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
  max-height: var(--home-panel-height, 496px);
  overflow: auto;
}

.home-content .home-hidden-list > li {
  margin: 0;
}

/* 2) 국가 세부정보 모달 */
.home-country-modal {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: none;
  pointer-events: none;
}

.home-country-modal.is-open {
  display: block;
}

.home-country-modal-dialog {
  position: fixed;
  top: var(--home-country-modal-center-y, 50vh);
  left: var(--home-country-modal-center-x, 50vw);
  transform: translate(-50%, -50%);
  pointer-events: auto;
  width: min(800px, calc(100vw - 48px));
  max-height: 82vh;
  overflow-y: auto;
  padding: 22px 22px 20px;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  color: #1f2937;
}

.home-country-modal-close {
  position: absolute;
  top: 14px;
  right: 16px;
  width: 34px;
  height: 34px;
  border: none;
  background: transparent;
  font-size: 26px;
  line-height: 1;
  color: #6b7280;
  cursor: pointer;
}

.home-country-modal-close:hover {
  color: #111827;
}

.home-country-modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
  padding-right: 32px;
}

.home-country-modal-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.home-country-modal-country {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-width: 0;
}

.home-country-modal-nav-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 36px;
  width: 36px;
  height: 36px;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.home-country-modal-nav-button:hover,
.home-country-modal-nav-button:focus-visible {
  background: #f5f8ff;
  border-color: rgba(47, 106, 255, 0.35);
  color: #0d42a6;
}

.home-country-modal-nav-button:disabled {
  opacity: 0.35;
  cursor: default;
}

.home-country-modal-flag {
  width: 42px;
  height: 28px;
  object-fit: cover;
  border-radius: 4px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.08);
}

.home-country-modal-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  white-space: nowrap;
}

.home-country-modal-section-title {
  margin: 12px 0 10px;
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

.home-country-modal-periods {
  flex: 0 0 auto;
  margin: 0;
}

.home-country-modal-body {
  display: grid;
  grid-template-columns: 1fr; /* 순위 위 · 그래프 아래 세로 스택 (그래프가 순위 아래로 온다) */
  gap: 18px;
  align-items: stretch;
}

/* 두 추이 그래프(월별 국가·상품별)를 순위 아래에서 가로로 나열 — 폭 고정 + 횡스크롤로 넘겨 본다.
   모바일에선 scroll-snap 으로 1개씩 스와이프(아래 업종별 표와 동일 감각). */
.home-country-modal-chart-stack {
  display: flex;
  gap: 14px;
  align-items: stretch;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 6px;
}

.home-country-modal-country-trend-panel,
.home-country-modal-rank-panel,
.home-country-modal-trend-panel {
  display: flex;
  flex-direction: column;
  min-width: 0;
  height: 100%;
}

/* 그래프 패널만 폭 고정 + 스냅(순위 패널 제외) — 두 그래프가 다 안 들어가면 횡스크롤.
   하한 280px: 초협폭에서도 그래프가 뭉개지지 않게 min-width 방어(넘치면 스택 횡스크롤이 수용). */
.home-country-modal-country-trend-panel,
.home-country-modal-trend-panel {
  flex: 0 0 clamp(280px, 92%, 680px);
  min-width: 280px;
  scroll-snap-align: start;
}

.home-country-modal-metrics {
  display: grid;
  grid-template-columns: 1fr;
  gap: 5px;
  flex: 1 1 auto;
}

.home-country-modal-metric-row {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 9px;
  width: 100%;
  min-height: 34px;
  padding: 5px 9px;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  background: #ffffff;
  color: inherit;
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition:
    border-color 0.16s ease,
    background-color 0.16s ease,
    box-shadow 0.16s ease;
}

.home-country-modal-metric-row:hover,
.home-country-modal-metric-row:focus-visible,
.home-country-modal-metric-row.is-active {
  border-color: rgba(47, 106, 255, 0.38);
  background: #ffffff;
  box-shadow: 0 8px 18px rgba(47, 106, 255, 0.1);
}

.home-country-modal-metric-rank {
  text-align: center;
  font-weight: 700;
  color: #9ca3af;
}

.home-country-modal-metric-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 auto;
  min-width: 0;
}

.home-country-modal-metric-category {
  font-size: 13px;
  color: #1a2b4a;
}

.home-country-modal-risk-badge {
  flex: 0 0 auto;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  color: #ffffff;
  background: #9ca3af;
}

.home-country-modal-risk-badge.high {
  background: var(--home-risk-high, #ee3636);
}

.home-country-modal-risk-badge.caution {
  background: var(--home-risk-caution, #eea300);
}

.home-country-modal-risk-badge.low {
  background: var(--home-risk-low, #0ea833);
  color: #ffffff;
}

.home-country-modal-risk-badge.safe {
  background: var(--home-risk-safe, #187dea);
}

.home-country-modal-risk-badge.none {
  background: #9ca3af;
}

.home-country-modal-metric-row.is-nodata {
  cursor: default;
  opacity: 0.78;
}

.home-country-modal-chart-wrap {
  position: relative;
  flex: 1 1 auto;
  height: 170px;
  min-height: 160px;
  padding: 10px;
  border: 1px solid #eef0f3;
  border-radius: 10px;
  background: #fafbfc;
}

.home-country-modal-country-chart-wrap {
  height: 170px;
  min-height: 160px;
}

/* 3) 지구본 아래 경보(Alert) 설명문 */
.home-alert-explainer {
  max-width: 1180px;
  margin: 16px auto 4px;
  color: #ffffff;
  font-size: 14px;
  line-height: 1.7;
  text-align: center;
  opacity: 0.92;
}

.home-alert-explainer strong {
  font-weight: 700;
}

/* 4) 선명도 보정 — 히어로/지구본이 흐려 보이는 문제(저채도·죽은 불투명도) 개선.
 *    A~F 지구본 테마 색(--home-risk-* / [data-globe-theme])은 건드리지 않음. */

/* 지구본 캔버스: 채도·대비·명도 boost → 선명하게 */
.home-content #home-scene canvas {
  filter: saturate(1.3) contrast(1.1) brightness(1.05);
}

/* 히어로 배경: 저채도 이미지 위에 진한 네이비 그라데이션을 덧대 톤을 선명하게(대비↑) */
.home-content .slide_item.slide_item02 {
  background-image:
    linear-gradient(
      120deg,
      rgba(7, 11, 38, 0.5) 0%,
      rgba(18, 28, 78, 0.28) 48%,
      rgba(9, 14, 50, 0.55) 100%
    ),
    url("../images/front/main/slide_bg.jpg");
  background-repeat: no-repeat;
  background-position: center;
  background-size: cover;
}

/* 죽어 있던 텍스트 불투명도 → 또렷하게 */
.home-content .home-stage-header-copy span {
  color: rgba(255, 255, 255, 0.92);
}

/* 요약 카드/리스트 텍스트 대비 강화 */
.home-content .home-hidden-title {
  color: #ffffff;
}

.home-content .home-hidden-item {
  border-color: rgba(148, 163, 184, 0.42);
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 12px rgba(30, 64, 175, 0.12);
}

.home-content .home-hidden-name {
  color: #ffffff;
}

/* 위험도순 국가 요약 — 항목 앞 위험도 색 점 제거(위험도는 우측 칩으로 표시) */
.home-content .home-hidden-item .dot {
  display: none;
}

@media screen and (max-width: 1200px) {
  .home-country-modal-dialog {
    width: min(760px, calc(100vw - 32px));
  }

  .home-country-modal-body,
  .home-country-modal-chart-stack {
    gap: 14px;
  }
}

@media screen and (max-width: 640px) {
  .home-country-modal-dialog {
    width: calc(100vw - 24px);
    max-height: calc(100vh - 24px);
    padding: 22px 16px 18px;
    border-radius: 12px;
  }

  .home-country-modal-head {
    align-items: stretch;
    flex-direction: column;
    gap: 8px;
    padding-right: 0;
  }

  .home-country-modal-nav {
    justify-content: center;
  }

  .home-country-modal-country {
    gap: 8px;
  }

  .home-country-modal-nav-button {
    flex-basis: 32px;
    width: 32px;
    height: 32px;
    font-size: 22px;
  }

  .home-country-modal-periods {
    width: 100%;
  }

  .home-country-modal-periods,
  .home-country-modal-periods .home-summary-period-button,
  .home-country-modal-periods .home-summary-period-menu {
    width: 100%;
  }

  .home-country-modal-metrics {
    grid-template-columns: 1fr;
  }

  .home-country-modal-metric-row {
    grid-template-columns: 22px minmax(0, 1fr) auto;
    gap: 9px;
    padding: 9px 10px;
  }

  .home-country-modal-chart-wrap {
    height: 220px;
  }

  .home-country-modal-country-chart-wrap {
    height: 210px;
  }
}

/* 국가 모달 → 국가별 상세(country-status) 이동 링크 (2026-07-01) */
.home-country-modal-detail-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  margin-top: 14px;
  padding: 10px 18px;
  border-radius: 10px;
  background: #143070;
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  text-decoration: none;
  transition: background-color 0.18s ease;
}
.home-country-modal-detail-link:hover,
.home-country-modal-detail-link:focus-visible {
  background: #0d42a6;
}
