@import url('https://fonts.googleapis.com/css2?family=Be+Vietnam+Pro:wght@400;500;600;700;800;900&display=swap');

:root {
  --red: #DA251D;
  --red-deep: #C81E1E;
  --red-dark: #B71C1C;
  --red-darker: #A31515;
  --gold: #FFC72C;
  --gold-light: #FFD970;
  --cream: #fbf3e2;
  --text: #2b1810;
  --muted: #8a6d5a;
  --border: #ecdcc0;
  --badge-bg: #fbe8d8;
  --badge-text: #8a6d1f;
  --shadow-sm: 0 2px 8px rgba(140,16,23,0.08);
  --shadow-md: 0 4px 16px rgba(140,16,23,0.12);
  --shadow-lg: 0 8px 32px rgba(140,16,23,0.16);
  --shadow-glow: 0 0 20px rgba(218,37,29,0.3);
  --transition-fast: 0.15s ease;
  --transition-normal: 0.3s ease;
  --transition-slow: 0.5s ease;
}

* {
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
}

html { scroll-behavior: smooth; }

html, body {
  margin: 0;
  background: var(--cream);
  color: var(--text);
  font-family: 'Be Vietnam Pro', sans-serif;
}

a { color: var(--red); text-decoration: none; transition: color var(--transition-fast); }
a:hover { color: var(--red-dark); }

.page { min-height: 100vh; display: flex; flex-direction: column; }

/* ========== HEADER ========== */
.site-header {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, var(--red-deep), var(--red));
  border-bottom: 3px solid var(--gold);
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  padding: 12px clamp(14px, 4vw, 40px);
  box-shadow: var(--shadow-md);
}
.site-header::before {
  content: '';
  position: absolute;
  bottom: -3px;
  left: 0;
  width: 100%;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--gold-light), var(--gold));
  opacity: 0.8;
}

.brand {
  display: flex; align-items: center; gap: 10px; cursor: pointer;
  transition: transform var(--transition-fast);
}
.brand:hover { transform: scale(1.02); }

.brand-mark {
  width: 36px; height: 36px; flex-shrink: 0; border-radius: 8px;
  background: var(--gold); display: flex; align-items: center; justify-content: center;
  color: #6b1010; font-weight: 900; font-size: 17px;
  box-shadow: 0 2px 8px rgba(255,199,44,0.4);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}
.brand:hover .brand-mark {
  transform: rotate(-5deg) scale(1.05);
  box-shadow: 0 4px 12px rgba(255,199,44,0.5);
}

.brand-name { font-weight: 800; font-size: 16px; letter-spacing: 0.4px; color: #fff; line-height: 1.1; }
.brand-tag { font-size: 10px; color: var(--gold); letter-spacing: 0.8px; font-weight: 600; }

.nav { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-link {
  background: transparent; border: none; padding: 9px 16px; border-radius: 8px;
  font-weight: 600; font-size: 14px; cursor: pointer; color: #fbe8d8;
  font-family: inherit;
  transition: all var(--transition-fast);
  position: relative;
}
.nav-link::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 50%;
  width: 0;
  height: 2px;
  background: var(--gold);
  border-radius: 2px;
  transition: all var(--transition-normal);
  transform: translateX(-50%);
}
.nav-link:hover::after { width: 60%; }
.nav-link.active { background: rgba(255, 199, 44, 0.16); color: var(--gold); font-weight: 700; }
.nav-link.active::after { width: 40%; }

/* ========== HERO SECTION ========== */
.hero {
  background: radial-gradient(circle at 15% 20%, #E63946, var(--red-dark) 70%);
  padding: clamp(40px, 10vw, 100px) clamp(16px, 5vw, 40px);
  position: relative; overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -20%;
  width: 60%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255,199,44,0.08) 0%, transparent 70%);
  animation: heroFloat 20s ease-in-out infinite;
}

@keyframes heroFloat {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-5%) rotate(3deg); }
}

.hero-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 36px; align-items: center; position: relative; z-index: 1;
}

.eyebrow {
  display: inline-block; background: var(--gold); color: #5c1010;
  font-size: 13px; font-weight: 800; padding: 6px 16px; border-radius: 100px;
  margin-bottom: 20px; letter-spacing: 0.3px;
  animation: eyebrowPulse 3s ease-in-out infinite;
}

@keyframes eyebrowPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(255,199,44,0.4); }
  50% { box-shadow: 0 0 0 8px rgba(255,199,44,0); }
}

