/* =============================================
   KRYNEX THEME — main.css
   ============================================= */

/* --- Variables --- */
:root {
  --bg-primary:    #0c1219;
  --bg-secondary:  #0f1923;
  --bg-card:       #111927;
  --bg-card-hover: #162032;
  --accent:        #2563eb;
  --accent-hover:  #1d4ed8;
  --accent-light:  rgba(37,99,235,.15);
  --text-primary:  #f1f5f9;
  --text-secondary:#94a3b8;
  --text-muted:    #64748b;
  --border:        rgba(255,255,255,.07);
  --border-strong: rgba(255,255,255,.14);
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;
  --ticker-bg:     #1a56db;
  --font-sans:     'Inter', system-ui, -apple-system, sans-serif;
  --max-width:     1280px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { font-size: 16px; scroll-behavior: smooth; }
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; height: auto; display: block; }
ul, ol { list-style: none; }

/* =============================================
   BREAKING NEWS TICKER
   ============================================= */
.ticker-bar {
  background: var(--ticker-bg);
  color: #fff;
  font-size: .8125rem;
  font-weight: 500;
  letter-spacing: .01em;
  padding: 0 1.25rem;
  height: 38px;
  display: flex;
  align-items: center;
  gap: 1rem;
  overflow: hidden;
  position: relative;
  z-index: 100;
}
.ticker-bar .ticker-label {
  background: rgba(255,255,255,.22);
  border-radius: 3px;
  padding: 2px 8px;
  font-size: .75rem;
  font-weight: 700;
  letter-spacing: .08em;
  white-space: nowrap;
  flex-shrink: 0;
}
.ticker-track-wrap {
  overflow: hidden;
  flex: 1;
  position: relative;
}
.ticker-track {
  display: flex;
  gap: 3rem;
  white-space: nowrap;
  animation: tickerScroll 30s linear infinite;
}
.ticker-track:hover { animation-play-state: paused; }
.ticker-track a { color: #fff; }
.ticker-track a:hover { text-decoration: underline; }
@keyframes tickerScroll {
  0%   { transform: translateX(0); }
  100% { transform: translateX(-50%); }
}

/* =============================================
   HEADER
   ============================================= */
.site-header {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  z-index: 99;
}
.header-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: .85rem 1.5rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}
/* Logo */
.site-branding { display: flex; align-items: center; gap: .75rem; text-decoration: none; }
.site-branding .logo-icon {
  width: 36px; height: 36px;
  background: var(--accent);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.site-branding .logo-icon svg { width: 20px; height: 20px; fill: #fff; }
.site-branding .logo-text { line-height: 1.15; }
.site-branding .logo-name {
  font-size: 1.125rem;
  font-weight: 800;
  letter-spacing: .06em;
  color: #fff;
  text-transform: uppercase;
}
.site-branding .logo-tagline {
  font-size: .65rem;
  font-weight: 500;
  letter-spacing: .12em;
  color: var(--accent);
  text-transform: uppercase;
}
/* Nav */
.main-nav { flex: 1; }
.main-nav .menu {
  display: flex;
  align-items: center;
  gap: .25rem;
}
.main-nav .menu li a {
  display: block;
  padding: .45rem .85rem;
  font-size: .875rem;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-sm);
  transition: color .15s, background .15s;
}
.main-nav .menu li a:hover,
.main-nav .menu li.current-menu-item a,
.main-nav .menu li.current-menu-ancestor a {
  color: #fff;
  background: rgba(255,255,255,.06);
}
.main-nav .menu li.current-menu-item > a {
  color: var(--accent);
  background: var(--accent-light);
}
/* Header actions */
.header-actions { display: flex; align-items: center; gap: .75rem; margin-left: auto; }
.header-search-btn {
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  padding: .4rem;
  border-radius: var(--radius-sm);
  transition: color .15s;
  display: flex; align-items: center;
}
.header-search-btn:hover { color: #fff; }
.btn-newsletter {
  background: var(--accent);
  color: #fff;
  font-size: .8125rem;
  font-weight: 600;
  padding: .45rem 1.1rem;
  border-radius: var(--radius-sm);
  border: none;
  cursor: pointer;
  transition: background .15s;
  white-space: nowrap;
}
.btn-newsletter:hover { background: var(--accent-hover); color: #fff; }

/* Mobile hamburger */
.menu-toggle {
  display: none;
  background: none; border: none; cursor: pointer;
  color: var(--text-secondary);
  padding: .4rem;
}

/* =============================================
   SEARCH BAR (collapsible)
   ============================================= */
.header-search-bar {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  display: none;
  padding: .75rem 1.5rem;
}
.header-search-bar.open { display: block; }
.header-search-bar form {
  max-width: var(--max-width);
  margin: 0 auto;
  display: flex;
  gap: .5rem;
}
.header-search-bar input[type="search"] {
  flex: 1;
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: .9rem;
  padding: .5rem .9rem;
  outline: none;
}
.header-search-bar input[type="search"]:focus { border-color: var(--accent); }
.header-search-bar button {
  background: var(--accent); color: #fff;
  border: none; border-radius: var(--radius-sm);
  padding: .5rem 1rem; cursor: pointer; font-weight: 600;
}

/* =============================================
   LAYOUT WRAPPER
   ============================================= */
.site-main { min-height: 70vh; }
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* =============================================
   HERO — SPLIT LAYOUT
   ============================================= */
.hero-section {
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 3rem 0;
}
.hero-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  align-items: center;
}
.hero-content {}
.hero-tags { display: flex; gap: .5rem; margin-bottom: 1.25rem; flex-wrap: wrap; }
.tag-pill {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .08em;
  text-transform: uppercase;
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid var(--accent);
  color: var(--accent);
  background: var(--accent-light);
}
.tag-pill.tag-news     { border-color: #10b981; color: #10b981; background: rgba(16,185,129,.12); }
.tag-pill.tag-guide    { border-color: #f59e0b; color: #f59e0b; background: rgba(245,158,11,.12); }
.tag-pill.tag-checklist{ border-color: #8b5cf6; color: #8b5cf6; background: rgba(139,92,246,.12); }
.tag-pill.tag-analysis { border-color: var(--accent); color: var(--accent); background: var(--accent-light); }
.tag-pill.tag-advisory { border-color: #ef4444; color: #ef4444; background: rgba(239,68,68,.12); }
.hero-title {
  font-size: clamp(1.75rem, 3vw, 2.5rem);
  font-weight: 800;
  line-height: 1.18;
  color: #fff;
  margin-bottom: 1rem;
  letter-spacing: -.02em;
}
.hero-title a { color: inherit; }
.hero-title a:hover { color: var(--accent); }
.hero-excerpt {
  color: var(--text-secondary);
  font-size: .9375rem;
  line-height: 1.7;
  margin-bottom: 1.75rem;
  max-width: 520px;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.btn-read {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  background: var(--accent);
  color: #fff;
  font-size: .875rem;
  font-weight: 600;
  padding: .6rem 1.3rem;
  border-radius: var(--radius-sm);
  transition: background .15s;
}
.btn-read:hover { background: var(--accent-hover); color: #fff; }
.post-meta-info {
  color: var(--text-muted);
  font-size: .8125rem;
}

/* Hero image */
.hero-image-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 16/10;
  background: var(--bg-card);
}
.hero-image-wrap img {
  width: 100%; height: 100%;
  object-fit: cover;
}
.hero-image-placeholder {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--bg-card) 0, var(--bg-card) 8px,
    var(--bg-secondary) 8px, var(--bg-secondary) 16px
  );
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: .75rem;
  letter-spacing: .06em;
  flex-direction: column; gap: .5rem;
}

/* =============================================
   LATEST INTELLIGENCE — GRID
   ============================================= */
.posts-section { padding: 2.5rem 0 3.5rem; }
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
}
.section-title {
  font-size: .75rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-secondary);
  display: flex;
  align-items: center;
  gap: .5rem;
}
.section-title::before {
  content: '';
  display: block;
  width: 3px; height: 14px;
  background: var(--accent);
  border-radius: 2px;
}
.view-all-link {
  font-size: .8125rem;
  font-weight: 600;
  color: var(--accent);
  display: flex; align-items: center; gap: .3rem;
}
.view-all-link:hover { color: #fff; }

/* Cards grid */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.25rem;
}

/* Post card */
.post-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: background .15s, border-color .15s, transform .15s;
  display: flex;
  flex-direction: column;
}
.post-card:hover {
  background: var(--bg-card-hover);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}
.post-card-image {
  aspect-ratio: 16/9;
  overflow: hidden;
  position: relative;
  background: var(--bg-secondary);
}
.post-card-image img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.post-card:hover .post-card-image img { transform: scale(1.04); }
.post-card-image-placeholder {
  width: 100%; height: 100%;
  background: repeating-linear-gradient(
    -45deg,
    var(--bg-secondary) 0, var(--bg-secondary) 8px,
    var(--bg-card) 8px, var(--bg-card) 16px
  );
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  font-size: .7rem;
  letter-spacing: .05em;
}
.post-card-image .card-type-tag {
  position: absolute;
  top: .75rem; left: .75rem;
}
.post-card-body { padding: 1rem 1.1rem 1.25rem; flex: 1; display: flex; flex-direction: column; }
.card-category {
  font-size: .6875rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .5rem;
}
.post-card-title {
  font-size: .9375rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  margin-bottom: .6rem;
  flex: 1;
}
.post-card-title a { color: inherit; }
.post-card-title a:hover { color: var(--accent); }
.post-card-excerpt {
  font-size: .8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: .8rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.post-card-meta {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: auto;
  padding-top: .75rem;
  border-top: 1px solid var(--border);
}

/* =============================================
   SIDEBAR + CONTENT LAYOUT (archives/single)
   ============================================= */
.content-sidebar-wrap {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 2rem;
  padding: 2.5rem 0 3.5rem;
}
.main-content-area {}

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 1.5rem; position: sticky; top: 1.5rem; align-self: start; max-height: calc(100vh - 3rem); overflow-y: auto; scrollbar-width: none; -ms-overflow-style: none; }
.widget {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.25rem;
}
.widget-title {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: 1rem;
  padding-bottom: .75rem;
  border-bottom: 1px solid var(--border);
}
.category-list li {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: .45rem 0;
  border-bottom: 1px solid var(--border);
  font-size: .875rem;
}
.category-list li:last-child { border-bottom: none; }
.category-list li a {
  color: var(--text-secondary);
  display: flex; align-items: center; gap: .5rem;
  transition: color .15s;
}
.category-list li a::before {
  content: '';
  display: block;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
}
.category-list li a:hover { color: #fff; }
.category-count {
  font-size: .75rem;
  font-weight: 600;
  color: var(--text-muted);
  background: var(--bg-secondary);
  padding: 1px 6px;
  border-radius: 3px;
}

/* =============================================
   SINGLE POST
   ============================================= */
.single-post-header { padding: 2.5rem 0 0; }
.single-post-header .hero-tags { margin-bottom: 1rem; }
.single-post-title {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -.02em;
  color: #fff;
  margin-bottom: 1rem;
}
.single-post-meta {
  display: flex; align-items: center; gap: 1rem;
  color: var(--text-muted); font-size: .8125rem;
  padding-bottom: 1.5rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}
.single-post-meta span { display: flex; align-items: center; gap: .3rem; }
.single-featured-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 2rem;
  aspect-ratio: 16/7;
}
.single-featured-image img {
  width: 100%; height: 100%;
  object-fit: cover;
}

/* Post content */
.post-content {
  color: var(--text-secondary);
  font-size: .9625rem;
  line-height: 1.8;
  max-width: 720px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.post-content h1, .post-content h2, .post-content h3,
.post-content h4, .post-content h5, .post-content h6 {
  color: var(--text-primary);
  font-weight: 700;
  line-height: 1.3;
  margin: 2rem 0 .75rem;
  letter-spacing: -.015em;
}
.post-content h2 { font-size: 1.35rem; }
.post-content h3 { font-size: 1.125rem; }
.post-content p { margin-bottom: 1.25rem; }
.post-content a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.post-content a:hover { color: #fff; }
.post-content ul, .post-content ol {
  padding-left: 1.5rem; margin-bottom: 1.25rem;
  list-style: initial;
}
.post-content ol { list-style: decimal; }
.post-content li { margin-bottom: .4rem; }
.post-content blockquote {
  border-left: 3px solid var(--accent);
  padding: .75rem 1.25rem;
  margin: 1.5rem 0;
  background: var(--bg-card);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--text-primary);
  font-style: italic;
}
.post-content pre, .post-content code {
  font-family: 'Fira Code', 'Cascadia Code', monospace;
  font-size: .875rem;
}
.post-content pre {
  background: #0a0f16;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: 1.1rem 1.25rem;
  overflow: hidden;
  margin-bottom: 1.25rem;
}
.post-content :not(pre) > code {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 2px 6px;
  color: #7dd3fc;
}
.post-content img {
  border-radius: var(--radius-md);
  margin: 1rem 0;
  max-width: 100%;
  height: auto;
}
.post-content table {
  width: 100%; border-collapse: collapse; margin-bottom: 1.25rem;
  display: block; overflow-x: auto;
}
.post-content th, .post-content td {
  border: 1px solid var(--border);
  padding: .6rem .9rem;
  font-size: .875rem;
  text-align: left;
}
.post-content th { background: var(--bg-card); font-weight: 700; color: var(--text-primary); }
.post-content hr {
  border: none;
  border-top: 1px solid var(--border);
  margin: 2rem 0;
}

/* =============================================
   PAGINATION
   ============================================= */
.pagination {
  display: flex; align-items: center;
  justify-content: center; gap: .5rem;
  padding: 2rem 0;
}
.pagination a, .pagination span {
  display: flex; align-items: center; justify-content: center;
  width: 36px; height: 36px;
  border-radius: var(--radius-sm);
  font-size: .875rem; font-weight: 500;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  transition: all .15s;
}
.pagination a:hover { background: var(--accent); color: #fff; border-color: var(--accent); }
.pagination .current { background: var(--accent); color: #fff; border-color: var(--accent); }

/* =============================================
   PAGE (static)
   ============================================= */
.page-content-wrap { padding: 2.5rem 0 3.5rem; max-width: 760px; }
.page-title {
  font-size: 2rem;
  font-weight: 800;
  color: #fff;
  margin-bottom: 1.5rem;
  letter-spacing: -.02em;
}

/* =============================================
   404 / NO RESULTS
   ============================================= */
.error-page {
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  min-height: 55vh;
  text-align: center; padding: 3rem 1.5rem;
}
.error-code {
  font-size: 7rem; font-weight: 900;
  color: var(--border-strong);
  line-height: 1;
  margin-bottom: .5rem;
}
.error-page h1 { font-size: 1.5rem; color: #fff; margin-bottom: .75rem; }
.error-page p { color: var(--text-secondary); margin-bottom: 1.5rem; max-width: 400px; }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  padding: 2rem 0;
  margin-top: auto;
}
.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}
.footer-copy { font-size: .8125rem; color: var(--text-muted); }
.footer-links { display: flex; gap: 1.25rem; }
.footer-links a { font-size: .8125rem; color: var(--text-muted); transition: color .15s; }
.footer-links a:hover { color: var(--text-primary); }

/* =============================================
   UTILITIES
   ============================================= */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }
.text-accent { color: var(--accent); }

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .cards-grid { grid-template-columns: repeat(2, 1fr); }
  .content-sidebar-wrap { grid-template-columns: 1fr; }
  .sidebar { display: none; }
}
@media (max-width: 768px) {
  .hero-inner { grid-template-columns: 1fr; }
  .hero-image-wrap { display: none; }
  .cards-grid { grid-template-columns: 1fr; }
  .main-nav { display: none; }
  .main-nav.open { display: block; position: absolute; top: 100%; left: 0; right: 0; background: var(--bg-secondary); border-bottom: 1px solid var(--border); padding: .75rem 1.5rem; }
  .main-nav.open .menu { flex-direction: column; align-items: flex-start; }
  .menu-toggle { display: flex; }
  .site-header { position: relative; }
  .header-inner { flex-wrap: wrap; }
  .footer-inner { flex-direction: column; text-align: center; }
}
@media (max-width: 480px) {
  .hero-title { font-size: 1.5rem; }
  .header-inner { padding: .75rem 1rem; }
  .container { padding: 0 1rem; }
}

/* ── Data Table (pipeline-generated articles) ─────────────────── */
.cved-table-wrap {
  overflow: hidden;
  margin: 2rem 0;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,.45);
  border: 1px solid var(--border-strong);
}
.cved-table-wrap table {
  width: 100%;
  display: table;
  border-collapse: collapse;
  overflow-x: visible;
  margin-bottom: 0;
  font-size: .9rem;
  background: var(--bg-card);
}
.cved-table-wrap th,
.cved-table-wrap td { border: none; }
.cved-table-wrap thead tr { background: var(--accent); }
.cved-table-wrap thead th {
  padding: 13px 18px;
  text-align: left;
  font-weight: 700;
  color: #fff;
  letter-spacing: .03em;
  white-space: nowrap;
}
.cved-table-wrap tbody tr {
  border-bottom: 1px solid var(--border);
  transition: background .15s ease;
}
.cved-table-wrap tbody tr:nth-child(odd)  { background: var(--bg-card); }
.cved-table-wrap tbody tr:nth-child(even) { background: var(--bg-secondary); }
.cved-table-wrap tbody tr:hover           { background: var(--accent-light); }
.cved-table-wrap tbody tr:last-child      { border-bottom: none; }
.cved-table-wrap tbody td {
  padding: 11px 18px;
  color: var(--text-secondary);
  vertical-align: middle;
}
.cved-table-wrap tbody td:first-child {
  color: var(--text-primary);
  font-weight: 600;
}
.cved-table-wrap a {
  color: var(--accent);
  text-decoration: none;
  border-bottom: 1px solid rgba(37,99,235,.35);
  transition: border-color .15s;
}
.cved-table-wrap a:hover { border-bottom-color: var(--accent); }

/* ── Table of Contents ────────────────────────── */
.toc-block {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-left: 3px solid var(--accent);
  border-radius: 8px;
  padding: 1.25rem 1.5rem;
  margin: 0 0 2rem;
  max-width: 720px;
}
.toc-title {
  font-size: .7rem;
  font-weight: 700;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: .75rem !important;
}
.toc-block ol {
  padding-left: 1.25rem;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  list-style: decimal;
}
.toc-block a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: .9rem;
  transition: color .15s;
  line-height: 1.4;
}
.toc-block a:hover { color: var(--text-primary); }

