/* ==========================================================================
   LSVN Pages — Lịch sử Việt Nam
   Style riêng cho các trang trong /lich-su-viet-nam/
   ========================================================================== */

.lsvn-main {
  min-height: calc(100vh - 200px);
  padding: 24px 0 48px;
  background: #f8f9fb;
}

.lsvn-container {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== Breadcrumb ===== */
.lsvn-breadcrumb {
  margin-bottom: 20px;
  font-size: 13px;
  color: #64748b;
}

.lsvn-breadcrumb ol {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 0;
}

.lsvn-breadcrumb li {
  display: flex;
  align-items: center;
}

.lsvn-breadcrumb li + li::before {
  content: '›';
  margin: 0 8px;
  color: #cbd5e1;
}

.lsvn-breadcrumb a {
  color: #475569;
  text-decoration: none;
  transition: color 0.15s;
}

.lsvn-breadcrumb a:hover {
  color: #0ea5e9;
  text-decoration: underline;
}

.lsvn-breadcrumb [aria-current="page"] {
  color: #1a202c;
  font-weight: 500;
}

/* ===== Article ===== */
.lsvn-article {
  background: #fff;
  border-radius: 12px;
  padding: 32px 36px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04), 0 4px 16px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
}

.lsvn-meta {
  display: flex;
  gap: 8px;
  margin-bottom: 12px;
}

.lsvn-category {
  display: inline-block;
  background: #e0f2fe;
  color: #0369a1;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.lsvn-title {
  font-size: 32px;
  line-height: 1.25;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 24px;
  letter-spacing: -0.02em;
}

/* ===== Content body ===== */
.lsvn-content {
  font-size: 16px;
  line-height: 1.75;
  color: #334155;
}

.lsvn-content p {
  margin: 0 0 16px;
  text-align: justify;
}

.lsvn-content strong {
  color: #0f172a;
  font-weight: 600;
}

.lsvn-content em {
  color: #334155;
  font-style: italic;
}

.lsvn-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 20px auto;
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.lsvn-content a {
  color: #0284c7;
  text-decoration: underline;
  text-decoration-color: #7dd3fc;
  text-underline-offset: 3px;
  transition: all 0.15s;
}

.lsvn-content a:hover {
  color: #0369a1;
  text-decoration-color: #0284c7;
}

/* ===== Related / Pair Links ===== */
.lsvn-related {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 24px;
  border-left: 4px solid #0ea5e9;
}

.lsvn-related h2 {
  font-size: 18px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 12px;
}

.lsvn-related ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.lsvn-related li {
  margin-bottom: 8px;
}

.lsvn-related a {
  display: block;
  padding: 10px 14px;
  background: #f1f5f9;
  border-radius: 8px;
  color: #0369a1;
  text-decoration: none;
  font-weight: 500;
  transition: all 0.15s;
}

.lsvn-related a:hover {
  background: #e0f2fe;
  color: #075985;
  transform: translateX(4px);
}

.lsvn-related a::before {
  content: '→';
  margin-right: 8px;
  color: #0ea5e9;
}

/* ===== Back link ===== */
.lsvn-back {
  text-align: center;
  padding: 16px 0;
}

.lsvn-back-link {
  display: inline-block;
  padding: 10px 20px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  color: #475569;
  text-decoration: none;
  font-size: 14px;
  font-weight: 500;
  transition: all 0.15s;
}

.lsvn-back-link:hover {
  background: #f1f5f9;
  border-color: #cbd5e1;
  color: #0f172a;
}

/* ===== Index page ===== */
.lsvn-index-title {
  font-size: 36px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.lsvn-index-intro {
  font-size: 16px;
  line-height: 1.7;
  color: #475569;
  max-width: 720px;
  margin: 0 0 32px;
}

.lsvn-index-intro strong {
  color: #0f172a;
  font-weight: 600;
}

.lsvn-group {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
}

.lsvn-group-title {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px;
  padding-bottom: 12px;
  border-bottom: 2px solid #e0f2fe;
  display: flex;
  align-items: baseline;
  gap: 8px;
}

.lsvn-count {
  font-size: 13px;
  font-weight: 500;
  color: #64748b;
  background: #f1f5f9;
  padding: 2px 10px;
  border-radius: 999px;
}

.lsvn-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 8px;
}

.lsvn-list li {
  margin: 0;
}

