/* ===========================================================
   BLOG / BAI VIET - Standalone Stylesheet
   Dark theme matching main app — For article & listing pages
   =========================================================== */

/* ========================
   CSS VARIABLES (duplicated from style.css for standalone use)
   ======================== */
:root {
  --bg-body: #080c14;
  --bg-card: #111827;
  --bg-card-hover: #1a2332;
  --bg-card-alt: #0f1520;
  --bg-input: #0c1220;
  --bg-overlay: rgba(0, 0, 0, 0.75);
  --text-primary: #e8ecf1;
  --text-secondary: #94a3b8;
  --text-muted: #7a8ba3;
  --accent-gold: #f0b429;
  --accent-gold-light: #fcd34d;
  --accent-gold-dim: rgba(240, 180, 41, 0.12);
  --accent-gold-glow: rgba(240, 180, 41, 0.25);
  --accent-red: #f87171;
  --accent-green: #4ade80;
  --accent-blue: #60a5fa;
  --accent-purple: #a78bfa;
  --accent-teal: #2dd4bf;
  --accent-orange: #fb923c;
  --border-color: rgba(240, 180, 41, 0.10);
  --border-subtle: rgba(255, 255, 255, 0.06);
  --border-medium: rgba(255, 255, 255, 0.10);
  --glass-bg: rgba(17, 24, 39, 0.80);
  --glass-border: rgba(255, 255, 255, 0.08);
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.45);
  --shadow-glow: 0 0 24px rgba(240, 180, 41, 0.2);
  --shadow-glow-lg: 0 4px 40px rgba(240, 180, 41, 0.15);
  --radius-xs: 6px;
  --radius-sm: 10px;
  --radius-md: 14px;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --transition-fast: 0.15s ease;
  --transition: 0.25s ease;
  --transition-slow: 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  /* Category colors */
  --cat-love: #e87fa0;
  --cat-finance: #f0b429;
  --cat-philosophy: #a78bfa;
  --cat-knowledge: #60a5fa;
}

/* ========================
   RESET & BASE
   ======================== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background: var(--bg-body);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--accent-gold); text-decoration: none; }
a:hover { color: var(--accent-gold-light); }

img { max-width: 100%; height: auto; display: block; }

/* ========================
   BLOG NAV (sticky, glassmorphism)
   ======================== */
.blog-nav {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.75rem 1rem;
  background: rgba(8, 12, 20, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--glass-border);
}

.blog-nav-logo {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  text-decoration: none;
  color: var(--text-primary);
  font-weight: 700;
  font-size: 1rem;
}

.blog-nav-logo img {
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.blog-nav-links {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.blog-nav-link {
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 500;
  transition: color var(--transition-fast);
}

.blog-nav-link:hover { color: var(--text-primary); }
.blog-nav-link.active { color: var(--accent-gold); }

.blog-nav-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  background: linear-gradient(135deg, var(--accent-gold), #e6a817);
  color: #0a0e17;
  font-size: 0.8rem;
  font-weight: 700;
  border-radius: var(--radius-xs);
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.blog-nav-cta:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-glow);
  color: #0a0e17;
}

/* ========================
   BREADCRUMB
   ======================== */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.75rem 1rem;
  font-size: 0.78rem;
  color: var(--text-muted);
  max-width: 800px;
  margin: 0 auto;
}

.breadcrumb a { color: var(--text-secondary); }
.breadcrumb a:hover { color: var(--accent-gold); }
.breadcrumb-sep { opacity: 0.4; }
.breadcrumb-current { color: var(--text-primary); }

/* ========================
   ARTICLE HERO
   ======================== */
.article-hero {
  position: relative;
  max-height: 500px;
  overflow: hidden;
}

.article-hero img {
  width: 100%;
  height: 400px;
  object-fit: cover;
}

.article-hero-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 1.5rem;
  background: linear-gradient(to top, rgba(8, 12, 20, 0.95) 0%, rgba(8, 12, 20, 0.6) 50%, transparent 100%);
}

.article-category-badge {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 20px;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  width: fit-content;
  margin-bottom: 0.5rem;
}

