/* ═══════════════════════════════════════════
   Korean Travel Map – WordPress Plugin CSS
   ═══════════════════════════════════════════ */

/* ── content-area 배경/패딩 제거 ── */
#primary.content-area {
  background: transparent !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
}
.content-area .site-main {
  background: transparent !important;
  padding-top: 0 !important;
}
.entry-content {
  padding-top: 4px !important;
  margin-top: 0 !important;
}

/* ── Kadence 테마 간섭 리셋 ── */
#ktm-wrapper button,
#ktm-wrapper input,
#ktm-wrapper a {
  box-shadow: none !important;
}
#ktm-wrapper button {
  text-decoration: none !important;
  border-bottom: none !important;
}
#ktm-wrapper button::after,
#ktm-wrapper button::before {
  display: none !important;
}
#ktm-wrapper input {
  border-radius: 10px !important;
}

/* ── 아이콘 버튼/검색 버튼 Kadence 줄 완전 제거 ── */
#ktm-wrapper #ktm-search-toggle,
#ktm-wrapper #ktm-info-btn,
#ktm-wrapper #ktm-reset-btn,
.ktm-search-icon-btn {
  border: none !important;
  border-bottom: none !important;
  border-top: none !important;
  outline: none !important;
  text-decoration: none !important;
  box-shadow: none !important;
}
#ktm-wrapper #ktm-search-toggle::before,
#ktm-wrapper #ktm-search-toggle::after,
.ktm-search-icon-btn::before,
.ktm-search-icon-btn::after {
  display: none !important;
  content: none !important;
}
/* 아이콘 버튼(i, 시계)의 테두리 박스는 유지 */
#ktm-wrapper #ktm-info-btn,
#ktm-wrapper #ktm-reset-btn {
  border: 1px solid #eaeaea !important;
}
#ktm-search-input {
  border: none !important;
  outline: none !important;
  box-shadow: none !important;
}

/* ── 헤더가 스크롤 시 지도 요소에 가려지지 않도록 ── */
.site-header,
#masthead,
header.site-header {
  z-index: 9999 !important;
}
#ktm-wrapper {
  position: relative;
  z-index: 1;
  isolation: isolate;
}

/* ── Kadence 상단 여백/데코레이션 제거 ── */
.page-template-default .entry-hero,
.page-template-default .hero-section,
.kadence-page-hero,
.entry-hero-inner,
.site-above-header-wrap { display: none !important; }

/* ── 레이아웃 래퍼 ── */
#ktm-wrapper {
  display: flex;
  flex-direction: column;
  gap: 20px;
  width: 100%;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #1f2933;
  box-sizing: border-box;
}
@media (min-width: 768px) {
  #ktm-wrapper {
    flex-direction: row;
    align-items: flex-start;
    height: 700px;
  }
}
#ktm-wrapper *, #ktm-wrapper *::before, #ktm-wrapper *::after {
  box-sizing: border-box;
}

/* ── 지도 컨테이너 ── */
#ktm-map-container {
  position: relative;
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 16px;
  overflow: hidden;
  flex-shrink: 0;
  height: 360px;
  width: 100%;
}
@media (min-width: 768px) {
  #ktm-map-container {
    flex: 1;
    height: 100%;
    max-width: 650px;
  }
}

#ktm-map {
  width: 100%;
  height: 100%;
  display: block;
  outline: none;
}

/* 지역 경로 호버 */
.ktm-geo {
  transition: fill 200ms, stroke-width 200ms;
}
.ktm-geo:hover {
  opacity: 0.85;
}

/* ── 툴팁 ── */
.ktm-tooltip {
  position: absolute;
  background: #1f2933;
  color: #fff;
  font-size: 13px;
  font-weight: 500;
  padding: 6px 10px;
  border-radius: 8px;
  pointer-events: none;
  opacity: 0;
  transition: opacity 150ms;
  white-space: nowrap;
  z-index: 50;
}

/* ── 왼쪽 컨트롤 ── */
#ktm-controls-left {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.ktm-info-wrap { position: relative; }

.ktm-icon-btn {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  border: 1px solid #eaeaea;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #e47b02;
  transition: background 150ms;
  padding: 0;
}
.ktm-icon-btn:hover { background: #f9fafb; }

.ktm-info-popup {
  position: absolute;
  left: 48px;
  top: 0;
  width: 240px;
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  border: 1px solid #eaeaea;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 13px;
  color: #64748b;
  visibility: hidden;
  opacity: 0;
  transition: opacity 150ms;
  pointer-events: none;
  z-index: 30;
}

/* ── 관리자 배지 ── */
#ktm-admin-badge {
  position: absolute;
  top: 60px;
  right: 14px;
  z-index: 20;
  background: #ef4444;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  padding: 6px 12px;
  border-radius: 8px;
  display: flex;
  align-items: center;
  gap: 6px;
  animation: ktm-pulse 2s infinite;
}
@keyframes ktm-pulse {
  0%,100% { opacity: 1; }
  50%      { opacity: 0.75; }
}