/* ── Sidebar TOC (sticky scroll-spy) ────────────── */
.sidebar-toc .toc-block {
  max-width: 100%;
  margin: 0;
  border-left: none;
  border-top: 3px solid var(--accent);
  padding: 1rem 1.25rem 1.25rem;
}
.sidebar-toc .toc-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  cursor: default;
}
.sidebar-toc .toc-block ol { gap: .25rem; }
.sidebar-toc .toc-block a {
  display: block;
  padding: .3rem .5rem .3rem .75rem;
  border-left: 2px solid transparent;
  border-radius: 0 4px 4px 0;
  font-size: .825rem;
  transition: color .15s, border-color .15s, background .15s;
}
.sidebar-toc .toc-block a:hover {
  color: var(--text-primary);
  background: rgba(255,255,255,.04);
}
.sidebar-toc .toc-block a.toc-active {
  color: var(--accent);
  border-left-color: var(--accent);
  background: var(--accent-light);
  font-weight: 600;
}
/* Mobile: mostrar TOC inline, ocultar sidebar TOC */
.toc-mobile-only { display: none; }
@media (max-width: 1024px) {
  .toc-mobile-only { display: block; }
  .sidebar-toc { display: none; }
}

/* ocultar scrollbar del sidebar (Chrome/Safari) */
.sidebar::-webkit-scrollbar { display: none; }

