/* ===================================================
   DESIGN SYSTEM — Trang Di Sản Đặng Vũ Hiệp
   =================================================== */

@import url('../vendor/fonts/fonts.css');

/* ─── CSS TOKENS ─────────────────────────────────── */
:root {
  --bg-deep:       #080C14;
  --bg-dark:       #0D1221;
  --bg-card:       #111827;
  --bg-glass:      rgba(17, 24, 39, 0.7);
  --gold:          #C9A84C;
  --gold-light:    #E8C96A;
  --gold-dim:      rgba(201, 168, 76, 0.15);
  --red:           #8B1A1A;
  --red-light:     #C0392B;
  --cream:         #E8DCC8;
  --cream-dim:     rgba(232, 220, 200, 0.6);
  --navy:          #1A3A5C;
  --navy-light:    #234E78;
  --text-primary:  #E8DCC8;
  --text-secondary:#A89880;
  --text-muted:    #6B5F50;
  --border:        rgba(201, 168, 76, 0.2);
  --border-subtle: rgba(255,255,255,0.06);
  --shadow-gold:   0 0 40px rgba(201, 168, 76, 0.15);
  --shadow-deep:   0 20px 60px rgba(0,0,0,0.6);
  --radius-sm:     6px;
  --radius-md:     12px;
  --radius-lg:     20px;
  --transition:    0.35s cubic-bezier(0.4, 0, 0.2, 1);
  --font-serif:    'Playfair Display', 'Noto Serif Vietnamese', serif;
  --font-sans:     'Inter', sans-serif;
}

/* ─── RESET & BASE ───────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-sans);
  background: var(--bg-deep);
  color: var(--text-primary);
  overflow-x: hidden;
  line-height: 1.7;
}

::selection {
  background: var(--gold);
  color: var(--bg-deep);
}

::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-dark); }
::-webkit-scrollbar-thumb { background: var(--gold); border-radius: 3px; }

/* ─── TYPOGRAPHY ─────────────────────────────────── */
h1, h2, h3, h4 {
  font-family: var(--font-serif);
  line-height: 1.2;
  color: var(--cream);
}

.section-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 16px;
}

.section-label::before {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--gold);
}

.section-title {
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 12px;
}

.section-subtitle {
  font-size: 1.05rem;
  color: var(--text-secondary);
  max-width: 600px;
  line-height: 1.8;
}

/* ─── LAYOUT ─────────────────────────────────────── */
.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 40px;
}

section {
  padding: 100px 0;
  position: relative;
}

/* ─── NAVIGATION ─────────────────────────────────── */
#navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 0 40px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  transition: var(--transition);
  background: transparent;
}

#navbar.scrolled {
  background: rgba(8, 12, 20, 0.95);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border);
  box-shadow: 0 4px 30px rgba(0,0,0,0.4);
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
}

.nav-brand-icon {
  width: 36px;
  height: 36px;
  background: var(--gold);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  color: var(--bg-deep);
  font-weight: 700;
  flex-shrink: 0;
}

.nav-brand-text {
  font-family: var(--font-serif);
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--cream);
  line-height: 1.2;
}

.nav-brand-text span {
  display: block;
  font-size: 0.7rem;
  font-family: var(--font-sans);
  font-weight: 400;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
  list-style: none;
}

.nav-links a {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  padding: 8px 16px;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  letter-spacing: 0.03em;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 4px;
  left: 16px;
  right: 16px;
  height: 1px;
  background: var(--gold);
  transform: scaleX(0);
  transition: var(--transition);
}

.nav-links a:hover, .nav-links a.active {
  color: var(--gold);
}

.nav-links a:hover::after, .nav-links a.active::after {
  transform: scaleX(1);
}

/* ─── HERO SECTION ───────────────────────────────── */
#hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  padding: 0;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(135deg, rgba(8,12,20,0.92) 0%, rgba(26,58,92,0.5) 50%, rgba(8,12,20,0.96) 100%),
    radial-gradient(ellipse at 70% 50%, rgba(201,168,76,0.06) 0%, transparent 60%);
  z-index: 1;
}

