/* =====================================================
   CarticleFinance — Professional Editorial Stylesheet
   ===================================================== */

/* ─── Design Tokens ──────────────────────────────────── */
:root {
  /* Colors */
  --white:        #ffffff;
  --off-white:    #f8f7f4;
  --gray-50:      #f9fafb;
  --gray-100:     #f3f4f6;
  --gray-200:     #e5e7eb;
  --gray-300:     #d1d5db;
  --gray-400:     #9ca3af;
  --gray-500:     #6b7280;
  --gray-600:     #4b5563;
  --gray-700:     #374151;
  --gray-800:     #1f2937;
  --gray-900:     #111827;
  --black:        #0d0d0d;

  /* Brand */
  --navy:         #0f2044;
  --navy-mid:     #1a3560;
  --navy-light:   #2d4f8a;
  --gold:         #b8860b;
  --gold-light:   #d4a017;
  --gold-muted:   #f0e0a0;

  /* Text */
  --text-primary:   var(--gray-900);
  --text-secondary: var(--gray-600);
  --text-muted:     var(--gray-400);
  --text-inverse:   var(--white);

  /* Borders & Backgrounds */
  --bg:           var(--off-white);
  --bg-white:     var(--white);
  --border:       var(--gray-200);
  --border-dark:  var(--gray-300);

  /* Typography */
  --font-serif:   'Playfair Display', Georgia, serif;
  --font-sans:    'Inter', -apple-system, sans-serif;

  /* Spacing */
  --radius-sm:    4px;
  --radius-md:    8px;
  --radius-lg:    12px;

  /* Transitions */
  --ease:         0.2s ease;
}

/* ─── Reset ──────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

html, body {
  max-width: 100%;
  overflow-x: hidden;
}

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

a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font-family: var(--font-sans); }
img { max-width: 100%; display: block; }

/* ─── Scrollbar ──────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; }
::-webkit-scrollbar-track { background: var(--gray-100); }
::-webkit-scrollbar-thumb { background: var(--gray-300); border-radius: 99px; }
::-webkit-scrollbar-thumb:hover { background: var(--navy-light); }

/* ─── Container ──────────────────────────────────────── */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}

/* ─── Topbar ─────────────────────────────────────────── */
.topbar {
  background: var(--navy);
  color: rgba(255,255,255,0.7);
  font-size: 0.72rem;
  font-family: var(--font-sans);
  letter-spacing: 0.3px;
  border-bottom: 1px solid var(--navy-mid);
}
.topbar-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.topbar-date { color: rgba(255,255,255,0.5); }
.topbar-tagline {
  flex: 1;
  text-align: center;
  font-weight: 500;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  font-size: 0.65rem;
  color: rgba(255,255,255,0.5);
}
.topbar-admin {
  color: var(--gold-light);
  font-weight: 600;
  font-size: 0.72rem;
  transition: var(--ease);
}
.topbar-admin:hover { color: var(--white); }

/* ─── Header ─────────────────────────────────────────── */
.header {
  background: var(--white);
  position: sticky;
  top: 0;
  z-index: 100;
}
.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

/* Brand */
.brand { display: flex; align-items: center; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.55rem;
  font-weight: 700;
  color: var(--navy);
  letter-spacing: -0.5px;
  line-height: 1;
}
.brand-name em {
  font-style: normal;
  color: var(--gold);
}

/* Nav */
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.nav-link {
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  transition: var(--ease);
}
.nav-link:hover, .nav-link.active {
  color: var(--navy);
}
.nav-search-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--gray-500);
  transition: var(--ease);
}
.nav-search-btn:hover {
  background: var(--gray-100);
  color: var(--navy);
}

/* Search bar */
.search-bar {
  background: var(--white);
  border-top: 1px solid var(--border);
  padding: 12px 32px;
}
.search-inner {
  max-width: 1200px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 12px;
}
.search-field {
  flex: 1;
  border: none;
  outline: none;
  font-size: 1rem;
  color: var(--text-primary);
  font-family: var(--font-sans);
  background: transparent;
  padding: 4px 0;
}
.search-field::placeholder { color: var(--text-muted); }
.search-close {
  font-size: 0.85rem;
  color: var(--gray-400);
  padding: 4px 8px;
  transition: var(--ease);
}
.search-close:hover { color: var(--gray-700); }

