/* =====================================================================
   ALYA BLOG — single-post article (enhanced).
   Immersive hero · breadcrumbs · byline · sticky TOC + reading progress ·
   article typography · share · author · related · CTA. Theme file (sync-safe).
   ===================================================================== */

.blog-main { background: #ffffff; position: relative; }

/* ── Reading-progress bar ─────────────────────────────────────────────── */
.blog-progress {
  position: fixed; top: 0; left: 0; height: 3px; width: 0;
  background: linear-gradient(90deg, #7FFA7B, #5AF956); z-index: 100;
  transition: width .1s linear;
}

/* ── Immersive hero ───────────────────────────────────────────────────── */
.blog-hero {
  position: relative; background: #021F4B; overflow: hidden;
  display: flex; align-items: flex-end; min-height: 360px;
  padding: 64px 24px 40px;
}
.blog-hero.has-image::before {
  content: ""; position: absolute; inset: 0;
  background-image: var(--hero-bg); background-size: cover; background-position: center;
}
.blog-hero::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(2,31,75,0.97) 0%, rgba(2,31,75,0.82) 45%, rgba(2,31,75,0.6) 100%);
}
.blog-hero.has-image::after { background: linear-gradient(to top, rgba(2,31,75,0.96) 0%, rgba(2,31,75,0.80) 50%, rgba(2,31,75,0.55) 100%); }
.blog-hero-inner { position: relative; z-index: 1; max-width: 760px; margin: 0 auto; width: 100%; }

