/* ═══════════════════════════════════════════════════════
   hkdq-styles.css — Huyền Không Đại Quái  ·  Shared CSS
   Linked by all 16 HKDQ sao pages.
   Design system: premium Vietnamese phong-thuỷ aesthetic.
   ═══════════════════════════════════════════════════════ */

/* ─── Design Tokens ─── */
:root {
  --bg:      #fbf6ec;
  --bg2:     #f3e9d2;
  --bg3:     #fdf8f0;
  --ink:     #1c1410;
  --ink-soft:#5b4636;
  --gold:    #D4AF37;
  --gold-soft:#f6e3a8;
  --red:     #6E0E0A;
  --red-2:   #a32a2a;
  --green:   #1a6b3c;
  --green-soft: rgba(26,107,60,.08);
  --red-soft:   rgba(110,14,10,.08);
  --line:    #d8c79b;
  --card:    #fffaf0;
  --shadow:  0 12px 30px rgba(60,40,10,.08);
}

/* ═══════════════════════════════════════════════════════
   1.  ENHANCED ARTICLE TYPOGRAPHY  (.hkdq-article)
   ═══════════════════════════════════════════════════════ */
.hkdq-article {
  counter-reset: hkdq-section;
}

.hkdq-article h2 {
  font-family: "Noto Serif", serif;
  font-size: 28px;
  color: var(--red);
  margin: 48px 0 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--gold-soft);
  position: relative;
  line-height: 1.3;
  counter-increment: hkdq-section;
}

.hkdq-article h2::before {
  content: counter(hkdq-section, decimal-leading-zero) ". ";
  color: var(--gold);
  font-weight: 700;
}

.hkdq-article h2::after {
  content: "";
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 60px;
  height: 2px;
  background: var(--gold);
  transition: width .35s ease;
}

.hkdq-article h2:hover::after {
  width: 120px;
}

.hkdq-article h3 {
  font-family: "Noto Serif", serif;
  font-size: 22px;
  color: var(--ink);
  margin: 30px 0 12px;
  line-height: 1.35;
  position: relative;
  padding-left: 16px;
}

.hkdq-article h3::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  width: 4px;
  height: calc(100% - 8px);
  background: var(--gold);
  border-radius: 2px;
}

.hkdq-article p {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 16px;
  line-height: 1.8;
}

.hkdq-article ul,
.hkdq-article ol {
  padding-left: 0;
  margin: 0 0 20px;
  list-style: none;
}

.hkdq-article ul li,
.hkdq-article ol li {
  font-size: 17px;
  color: var(--ink-soft);
  margin-bottom: 10px;
  line-height: 1.75;
  padding-left: 26px;
  position: relative;
}

.hkdq-article ul li::before {
  content: "◆";
  position: absolute;
  left: 0;
  top: 0;
  color: var(--gold);
  font-size: 10px;
  line-height: 1.75;
  transform: translateY(3px);
}

.hkdq-article ol {
  counter-reset: hkdq-list;
}

.hkdq-article ol li {
  counter-increment: hkdq-list;
}

.hkdq-article ol li::before {
  content: counter(hkdq-list);
  position: absolute;
  left: 0;
  top: 1px;
  width: 20px;
  height: 20px;
  background: var(--gold);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  line-height: 1;
}

/* ═══════════════════════════════════════════════════════
   2.  STYLED HTML TABLES  (.hkdq-table)
   ═══════════════════════════════════════════════════════ */
.hkdq-table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 24px 0;
  border-radius: 14px;
  box-shadow: var(--shadow);
}

.hkdq-table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border-radius: 14px;
  overflow: hidden;
  font-size: 16px;
}

