/* ============================================
   HTripHub v6.0 — 통합 디자인 시스템
   ============================================ */

/* ── 1. 디자인 토큰 ── */
:root {
  /* 색상 - 브랜드 */
  --ht-brand: #C64C30;
  --ht-brand-2: #E8734A;
  --ht-teal: #1D6A5E;
  --ht-teal-2: #2D9B8A;

  /* 색상 - 표면 */
  --ht-bg: #FAFAF7;
  --ht-surface: #FFFFFF;
  --ht-surface-alt: #F5F4EF;

  /* 색상 - 경계 */
  --ht-border: #E8E6DF;
  --ht-border-2: #D4D0C4;

  /* 색상 - 텍스트 */
  --ht-text-1: #1A1A16;
  --ht-text-2: #6B6860;
  --ht-text-3: #A8A49A;

  /* 색상 - 상태 */
  --ht-red: #DC2626;
  --ht-green: #16A34A;
  --ht-amber: #D97706;
  --ht-blue: #2B6CB0;

  /* 지역색 */
  --ht-r-seoul: #C64C30;
  --ht-r-busan: #2C5282;
  --ht-r-jeju: #0369A1;
  --ht-r-gangwon: #2B6CB0;
  --ht-r-gyeonggi: #2F855A;

  /* 간격 */
  --ht-s-1: 4px;
  --ht-s-2: 8px;
  --ht-s-3: 12px;
  --ht-s-4: 16px;
  --ht-s-5: 20px;
  --ht-s-6: 24px;
  --ht-s-8: 32px;
  --ht-s-10: 40px;
  --ht-s-12: 48px;
  --ht-s-16: 64px;

  /* 타이포 */
  --ht-font-body: 'Apple SD Gothic Neo', 'Noto Sans KR', system-ui, sans-serif;
  --ht-font-display: 'Georgia', 'Apple SD Gothic Neo', serif;

  /* 모서리 */
  --ht-radius-sm: 6px;
  --ht-radius-md: 12px;
  --ht-radius-lg: 20px;
  --ht-radius-pill: 999px;

  /* 그림자 */
  --ht-shadow-sm: 0 1px 2px rgba(0,0,0,.05);
  --ht-shadow-md: 0 2px 12px rgba(0,0,0,.08);
  --ht-shadow-lg: 0 8px 32px rgba(0,0,0,.12);

  /* 레이아웃 */
  --ht-nav-h: 64px;
  --ht-container: 1200px;
}

/* ── 2. 리셋 & 기본 ── */
* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--ht-font-body);
  background: var(--ht-bg);
  color: var(--ht-text-1);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; border: none; outline: none; background: none; }
img { display: block; max-width: 100%; }

/* ── 3. 컨테이너 & 레이아웃 ── */
.ht-container { max-width: var(--ht-container); margin: 0 auto; padding: 0 var(--ht-s-5); }
.ht-section { padding: var(--ht-s-12) 0; }
.ht-section-sm { padding: var(--ht-s-8) 0; }
.ht-main { min-height: calc(100vh - var(--ht-nav-h) - 200px); }

