/* ============================================
   CHINAMAXXING.INFO - Global Stylesheet
   Design: Imperial Chinese Aesthetic - Content Website
   Primary: China Red | Accent: Gold | Base: Ink & Rice Paper
   ============================================ */

/* --- CSS Variables --- */
:root {
  --red-primary: #B22222;
  --red-deep: #8B1A1A;
  --red-bright: #C41E24;
  --red-light: #D4453A;
  --gold-primary: #C5A55A;
  --gold-light: #D4B96A;
  --gold-dark: #A08030;
  --ink-black: #1C1C1C;
  --ink-dark: #2C2C2C;
  --ink-medium: #4A4A4A;
  --ink-light: #6B6B6B;
  --paper-white: #FDF9F3;
  --paper-cream: #F8F2E8;
  --paper-warm: #F3EBDD;
  --border-light: rgba(178, 34, 34, 0.12);
  --shadow-soft: 0 4px 24px rgba(28, 28, 28, 0.06);
  --shadow-medium: 0 8px 40px rgba(28, 28, 28, 0.1);
  --shadow-red: 0 4px 20px rgba(178, 34, 34, 0.15);
  --font-display: 'Playfair Display', 'Noto Serif SC', serif;
  --font-body: 'Cormorant Garamond', 'Noto Serif SC', serif;
  --font-accent: 'Noto Serif SC', serif;
  --transition-smooth: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --max-width: 1200px;
}

/* --- Reset & Base --- */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  font-size: 16px;
}

body {
  font-family: var(--font-body);
  background-color: var(--paper-white);
  color: var(--ink-dark);
  line-height: 1.8;
  font-size: 1.125rem;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--red-primary);
  text-decoration: none;
  transition: var(--transition-smooth);
}

a:hover {
  color: var(--red-bright);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* --- Typography --- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--ink-black);
  line-height: 1.3;
  font-weight: 700;
}

h1 { font-size: clamp(2.5rem, 5vw, 4rem); }
h2 { font-size: clamp(1.8rem, 3.5vw, 2.75rem); }
h3 { font-size: clamp(1.3rem, 2.5vw, 1.75rem); }
h4 { font-size: 1.25rem; }

p {
  margin-bottom: 1.2em;
  color: var(--ink-medium);
}

/* --- Header & Navigation --- */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(253, 249, 243, 0.96);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0.9rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo {
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-mark {
  width: 40px;
  height: 40px;
  background: var(--red-primary);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--paper-white);
  font-family: var(--font-accent);
  font-size: 1.1rem;
  font-weight: 700;
  transform: rotate(-2deg);
  box-shadow: var(--shadow-red);
}

.logo-text {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink-black);
  letter-spacing: -0.5px;
}

.logo-text span {
  color: var(--red-primary);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 1.8rem;
}

.main-nav a {
  font-family: var(--font-body);
  font-size: 1.05rem;
  color: var(--ink-medium);
  position: relative;
  padding: 4px 0;
  letter-spacing: 0.3px;
}

.main-nav a::after {
  content: '';
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--red-primary);
  transition: width 0.3s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--red-primary);
}

.main-nav a:hover::after,
.main-nav a.active::after {
  width: 100%;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 8px;
}

.nav-toggle span {
  width: 24px;
  height: 2px;
  background: var(--ink-black);
  transition: var(--transition-smooth);
}

/* --- Hero Section (Homepage) --- */
.hero {
  min-height: 85vh;
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  background: var(--ink-black);
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0.78;
  transition: transform 8s ease;
}

.hero:hover .hero-bg {
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(28,28,28,0.45) 0%, rgba(139,26,26,0.15) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 8rem 2rem 4rem;
}

.hero-content h1 {
  color: var(--paper-white);
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  margin-bottom: 1.2rem;
  letter-spacing: -1px;
}

.hero-content h1 .highlight {
  color: var(--gold-primary);
}

.hero-tagline {
  font-size: 1.35rem;
  color: rgba(253, 249, 243, 0.85);
  max-width: 600px;
  margin-bottom: 2.5rem;
  font-style: italic;
}

