/* =====================================================
   SECURITY BULLETIN BLOG — STYLESHEET
   ===================================================== */

/* ---- NAV ACTIVE ---- */
.nav-active { color: var(--accent) !important; background: rgba(0,212,170,.1) !important; }

/* =====================================================
   BLOG HERO
   ===================================================== */
.blog-hero {
  position: relative; overflow: hidden;
  padding: 72px 0 56px;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, rgba(124,58,237,.15) 0%, transparent 70%);
}
.blog-hero-bg { position: absolute; inset: 0; pointer-events: none; }
.bh-shape {
  position: absolute; border-radius: 50%;
  filter: blur(90px); opacity: .2;
}
.bh-shape.s1 { width: 500px; height: 500px; background: var(--accent2); top: -200px; left: -100px; }
.bh-shape.s2 { width: 300px; height: 300px; background: var(--accent);  bottom: -100px; right: 5%; }

.blog-hero-content { position: relative; text-align: center; }
.blog-hero-badge {
  display: inline-flex; align-items: center; gap: 8px;
  background: rgba(0,212,170,.1); border: 1px solid rgba(0,212,170,.3);
  color: var(--accent); padding: 5px 16px; border-radius: 100px;
  font-size: .8rem; font-weight: 600; margin-bottom: 22px;
}
.blog-hero-title {
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 900; color: #fff; margin-bottom: 14px; line-height: 1.2;
}
.blog-hero-desc { color: var(--muted); max-width: 520px; margin: 0 auto 36px; font-size: .98rem; }

/* ---- Search ---- */
.blog-search-wrap { display: flex; justify-content: center; }
.blog-search-box {
  display: flex; align-items: center; gap: 12px;
  background: var(--card); border: 1.5px solid var(--border);
  border-radius: 12px; padding: 12px 18px;
  width: 100%; max-width: 520px; transition: border-color .2s;
}
.blog-search-box:focus-within { border-color: var(--accent); }
.blog-search-box svg { color: var(--muted); flex-shrink: 0; width: 18px; height: 18px; }
.blog-search-box input {
  flex: 1; background: transparent; border: none; outline: none;
  color: var(--text); font-family: var(--font); font-size: .95rem;
}
.blog-search-box input::placeholder { color: var(--muted); }
kbd {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); padding: 2px 8px; border-radius: 5px;
  font-size: .72rem; font-family: monospace; flex-shrink: 0;
}

/* =====================================================
   CATEGORY TABS
   ===================================================== */
.cat-bar {
  background: var(--bg2);
  border-bottom: 1px solid var(--border);
  position: sticky; top: 68px; z-index: 90;
}
.cat-tabs {
  display: flex; gap: 4px; overflow-x: auto;
  padding: 12px 0; scrollbar-width: none;
}
.cat-tabs::-webkit-scrollbar { display: none; }

