/* ==========================================================================
   BÀI TỚI CỐ ĐÔ — ORNAMENTAL SYSTEM & HERITAGE FRAMES
   Khung lồng khung 4 đường viền đồng tâm · Hoa văn mây lửa Huế · Thẻ 3D
   ========================================================================== */

/* ---------- 1. HeritageFrame (3 cấp độ: simple · medium · hero) ---------- */
.heritage-frame {
  position: relative;
  border-radius: var(--radius-md);
  color: var(--ink-dark);
  background: var(--bt-paper);
}

.heritage-frame--dark {
  background: linear-gradient(155deg, rgba(16, 40, 84, 0.94) 0%, rgba(56, 7, 21, 0.96) 100%);
  color: var(--ink-light);
}

/* Tier 1: Simple — 2 đường viền sắc nét */
.heritage-frame--simple {
  border: 2px solid var(--bt-orange);
  box-shadow:
    inset 0 0 0 3px var(--bt-pink),
    inset 0 0 0 5px var(--bt-blue),
    var(--shadow-card);
  padding: 1.5rem;
}

/* Tier 2: Medium — 4 lớp viền đồng tâm đúng tinh thần artwork mẫu */
.heritage-frame--medium {
  border: 3px solid var(--bt-crimson);
  box-shadow:
    inset 0 0 0 4px var(--bt-pink),
    inset 0 0 0 7px var(--bt-blue),
    inset 0 0 0 10px var(--bt-orange),
    inset 0 0 0 12px var(--bt-gold),
    var(--shadow-card);
  padding: clamp(1.5rem, 3vw, 2.5rem);
}

/* Tier 3: Hero — Khung triển lãm lớn với góc chạm sen & vân mây */
.heritage-frame--hero {
  border: 4px solid var(--bt-gold);
  box-shadow:
    0 0 0 4px var(--bt-crimson),
    0 0 0 8px var(--bt-pink),
    0 0 0 11px var(--bt-cyan),
    0 24px 60px rgba(5, 12, 32, 0.55);
  padding: clamp(1.75rem, 4vw, 3.25rem);
}

.heritage-frame--hero::before,
.heritage-frame--hero::after {
  content: "";
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  width: 140px;
  height: 20px;
  pointer-events: none;
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 140 22'%3E%3Cpath d='M4 18 Q28 4 50 14 T70 4 T90 14 Q112 4 136 18' fill='none' stroke='%23E8B84B' stroke-width='2.6'/%3E%3Ccircle cx='70' cy='11' r='5' fill='%23F36A9E' stroke='%23911B3C' stroke-width='2'/%3E%3C/svg%3E");
}

.heritage-frame--hero::before { top: -12px; }
.heritage-frame--hero::after { bottom: -12px; transform: translateX(-50%) rotate(180deg); }

/* ---------- 2. OrnamentalDivider ---------- */
.ornament-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 2.25rem auto;
  width: min(100%, 720px);
}

.ornament-divider__line {
  flex: 1;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--bt-orange), var(--bt-pink), var(--bt-cyan));
}

.ornament-divider__line--rev {
  background: linear-gradient(90deg, var(--bt-cyan), var(--bt-pink), var(--bt-orange), transparent);
}

.ornament-divider__medallion {
  width: 44px;
  height: 24px;
  flex-shrink: 0;
  background: center / contain no-repeat url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 26'%3E%3Cpath d='M24 2 L32 13 L24 24 L16 13 Z' fill='%23911B3C' stroke='%23E8B84B' stroke-width='2'/%3E%3Cpath d='M4 13 Q12 4 16 13 Q12 22 4 13 Z' fill='%2316BCE4'/%3E%3Cpath d='M44 13 Q36 4 32 13 Q36 22 44 13 Z' fill='%23F47B32'/%3E%3Ccircle cx='24' cy='13' r='3.2' fill='%23FFD6AA'/%3E%3C/svg%3E");
}