.hero-bg-image {
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/Anhcover.png');
  background-size: cover;
  background-position: 15% 20%;
  animation: kenBurns 25s ease-in-out infinite alternate;
  filter: sepia(40%) brightness(0.35) contrast(1.1);
  z-index: 0;
}

@keyframes kenBurns {
  from { transform: scale(1) translateX(0); }
  to   { transform: scale(1.08) translateX(-2%); }
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 120px 40px 80px;
  max-width: 1280px;
  margin: 0 auto;
  width: 100%;
}

.hero-eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 24px;
  opacity: 0;
  animation: fadeUp 0.8s 0.3s forwards;
  display: flex;
  align-items: center;
  gap: 16px;
}

.hero-eyebrow::before {
  content: '';
  display: block;
  width: 48px;
  height: 1px;
  background: var(--gold);
}

.hero-rank {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2vw, 1.4rem);
  font-weight: 400;
  font-style: italic;
  color: var(--gold-light);
  margin-bottom: 12px;
  opacity: 0;
  animation: fadeUp 0.8s 0.5s forwards;
}

.hero-name {
  font-family: var(--font-serif);
  font-size: clamp(3.5rem, 8vw, 7rem);
  font-weight: 900;
  line-height: 0.95;
  color: var(--cream);
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.8s 0.7s forwards;
}

.hero-name em {
  display: block;
  color: var(--gold);
  font-style: normal;
}

.hero-dates {
  font-size: 0.9rem;
  color: var(--text-secondary);
  letter-spacing: 0.1em;
  margin-bottom: 32px;
  opacity: 0;
  animation: fadeUp 0.8s 0.9s forwards;
}

.hero-quote {
  max-width: 560px;
  border-left: 2px solid var(--gold);
  padding-left: 24px;
  margin-bottom: 48px;
  opacity: 0;
  animation: fadeUp 0.8s 1.1s forwards;
}

.hero-quote p {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--cream-dim);
  line-height: 1.8;
  margin-bottom: 8px;
}

.hero-quote cite {
  font-size: 0.78rem;
  color: var(--gold);
  font-style: normal;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.hero-cta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  opacity: 0;
  animation: fadeUp 0.8s 1.3s forwards;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: var(--gold);
  color: var(--bg-deep);
  font-size: 0.9rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: var(--radius-sm);
  transition: var(--transition);
  letter-spacing: 0.04em;
  border: none;
  cursor: pointer;
}

.btn-primary:hover {
  background: var(--gold-light);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(201,168,76,0.3);
}

.btn-outline {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 32px;
  background: transparent;
  color: var(--cream);
  font-size: 0.9rem;
  font-weight: 500;
  text-decoration: none;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  transition: var(--transition);
  letter-spacing: 0.04em;
  cursor: pointer;
}

.btn-outline:hover {
  border-color: var(--gold);
  color: var(--gold);
  background: var(--gold-dim);
  transform: translateY(-2px);
}

.hero-scroll-hint {
  position: absolute;
  bottom: 40px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  opacity: 0;
  animation: fadeIn 1s 2s forwards;
}

.hero-scroll-hint span {
  font-size: 0.65rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.scroll-line {
  width: 1px;
  height: 48px;
  background: linear-gradient(to bottom, var(--gold), transparent);
  animation: scrollPulse 2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50% { opacity: 1; transform: scaleY(1.2); }
}

/* Hero mini stats */
.hero-stats {
  position: absolute;
  right: 40px;
  bottom: 80px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 20px;
  opacity: 0;
  animation: fadeIn 1s 1.5s forwards;
}

.hero-stat {
  text-align: right;
}

.hero-stat-number {
  font-family: var(--font-serif);
  font-size: 2.2rem;
  font-weight: 700;
  color: var(--gold);
  line-height: 1;
}

.hero-stat-label {
  font-size: 0.7rem;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  text-transform: uppercase;
}

/* ─── SECTION DIVIDER ────────────────────────────── */
.divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(to right, transparent, var(--border), transparent);
  margin: 0;
}

/* ─── BIOGRAPHY / TIMELINE ───────────────────────── */
#biography {
  background: var(--bg-dark);
}

.biography-intro {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  margin-bottom: 80px;
}

