/* =========================================
   BNB Dev Hub — Binance Blog Style
   ========================================= */

:root {
  --bg:           #12141C;
  --surface:      #1A1B24;
  --surface-2:    #22232E;
  --border:       #2E303D;
  --text:         #F0F0F5;
  --text-sec:     #888FA8;
  --text-dim:     #5A6078;
  --accent:       #F0B90B;
  --accent-hover: #FFD03A;
  --accent-dim:   rgba(240,185,11,0.12);
  --code-bg:      #0D0E14;
  --radius:       8px;
  --radius-lg:    12px;
  --shadow:       0 4px 24px rgba(0,0,0,0.5);
  --shadow-sm:    0 2px 8px rgba(0,0,0,0.3);
  --transition:   0.2s ease;
  --max-w:        1160px;
  --page-max:     1160px;
  --page-px:      40px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-hover); }
img { max-width: 100%; display: block; }
h1,h2,h3,h4 { line-height: 1.25; color: var(--text); }

/* =========================================
   HEADER
   ========================================= */
.site-header {
  position: sticky; top: 0; z-index: 500;
  background: rgba(18,20,28,0.99);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w);
  margin: 0 auto; padding: 0 24px;
  height: 64px;
  display: flex; align-items: center; gap: 28px;
}
.logo {
  display: flex; align-items: center; gap: 9px;
  color: var(--text) !important; text-decoration: none; flex-shrink: 0;
}
.logo-hex { font-size: 20px; color: var(--accent); }
.logo-img { width: 28px; height: 28px; object-fit: contain; display: block; flex-shrink: 0; }
.logo-text { font-size: 16px; font-weight: 800; letter-spacing: -0.4px; }

.main-nav {
  display: flex; align-items: center; gap: 2px; flex: 1;
}
.nav-link {
  padding: 6px 11px; border-radius: 6px;
  font-size: 13px; font-weight: 500;
  color: var(--text-sec) !important;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover { color: var(--text) !important; background: var(--surface-2); }
.nav-link.active { color: var(--accent) !important; background: var(--accent-dim); }

.header-right {
  display: flex; align-items: center; gap: 10px; margin-left: auto;
}

/* Search */
.search-wrap { position: relative; }
.search-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  color: var(--text);
  padding: 7px 34px 7px 14px;
  font-size: 13px; width: 190px; outline: none;
  transition: border-color var(--transition), width var(--transition);
}
.search-input:focus { border-color: var(--accent); width: 250px; }
.search-input::placeholder { color: var(--text-dim); }
.search-icon {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%); font-size: 13px; pointer-events: none;
}
.search-results {
  display: none;
  position: absolute; top: calc(100% + 8px); right: 0; width: 360px;
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); box-shadow: var(--shadow);
  max-height: 400px; overflow-y: auto; z-index: 2000;
}
.search-results.open { display: block; }
.search-result-item {
  padding: 12px 16px; border-bottom: 1px solid var(--border);
  cursor: pointer; transition: background var(--transition);
}
.search-result-item:last-child { border-bottom: none; }
.search-result-item:hover { background: var(--surface-2); }
.search-result-title { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.search-result-meta { font-size: 11px; color: var(--text-sec); display: flex; align-items: center; gap: 6px; }
.search-no-results { padding: 20px 16px; text-align: center; color: var(--text-sec); font-size: 13px; }

/* Hamburger */
.hamburger {
  display: none; flex-direction: column; gap: 5px;
  background: none; border: none; cursor: pointer; padding: 4px; flex-shrink: 0;
}
.hamburger span { display: block; width: 22px; height: 2px; background: var(--text); border-radius: 2px; transition: transform var(--transition), opacity var(--transition); }
.hamburger.open span:nth-child(1) { transform: rotate(45deg) translate(5px, 5px); }
.hamburger.open span:nth-child(2) { opacity: 0; }
.hamburger.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* =========================================
   PAGE WRAPPER
   ========================================= */
#app { min-height: calc(100vh - 64px - 260px); }
@media (max-width: 768px) { #app { min-height: calc(100vh - 56px - 200px); } }

.inner {
  max-width: var(--max-w);
  margin: 0 auto; padding: 0 24px;
}

/* =========================================
   HOME — FEATURED ARTICLE
   ========================================= */
.featured-wrap {
  max-width: var(--max-w); margin: 0 auto;
  padding: 40px 24px 0;
}

.featured-card {
  display: grid;
  grid-template-columns: 440px 1fr;
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: box-shadow var(--transition);
  min-height: 310px;
}
.featured-card:hover { box-shadow: var(--shadow); }

.featured-thumb {
  position: relative;
  overflow: hidden;
  min-height: 310px;
  background-size: cover;
  background-position: center;
  background-color: var(--surface-2);
}
.featured-thumb-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.2) 0%, rgba(0,0,0,0.75) 100%);
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 24px;
}
.featured-brand {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 11px; font-weight: 800; letter-spacing: 1.2px;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  padding: 5px 12px;
  border-radius: 20px;
  width: fit-content;
}
.featured-thumb-title {
  font-size: 22px; font-weight: 900;
  color: #fff; line-height: 1.25;
  text-transform: uppercase;
  text-shadow: 0 2px 10px rgba(0,0,0,0.7);
}