/* ── Inline article chart ─────────────────────── */
.article-chart-figure {
  margin: 1.5rem 0 0;
}
.article-chart-figure img {
  width: 100%;
  border-radius: 8px;
  display: block;
}
.article-chart-figure figcaption {
  text-align: center;
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: .5rem;
  letter-spacing: .02em;
}

.article-advisory-screenshot {
  margin: 1.5rem 0 2rem;
  border: 1px solid rgba(37,99,235,0.3);
  border-radius: 10px;
  overflow: hidden;
}
.article-advisory-screenshot a {
  display: block;
}
.article-advisory-screenshot img {
  width: 100%;
  display: block;
  border-radius: 10px 10px 0 0;
}
.article-advisory-screenshot figcaption {
  background: rgba(37,99,235,0.08);
  text-align: center;
  font-size: .72rem;
  color: var(--text-muted);
  padding: .5rem 1rem;
  letter-spacing: .02em;
}

/* ── Breadcrumbs ─────────────────────────────── */
.krynex-breadcrumb {
  margin-bottom: 1rem;
}
.krynex-breadcrumb ol {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .25rem;
  list-style: none;
  padding: 0;
  margin: 0;
  font-size: .78rem;
  color: var(--text-muted);
}
.krynex-breadcrumb a {
  color: var(--accent);
  text-decoration: none;
}
.krynex-breadcrumb a:hover {
  text-decoration: underline;
}
.krynex-breadcrumb .sep {
  color: var(--text-muted);
  opacity: .5;
  font-size: .85rem;
}
.krynex-breadcrumb .current {
  color: var(--text-muted);
  opacity: .7;
}