.hero-title {
  font-size: clamp(28px, 6vw, 48px); font-weight: 900; line-height: 1.18;
  margin: 0 0 18px; color: var(--gold); text-shadow: 0 2px 12px rgba(0,0,0,0.25);
  animation: fadeInUp 0.8s ease-out;
}
.hero-sub {
  font-size: 16px; line-height: 1.75; color: #fbe8d8; margin: 0 0 28px; max-width: 520px;
  animation: fadeInUp 0.8s ease-out 0.1s both;
}
.hero-actions {
  display: flex; gap: 12px; flex-wrap: wrap;
  animation: fadeInUp 0.8s ease-out 0.2s both;
}

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

.hero-feature {
  min-height: 360px; border-radius: 18px; overflow: hidden; position: relative; display: block;
  box-shadow: 0 24px 55px rgba(56, 4, 7, .35);
  animation: fadeInUp 0.8s ease-out 0.3s both;
  transition: transform var(--transition-normal), box-shadow var(--transition-normal);
}
.hero-feature:hover {
  transform: translateY(-8px) scale(1.02);
  box-shadow: 0 32px 70px rgba(56, 4, 7, .45);
}
.hero-feature img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 0.6s ease; }
.hero-feature:hover img { transform: scale(1.08); }
.hero-feature::after { content: ''; position: absolute; inset: 40% 0 0; background: linear-gradient(transparent, rgba(26, 3, 4, .9)); transition: opacity var(--transition-normal); }
.hero-feature:hover::after { opacity: 0.8; }

.hero-feature-caption { position: absolute; z-index: 1; left: 24px; right: 24px; bottom: 22px; color: #fff; display: flex; flex-direction: column; gap: 5px; transition: transform var(--transition-normal); }
.hero-feature:hover .hero-feature-caption { transform: translateY(-10px); }
.hero-feature-caption span { color: var(--gold); font-size: 12px; font-weight: 800; text-transform: uppercase; }
.hero-feature-caption strong { font-size: 22px; line-height: 1.25; }
.hero-feature-caption small { color: #f8e7c3; }

/* Hero Badge Animation */
.hero-badge-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(8px);
  padding: 8px 14px;
  border-radius: 20px;
  font-size: 12px;
  color: #fff;
  margin-bottom: 12px;
}
.hero-badge-icon svg { width: 16px; height: 16px; }

/* ========== BUTTONS ========== */
.btn {
  border: none; padding: 14px 26px; border-radius: 8px; font-size: 15px; font-weight: 800;
  cursor: pointer; font-family: inherit;
  transition: all var(--transition-fast);
  position: relative;
  overflow: hidden;
}
.btn::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 0;
  height: 0;
  background: rgba(255,255,255,0.2);
  border-radius: 50%;
  transform: translate(-50%, -50%);
  transition: width 0.6s, height 0.6s;
}
.btn:hover::before { width: 300px; height: 300px; }

.btn-gold { background: var(--gold); color: #5c1010; }
.btn-gold:hover { background: var(--gold-light); transform: translateY(-2px); box-shadow: 0 6px 20px rgba(255,199,44,0.4); }

.btn-outline { background: transparent; color: #fff; border: 2px solid rgba(251,232,216,0.4); padding: 12px 24px; font-weight: 700; }
.btn-outline:hover { background: rgba(255,255,255,0.1); border-color: rgba(251,232,216,0.7); }

.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-deep); transform: translateY(-2px); box-shadow: var(--shadow-glow); }

.btn-muted { background: #f0e6d6; color: #5a4034; }
.btn-muted:hover { background: #e8dcc6; transform: translateY(-1px); }

/* ========== STATS ========== */
.stats {
  background: var(--red-darker);
  padding: 28px clamp(16px, 5vw, 40px);
  position: relative;
  overflow: hidden;
}
.stats::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: repeating-linear-gradient(
    45deg,
    transparent,
    transparent 40px,
    rgba(255,199,44,0.03) 40px,
    rgba(255,199,44,0.03) 80px
  );
}

.stats-grid {
  max-width: 1280px; margin: 0 auto;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
  gap: 16px; text-align: center;
  position: relative;
}

.stat-item {
  padding: 20px;
  border-radius: 12px;
  background: rgba(255,255,255,0.05);
  transition: all var(--transition-normal);
}
.stat-item:hover {
  background: rgba(255,255,255,0.1);
  transform: translateY(-4px);
}

.stat-num {
  font-size: 36px; font-weight: 900; color: var(--gold);
  display: block;
  background: linear-gradient(135deg, var(--gold), var(--gold-light));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}
.stat-label { color: #fbe8d8; font-size: 14px; margin-top: 4px; }

/* ========== SECTIONS & CARDS ========== */
.section {
  padding: clamp(36px, 8vw, 64px) clamp(16px, 5vw, 40px);
  max-width: 1280px; margin: 0 auto;
}

.section-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-bottom: 24px;
}
.section-title {
  font-size: 24px; font-weight: 800; margin: 0; color: var(--red-dark);
  position: relative;
  display: inline-block;
}
.section-title::after {
  content: '';
  position: absolute;
  bottom: -8px;
  left: 0;
  width: 60px;
  height: 3px;
  background: var(--gold);
  border-radius: 3px;
}

.card-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 20px;
}