.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 36px;
  background: var(--red-primary);
  color: var(--paper-white);
  font-family: var(--font-body);
  font-size: 1.1rem;
  border-radius: 2px;
  box-shadow: var(--shadow-red);
  transition: var(--transition-smooth);
}

.hero-cta:hover {
  background: var(--red-bright);
  color: var(--paper-white);
  transform: translateY(-2px);
  box-shadow: 0 8px 30px rgba(178, 34, 34, 0.35);
}

/* --- Page Hero (Interior Pages) --- */
.page-hero {
  padding: 9rem 2rem 4rem;
  text-align: center;
  position: relative;
  background: linear-gradient(180deg, var(--paper-cream) 0%, var(--paper-white) 100%);
  overflow: hidden;
}

.page-hero::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--red-deep), var(--red-primary), var(--gold-primary), var(--red-primary), var(--red-deep));
}

.page-hero h1 {
  margin-bottom: 0.75rem;
}

.page-hero .page-desc {
  font-size: 1.2rem;
  color: var(--ink-light);
  max-width: 600px;
  margin: 0 auto;
  font-style: italic;
}

.page-hero .side-ornament {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 1px;
  height: 120px;
  background: linear-gradient(180deg, transparent, var(--gold-primary), transparent);
}

.page-hero .side-ornament.left { left: 5%; }
.page-hero .side-ornament.right { right: 5%; }

/* --- Section Titles --- */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 2.5rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--border-light);
}

.section-header h2 {
  position: relative;
  padding-left: 1rem;
}

.section-header h2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 4px;
  background: var(--red-primary);
  border-radius: 2px;
}

.section-header .subtitle {
  font-family: var(--font-accent);
  font-size: 0.9rem;
  color: var(--gold-dark);
  letter-spacing: 2px;
}

.section-header .view-all {
  font-size: 1rem;
  color: var(--red-primary);
  white-space: nowrap;
}

.section-header .view-all:hover {
  text-decoration: underline;
}

/* Centered section title variant */
.section-title {
  text-align: center;
  margin-bottom: 3rem;
}

.section-title h2 {
  display: inline-block;
  position: relative;
  padding: 0 2rem;
}

.section-title h2::before,
.section-title h2::after {
  content: '';
  position: absolute;
  top: 50%;
  width: 40px;
  height: 1px;
  background: var(--gold-primary);
}

.section-title h2::before { left: -30px; }
.section-title h2::after { right: -30px; }

.section-title .subtitle {
  display: block;
  font-family: var(--font-accent);
  font-size: 0.9rem;
  color: var(--gold-dark);
  margin-top: 0.5rem;
  letter-spacing: 3px;
  font-weight: 400;
}

/* --- Content Container --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 4rem 2rem;
}

.container.narrow {
  max-width: 800px;
}

/* --- Article Cards (Content Website Core) --- */
.article-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}

.article-card {
  background: var(--paper-white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
}

.article-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
  border-color: transparent;
}

.article-card .card-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--paper-cream);
}

.article-card .card-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}

.article-card:hover .card-thumb img {
  transform: scale(1.06);
}

.article-card .card-category {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--red-primary);
  color: var(--paper-white);
  font-size: 0.75rem;
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 0.5px;
  font-family: var(--font-body);
}

.article-card .card-body {
  padding: 1.5rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}

.article-card .card-body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.6rem;
  line-height: 1.4;
}

.article-card .card-body h3 a {
  color: var(--ink-black);
}

.article-card .card-body h3 a:hover {
  color: var(--red-primary);
}

.article-card .card-excerpt {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.7;
  flex: 1;
  margin-bottom: 1rem;
}

.article-card .card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--ink-light);
  padding-top: 0.75rem;
  border-top: 1px solid var(--border-light);
}

.article-card .card-meta .date {
  opacity: 0.7;
}

.article-card .card-meta .read-more {
  color: var(--red-primary);
  font-weight: 600;
}

/* Featured article (large card) */
.article-featured {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 0;
  background: var(--paper-white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  margin-bottom: 3rem;
  transition: var(--transition-smooth);
}

.article-featured:hover {
  box-shadow: var(--shadow-medium);
  border-color: transparent;
}

.article-featured .featured-thumb {
  position: relative;
  min-height: 380px;
  overflow: hidden;
}

.article-featured .featured-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  position: absolute;
  inset: 0;
  transition: transform 0.6s ease;
}

