@import url('/css/common.css?v=41');

/* --- DESIGN SYSTEM & VARIABLES --- */
:root {
  --font: 'Be Vietnam Pro', sans-serif;
  --bg: #fbf3e4;          /* Warm cream canvas */
  --bg-2: #f6e8cf;        /* Slightly darker cream */
  --surface: #ffffff;     /* Card background */
  --text: #2b1d0e;        /* Dark brown-black */
  --sub: #6b563d;         /* Subdued brown */
  --muted: #a7937a;       /* Muted tan */
  --border: rgba(120,80,25,0.12);
  --shadow: 0 6px 22px rgba(120,75,25,0.09);
  --shadow-h: 0 16px 44px rgba(120,75,25,0.18);
  
  /* Module colors */
  --c-gieoque: #0d9668;   /* Jade green */
  --c-tarot: #7c3aed;     /* Purple */
  --c-tuvi: #e8930a;      /* Amber gold */
  --c-thuvien: #2563eb;   /* Deep blue */
}

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

body {
  font-family: var(--font);
  background-color: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  padding: 0;
  margin: 0;
}

/* --- LAYOUT CONTAINERS --- */
.container {
  max-width: 980px;
  margin: 0 auto;
  padding: 0 24px;
}

.header {
  padding: 40px 0 24px;
  text-align: center;
  position: relative;
}

.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sub);
  text-decoration: none;
  font-size: 14px;
  font-weight: 600;
  background: var(--surface);
  padding: 8px 16px;
  border-radius: 12px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
  margin-bottom: 24px;
}

.btn-back:hover {
  transform: translateX(-4px);
  color: var(--text);
  box-shadow: var(--shadow-h);
}

.brand-title {
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.5px;
  margin-bottom: 8px;
  background: linear-gradient(135deg, #4c3013, #2b1d0e);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.brand-subtitle {
  font-size: 16px;
  color: var(--sub);
  max-width: 540px;
  margin: 0 auto 40px;
}

/* --- CARD GRID & ARTICLE CARDS --- */
.article-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 24px;
  margin-bottom: 64px;
}

@media (min-width: 640px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 900px) {
  .article-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

.article-card {
  background: var(--surface);
  border-radius: 24px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.article-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-h);
  border-color: rgba(120,80,25,0.25);
}

.card-banner {
  height: 8px;
  width: 100%;
}

.card-banner.gieoque { background-color: var(--c-gieoque); }
.card-banner.tarot { background-color: var(--c-tarot); }
.card-banner.tuvi { background-color: var(--c-tuvi); }
.card-banner { background-color: var(--c-thuvien); }

.card-content {
  padding: 24px;
  display: flex;
  flex-direction: column;
  flex-grow: 1;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}

.badge {
  font-size: 11px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 4px 8px;
  border-radius: 6px;
}

.badge { background: rgba(37, 99, 235, 0.1); color: var(--c-thuvien); }
.badge.gieoque { background: rgba(13, 150, 104, 0.1); color: var(--c-gieoque); }
.badge.tarot { background: rgba(124, 58, 237, 0.1); color: var(--c-tarot); }
.badge.tuvi { background: rgba(232, 147, 10, 0.1); color: var(--c-tuvi); }

.card-title {
  font-size: 18px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 10px;
  color: var(--text);
  transition: color 0.2s ease;
}

.article-card:hover .card-title {
  color: var(--c-thuvien);
}

.card-desc {
  font-size: 14px;
  color: var(--sub);
  line-height: 1.5;
  margin-bottom: 20px;
  flex-grow: 1;
}

.card-footer {
  display: flex;
  align-items: center;
  font-size: 13px;
  font-weight: 700;
  color: var(--c-thuvien);
  margin-top: auto;
}

.card-footer i {
  transition: transform 0.2s ease;
}

.article-card:hover .card-footer i {
  transform: translateX(4px);
}

/* --- ARTICLE PAGE SPECIFICS --- */
.article-container {
  max-width: 760px;
  margin: 0 auto;
  padding: 40px 24px 80px;
}

.breadcrumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 24px;
}

.breadcrumbs a {
  color: var(--sub);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--text);
}

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

.article-h1 {
  font-size: 32px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.5px;
  color: var(--text);
  margin-bottom: 16px;
}

@media (max-width: 600px) {
  .article-h1 {
    font-size: 24px;
  }
}

/* --- TABLE OF CONTENTS ("Mục lục") --- */
.article-toc {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  box-shadow: var(--shadow);
  padding: 16px 20px;
  margin-bottom: 28px;
}

.toc-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  color: var(--c-thuvien);
  margin-bottom: 12px;
}

.toc-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.toc-list a {
  display: block;
  font-size: 14px;
  line-height: 1.4;
  color: var(--sub);
  text-decoration: none;
  padding: 6px 10px;
  border-radius: 8px;
  border-left: 2px solid transparent;
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}

.toc-list a:hover {
  background: var(--bg-2);
  color: var(--text);
}

