@charset "UTF-8";
@import url('https://fonts.googleapis.com/css2?family=Plus+Jakarta+Sans:wght@400;500;600;700;800&family=Noto+Sans+KR:wght@300;400;500;700;900&display=swap');

:root {
  --primary: #c92a2a; /* 베트남의 정열적인 레드/버건디 포인트 */
  --primary-hover: #a51818;
  --secondary: #087f5b; /* 베트남 열대 에메랄드 그린 */
  --accent: #f59f00; /* 황금빛 랜턴 옐로우 */
  --dark: #121820;
  --dark-surface: #1e2632;
  --light-bg: #f8fafc;
  --card-bg: #ffffff;
  --text-main: #1e293b;
  --text-muted: #64748b;
  --border: #e2e8f0;
  --shadow-sm: 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 8px 24px rgba(18, 24, 32, 0.08);
  --shadow-lg: 0 16px 36px rgba(18, 24, 32, 0.12);
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-full: 9999px;
  --transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: 'Plus Jakarta Sans', 'Noto Sans KR', -apple-system, sans-serif;
  background-color: var(--light-bg);
  color: var(--text-main);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ------------------------------------------------------------- */
/* 네비게이션 헤더 */
/* ------------------------------------------------------------- */
.navbar {
  position: sticky;
  top: var(--fx-h, 0px);   /* 환율 배너가 있으면 그 아래에 붙음 */
  z-index: 100;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  padding: 16px 32px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--dark);
}

.nav-logo-badge {
  background: linear-gradient(135deg, var(--primary), #e03131);
  color: #fff;
  font-weight: 900;
  font-size: 1.1rem;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.5px;
}

.nav-brand h1 {
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.5px;
}

.nav-brand h1 span {
  color: var(--primary);
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-link {
  text-decoration: none;
  color: var(--text-muted);
  font-weight: 600;
  font-size: 0.95rem;
  transition: var(--transition);
}

.nav-link:hover, .nav-link.active {
  color: var(--primary);
}

.nav-admin-btn {
  background: var(--dark);
  color: #fff;
  padding: 8px 18px;
  border-radius: var(--radius-full);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: var(--transition);
}

.nav-admin-btn:hover {
  background: var(--primary);
  transform: translateY(-1px);
}

/* ------------------------------------------------------------- */
/* 히어로 배너 (vietnam.travel 풍) */
/* ------------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 440px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 60px 24px;
  color: #fff;
  background: linear-gradient(180deg, rgba(18, 24, 32, 0.4) 0%, rgba(18, 24, 32, 0.75) 100%),
              url('https://images.unsplash.com/photo-1528127269322-539801943592?q=80&w=2070&auto=format&fit=crop') center/cover no-repeat;
}

.hero-tag {
  background: rgba(245, 159, 0, 0.9);
  color: #121820;
  font-size: 0.85rem;
  font-weight: 700;
  padding: 6px 16px;
  border-radius: var(--radius-full);
  margin-bottom: 16px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.hero-title {
  font-size: 2.8rem;
  font-weight: 900;
  line-height: 1.2;
  margin-bottom: 16px;
  text-shadow: 0 4px 12px rgba(0, 0, 0, 0.4);
}

.hero-subtitle {
  font-size: 1.15rem;
  max-width: 650px;
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 32px;
  font-weight: 400;
}

.search-box-wrapper {
  width: 100%;
  max-width: 600px;
  position: relative;
}

.search-input {
  width: 100%;
  padding: 18px 28px;
  padding-right: 120px;
  border-radius: var(--radius-full);
  border: none;
  font-size: 1rem;
  outline: none;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

.search-btn {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 12px 24px;
  border-radius: var(--radius-full);
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.search-btn:hover {
  background: var(--primary-hover);
}

/* ------------------------------------------------------------- */
/* 필터 영역 (지역 & 카테고리 탭) */
/* ------------------------------------------------------------- */
.filter-section {
  max-width: 1280px;
  margin: -30px auto 40px;
  position: relative;
  z-index: 10;
  padding: 0 24px;
}

.filter-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  padding: 20px 28px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.filter-row {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--text-muted);
  min-width: 50px;
}

.filter-pills {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.pill-btn {
  background: #f1f5f9;
  border: 1px solid transparent;
  color: var(--text-main);
  padding: 8px 16px;
  border-radius: var(--radius-full);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.pill-btn:hover {
  background: #e2e8f0;
}

.pill-btn.active {
  background: var(--dark);
  color: #fff;
}

.pill-btn.category-active {
  background: var(--primary);
  color: #fff;
}

/* ------------------------------------------------------------- */
/* 게시글 카드 그리드 */
/* ------------------------------------------------------------- */
.content-section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 80px;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 24px;
}

.section-title h2 {
  font-size: 1.8rem;
  font-weight: 800;
  color: var(--dark);
}

.section-title p {
  color: var(--text-muted);
  font-size: 0.95rem;
}

.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(350px, 1fr));
  gap: 28px;
}