.biography-text p {
  font-size: 1.05rem;
  color: var(--text-secondary);
  line-height: 1.9;
  margin-bottom: 20px;
}

.biography-portrait {
  position: relative;
}

.portrait-frame {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 3/4;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  filter: sepia(20%) brightness(0.9);
  transition: var(--transition);
}

.portrait-frame:hover img {
  filter: sepia(0%) brightness(1);
}

.portrait-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  pointer-events: none;
}

.portrait-badge {
  position: absolute;
  bottom: -16px;
  left: -16px;
  background: var(--gold);
  color: var(--bg-deep);
  padding: 16px 20px;
  border-radius: var(--radius-sm);
  font-family: var(--font-serif);
  font-size: 0.85rem;
  font-weight: 700;
  line-height: 1.3;
  box-shadow: var(--shadow-deep);
}

/* Timeline */
.timeline {
  position: relative;
  padding-left: 0;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(to bottom, transparent, var(--border) 10%, var(--border) 90%, transparent);
  transform: translateX(-50%);
}

.timeline-item {
  display: grid;
  grid-template-columns: 1fr 60px 1fr;
  gap: 0;
  margin-bottom: 60px;
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s, transform 0.6s;
}

.timeline-item.visible {
  opacity: 1;
  transform: translateY(0);
}

.timeline-item:nth-child(odd) .timeline-content {
  grid-column: 1;
  grid-row: 1;
  text-align: right;
  padding-right: 40px;
}

.timeline-item:nth-child(odd) .timeline-empty {
  grid-column: 3;
  grid-row: 1;
}

.timeline-item:nth-child(even) .timeline-content {
  grid-column: 3;
  grid-row: 1;
  text-align: left;
  padding-left: 40px;
}

.timeline-item:nth-child(even) .timeline-empty {
  grid-column: 1;
  grid-row: 1;
}

.timeline-center {
  grid-column: 2;
  grid-row: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 8px;
  position: relative;
  z-index: 1;
}

.timeline-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: var(--gold);
  border: 3px solid var(--bg-dark);
  box-shadow: 0 0 0 1px var(--gold), var(--shadow-gold);
  flex-shrink: 0;
}

.timeline-year {
  font-family: var(--font-serif);
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--gold);
  margin-top: 8px;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.timeline-content {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  padding: 24px;
  cursor: pointer;
  transition: var(--transition);
}

.timeline-content:hover {
  border-color: var(--border);
  transform: translateY(-4px);
  box-shadow: var(--shadow-gold);
}

.timeline-badge {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 20px;
  margin-bottom: 10px;
}

.badge-khangphap { background: rgba(139,26,26,0.2); color: #E57373; border: 1px solid rgba(139,26,26,0.4); }
.badge-chongmy   { background: rgba(26,58,92,0.3); color: #64B5F6; border: 1px solid rgba(26,58,92,0.5); }
.badge-hoabinh   { background: rgba(201,168,76,0.15); color: var(--gold); border: 1px solid var(--border); }
.badge-thieuthoi { background: rgba(100,180,100,0.15); color: #81C784; border: 1px solid rgba(100,180,100,0.3); }

.timeline-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 8px;
}

.timeline-text {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.75;
  display: none;
  text-align: left;
  padding-left: 12px;
}

.timeline-content.expanded .timeline-text {
  display: block;
}

.timeline-expand {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 0.75rem;
  color: var(--gold);
  margin-top: 10px;
  cursor: pointer;
  background: none;
  border: none;
  font-family: var(--font-sans);
  padding: 0;
}

/* ─── LEGACY / MUSEUM ────────────────────────────── */
#legacy {
  background: var(--bg-deep);
}

.museum-intro {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 60px;
  gap: 40px;
}

.room-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg-card);
  padding: 4px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
}

.room-tab {
  padding: 10px 20px;
  border-radius: 8px;
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  white-space: nowrap;
}

.room-tab.active {
  background: var(--gold);
  color: var(--bg-deep);
  font-weight: 600;
}

.museum-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 24px;
}

.artifact-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  display: none;
}

.artifact-card.visible {
  display: block;
}