.featured-content {
  padding: 36px 40px;
  display: flex; flex-direction: column; justify-content: center;
}
.featured-title {
  font-size: 28px; font-weight: 800; line-height: 1.22;
  color: var(--text); margin: 10px 0 14px;
}
.featured-excerpt {
  font-size: 14px; color: var(--text-sec); line-height: 1.7;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.featured-footer {
  margin-top: 24px;
  display: flex; align-items: center; gap: 8px;
  font-size: 13px; color: var(--text-dim);
}
.featured-footer-sep { color: var(--border); }

/* =========================================
   CATEGORY FILTER TABS
   ========================================= */
.cat-filter-wrap {
  max-width: var(--max-w); margin: 0 auto;
  padding: 0 24px;
}
.cat-filter {
  display: flex; gap: 8px;
  padding: 28px 0 24px;
  overflow-x: auto; scrollbar-width: none;
  border-bottom: 1px solid var(--border);
}
.cat-filter::-webkit-scrollbar { display: none; }

.cat-filter-btn {
  padding: 7px 18px;
  border-radius: 6px;
  border: 1px solid var(--border);
  background: transparent;
  color: var(--text-sec);
  font-size: 13px; font-weight: 600;
  cursor: pointer; white-space: nowrap;
  transition: background var(--transition), color var(--transition), border-color var(--transition);
  font-family: inherit;
}
.cat-filter-btn:hover { border-color: var(--text-sec); color: var(--text); }
.cat-filter-btn.active { background: var(--text); color: #000; border-color: var(--text); }

/* =========================================
   ARTICLE GRID
   ========================================= */
.articles-wrap {
  max-width: var(--max-w); margin: 0 auto;
  padding: 32px 24px 60px;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}

.article-card {
  background: var(--surface);
  border-radius: var(--radius-lg);
  overflow: hidden;
  cursor: pointer;
  transition: transform var(--transition), box-shadow var(--transition);
  display: flex; flex-direction: column;
}
.article-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

/* Photo thumbnail */
.card-thumb {
  position: relative; height: 200px; overflow: hidden; flex-shrink: 0;
  background-size: cover; background-position: center;
  background-color: var(--surface-2);
}
.card-thumb-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.15) 0%, rgba(0,0,0,0.72) 100%);
}
.card-thumb-inner {
  position: absolute; inset: 0; z-index: 1;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 14px 16px;
}
.card-thumb-brand {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 10px; font-weight: 800; letter-spacing: 1px;
  color: var(--accent);
  background: rgba(0, 0, 0, 0.55);
  backdrop-filter: blur(6px);
  padding: 4px 10px;
  border-radius: 20px;
  width: fit-content;
}
.card-thumb-label {
  font-size: 15px; font-weight: 900;
  color: #fff; line-height: 1.3;
  text-transform: uppercase;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,0.8);
}