/* ── Related Articles ────────────────────────── */
.related-posts {
  margin-top: 3rem;
  padding-top: 2rem;
  border-top: 1px solid var(--border);
}
.related-posts__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: .08em;
  margin-bottom: 1.25rem;
}
.related-posts__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
@media (max-width: 640px) {
  .related-posts__grid { grid-template-columns: 1fr; }
}
.related-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 10px;
  overflow: hidden;
  text-decoration: none;
  transition: border-color .2s, transform .2s;
}
.related-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
}
.related-card__img {
  width: 100%;
  aspect-ratio: 16/9;
  background-size: cover;
  background-position: center;
}
.related-card__body {
  padding: .9rem 1rem;
  display: flex;
  flex-direction: column;
  gap: .35rem;
  flex: 1;
}
.related-card__cat {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--accent);
}
.related-card__title {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text-primary);
  line-height: 1.4;
  margin: 0;
}
.related-card__meta {
  font-size: .72rem;
  color: var(--text-muted);
  margin-top: auto;
}

/* ── Author Box ──────────────────────────────── */
.author-box {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 1.5rem;
  margin-top: 2.5rem;
}
.author-box__avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 2px solid var(--accent);
  flex-shrink: 0;
  object-fit: cover;
}
.author-box__body {
  display: flex;
  flex-direction: column;
  gap: .35rem;
}
.author-box__label {
  font-size: .72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
  margin: 0;
}
.author-box__name {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  text-decoration: none;
}
.author-box__name:hover { color: var(--accent); }
.author-box__bio {
  font-size: .88rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin: .15rem 0 .25rem;
}
.author-box__link {
  font-size: .8rem;
  color: var(--accent);
  text-decoration: none;
  font-weight: 600;
}
.author-box__link:hover { text-decoration: underline; }
@media (max-width: 480px) {
  .author-box { flex-direction: column; align-items: center; text-align: center; }
}