.hkdq-table thead th {
  background: linear-gradient(135deg, var(--red), #8a1a15);
  color: #fff;
  padding: 14px 18px;
  font-weight: 600;
  text-align: left;
  font-size: 15px;
  letter-spacing: .3px;
  border-bottom: 3px solid var(--gold);
  white-space: nowrap;
}

.hkdq-table thead th:first-child {
  border-top-left-radius: 14px;
}

.hkdq-table thead th:last-child {
  border-top-right-radius: 14px;
}

.hkdq-table tbody td {
  padding: 12px 18px;
  background: var(--card);
  border-bottom: 1px solid var(--line);
  color: var(--ink-soft);
  transition: background .2s ease, color .2s ease;
}

.hkdq-table tbody tr:nth-child(even) td {
  background: var(--bg2);
}

.hkdq-table tbody tr:last-child td {
  border-bottom: none;
}

.hkdq-table tbody tr:last-child td:first-child {
  border-bottom-left-radius: 14px;
}

.hkdq-table tbody tr:last-child td:last-child {
  border-bottom-right-radius: 14px;
}

.hkdq-table tbody tr:hover td {
  background: var(--gold-soft);
  color: var(--ink);
}

/* Table utility tags (reuse from phi-tinh) */
.hkdq-table .tag-cat {
  display: inline-block;
  background: rgba(26,107,60,.12);
  color: var(--green);
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

.hkdq-table .tag-hung {
  display: inline-block;
  background: rgba(110,14,10,.1);
  color: var(--red);
  font-size: 13px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: 20px;
}

/* ═══════════════════════════════════════════════════════
   3.  INFO CARD  (.hkdq-info-card)
   ═══════════════════════════════════════════════════════ */
.hkdq-info-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--gold);
  border-radius: 12px;
  padding: 26px 28px;
  margin: 24px 0;
  box-shadow: var(--shadow);
}

.hkdq-info-card .info-row {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px solid rgba(216,199,155,.25);
  align-items: baseline;
}

.hkdq-info-card .info-row:last-child {
  border-bottom: none;
}

.hkdq-info-card .info-row .info-label {
  font-weight: 700;
  color: var(--gold);
  text-transform: uppercase;
  font-size: 13px;
  letter-spacing: .6px;
  min-width: 140px;
  flex-shrink: 0;
  line-height: 1.6;
  padding-top: 2px;
}

.hkdq-info-card .info-row .info-value {
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

/* Info-note variant (gold background) */
.hkdq-info-card .info-note {
  margin-top: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(212,175,55,.12), rgba(212,175,55,.04));
  border-left: 4px solid var(--gold);
  border-radius: 0 10px 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--gold);
  line-height: 1.7;
}

.hkdq-info-card .info-note::before {
  content: "💡 ";
}

/* Info-warn variant (red background) */
.hkdq-info-card .info-warn {
  margin-top: 16px;
  padding: 14px 18px;
  background: linear-gradient(135deg, rgba(110,14,10,.1), rgba(110,14,10,.04));
  border-left: 4px solid var(--red);
  border-radius: 0 10px 10px 0;
  font-size: 15px;
  font-weight: 600;
  color: var(--red);
  line-height: 1.7;
}

.hkdq-info-card .info-warn::before {
  content: "⚠️ ";
}

/* ═══════════════════════════════════════════════════════
   4.  CALLOUT BOXES
   ═══════════════════════════════════════════════════════ */

/* Shared base */
.tip-box,
.warn-box,
.note-box,
.important-box {
  border-radius: 10px;
  padding: 18px 20px;
  margin: 20px 0;
  font-size: 16px;
  line-height: 1.75;
  position: relative;
}

/* ✅ Tip Box — green */
.tip-box {
  background: linear-gradient(135deg, var(--green-soft), rgba(26,107,60,.03));
  border-left: 4px solid var(--green);
  color: #1b5e20;
}

.tip-box::before {
  content: "✅ ";
}

.tip-box strong {
  color: var(--green);
}

/* ⚠️ Warn Box — red */
.warn-box {
  background: linear-gradient(135deg, var(--red-soft), rgba(110,14,10,.03));
  border-left: 4px solid var(--red);
  color: #7f1d1d;
}

.warn-box::before {
  content: "⚠️ ";
}

.warn-box strong {
  color: var(--red);
}

/* 💡 Note Box — gold */
.note-box {
  background: linear-gradient(135deg, rgba(212,175,55,.12), rgba(212,175,55,.04));
  border-left: 4px solid var(--gold);
  color: var(--ink-soft);
}

.note-box::before {
  content: "💡 ";
}

.note-box strong {
  color: var(--gold);
}