/* ── 4. 통합 네비게이션 ── */
.ht-nav {
  position: sticky; top: 0; z-index: 500;
  background: rgba(250, 250, 247, .95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--ht-border);
  height: var(--ht-nav-h);
}
.ht-nav-inner {
  max-width: var(--ht-container);
  margin: 0 auto;
  padding: 0 var(--ht-s-5);
  height: 100%;
  display: flex;
  align-items: center;
  gap: 0;
}
.ht-nav-logo {
  display: flex;
  align-items: center;
  gap: var(--ht-s-2);
  margin-right: var(--ht-s-6);
  flex-shrink: 0;
  font-family: var(--ht-font-display);
  font-size: 1.25rem;
  font-weight: 700;
  letter-spacing: -0.3px;
}
.ht-nav-logo .h { color: var(--ht-brand); font-style: italic; }
.ht-nav-logo .hub { color: var(--ht-teal); }
.ht-nav-links {
  display: flex; align-items: center; gap: 2px; flex: 1;
  overflow-x: auto; scrollbar-width: none;
}
.ht-nav-links::-webkit-scrollbar { display: none; }
.ht-nav-links a {
  padding: 8px 14px;
  border-radius: 8px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--ht-text-2);
  white-space: nowrap;
  transition: all .15s;
}
.ht-nav-links a:hover { background: var(--ht-surface-alt); color: var(--ht-text-1); }
.ht-nav-links a.active { background: var(--ht-surface-alt); color: var(--ht-text-1); font-weight: 600; }
.ht-nav-right {
  display: flex; align-items: center; gap: var(--ht-s-2);
  flex-shrink: 0; margin-left: auto;
}
.ht-nav-cta {
  background: linear-gradient(135deg, var(--ht-brand), var(--ht-brand-2));
  color: #fff !important;
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .84rem;
  font-weight: 700;
  white-space: nowrap;
}
.ht-nav-cta:hover { opacity: .9; }
.ht-nav-btn {
  padding: 8px 16px;
  border-radius: 8px;
  font-size: .82rem;
  font-weight: 600;
  background: var(--ht-teal);
  color: #fff;
}
.ht-nav-btn:hover { background: var(--ht-teal-2); }
.ht-nav-more { position: relative; }
.ht-nav-more-btn {
  padding: 8px 12px;
  border-radius: 8px;
  font-size: .85rem;
  color: var(--ht-text-2);
}
.ht-nav-more-btn:hover { background: var(--ht-surface-alt); }
.ht-nav-more-drop {
  display: none; position: absolute;
  top: 100%; right: 0;
  background: var(--ht-surface);
  border: 1px solid var(--ht-border);
  border-radius: var(--ht-radius-md);
  padding: 6px;
  min-width: 180px;
  box-shadow: var(--ht-shadow-lg);
  z-index: 9999;
  margin-top: 4px;
}
.ht-nav-more-drop.open { display: flex; flex-direction: column; }
.ht-nav-more-drop a {
  display: block;
  padding: 10px 14px;
  font-size: .84rem;
  border-radius: 6px;
  white-space: nowrap;
}
.ht-nav-more-drop a:hover { background: var(--ht-surface-alt); }

@media (max-width: 768px) {
  .ht-nav-links { display: none; }
}

/* ── 5. 히어로 ── */
.ht-hero {
  background: linear-gradient(160deg, #1A1A16 0%, #2D2A22 50%, #1D3A35 100%);
  padding: 80px var(--ht-s-5) 60px;
  text-align: center;
  color: #fff;
  position: relative;
  overflow: hidden;
}
.ht-hero h1 {
  font-size: clamp(2rem, 5vw, 3.4rem);
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: var(--ht-s-4);
}
.ht-hero h1 em { color: var(--ht-brand-2); font-style: normal; }
.ht-hero-sub {
  font-size: clamp(.9rem, 2vw, 1.1rem);
  color: rgba(255, 255, 255, .65);
  margin-bottom: var(--ht-s-8);
}

/* ── 6. 섹션 헤더 ── */
.ht-sec-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  margin-bottom: var(--ht-s-6);
  gap: var(--ht-s-4);
}
.ht-sec-title {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ht-text-1);
}
.ht-sec-title small {
  font-size: .82rem;
  font-weight: 500;
  color: var(--ht-text-3);
  margin-left: var(--ht-s-2);
}
.ht-sec-more {
  font-size: .82rem;
  color: var(--ht-text-2);
  display: flex;
  align-items: center;
  gap: 4px;
}
.ht-sec-more:hover { color: var(--ht-brand); }

/* ── 7. 카드 그리드 ── */
.ht-grid { display: grid; gap: var(--ht-s-4); }
.ht-grid-2 { grid-template-columns: repeat(2, 1fr); }
.ht-grid-3 { grid-template-columns: repeat(3, 1fr); }
.ht-grid-4 { grid-template-columns: repeat(4, 1fr); }
.ht-grid-5 { grid-template-columns: repeat(5, 1fr); }

@media (max-width: 1024px) {
  .ht-grid-5 { grid-template-columns: repeat(3, 1fr); }
  .ht-grid-4 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 640px) {
  .ht-grid-5, .ht-grid-4, .ht-grid-3 { grid-template-columns: repeat(2, 1fr); }
}

/* ── 8. 카드 (통합) ── */
.ht-card {
  background: var(--ht-surface);
  border-radius: var(--ht-radius-md);
  overflow: hidden;
  border: 1px solid var(--ht-border);
  transition: all .2s;
  cursor: pointer;
  display: flex;
  flex-direction: column;
}
.ht-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--ht-shadow-lg);
  border-color: transparent;
}