.post-card {
  background: var(--card-bg);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  cursor: pointer;
}

.post-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: #cbd5e1;
}

.card-img-wrap {
  position: relative;
  width: 100%;
  height: 220px;
  overflow: hidden;
  background-color: #e2e8f0;
}

.card-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.post-card:hover .card-img {
  transform: scale(1.05);
}

.card-badges {
  position: absolute;
  top: 14px;
  left: 14px;
  display: flex;
  gap: 6px;
}

.badge-region {
  background: rgba(18, 24, 32, 0.85);
  backdrop-filter: blur(4px);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.badge-cat {
  background: var(--primary);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: var(--radius-full);
}

.card-body {
  padding: 22px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--dark);
  line-height: 1.4;
  margin-bottom: 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-summary {
  font-size: 0.92rem;
  color: var(--text-muted);
  line-height: 1.5;
  margin-bottom: 18px;
  flex-grow: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 14px;
  border-top: 1px solid #f1f5f9;
  font-size: 0.82rem;
  color: #94a3b8;
}

/* ------------------------------------------------------------- */
/* 글 상세 보기 모달 (Modal) */
/* ------------------------------------------------------------- */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(15, 23, 42, 0.65);
  backdrop-filter: blur(8px);
  z-index: 1000;
  display: none;
  justify-content: center;
  align-items: center;
  padding: 20px;
}

.modal-overlay.active {
  display: flex;
}

.modal-content {
  background: #fff;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  overflow-y: auto;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
  position: relative;
  animation: modalUp 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

.modal-close-btn {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 36px;
  height: 36px;
  background: rgba(0, 0, 0, 0.5);
  color: #fff;
  border-radius: 50%;
  border: none;
  font-size: 1.2rem;
  cursor: pointer;
  z-index: 10;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.modal-close-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.modal-hero-img {
  width: 100%;
  height: 360px;
  object-fit: cover;
}

.modal-body {
  padding: 32px 36px 48px;
}

.modal-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 14px;
}

.modal-title {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--dark);
  line-height: 1.35;
  margin-bottom: 16px;
}

.modal-meta {
  display: flex;
  gap: 16px;
  color: var(--text-muted);
  font-size: 0.85rem;
  margin-bottom: 24px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--border);
}

.modal-text {
  font-size: 1.05rem;
  line-height: 1.95;
  color: #334155;
  white-space: pre-line;
}

.modal-text h3 {
  font-size: 1.3rem;
  color: var(--dark);
  margin: 40px 0 14px;
}

/* ------------------------------------------------------------- */
/* 관리자 페이지 전용 스타일 */
/* ------------------------------------------------------------- */
.admin-container {
  max-width: 1100px;
  margin: 40px auto;
  padding: 0 24px;
}

.admin-header {
  margin-bottom: 32px;
}

.admin-header h1 {
  font-size: 2rem;
  font-weight: 800;
  color: var(--dark);
}

.admin-panel-card {
  background: #fff;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  border: 1px solid var(--border);
  padding: 32px;
  margin-bottom: 40px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--dark);
}

.form-input, .form-textarea, .form-select {
  width: 100%;
  padding: 12px 16px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  font-size: 1rem;
  font-family: inherit;
  outline: none;
  transition: var(--transition);
}

.form-input:focus, .form-textarea:focus, .form-select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(201, 42, 42, 0.15);
}

.form-textarea {
  min-height: 140px;
  resize: vertical;
}