.toc-list a.active {
  color: var(--c-thuvien);
  font-weight: 700;
  border-left-color: var(--c-thuvien);
  background: rgba(37, 99, 235, 0.06);
}

/* Wide desktop: float the TOC into the right gutter as a sticky panel.
   The article is centered inside body's content box, which is shifted
   right by the 80px left-dock padding — so its center sits at ~50%+40px
   and its right edge at ~50%+420px. Park the TOC just past that. */
@media (min-width: 1280px) {
  .article-toc {
    position: fixed;
    top: 96px;
    left: calc(50% + 430px);
    width: 190px;
    max-height: calc(100vh - 140px);
    overflow-y: auto;
    margin-bottom: 0;
    z-index: 5;
  }
}

.article-body {
  background: var(--surface);
  border-radius: 28px;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  padding: 40px;
  font-size: 16px;
  color: var(--text);
}

@media (max-width: 600px) {
  .article-body {
    padding: 24px;
  }
}

.article-body p {
  margin-bottom: 20px;
}

.article-body h2 {
  font-size: 22px;
  font-weight: 800;
  margin-top: 36px;
  margin-bottom: 16px;
  color: var(--text);
  border-left: 4px solid var(--c-thuvien);
  padding-left: 12px;
}

.article-body h2.gieoque { border-left-color: var(--c-gieoque); }
.article-body h2.tarot { border-left-color: var(--c-tarot); }
.article-body h2.tuvi { border-left-color: var(--c-tuvi); }

.article-body h3 {
  font-size: 18px;
  font-weight: 700;
  margin-top: 24px;
  margin-bottom: 12px;
}

.article-body ul, .article-body ol {
  margin-left: 20px;
  margin-bottom: 20px;
}

.article-body li {
  margin-bottom: 8px;
}

/* Elegant tables */
.table-responsive {
  width: 100%;
  overflow-x: auto;
  margin: 24px 0;
  border-radius: 16px;
  border: 1px solid var(--border);
}

.seo-table {
  width: 100%;
  border-collapse: collapse;
  text-align: left;
  font-size: 14px;
}

.seo-table th {
  background-color: var(--bg-2);
  color: var(--text);
  font-weight: 700;
  padding: 12px 16px;
  border-bottom: 2px solid var(--border);
}

.seo-table td {
  padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--sub);
}

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

/* FAQ section inside an article body — override common.css standalone spacing */
.faq-section {
  max-width: none;
  margin: 40px 0 0;
  padding: 32px 0 0;
  border-top: 1px dashed var(--border);
  text-align: left;
}

/* Note: the Q&A item visuals (list / item / question / answer + blue ? bullet)
   come from the theme-aware "Premium FAQ List Layout" in common.css. Here we
   only adapt the section wrapper so it sits naturally inside the article body
   (left-aligned, no extra centering/inset that common.css adds for standalone use). */
.faq-title {
  font-size: 20px;
  font-weight: 800;
  text-align: left;
  margin-bottom: 20px;
}

/* Author Box */
.author-box {
  background: var(--bg-2);
  border-radius: 16px;
  padding: 20px;
  margin-top: 40px;
  font-size: 14px;
  color: var(--sub);
  border-left: 4px solid var(--muted);
}

.author-box p {
  margin-bottom: 6px !important;
}

.author-box p:last-child {
  margin-bottom: 0 !important;
}

/* Related articles */
.related-articles {
  margin-top: 48px;
}

.related-title {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 16px;
}

.related-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.related-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px;
  text-decoration: none;
  color: var(--text);
  font-weight: 700;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}

.related-item:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-h);
  border-color: var(--c-thuvien);
}

/* CTA buttons inside articles */
.article-cta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--c-thuvien);
  color: #fff;
  font-weight: 700;
  font-size: 15px;
  text-decoration: none;
  padding: 12px 24px;
  border-radius: 14px;
  margin: 24px 0;
  transition: all 0.2s ease;
}

.article-cta:hover {
  opacity: 0.9;
  transform: translateY(-2px);
}

.article-cta.gieoque { background-color: var(--c-gieoque); }
.article-cta.tarot { background-color: var(--c-tarot); }
.article-cta.tuvi { background-color: var(--c-tuvi); }

/* --- FOOTER --- */
.footer {
  text-align: center;
  padding: 48px 0;
  border-top: 1px solid var(--border);
  font-size: 13px;
  color: var(--muted);
  margin-top: 40px;
}

.footer-nav {
  margin-bottom: 12px;
}

.footer-nav a {
  color: var(--sub);
  text-decoration: none;
  margin: 0 8px;
}

.footer-nav a:hover {
  color: var(--text);
}

/* --- FLOATING DOCK SAFE-AREAS --- */
/* Mobile: bottom bar — keep footer clear of it */
@media (max-width: 767px) {
  body.thuvien-theme { padding-bottom: 84px; }
}
/* Desktop: left sidebar rail — give content a left gutter so it never overlaps */
@media (min-width: 768px) {
  body.thuvien-theme { padding-left: 80px; }
}