/* Header Rule */
.header-rule {
  height: 3px;
  background: linear-gradient(90deg, var(--navy) 0%, var(--gold) 50%, var(--navy) 100%);
}

/* ─── Buttons ────────────────────────────────────────── */
.btn-primary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: var(--navy);
  color: var(--white);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 600;
  transition: var(--ease);
}
.btn-primary:hover {
  background: var(--navy-mid);
}
.btn-secondary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 22px;
  background: var(--white);
  color: var(--text-secondary);
  border: 1px solid var(--border-dark);
  border-radius: var(--radius-md);
  font-size: 0.875rem;
  font-weight: 500;
  transition: var(--ease);
}
.btn-secondary:hover {
  background: var(--gray-50);
  color: var(--text-primary);
}

/* ─── Section Eyebrow ────────────────────────────────── */
.section-eyebrow {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 10px;
}
.section-eyebrow::before {
  content: '';
  display: block;
  width: 28px;
  height: 2px;
  background: var(--gold);
}
.section-divider {
  height: 1px;
  background: var(--border);
  margin: 48px 0 0;
}

/* ─── Featured Article ───────────────────────────────── */
.featured-section {
  padding: 52px 0 0;
  background: var(--white);
}
.featured-section .container { padding-bottom: 0; }
.featured-card {
  display: grid;
  grid-template-columns: 1fr 400px;
  gap: 0;
  cursor: pointer;
}
.featured-card:hover .featured-title { color: var(--navy-mid); }
.featured-image-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-md) 0 0 var(--radius-md);
  background: var(--gray-100);
  min-height: 320px;
}
.featured-image-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}
.featured-card:hover .featured-image-wrap img { transform: scale(1.03); }
.featured-no-image {
  width: 100%;
  height: 100%;
  min-height: 320px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 4rem;
  color: var(--gray-300);
  background: linear-gradient(135deg, var(--navy) 0%, var(--navy-light) 100%);
}
.has-video-badge {
  position: absolute;
  bottom: 16px; left: 16px;
  background: rgba(0,0,0,0.7);
  color: var(--white);
  font-size: 0.7rem;
  font-weight: 700;
  padding: 5px 12px;
  border-radius: 99px;
  letter-spacing: 0.5px;
  backdrop-filter: blur(4px);
}
.featured-content {
  padding: 40px 36px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  border: 1px solid var(--border);
  border-left: none;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  background: var(--white);
}
.featured-cat {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: var(--gold);
}
.featured-title {
  font-family: var(--font-serif);
  font-size: 1.75rem;
  font-weight: 700;
  line-height: 1.25;
  color: var(--navy);
  transition: var(--ease);
}
.featured-excerpt {
  font-size: 0.9rem;
  color: var(--text-secondary);
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-byline {
  font-size: 0.78rem;
  color: var(--text-muted);
}
.featured-byline strong { color: var(--text-secondary); }
.featured-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.82rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.8px;
  margin-top: 4px;
  transition: var(--ease);
}
.featured-read-btn:hover { color: var(--gold); }
.featured-read-btn svg { transition: transform var(--ease); }
.featured-read-btn:hover svg { transform: translateX(4px); }

/* ─── Latest Section ─────────────────────────────────── */
.latest-section {
  padding: 52px 0 80px;
}
.latest-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 36px;
}
.section-heading {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--navy);
}

/* Category tabs */
.category-tabs {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.cat-tab {
  padding: 5px 16px;
  border: 1px solid var(--border-dark);
  border-radius: 99px;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-secondary);
  background: var(--white);
  transition: var(--ease);
}
.cat-tab:hover {
  border-color: var(--navy);
  color: var(--navy);
}
.cat-tab.active {
  background: var(--navy);
  border-color: var(--navy);
  color: var(--white);
}

/* ─── Articles Grid ──────────────────────────────────── */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}