.ht-card-img {
  position: relative;
  height: 160px;
  background: var(--ht-surface-alt);
  overflow: hidden;
}
.ht-card-img img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.ht-card:hover .ht-card-img img { transform: scale(1.05); }

/* 이미지 폴백 (CSS만으로 작동) */
.ht-card-img-fallback {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  background: linear-gradient(135deg, var(--fb-color, #6B6860), var(--fb-color-2, #4B4860));
}

.ht-card-badge {
  position: absolute;
  top: 8px; left: 8px;
  background: rgba(0, 0, 0, .55);
  color: #fff;
  font-size: .68rem;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 5px;
  backdrop-filter: blur(4px);
}
.ht-card-bk {
  position: absolute;
  top: 8px; right: 8px;
  width: 32px; height: 32px;
  background: rgba(255, 255, 255, .85);
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 1rem;
  cursor: pointer;
}
.ht-card-bk:hover { background: #fff; }

.ht-card-body {
  padding: var(--ht-s-4);
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.ht-card-region {
  font-size: .72rem;
  color: var(--ht-teal);
  font-weight: 600;
}
.ht-card-name {
  font-size: .98rem;
  font-weight: 700;
  color: var(--ht-text-1);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ht-card-desc {
  font-size: .82rem;
  color: var(--ht-text-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.ht-card-meta {
  display: flex;
  gap: var(--ht-s-3);
  margin-top: auto;
  padding-top: var(--ht-s-2);
  font-size: .76rem;
  color: var(--ht-text-3);
}

/* 태그 */
.ht-tags { display: flex; flex-wrap: wrap; gap: 4px; }
.ht-tag {
  padding: 2px 8px;
  background: var(--ht-surface-alt);
  border-radius: var(--ht-radius-pill);
  font-size: .72rem;
  color: var(--ht-text-2);
}
.ht-tag.brand { background: rgba(198, 76, 48, .1); color: var(--ht-brand); }
.ht-tag.teal { background: rgba(29, 106, 94, .1); color: var(--ht-teal); }

/* ── 9. 버튼 ── */
.ht-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: 8px;
  font-size: .88rem;
  font-weight: 600;
  transition: all .15s;
  white-space: nowrap;
}
.ht-btn-primary { background: var(--ht-brand); color: #fff; }
.ht-btn-primary:hover { background: var(--ht-brand-2); }
.ht-btn-teal { background: var(--ht-teal); color: #fff; }
.ht-btn-teal:hover { background: var(--ht-teal-2); }
.ht-btn-outline {
  background: var(--ht-surface);
  border: 1.5px solid var(--ht-border);
  color: var(--ht-text-1);
}
.ht-btn-outline:hover { border-color: var(--ht-text-1); }
.ht-btn-ghost { color: var(--ht-text-2); }
.ht-btn-ghost:hover { background: var(--ht-surface-alt); color: var(--ht-text-1); }
.ht-btn-sm { padding: 6px 12px; font-size: .8rem; }
.ht-btn-lg { padding: 14px 28px; font-size: 1rem; }

/* ── 10. 폼 ── */
.ht-input, .ht-textarea, .ht-select {
  width: 100%;
  padding: 11px 14px;
  border: 1.5px solid var(--ht-border);
  border-radius: 8px;
  font-size: .92rem;
  font-family: inherit;
  background: var(--ht-surface);
  color: var(--ht-text-1);
  transition: border-color .15s;
}
.ht-input:focus, .ht-textarea:focus, .ht-select:focus {
  outline: none;
  border-color: var(--ht-brand);
}
.ht-textarea { resize: vertical; min-height: 100px; }
.ht-label {
  display: block;
  font-size: .84rem;
  font-weight: 600;
  color: var(--ht-text-1);
  margin-bottom: 6px;
}

/* ── 11. 상태 표시 ── */
.ht-empty {
  text-align: center;
  padding: 60px var(--ht-s-5);
  color: var(--ht-text-2);
  grid-column: 1 / -1;
}
.ht-empty-icon { font-size: 2.5rem; margin-bottom: var(--ht-s-3); }
.ht-empty p { font-size: .92rem; }

.ht-skeleton {
  background: linear-gradient(90deg, var(--ht-surface-alt) 25%, var(--ht-border) 50%, var(--ht-surface-alt) 75%);
  background-size: 200% 100%;
  animation: ht-skel 1.5s infinite;
  border-radius: var(--ht-radius-md);
}
.ht-skel-card { aspect-ratio: 4/3; }
@keyframes ht-skel {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.ht-loading {
  display: inline-block;
  width: 20px; height: 20px;
  border: 2px solid var(--ht-surface-alt);
  border-top-color: var(--ht-brand);
  border-radius: 50%;
  animation: ht-spin .6s linear infinite;
}
@keyframes ht-spin { to { transform: rotate(360deg); } }

/* ── 12. 토스트 ── */
.ht-toast-container {
  position: fixed;
  top: calc(var(--ht-nav-h) + 16px);
  left: 50%;
  transform: translateX(-50%);
  z-index: 99999;
  display: flex;
  flex-direction: column;
  gap: 8px;
  pointer-events: none;
}
.ht-toast {
  padding: 10px 20px;
  background: var(--ht-text-1);
  color: #fff;
  border-radius: 8px;
  font-size: .86rem;
  font-weight: 600;
  box-shadow: var(--ht-shadow-lg);
  white-space: nowrap;
  animation: ht-toast-in .3s ease-out;
  pointer-events: auto;
  max-width: 90vw;
}
.ht-toast.success { background: var(--ht-green); }
.ht-toast.error { background: var(--ht-red); }
.ht-toast.warn { background: var(--ht-amber); }
.ht-toast.info { background: var(--ht-blue); }
@keyframes ht-toast-in {
  from { opacity: 0; transform: translateY(-10px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ── 13. 모달 ── */
.ht-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .5);
  z-index: 9000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: var(--ht-s-5);
}
.ht-modal-overlay.open { display: flex; }
.ht-modal {
  background: var(--ht-surface);
  border-radius: var(--ht-radius-lg);
  max-width: 600px;
  width: 100%;
  max-height: 85vh;
  overflow-y: auto;
  position: relative;
}
.ht-modal-close {
  position: absolute;
  top: 12px; right: 12px;
  width: 32px; height: 32px;
  border-radius: 50%;
  background: var(--ht-surface-alt);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: var(--ht-text-2);
}
.ht-modal-body { padding: var(--ht-s-6); }

/* ── 14. 푸터 ── */
.ht-footer {
  background: var(--ht-surface);
  border-top: 1px solid var(--ht-border);
  padding: var(--ht-s-10) var(--ht-s-5);
  margin-top: var(--ht-s-12);
}
.ht-footer-inner {
  max-width: var(--ht-container);
  margin: 0 auto;
}
.ht-footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: var(--ht-s-8);
}
@media (max-width: 768px) {
  .ht-footer-grid { grid-template-columns: 1fr 1fr; }
}
.ht-footer h4 {
  font-size: .85rem;
  font-weight: 700;
  color: var(--ht-text-1);
  margin-bottom: var(--ht-s-3);
}
.ht-footer ul { list-style: none; display: flex; flex-direction: column; gap: 8px; }
.ht-footer a { font-size: .82rem; color: var(--ht-text-2); }
.ht-footer a:hover { color: var(--ht-brand); }
.ht-footer-bottom {
  margin-top: var(--ht-s-8);
  padding-top: var(--ht-s-5);
  border-top: 1px solid var(--ht-border);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--ht-s-3);
  font-size: .76rem;
  color: var(--ht-text-3);
}

/* ── 15. 유틸리티 ── */
.ht-flex { display: flex; }
.ht-flex-col { display: flex; flex-direction: column; }
.ht-items-center { align-items: center; }
.ht-justify-between { justify-content: space-between; }
.ht-gap-2 { gap: var(--ht-s-2); }
.ht-gap-3 { gap: var(--ht-s-3); }
.ht-gap-4 { gap: var(--ht-s-4); }
.ht-text-center { text-align: center; }
.ht-mb-2 { margin-bottom: var(--ht-s-2); }
.ht-mb-4 { margin-bottom: var(--ht-s-4); }
.ht-mb-8 { margin-bottom: var(--ht-s-8); }
.ht-hidden { display: none !important; }