.card-body {
  padding: 16px 18px 18px;
  flex: 1; display: flex; flex-direction: column;
}
.card-title {
  font-size: 14px; font-weight: 700; line-height: 1.45;
  color: var(--text); margin: 8px 0 10px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.card-footer {
  margin-top: auto; padding-top: 12px;
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; color: var(--text-dim);
}
.card-author { font-weight: 600; }
.card-sep { color: var(--border); }

/* =========================================
   BADGE
   ========================================= */
.badge {
  display: inline-block; font-size: 10px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  padding: 3px 8px; border-radius: 4px; white-space: nowrap;
}
.badge-tutorials  { background: rgba(29,66,95,0.8);  color: #5DADE2; }
.badge-news       { background: rgba(26,62,80,0.8);  color: #F0B90B; }
.badge-deep-dives { background: rgba(62,34,74,0.8);  color: #C39BD3; }
.badge-tools      { background: rgba(17,74,45,0.8);  color: #58D68D; }
.badge-security   { background: rgba(82,24,18,0.8);  color: #EC7063; }

/* Thumbnail category fallback colors (shown while image loads) */
.thumb-tutorials  { background-color: #0A1929; }
.thumb-news       { background-color: #0A1206; }
.thumb-deep-dives { background-color: #160D28; }
.thumb-tools      { background-color: #0A1A10; }
.thumb-security   { background-color: #1A0A08; }

/* =========================================
   ARTICLE PAGE
   ========================================= */
.article-layout {
  max-width: var(--max-w); margin: 0 auto;
  padding: 40px 24px 60px;
  display: grid;
  grid-template-columns: 1fr 260px;
  gap: 56px;
  align-items: start;
}

.article-main { min-width: 0; }

/* Breadcrumb */
.breadcrumb {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-sec); margin-bottom: 28px;
}
.breadcrumb a { color: var(--text-sec); transition: color var(--transition); }
.breadcrumb a:hover { color: var(--accent); }
.breadcrumb-sep { color: var(--border); }
.breadcrumb-current { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 260px; }

/* Article title & meta */
.article-title {
  font-size: 34px; font-weight: 800; line-height: 1.18;
  color: var(--text); margin-bottom: 14px;
}
.article-meta {
  font-size: 13px; color: var(--text-sec);
  display: flex; align-items: center; gap: 8px;
  padding-bottom: 28px; margin-bottom: 32px;
  border-bottom: 1px solid var(--border);
}
.article-meta-sep { color: var(--border); }
.article-meta-author { font-weight: 600; color: var(--text-sec); }
.article-meta-author a { color: var(--text-sec); }
.article-meta-author a:hover { color: var(--accent); }

/* Article body */
.article-body {
  font-size: 16px; line-height: 1.82; color: rgba(240,240,245,0.88);
}
.article-body h2 {
  font-size: 22px; font-weight: 800;
  color: var(--text); margin: 40px 0 16px;
  padding-top: 8px;
}
.article-body h3 {
  font-size: 18px; font-weight: 700;
  color: var(--text); margin: 28px 0 12px;
}
.article-body p { margin-bottom: 20px; }
.article-body ul, .article-body ol { margin: 0 0 20px 24px; }
.article-body li { margin-bottom: 7px; }
.article-body strong { color: var(--accent); font-weight: 700; }
.article-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }

/* Code */
.article-body pre {
  background: var(--code-bg);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius) var(--radius) 0;
  padding: 20px 24px; margin: 24px 0;
  overflow-x: auto;
  font-family: 'Fira Code','Cascadia Code','JetBrains Mono','Consolas',monospace;
  font-size: 13px; line-height: 1.7; color: #cdd6f4;
}
.article-body code {
  font-family: 'Fira Code','Cascadia Code','Consolas',monospace;
  font-size: 13px; background: rgba(240,185,11,0.1);
  color: var(--accent); padding: 2px 6px; border-radius: 4px;
}
.article-body pre code { background: none; padding: 0; color: inherit; }

/* Tags */
.article-tags {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-top: 36px; padding-top: 28px;
  border-top: 1px solid var(--border);
}
.tag {
  display: inline-block; background: var(--surface-2);
  color: var(--text-sec); font-size: 12px; font-weight: 500;
  padding: 5px 12px; border-radius: 4px;
  transition: background var(--transition), color var(--transition);
}
.tag:hover { background: var(--accent); color: #000; cursor: pointer; }

/* Related */
.related-section { margin-top: 52px; padding-top: 36px; border-top: 1px solid var(--border); }
.section-title {
  font-size: 17px; font-weight: 700;
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 24px;
}
.section-title::after { content: ''; flex: 1; height: 1px; background: var(--border); }

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

/* =========================================
   ARTICLE SIDEBAR
   ========================================= */
.article-sidebar {
  position: sticky; top: 84px;
  display: flex; flex-direction: column; gap: 16px;
}

/* Sidebar search */
.sidebar-search-wrap {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.sidebar-search-input {
  width: 100%; background: none; border: none;
  color: var(--text); font-size: 13px; outline: none;
  padding: 10px 36px 10px 14px;
  font-family: inherit;
}
.sidebar-search-input::placeholder { color: var(--text-dim); }
.sidebar-search-icon {
  position: absolute; right: 10px; top: 50%;
  transform: translateY(-50%); pointer-events: none; color: var(--text-sec);
}

/* Table of Contents */
.toc-widget {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.toc-header {
  padding: 12px 16px;
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.9px;
  color: var(--text-sec);
  border-bottom: 1px solid var(--border);
}
.toc-list { list-style: none; padding: 8px 0; }
.toc-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 7px 16px;
  cursor: pointer;
  transition: background var(--transition);
}
.toc-item:hover { background: var(--surface-2); }
.toc-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--border);
  flex-shrink: 0; margin-top: 5px;
  transition: background var(--transition), transform var(--transition);
}
.toc-item.active .toc-dot { background: var(--accent); transform: scale(1.3); }
.toc-link {
  font-size: 12px; color: var(--text-sec); line-height: 1.5;
  transition: color var(--transition);
}
.toc-item.active .toc-link { color: var(--accent); font-weight: 600; }
.toc-item:hover .toc-link { color: var(--text); }

/* =========================================
   CATEGORY / AUTHOR / SEARCH PAGES
   ========================================= */
.page-header {
  max-width: var(--max-w); margin: 0 auto;
  padding: 40px 24px 4px;
}
.page-title { font-size: 28px; font-weight: 800; margin: 6px 0 6px; }
.page-subtitle { font-size: 14px; color: var(--text-sec); }

.page-content {
  max-width: var(--max-w); margin: 0 auto;
  padding: 8px 24px 60px;
}
.page-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  margin-top: 24px;
}

/* =========================================
   AVATAR
   ========================================= */
.avatar {
  border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  font-weight: 800; flex-shrink: 0;
}

/* =========================================
   EMPTY STATE
   ========================================= */
.empty-state { text-align: center; padding: 80px 20px; }
.empty-state-icon { font-size: 48px; margin-bottom: 16px; opacity: 0.3; }
.empty-state h2 { font-size: 20px; color: var(--text-sec); margin-bottom: 8px; }

/* =========================================
   FOOTER
   ========================================= */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 60px;
}
.footer-inner {
  max-width: var(--max-w); margin: 0 auto;
  padding: 48px 24px 32px;
  display: grid; grid-template-columns: 260px 1fr; gap: 48px;
}
.footer-tagline { color: var(--text-sec); font-size: 13px; line-height: 1.6; margin-top: 12px; }
.footer-socials { display: flex; gap: 8px; margin-top: 16px; }
.social-link {
  width: 36px; height: 36px; background: var(--surface-2);
  border-radius: 50%; display: flex; align-items: center; justify-content: center;
  font-size: 14px; color: var(--text-sec) !important;
  transition: background var(--transition), color var(--transition);
}
.social-link:hover { background: var(--accent); color: #000 !important; }
.footer-links { display: grid; grid-template-columns: repeat(3,1fr); gap: 32px; }
.footer-col h4 {
  font-size: 11px; font-weight: 700;
  text-transform: uppercase; letter-spacing: 0.8px;
  color: var(--text-sec); margin-bottom: 14px;
}
.footer-col a {
  display: block; color: var(--text-sec) !important; font-size: 13px;
  margin-bottom: 8px; transition: color var(--transition);
}
.footer-col a:hover { color: var(--text) !important; }
.footer-bottom { border-top: 1px solid var(--border); padding: 20px; text-align: center; }
.footer-bottom p { font-size: 12px; color: var(--text-sec); }

/* =========================================
   RESPONSIVE — 1024px
   ========================================= */
@media (max-width: 1024px) {
  .featured-card { grid-template-columns: 1fr; min-height: auto; }
  .featured-thumb { min-height: 240px; }
  .article-layout { grid-template-columns: 1fr; gap: 32px; }
  .article-sidebar { display: none; }
  .articles-grid, .page-grid { grid-template-columns: repeat(2,1fr); }
}

/* =========================================
   RESPONSIVE — 768px
   ========================================= */
@media (max-width: 768px) {
  /* Header */
  .header-inner { padding: 0 16px; gap: 12px; height: 56px; }
  .logo-text { font-size: 14px; }

  /* Mobile nav + hamburger handled by NAV block at end of file */

  /* Search — shrink on mobile */
  .search-input { width: 110px; font-size: 12px; padding: 6px 28px 6px 10px; }
  .search-input:focus { width: 150px; }
  .search-results { width: 260px; right: -10px; }

  /* Slideshow */
  .slideshow { height: 300px; }
  .slide-content { left: 0; right: 0; padding: 16px 56px 20px; /* 56px sides clears the arrows */ }
  .slide-title { font-size: 17px; -webkit-line-clamp: 2; }
  .slide-excerpt { display: none; }
  .slide-meta { font-size: 11px; }
  .slide-read-btn { padding: 8px 16px; font-size: 12px; }
  .slide-arrow { width: 36px; height: 36px; font-size: 14px; top: 40%; }
  .slide-prev { left: 8px; }
  .slide-next { right: 8px; }
  .slide-dots { bottom: 10px; }

  /* Cards */
  .articles-grid, .page-grid { grid-template-columns: repeat(2,1fr); gap: 12px; }
  .card-thumb { height: 150px; }
  .card-thumb-label { font-size: 12px; -webkit-line-clamp: 2; }
  .card-title { font-size: 13px; }
  .card-footer { font-size: 11px; }

  /* Featured */
  .featured-thumb { min-height: 180px; }
  .featured-content { padding: 20px; }
  .featured-title { font-size: 18px; }
  .featured-excerpt { display: none; }

  /* Section padding */
  .featured-wrap { padding: 12px 16px 0; }
  .cat-filter-wrap { padding: 0 16px; }
  .articles-wrap { padding: 0 16px; }
  .page-header { padding: 24px 16px 16px; }
  .page-content { padding: 0 16px 40px; }

  /* Category filter — scrollable row */
  .cat-filter { gap: 6px; overflow-x: auto; padding-bottom: 4px; flex-wrap: nowrap; }
  .cat-filter-btn { white-space: nowrap; padding: 6px 12px; font-size: 12px; flex-shrink: 0; }

  /* Article page */
  .article-layout { padding: 16px 16px 40px; }
  .article-title { font-size: 22px; }
  .article-hero img { height: 180px; }
  .article-meta { font-size: 12px; flex-wrap: wrap; gap: 6px; }
  .article-body { font-size: 14px; }
  .article-body h2 { font-size: 18px; }
  .article-body pre { overflow-x: auto; font-size: 12px; }
  .author-card { gap: 14px; }

  /* Footer — brand full width, links in 3 columns */
  .footer-inner { grid-template-columns: 1fr; gap: 24px; padding: 32px 16px; }
  .footer-links { grid-template-columns: repeat(3,1fr); gap: 16px; }
  .footer-col h4 { font-size: 10px; margin-bottom: 10px; }
  .footer-col a { font-size: 12px; margin-bottom: 6px; }

  /* Hide search on mobile */
  .search-wrap { display: none; }

  /* Author profile */
  --page-px: 16px;
}

/* =========================================
   RESPONSIVE — 480px
   ========================================= */
@media (max-width: 480px) {
  /* Single column cards */
  .articles-grid, .page-grid, .related-grid { grid-template-columns: 1fr; gap: 10px; }

  /* Header minimal */
  .search-input { width: 90px; }
  .search-results { width: 240px; right: -50px; }

  /* Slideshow */
  .slideshow { height: 260px; }
  .slide-title { font-size: 15px; }

  /* Featured full width */
  .featured-card { grid-template-columns: 1fr; }
  .featured-title { font-size: 17px; }

  /* Article */
  .article-title { font-size: 20px; }
  .breadcrumb { font-size: 11px; }
  .article-body table { font-size: 12px; }
  .article-body table thead th { padding: 8px 10px; font-size: 11px; }
  .article-body table tbody td { padding: 8px 10px; }
  .author-card { flex-direction: column; gap: 12px; }
  .author-card-avatar img { width: 52px; height: 52px; }

  /* Footer — keep 3 cols even on small phones, just tighter */
  .footer-links { grid-template-columns: repeat(3,1fr); gap: 10px; }
  .footer-col a { font-size: 11px; }
  .footer-inner { padding: 24px 16px; }

  /* Author profile */
  .author-cover { height: 120px; }
  .author-avatar-row { margin-top: -36px; }
  .author-profile-avatar { width: 72px; height: 72px; border-width: 3px; }
  .author-profile-name { font-size: 18px; }
  .author-stat { padding: 0 10px 0 0; }
  .author-stat:not(:first-child) { padding-left: 10px; }
  .author-stat-val { font-size: 18px; }

  /* Newsletter */
  .newsletter-fields { flex-direction: column; }
  .nl-submit { width: 100%; }

  /* Load more */
  .load-more-btn { width: 100%; justify-content: center; }

  /* Tags */
  .article-tags { flex-wrap: wrap; }
}

/* =========================================
   SCROLLBAR + ANIMATIONS
   ========================================= */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: var(--text-sec); }

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
#app > * { animation: fadeUp 0.3s ease forwards; }

/* =========================================
   ARTICLE HERO IMAGE
   ========================================= */
.article-hero {
  margin: 0 0 36px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--surface-2);
  line-height: 0;
}
.article-hero img {
  width: 100%;
  height: 380px;
  object-fit: cover;
  display: block;
  transition: opacity 0.3s;
}
@media (max-width: 768px) {
  .article-hero img { height: 220px; }
}

/* =========================================
   ARTICLE BODY — TABLES
   ========================================= */
.article-body table {
  width: 100%;
  border-collapse: collapse;
  margin: 28px 0;
  font-size: 14px;
  border-radius: var(--radius);
  overflow: hidden;
}
.article-body thead th {
  background: var(--surface-2);
  color: var(--accent);
  font-weight: 700;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  padding: 12px 16px;
  text-align: left;
  border-bottom: 2px solid var(--accent);
}
.article-body tbody td {
  padding: 11px 16px;
  border-bottom: 1px solid var(--border);
  color: var(--text-sec);
  vertical-align: top;
  line-height: 1.5;
}
.article-body tbody tr:last-child td { border-bottom: none; }
.article-body tbody tr:hover td { background: rgba(240,185,11,0.04); color: var(--text); }
.article-body td strong { color: var(--text); font-weight: 600; }
.article-body td code { font-size: 12px; }

/* =========================================
   ARTICLE BODY — INLINE LINKS
   ========================================= */
.article-body a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: rgba(240,185,11,0.45);
  text-underline-offset: 3px;
  transition: color var(--transition), text-decoration-color var(--transition);
}
.article-body a:hover {
  color: var(--accent-hover);
  text-decoration-color: var(--accent-hover);
}

/* =========================================
   LOAD MORE BUTTON
   ========================================= */
.load-more-wrap {
  text-align: center;
  padding: 12px 0 8px;
}
.load-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 32px;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  font-family: inherit;
  transition: border-color var(--transition), background var(--transition), color var(--transition);
}
.load-more-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-dim);
}
.lm-badge {
  font-size: 11px;
  font-weight: 700;
  background: var(--surface-2);
  color: var(--text-sec);
  padding: 2px 8px;
  border-radius: 10px;
}
.all-loaded {
  font-size: 13px;
  color: var(--text-dim);
  padding: 20px 0;
}

/* =========================================
   HERO SLIDESHOW
   ========================================= */
.slideshow {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  background: var(--surface-2);
}

.slides-track {
  width: 100%;
  height: 100%;
  position: relative;
}

.slide {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transition: opacity 0.7s ease;
  cursor: pointer;
}

.slide.active {
  opacity: 1;
  z-index: 1;
}

.slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(0,0,0,0.82) 0%,
    rgba(0,0,0,0.55) 50%,
    rgba(0,0,0,0.2) 100%
  );
}