.lsvn-list a {
  display: block;
  padding: 10px 14px;
  color: #0369a1;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  transition: all 0.15s;
  line-height: 1.4;
}

.lsvn-list a:hover {
  background: #f0f9ff;
  color: #075985;
  transform: translateX(2px);
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .lsvn-main {
    padding: 16px 0 32px;
  }

  .lsvn-container {
    padding: 0 12px;
  }

  .lsvn-article {
    padding: 20px 20px;
  }

  .lsvn-title {
    font-size: 24px;
    margin-bottom: 16px;
  }

  .lsvn-index-title {
    font-size: 26px;
  }

  .lsvn-content {
    font-size: 15px;
    line-height: 1.7;
  }

  .lsvn-list {
    grid-template-columns: 1fr;
  }

  .lsvn-related {
    padding: 18px 20px;
  }

  .lsvn-group {
    padding: 18px 20px;
  }
}

/* ===== Dark mode support (tùy theo body class) ===== */
body.theme-dark .lsvn-main {
  background: #0f172a;
}

body.theme-dark .lsvn-article,
body.theme-dark .lsvn-related,
body.theme-dark .lsvn-group {
  background: #1e293b;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.theme-dark .lsvn-title,
body.theme-dark .lsvn-index-title,
body.theme-dark .lsvn-group-title,
body.theme-dark .lsvn-related h2 {
  color: #f1f5f9;
}

body.theme-dark .lsvn-content {
  color: #cbd5e1;
}

body.theme-dark .lsvn-content strong {
  color: #f1f5f9;
}

body.theme-dark .lsvn-breadcrumb {
  color: #94a3b8;
}

body.theme-dark .lsvn-breadcrumb a {
  color: #cbd5e1;
}

body.theme-dark .lsvn-breadcrumb [aria-current="page"] {
  color: #f1f5f9;
}

body.theme-dark .lsvn-related a,
body.theme-dark .lsvn-list a {
  background: #334155;
  color: #7dd3fc;
}

body.theme-dark .lsvn-related a:hover,
body.theme-dark .lsvn-list a:hover {
  background: #475569;
  color: #bae6fd;
}

body.theme-dark .lsvn-back-link {
  background: #1e293b;
  border-color: #334155;
  color: #cbd5e1;
}

body.theme-dark .lsvn-back-link:hover {
  background: #334155;
  color: #f1f5f9;
}

/* ==========================================================================
   NEW LAYOUT (Sprint 2.1.5 refactor) — hierarchical view
   ========================================================================== */

/* ===== Era grid (on super index) ===== */
.lsvn-era-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
  margin: 24px 0;
}

.lsvn-era-card {
  display: block;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  text-decoration: none;
  color: inherit;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  border: 2px solid transparent;
  transition: all 0.2s;
}

.lsvn-era-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.12);
  border-color: #0ea5e9;
}

.lsvn-era-name {
  font-size: 22px;
  font-weight: 800;
  color: #0f172a;
  margin-bottom: 8px;
  font-family: Georgia, 'Times New Roman', serif;
}

.lsvn-era-count {
  font-size: 13px;
  color: #0ea5e9;
  font-weight: 600;
  margin-bottom: 10px;
}

.lsvn-era-periods {
  font-size: 13px;
  line-height: 1.6;
  color: #64748b;
}

/* ===== Era page title ===== */
.lsvn-era-title {
  font-size: 34px;
  font-weight: 800;
  color: #0f172a;
  margin: 0 0 12px;
  font-family: Georgia, serif;
}

.lsvn-era-intro {
  font-size: 15px;
  line-height: 1.7;
  color: #475569;
  margin: 0 0 28px;
}

/* ===== Period grid (on era page) ===== */
.lsvn-period-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 14px;
}

.lsvn-period-card {
  display: block;
  padding: 20px;
  background: #fff;
  border-radius: 10px;
  text-decoration: none;
  color: inherit;
  border: 1px solid #e2e8f0;
  transition: all 0.15s;
}

.lsvn-period-card:hover {
  border-color: #0ea5e9;
  transform: translateY(-2px);
  box-shadow: 0 4px 16px rgba(14, 165, 233, 0.08);
}

.lsvn-period-name {
  font-size: 17px;
  font-weight: 700;
  color: #0f172a;
  margin-bottom: 4px;
  font-family: Georgia, serif;
}

.lsvn-period-time {
  font-size: 12px;
  color: #0ea5e9;
  font-weight: 600;
  margin-bottom: 10px;
}