/* ─── Article Card ───────────────────────────────────── */
.article-card {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--ease), transform var(--ease);
  animation: fadeIn 0.3s ease both;
}
.article-card:hover {
  box-shadow: 0 6px 24px rgba(15,32,68,0.1);
  transform: translateY(-3px);
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}
.card-image {
  position: relative;
  height: 188px;
  overflow: hidden;
  background: var(--gray-100);
}
.card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}
.article-card:hover .card-image img { transform: scale(1.04); }
.card-no-image {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  font-size: 2.5rem;
  color: var(--gray-300);
  background: linear-gradient(135deg, var(--gray-100) 0%, var(--gray-200) 100%);
}
.card-video-tag {
  position: absolute;
  bottom: 8px; left: 8px;
  background: rgba(15,32,68,0.85);
  color: var(--white);
  font-size: 0.62rem;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 3px;
  letter-spacing: 0.5px;
  text-transform: uppercase;
}
.card-body {
  padding: 20px 22px 22px;
}
.card-category {
  font-size: 0.68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.2px;
  color: var(--gold);
  margin-bottom: 8px;
}
.card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.35;
  margin-bottom: 10px;
  transition: var(--ease);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-card:hover .card-title { color: var(--navy-mid); }
.card-excerpt {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 14px;
}
.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 0.72rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  padding-top: 12px;
  margin-top: 4px;
}
.card-author { font-weight: 500; color: var(--text-secondary); }
.card-read-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--navy);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: var(--ease);
}
.card-read-link:hover { color: var(--gold); }

/* ─── Empty State ────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.empty-icon { font-size: 3rem; margin-bottom: 16px; }
.empty-state h3 {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  color: var(--navy);
  margin-bottom: 8px;
}
.empty-state p {
  color: var(--text-secondary);
  margin-bottom: 24px;
  font-size: 0.9rem;
}

/* ─── ARTICLE PAGE ───────────────────────────────────── */
.article-page { background: var(--bg); padding: 0 0 80px; }
.article-container {
  max-width: 780px;
  margin: 0 auto;
  padding: 40px 32px 0;
}

/* Breadcrumb */
.breadcrumb {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--text-muted);
  margin-bottom: 32px;
}
.breadcrumb a {
  color: var(--navy-light);
  transition: var(--ease);
}
.breadcrumb a:hover { color: var(--navy); }
.bc-sep { color: var(--gray-300); }

/* Article Header */
.article-header { margin-bottom: 32px; }
.article-category-label {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.article-category-label::before {
  content: '';
  display: block;
  width: 20px; height: 2px;
  background: var(--gold);
}
.article-title {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 4vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--navy);
  margin-bottom: 20px;
  letter-spacing: -0.3px;
}
.article-meta {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-muted);
}
.meta-author {
  font-weight: 600;
  color: var(--text-secondary);
}
.meta-dot {
  width: 3px; height: 3px;
  border-radius: 50%;
  background: var(--gray-300);
}

/* Video Embed */
.video-embed-block {
  margin: 32px 0;
}
.video-wrapper {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: var(--black);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0,0,0,0.2);
}
.video-wrapper iframe,
.video-wrapper video {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  border: none;
}
.video-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--gray-900);
}
.spinner {
  width: 36px; height: 36px;
  border: 3px solid rgba(255,255,255,0.1);
  border-top-color: var(--gold-light);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }
.video-caption {
  font-size: 0.78rem;
  color: var(--text-muted);
  text-align: center;
  margin-top: 10px;
  font-style: italic;
}

/* Article Body */
.article-body {
  margin: 36px 0;
  font-size: 1.05rem;
  line-height: 1.9;
  color: var(--gray-700);
}
.article-body p {
  margin-bottom: 1.5em;
}
.article-body p:last-child { margin-bottom: 0; }

/* Tags */
.article-tags {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin: 28px 0;
}
.tag-pill {
  padding: 4px 14px;
  background: var(--gray-100);
  border: 1px solid var(--border);
  border-radius: 99px;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-secondary);
}
.article-rule {
  border: none;
  border-top: 1px solid var(--border);
  margin: 40px 0;
}

/* Related */
.related-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 32px;
}
.related-heading {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--navy);
  margin-bottom: 28px;
}