/* ★ Important Box — dark red, premium accent */
.important-box {
  background: linear-gradient(135deg, var(--red), #4a0908);
  border-left: none;
  color: rgba(255,255,255,.92);
  box-shadow: 0 8px 32px rgba(110,14,10,.22);
  overflow: hidden;
  position: relative;
}

.important-box::before {
  content: "★";
  position: absolute;
  right: 18px;
  top: 14px;
  font-size: 28px;
  color: rgba(212,175,55,.3);
  pointer-events: none;
}

.important-box h4,
.important-box .important-heading {
  font-family: "Noto Serif", serif;
  font-size: 18px;
  color: var(--gold-soft);
  margin: 0 0 10px;
  font-weight: 700;
  letter-spacing: .3px;
}

.important-box p {
  color: rgba(255,255,255,.88);
  margin: 0 0 8px;
  font-size: 16px;
}

.important-box strong {
  color: var(--gold-soft);
}

/* ═══════════════════════════════════════════════════════
   5.  SUMMARY BOX  (.hkdq-summary)
   ═══════════════════════════════════════════════════════ */
.hkdq-summary {
  background: linear-gradient(160deg, var(--bg2), var(--bg));
  border: 1px solid var(--gold-soft);
  border-radius: 16px;
  padding: 30px;
  margin: 40px 0 24px;
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hkdq-summary::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--gold), var(--red), var(--gold));
}

.hkdq-summary h3 {
  font-family: "Noto Serif", serif;
  color: var(--red);
  font-size: 22px;
  margin: 0 0 14px;
  line-height: 1.35;
}

.hkdq-summary p {
  font-size: 17px;
  color: var(--ink-soft);
  margin: 0 0 10px;
  line-height: 1.8;
}

.hkdq-summary ul {
  padding-left: 20px;
  margin: 10px 0 0;
}

.hkdq-summary li {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  line-height: 1.7;
}

/* ═══════════════════════════════════════════════════════
   6.  DIAGRAM CONTAINER  (.hkdq-diagram)
   ═══════════════════════════════════════════════════════ */
.hkdq-diagram {
  background: var(--bg2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 20px 24px;
  margin: 24px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  text-align: center;
}

.hkdq-diagram pre,
.hkdq-diagram code {
  font-family: "Noto Sans Mono", "SF Mono", "Fira Code", Consolas, monospace;
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
  white-space: pre;
  margin: 0;
  background: transparent;
  display: inline-block;
  text-align: left;
}

.hkdq-diagram .diagram-caption {
  margin-top: 12px;
  font-size: 14px;
  color: var(--ink-soft);
  font-style: italic;
  text-align: center;
}

/* ═══════════════════════════════════════════════════════
   7.  SECTION DIVIDER  (.hkdq-divider)
   ═══════════════════════════════════════════════════════ */
.hkdq-divider {
  border: none;
  height: 2px;
  max-width: 200px;
  margin: 40px auto;
  background: linear-gradient(90deg, transparent, var(--gold), transparent);
}

/* ═══════════════════════════════════════════════════════
   8.  HAN TU — Chinese Characters  (.han-tu)
   ═══════════════════════════════════════════════════════ */
.han-tu {
  font-size: .92em;
  color: var(--gold);
  font-weight: 400;
  font-style: normal;
  letter-spacing: .5px;
}

/* ═══════════════════════════════════════════════════════
   9.  HERO IMAGE UPGRADE  (.hkdq-hero-img)
   ═══════════════════════════════════════════════════════ */
.hkdq-hero-img {
  position: relative;
  width: 100%;
  max-height: 420px;
  overflow: hidden;
  border-bottom: 3px solid var(--gold);
}

.hkdq-hero-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.45);
  display: block;
}

.hkdq-hero-img .hero-overlay {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  min-height: 420px;
  padding: 24px;
  background: linear-gradient(180deg, rgba(28,20,16,.15) 0%, rgba(28,20,16,.65) 100%);
}