.slide-content {
  position: absolute;
  bottom: 0;
  left: 76px;   /* clear the prev arrow (44px wide + 20px margin + buffer) */
  right: 40%;
  padding: 48px 32px 48px 24px;
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.slide-top {
  display: flex;
  align-items: center;
  gap: 12px;
}

.slide-title {
  font-size: 28px;
  font-weight: 800;
  color: #fff;
  line-height: 1.25;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 2px 8px rgba(0,0,0,0.5);
}

.slide-excerpt {
  font-size: 14px;
  color: rgba(255,255,255,0.78);
  line-height: 1.6;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.slide-meta {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  display: flex;
  align-items: center;
  gap: 8px;
}

.slide-meta-sep { opacity: 0.4; }

.slide-read-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 22px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  width: fit-content;
  transition: background var(--transition), transform 0.15s;
}

.slide-read-btn:hover {
  background: var(--accent-hover);
  transform: translateY(-1px);
}

/* Arrows */
.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(0,0,0,0.45);
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background var(--transition), border-color var(--transition);
  backdrop-filter: blur(4px);
}

.slide-arrow:hover {
  background: rgba(240,185,11,0.25);
  border-color: var(--accent);
  color: var(--accent);
}

.slide-prev { left: 16px; }
.slide-next { right: 16px; }