.btn-primary {
  background: var(--primary);
  color: #fff;
  border: none;
  padding: 14px 28px;
  border-radius: var(--radius-sm);
  font-size: 1rem;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.btn-primary:hover {
  background: var(--primary-hover);
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
}

.btn-secondary {
  background: #f1f5f9;
  color: var(--text-main);
  border: 1px solid var(--border);
  padding: 10px 18px;
  border-radius: var(--radius-sm);
  font-size: 0.9rem;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.btn-secondary:hover {
  background: #e2e8f0;
}

.btn-danger {
  background: #fff5f5;
  color: #e03131;
  border: 1px solid #ffc9c9;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
}

.btn-danger:hover {
  background: #ffe3e3;
}

.ai-preview-box {
  background: #f8fafc;
  border-radius: var(--radius-md);
  border: 2px dashed #cbd5e1;
  padding: 24px;
  margin-top: 24px;
  display: none;
}

.ai-preview-box.active {
  display: block;
  animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.preview-img-container {
  width: 100%;
  height: 280px;
  border-radius: var(--radius-sm);
  overflow: hidden;
  margin-bottom: 16px;
  background: #000;
}

.preview-img-container img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.table-responsive {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.admin-table th, .admin-table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--border);
  text-align: left;
}

.admin-table th {
  background: #f8fafc;
  font-weight: 700;
  color: var(--text-muted);
}

/* 로딩 스피너 */
.spinner {
  display: inline-block;
  width: 20px;
  height: 20px;
  border: 3px solid rgba(255, 255, 255, 0.3);
  border-radius: 50%;
  border-top-color: #fff;
  animation: spin 0.8s ease-in-out infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* 반응형 모바일 */
@media (max-width: 768px) {
  /* 팝업은 위아래 여백을 두어 뒷배경이 보이게(그곳을 터치하면 닫힘), 닫기 버튼은 화면에 고정 */
  .modal-overlay { padding: 64px 14px 40px; }
  .modal-content { max-height: 100%; }
  .modal-close-btn {
    position: fixed;
    top: 12px;
    right: 14px;
    width: 44px;
    height: 44px;
    background: rgba(255, 255, 255, 0.95);
    color: #0f172a;
    font-size: 1.5rem;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
  }
  .hero-title { font-size: 2rem; }
  .card-grid { grid-template-columns: 1fr; }
  .navbar { padding: 12px 16px; }
  .modal-body { padding: 20px; }
  .modal-hero-img { height: 220px; }
}

/* ------------------------------------------------------------- */
/* 후원 버튼 배너 (상단 메뉴, 투네이션) */
/* ------------------------------------------------------------- */
.nav-donate-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, var(--accent), #ffb62e);
  color: var(--dark);
  text-decoration: none;
  font-size: 0.86rem;
  font-weight: 800;
  white-space: nowrap;
  box-shadow: 0 0 0 0 rgba(245, 159, 0, 0.5);
  animation: donate-pulse 2.6s ease-out infinite;
  transition: var(--transition);
}

.nav-donate-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(245, 159, 0, 0.45);
  animation: none;
}

@keyframes donate-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(245, 159, 0, 0.5); }
  70%  { box-shadow: 0 0 0 9px rgba(245, 159, 0, 0); }
  100% { box-shadow: 0 0 0 0 rgba(245, 159, 0, 0); }
}

@media (prefers-reduced-motion: reduce) {
  .nav-donate-btn { animation: none; }
}

/* 모바일: 메뉴가 한 줄에 다 들어가지 않으므로 줄바꿈 허용 (후원 버튼이 잘리지 않게) */
@media (max-width: 768px) {
  .navbar { flex-wrap: wrap; gap: 10px; }
  .nav-menu { flex-wrap: wrap; gap: 8px 14px; width: 100%; }
}

/* 카드 제목 링크 (검색 로봇이 글 주소를 찾을 수 있게 실제 링크로 둠, 화면에서는 기존 모양 유지) */
.card-link { color: inherit; text-decoration: none; }
.card-link:hover { color: var(--primary); }