.hkdq-hero-img .hero-overlay .badge {
  display: inline-block;
  background: linear-gradient(135deg, var(--gold), #c9a227);
  color: #1c1410;
  font-weight: 700;
  font-size: 15px;
  padding: 6px 20px;
  border-radius: 30px;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin-bottom: 14px;
  box-shadow: 0 4px 16px rgba(212,175,55,.35);
}

.hkdq-hero-img .hero-overlay .badge.badge-hung {
  background: linear-gradient(135deg, #c62828, #8a1a15);
  color: #fff;
}

.hkdq-hero-img .hero-overlay h1 {
  font-family: "Noto Serif", serif;
  font-size: 40px;
  color: #fff;
  margin: 0 0 10px;
  line-height: 1.2;
  text-shadow: 0 3px 20px rgba(0,0,0,.5);
}

.hkdq-hero-img .hero-overlay .subtitle {
  font-size: 18px;
  color: rgba(255,255,255,.88);
  margin: 0;
  font-weight: 300;
  text-shadow: 0 2px 8px rgba(0,0,0,.4);
}

/* ═══════════════════════════════════════════════════════
   UTILITY: Scroll Animations
   ═══════════════════════════════════════════════════════ */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(24px); }
  to   { opacity: 1; transform: translateY(0); }
}

.fade-in {
  opacity: 0;
  animation: fadeInUp .6s ease-out forwards;
}

/* Staggered delay helpers */
.fade-in.d1 { animation-delay: .1s; }
.fade-in.d2 { animation-delay: .2s; }
.fade-in.d3 { animation-delay: .3s; }
.fade-in.d4 { animation-delay: .4s; }

/* ═══════════════════════════════════════════════════════
   UTILITY: Application Card Grid  (.hkdq-app-grid)
   ═══════════════════════════════════════════════════════ */
.hkdq-app-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  margin: 24px 0;
}

.hkdq-app-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 24px;
  box-shadow: var(--shadow);
  transition: transform .25s ease, box-shadow .25s ease;
}

.hkdq-app-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 16px 40px rgba(60,40,10,.12);
}