.blog-crumbs { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; font-family: 'Manrope', sans-serif; font-size: 13px; margin-bottom: 22px; }
.blog-crumbs a { color: rgba(255,255,255,0.6); text-decoration: none; transition: color .15s; }
.blog-crumbs a:hover { color: #fff; }
.blog-crumbs span[aria-hidden] { color: rgba(255,255,255,0.3); }
.blog-crumbs .current { color: rgba(255,255,255,0.45); }

.blog-cat-pill {
  display: inline-block; font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 700;
  letter-spacing: 0.14em; text-transform: uppercase; color: #021F4B; background: #7FFA7B;
  padding: 6px 14px; border-radius: 9999px; text-decoration: none; margin-bottom: 18px;
}
.blog-cat-pill:hover { background: #A3FBA0; }

.blog-title {
  font-family: 'Manrope', sans-serif !important; color: #fff; font-weight: 800;
  font-size: clamp(30px, 4.4vw, 52px); line-height: 1.08; letter-spacing: -0.03em; margin: 0 0 22px;
}

.blog-byline { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; font-family: 'Manrope', sans-serif; font-size: 14px; color: rgba(255,255,255,0.65); }
.blog-byline .blog-avatar { width: 36px; height: 36px; border-radius: 50%; border: 2px solid rgba(255,255,255,0.25); }
.blog-byline-author { color: #fff; font-weight: 700; }
.blog-byline-sep { color: rgba(255,255,255,0.3); }

/* ── Body layout: sticky TOC + article ────────────────────────────────── */
.blog-body { max-width: 720px; margin: 0 auto; padding: 52px 24px 56px; }
.blog-body.has-toc {
  display: grid; grid-template-columns: 232px minmax(0, 720px); gap: 56px;
  justify-content: center; max-width: 1064px;
}

/* ── Table of contents (collapsible: H3s reveal under the active H2) ───── */
.blog-toc { position: sticky; top: calc(var(--alya-header-h, 90px) + 16px); max-height: calc(100vh - var(--alya-header-h, 90px) - 48px); overflow-y: auto; overscroll-behavior: contain; scrollbar-width: none; -ms-overflow-style: none; }
.blog-toc::-webkit-scrollbar { width: 0; height: 0; display: none; }
.blog-toc-toggle { display: none; }
.blog-toc-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 0 0 14px; }
.blog-toc-label { font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: #021F4B; margin: 0; }
.blog-toc-list, .blog-toc .toc-sub { list-style: none; margin: 0; padding: 0; }
.blog-toc-list { border-left: 1px solid #E3ECF7; }
.blog-toc-list > li { margin: 0; }
.blog-toc-list > li > a {
  display: block; font-family: 'Manrope', sans-serif; font-size: 13px; line-height: 1.45; font-weight: 500;
  color: #5A7090; text-decoration: none; padding: 6px 0 6px 18px; margin-left: -1px;
  border-left: 2px solid transparent; transition: color .15s, border-color .15s;
}
.blog-toc .toc-sub { display: none; margin: 1px 0 5px; }
.blog-toc .toc-grp.open > .toc-sub { display: block; }
.blog-toc .toc-sub a {
  display: block; font-family: 'Manrope', sans-serif; font-size: 12px; line-height: 1.4; font-weight: 500;
  color: #6B7E99; text-decoration: none; padding: 4px 0 4px 28px; margin-left: -1px;
  border-left: 2px solid transparent; transition: color .15s, border-color .15s;
}
.blog-toc a:hover { color: #021F4B; }
.blog-toc a.active { color: #021F4B !important; font-weight: 700; border-left-color: #7FFA7B; }
.blog-toc .toc-grp.open > a { color: #021F4B; }
.blog-toc-timeleft { font-family: 'Manrope', sans-serif; font-size: 11.5px; color: #5A7090; margin: 0; padding: 0; border: none; white-space: nowrap; }
.blog-toc-timeleft .time-left { color: #021F4B; font-weight: 800; }

/* ── Article body typography ──────────────────────────────────────────── */
.blog-content { font-family: 'Manrope', sans-serif; font-size: 17.5px; line-height: 1.8; color: #334155; }
.blog-content > *:first-child { margin-top: 0; }

/* drop cap on the lead paragraph */
.blog-content > p:first-child::first-letter {
  float: left; font-family: 'Manrope', sans-serif; font-weight: 800; color: #021F4B;
  font-size: 64px; line-height: 0.82; padding: 6px 12px 0 0;
}

.blog-content h2 { font-family: 'Manrope', sans-serif !important; color: #021F4B !important; font-weight: 800; font-size: clamp(24px, 3vw, 32px); line-height: 1.18; letter-spacing: -0.02em; margin: 56px 0 18px; scroll-margin-top: calc(var(--alya-header-h, 90px) + 22px); }
.blog-content h3 { font-family: 'Manrope', sans-serif !important; color: #021F4B !important; font-weight: 700; font-size: clamp(20px, 2.4vw, 24px); line-height: 1.3; letter-spacing: -0.01em; margin: 40px 0 14px; scroll-margin-top: calc(var(--alya-header-h, 90px) + 22px); }
.blog-content h4 { font-family: 'Manrope', sans-serif !important; color: #1E3A66 !important; font-weight: 700; font-size: 18px; margin: 30px 0 12px; }
.blog-content p { margin: 0 0 22px; }
.blog-content a { color: #021F4B !important; font-weight: 600; text-decoration: none; border-bottom: 1.5px solid #7FFA7B; transition: background-color .15s, color .15s; }
.blog-content a:hover { background: rgba(127,250,123,0.18); }
.blog-content strong { color: #021F4B; font-weight: 700; }

.blog-content ul, .blog-content ol { margin: 0 0 24px; padding-left: 4px; list-style: none; }
.blog-content ol { counter-reset: blog-ol; }
.blog-content li { position: relative; padding-left: 30px; margin-bottom: 12px; line-height: 1.7; }
.blog-content ul > li::before { content: ""; position: absolute; left: 6px; top: 12px; width: 7px; height: 7px; border-radius: 50%; background: #7FFA7B; }
.blog-content ol > li { counter-increment: blog-ol; }
.blog-content ol > li::before { content: counter(blog-ol); position: absolute; left: 0; top: 1px; font-family: 'Manrope', sans-serif; font-size: 12px; font-weight: 800; color: #021F4B; width: 20px; height: 20px; border-radius: 50%; background: rgba(127,250,123,0.25); display: flex; align-items: center; justify-content: center; }

.blog-content blockquote {
  position: relative; margin: 36px 0; padding: 8px 0 8px 28px; border-left: 3px solid #7FFA7B;
  font-size: 20px; line-height: 1.55; color: #021F4B; font-weight: 600;
}

.blog-content table { width: 100%; border-collapse: collapse; margin: 32px 0; font-size: 15px; border: 1px solid #C8DAF2; border-radius: 12px; overflow: hidden; }
.blog-content figure.wp-block-table { margin: 32px 0; }
.blog-content figure.wp-block-table table { margin: 0; }
.blog-content thead th { background: #021F4B; color: #fff; font-weight: 700; text-align: left; padding: 14px 16px; font-size: 13px; letter-spacing: 0.02em; }
.blog-content tbody td { padding: 13px 16px; border-top: 1px solid #E3ECF7; color: #334155; vertical-align: top; }
.blog-content tbody tr:nth-child(even) td { background: #F7FAFE; }

.blog-content img { max-width: 100%; height: auto; border-radius: 12px; margin: 28px 0; display: block; }
.blog-content figure { margin: 28px 0; }
.blog-content figure img { margin: 0; }
.blog-content figcaption { font-size: 13px; color: #5A7090; margin-top: 8px; text-align: center; }

/* legacy callout boxes the content ships with */
.blog-content .takeaways, .blog-content .key-takeaways, .blog-content .highlight, .blog-content .highlight-box,
.blog-content .warning-box, .blog-content .success-box, .blog-content .case-study, .blog-content .cta-box, .blog-content .faq-item {
  background: #F4F8FD !important; border: 1px solid #C8DAF2 !important; border-left: 3px solid #7FFA7B !important;
  border-radius: 12px !important; padding: 22px 24px !important; margin: 28px 0 !important; color: #334155 !important;
}
.blog-content .warning-box { border-left-color: #F0B429 !important; }
.blog-content .takeaways *, .blog-content .highlight-box *, .blog-content .warning-box *, .blog-content .success-box *,
.blog-content .case-study *, .blog-content .cta-box *, .blog-content .faq-item * { color: inherit; }

/* ── Share row ────────────────────────────────────────────────────────── */
.blog-share { display: flex; align-items: center; gap: 10px; margin: 48px 0 0; padding-top: 28px; border-top: 1px solid #E3ECF7; }
.blog-share-label { font-family: 'Manrope', sans-serif; font-size: 13px; font-weight: 700; color: #021F4B; margin-right: 4px; }
.blog-share-btn { display: inline-flex; align-items: center; justify-content: center; min-width: 40px; height: 36px; padding: 0 14px; border-radius: 9999px; border: 1px solid #C8DAF2; background: #fff; color: #021F4B; font-family: 'Manrope', sans-serif; font-size: 12.5px; font-weight: 700; text-decoration: none; cursor: pointer; transition: border-color .15s, background-color .15s, color .15s; }
.blog-share-btn:hover { border-color: #7FFA7B; background: #7FFA7B; color: #021F4B; }
.blog-share-btn.copied { border-color: #7FFA7B; background: #7FFA7B; }

/* ── Author box ───────────────────────────────────────────────────────── */
.blog-author { display: flex; gap: 16px; align-items: flex-start; margin: 36px 0 0; padding: 24px; background: #F4F8FD; border: 1px solid #C8DAF2; border-radius: 16px; }
.blog-author-avatar { width: 56px; height: 56px; border-radius: 50%; flex-shrink: 0; }
.blog-author-name { font-family: 'Manrope', sans-serif; font-weight: 800; color: #021F4B; font-size: 16px; }
.blog-author-meta p { margin: 4px 0 0; font-size: 14px; line-height: 1.6; color: #5A7090; font-family: 'Manrope', sans-serif; }

/* ── Related posts ────────────────────────────────────────────────────── */
.blog-related { background: #F4F8FD; border-top: 1px solid #C8DAF2; padding: 56px 24px; }
.blog-related-inner { max-width: 1064px; margin: 0 auto; }
.blog-related-head { font-family: 'Manrope', sans-serif !important; color: #021F4B !important; font-weight: 800; font-size: 24px; letter-spacing: -0.02em; margin: 0 0 28px; }
.blog-related-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.blog-rel-card { display: flex; flex-direction: column; background: #fff; border: 1px solid #C8DAF2; border-radius: 16px; overflow: hidden; text-decoration: none; transition: transform .2s, box-shadow .2s; }
.blog-rel-card:hover { transform: translateY(-3px); box-shadow: 0 16px 36px rgba(2,31,75,0.10); }
.blog-rel-thumb { display: block; aspect-ratio: 16 / 9; background: #EDF3FB; overflow: hidden; }
.blog-rel-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.blog-rel-body { display: flex; flex-direction: column; gap: 8px; padding: 18px 20px 22px; }
.blog-rel-cat { font-family: 'Manrope', sans-serif; font-size: 10.5px; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; color: #5A7090; }
.blog-rel-title { font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 16px; line-height: 1.3; color: #021F4B; letter-spacing: -0.01em; }
.blog-rel-date { font-family: 'Manrope', sans-serif; font-size: 12.5px; color: #5A7090; margin-top: auto; }

/* ── End CTA ──────────────────────────────────────────────────────────── */
.blog-cta { padding: 56px 24px 72px; }
.blog-cta-inner { max-width: 720px; margin: 0 auto; background: #021F4B; border-radius: 20px; padding: 40px 36px; text-align: center; }
.blog-cta-eyebrow { font-family: 'Manrope', sans-serif; font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase; color: #7FFA7B; margin: 0 0 12px; }
.blog-cta h3 { font-family: 'Manrope', sans-serif !important; color: #fff !important; font-weight: 800; font-size: clamp(22px, 3vw, 30px); line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 10px; }
.blog-cta p { color: rgba(255,255,255,0.6); font-size: 15px; margin: 0 0 24px; }
.blog-cta a.blog-cta-btn { display: inline-flex; align-items: center; gap: 8px; background: #7FFA7B; color: #021F4B; font-family: 'Manrope', sans-serif; font-weight: 700; font-size: 14px; padding: 13px 28px; border-radius: 9999px; text-decoration: none; transition: transform .2s, background-color .2s, box-shadow .2s; }
.blog-cta a.blog-cta-btn:hover { background: #A3FBA0; transform: translateY(-2px); box-shadow: 0 8px 24px rgba(127,250,123,0.25); }

/* ── Back to top ──────────────────────────────────────────────────────── */
.blog-totop { position: fixed; right: 24px; bottom: 24px; width: 46px; height: 46px; border-radius: 50%; border: none; background: #021F4B; color: #fff; font-size: 20px; cursor: pointer; opacity: 0; visibility: hidden; transform: translateY(8px); transition: opacity .2s, transform .2s, background-color .2s; z-index: 60; box-shadow: 0 8px 24px rgba(2,31,75,0.25); }
.blog-totop.show { opacity: 1; visibility: visible; transform: translateY(0); }
.blog-totop:hover { background: #7FFA7B; color: #021F4B; }

/* ── Tablet / mobile ──────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .blog-body.has-toc { display: block; max-width: 720px; }
  .blog-toc { position: static; margin-bottom: 28px; border: 1px solid #C8DAF2; border-radius: 12px; background: #F7FAFE; }
  .blog-toc-toggle { display: flex; align-items: center; justify-content: space-between; width: 100%; padding: 14px 18px; background: none; border: none; font-family: 'Manrope', sans-serif; font-size: 14px; font-weight: 700; color: #021F4B; cursor: pointer; }
  .blog-toc-toggle::after { content: "▾"; color: #7FFA7B; transition: transform .2s; }
  .blog-toc.open .blog-toc-toggle::after { transform: rotate(180deg); }
  .blog-toc-panel { display: none; padding: 0 18px 16px; }
  .blog-toc.open .blog-toc-panel { display: block; }
  .blog-toc-label { display: none; }
}
@media (max-width: 768px) {
  .blog-hero { min-height: 280px; padding: 40px 20px 28px; }
  .blog-body { padding: 36px 20px 44px; }
  .blog-content { font-size: 16.5px; }
  .blog-content > p:first-child::first-letter { font-size: 52px; }
  .blog-related { padding: 40px 20px; }
  .blog-related-grid { grid-template-columns: 1fr; gap: 18px; }
  .blog-cta { padding: 36px 20px 56px; }
  .blog-cta-inner { padding: 32px 24px; }
  .blog-totop { right: 16px; bottom: 16px; }
  .blog-content table { font-size: 13.5px; }
  .blog-content thead th, .blog-content tbody td { padding: 10px 12px; }
}