/* 상단 환율 배너 (fx.js 가 값을 채우면 보임): 오른쪽에서 왼쪽으로 흐르는 전광판 */
.fx-bar {
  display: none;
  position: sticky;   /* 스크롤해도 맨 위에 고정 */
  top: 0;
  z-index: 101;
  overflow: hidden;
  background: #0f172a;
  color: #e2e8f0;
  font-size: 0.85rem;
  padding: 8px 0;
  line-height: 1.5;
}
.fx-track {
  display: inline-flex;
  white-space: nowrap;
  animation: fxScroll 40s linear infinite;
}
.fx-bar:hover .fx-track { animation-play-state: paused; }
.fx-seg { display: inline-flex; align-items: center; gap: 22px; padding-right: 56px; }
.fx-bar strong { color: #fde68a; }
.fx-bar .fx-meta { color: #94a3b8; font-size: 0.78rem; }
.fx-bar a { color: #94a3b8; text-decoration: underline; }
@keyframes fxScroll {
  from { transform: translateX(0); }
  to { transform: translateX(-50%); }
}
/* 움직임을 줄이도록 설정한 사용자에게는 멈춰 있는 한 줄로 보여 줌 */
@media (prefers-reduced-motion: reduce) {
  .fx-track { animation: none; white-space: normal; flex-wrap: wrap; justify-content: center; }
  .fx-seg:nth-child(2) { display: none; }
}

/* 배너 (banner.js): 넓은 화면은 좌우 여백에 쌓여 스크롤을 따라다니고, 좁은 화면은 아래에서 번갈아 나옴 */
.sb-item { position: relative; background: #fff; border: 1px solid var(--border); box-shadow: 0 6px 24px rgba(15, 23, 42, 0.25); border-radius: 12px; overflow: hidden; }
.sb-item img { display: block; width: 100%; height: auto; }
.sb-item .sb-ad { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(15, 23, 42, 0.65); color: #fff; padding: 1px 6px; border-radius: 4px; }
.sb-close { position: absolute; width: 24px; height: 24px; border: none; border-radius: 50%; background: rgba(15, 23, 42, 0.65); color: #fff; font-size: 16px; line-height: 24px; cursor: pointer; z-index: 2; padding: 0; }
.sb-side { display: none; position: fixed; top: 150px; width: 160px; z-index: 90; flex-direction: column; gap: 10px; max-height: calc(100vh - 170px); overflow-y: auto; scrollbar-width: none; }
.sb-side::-webkit-scrollbar { display: none; }
.sb-side.left { left: 24px; }
.sb-side.right { right: 24px; }
.sb-side .sb-item img { max-height: 220px; object-fit: contain; }
.sb-bar { position: fixed; z-index: 90; left: 50%; transform: translateX(-50%); bottom: 10px; width: min(92vw, 728px); }
.sb-bar .sb-item { max-height: 90px; }
.sb-bar .sb-item img { max-height: 90px; object-fit: contain; }
.sb-bar .sb-item[hidden] { display: none; }
.sb-bar .sb-close { top: 4px; right: 4px; }
body.has-bottom-banner { padding-bottom: 104px; }
/* 옆 배너/아래 배너 전환은 banner.js 가 화면 폭을 보고 body 에 sb-wide 를 붙임 */
body.sb-wide .sb-side { display: flex; align-items: center; }
body.sb-wide .sb-bar { display: none; }
body.sb-wide.has-bottom-banner { padding-bottom: 0; }

/* 관리자 배너 관리 (bn-): 칸·끌기·미리보기 */
.bn-col { display: flex; flex-direction: column; gap: 10px; min-height: 120px; padding: 8px; border: 1px dashed #cbd5e1; border-radius: 10px; background: #f8fafc; }
.bn-item { background: #fff; border: 1px solid #e2e8f0; border-radius: 10px; padding: 8px; }
.bn-item.bn-off { opacity: 0.6; }
.bn-item.bn-dragging { opacity: 0.35; }
.bn-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.bn-handle { cursor: grab; font-size: 0.8rem; color: #475569; background: #f1f5f9; border-radius: 6px; padding: 3px 8px; user-select: none; }
.bn-handle:active { cursor: grabbing; }
.bn-del { border: none; background: transparent; cursor: pointer; font-size: 1rem; }
.bn-preview { position: relative; display: flex; justify-content: center; background: repeating-conic-gradient(#f1f5f9 0% 25%, #fff 0% 50%) 50% / 16px 16px; border-radius: 8px; padding: 8px; }
.bn-prev-box { position: relative; max-width: 100%; border: 1px solid #e2e8f0; border-radius: 8px; overflow: hidden; background: #fff; }
.bn-ad { position: absolute; left: 4px; bottom: 4px; font-size: 10px; background: rgba(15, 23, 42, 0.65); color: #fff; padding: 1px 6px; border-radius: 4px; }
.bn-off-badge { display: none; position: absolute; top: 8px; right: 8px; background: #475569; color: #fff; font-size: 0.72rem; padding: 2px 8px; border-radius: 10px; }
.bn-item.bn-off .bn-off-badge { display: block; }
.bn-warn { margin-top: 6px; font-size: 0.78rem; color: #b45309; }
.bn-fields { display: grid; gap: 6px; margin-top: 8px; }
.bn-fields .form-input { padding: 6px 8px; font-size: 0.82rem; }
.bn-empty { border: 2px dashed #cbd5e1; border-radius: 10px; padding: 22px 10px; text-align: center; color: #64748b; font-size: 0.88rem; font-weight: 600; cursor: pointer; background: #fff; }
.bn-empty:hover { border-color: #2563eb; color: #2563eb; background: #eff6ff; }
.bn-drop-line { height: 4px; background: #2563eb; border-radius: 4px; }
@media (max-width: 900px) { #bannerBoard { grid-template-columns: 1fr !important; } }