.article-featured:hover .featured-thumb img {
  transform: scale(1.04);
}

.article-featured .featured-body {
  padding: 3rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.article-featured .featured-body .card-category {
  display: inline-block;
  background: var(--red-primary);
  color: var(--paper-white);
  font-size: 0.75rem;
  padding: 3px 12px;
  border-radius: 2px;
  margin-bottom: 1rem;
  width: fit-content;
}

.article-featured .featured-body h2 {
  font-size: 1.8rem;
  margin-bottom: 1rem;
  line-height: 1.35;
}

.article-featured .featured-body h2 a {
  color: var(--ink-black);
}

.article-featured .featured-body h2 a:hover {
  color: var(--red-primary);
}

.article-featured .featured-body p {
  font-size: 1.05rem;
  color: var(--ink-light);
  margin-bottom: 1.5rem;
}

.article-featured .featured-body .card-meta {
  font-size: 0.85rem;
  color: var(--ink-light);
}

/* Horizontal article list item */
.article-list-item {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border-light);
  transition: var(--transition-smooth);
}

.article-list-item:hover {
  padding-left: 8px;
}

.article-list-item .list-thumb {
  aspect-ratio: 16/10;
  border-radius: 4px;
  overflow: hidden;
  background: var(--paper-cream);
}

.article-list-item .list-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.article-list-item:hover .list-thumb img {
  transform: scale(1.05);
}

.article-list-item .list-body h3 {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
}

.article-list-item .list-body h3 a {
  color: var(--ink-black);
}

.article-list-item .list-body h3 a:hover {
  color: var(--red-primary);
}

.article-list-item .list-body p {
  font-size: 0.95rem;
  color: var(--ink-light);
  margin-bottom: 0.5rem;
}

.article-list-item .list-body .card-meta {
  font-size: 0.82rem;
  color: var(--ink-light);
  opacity: 0.7;
}

/* --- Category Navigation Cards --- */
.category-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1.5rem;
}

.category-card {
  display: block;
  position: relative;
  border-radius: 6px;
  overflow: hidden;
  aspect-ratio: 3/4;
  background: var(--ink-black);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.7;
  transition: var(--transition-smooth);
}

.category-card:hover img {
  opacity: 0.5;
  transform: scale(1.05);
}

.category-card .category-label {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 2rem 1.25rem 1.25rem;
  background: linear-gradient(transparent, rgba(28,28,28,0.85));
  color: var(--paper-white);
}

.category-card .category-label h3 {
  color: var(--paper-white);
  font-size: 1.15rem;
  margin-bottom: 0.25rem;
}

.category-card .category-label p {
  color: rgba(253,249,243,0.7);
  font-size: 0.85rem;
  margin: 0;
}

/* --- Cloud Divider --- */
.cloud-divider {
  width: 100%;
  height: 60px;
  position: relative;
  overflow: hidden;
  opacity: 0.6;
}

.cloud-divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 200px;
  height: 2px;
  background: linear-gradient(90deg, transparent, var(--gold-primary), transparent);
}

.cloud-divider::after {
  content: '\2726';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-size: 1.2rem;
  color: var(--gold-primary);
  background: var(--paper-white);
  padding: 0 16px;
}

/* --- Proverb Block --- */
.proverb-block {
  text-align: center;
  padding: 3.5rem 2rem;
  margin: 3rem 0;
  position: relative;
  background: var(--paper-cream);
  border-radius: 6px;
}

.proverb-block::before {
  content: '\201C';
  font-family: var(--font-display);
  font-size: 5rem;
  color: var(--red-primary);
  opacity: 0.12;
  position: absolute;
  top: 0.5rem;
  left: 1.5rem;
  line-height: 1;
}

.proverb-block blockquote {
  font-family: var(--font-display);
  font-size: 1.5rem;
  color: var(--ink-black);
  font-style: italic;
  max-width: 650px;
  margin: 0 auto 0.75rem;
  line-height: 1.5;
}

.proverb-block cite {
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--gold-dark);
  font-style: normal;
  letter-spacing: 1px;
}