.hkdq-app-card h4 {
  font-family: "Noto Serif", serif;
  font-size: 19px;
  color: var(--red);
  margin: 0 0 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.hkdq-app-card ul {
  padding-left: 18px;
  margin: 0;
}

.hkdq-app-card li {
  font-size: 16px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  line-height: 1.6;
}

.hkdq-app-card.good  { border-top: 3px solid var(--green); }
.hkdq-app-card.good  h4 { color: var(--green); }
.hkdq-app-card.bad   { border-top: 3px solid #c62828; }
.hkdq-app-card.bad   h4 { color: #c62828; }

/* ═══════════════════════════════════════════════════════
   UTILITY: Element Relationship Grid
   ═══════════════════════════════════════════════════════ */
.hkdq-element-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 14px;
  margin: 24px 0;
}

.hkdq-element-item {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 18px 14px;
  text-align: center;
  box-shadow: var(--shadow);
  transition: transform .2s ease;
}

.hkdq-element-item:hover {
  transform: translateY(-2px);
}

.hkdq-element-item .el-icon  { font-size: 30px; margin-bottom: 8px; }
.hkdq-element-item .el-label { font-size: 13px; font-weight: 600; color: var(--ink-soft); text-transform: uppercase; letter-spacing: .5px; margin-bottom: 4px; }
.hkdq-element-item .el-text  { font-size: 15px; color: var(--ink); line-height: 1.4; }

.hkdq-element-item.boost    { border-top: 3px solid var(--green); }
.hkdq-element-item.drain    { border-top: 3px solid #e65100; }
.hkdq-element-item.conquer  { border-top: 3px solid var(--gold); }
.hkdq-element-item.suppress { border-top: 3px solid #c62828; }

/* ═══════════════════════════════════════════════════════
   UTILITY: Back Link, Error State, Skeleton Loaders
   ═══════════════════════════════════════════════════════ */
.hkdq-back-link {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 40px 0 20px;
  font-size: 17px;
  font-weight: 600;
  color: var(--red-2);
  transition: gap .2s ease;
}

.hkdq-back-link:hover {
  gap: 12px;
  color: var(--red);
}

.hkdq-error-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--ink-soft);
}

.hkdq-error-state .icon { font-size: 54px; margin-bottom: 16px; }
.hkdq-error-state h3    { font-family: "Noto Serif", serif; color: var(--red); font-size: 24px; margin: 0 0 10px; }
.hkdq-error-state p     { font-size: 17px; margin: 0 0 20px; }

.hkdq-error-state a {
  display: inline-block;
  padding: 12px 28px;
  background: var(--red);
  color: #fff;
  border-radius: 10px;
  font-weight: 600;
  transition: background .2s ease;
}

.hkdq-error-state a:hover {
  background: var(--red-2);
  color: #fff;
}

/* Skeleton loader */
@keyframes shimmer {
  0%   { background-position: -400px 0; }
  100% { background-position:  400px 0; }
}

.hkdq-skeleton {
  border-radius: 8px;
  background: linear-gradient(90deg, var(--bg2) 25%, rgba(255,255,255,.5) 50%, var(--bg2) 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite;
}

.hkdq-skel-h2     { height: 32px; width: 60%;  margin: 48px 0 18px; }
.hkdq-skel-p      { height: 18px; width: 100%; margin: 0 0 14px; }
.hkdq-skel-p.short   { width: 75%; }
.hkdq-skel-p.shorter { width: 50%; }
.hkdq-skel-card   { height: 220px; border-radius: 16px; margin: 24px 0; }
.hkdq-skel-table  { height: 320px; border-radius: 14px; margin: 24px 0; }

/* ═══════════════════════════════════════════════════════
   10. RESPONSIVE BREAKPOINTS
   ═══════════════════════════════════════════════════════ */

/* ─── Tablet (≤ 1023px) ─── */
@media (max-width: 1023px) {
  .hkdq-table {
    font-size: 14px;
  }

  .hkdq-table thead th {
    padding: 12px 14px;
    font-size: 13px;
  }

  .hkdq-table tbody td {
    padding: 10px 14px;
  }

  .hkdq-info-card .info-row {
    flex-direction: column;
    gap: 4px;
  }

  .hkdq-info-card .info-row .info-label {
    min-width: auto;
  }

  .hkdq-element-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ─── Mobile (≤ 767px) ─── */
@media (max-width: 767px) {
  .hkdq-hero-img .hero-overlay h1 {
    font-size: 28px;
  }

  .hkdq-hero-img .hero-overlay .subtitle {
    font-size: 16px;
  }

  .hkdq-hero-img .hero-overlay .badge {
    font-size: 13px;
    padding: 5px 14px;
  }

  .hkdq-hero-img img,
  .hkdq-hero-img .hero-overlay {
    min-height: 300px;
  }

  .hkdq-article h2 {
    font-size: 24px;
  }

  .hkdq-article h3 {
    font-size: 20px;
  }

  .hkdq-article p {
    font-size: 16px;
  }

  .hkdq-app-grid {
    grid-template-columns: 1fr;
  }

  .hkdq-element-grid {
    grid-template-columns: 1fr 1fr;
  }

  .hkdq-summary {
    padding: 22px;
  }

  .hkdq-info-card {
    padding: 20px;
  }

  .hkdq-diagram {
    padding: 14px 12px;
  }

  .hkdq-diagram pre,
  .hkdq-diagram code {
    font-size: 13px;
  }
}

/* ─── Small mobile (≤ 480px) ─── */
@media (max-width: 480px) {
  .hkdq-hero-img .hero-overlay h1 {
    font-size: 24px;
  }

  .hkdq-hero-img img,
  .hkdq-hero-img .hero-overlay {
    min-height: 240px;
  }

  .hkdq-article h2 {
    font-size: 22px;
    margin: 36px 0 14px;
  }

  .hkdq-article h3 {
    font-size: 18px;
  }

  .hkdq-article p,
  .hkdq-article ul li,
  .hkdq-article ol li {
    font-size: 15px;
  }

  .hkdq-info-card {
    padding: 16px;
  }

  .hkdq-info-card .info-row .info-value {
    font-size: 15px;
  }

  .tip-box,
  .warn-box,
  .note-box,
  .important-box {
    padding: 14px 16px;
    font-size: 15px;
  }

  .hkdq-summary {
    padding: 18px;
    margin: 30px 0 20px;
  }

  .hkdq-summary h3 {
    font-size: 20px;
  }

  .hkdq-table thead th {
    padding: 10px 10px;
    font-size: 12px;
  }

  .hkdq-table tbody td {
    padding: 8px 10px;
    font-size: 14px;
  }

  .hkdq-app-card {
    padding: 18px;
  }

  .hkdq-element-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .hkdq-element-item {
    padding: 14px 10px;
  }

  .hkdq-divider {
    margin: 30px auto;
  }

  .hkdq-diagram pre,
  .hkdq-diagram code {
    font-size: 12px;
  }
}
