/* ==========================================================================
   Equalza Blog / Magazine Styles
   Matches the Equalza design system (dark hero, white cards, blue accent)
   ========================================================================== */

/* ---------- Variables (inherit from equalza.css) ---------- */
.eq-blog-wrap {
  --blog-max: 1100px;
  --blog-single-max: 1200px;
  --blog-article-max: 780px;
  --blog-sidebar-w: 300px;
  --blog-card-r: 12px;
}

/* ---------- Archive Hero ---------- */
.eq-blog-hero {
  background: linear-gradient(135deg, #0a1628 0%, #1e3a5f 50%, #0a1628 100%);
  color: #fff;
  text-align: center;
  padding: 72px 24px 56px;
  position: relative;
  overflow: hidden;
}
.eq-blog-hero::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: radial-gradient(circle, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 24px 24px;
  pointer-events: none;
}
.eq-blog-hero-inner {
  max-width: 620px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
}
.eq-blog-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 14px;
}
.eq-blog-hero p {
  font-size: 1.05rem;
  opacity: .82;
  line-height: 1.7;
}

/* ---------- Archive Main ---------- */
.eq-blog-main {
  max-width: var(--blog-max);
  margin: 0 auto;
  padding: 40px 20px 60px;
}

/* ---------- Featured Post Card ---------- */
.eq-blog-featured {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 0;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e5ea);
  border-radius: var(--blog-card-r);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  margin-bottom: 40px;
  transition: transform .2s, box-shadow .2s;
}
.eq-blog-featured:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 32px rgba(0,0,0,.08);
  color: inherit;
}
.eq-blog-featured-img {
  position: relative;
  overflow: hidden;
  min-height: 280px;
}
.eq-blog-featured-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.eq-blog-badge-featured {
  position: absolute;
  top: 16px;
  left: 16px;
  background: var(--accent, #2563eb);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 12px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
}
[dir="rtl"] .eq-blog-badge-featured { left: auto; right: 16px; }
.eq-blog-featured-body {
  padding: 32px 28px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.eq-blog-featured h2 {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--text, #111827);
  margin-bottom: 10px;
  line-height: 1.35;
}
.eq-blog-featured-sub {
  font-size: .95rem;
  color: var(--text2, #4b5563);
  line-height: 1.6;
  margin-bottom: 16px;
}
.eq-blog-read-more {
  font-size: .88rem;
  font-weight: 600;
  color: var(--accent, #2563eb);
  margin-top: auto;
}

/* ---------- Blog Meta (date + read time) ---------- */
.eq-blog-meta {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .82rem;
  color: var(--text3, #9ca3af);
  margin-bottom: 8px;
}
.eq-blog-dot { opacity: .5; }

/* ---------- Grid ---------- */
.eq-blog-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ---------- Blog Card ---------- */
.eq-blog-card {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e5ea);
  border-radius: var(--blog-card-r);
  overflow: hidden;
  text-decoration: none;
  color: inherit;
  transition: transform .2s, box-shadow .2s;
  display: flex;
  flex-direction: column;
}
.eq-blog-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(0,0,0,.07);
  color: inherit;
}
.eq-blog-card-img {
  height: 180px;
  overflow: hidden;
}
.eq-blog-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform .3s;
}
.eq-blog-card:hover .eq-blog-card-img img {
  transform: scale(1.05);
}
.eq-blog-card-body {
  padding: 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.eq-blog-card-cat {
  display: inline-block;
  font-size: .72rem;
  font-weight: 700;
  color: var(--accent, #2563eb);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 8px;
}
.eq-blog-card h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text, #111827);
  margin-bottom: 8px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.eq-blog-card p {
  font-size: .85rem;
  color: var(--text2, #4b5563);
  line-height: 1.6;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 12px;
}

/* ---------- Empty State ---------- */
.eq-blog-empty {
  text-align: center;
  padding: 80px 24px;
  color: var(--text3, #9ca3af);
  font-size: 1.1rem;
}

/* ---------- Pagination ---------- */
.eq-blog-pagination {
  text-align: center;
  margin-top: 48px;
}
.eq-blog-pagination .page-numbers {
  display: inline-block;
  padding: 8px 14px;
  margin: 0 3px;
  border-radius: 6px;
  font-size: .88rem;
  font-weight: 600;
  color: var(--text2, #4b5563);
  text-decoration: none;
  transition: background .15s, color .15s;
}
.eq-blog-pagination .page-numbers:hover { background: var(--bg, #f5f6f8); }
.eq-blog-pagination .page-numbers.current {
  background: var(--accent, #2563eb);
  color: #fff;
}

/* ==========================================================================
   Single Post
   ========================================================================== */

/* ---------- Single Hero ---------- */
.eq-blog-single-hero {
  background: linear-gradient(135deg, #0a1628 0%, #1e3a5f 50%, #0a1628 100%);
  color: #fff;
  min-height: 340px;
  position: relative;
  display: flex;
  align-items: flex-end;
  background-size: cover;
  background-position: center;
}
.eq-blog-single-hero-overlay {
  width: 100%;
  padding: 120px 24px 48px;
  background: linear-gradient(to top, rgba(10,22,40,.97) 0%, rgba(10,22,40,.85) 40%, rgba(10,22,40,.65) 100%);
}
.eq-blog-single-hero-inner {
  max-width: var(--blog-single-max);
  margin: 0 auto;
  padding: 0 24px;
}
.eq-blog-single-cat {
  display: inline-block;
  background: var(--accent, #2563eb);
  color: #fff;
  font-size: .72rem;
  font-weight: 700;
  padding: 4px 14px;
  border-radius: 20px;
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 16px;
}
.eq-blog-single-hero h1 {
  font-size: 2.2rem;
  font-weight: 800;
  margin-bottom: 14px;
  line-height: 1.3;
}
.eq-blog-single-subtitle {
  font-size: 1.1rem;
  opacity: .82;
  line-height: 1.7;
  margin-bottom: 16px;
}
.eq-blog-single-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: .88rem;
  opacity: .65;
}

/* ---------- Content Layout (Article + Sidebar Banner) ---------- */
.eq-blog-single-layout {
  max-width: var(--blog-single-max);
  margin: 0 auto;
  padding: 40px 24px 60px;
  display: grid;
  grid-template-columns: 1fr var(--blog-sidebar-w);
  gap: 40px;
  align-items: start;
}

/* RTL: sidebar on left, article on right */
[dir="rtl"] .eq-blog-single-layout {
  direction: rtl;
}

/* ---------- Sidebar ---------- */
.eq-blog-sidebar {
  min-width: 0;
}
.eq-blog-sidebar-sticky {
  position: sticky;
  top: calc(var(--topbar-h, 100px) + 24px);
  display: flex;
  flex-direction: column;
  gap: 20px;
}

/* Tools promo banner */
.eq-blog-banner {
  background: linear-gradient(135deg, #0a1628, #1e3a5f);
  color: #fff;
  border-radius: var(--blog-card-r);
  padding: 28px 24px;
  text-align: center;
}
.eq-blog-banner-icon {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,.12);
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #93c5fd;
}
.eq-blog-banner h3 {
  font-size: 1.05rem;
  font-weight: 700;
  margin-bottom: 8px;
  color: #fff;
}
.eq-blog-banner p {
  font-size: .82rem;
  line-height: 1.6;
  opacity: .78;
  margin-bottom: 18px;
  color: #fff;
}
.eq-blog-banner-btn {
  display: inline-block;
  background: #fff;
  color: #0a1628;
  padding: 10px 24px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .85rem;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.eq-blog-banner-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.25);
  color: #0a1628;
}

/* TOC in sidebar (desktop) */
.eq-blog-toc-sidebar {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e5ea);
  border-radius: var(--blog-card-r);
  padding: 20px;
}
.eq-blog-toc-sidebar h4,
.eq-blog-toc-inline h4 {
  font-size: .82rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .5px;
  color: var(--text3, #9ca3af);
  margin-bottom: 12px;
}
.eq-blog-toc-sidebar ol,
.eq-blog-toc-inline ol {
  list-style: none;
  padding: 0;
  margin: 0;
}
.eq-blog-toc-sidebar li,
.eq-blog-toc-inline li {
  margin-bottom: 6px;
}
.eq-blog-toc-sidebar li a,
.eq-blog-toc-inline li a {
  font-size: .84rem;
  color: var(--text2, #4b5563);
  text-decoration: none;
  line-height: 1.5;
  display: block;
  padding: 4px 0;
  transition: color .15s;
}
.eq-blog-toc-sidebar li a:hover,
.eq-blog-toc-inline li a:hover {
  color: var(--accent, #2563eb);
}
.eq-toc-level-3 { padding-inline-start: 14px; }
.eq-toc-level-3 a { font-size: .8rem; color: var(--text3, #9ca3af); }

/* Inline TOC — sticky accordion */
.eq-blog-toc-inline {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e5ea);
  border-radius: var(--blog-card-r);
  margin-bottom: 32px;
  position: sticky;
  top: calc(var(--topbar-h, 80px) + 12px);
  z-index: 20;
  box-shadow: 0 2px 8px rgba(0,0,0,.04);
}

/* Toggle button */
.eq-toc-toggle {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 16px 20px;
  background: none;
  border: none;
  cursor: pointer;
  font-size: .92rem;
  font-weight: 700;
  color: var(--text, #111827);
  font-family: inherit;
}
.eq-toc-toggle-icon {
  display: flex;
  color: var(--accent, #2563eb);
}
.eq-toc-chevron {
  margin-inline-start: auto;
  color: var(--text3, #9ca3af);
  transition: transform .25s ease;
  flex-shrink: 0;
}
.eq-blog-toc-inline.eq-toc-open .eq-toc-chevron {
  transform: rotate(180deg);
}

/* Collapsible list */
.eq-toc-list {
  max-height: 0;
  overflow: hidden;
  transition: max-height .3s ease, padding .3s ease;
  padding: 0 20px;
  list-style: none;
  margin: 0;
  counter-reset: toc;
}
.eq-blog-toc-inline.eq-toc-open .eq-toc-list {
  max-height: 600px;
  padding: 0 20px 18px;
  border-top: 1px solid var(--border, #e2e5ea);
}
.eq-toc-list li {
  counter-increment: toc;
  display: flex;
  align-items: baseline;
  margin-bottom: 6px;
}
.eq-toc-list li:first-child {
  margin-top: 14px;
}
.eq-toc-list li::before {
  content: counter(toc) ".";
  color: var(--accent, #2563eb);
  font-weight: 600;
  font-size: .84rem;
  margin-inline-end: 8px;
  flex-shrink: 0;
}
.eq-toc-list li a {
  display: inline;
}

/* Active TOC item */
.eq-blog-toc-inline li a.eq-toc-active,
.eq-blog-toc-sidebar li a.eq-toc-active {
  color: var(--accent, #2563eb);
  font-weight: 600;
}

/* Sidebar share */
.eq-blog-sidebar-share {
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e5ea);
  border-radius: var(--blog-card-r);
  padding: 16px 20px;
  text-align: center;
}
.eq-blog-sidebar-share > span {
  display: block;
  font-size: .82rem;
  font-weight: 700;
  color: var(--text3, #9ca3af);
  text-transform: uppercase;
  letter-spacing: .5px;
  margin-bottom: 10px;
}
.eq-blog-sidebar-share-btns {
  display: flex;
  justify-content: center;
  gap: 8px;
}
.eq-blog-sidebar-share-btns a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--bg, #f5f6f8);
  color: var(--text2, #4b5563);
  transition: background .15s, color .15s;
}
.eq-blog-sidebar-share-btns a:hover {
  background: var(--accent, #2563eb);
  color: #fff;
}

/* ---------- Article Body ---------- */
.eq-blog-article {
  max-width: var(--blog-article-max);
  min-width: 0;
}

/* Back link (hero variant — white) */
.eq-blog-back-hero {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 500;
  color: rgba(255,255,255,.7);
  text-decoration: none;
  margin-bottom: 20px;
  transition: color .15s;
}
.eq-blog-back-hero:hover { color: #fff; }
[dir="rtl"] .eq-blog-back-hero svg { transform: rotate(180deg); }

/* Back link (default) */
.eq-blog-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .85rem;
  font-weight: 500;
  color: var(--text3, #9ca3af);
  text-decoration: none;
  margin-bottom: 24px;
  transition: color .15s;
}
.eq-blog-back:hover { color: var(--accent, #2563eb); }
[dir="rtl"] .eq-blog-back svg { transform: rotate(180deg); }

/* Content typography */
.eq-blog-content {
  font-size: 1rem;
  line-height: 1.8;
  color: var(--text, #111827);
}
.eq-blog-content h2 {
  font-size: 1.5rem;
  font-weight: 700;
  margin: 40px 0 16px;
  color: var(--text, #111827);
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border, #e2e5ea);
}
.eq-blog-content h3 {
  font-size: 1.2rem;
  font-weight: 600;
  margin: 32px 0 12px;
  color: var(--text, #111827);
}
.eq-blog-content p {
  margin-bottom: 18px;
  color: var(--text2, #4b5563);
}
.eq-blog-content ul, .eq-blog-content ol {
  padding-inline-start: 24px;
  margin-bottom: 18px;
  color: var(--text2, #4b5563);
}
.eq-blog-content li { margin-bottom: 8px; }
.eq-blog-content img {
  border-radius: var(--blog-card-r);
  margin: 24px 0;
}
.eq-blog-content blockquote {
  border-inline-start: 4px solid var(--accent, #2563eb);
  padding: 16px 24px;
  margin: 24px 0;
  background: var(--accent-light, #eff6ff);
  border-radius: 0 8px 8px 0;
  color: var(--text, #111827);
  font-style: italic;
}
[dir="rtl"] .eq-blog-content blockquote {
  border-radius: 8px 0 0 8px;
}
.eq-blog-content pre, .eq-blog-content code {
  font-family: 'JetBrains Mono', 'Fira Code', monospace;
  background: #1e293b;
  color: #e2e8f0;
  border-radius: 8px;
  font-size: .88rem;
}
.eq-blog-content code {
  padding: 2px 6px;
  border-radius: 4px;
}
.eq-blog-content pre {
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
}
.eq-blog-content pre code {
  background: none;
  padding: 0;
}
.eq-blog-content a {
  color: inherit;
  text-decoration: none;
  border-bottom: 2px solid var(--accent-mid, #bfdbfe);
  background-image: linear-gradient(var(--accent-mid, #bfdbfe), var(--accent-mid, #bfdbfe));
  background-size: 100% 0%;
  background-position: 0 100%;
  background-repeat: no-repeat;
  transition: background-size .3s ease;
  position: relative;
  z-index: 1;
}
.eq-blog-content a:hover {
  background-size: 100% 100%;
  padding-top: 3px;
  margin-top: -3px;
  border-bottom: 2px solid var(--accent-mid, #bfdbfe);
}
.eq-blog-content table {
  width: 100%;
  border-collapse: collapse;
  margin: 24px 0;
  font-size: .92rem;
}
.eq-blog-content th, .eq-blog-content td {
  padding: 12px 16px;
  border: 1px solid var(--border, #e2e5ea);
  text-align: start;
}
.eq-blog-content th {
  background: var(--bg, #f5f6f8);
  font-weight: 700;
  color: var(--text, #111827);
}
.eq-blog-content td {
  color: var(--text2, #4b5563);
}

/* ---------- Related Tools ---------- */
.eq-blog-related-tools {
  margin-top: 48px;
  padding-top: 32px;
  border-top: 1px solid var(--border, #e2e5ea);
}
.eq-blog-related-tools h3 {
  font-size: 1.1rem;
  font-weight: 700;
  color: var(--text, #111827);
  margin-bottom: 16px;
}
.eq-blog-tools-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
}
.eq-blog-tool-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 20px;
  background: var(--surface, #fff);
  border: 1px solid var(--border, #e2e5ea);
  border-radius: 8px;
  text-decoration: none;
  color: inherit;
  transition: border-color .15s, box-shadow .15s;
}
.eq-blog-tool-card:hover {
  border-color: var(--accent, #2563eb);
  box-shadow: 0 4px 12px rgba(37,99,235,.1);
  color: inherit;
}
.eq-blog-tool-card-body strong {
  display: block;
  font-size: .92rem;
  color: var(--text, #111827);
}
.eq-blog-tool-card-body span {
  display: block;
  font-size: .8rem;
  color: var(--text3, #9ca3af);
  margin-top: 2px;
}
.eq-blog-tool-try {
  font-size: .82rem;
  font-weight: 600;
  color: var(--accent, #2563eb);
  white-space: nowrap;
  flex-shrink: 0;
}

/* ---------- CTA Box ---------- */
.eq-blog-cta-box {
  margin-top: 48px;
  padding: 36px 32px;
  background: linear-gradient(135deg, #0a1628, #1e3a5f);
  border-radius: var(--blog-card-r);
  text-align: center;
  color: #fff;
}
.eq-blog-cta-box h3 {
  font-size: 1.3rem;
  font-weight: 800;
  margin-bottom: 10px;
  color: #fff;
}
.eq-blog-cta-box p {
  font-size: .95rem;
  opacity: .82;
  margin-bottom: 20px;
  color: #fff;
}
.eq-blog-cta-btn {
  display: inline-block;
  background: #fff;
  color: #0a1628;
  padding: 12px 32px;
  border-radius: 8px;
  font-weight: 700;
  font-size: .95rem;
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.eq-blog-cta-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(0,0,0,.2);
  color: #0a1628;
}

/* ---------- Share ---------- */
.eq-blog-share {
  margin-top: 40px;
  padding-top: 24px;
  border-top: 1px solid var(--border, #e2e5ea);
  display: flex;
  align-items: center;
  gap: 14px;
}
.eq-blog-share span {
  font-size: .88rem;
  font-weight: 600;
  color: var(--text3, #9ca3af);
}
.eq-blog-share a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--bg, #f5f6f8);
  color: var(--text2, #4b5563);
  transition: background .15s, color .15s;
}
.eq-blog-share a:hover {
  background: var(--accent, #2563eb);
  color: #fff;
}

/* ==========================================================================
   Responsive
   ========================================================================== */

@media (max-width: 960px) {
  .eq-blog-single-layout {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 28px 20px 48px;
  }
  /* Hide sidebar TOC on tablet/mobile (inline TOC is always visible) */
  .eq-blog-toc-sidebar { display: none; }

  /* Sidebar becomes full-width section below article */
  .eq-blog-sidebar {
    margin-top: 32px;
  }
  .eq-blog-sidebar-sticky {
    position: static;
  }
  .eq-blog-banner {
    max-width: 480px;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .eq-blog-hero { padding: 48px 18px 40px; }
  .eq-blog-hero h1 { font-size: 1.5rem; }

  .eq-blog-featured {
    grid-template-columns: 1fr;
  }
  .eq-blog-featured-img { min-height: 200px; }
  .eq-blog-featured-body { padding: 24px 20px; }
  .eq-blog-featured h2 { font-size: 1.25rem; }

  .eq-blog-grid { grid-template-columns: 1fr; gap: 16px; }

  .eq-blog-single-hero h1 { font-size: 1.5rem; }
  .eq-blog-single-hero-overlay { padding: 80px 18px 36px; }

  .eq-blog-cta-box { padding: 28px 20px; }
  .eq-blog-cta-box h3 { font-size: 1.1rem; }
  .eq-blog-tools-grid { grid-template-columns: 1fr; }
}

@media (max-width: 520px) {
  .eq-blog-hero h1 { font-size: 1.3rem; }
  .eq-blog-single-hero h1 { font-size: 1.3rem; }
  .eq-blog-card-img { height: 160px; }
}

/* ==========================================================================
   RTL Adjustments
   ========================================================================== */

[dir="rtl"] .eq-blog-wrap {
  text-align: right;
}
[dir="rtl"] .eq-blog-hero {
  text-align: center;
}
[dir="rtl"] .eq-blog-share {
  direction: rtl;
}
[dir="rtl"] .eq-blog-banner,
[dir="rtl"] .eq-blog-sidebar-share {
  text-align: center;
}