/* --- Breadcrumb --- */
.breadcrumb {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 1.25rem 2rem 0;
  font-size: 0.9rem;
  color: var(--ink-light);
}

.breadcrumb a {
  color: var(--ink-light);
}

.breadcrumb a:hover {
  color: var(--red-primary);
}

.breadcrumb span {
  margin: 0 8px;
  color: var(--gold-primary);
}

/* --- Sidebar Layout --- */
.content-with-sidebar {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 3rem;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 3rem 2rem;
}

.sidebar .sidebar-block {
  background: var(--paper-white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.sidebar .sidebar-block h4 {
  font-size: 1.05rem;
  margin-bottom: 1rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--red-primary);
}

.sidebar .sidebar-block ul {
  list-style: none;
}

.sidebar .sidebar-block ul li {
  padding: 0.5rem 0;
  border-bottom: 1px solid var(--border-light);
  font-size: 0.95rem;
}

.sidebar .sidebar-block ul li:last-child {
  border-bottom: none;
}

.sidebar .sidebar-block ul li a {
  color: var(--ink-medium);
}

.sidebar .sidebar-block ul li a:hover {
  color: var(--red-primary);
}

/* --- Tags --- */
.tag {
  display: inline-block;
  padding: 3px 10px;
  background: var(--paper-cream);
  border: 1px solid var(--border-light);
  border-radius: 3px;
  font-size: 0.8rem;
  color: var(--ink-light);
  margin: 2px 4px 2px 0;
  transition: var(--transition-smooth);
}

.tag:hover {
  background: var(--red-primary);
  color: var(--paper-white);
  border-color: var(--red-primary);
}

/* --- Pagination --- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border-light);
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border: 1px solid var(--border-light);
  border-radius: 4px;
  font-size: 0.9rem;
  color: var(--ink-medium);
  transition: var(--transition-smooth);
}

.pagination a:hover {
  border-color: var(--red-primary);
  color: var(--red-primary);
}

.pagination .current {
  background: var(--red-primary);
  border-color: var(--red-primary);
  color: var(--paper-white);
}

/* --- Footer --- */
.site-footer {
  background: var(--ink-black);
  color: var(--paper-cream);
  padding: 2rem 2rem 1.25rem;
  position: relative;
}

.site-footer::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--red-deep), var(--red-primary), var(--gold-primary), var(--red-primary), var(--red-deep));
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 1.5rem;
}

.footer-brand .logo-text {
  color: var(--paper-white);
  font-size: 1.3rem;
  margin-bottom: 0.5rem;
}

.footer-brand p {
  color: rgba(253, 249, 243, 0.6);
  font-size: 0.9rem;
  line-height: 1.5;
}

.footer-nav h4 {
  color: var(--gold-primary);
  font-family: var(--font-body);
  font-size: 1rem;
  margin-bottom: 0.75rem;
  letter-spacing: 1px;
}

.footer-nav a {
  display: block;
  color: rgba(253, 249, 243, 0.7);
  font-size: 0.9rem;
  padding: 2px 0;
  transition: var(--transition-smooth);
}

.footer-nav a:hover {
  color: var(--paper-white);
  padding-left: 6px;
}

.footer-bottom {
  max-width: var(--max-width);
  margin: 1rem auto 0;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(253, 249, 243, 0.1);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  color: rgba(253, 249, 243, 0.5);
}

.footer-bottom .slogan {
  font-style: italic;
  color: var(--gold-primary);
  opacity: 0.8;
}

.footer-legal {
  max-width: var(--max-width);
  margin: 1rem auto 0;
  padding: 1rem 0 0.25rem;
  border-top: 1px solid rgba(253, 249, 243, 0.08);
  font-size: 0.75rem;
  color: rgba(253, 249, 243, 0.4);
  line-height: 1.6;
}

.footer-legal p {
  margin: 0.2rem 0;
}

.footer-legal strong {
  color: rgba(253, 249, 243, 0.6);
}

.footer-legal a {
  color: var(--gold-primary);
  text-decoration: none;
}

.footer-legal a:hover {
  text-decoration: underline;
}

.footer-legal .legal-note {
  font-style: italic;
  margin-top: 0.5rem;
}

.footer-legal .legal-links {
  margin-top: 0.5rem;
}