.card {
  border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff;
  cursor: pointer; box-shadow: var(--shadow-sm); display: block;
  transition: all var(--transition-normal);
  opacity: 0;
  transform: translateY(30px);
}
.card.visible {
  opacity: 1;
  transform: translateY(0);
}
.card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-lg);
  border-color: var(--gold);
}

.card-thumb-img {
  width: 100%; height: 190px; object-fit: cover; display: block;
  transition: transform 0.6s ease;
}
.card:hover .card-thumb-img { transform: scale(1.08); }

.card-thumb {
  position: relative;
  overflow: hidden;
}
.card-thumb::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: linear-gradient(transparent, rgba(140,16,23,0.3));
  transition: height var(--transition-normal);
}
.card:hover .card-thumb::after { height: 100px; }

.card-thumb-empty {
  background: linear-gradient(135deg, #8f1118, #d62b24);
  height: 190px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card-thumb-empty span { color: var(--gold); font-family: inherit; font-size: 52px; font-weight: 900; }

.card-body { padding: 18px; }
.card-body .badge { transition: all var(--transition-fast); }
.card:hover .badge {
  background: var(--gold);
  color: #5c1010;
}

.badge {
  display: inline-block; background: var(--badge-bg); color: var(--badge-text);
  font-size: 11px; font-weight: 700; padding: 3px 10px; border-radius: 100px;
  margin-bottom: 10px; border: 1px solid rgba(255,199,44,0.33);
}

.card-title {
  font-weight: 700; font-size: 16px; line-height: 1.4; margin: 0 0 6px; color: var(--text);
  transition: color var(--transition-fast);
}
.card:hover .card-title { color: var(--red); }

.card-loc { color: var(--muted); font-size: 13px; display: flex; align-items: center; gap: 4px; }
.card-loc svg { width: 12px; height: 12px; opacity: 0.7; }
.card-summary { color: #5a4034; font-size: 13px; line-height: 1.6; margin-top: 10px; }
.card-meta {
  color: var(--muted); font-size: 11px; margin-top: 12px;
  display: flex;
  align-items: center;
  gap: 4px;
}
.card-meta svg { width: 12px; height: 12px; }

/* ========== LIST PAGE ========== */
.page-banner {
  background: linear-gradient(120deg, var(--red-deep), var(--red));
  padding: clamp(36px, 8vw, 56px) clamp(16px, 5vw, 40px);
  position: relative;
  overflow: hidden;
}
.page-banner::before {
  content: '';
  position: absolute;
  top: -50%;
  right: -10%;
  width: 40%;
  height: 200%;
  background: radial-gradient(ellipse, rgba(255,199,44,0.1) 0%, transparent 60%);
}

.page-banner .inner { max-width: 1280px; margin: 0 auto; position: relative; }
.page-banner h1 {
  font-size: clamp(24px, 5vw, 32px); font-weight: 900; margin: 0 0 8px; color: var(--gold);
  animation: fadeInUp 0.6s ease-out;
}
.page-banner p { color: #fbe8d8; margin: 0; font-size: 15px; animation: fadeInUp 0.6s ease-out 0.1s both; }

.list-wrap { max-width: 1280px; margin: 0 auto; padding: 28px clamp(16px, 5vw, 40px) 56px; }

.list-controls {
  display: flex; gap: 16px; align-items: center; margin-bottom: 20px; flex-wrap: wrap;
  animation: fadeInUp 0.6s ease-out 0.2s both;
}

.search-input {
  flex: 1; min-width: 240px; padding: 12px 16px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; background: #fff;
  transition: all var(--transition-fast);
}
.search-input:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(218,37,29,0.1);
}

.view-toggle { display: flex; gap: 8px; background: #f5e6cc; padding: 4px; border-radius: 8px; }
.view-toggle button {
  background: transparent; color: var(--muted); border: none; padding: 7px 16px;
  border-radius: 6px; font-weight: 600; font-size: 13px; cursor: pointer; font-family: inherit;
  transition: all var(--transition-fast);
}
.view-toggle button.active { background: #fff; color: var(--text); font-weight: 700; box-shadow: var(--shadow-sm); }
.view-toggle button:hover:not(.active) { color: var(--text); }

.chip-row { display: flex; gap: 8px; margin-bottom: 32px; flex-wrap: wrap; }
.chip {
  background: #fff; color: var(--red-dark); border: 1px solid var(--border); padding: 8px 16px;
  border-radius: 100px; font-size: 13px; font-weight: 600; cursor: pointer; font-family: inherit;
  transition: all var(--transition-fast);
}
.chip:hover {
  border-color: var(--red);
  color: var(--red);
  transform: translateY(-2px);
}
.chip.active { background: var(--red); color: #fff; border-color: transparent; font-weight: 700; }
.chip.active:hover { background: var(--red-deep); }

.result-summary { color: var(--muted); font-size: 13px; margin: -12px 0 18px; }
.empty-state { padding: 60px 0; text-align: center; color: var(--muted); }
.map-layout { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 20px; }

/* ========== DETAIL PAGE ========== */
.detail-hero {
  position: relative;
  background: linear-gradient(to bottom, rgba(0,0,0,0.05), rgba(0,0,0,0.8)),
    repeating-linear-gradient(45deg, var(--red-deep), var(--red-deep) 10px, var(--red) 10px, var(--red) 20px);
  height: 420px; display: flex; flex-direction: column; justify-content: flex-end; overflow: hidden;
  background-size: cover;
  background-position: center;
  transition: background-image 0.6s ease;
}

.detail-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to bottom,
    rgba(0,0,0,0.2) 0%,
    rgba(0,0,0,0.4) 50%,
    rgba(0,0,0,0.8) 100%
  );
  z-index: 1;
}

.detail-back {
  position: absolute; top: 24px; left: 24px; z-index: 3; font-size: 13px; font-weight: 700; color: #fff;
  background: rgba(0,0,0,0.35); padding: 8px 14px; border-radius: 100px;
  transition: all var(--transition-fast);
  backdrop-filter: blur(4px);
}
.detail-back:hover {
  background: rgba(0,0,0,0.5);
  transform: translateX(-4px);
  color: var(--gold);
}

.detail-hero-fill { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; z-index: 0; }
.detail-hero-fill span { font-family: monospace; font-size: 12px; color: rgba(255,255,255,0.47); }

.detail-hero-content {
  position: relative; z-index: 2; padding: 28px clamp(16px, 5vw, 40px); width: 100%; max-width: 1280px; margin: 0 auto;
  animation: fadeInUp 0.8s ease-out;
}

.detail-title {
  font-size: clamp(22px, 5.5vw, 38px); font-weight: 900; margin: 0 0 10px; line-height: 1.25;
  color: #fff; text-shadow: 0 2px 16px rgba(0,0,0,0.4); max-width: 760px;
}
.detail-meta { color: #f5e6cc; font-size: 13px; font-weight: 600; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.detail-meta svg { width: 14px; height: 14px; opacity: 0.8; }

.detail-wrap { max-width: 1280px; margin: 0 auto; padding: 24px clamp(16px, 5vw, 40px) 56px; }
.detail-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); gap: 32px; }

/* Tabs */
.tabs {
  display: flex; gap: 4px; border-bottom: 2px solid var(--border); margin-bottom: 24px;
  overflow-x: auto;
  position: relative;
}
.tabs::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 100%;
  height: 2px;
  background: var(--border);
}

.tab-btn {
  background: transparent; border: none; border-bottom: 2px solid transparent; color: var(--muted);
  padding: 10px 16px; font-weight: 600; font-size: 14px; cursor: pointer; white-space: nowrap; font-family: inherit;
  transition: all var(--transition-fast);
  position: relative;
  top: 2px;
}
.tab-btn:hover { color: var(--red); }
.tab-btn.active {
  border-bottom-color: var(--red); color: var(--red); font-weight: 700;
  background: rgba(218,37,29,0.05);
  border-radius: 8px 8px 0 0;
}

.tab-panel { display: none; animation: fadeIn 0.3s ease; }
.tab-panel.active { display: block; }

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

.quote-box {
  margin: 0 0 28px; padding: 18px 24px; background: var(--badge-bg); border-left: 4px solid var(--red);
  border-radius: 0 10px 10px 0; font-size: 16px; font-style: italic; color: #5a2a1a; line-height: 1.7;
  position: relative;
}
.quote-box::before {
  content: '"';
  position: absolute;
  top: -10px;
  left: 16px;
  font-size: 48px;
  color: var(--red);
  opacity: 0.2;
  font-family: Georgia, serif;
}

.article-body { font-size: 16px; line-height: 2; color: #332018; white-space: pre-line; }

/* Article Enhancement */
.article-body p {
  margin-bottom: 1.5em;
  text-align: justify;
}
.article-body h2, .article-body h3 {
  color: var(--red-dark);
  margin-top: 2em;
  margin-bottom: 0.8em;
}
.article-body h2 { font-size: 1.4em; }
.article-body h3 { font-size: 1.2em; }
.article-body img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 1.5em 0;
}

/* Gallery */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 16px;
}
.gallery-grid figure {
  margin: 0;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  cursor: pointer;
  transition: transform var(--transition-normal);
}
.gallery-grid figure:hover {
  transform: scale(1.03);
  box-shadow: var(--shadow-lg);
}
.gallery-grid img {
  width: 100%; height: 220px; object-fit: cover; border-radius: 10px; display: block;
  transition: transform 0.6s ease;
}
.gallery-grid figure:hover img { transform: scale(1.1); }
.gallery-grid figcaption {
  color: var(--muted); font-size: 12px; margin-top: 6px;
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 12px;
  background: linear-gradient(transparent, rgba(0,0,0,0.7));
  color: #fff;
  border-radius: 0 0 10px 10px;
  transform: translateY(100%);
  transition: transform var(--transition-normal);
}
.gallery-grid figure:hover figcaption { transform: translateY(0); }

/* PDF */
.pdf-viewer { display: flex; flex-direction: column; align-items: center; gap: 18px; width: 100%; }
.pdf-book { padding: 16px; background: #efe3cc; border-radius: 16px; box-shadow: 0 16px 40px rgba(0,0,0,0.15); width: 100%; max-width: 420px; }
.pdf-page {
  background: #fffaf0; padding: 26px 22px 44px; position: relative; min-height: 380px;
  border-radius: 4px; box-shadow: 0 4px 18px rgba(0,0,0,0.15);
  transform: rotateY(0) scale(1); opacity: 1; transition: all .2s ease;
}
.pdf-page.flipping { transform: rotateY(8deg) scale(0.97); opacity: 0.5; }
.pdf-page-title { font-size: 11px; font-weight: 700; color: var(--muted); margin-bottom: 14px; letter-spacing: 0.5px; }
.pdf-line { height: 9px; border-radius: 3px; background: #e7ddc9; margin-bottom: 11px; }
.pdf-page-num { position: absolute; bottom: 16px; left: 0; right: 0; text-align: center; font-size: 12px; color: var(--muted); font-family: monospace; }
.pdf-controls { display: flex; align-items: center; gap: 16px; }
.pdf-nav-btn {
  background: #fff; color: var(--text); border: 1px solid var(--border); width: 40px; height: 40px;
  border-radius: 8px; font-weight: 700; font-size: 16px; cursor: pointer; font-family: inherit;
  transition: all var(--transition-fast);
}
.pdf-nav-btn:hover { background: var(--red); color: #fff; border-color: var(--red); }
.pdf-nav-btn.primary { background: var(--red); color: #fff; border: none; }
.pdf-nav-btn:disabled { background: #eee; color: #bbb; cursor: default; }
.pdf-counter { font-size: 13px; color: var(--muted); font-family: monospace; }

/* Audio */
.audio-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 28px; background: #fff;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}
.audio-card:hover { box-shadow: var(--shadow-md); }
.audio-title { font-weight: 700; margin-bottom: 16px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.audio-title svg { width: 20px; height: 20px; color: var(--red); }

.audio-row { display: flex; align-items: center; gap: 16px; }
.audio-play {
  width: 44px; height: 44px; border-radius: 50%; background: var(--red); color: #fff;
  display: flex; align-items: center; justify-content: center; font-size: 16px; cursor: pointer;
  flex-shrink: 0; border: none;
  transition: all var(--transition-fast);
}
.audio-play:hover {
  background: var(--red-deep);
  transform: scale(1.1);
  box-shadow: var(--shadow-glow);
}
.audio-track { flex: 1; height: 6px; border-radius: 100px; background: var(--border); position: relative; cursor: pointer; }
.audio-progress { position: absolute; left: 0; top: 0; bottom: 0; width: 32%; background: var(--gold); border-radius: 100px; transition: width 0.1s; }
.audio-time { color: var(--muted); font-size: 12px; font-family: monospace; }

/* Video */
.video-frame {
  background: #2a1310; border-radius: 14px; height: 400px; display: flex;
  align-items: center; justify-content: center; position: relative; overflow: hidden;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: none; }
.video-play { width: 64px; height: 64px; border-radius: 50%; background: rgba(0,0,0,0.55); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 22px; }
.video-caption { position: absolute; bottom: 16px; left: 16px; color: #fff; font-family: monospace; font-size: 12px; background: rgba(0,0,0,0.5); padding: 4px 10px; border-radius: 6px; }

/* Sidebar */
.side-card {
  border: 1px solid var(--border); border-radius: 12px; padding: 22px; margin-bottom: 20px;
  background: #fff;
  box-shadow: var(--shadow-sm);
  transition: all var(--transition-normal);
}
.side-card:hover { box-shadow: var(--shadow-md); }
.side-card:last-child { margin-bottom: 0; }
.side-title { font-weight: 800; font-size: 14px; margin-bottom: 14px; color: var(--red-dark); }
.side-fact { display: flex; flex-direction: column; gap: 10px; font-size: 13px; }
.side-fact span.label { color: var(--muted); }
.side-fact .value { color: var(--text); font-weight: 600; }

.related-item {
  cursor: pointer; margin-bottom: 14px; display: block; color: inherit;
  padding: 12px;
  border-radius: 8px;
  transition: all var(--transition-fast);
}
.related-item:last-child { margin-bottom: 0; }
.related-item:hover {
  background: rgba(218,37,29,0.05);
  transform: translateX(4px);
}
.related-name { font-weight: 600; font-size: 13px; margin-bottom: 2px; color: var(--text); }
.related-loc { color: var(--muted); font-size: 12px; }

/* ========== LOGIN ========== */
.login-wrap {
  flex: 1; display: flex; align-items: center; justify-content: center;
  padding: 60px 20px;
  background: radial-gradient(circle at 50% 0%, var(--red), var(--red-darker) 70%);
}
.login-card {
  width: 100%; max-width: 380px; border-radius: 14px; padding: 40px; background: #fff;
  box-shadow: 0 20px 60px rgba(0,0,0,0.3);
  animation: fadeInUp 0.5s ease-out;
}
.login-mark {
  width: 46px; height: 46px; border-radius: 8px; background: var(--gold);
  display: flex; align-items: center; justify-content: center; color: #5c1010;
  font-weight: 900; font-size: 20px; margin: 0 auto 20px;
}
.login-card h1 { font-size: 22px; font-weight: 800; text-align: center; margin: 0 0 6px; color: var(--red-dark); }
.login-card p { text-align: center; color: var(--muted); font-size: 13px; margin: 0 0 28px; }

/* ========== FORMS ========== */
.form-label { font-size: 13px; font-weight: 600; display: block; margin-bottom: 6px; color: #5a4034; }
.form-input, .form-textarea {
  width: 100%; padding: 11px 14px; border: 1px solid var(--border); border-radius: 8px;
  font-size: 14px; font-family: inherit; margin-bottom: 16px;
  transition: all var(--transition-fast);
}
.form-input:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--red);
  box-shadow: 0 0 0 3px rgba(218,37,29,0.1);
}
.form-textarea { resize: vertical; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: 16px; }
.upload-box {
  border: 2px dashed var(--border); border-radius: 10px; height: 100px;
  display: flex; align-items: center; justify-content: center; background: #fffaf0; padding: 12px;
  text-align: center;
  transition: all var(--transition-fast);
}
.upload-box:hover { border-color: var(--red); background: #fff5eb; }
.upload-box.small { height: 52px; margin-top: 8px; }
.upload-box span { font-family: monospace; font-size: 11px; color: var(--muted); }
.form-actions { display: flex; gap: 12px; margin-top: 8px; }
.form-error { color: var(--red-dark); font-size: 13px; font-weight: 600; margin-top: 8px; }

/* ========== ADMIN ========== */
.admin-wrap { flex: 1; width: 100%; max-width: 1100px; margin: 0 auto; padding: 32px clamp(16px, 5vw, 40px) 64px; }
.admin-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 24px; }
.admin-head h1 { font-size: 26px; font-weight: 800; margin: 0 0 4px; color: var(--red-dark); }
.admin-head p { color: var(--muted); font-size: 14px; margin: 0; }
.admin-table { border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: #fff; }
.admin-row {
  display: flex; align-items: center; gap: 16px; padding: 16px 20px; border-bottom: 1px solid var(--border);
  transition: background var(--transition-fast);
}
.admin-row:hover { background: rgba(218,37,29,0.02); }
.admin-row:last-child { border-bottom: none; }
.admin-row .thumb {
  width: 56px; height: 56px; flex-shrink: 0; border-radius: 8px;
  background: repeating-linear-gradient(45deg, var(--red-deep), var(--red-deep) 10px, var(--red) 10px, var(--red) 20px);
  object-fit: cover;
}
.admin-row .info { flex: 1; min-width: 0; }
.admin-row .info .name { font-weight: 700; font-size: 14px; margin-bottom: 3px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-row .info .meta { color: var(--muted); font-size: 12px; }

.btn-edit {
  background: #f5e6cc; color: #7c0d18; border: none; padding: 8px 14px;
  border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
  transition: all var(--transition-fast);
}
.btn-edit:hover { background: var(--gold); color: #5c1010; }

.btn-delete {
  background: #fbe4e4; color: var(--red-dark); border: none; padding: 8px 14px;
  border-radius: 6px; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
  transition: all var(--transition-fast);
}
.btn-delete:hover { background: var(--red); color: #fff; }

/* ========== ABOUT ========== */
.about-body { max-width: 860px; margin: 0 auto; padding: clamp(28px, 6vw, 48px) clamp(16px, 5vw, 40px) 56px; }
.about-body p { font-size: 15px; line-height: 1.9; color: #332018; margin: 0 0 20px; }
.about-body h2 { font-size: 18px; font-weight: 800; margin: 40px 0 14px; color: var(--red-dark); }
.about-contact { display: flex; flex-direction: column; gap: 8px; font-size: 14px; color: #5a4034; }

/* ========== FOOTER ========== */
.site-footer {
  background: var(--red-darker); padding: 28px 40px; text-align: center;
  color: #fbe8d8; font-size: 13px; font-weight: 600;
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--red), var(--gold));
}

/* ========== UTILITIES ========== */
.nav-logout, .admin-row form { margin: 0; }
.nav-logout button { background: transparent; }
.filter-select { width: min(260px, 100%); margin: 0; }
.admin-filter { display: flex; gap: 12px; align-items: center; margin-bottom: 20px; flex-wrap: wrap; }
.admin-filter .search-input { min-width: 260px; }
.admin-filter .form-input { width: auto; min-width: 200px; margin: 0; }

.notice { padding: 12px 16px; border-radius: 8px; margin-bottom: 18px; font-size: 14px; font-weight: 600; }
.notice.success { color: #256029; background: #e9f7e9; border: 1px solid #b9ddb9; }
.notice.error { color: #8b1a1a; background: #fff0f0; border: 1px solid #efbcbc; }

.pagination { display: flex; justify-content: center; gap: 6px; margin-top: 28px; flex-wrap: wrap; }
.pagination a {
  min-width: 38px; height: 38px; padding: 0 10px; display: grid; place-items: center;
  border: 1px solid var(--border); border-radius: 8px; background: #fff; color: var(--red-dark); font-weight: 700;
  transition: all var(--transition-fast);
}
.pagination a:hover {
  border-color: var(--red);
  background: rgba(218,37,29,0.05);
}
.pagination a.active { color: #fff; background: var(--red); border-color: var(--red); }

.admin-editor { max-width: 860px; }
.admin-editor > h1 { color: var(--red-dark); font-size: 26px; margin: 16px 0 24px; }
.detail-back-link { color: var(--muted); font-size: 13px; font-weight: 700; }
.attachment-section { border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); padding: 20px 0; margin: 8px 0 20px; }
.attachment-section h2 { color: var(--red-dark); font-size: 17px; margin: 0 0 18px; }
.attachment-section input[type=file] { width: 100%; margin: 8px 0 14px; }
.existing-cover { width: 100%; max-height: 220px; object-fit: cover; border-radius: 10px; display: block; }
.existing-gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 12px; margin: 18px 0; }
.existing-gallery > div { border: 1px solid var(--border); padding: 8px; border-radius: 10px; }
.existing-gallery img { width: 100%; height: 100px; object-fit: cover; border-radius: 6px; margin-bottom: 8px; }
.publish-check { display: flex; gap: 8px; align-items: center; font-weight: 700; margin: 8px 0 18px; }

.gallery-grid figure { background: #f5e6cc; }
.gallery-grid img { background: #e7ddc9; }
.pdf-embed { width: 100%; height: min(72vh, 760px); border: 1px solid var(--border); border-radius: 10px; background: #fff; }
.audio-card audio { width: 100%; }
.short-link { display: flex; gap: 6px; }
.short-link input { min-width: 0; flex: 1; padding: 9px 10px; border: 1px solid var(--border); border-radius: 7px; color: var(--muted); background: #fffaf0; }
.short-link button {
  border: 0; border-radius: 7px; padding: 8px 10px; background: var(--red); color: #fff;
  font-weight: 700; cursor: pointer;
  transition: all var(--transition-fast);
}
.short-link button:hover { background: var(--red-deep); }
.copy-status { color: #256029; font-size: 11px; min-height: 18px; margin-top: 6px; }

/* ========== SCROLL ANIMATIONS ========== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}
.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ========== LOADING STATES ========== */
.skeleton {
  background: linear-gradient(
    90deg,
    #f0e6d6 25%,
    #e8dcc6 50%,
    #f0e6d6 75%
  );
  background-size: 200% 100%;
  animation: skeleton-loading 1.5s infinite;
  border-radius: 8px;
}
@keyframes skeleton-loading {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* ========== TOAST NOTIFICATIONS ========== */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  padding: 16px 24px;
  background: var(--text);
  color: #fff;
  border-radius: 8px;
  box-shadow: var(--shadow-lg);
  z-index: 1000;
  transform: translateY(100px);
  opacity: 0;
  transition: all var(--transition-normal);
}
.toast.show {
  transform: translateY(0);
  opacity: 1;
}
.toast.success { background: #2e7d32; }
.toast.error { background: var(--red-dark); }

/* ========== LIGHTBOX ========== */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: all var(--transition-normal);
}
.lightbox.active {
  opacity: 1;
  visibility: visible;
}
.lightbox img {
  max-width: 90%;
  max-height: 90%;
  border-radius: 8px;
  transform: scale(0.9);
  transition: transform var(--transition-normal);
}
.lightbox.active img {
  transform: scale(1);
}
.lightbox-close {
  position: absolute;
  top: 24px;
  right: 24px;
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(255,255,255,0.1);
  color: #fff;
  border-radius: 50%;
  cursor: pointer;
  font-size: 24px;
  transition: all var(--transition-fast);
}
.lightbox-close:hover {
  background: rgba(255,255,255,0.2);
  transform: rotate(90deg);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 720px) {
  .site-header { align-items: flex-start; padding: 14px 16px; }
  .nav { width: 100%; overflow-x: auto; flex-wrap: nowrap; }
  .nav-link { white-space: nowrap; padding: 8px 10px; }
  .detail-hero { height: 340px; }
  .detail-grid { grid-template-columns: 1fr; }
  .admin-row { align-items: flex-start; flex-wrap: wrap; }
  .admin-row .info { min-width: calc(100% - 80px); }
  .admin-filter > * { width: 100% !important; }
  .login-card { padding: 28px 22px; }
  .video-frame { height: 280px; }
  .gallery-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .gallery-grid img { height: 160px; }
  .audio-card { padding: 20px; }
}

/* ========== PRINT ========== */
@media print {
  .site-header, .site-footer, .nav, .btn, .pagination { display: none; }
  .detail-hero { height: auto; min-height: 200px; }
  .card { break-inside: avoid; }
}

/* ========== ACCESSIBILITY ========== */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

.error-page { max-width: 560px; margin: 70px auto; padding: 40px 24px; text-align: center; }
.error-page h1 { color: var(--red-dark); }
.error-page p { color: var(--muted); margin-bottom: 24px; }
.error-page small { display: block; margin-bottom: 24px; }

/* Card image placeholder animation */
.card-thumb.card-thumb-empty {
  position: relative;
  overflow: hidden;
}
.card-thumb.card-thumb-empty::after {
  content: 'Đ';
  position: absolute;
  font-size: 52px;
  font-weight: 900;
  color: var(--gold);
  font-family: inherit;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { opacity: 0.7; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.05); }
}