.artifact-card:hover {
  border-color: var(--border);
  transform: translateY(-6px);
  box-shadow: 0 20px 40px rgba(0,0,0,0.4), var(--shadow-gold);
}

.artifact-img-wrap {
  position: relative;
  aspect-ratio: 4/3;
  overflow: hidden;
  background: var(--bg-dark);
}

.artifact-img-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
  filter: sepia(10%) brightness(0.85);
}

.artifact-card:hover .artifact-img-wrap img {
  transform: scale(1.06);
  filter: sepia(0%) brightness(1);
}

.artifact-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,12,20,0.9) 0%, transparent 50%);
  opacity: 0;
  transition: var(--transition);
  display: flex;
  align-items: flex-end;
  padding: 20px;
}

.artifact-card:hover .artifact-overlay {
  opacity: 1;
}

.artifact-overlay-text {
  font-size: 0.82rem;
  color: var(--cream);
  line-height: 1.6;
}

.ai-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  background: rgba(100,150,255,0.9);
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 3px 8px;
  border-radius: 20px;
}

.artifact-info {
  padding: 20px;
}

.artifact-year {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 6px;
}

.artifact-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  color: var(--cream);
  margin-bottom: 8px;
}

.artifact-desc {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* Legacy story blocks */
.legacy-stories {
  margin-top: 80px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 32px;
}

.story-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
}

.story-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(to right, var(--gold), transparent);
}

.story-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-gold);
}

.story-icon {
  font-size: 2rem;
  margin-bottom: 16px;
}

.story-title {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 12px;
  line-height: 1.4;
}

.story-text {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.85;
}

.story-quote {
  margin-top: 20px;
  padding: 16px 20px;
  background: var(--gold-dim);
  border-left: 2px solid var(--gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 0.95rem;
  color: var(--cream);
  line-height: 1.7;
}

/* ─── BATTLES / SA BÀN 3D ────────────────────────── */
#battles {
  background: var(--bg-dark);
  padding: 80px 0;
  position: relative;
  overflow: hidden;
}

#battles::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('../assets/images/ban do.png');
  background-repeat: no-repeat;
  background-size: contain;
  background-position: center;
  opacity: 0.10;
  pointer-events: none;
  z-index: 0;
}

#battles > * {
  position: relative;
  z-index: 1;
}

.battles-header {
  margin-bottom: 40px;
  text-align: center;
}
.battles-header-card {
  background: var(--bg-card);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 40px;
  position: relative;
  overflow: hidden;
  transition: var(--transition);
  display: flex;
  flex-direction: column;
  justify-content: center;
  border-left: 4px solid var(--gold);
}

.battles-header-card:hover {
  border-color: var(--border);
  box-shadow: var(--shadow-gold);
}

.battles-header-card .section-title {
  font-size: clamp(1.5rem, 2.5vw, 2.2rem);
  margin-bottom: 12px;
  line-height: 1.3;
}

.battles-header-card .section-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

.saban-iframe-wrap {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  max-height: 720px;
  border-radius: var(--radius-lg);
  border: 1px solid var(--border-subtle);
  background: #020508;
  overflow: hidden;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5), inset 0 0 20px rgba(199, 168, 76, 0.15);
  transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.saban-iframe-wrap:hover {
  border-color: var(--gold);
  box-shadow: 0 25px 50px rgba(0, 0, 0, 0.6), 0 0 20px rgba(199, 168, 76, 0.25);
  transform: translateY(-4px);
}

#saban-iframe {
  width: 100%;
  height: 100%;
  border: none;
  display: block;
}

/* Fullscreen Link overlay */
.saban-fullscreen-link {
  position: absolute;
  bottom: 20px;
  right: 20px;
  background: rgba(8, 12, 20, 0.85);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--cream);
  font-size: 0.8rem;
  font-weight: 500;
  padding: 8px 16px;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  backdrop-filter: blur(10px);
  z-index: 10;
  transition: var(--transition);
  box-shadow: 0 4px 12px rgba(0,0,0,0.3);
}

.saban-fullscreen-link:hover {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-deep);
  transform: translateY(-2px);
  box-shadow: 0 6px 16px rgba(199, 168, 76, 0.4);
}