.footer-links {
  max-width: var(--max-width);
  margin: 1rem auto 0;
  padding-top: 1rem;
  border-top: 1px solid rgba(253, 249, 243, 0.08);
}

.footer-links h4 {
  color: var(--gold-primary);
  font-family: var(--font-body);
  font-size: 0.9rem;
  margin-bottom: 0.5rem;
  letter-spacing: 1px;
}

.footer-links a {
  color: rgba(253, 249, 243, 0.6);
  font-size: 0.8rem;
  text-decoration: none;
  margin-right: 1.2rem;
  line-height: 2;
  transition: var(--transition-smooth);
}

.footer-links a:hover {
  color: var(--paper-white);
}

/* --- Article Detail Page --- */
.article-header {
  max-width: 800px;
  margin: 0 auto;
  padding: 8rem 2rem 2rem;
  text-align: center;
}

.article-header .card-category {
  display: inline-block;
  background: var(--red-primary);
  color: var(--paper-white);
  font-size: 0.8rem;
  padding: 4px 14px;
  border-radius: 2px;
  margin-bottom: 1.25rem;
}

.article-header h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  margin-bottom: 1rem;
}

.article-header .article-meta {
  font-size: 0.9rem;
  color: var(--ink-light);
}

.article-cover {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 0 2rem;
}

.article-cover img {
  width: 100%;
  border-radius: 6px;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.article-content {
  max-width: 760px;
  margin: 0 auto;
  padding: 2rem 2rem 4rem;
}

.article-content p {
  font-size: 1.15rem;
  line-height: 2;
  margin-bottom: 1.5em;
}

.article-content h2 {
  margin: 2.5rem 0 1rem;
  font-size: 1.6rem;
}

.article-content h3 {
  margin: 2rem 0 0.75rem;
  font-size: 1.3rem;
}

.article-content img {
  border-radius: 6px;
  margin: 2rem 0;
}

.article-content blockquote {
  border-left: 4px solid var(--red-primary);
  padding: 1rem 1.5rem;
  margin: 2rem 0;
  background: var(--paper-cream);
  border-radius: 0 6px 6px 0;
  font-style: italic;
}

/* --- Ornament Frame --- */
.ornament-frame {
  position: relative;
  padding: 2.5rem;
}

.ornament-frame::before,
.ornament-frame::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 24px;
  border-color: var(--gold-primary);
  border-style: solid;
}

.ornament-frame::before {
  top: 0;
  left: 0;
  border-width: 2px 0 0 2px;
}

.ornament-frame::after {
  bottom: 0;
  right: 0;
  border-width: 0 2px 2px 0;
}

/* --- Content Placeholder --- */
.content-placeholder {
  padding: 2.5rem;
  border: 2px dashed var(--border-light);
  border-radius: 6px;
  text-align: center;
  color: var(--ink-light);
  font-style: italic;
  margin: 2rem 0;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .article-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .category-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .content-with-sidebar {
    grid-template-columns: 1fr;
  }

  .article-featured {
    grid-template-columns: 1fr;
  }

  .article-featured .featured-thumb {
    min-height: 260px;
  }
}