.lsvn-period-stats {
  display: flex;
  gap: 12px;
  font-size: 12px;
  color: #64748b;
}

.lsvn-period-stats span {
  padding: 2px 8px;
  background: #f1f5f9;
  border-radius: 999px;
}

/* ===== Period detail page ===== */
.lsvn-time {
  display: inline-block;
  background: #fef3c7;
  color: #92400e;
  padding: 4px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-left: 4px;
}

.lsvn-summary,
.lsvn-detail {
  margin: 24px 0;
  padding-top: 20px;
  border-top: 1px solid #e2e8f0;
}

.lsvn-summary h2,
.lsvn-detail h2 {
  font-size: 22px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 14px;
  font-family: Georgia, serif;
}

/* ===== Section (characters + events list on period page) ===== */
.lsvn-section {
  background: #fff;
  border-radius: 12px;
  padding: 24px 28px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.04);
  margin-bottom: 20px;
  border-left: 4px solid #0ea5e9;
}

.lsvn-section h2 {
  font-size: 20px;
  font-weight: 700;
  color: #0f172a;
  margin: 0 0 16px;
  font-family: Georgia, serif;
}

.lsvn-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 6px;
}

.lsvn-list li {
  margin: 0;
}

.lsvn-list a {
  display: block;
  padding: 10px 14px;
  color: #0369a1;
  text-decoration: none;
  border-radius: 6px;
  font-size: 14px;
  line-height: 1.4;
  transition: all 0.15s;
}

.lsvn-list a:hover {
  background: #e0f2fe;
  color: #075985;
  transform: translateX(2px);
}

/* ===== Prev/Next navigation ===== */
.lsvn-prev-next {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 24px 0;
}

.lsvn-nav-prev,
.lsvn-nav-next {
  display: flex;
  flex-direction: column;
  padding: 14px 18px;
  background: #fff;
  border-radius: 10px;
  text-decoration: none;
  border: 1px solid #e2e8f0;
  transition: all 0.15s;
}

.lsvn-nav-next {
  text-align: right;
}

.lsvn-nav-prev:hover,
.lsvn-nav-next:hover {
  border-color: #0ea5e9;
  background: #f0f9ff;
  transform: translateY(-2px);
}

.lsvn-nav-prev span,
.lsvn-nav-next span {
  font-size: 12px;
  color: #0ea5e9;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 4px;
}

.lsvn-nav-prev strong,
.lsvn-nav-next strong {
  font-size: 14px;
  color: #0f172a;
  font-weight: 600;
  line-height: 1.4;
}

.lsvn-nav-placeholder {
  display: block;
}

/* ===== Responsive ===== */
@media (max-width: 640px) {
  .lsvn-era-grid,
  .lsvn-period-grid {
    grid-template-columns: 1fr;
  }
  .lsvn-era-title {
    font-size: 26px;
  }
  .lsvn-prev-next {
    grid-template-columns: 1fr;
  }
  .lsvn-list {
    grid-template-columns: 1fr;
  }
}

/* ===== Dark mode ===== */
body.theme-dark .lsvn-era-card,
body.theme-dark .lsvn-period-card,
body.theme-dark .lsvn-section,
body.theme-dark .lsvn-nav-prev,
body.theme-dark .lsvn-nav-next {
  background: #1e293b;
  border-color: #334155;
}

body.theme-dark .lsvn-era-name,
body.theme-dark .lsvn-period-name,
body.theme-dark .lsvn-era-title,
body.theme-dark .lsvn-summary h2,
body.theme-dark .lsvn-detail h2,
body.theme-dark .lsvn-section h2,
body.theme-dark .lsvn-nav-prev strong,
body.theme-dark .lsvn-nav-next strong {
  color: #f1f5f9;
}

body.theme-dark .lsvn-era-intro,
body.theme-dark .lsvn-era-periods,
body.theme-dark .lsvn-period-stats {
  color: #94a3b8;
}

body.theme-dark .lsvn-list a {
  color: #7dd3fc;
}

body.theme-dark .lsvn-list a:hover {
  background: #334155;
  color: #bae6fd;
}

body.theme-dark .lsvn-summary,
body.theme-dark .lsvn-detail {
  border-top-color: #334155;
}

body.theme-dark .lsvn-period-stats span {
  background: #334155;
  color: #cbd5e1;
}