/* ---------- 3. Stepped Ribbon Buttons (CTA đậm bản sắc Huế) ---------- */
.btn-imperial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  padding: 0.82rem 1.5rem;
  border-radius: var(--radius-sm);
  border: 2px solid var(--bt-gold);
  background: linear-gradient(135deg, var(--bt-crimson) 0%, #B8224A 55%, var(--bt-orange) 100%);
  color: #FFF9F0;
  font-weight: 700;
  font-size: 0.95rem;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(145, 27, 60, 0.42), inset 0 1px 0 rgba(255, 255, 255, 0.25);
  transition: transform var(--dur-fast) var(--ease-imperial), box-shadow var(--dur-fast) var(--ease-imperial), filter var(--dur-fast);
}

.btn-imperial:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 26px rgba(244, 123, 50, 0.44), 0 0 0 2px var(--bt-pink);
  filter: brightness(1.06);
}

.btn-imperial--secondary {
  background: linear-gradient(135deg, var(--bt-blue) 0%, #104584 100%);
  border-color: var(--bt-cyan);
  box-shadow: 0 6px 18px rgba(9, 43, 87, 0.42);
}

.btn-imperial--ghost {
  background: rgba(255, 247, 235, 0.94);
  color: var(--bt-crimson-deep);
  border-color: var(--bt-crimson);
  box-shadow: 0 4px 14px rgba(24, 9, 18, 0.16);
}

.btn-imperial--ghost:hover {
  background: var(--bt-paper-warm);
  color: var(--bt-blue);
}

.btn-imperial--sm {
  padding: 0.52rem 1rem;
  font-size: 0.85rem;
}

/* ---------- 4. Bài Tới Card 3D Flip & Tilt Container ---------- */
.bt-card-stage {
  perspective: 1200px;
}

.bt-card-frame {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: var(--card-ratio);
  transform-style: preserve-3d;
  transition: transform 680ms var(--ease-imperial), box-shadow var(--dur-fast) var(--ease-imperial);
  border-radius: 10px;
  cursor: pointer;
}

.bt-card-stage:hover .bt-card-frame:not(.is-flipped) {
  transform: translateY(-8px) rotateX(3deg) rotateY(-4deg);
}

.bt-card-frame.is-flipped {
  transform: rotateY(180deg);
}

.bt-card-face {
  position: absolute;
  inset: 0;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
  border-radius: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-card);
  background: #140812;
  border: 2px solid rgba(232, 184, 75, 0.5);
}

.bt-card-face--back {
  transform: rotateY(180deg);
}

.bt-card-face img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Ánh kim nhũ hoàng triều cho nhóm Tam Yêu */
.bt-card-stage--tam-yeu .bt-card-face--front::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(125deg,
    transparent 20%,
    rgba(232, 184, 75, 0.22) 38%,
    rgba(243, 106, 158, 0.18) 50%,
    rgba(22, 188, 228, 0.18) 62%,
    transparent 80%);
  mix-blend-mode: screen;
  opacity: 0.55;
  transition: opacity var(--dur-fast);
}

.bt-card-stage--tam-yeu:hover .bt-card-face--front::after {
  opacity: 0.95;
}

/* ---------- 5. Ribbon Tags & Pho Gate Accents ---------- */
.pho-tag {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 4px;
  font-size: 0.72rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.pho-tag--van-chu { background: #142854; color: #7EE4F7; border: 1px solid #24C4D8; }
.pho-tag--van-tien { background: #0E4D3C; color: #DDF5E5; border: 1px solid #7AD151; }
.pho-tag--sach { background: #6E1D34; color: #FFD5DE; border: 1px solid #F28C1B; }
.pho-tag--tam-yeu { background: linear-gradient(90deg, #9E1624, #6A1F7D); color: #FFE29A; border: 1px solid #E8B84B; }

@keyframes gentle-float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.anim-float {
  animation: gentle-float 5.5s ease-in-out infinite;
}