@media (max-width: 768px) {
  .main-nav {
    position: fixed;
    top: 0;
    right: -100%;
    width: 280px;
    height: 100vh;
    background: var(--paper-white);
    flex-direction: column;
    padding: 5rem 2rem 2rem;
    gap: 1.5rem;
    box-shadow: var(--shadow-medium);
    transition: right 0.3s ease;
    z-index: 999;
  }

  .main-nav.open {
    right: 0;
  }

  .nav-toggle {
    display: flex;
    z-index: 1001;
  }

  .article-grid {
    grid-template-columns: 1fr;
  }

  .category-grid {
    grid-template-columns: 1fr;
  }

  .article-list-item {
    grid-template-columns: 1fr;
  }

  .article-list-item .list-thumb {
    aspect-ratio: 16/9;
  }

  .footer-inner {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .footer-bottom {
    flex-direction: column;
    gap: 1rem;
    text-align: center;
  }

  .hero-content h1 {
    font-size: 2.2rem;
  }

  .container {
    padding: 3rem 1.5rem;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
  }
}

/* --- Utilities --- */
.text-center { text-align: center; }
.text-red { color: var(--red-primary); }
.text-gold { color: var(--gold-primary); }
.mt-1 { margin-top: 1rem; }
.mt-2 { margin-top: 2rem; }
.mt-3 { margin-top: 3rem; }
.mb-1 { margin-bottom: 1rem; }
.mb-2 { margin-bottom: 2rem; }
.mb-3 { margin-bottom: 3rem; }

/* --- Animations --- */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroFadeIn {
  from { opacity: 0; transform: translateY(32px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes heroBgZoom {
  from { transform: scale(1.08); }
  to { transform: scale(1); }
}

@keyframes floatSoft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px); }
}

.fade-in {
  animation: fadeInUp 0.8s ease forwards;
}

/* Hero entrance — staggered */
.hero-bg {
  animation: heroBgZoom 12s ease-out forwards;
}

.hero-content h1 {
  opacity: 0;
  animation: heroFadeIn 1s ease forwards 0.3s;
}

.hero-tagline {
  opacity: 0;
  animation: heroFadeIn 1s ease forwards 0.6s;
}

.hero-cta {
  opacity: 0;
  animation: heroFadeIn 1s ease forwards 0.9s;
}

/* Scroll-reveal utility */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* Staggered children inside a grid */
.reveal-stagger .article-card,
.reveal-stagger .category-card {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.reveal-stagger.visible .article-card,
.reveal-stagger.visible .category-card {
  opacity: 1;
  transform: translateY(0);
}

.reveal-stagger.visible .article-card:nth-child(1),
.reveal-stagger.visible .category-card:nth-child(1) { transition-delay: 0s; }
.reveal-stagger.visible .article-card:nth-child(2),
.reveal-stagger.visible .category-card:nth-child(2) { transition-delay: 0.1s; }
.reveal-stagger.visible .article-card:nth-child(3),
.reveal-stagger.visible .category-card:nth-child(3) { transition-delay: 0.2s; }
.reveal-stagger.visible .article-card:nth-child(4),
.reveal-stagger.visible .category-card:nth-child(4) { transition-delay: 0.3s; }
.reveal-stagger.visible .article-card:nth-child(5),
.reveal-stagger.visible .category-card:nth-child(5) { transition-delay: 0.4s; }
.reveal-stagger.visible .article-card:nth-child(6),
.reveal-stagger.visible .category-card:nth-child(6) { transition-delay: 0.5s; }

/* Proverb block gentle float */
.proverb-block {
  animation: floatSoft 6s ease-in-out infinite;
}

/* Category card hover lift */
.category-card {
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.category-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 12px 36px rgba(28, 28, 28, 0.12);
}

/* Respect reduced motion preference */
@media (prefers-reduced-motion: reduce) {
  .hero-bg,
  .hero-content h1,
  .hero-tagline,
  .hero-cta,
  .proverb-block {
    animation: none;
    opacity: 1;
  }
  .reveal,
  .reveal-stagger .article-card,
  .reveal-stagger .category-card {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* ============================================
   HISTORY SECTION — Dynasty Cards & Timeline
   ============================================ */

/* Dynasty card grid */
.dynasty-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
}
.dynasty-card {
  background: var(--paper-white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  overflow: hidden;
  transition: var(--transition-smooth);
  display: flex;
  flex-direction: column;
  text-decoration: none;
}
.dynasty-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-medium);
  border-color: transparent;
}
.dynasty-card .dynasty-thumb {
  position: relative;
  aspect-ratio: 16/10;
  overflow: hidden;
  background: var(--paper-cream);
}
.dynasty-card .dynasty-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.dynasty-card:hover .dynasty-thumb img { transform: scale(1.06); }
.dynasty-card .dynasty-era {
  position: absolute;
  top: 12px;
  left: 12px;
  background: var(--red-primary);
  color: var(--paper-white);
  font-size: 0.72rem;
  padding: 3px 10px;
  border-radius: 2px;
  letter-spacing: 0.5px;
  font-family: var(--font-body);
}
.dynasty-card .dynasty-body {
  padding: 1.25rem 1.4rem 1.4rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.dynasty-card .dynasty-name {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.15rem;
}
.dynasty-card .dynasty-name .hanzi {
  font-family: var(--font-accent);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--red-primary);
  line-height: 1;
}
.dynasty-card .dynasty-name .en {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--ink-black);
}
.dynasty-card .dynasty-dates {
  font-size: 0.9rem;
  color: var(--gold-dark);
  letter-spacing: 0.5px;
  margin-bottom: 0.7rem;
  font-family: var(--font-body);
}
.dynasty-card .dynasty-desc {
  font-size: 0.95rem;
  color: var(--ink-light);
  line-height: 1.65;
  flex: 1;
}

/* Timeline */
.dynasty-timeline {
  position: relative;
  margin: 1rem 0 0;
  padding-left: 2.2rem;
}
.dynasty-timeline::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: linear-gradient(to bottom, var(--gold-light), var(--red-primary), var(--gold-light));
  opacity: 0.5;
}
.timeline-era {
  position: relative;
  margin: 2.2rem 0 1rem;
}
.timeline-era:first-child { margin-top: 0; }
.timeline-era h3 {
  font-family: var(--font-display);
  font-size: 1.35rem;
  color: var(--red-deep);
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
}
.timeline-era h3 .era-hanzi {
  font-family: var(--font-accent);
  font-size: 1.05rem;
  color: var(--gold-dark);
}
.timeline-era::before {
  content: "";
  position: absolute;
  left: -2.2rem;
  top: 8px;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--red-primary);
  border: 3px solid var(--paper-white);
  box-shadow: 0 0 0 2px var(--gold-primary);
  margin-left: -0.5px;
}
.timeline-entry {
  position: relative;
  padding: 0.9rem 0 0.9rem 0;
  border-bottom: 1px dashed var(--border-light);
}
.timeline-entry:last-child { border-bottom: none; }
.timeline-entry::before {
  content: "";
  position: absolute;
  left: -2.2rem;
  top: 1.35rem;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--gold-primary);
  margin-left: 3.5px;
}
.timeline-entry .tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.7rem;
  margin-bottom: 0.25rem;
}
.timeline-entry .tl-hanzi {
  font-family: var(--font-accent);
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--ink-black);
}
.timeline-entry .tl-en {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--red-primary);
}
.timeline-entry .tl-dates {
  font-size: 0.88rem;
  color: var(--gold-dark);
  letter-spacing: 0.5px;
}
.timeline-entry .tl-facts {
  font-size: 0.92rem;
  color: var(--ink-medium);
  margin: 0.15rem 0 0.4rem;
}
.timeline-entry .tl-facts strong { color: var(--red-deep); font-weight: 600; }
.timeline-entry .tl-desc {
  font-size: 0.98rem;
  color: var(--ink-light);
  line-height: 1.7;
}