/* ── Category Header ─────────────────────────── */
.cat-header {
  background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-dark) 100%);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0 1.75rem;
}
.cat-breadcrumb {
  font-size: .78rem;
  color: var(--text-muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: .4rem;
}
.cat-breadcrumb a {
  color: var(--text-muted);
  text-decoration: none;
}
.cat-breadcrumb a:hover { color: var(--accent); }
.cat-breadcrumb__sep { opacity: .5; }
.cat-breadcrumb__current { color: var(--text-secondary); }
.cat-header__inner {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
}
.cat-header__left { flex: 1; }
.cat-header__pill { margin-bottom: .75rem; display: inline-block; }
.cat-header__title {
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -.02em;
  color: var(--text-primary);
  margin: 0 0 .6rem;
  line-height: 1.15;
  border-left: 4px solid var(--accent);
  padding-left: .75rem;
}
.cat-header__desc {
  font-size: .925rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0;
  line-height: 1.65;
}
.cat-header__count {
  display: flex;
  flex-direction: column;
  align-items: center;
  background: var(--bg-dark);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: .9rem 1.4rem;
  flex-shrink: 0;
  gap: .15rem;
}
.cat-header__count-number {
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--accent);
  line-height: 1;
}
.cat-header__count-label {
  font-size: .68rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--text-muted);
}