/* ── 검색 ── */
#ktm-search-wrap {
  position: absolute;
  top: 14px;
  right: 14px;
  z-index: 20;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
}

#ktm-search-bar {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  border-radius: 12px;
  overflow: hidden;
  height: 40px;
  transition: background 200ms, border-color 200ms;
}
#ktm-search-bar.is-open {
  background: rgba(255,255,255,0.92);
  backdrop-filter: blur(4px);
  border: 1px solid #eaeaea;
}

.ktm-search-icon-btn {
  background: none;
  border: none;
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #9ca3af;
  flex-shrink: 0;
  padding: 0;
  transition: color 150ms;
}
.ktm-search-icon-btn:hover { color: #e47b02; }

#ktm-search-input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 14px;
  width: 0;
  opacity: 0;
  transition: width 300ms, opacity 300ms;
  padding: 0;
}

#ktm-search-clear {
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  padding: 0 8px;
  display: flex;
  align-items: center;
  transition: color 150ms;
}
#ktm-search-clear:hover { color: #6b7280; }

#ktm-search-results {
  margin-top: 8px;
  width: 260px;
  background: rgba(255,255,255,0.96);
  backdrop-filter: blur(4px);
  border: 1px solid #eaeaea;
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 4px 16px rgba(0,0,0,0.08);
}

.ktm-search-item {
  width: 100%;
  text-align: left;
  background: none;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 2px;
  transition: background 150ms;
}
.ktm-search-item:hover { background: #fff7ed; }

.ktm-si-ko { font-size: 14px; font-weight: 500; color: #1f2933; }
.ktm-si-en { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.05em; }

/* ── 사이드바 ── */
#ktm-sidebar {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 14px;
  overflow-y: auto;
  padding-bottom: 16px;
}
@media (min-width: 768px) {
  #ktm-sidebar {
    width: 340px;
    height: 100%;
    flex-shrink: 0;
  }
}

/* ── 카드 ── */
.ktm-card {
  background: #fff;
  border: 1px solid #eaeaea;
  border-radius: 16px;
  padding: 20px;
}

/* ── 통계 ── */
.ktm-card-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ktm-accent-bar {
  display: inline-block;
  width: 6px;
  height: 22px;
  border-radius: 3px;
  background: #e47b02;
  flex-shrink: 0;
}