/* Dots */
.slide-dots {
  position: absolute;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 10;
  display: flex;
  gap: 8px;
}

.slide-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  border: none;
  background: rgba(255,255,255,0.35);
  cursor: pointer;
  padding: 0;
  transition: background var(--transition), width var(--transition);
}

.slide-dot.active {
  background: var(--accent);
  width: 24px;
  border-radius: 4px;
}

@media (max-width: 768px) {
  .slideshow { height: 380px; }
  .slide-content {
    right: 0;
    padding: 28px 24px;
  }
  .slide-title { font-size: 20px; }
  .slide-excerpt { display: none; }
  .slide-arrow { width: 36px; height: 36px; font-size: 14px; }
  .slide-prev { left: 10px; }
  .slide-next { right: 10px; }
}

/* =========================================
   AUTHOR META (article page)
   ========================================= */
.article-meta-author-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  color: inherit;
}
.article-meta-author-wrap:hover .article-meta-author {
  color: var(--accent);
}
.article-meta-author-wrap img {
  border: 2px solid var(--border);
}

/* Verified badge */
.verified-badge {
  display: inline-flex;
  align-items: center;
  margin-left: 3px;
  vertical-align: middle;
  flex-shrink: 0;
}
.verified-badge svg { display: block; }

/* =========================================
   AUTHOR BIO CARD (bottom of article)
   ========================================= */