@media (max-width: 900px) {
  .dynasty-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
  .dynasty-grid { grid-template-columns: 1fr; }
}

/* --- Article Prev/Next Navigation (History dynasty articles) --- */
.article-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  max-width: 760px;
  margin: 0 auto 3rem;
  padding: 0 2rem;
}
.article-nav a {
  display: block;
  background: var(--paper-white);
  border: 1px solid var(--border-light);
  border-radius: 6px;
  padding: 1.1rem 1.4rem;
  transition: var(--transition-smooth);
  text-decoration: none;
}
.article-nav a:hover {
  border-color: var(--red-primary);
  box-shadow: var(--shadow-soft);
  transform: translateY(-2px);
}
.article-nav .nav-label {
  display: block;
  font-size: 0.78rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--gold-dark);
  margin-bottom: 0.35rem;
}
.article-nav .nav-title {
  display: block;
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink-black);
  line-height: 1.4;
}
.article-nav a:hover .nav-title { color: var(--red-primary); }
.article-nav .nav-next { text-align: right; }
@media (max-width: 600px) {
  .article-nav { grid-template-columns: 1fr; }
  .article-nav .nav-next { text-align: left; }
}

/* Timeline "read the full article" link */
.timeline-entry .tl-read {
  display: inline-block;
  margin-top: 0.4rem;
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--red-primary);
  white-space: nowrap;
}
.timeline-entry .tl-read:hover { color: var(--red-bright); }