.cat-love { background: rgba(232, 127, 160, 0.2); color: var(--cat-love); }
.cat-finance { background: rgba(240, 180, 41, 0.2); color: var(--cat-finance); }
.cat-philosophy { background: rgba(167, 139, 250, 0.2); color: var(--cat-philosophy); }
.cat-knowledge { background: rgba(96, 165, 250, 0.2); color: var(--cat-knowledge); }

.article-hero-title {
  font-size: 1.5rem;
  font-weight: 800;
  line-height: 1.3;
  color: #fff;
  margin-bottom: 0.4rem;
}

.article-hero-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* ========================
   ARTICLE BODY
   ======================== */
.article-body {
  max-width: 800px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2rem;
}

/* Section styling */
.article-section {
  margin-bottom: 2rem;
}

.section-header {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-bottom: 1rem;
}

.section-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 1rem;
  flex-shrink: 0;
}

.section-icon-story { background: rgba(96, 165, 250, 0.15); color: var(--accent-blue); }
.section-icon-tuvi { background: var(--accent-gold-dim); color: var(--accent-gold); }
.section-icon-conclusion { background: rgba(167, 139, 250, 0.15); color: var(--accent-purple); }

.section-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
}

.article-section p {
  margin-bottom: 1rem;
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.8;
}

/* Tu Vi Deep Dive highlight */
.section-tuvi {
  background: rgba(240, 180, 41, 0.04);
  border-left: 3px solid var(--accent-gold);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.25rem 1rem;
  margin-left: -1rem;
  margin-right: -1rem;
}

.section-tuvi .section-header { margin-bottom: 0.75rem; }

/* Star name highlighting */
.star-name {
  display: inline-block;
  padding: 0.1rem 0.45rem;
  background: var(--accent-gold-dim);
  color: var(--accent-gold);
  border-radius: 4px;
  font-size: 0.85em;
  font-weight: 600;
  white-space: nowrap;
}

/* ========================
   IMAGE PAIRS (2-col grid)
   ======================== */
.article-images {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
  margin: 1.25rem 0;
}

.article-images picture,
.article-images img {
  border-radius: var(--radius-sm);
  overflow: hidden;
}

.article-images img {
  width: 100%;
  height: 200px;
  object-fit: cover;
  transition: transform var(--transition);
}

.article-images img:hover {
  transform: scale(1.02);
}

.article-image-single {
  margin: 1.25rem 0;
}

.article-image-single img {
  width: 100%;
  border-radius: var(--radius-sm);
  max-height: 350px;
  object-fit: cover;
}

/* ========================
   CTA SECTION
   ======================== */
.article-cta {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin: 2rem -1rem;
  min-height: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.article-cta-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.3) blur(2px);
}

.article-cta-content {
  position: relative;
  z-index: 1;
  text-align: center;
  padding: 2rem 1.5rem;
}

.article-cta-title {
  font-size: 1.2rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 0.5rem;
}

.article-cta-text {
  font-size: 0.85rem;
  color: var(--text-secondary);
  margin-bottom: 1rem;
}

.article-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.7rem 1.5rem;
  background: linear-gradient(135deg, var(--accent-gold), #e6a817);
  color: #0a0e17;
  font-size: 0.9rem;
  font-weight: 700;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: transform var(--transition-fast), box-shadow var(--transition-fast);
}

.article-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-glow);
  color: #0a0e17;
}

/* ========================
   RELATED ARTICLES
   ======================== */
.related-section {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.related-title {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 1rem;
  color: var(--text-primary);
}

.related-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.related-card {
  display: flex;
  gap: 0.75rem;
  padding: 0.75rem;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  border: 1px solid var(--border-subtle);
  transition: border-color var(--transition-fast), background var(--transition-fast);
  text-decoration: none;
}

.related-card:hover {
  border-color: var(--border-color);
  background: var(--bg-card-hover);
}

.related-card-thumb {
  width: 80px;
  height: 80px;
  border-radius: var(--radius-xs);
  object-fit: cover;
  flex-shrink: 0;
}

.related-card-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.25rem;
  min-width: 0;
}

.related-card-cat {
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.related-card-title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================
   BLOG LISTING PAGE
   ======================== */
.blog-hero-header {
  text-align: center;
  padding: 2.5rem 1rem 1.5rem;
  background: linear-gradient(180deg, rgba(240, 180, 41, 0.06) 0%, transparent 100%);
}

.blog-hero-title {
  font-size: 1.6rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-gold-light), var(--accent-gold));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  margin-bottom: 0.4rem;
}