/* ── Category Featured Post ──────────────────── */
.cat-featured {
  margin-top: 2rem;
}
.cat-featured__link {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  border-radius: 14px;
  overflow: hidden;
  border: 1px solid var(--border);
  text-decoration: none;
  background: var(--bg-card);
  transition: border-color .2s, box-shadow .2s;
}
.cat-featured__link:hover {
  border-color: var(--accent);
  box-shadow: 0 4px 24px rgba(0,0,0,.4);
}
.cat-featured__image {
  position: relative;
  overflow: hidden;
  min-height: 280px;
  background: var(--bg-dark);
}
.cat-featured__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .4s ease;
}
.cat-featured__link:hover .cat-featured__image img {
  transform: scale(1.03);
}
.cat-featured__body {
  padding: 2rem 2rem 1.75rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: .6rem;
}
.cat-featured__pill { margin-bottom: .25rem; }
.cat-featured__title {
  font-size: 1.45rem;
  font-weight: 800;
  color: var(--text-primary);
  line-height: 1.3;
  letter-spacing: -.015em;
  margin: 0;
}
.cat-featured__excerpt {
  font-size: .9rem;
  color: var(--text-secondary);
  line-height: 1.65;
  margin: 0;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cat-featured__meta {
  display: flex;
  gap: .5rem;
  align-items: center;
  font-size: .78rem;
  color: var(--text-muted);
  margin-top: .25rem;
}

/* ── Category Page Responsive ────────────────── */
@media (max-width: 768px) {
  .cat-header__inner { flex-direction: column; align-items: flex-start; }
  .cat-header__count { flex-direction: row; align-items: center; gap: .5rem; padding: .6rem 1rem; }
  .cat-header__title { font-size: 1.5rem; }
  .cat-featured__link { grid-template-columns: 1fr; }
  .cat-featured__image { min-height: 200px; }
  .cat-featured__body { padding: 1.25rem; }
  .cat-featured__title { font-size: 1.2rem; }
}

/* =============================================
   HOMEPAGE REDESIGN — Featured Row + By Category
   ============================================= */

/* ── Editor's Picks (featured horizontal cards) ── */
.featured-section {
  padding: 2rem 0 0;
  border-top: 1px solid var(--border);
}
.featured-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
}
.featured-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  height: 172px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  transition: border-color .15s, background .15s, transform .15s;
}
.featured-card:hover {
  border-color: var(--border-strong);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.featured-card-image {
  position: relative;
  overflow: hidden;
  background: var(--bg-secondary);
}
.featured-card-image a {
  display: block;
  width: 100%;
  height: 100%;
}
.featured-card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .3s;
}
.featured-card:hover .featured-card-image img { transform: scale(1.04); }
.featured-card-body {
  padding: 1.1rem 1.25rem;
  display: flex;
  flex-direction: column;
  gap: .4rem;
}
.featured-card-title {
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
  flex: 1;
}
.featured-card-title a { color: inherit; }
.featured-card-title a:hover { color: var(--accent); }
.featured-card-excerpt {
  font-size: .8125rem;
  color: var(--text-secondary);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-card-meta {
  font-size: .75rem;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: .75rem;
  margin-top: auto;
  padding-top: .65rem;
  border-top: 1px solid var(--border);
}

/* ── Browse by Topic ─────────────────────────── */
.by-category-section {
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--border);
}
.by-category-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-top: 1.5rem;
}
.by-category-tile {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 1.1rem 1.25rem;
  text-decoration: none;
  transition: border-color .15s, background .15s, transform .15s;
}
.by-category-tile:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
  transform: translateY(-2px);
}
.by-category-icon {
  width: 40px; height: 40px;
  border-radius: var(--radius-md);
  background: var(--accent-light);
  border: 1px solid rgba(37,99,235,.25);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: var(--accent);
}
.by-category-icon svg { width: 18px; height: 18px; }
.by-category-info { flex: 1; min-width: 0; }
.by-category-name {
  font-size: .9rem;
  font-weight: 700;
  color: var(--text-primary);
  display: block;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.by-category-count {
  font-size: .75rem;
  color: var(--text-muted);
  margin-top: .15rem;
}
.by-category-arrow {
  color: var(--text-muted);
  flex-shrink: 0;
  transition: color .15s, transform .15s;
}
.by-category-tile:hover .by-category-arrow {
  color: var(--accent);
  transform: translateX(3px);
}

/* ── Responsive — homepage additions ────────── */
@media (max-width: 1024px) {
  .featured-card { grid-template-columns: 160px 1fr; height: 160px; }
}
@media (max-width: 768px) {
  .featured-row { grid-template-columns: 1fr; }
  .featured-card { grid-template-columns: 130px 1fr; height: 150px; }
  .by-category-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .featured-card { grid-template-columns: 1fr; height: auto; }
  .featured-card-image { aspect-ratio: 16/9; }
  .by-category-grid { grid-template-columns: 1fr; }
}

/* =============================================
   NEWSLETTER BAR (footer)
   ============================================= */
.newsletter-bar {
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  padding: 2rem 0;
}
.newsletter-bar__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 1.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  flex-wrap: wrap;
}
.newsletter-bar__copy {
  display: flex;
  flex-direction: column;
  gap: .3rem;
}
.newsletter-bar__title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text-primary);
}
.newsletter-bar__sub {
  font-size: .8125rem;
  color: var(--text-secondary);
}
.newsletter-bar__form {
  display: flex;
  align-items: center;
  gap: .5rem;
  flex-wrap: wrap;
  position: relative;
}
.newsletter-bar__input {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  font-size: .875rem;
  padding: .55rem 1rem;
  width: 240px;
  outline: none;
  transition: border-color .15s;
}
.newsletter-bar__input::placeholder { color: var(--text-muted); }
.newsletter-bar__input:focus { border-color: var(--accent); }
.newsletter-bar__btn {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: var(--radius-sm);
  font-size: .875rem;
  font-weight: 600;
  padding: .55rem 1.25rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.newsletter-bar__btn:hover:not(:disabled) { background: var(--accent-hover); }
.newsletter-bar__btn:disabled { opacity: .6; cursor: default; }
.newsletter-bar__msg {
  font-size: .8rem;
  display: none;
  width: 100%;
  margin-top: .25rem;
}
.newsletter-bar__msg--ok   { display: block; color: #10b981; }
.newsletter-bar__msg--warn { display: block; color: #f59e0b; }
.newsletter-bar__msg--err  { display: block; color: #ef4444; }

@media (max-width: 768px) {
  .newsletter-bar__inner { flex-direction: column; align-items: flex-start; }
  .newsletter-bar__input { width: 100%; }
  .newsletter-bar__form { width: 100%; }
  .newsletter-bar__btn { width: 100%; justify-content: center; }
}