.ktm-stats-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 10px;
}
.ktm-stats-label { font-size: 14px; color: #64748b; }
.ktm-stats-num   { font-size: 28px; font-weight: 700; color: #e47b02; }

.ktm-progress-track {
  width: 100%;
  height: 10px;
  background: #f1f5f9;
  border-radius: 5px;
  overflow: hidden;
  margin-bottom: 8px;
}
.ktm-progress-fill {
  height: 100%;
  background: #e47b02;
  border-radius: 5px;
  transition: width 500ms ease;
}
.ktm-progress-label {
  font-size: 12px;
  color: #94a3b8;
  text-align: right;
  margin: 0;
}

/* ── 지역 상세 ── */
.ktm-detail-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 4px;
}
.ktm-detail-name { font-size: 20px; font-weight: 700; margin: 0; }
.ktm-detail-eng  { font-size: 11px; color: #9ca3af; text-transform: uppercase; letter-spacing: 0.08em; margin: 0 0 12px; }

.ktm-badge { font-size: 11px; font-weight: 700; padding: 3px 8px; border-radius: 6px; white-space: nowrap; }
.ktm-badge-visited   { background: #fff7ed; color: #c2570b; }
.ktm-badge-unvisited { background: #f1f5f9; color: #64748b; }

.ktm-section       { margin-bottom: 12px; }
.ktm-section-links { margin-bottom: 0; }
.ktm-section-label { font-size: 13px; font-weight: 600; color: #6b7280; margin: 0 0 8px; }

.ktm-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.ktm-tag  {
  padding: 4px 10px;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 500;
  background: #fff7ed;
  color: #c2570b;
  border: 1px solid #fed7aa;
}

.ktm-links { display: flex; flex-direction: column; gap: 8px; }
.ktm-link  {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  background: #fff;
  text-decoration: none;
  font-size: 14px;
  color: #374151;
  transition: border-color 150ms, box-shadow 150ms, color 150ms;
}
.ktm-link:hover { border-color: #fdba74; box-shadow: 0 2px 8px rgba(0,0,0,0.06); color: #e47b02; }
.ktm-link span  { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; flex: 1; padding-right: 8px; }
.ktm-link svg   { flex-shrink: 0; color: #d1d5db; transition: color 150ms; }
.ktm-link:hover svg { color: #e47b02; }

.ktm-no-data { font-size: 14px; color: #9ca3af; font-style: italic; text-align: center; padding: 20px 0; margin: 0; }

/* ── 빈 상태 ── */
.ktm-empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 12px;
  min-height: 120px;
}
.ktm-empty-state p { font-size: 14px; color: #6b7280; margin: 0; line-height: 1.6; }

/* ── 관리자 폼 ── */
.ktm-admin-form { display: flex; flex-direction: column; gap: 20px; }
.ktm-form-group { display: flex; flex-direction: column; gap: 8px; }
.ktm-label      { font-size: 12px; font-weight: 600; color: #6b7280; }

.ktm-input {
  width: 100%;
  padding: 8px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  font-size: 14px;
  outline: none;
  background: #f9fafb;
  transition: border-color 150ms, box-shadow 150ms;
  color: #1f2933;
}
.ktm-input:focus { border-color: #e47b02; box-shadow: 0 0 0 3px rgba(228,123,2,0.12); background: #fff; }

.ktm-input-row { display: flex; gap: 8px; }

.ktm-btn-sm {
  padding: 8px 14px;
  background: #1f2933;
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  transition: background 150ms;
  flex-shrink: 0;
}
.ktm-btn-sm:hover { background: #374151; }

.ktm-tag-removable { display: flex; align-items: center; gap: 4px; }
.ktm-tag-del {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 14px;
  line-height: 1;
  color: #c2570b;
  padding: 0 2px;
  transition: color 150ms;
}
.ktm-tag-del:hover { color: #9a3412; }

.ktm-link-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #f9fafb;
  margin-bottom: 6px;
}
.ktm-link-info  { display: flex; flex-direction: column; overflow: hidden; flex: 1; }
.ktm-link-title { font-size: 13px; font-weight: 500; color: #1f2933; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ktm-link-url   { font-size: 11px; color: #9ca3af; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ktm-link-del   {
  background: none; border: none; cursor: pointer;
  padding: 4px 6px; color: #9ca3af; border-radius: 6px;
  transition: background 150ms, color 150ms; flex-shrink: 0; font-size: 15px;
}
.ktm-link-del:hover { background: #fee2e2; color: #ef4444; }

.ktm-travelogue-form { display: flex; flex-direction: column; gap: 8px; padding: 12px; border: 1px solid #e5e7eb; border-radius: 12px; background: #f9fafb; margin-top: 4px; }

/* ── 인증 ── */
#ktm-auth-area { display: flex; flex-direction: column; gap: 8px; margin-top: 4px; }

.ktm-btn-outline {
  width: 100%;
  padding: 11px;
  border: 1px solid #eaeaea;
  border-radius: 12px;
  background: #fff;
  font-size: 14px;
  font-weight: 500;
  color: #374151;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  transition: background 150ms;
}
.ktm-btn-outline:hover { background: #f9fafb; }

.ktm-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4px;
  margin-bottom: 6px;
}
.ktm-user-email { font-size: 12px; color: #9ca3af; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.ktm-logout-btn {
  background: none; border: none; cursor: pointer;
  font-size: 12px; color: #f87171;
  transition: color 150ms; flex-shrink: 0;
}
.ktm-logout-btn:hover { color: #ef4444; }

/* ── SEO 섹션 ── */
.ktm-seo-section {
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px solid #f1f5f9;
}
.ktm-seo-section h2 {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 16px;
  color: #1f2933;
}
/* 한 줄 형태: [지역명] [특산물] [포스팅 링크] */
.ktm-seo-region {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding: 10px 0;
  border-bottom: 1px solid #f1f5f9;
  font-size: 14px;
  color: #374151;
}
.ktm-seo-region strong {
  font-weight: 700;
  color: #1f2933;
}
.ktm-seo-region span {
  color: #9ca3af;
  font-size: 13px;
}
.ktm-seo-region a {
  font-size: 14px;
  color: #e47b02;
  text-decoration: none;
  border-bottom: none;
  transition: color 150ms;
}
.ktm-seo-region a:hover { color: #c26802; text-decoration: underline; }