.author-card {
  display: flex;
  align-items: flex-start;
  gap: 20px;
  margin: 48px 0 0;
  padding: 28px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
}
.author-card-avatar { flex-shrink: 0; }
.author-card-avatar img {
  border: 3px solid var(--border);
  transition: border-color var(--transition);
}
.author-card-avatar:hover img { border-color: var(--accent); }
.author-card-info { display: flex; flex-direction: column; gap: 8px; }
.author-card-name {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 700;
}
.author-card-name a {
  color: var(--text);
  text-decoration: none;
}
.author-card-name a:hover { color: var(--accent); }
.author-card-bio {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.65;
  margin: 0;
}
.author-card-link {
  font-size: 13px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.author-card-link:hover { color: var(--accent-hover); }

@media (max-width: 600px) {
  .author-card { flex-direction: column; gap: 14px; }
}

/* =========================================
   AUTHOR PROFILE PAGE
   ========================================= */
.author-profile { width: 100%; }

.author-cover {
  width: 100%;
  height: 200px;
  background-size: cover;
  background-position: center;
  position: relative;
  background-color: var(--surface-2);
}
.author-cover-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(0,0,0,0.1), rgba(11,14,17,0.7));
}

/* Body sits below the cover — no negative margin tricks */
.author-profile-body {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 0 var(--page-px) 40px;
  border-bottom: 1px solid var(--border);
}

/* Avatar row: avatar floats up over the cover via negative margin */
.author-avatar-row {
  display: flex;
  align-items: flex-end;
  margin-top: -52px;
  margin-bottom: 20px;
}
.author-profile-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}
.author-profile-avatar {
  width: 104px;
  height: 104px;
  border-radius: 50%;
  object-fit: cover;
  border: 4px solid var(--bg);
  display: block;
  background: var(--surface-2);
}
.author-profile-verified {
  position: absolute;
  bottom: 2px;
  right: 2px;
  background: var(--bg);
  border-radius: 50%;
  width: 24px;
  height: 24px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2px solid var(--bg);
}
.author-profile-verified .verified-badge svg {
  width: 16px; height: 16px;
}