.cat-tab {
  display: flex; align-items: center; gap: 7px;
  background: transparent; border: 1px solid transparent;
  color: var(--muted); font-family: var(--font); font-size: .85rem;
  padding: 7px 16px; border-radius: 100px; cursor: pointer;
  white-space: nowrap; transition: all .2s; font-weight: 500;
}
.cat-tab:hover { color: var(--text); border-color: var(--border); }
.cat-tab.active {
  background: rgba(0,212,170,.1); border-color: rgba(0,212,170,.35);
  color: var(--accent); font-weight: 700;
}
.cat-dot {
  width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0;
}
.cve-dot      { background: #ef4444; }
.news-dot     { background: #3b82f6; }
.tutorial-dot { background: #8b5cf6; }
.report-dot   { background: #f59e0b; }
.tool-dot     { background: #00d4aa; }

/* =====================================================
   MAIN LAYOUT
   ===================================================== */
.blog-main { padding: 48px 0 80px; }
.blog-layout {
  display: grid;
  grid-template-columns: 1fr 300px;
  gap: 32px;
  align-items: start;
}
@media (max-width: 860px) {
  .blog-layout { grid-template-columns: 1fr; }
  .blog-sidebar { order: -1; }
}

/* =====================================================
   FEATURED ARTICLE
   ===================================================== */
.featured-label {
  font-size: .78rem; font-weight: 700; color: var(--accent);
  text-transform: uppercase; letter-spacing: .08em;
  margin-bottom: 12px;
}
.article-featured {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 28px 30px;
  margin-bottom: 32px; position: relative; overflow: hidden;
  transition: border-color .25s, box-shadow .25s;
}
.article-featured::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 4px; height: 100%;
  background: linear-gradient(180deg, var(--danger), var(--warn));
}
.article-featured:hover {
  border-color: rgba(239,68,68,.4);
  box-shadow: 0 8px 32px rgba(239,68,68,.1);
}

.featured-badge-wrap { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }

.article-badge {
  display: inline-block; padding: 3px 12px; border-radius: 100px;
  font-size: .75rem; font-weight: 700;
}
.badge-cve      { background: rgba(239,68,68,.15);  color: #f87171; border: 1px solid rgba(239,68,68,.3); }
.badge-news     { background: rgba(59,130,246,.15); color: #60a5fa; border: 1px solid rgba(59,130,246,.3); }
.badge-tutorial { background: rgba(139,92,246,.15); color: #a78bfa; border: 1px solid rgba(139,92,246,.3); }
.badge-report   { background: rgba(245,158,11,.15); color: #fbbf24; border: 1px solid rgba(245,158,11,.3); }
.badge-tool     { background: rgba(0,212,170,.15);  color: #00d4aa; border: 1px solid rgba(0,212,170,.3); }

.article-severity {
  display: inline-block; padding: 3px 12px; border-radius: 100px;
  font-size: .75rem; font-weight: 700;
}
.sev-critical { background: rgba(239,68,68,.2); color: #fca5a5; border: 1px solid rgba(239,68,68,.4); }
.sev-high     { background: rgba(249,115,22,.2); color: #fdba74; border: 1px solid rgba(249,115,22,.4); }
.sev-medium   { background: rgba(245,158,11,.2); color: #fcd34d; border: 1px solid rgba(245,158,11,.4); }
.sev-low      { background: rgba(34,197,94,.2);  color: #86efac; border: 1px solid rgba(34,197,94,.4);  }

.featured-title {
  font-size: 1.35rem; font-weight: 800; color: #fff;
  line-height: 1.4; margin-bottom: 12px;
}
.featured-excerpt { color: var(--muted); font-size: .9rem; line-height: 1.75; margin-bottom: 18px; }
.featured-meta {
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center;
  font-size: .8rem; color: var(--muted); margin-bottom: 20px;
}
.featured-meta > span { display: flex; align-items: center; gap: 5px; }
.meta-tag { color: var(--accent2); }

.btn-read-more {
  background: transparent; border: 1px solid var(--border);
  color: var(--text); font-family: var(--font); font-size: .85rem;
  padding: 9px 20px; border-radius: 8px; cursor: pointer;
  transition: all .2s; font-weight: 600;
}
.btn-read-more:hover { border-color: var(--accent); color: var(--accent); }

/* =====================================================
   ARTICLES GRID
   ===================================================== */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 20px;
}

.article-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 22px;
  display: flex; flex-direction: column; gap: 12px;
  cursor: pointer; transition: all .25s;
}
.article-card:hover {
  transform: translateY(-3px);
  border-color: rgba(0,212,170,.25);
  box-shadow: 0 8px 28px rgba(0,0,0,.3);
}

.card-top { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 6px; }
.card-title { font-size: .98rem; font-weight: 700; color: #fff; line-height: 1.45; flex: 1; }
.card-excerpt { font-size: .83rem; color: var(--muted); line-height: 1.7; flex: 1; }
.card-meta {
  display: flex; gap: 12px; font-size: .75rem; color: var(--muted);
  border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto;
  flex-wrap: wrap; align-items: center;
}
.card-meta span { display: flex; align-items: center; gap: 4px; }
.card-tag { color: var(--accent2); margin-right: auto; }

/* =====================================================
   LIVE SECTIONS
   ===================================================== */
.live-section-header {
  display: flex; justify-content: space-between; align-items: center;
  flex-wrap: wrap; gap: 10px;
  margin-bottom: 16px; padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}
.live-section-title {
  display: flex; align-items: center; gap: 10px;
  font-size: .95rem; font-weight: 700; color: var(--text);
}
.live-dot {
  width: 10px; height: 10px; border-radius: 50%;
  background: var(--danger); flex-shrink: 0;
  box-shadow: 0 0 0 3px rgba(239,68,68,.2);
  animation: pulse 2s infinite;
}
.live-dot-blue {
  background: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59,130,246,.2);
}
.live-meta-row { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.live-source-badge {
  display: flex; align-items: center; gap: 5px;
  font-size: .75rem; color: var(--muted);
  background: var(--bg3); border: 1px solid var(--border);
  padding: 4px 10px; border-radius: 100px;
}
.live-refresh-btn {
  display: flex; align-items: center; gap: 5px;
  background: transparent; border: 1px solid var(--border);
  color: var(--muted); font-family: var(--font); font-size: .78rem;
  padding: 4px 12px; border-radius: 100px; cursor: pointer;
  transition: all .2s;
}
.live-refresh-btn:hover { border-color: var(--accent); color: var(--accent); }
.live-refresh-btn.spinning svg { animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---- Skeleton Loading ---- */
@keyframes shimmer {
  0%   { background-position: -600px 0; }
  100% { background-position:  600px 0; }
}
.skeleton-card, .skeleton-news {
  background: linear-gradient(90deg, var(--bg3) 25%, var(--border) 50%, var(--bg3) 75%);
  background-size: 600px 100%;
  animation: shimmer 1.6s infinite;
  border-radius: var(--radius);
}
.skeleton-card { height: 160px; }
.skeleton-news  { height: 64px; margin-bottom: 10px; border-radius: 8px; }

/* ---- Live CVE Grid ---- */
.live-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px; margin-bottom: 32px;
}
.cve-live-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 18px;
  display: flex; flex-direction: column; gap: 10px;
  transition: all .25s; cursor: default;
  position: relative; overflow: hidden;
}
.cve-live-card::before {
  content: ''; position: absolute; top: 0; right: 0;
  width: 3px; height: 100%;
}
.cve-live-card.sev-critical-card::before { background: var(--danger); }
.cve-live-card.sev-high-card::before     { background: var(--warn); }
.cve-live-card.sev-medium-card::before   { background: var(--accent3); }
.cve-live-card.sev-low-card::before      { background: var(--ok); }
.cve-live-card:hover { border-color: rgba(0,212,170,.25); transform: translateY(-2px); }

.cve-card-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 8px; }
.cve-id {
  font-family: 'Courier New', monospace; font-size: .82rem;
  color: var(--accent); font-weight: 700;
}
.cvss-badge {
  font-size: .75rem; font-weight: 700; padding: 2px 10px;
  border-radius: 100px; white-space: nowrap; flex-shrink: 0;
}
.cvss-critical { background: rgba(239,68,68,.18); color: #fca5a5; border: 1px solid rgba(239,68,68,.3); }
.cvss-high     { background: rgba(249,115,22,.18); color: #fdba74; border: 1px solid rgba(249,115,22,.3); }
.cvss-medium   { background: rgba(245,158,11,.18); color: #fcd34d; border: 1px solid rgba(245,158,11,.3); }
.cvss-low      { background: rgba(34,197,94,.18);  color: #86efac; border: 1px solid rgba(34,197,94,.3); }
.cvss-none     { background: rgba(100,116,139,.18);color: var(--muted); border: 1px solid var(--border); }

.cve-title { font-size: .85rem; color: var(--text); line-height: 1.55; flex: 1; }
.cve-card-footer {
  display: flex; justify-content: space-between; align-items: center;
  font-size: .73rem; color: var(--muted);
  border-top: 1px solid var(--border); padding-top: 10px; margin-top: auto;
}
.cve-card-footer a {
  color: var(--accent2); text-decoration: none; font-weight: 600;
  transition: color .2s;
}
.cve-card-footer a:hover { color: var(--accent); }

/* ---- Live News List ---- */
.live-news-list { display: flex; flex-direction: column; gap: 0; margin-bottom: 32px; }
.news-item {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 14px 0; border-bottom: 1px solid var(--border);
  transition: background .2s; cursor: pointer;
}
.news-item:last-child { border-bottom: none; }
.news-item:hover { background: rgba(255,255,255,.02); }
.news-source-icon {
  width: 36px; height: 36px; border-radius: 8px; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: .65rem; font-weight: 800; text-align: center; line-height: 1.2;
}
.src-thn  { background: rgba(239,68,68,.15); color: #f87171; }
.src-bc   { background: rgba(59,130,246,.15); color: #60a5fa; }
.src-sw   { background: rgba(245,158,11,.15); color: #fbbf24; }
.src-ks   { background: rgba(139,92,246,.15); color: #a78bfa; }
.src-dark { background: rgba(0,212,170,.15);  color: #00d4aa; }

.news-content { flex: 1; min-width: 0; }
.news-title {
  font-size: .9rem; font-weight: 600; color: var(--text);
  line-height: 1.45; margin-bottom: 5px;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.news-item:hover .news-title { color: var(--accent); }
.news-meta { display: flex; gap: 10px; font-size: .73rem; color: var(--muted); }
.news-link {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); flex-shrink: 0; transition: color .2s;
}
.news-item:hover .news-link { color: var(--accent); }

/* ---- Error state ---- */
.live-error {
  display: flex; align-items: center; gap: 10px;
  background: rgba(239,68,68,.06); border: 1px solid rgba(239,68,68,.2);
  border-radius: 10px; padding: 14px 18px;
  font-size: .85rem; color: #f87171; margin-bottom: 24px;
}
.live-error button {
  background: transparent; border: 1px solid rgba(239,68,68,.3);
  color: #f87171; padding: 3px 12px; border-radius: 6px;
  cursor: pointer; font-family: var(--font); font-size: .82rem;
  transition: all .2s;
}
.live-error button:hover { background: rgba(239,68,68,.1); }

/* ---- No results ---- */
.no-results {
  text-align: center; padding: 60px 20px;
  color: var(--muted); display: flex;
  flex-direction: column; align-items: center; gap: 16px;
}

/* =====================================================
   SIDEBAR
   ===================================================== */
.blog-sidebar { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 120px; }

.sidebar-alert {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.3);
  border-radius: var(--radius); padding: 18px;
}
.alert-header {
  display: flex; align-items: center; gap: 8px;
  color: #f87171; font-weight: 700; font-size: .88rem; margin-bottom: 10px;
}
.sidebar-alert p { font-size: .82rem; color: var(--text); line-height: 1.65; margin-bottom: 8px; }
.alert-date { font-size: .75rem; color: var(--danger); font-weight: 600; }

.sidebar-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px;
}
.sidebar-title {
  font-size: .88rem; font-weight: 700; color: var(--accent);
  margin-bottom: 16px; padding-bottom: 10px; border-bottom: 1px solid var(--border);
}

.sidebar-stats { display: flex; flex-direction: column; gap: 12px; }
.s-stat { display: flex; justify-content: space-between; align-items: center; }
.s-stat-num { font-size: 1.3rem; font-weight: 800; }
.s-stat-label { font-size: .8rem; color: var(--muted); }

.sidebar-latest { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.sidebar-latest li {
  font-size: .82rem; color: var(--muted);
  padding-bottom: 12px; border-bottom: 1px solid var(--border);
  line-height: 1.55; cursor: pointer; transition: color .2s;
}
.sidebar-latest li:last-child { border-bottom: none; padding-bottom: 0; }
.sidebar-latest li:hover { color: var(--text); }
.sidebar-latest .sl-date { font-size: .72rem; color: #334155; display: block; margin-top: 4px; }

.tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tag-chip {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); padding: 4px 12px; border-radius: 100px;
  font-size: .75rem; cursor: pointer; transition: all .2s;
}
.tag-chip:hover { border-color: var(--accent); color: var(--accent); }

.sidebar-tool-promo {
  background: linear-gradient(135deg, rgba(0,212,170,.1), rgba(124,58,237,.1));
  border: 1px solid rgba(0,212,170,.25);
  border-radius: var(--radius); padding: 18px;
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; transition: all .25s;
  color: var(--text);
}
.sidebar-tool-promo:hover { border-color: var(--accent); transform: translateY(-2px); }
.sidebar-tool-promo svg:first-child { color: var(--accent); flex-shrink: 0; }
.sidebar-tool-promo div { flex: 1; }
.sidebar-tool-promo strong { display: block; font-size: .9rem; color: #fff; margin-bottom: 3px; }
.sidebar-tool-promo span  { font-size: .78rem; color: var(--muted); }
.arrow-ltr { transform: rotate(180deg); color: var(--muted); flex-shrink: 0; }

/* =====================================================
   ARTICLE MODAL
   ===================================================== */
.modal-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,.75);
  backdrop-filter: blur(6px); z-index: 200;
  opacity: 0; pointer-events: none; transition: opacity .3s;
}
.modal-overlay.open { opacity: 1; pointer-events: all; }

.article-modal {
  position: fixed; top: 50%; left: 50%;
  transform: translate(-50%, -48%) scale(.96);
  width: min(720px, 94vw); max-height: 85vh;
  background: var(--card); border: 1px solid var(--border);
  border-radius: 18px; overflow-y: auto; z-index: 201;
  padding: 36px; opacity: 0; pointer-events: none;
  transition: all .3s cubic-bezier(.4,0,.2,1);
  scrollbar-width: thin;
}
.article-modal.open {
  opacity: 1; pointer-events: all;
  transform: translate(-50%, -50%) scale(1);
}

.modal-close {
  position: sticky; top: 0; float: left;
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); width: 32px; height: 32px; border-radius: 50%;
  cursor: pointer; font-size: .8rem; display: flex; align-items: center;
  justify-content: center; transition: all .2s; margin-bottom: 16px;
  z-index: 1;
}
.modal-close:hover { border-color: var(--accent); color: var(--accent); }

.modal-body h2 { font-size: 1.4rem; font-weight: 800; color: #fff; margin-bottom: 16px; line-height: 1.4; }
.modal-body .modal-meta {
  display: flex; flex-wrap: wrap; gap: 12px;
  font-size: .8rem; color: var(--muted); margin-bottom: 24px;
  padding-bottom: 20px; border-bottom: 1px solid var(--border);
}
.modal-body .modal-meta span { display: flex; align-items: center; gap: 5px; }
.modal-body p { font-size: .92rem; color: var(--text); line-height: 1.85; margin-bottom: 16px; }
.modal-body h3 { font-size: 1.05rem; font-weight: 700; color: var(--accent); margin: 24px 0 10px; }
.modal-body ul { list-style: none; display: flex; flex-direction: column; gap: 8px; margin-bottom: 16px; }
.modal-body ul li {
  font-size: .9rem; color: var(--text); line-height: 1.7;
  padding-right: 20px; position: relative;
}
.modal-body ul li::before {
  content: '▸'; color: var(--accent); position: absolute; right: 0; top: 1px;
}
.modal-body .cve-box {
  background: rgba(239,68,68,.08); border: 1px solid rgba(239,68,68,.25);
  border-radius: 10px; padding: 16px 20px; margin-bottom: 18px;
  font-size: .85rem; line-height: 1.7;
}
.modal-body .cve-box strong { color: #f87171; display: block; margin-bottom: 6px; }
.modal-body .ref-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.modal-body .ref-link {
  background: var(--bg3); border: 1px solid var(--border);
  color: var(--muted); padding: 5px 14px; border-radius: 6px;
  font-size: .78rem; text-decoration: none; transition: all .2s;
}
.modal-body .ref-link:hover { border-color: var(--accent); color: var(--accent); }