.saban-fullscreen-link i {
  font-size: 0.85rem;
}

/* Responsive adjustment */
@media (max-width: 768px) {
  .saban-iframe-wrap {
    aspect-ratio: 4 / 3;
    max-height: 480px;
  }
}


/* ─── BIOGRAPHY dạng iframe hero (_BiographyIframe) ───────── */
/* Tràn toàn chiều ngang, không padding: trang hero tự có padding. Chiều cao do main.js đặt theo nội dung. */
#biography.biography-iframe-section {
  padding: 0;
  background: #0A1515; /* = --ink của trang hero, tránh viền màu khác khi đang tải */
}

.biography-iframe {
  display: block;
  width: 100%;
  height: 100vh;
  border: none;
}

/* ─── DI SẢN dạng iframe (_LegacyIframe) ───────── */
/* Nền section sáng hơn --bg-deep để khung iframe (nội dung tối) nổi lên */
#legacy.legacy-iframe-section {
  background:
    radial-gradient(ellipse at 50% 40%, rgba(201, 168, 76, 0.12), transparent 65%),
    #182235;
}

.museum-iframe-wrap {
  max-height: none;
  border-color: rgba(201, 168, 76, 0.45);
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.55), 0 0 30px rgba(201, 168, 76, 0.12);
}

/* ─── IFRAME FULLSCREEN (nút [data-iframe-fullscreen], xem main.js) ─── */
.saban-iframe-wrap:fullscreen {
  max-height: none;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  transform: none;
  transition: none;
}

.saban-iframe-wrap:-webkit-full-screen {
  max-height: none;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  transform: none;
  transition: none;
}

/* Dự phòng khi trình duyệt không có Fullscreen API (iPhone Safari).
   !important để thắng .reveal.visible { transform } và .saban-iframe-wrap:hover. */
.saban-iframe-wrap.is-pseudo-fullscreen {
  position: fixed !important;
  inset: 0;
  z-index: 100000;
  width: 100%;
  height: 100%;
  max-height: none;
  aspect-ratio: auto;
  border: none;
  border-radius: 0;
  transform: none !important;
  transition: none !important;
}

.iframe-fullscreen-lock,
.iframe-fullscreen-lock body {
  overflow: hidden;
}

/* Trang bên trong khác domain nên không ẩn được thanh cuộn bằng CSS:
   cho iframe rộng hơn khung 20px, phần thanh cuộn bị overflow:hidden của khung cắt đi. */
.museum-iframe-wrap iframe {
  width: calc(100% + 20px);
  height: 100%;
  border: none;
  display: block;
}


/* ─── GALLERY ─────────────────────────────────────── */
#gallery {
  background: var(--bg-deep);
}

.gallery-filters {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 40px;
}

.filter-btn {
  padding: 8px 20px;
  border-radius: 24px;
  border: 1px solid var(--border-subtle);
  background: transparent;
  color: var(--text-secondary);
  font-size: 0.82rem;
  font-weight: 500;
  cursor: pointer;
  transition: var(--transition);
  font-family: var(--font-sans);
}

.filter-btn:hover {
  border-color: var(--border);
  color: var(--cream);
}

.filter-btn.active {
  background: var(--gold);
  border-color: var(--gold);
  color: var(--bg-deep);
  font-weight: 600;
}

.gallery-masonry {
  columns: 4;
  column-gap: 16px;
}

.gallery-item {
  break-inside: avoid;
  margin-bottom: 16px;
  position: relative;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--border-subtle);
  transition: var(--transition);
}

.gallery-item:hover {
  border-color: var(--border);
  box-shadow: 0 16px 40px rgba(0,0,0,0.5);
  transform: translateY(-4px);
}

.gallery-item img {
  width: 100%;
  display: block;
  filter: sepia(15%) brightness(0.85);
  transition: transform 0.4s ease, filter 0.4s ease;
}

.gallery-item:hover img {
  transform: scale(1.04);
  filter: sepia(0%) brightness(1);
}

.gallery-item-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(8,12,20,0.9) 0%, transparent 60%);
  opacity: 0;
  transition: var(--transition);
  padding: 16px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
}