/* Name + bio + stats: normal flow BELOW the avatar row */
.author-profile-details {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.author-profile-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
}
.author-profile-name {
  font-size: 26px;
  font-weight: 800;
  margin: 0;
  color: var(--text);
}
.author-verified-inline .verified-badge svg {
  width: 20px; height: 20px;
}
.author-profile-bio {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.7;
  margin: 0;
  max-width: 580px;
}
.author-profile-stats {
  display: flex;
  align-items: center;
}
.author-stat {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  padding: 0 24px 0 0;
  gap: 2px;
}
.author-stat:not(:first-child) {
  padding-left: 24px;
  border-left: 1px solid var(--border);
}
.author-stat-val {
  font-size: 22px;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.author-stat-label {
  font-size: 11px;
  color: var(--text-dim);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  white-space: nowrap;
}
.author-stat-divider { display: none; }
.author-profile-cats {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.author-articles-header {
  max-width: var(--page-max);
  margin: 0 auto;
  padding: 28px var(--page-px) 0;
}

@media (max-width: 640px) {
  .author-cover { height: 130px; }
  .author-avatar-row { margin-top: -40px; }
  .author-profile-avatar { width: 80px; height: 80px; }
  .author-profile-name { font-size: 20px; }
  .author-stat { padding: 0 14px 0 0; }
  .author-stat:not(:first-child) { padding-left: 14px; }
}

/* =========================================
   STATIC PAGES (About, Newsletter)
   ========================================= */
.static-page {
  max-width: 820px;
  margin: 0 auto;
  padding: 0 var(--page-px) 80px;
}
.static-hero {
  padding: 56px 0 40px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 40px;
}
.static-hero h1 {
  font-size: 36px;
  font-weight: 800;
  margin: 0 0 16px;
  color: var(--text);
}
.static-lead {
  font-size: 17px;
  color: var(--text-sec);
  line-height: 1.7;
  margin: 0;
  max-width: 680px;
}
.static-body h2 {
  font-size: 20px;
  font-weight: 700;
  color: var(--text);
  margin: 40px 0 14px;
}
.static-body p {
  font-size: 15px;
  color: var(--text-sec);
  line-height: 1.75;
  margin: 0 0 16px;
}
.static-body a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.static-body strong { color: var(--text); }

/* About authors grid */
.about-authors-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
  margin: 20px 0 0;
}
.about-author-card {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  text-decoration: none;
  transition: border-color var(--transition), background var(--transition);
}
.about-author-card:hover {
  border-color: var(--accent);
  background: var(--accent-dim);
}
.about-author-info { display: flex; flex-direction: column; gap: 3px; }
.about-author-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  display: flex;
  align-items: center;
  gap: 4px;
}
.about-author-count { font-size: 12px; color: var(--text-dim); }

/* Newsletter */
.newsletter-body { display: flex; flex-direction: column; gap: 0; }
.newsletter-form-wrap {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 36px;
  margin-bottom: 48px;
}
.newsletter-form-wrap h2 { margin-top: 0 !important; }
.newsletter-fields {
  display: flex;
  gap: 10px;
  margin: 20px 0 12px;
  flex-wrap: wrap;
}
.nl-input {
  flex: 1;
  min-width: 160px;
  padding: 11px 14px;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--text);
  font-size: 14px;
  font-family: inherit;
  outline: none;
  transition: border-color var(--transition);
}
.nl-input:focus { border-color: var(--accent); }
.nl-submit {
  padding: 11px 24px;
  background: var(--accent);
  color: #000;
  border: none;
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  font-family: inherit;
  cursor: pointer;
  white-space: nowrap;
  transition: background var(--transition);
}
.nl-submit:hover { background: var(--accent-hover); }
.nl-note { font-size: 12px; color: var(--text-dim); margin: 0; }
.nl-success {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 20px;
  background: rgba(88,214,141,0.1);
  border: 1px solid rgba(88,214,141,0.3);
  border-radius: var(--radius);
  color: #58D68D;
  font-size: 15px;
  font-weight: 500;
}
.nl-success-icon { font-size: 20px; font-weight: 700; }
.past-issues-list { display: flex; flex-direction: column; gap: 1px; }
.past-issue {
  display: flex;
  gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
  align-items: baseline;
}
.past-issue:last-child { border-bottom: none; }
.past-issue-date {
  font-size: 12px;
  color: var(--text-dim);
  white-space: nowrap;
  flex-shrink: 0;
  min-width: 100px;
}
.past-issue-title {
  font-size: 14px;
  color: var(--text-sec);
  line-height: 1.5;
}

/* =========================================
   MOBILE FIXES v2 (patch over previous rules)
   ========================================= */

/* ── Badge: never stretch full width ── */
.badge { display: inline-block !important; width: auto !important; }
.slide-top { display: block; }
.slide-top .badge { display: inline-block !important; }

/* ── Slideshow: arrows clear of text ── */
.slideshow { overflow: hidden; }
.slide-arrow {
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
}
/* Text content sits in the bottom half, arrows sit in the vertical centre */
.slide-content {
  left: 80px;    /* wider than 44px arrow + 16px gap */
  right: 36%;
  bottom: 0;
  padding: 40px 24px 48px 0;
}