.blog-hero-subtitle {
  font-size: 0.9rem;
  color: var(--text-secondary);
}

/* Category filter tabs */
.blog-filters {
  display: flex;
  gap: 0.5rem;
  padding: 0.75rem 1rem;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  max-width: 900px;
  margin: 0 auto;
}

.blog-filters::-webkit-scrollbar { display: none; }

.blog-filter-tab {
  display: inline-flex;
  align-items: center;
  white-space: nowrap;
  padding: 0.4rem 0.85rem;
  border-radius: 20px;
  font-size: 0.78rem;
  font-weight: 500;
  border: 1px solid var(--border-medium);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all var(--transition-fast);
  -webkit-tap-highlight-color: transparent;
}

.blog-filter-tab:hover { border-color: var(--text-muted); color: var(--text-primary); }

.blog-filter-tab.active {
  background: var(--accent-gold);
  color: #0a0e17;
  border-color: var(--accent-gold);
  font-weight: 600;
}

/* Article card grid */
.blog-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  padding: 1rem;
  max-width: 900px;
  margin: 0 auto;
}

.blog-card {
  display: flex;
  gap: 0.85rem;
  background: var(--bg-card);
  border-radius: var(--radius-md);
  border: 1px solid var(--border-subtle);
  overflow: hidden;
  transition: border-color var(--transition-fast), transform var(--transition-fast);
  text-decoration: none;
}

.blog-card:hover {
  border-color: var(--border-color);
  transform: translateY(-2px);
}

.blog-card-thumb {
  width: 120px;
  min-height: 120px;
  object-fit: cover;
  flex-shrink: 0;
}

.blog-card-body {
  padding: 0.75rem 0.75rem 0.75rem 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 0.3rem;
  min-width: 0;
}

.blog-card-cat {
  display: inline-block;
  font-size: 0.65rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  width: fit-content;
}

.blog-card-title {
  font-size: 0.92rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.blog-card-excerpt {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========================
   FOOTER
   ======================== */
.blog-footer {
  text-align: center;
  padding: 2rem 1rem;
  color: var(--text-muted);
  font-size: 0.75rem;
  border-top: 1px solid var(--border-subtle);
  margin-top: 2rem;
}

.blog-footer a { color: var(--accent-gold); }

.blog-footer p {
  line-height: 1.6;
  opacity: 0.6;
  margin-top: 0.25rem;
}

/* ========================
   RESPONSIVE
   ======================== */

/* Tablet (≥600px) */
@media (min-width: 600px) {
  .blog-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .blog-card {
    flex-direction: column;
  }

  .blog-card-thumb {
    width: 100%;
    height: 160px;
    min-height: auto;
  }

  .blog-card-body {
    padding: 0.75rem;
  }

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

  .related-card { flex-direction: column; }
  .related-card-thumb { width: 100%; height: 120px; }

  .article-hero img { height: 450px; }
  .article-hero-title { font-size: 1.8rem; }
}

/* Desktop (≥900px) */
@media (min-width: 900px) {
  .blog-nav {
    padding: 0.75rem 2rem;
    max-width: 1200px;
    margin: 0 auto;
  }

  .blog-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .blog-hero-title { font-size: 2rem; }

  .related-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  /* Contain hero to match article width */
  .article-hero {
    max-width: 900px;
    margin: 0 auto;
    border-radius: var(--radius-lg);
    overflow: hidden;
  }

  .article-body {
    max-width: 900px;
    padding: 2rem 2rem 3rem;
  }

  .article-hero img { height: 500px; }
  .article-hero-title { font-size: 2rem; }
  .article-hero-overlay { padding: 2rem; }

  .section-tuvi {
    margin-left: -2rem;
    margin-right: -2rem;
    padding: 1.5rem 2rem;
  }

  .article-images img { height: 280px; }

  /* Breadcrumb align with container */
  .breadcrumb {
    max-width: 900px;
    padding: 0.75rem 2rem;
  }
}

/* ========================
   UTILITY
   ======================== */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