/* ─── Footer ─────────────────────────────────────────── */
.footer {
  background: var(--navy);
  color: rgba(255,255,255,0.6);
  padding: 52px 0 0;
  margin-top: 60px;
}
.footer-top {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}
.footer-brand-name {
  color: var(--white);
  font-size: 1.3rem;
  display: block;
  margin-bottom: 12px;
}
.footer-brand-name em { color: var(--gold-light); font-style: normal; }
.footer-desc {
  font-size: 0.85rem;
  line-height: 1.7;
  max-width: 380px;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.footer-links h4 {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1.5px;
  color: rgba(255,255,255,0.4);
  margin-bottom: 4px;
}
.footer-links a {
  font-size: 0.85rem;
  color: rgba(255,255,255,0.6);
  transition: var(--ease);
}
.footer-links a:hover { color: var(--white); }
.footer-bottom {
  padding: 20px 0;
  text-align: center;
  font-size: 0.78rem;
  color: rgba(255,255,255,0.3);
}

/* ─── Responsive ─────────────────────────────────────── */
@media (max-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); gap: 20px; }
  .featured-card { grid-template-columns: 1fr; }
  .featured-image-wrap { border-radius: var(--radius-md) var(--radius-md) 0 0; min-height: 220px; }
  .featured-content { border: 1px solid var(--border); border-top: none; border-radius: 0 0 var(--radius-md) var(--radius-md); }
}

@media (max-width: 768px) {
  .container { padding: 0 20px; }
  .topbar-inner { padding: 0 20px; }
  .topbar-tagline { display: none; }
  .header-inner { padding: 0 20px; }
  .articles-grid { grid-template-columns: 1fr; gap: 20px; }
  .article-container { padding: 28px 20px 0; }
  .related-section { padding: 0 20px; }
  .footer-top { grid-template-columns: 1fr; gap: 32px; }
  .search-bar { padding: 12px 20px; }

  /* Horizontal scroll for category tabs on mobile/tablet */
  .category-tabs {
    display: flex;
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 8px;
    margin-bottom: 4px;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    max-width: 100%;
  }
  .category-tabs::-webkit-scrollbar {
    display: none;
  }
  .cat-tab {
    flex-shrink: 0;
  }
}

@media (max-width: 600px) {
  .topbar-inner {
    padding: 0 16px;
    font-size: 0.68rem;
    height: 32px;
  }
  .header-inner {
    padding: 0 16px;
    height: 56px;
    gap: 8px;
  }
  .brand-name {
    font-size: 1.25rem;
  }
  .main-nav {
    gap: 2px;
  }
  .nav-link {
    padding: 4px 8px;
    font-size: 0.8rem;
  }
  .nav-search-btn {
    width: 32px;
    height: 32px;
  }
  .search-bar {
    padding: 10px 16px;
  }
  .container {
    padding: 0 16px;
  }
  .featured-section {
    padding: 24px 0 0;
  }
  .featured-content {
    padding: 20px 16px;
    gap: 10px;
  }
  .featured-title {
    font-size: 1.3rem;
  }
  .featured-excerpt {
    font-size: 0.85rem;
    line-height: 1.6;
    -webkit-line-clamp: 3;
  }
  .latest-section {
    padding: 28px 0 50px;
  }
  .latest-header {
    margin-bottom: 20px;
    gap: 12px;
  }
  .section-heading {
    font-size: 1.25rem;
  }
  .article-card {
    border-radius: var(--radius-md);
  }
  .card-body {
    padding: 16px;
  }
  .card-title {
    font-size: 1.02rem;
  }
  .card-excerpt {
    font-size: 0.8rem;
  }
  .article-container {
    padding: 20px 16px 0;
  }
  .breadcrumb {
    margin-bottom: 20px;
  }
  .article-header {
    margin-bottom: 20px;
  }
  .article-title {
    font-size: 1.45rem;
    line-height: 1.28;
    margin-bottom: 12px;
  }
  .article-meta {
    gap: 10px;
    font-size: 0.75rem;
    padding-bottom: 14px;
  }
  .article-body {
    font-size: 0.96rem;
    line-height: 1.8;
    margin: 20px 0;
  }
  .related-section {
    padding: 0 16px;
  }
  .related-heading {
    font-size: 1.15rem;
    margin-bottom: 20px;
  }
  .footer {
    padding: 36px 0 0;
    margin-top: 40px;
  }
  .footer-top {
    padding-bottom: 24px;
    gap: 20px;
  }
}