/* ── Hamburger: force above nav drawer ── */
.hamburger {
  z-index: 600 !important;
  position: relative;
}

/* ── Cards: proper spacing ── */
.article-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.card-title { margin: 0; }
.card-footer { margin-top: auto; padding-top: 8px; }

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

@media (max-width: 1024px) {
  .articles-grid, .page-grid { grid-template-columns: repeat(2, 1fr); gap: 16px; }
}

@media (max-width: 768px) {
  /* Slideshow arrows: push to edge, text gets full width with side padding */
  .slide-content {
    left: 0 !important;
    right: 0 !important;
    padding: 16px 60px 24px !important; /* 60px matches arrow width + margin */
  }
  .slide-prev { left: 10px; }
  .slide-next { right: 10px; }
  .slide-arrow { width: 38px; height: 38px; font-size: 16px; }

  /* Mobile nav handled by NAV SINGLE CLEAN DEFINITION block below */

  /* Cards: single column on mobile, proper spacing */
  .articles-grid, .page-grid {
    grid-template-columns: 1fr !important;
    gap: 16px !important;
  }
  .article-card { border-radius: 10px; overflow: hidden; }
  .card-thumb { height: 180px; }
  .card-body { padding: 14px 16px 16px; gap: 8px; }
  .card-title { font-size: 15px; line-height: 1.4; }
  .card-footer { font-size: 12px; padding-top: 10px; }

  /* Section spacing */
  .featured-wrap { padding: 16px 16px 0; }
  .cat-filter-wrap { padding: 0 16px; margin-top: 4px; }
  .articles-wrap { padding: 0 16px; }
  .load-more-wrap { padding: 16px 0 8px; }
}

@media (max-width: 480px) {
  .card-thumb { height: 160px; }
}

/* ── Slideshow arrow final position fix ── */
@media (max-width: 768px) {
  .slide-arrow {
    top: 35% !important;   /* sits in the photo zone, well above the text */
    transform: translateY(-50%);
  }
}

/* =========================================
   FINAL FIXES
   ========================================= */

/* Nav drawer appended to body — always top layer */


/* Slideshow arrows — clean pill style */
.slide-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1.5px solid rgba(255,255,255,0.3);
  background: rgba(0,0,0,0.5);
  color: #fff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s, background 0.2s, color 0.2s;
  backdrop-filter: blur(4px);
  padding: 0;
}
.slide-arrow:hover {
  border-color: var(--accent);
  background: rgba(240,185,11,0.15);
  color: var(--accent);
}
.slide-prev { left: 16px; }
.slide-next { right: 16px; }

/* Slide content — push text below top third so arrows don't overlap */
.slide-content {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 28px 70px 36px; /* 70px sides clears 40px arrow + 16px gap */
  z-index: 2;
  display: flex;
  flex-direction: column;
  gap: 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.4) 70%, transparent 100%);
}
.slide-read-btn { margin-top: 4px; }

@media (max-width: 768px) {
  .slide-arrow { width: 36px; height: 36px; }
  .slide-arrow svg { width: 16px; height: 16px; }
  .slide-prev { left: 10px; }
  .slide-next { right: 10px; }
  .slide-content { padding: 20px 58px 28px; gap: 10px; }
  .slide-title { font-size: 18px; }
  .slide-excerpt { display: none; }
}

/* ── Nav drawer: below header, header always on top ── */
.site-header { z-index: 99999 !important; }




/* =========================================
   NAV — SINGLE CLEAN DEFINITION
   ========================================= */

/* Desktop: horizontal row inside header */
.main-nav {
  display: flex !important;
  align-items: center;
  gap: 2px;
  flex: 1;
  position: static;
  background: none;
  z-index: auto;
  padding: 0;
  flex-direction: row;
  overflow: visible;
}

/* Desktop: hamburger hidden */
.hamburger { display: none; }

/* Mobile overrides */
@media (max-width: 768px) {
  /* Hide desktop nav */
  .main-nav {
    display: none !important;
    position: fixed !important;
    top: 56px !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    background: #0D0F17 !important;
    flex-direction: column !important;
    align-items: stretch !important;
    gap: 4px !important;
    padding: 16px !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
  }
  /* Show when open */
  .main-nav.open {
    display: flex !important;
  }
  /* Nav links full width on mobile */
  .main-nav .nav-link {
    padding: 14px 18px !important;
    font-size: 16px !important;
    border-radius: 10px !important;
    width: 100%;
    box-sizing: border-box;
  }
  /* Show hamburger on mobile */
  .hamburger { display: flex !important; }
  /* Header always above nav drawer */
  .site-header { z-index: 10000 !important; background: #12141C !important; }
}

/* ── bcaipro image: show full without cropping ── */
.article-hero img[alt*="Meet Sunshine"],
.article-hero img[src*="bcaipro"] {
  object-fit: contain;
  background: #0A0A0F;
  height: auto;
  max-height: 480px;
}