.gallery-item:hover .gallery-item-overlay {
  opacity: 1;
}

.gallery-item-year {
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 4px;
}

.gallery-item-caption {
  font-family: var(--font-serif);
  font-size: 0.85rem;
  color: var(--cream);
  line-height: 1.4;
}

.gallery-ai-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  background: rgba(80,120,255,0.9);
  color: white;
  font-size: 0.58rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 2px 7px;
  border-radius: 20px;
}

/* ─── LIGHTBOX ────────────────────────────────────── */
#lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(0,0,0,0.97);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s;
}

#lightbox.open {
  opacity: 1;
  pointer-events: all;
}

.lightbox-inner {
  max-width: 90vw;
  max-height: 90vh;
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox-img {
  max-width: 90vw;
  max-height: 75vh;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-deep);
}

.lightbox-caption {
  margin-top: 16px;
  text-align: center;
}

.lightbox-caption h3 {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  color: var(--cream);
  margin-bottom: 4px;
}

.lightbox-caption p {
  font-size: 0.82rem;
  color: var(--text-secondary);
}

.lightbox-close {
  position: fixed;
  top: 24px;
  right: 24px;
  width: 44px;
  height: 44px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--cream);
  font-size: 20px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
}

.lightbox-close:hover {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
}

.lightbox-nav {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  background: rgba(8,12,20,0.8);
  border: 1px solid var(--border);
  border-radius: 50%;
  color: var(--cream);
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition);
  backdrop-filter: blur(10px);
}

.lightbox-nav:hover {
  background: var(--gold);
  color: var(--bg-deep);
  border-color: var(--gold);
}

.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }

/* ─── FOOTER ──────────────────────────────────────── */
#footer {
  background: var(--bg-dark);
  border-top: 1px solid var(--border-subtle);
  padding: 60px 0 40px;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 48px;
}

.footer-brand h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--cream);
  margin-bottom: 8px;
}

.footer-brand p {
  font-size: 0.85rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin-top: 12px;
}

.footer-col h4 {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 16px;
}

.footer-col ul {
  list-style: none;
}

.footer-col ul li {
  margin-bottom: 10px;
}

.footer-col ul li a {
  font-size: 0.85rem;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s;
}

.footer-col ul li a:hover {
  color: var(--gold);
}

.footer-bottom {
  border-top: 1px solid var(--border-subtle);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer-bottom p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.footer-gold-line {
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin-bottom: 16px;
}

/* ─── ANIMATIONS ──────────────────────────────────── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

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

.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered reveal */
.reveal-1 { transition-delay: 0.1s; }
.reveal-2 { transition-delay: 0.2s; }
.reveal-3 { transition-delay: 0.3s; }
.reveal-4 { transition-delay: 0.4s; }

/* ─── RESPONSIVE ──────────────────────────────────── */
@media (max-width: 1024px) {
  .hero-bg-image { background-position: center center; }
  .biography-intro { grid-template-columns: 1fr; gap: 48px; }
  .portrait-frame { max-width: 360px; margin: 0 auto; }
  .gallery-masonry { columns: 3; }
  .footer-inner { grid-template-columns: 1fr 1fr; }
  .legacy-stories { grid-template-columns: 1fr; }
  .timeline::before { left: 20px; }
  .timeline-item { grid-template-columns: 40px 1fr; }
  .timeline-item:nth-child(odd) .timeline-content,
  .timeline-item:nth-child(even) .timeline-content {
    grid-column: 2;
    text-align: left;
    padding-left: 20px;
    padding-right: 0;
  }
  .timeline-item:nth-child(odd) .timeline-empty,
  .timeline-item:nth-child(even) .timeline-empty { display: none; }
  .timeline-center { grid-column: 1; align-items: flex-start; padding-top: 12px; }
  .timeline-year { display: none; }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
  section { padding: 72px 0; }
  #navbar { padding: 0 20px; }
  .nav-links { display: none; }
  .hero-content { padding: 100px 20px 60px; }
  .hero-stats { display: none; }
  .gallery-masonry { columns: 2; }
  .footer-inner { grid-template-columns: 1fr; gap: 40px; }
  .room-tabs { flex-wrap: wrap; }
}