/*
 * NOTE: blog.css - listing and single post, proportioned like the reference blog:
 * 1280px editorial container, balanced typography, compact 16:9/16:10 imagery, and in-content CTAs.
 * ------------------------------------------------------------ */

.bl-page {
  background: var(--hm-paper);
  color: var(--hm-text);
}

.bl-page .hm-wrap {
  max-width: 1280px;
  padding-inline: clamp(16px, 2.5vw, 32px);
}

.bl-hero {
  padding: clamp(112px, 9vw, 138px) 0 clamp(24px, 3vw, 36px);
  background:
    radial-gradient(46% 80% at 50% 0%, rgba(37, 99, 255, 0.14), transparent 70%),
    linear-gradient(180deg, #eef4ff 0%, var(--hm-paper) 100%);
  text-align: center;
}

.bl-hero-in {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.bl-hero .hm-eyebrow {
  margin-bottom: 12px;
}

.bl-title {
  max-width: 18ch;
  margin: 0;
  font-size: clamp(30px, 3.4vw, 48px);
  font-weight: 800;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.bl-title .text-blue {
  background: var(--hm-grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.bl-lede {
  max-width: 62ch;
  margin: 14px 0 0;
  font-size: clamp(14.5px, 1.05vw, 16px);
  line-height: 1.65;
  color: var(--hm-muted);
}

.bl-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(520px, 100%);
  margin-top: 22px;
  padding: 5px 5px 5px 15px;
  border: 1px solid rgba(37, 99, 255, 0.16);
  border-radius: 999px;
  background: #fff;
  box-shadow: 0 14px 34px -22px rgba(20, 50, 140, 0.42);
}

.bl-search-ico {
  display: grid;
  flex: none;
  color: var(--hm-blue);
}

.bl-search-ico svg,
.bl-more svg {
  width: 15px;
  height: 15px;
}

.bl-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 14.5px;
  color: var(--hm-text);
}

.bl-search input:focus {
  outline: none;
}

.bl-search button {
  flex: none;
  padding: 10px 20px;
  border: 0;
  border-radius: 999px;
  background: var(--hm-blue);
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  font-weight: 700;
  cursor: pointer;
}

.bl-body {
  display: grid;
  gap: clamp(24px, 3vw, 36px);
  padding-bottom: clamp(48px, 6vw, 80px);
}

.bl-featured,
.bl-row {
  display: grid;
  align-items: center;
  gap: clamp(16px, 2vw, 28px);
  padding: clamp(12px, 1.2vw, 16px);
  border: 1px solid var(--hm-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--hm-shadow);
}

.bl-featured {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.bl-row {
  grid-template-columns: 230px minmax(0, 1fr);
}

.bl-featured-media,
.bl-row-media,
.bl-side-media {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 16px;
  background:
    radial-gradient(80% 80% at 30% 20%, rgba(34, 211, 238, 0.35), transparent 60%),
    linear-gradient(145deg, #123a9e, #2563ff 55%, #22d3ee);
  aspect-ratio: 16 / 10;
  max-height: 340px;
}

.bl-row-media {
  aspect-ratio: 16 / 10;
  max-height: 155px;
}

.bl-featured-media img,
.bl-row-media img,
.bl-side-media img,
.bl-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bl-ph {
  display: grid;
  place-items: center;
  width: 60px;
  height: 60px;
  border-radius: 16px;
  background: #fff;
}

.bl-ph img {
  width: 34px;
  height: 34px;
  object-fit: contain;
}

.bl-badge,
.bl-cat {
  display: inline-flex;
  align-items: center;
  padding: 5px 11px;
  border-radius: 999px;
  background: #111827;
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
}

.bl-featured-media .bl-badge {
  position: absolute;
  top: 12px;
  left: 12px;
}

.bl-cat {
  background: #eef3ff;
  color: var(--hm-blue);
}

.bl-kicker {
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--hm-blue);
}

.bl-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 10px 0 0;
  font-size: 13px;
  font-weight: 600;
  color: var(--hm-muted-2);
}

.bl-meta span[aria-hidden] {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}

.bl-featured-title,
.bl-row-title {
  margin: 8px 0 0;
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.bl-row-title {
  font-size: clamp(16.5px, 1.25vw, 19px);
}

.bl-featured-title a,
.bl-row-title a {
  color: var(--hm-text);
}

.bl-featured-title a:hover,
.bl-row-title a:hover,
.bl-more:hover {
  color: var(--hm-blue);
}

.bl-featured-excerpt,
.bl-row-excerpt {
  margin: 8px 0 0;
  font-size: 14.5px;
  line-height: 1.62;
  color: var(--hm-muted);
}

.bl-more {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 12px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--hm-text);
}

.bl-cats h2,
.bl-side-title {
  margin: 0 0 12px;
  font-size: 19px;
  font-weight: 800;
  letter-spacing: -0.025em;
}

.bl-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bl-pill {
  padding: 7px 14px;
  border: 1px solid var(--hm-line);
  border-radius: 999px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--hm-text);
}

.bl-pill.is-on,
.bl-pill:hover {
  border-color: transparent;
  background: var(--hm-blue);
  color: #fff;
}

.bl-rows {
  display: grid;
  gap: 14px;
}

.bl-rows:empty {
  display: none;
}

.bl-pager .page-numbers {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 8px 0 0;
}

.bl-pager a,
.bl-pager span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 38px;
  padding: 0 12px;
  border-radius: 10px;
  background: #fff;
  border: 1px solid var(--hm-line);
  font-size: 14px;
  font-weight: 700;
  color: var(--hm-text);
}

.bl-pager .current {
  border-color: transparent;
  background: var(--hm-blue);
  color: #fff;
}

.bl-empty {
  margin: 0;
  text-align: center;
  color: var(--hm-muted);
}

/* --- listing split + right promo card --- */
.bl-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  align-items: start;
  gap: clamp(18px, 2vw, 26px);
}

.bl-promo {
  position: sticky;
  top: 104px;
  padding: 22px;
  border-radius: 20px;
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(34, 211, 238, 0.35), transparent 60%),
    linear-gradient(160deg, #07184f 0%, #0b3bb8 55%, #1668ff 100%);
  color: #fff;
  box-shadow: 0 22px 46px -26px rgba(11, 59, 184, 0.78);
}

.bl-promo-title {
  margin: 0;
  font-size: clamp(20px, 1.5vw, 24px);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -0.025em;
}

.bl-promo-title em {
  font-style: normal;
  color: var(--gold-light);
}

.bl-promo p {
  margin: 10px 0 0;
  font-size: 14px;
  line-height: 1.58;
  color: rgba(255, 255, 255, 0.86);
}

.bl-promo-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--cta-grad);
  color: var(--cta-ink);
  font-size: 13.5px;
  font-weight: 800;
}

.bl-promo-btn svg {
  width: 15px;
  height: 15px;
}

.bl-promo ul {
  display: grid;
  gap: 10px;
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
}

.bl-promo li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.45;
}

.bl-promo li svg {
  flex: none;
  width: 15px;
  height: 15px;
  margin-top: 2px;
}

/* --- single post (matched to reference layout & typography) --- */
.bl-page-single {
  background: #fff;
}

.bl-single-head {
  padding: clamp(114px, 8.5vw, 134px) 0 28px;
  background: #fff;
  text-align: left;
}

.bl-single-title {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  line-height: 1.18;
  letter-spacing: -0.02em;
  color: #0d1526;
}

.bl-single-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  margin-top: 18px;
  font-size: 14px;
  font-weight: 400;
  line-height: 1.5;
  color: #2f3a4d;
}

.bl-meta-item {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
}

.bl-meta-item svg {
  flex: none;
  width: 15px;
  height: 15px;
  color: #5b677d;
}

.bl-meta-cat svg {
  color: #1668ff;
}

.bl-meta-cat:hover {
  color: #1668ff;
}

/* NOTE: exact 3-column editorial grid (280px TOC | 572px article | 300px sidebar inside 1280px). */
.bl-single-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr) 300px;
  align-items: start;
  gap: 32px;
  padding-bottom: 72px;
}

.bl-single-grid.no-toc {
  grid-template-columns: minmax(0, 1fr) 300px;
}

.bl-toc {
  position: sticky;
  top: 104px;
  max-height: calc(100vh - 128px);
  overflow-y: auto;
  padding: 20px;
  border: 1px solid #e6eaf1;
  border-radius: 12px;
  background: #fff;
}

.bl-toc p {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: #1668ff;
}

.bl-toc ol {
  display: grid;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bl-toc a {
  display: block;
  padding: 8px 12px;
  border-left: 3px solid transparent;
  border-radius: 0 8px 8px 0;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.45;
  color: #465064;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bl-toc a:hover,
.bl-toc a.is-active {
  border-left-color: #1668ff;
  background: #eef4ff;
  color: #1668ff;
  font-weight: 600;
}

.bl-toc .is-sub a {
  padding-left: 22px;
  font-size: 13.5px;
}

/* NOTE: featured cover matches reference 572x322 (16:9 inside the 572px article column). */
.bl-cover {
  margin: 0 0 24px;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  background: #e8effd;
}

.bl-content {
  font-size: 17px;
  font-weight: 400;
  line-height: 1.8;
  color: #1d1d1f;
}

.bl-content p {
  margin: 0 0 18px;
}

.bl-content h2,
.bl-content h3 {
  font-weight: 700;
  color: #0d1526;
  scroll-margin-top: 108px;
}

.bl-content h2 {
  margin: 28px 0 14px;
  font-size: 26px;
  line-height: 1.15;
  letter-spacing: -0.3px;
}

.bl-content h3 {
  margin: 22px 0 10px;
  font-size: 20px;
  line-height: 1.3;
  letter-spacing: -0.2px;
}

.bl-content a {
  color: #1668ff;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.bl-content ul,
.bl-content ol {
  margin: 0 0 18px 20px;
  padding-left: 16px;
}

.bl-content li {
  margin: 6px 0;
}

/* NOTE: in-content images fill the 572px article width with natural aspect ratio. */
.bl-content img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  margin: 20px 0;
  border-radius: 12px;
}

.bl-content figure {
  margin: 20px 0;
}

.bl-content figcaption {
  margin-top: 8px;
  font-size: 13.5px;
  text-align: center;
  color: #5b677d;
}

.bl-content blockquote {
  margin: 22px 0;
  padding: 14px 18px;
  border-left: 3px solid #1668ff;
  border-radius: 0 10px 10px 0;
  background: #f5f8ff;
  color: #0d1526;
}

.bl-table-wrap {
  width: 100%;
  margin: 18px 0 22px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}

.bl-content table {
  width: 100%;
  margin: 0;
  border-collapse: collapse;
  font-size: 15.5px;
  line-height: 1.6;
  color: #1d1d1f;
}

.bl-content th,
.bl-content td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid #e6eaf1;
}

.bl-content thead th,
.bl-content th {
  background: #d9edf7;
  color: #111;
  font-weight: 700;
}

/* --- in-content CTA banner (inserted via meta box, toolbar button, or [esf_cta]) --- */
.bl-inline-cta {
  margin: 36px 0;
  padding: 44px 30px;
  border-radius: 16px;
  background: #000;
  color: #fff;
  text-align: center;
}

.bl-inline-cta-title {
  max-width: 34ch;
  margin: 0 auto;
  font-size: clamp(20px, 1.7vw, 24px);
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -0.48px;
  color: #fff;
}

.bl-inline-cta-text {
  max-width: 46ch;
  margin: 10px auto 0;
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.8);
}

.bl-inline-cta-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-top: 24px;
  padding: 13px 26px;
  border-radius: 999px;
  background: var(--cta-grad);
  color: var(--cta-ink) !important;
  font-size: 15px;
  font-weight: 800;
  text-decoration: none !important;
  box-shadow: var(--cta-glow);
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.bl-inline-cta-btn:hover,
.bl-inline-cta-btn:focus-visible {
  background: #fff;
  color: #0d1526 !important;
  transform: translateY(-2px);
}

.bl-inline-cta-btn svg {
  width: 15px;
  height: 15px;
}

/* --- single sidebar --- */
.bl-side {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 20px;
}

.bl-panel {
  padding: 20px;
  border: 1px solid #e6eaf1;
  border-radius: 12px;
  background: #fff;
}

.bl-panel h2 {
  margin: 0 0 14px;
  font-size: 17px;
  font-weight: 700;
  color: #0d1526;
}

.bl-panel ul {
  display: grid;
  gap: 12px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.bl-panel li a {
  display: block;
  font-size: 15px;
  font-weight: 400;
  line-height: 1.5;
  color: #465064;
}

.bl-panel li a:hover {
  color: #1668ff;
}

.bl-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.bl-cloud a {
  padding: 6px 14px;
  border: 1px solid #e6eaf1;
  border-radius: 999px;
  background: #fff;
  font-size: 13.5px;
  font-weight: 500;
  color: #2f3a4d;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.bl-cloud a:hover {
  border-color: #1668ff;
  color: #1668ff;
}

/* --- related articles --- */
.bl-related {
  margin-top: 0;
  padding-top: 8px;
  padding-bottom: 80px;
}

.bl-related h2 {
  margin: 0 0 22px;
  font-size: clamp(22px, 1.9vw, 28px);
  font-weight: 800;
  letter-spacing: -0.025em;
  color: #0d1526;
}

.bl-related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.bl-rel {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid #e6eaf1;
  border-radius: 16px;
  background: #fff;
}

.bl-rel-media {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  background: linear-gradient(145deg, #123a9e, #2563ff 55%, #22d3ee);
}

.bl-rel-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.bl-rel-media .bl-badge {
  position: absolute;
  top: 10px;
  left: 10px;
}

.bl-rel-body {
  display: flex;
  flex-direction: column;
  flex: 1;
  padding: 14px 16px 16px;
}

.bl-rel-body h3 {
  margin: 6px 0 0;
  font-size: 15.5px;
  font-weight: 800;
  line-height: 1.35;
}

.bl-rel-body h3 a {
  color: var(--hm-text);
}

.bl-rel-body > p:last-of-type {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--hm-muted);
}

/* --- responsive --- */
@media (max-width: 1100px) {
  .bl-featured,
  .bl-split,
  .bl-single-grid,
  .bl-single-grid.no-toc {
    grid-template-columns: minmax(0, 1fr);
  }

  .bl-toc,
  .bl-side,
  .bl-promo {
    position: static;
  }

  .bl-toc {
    max-height: none;
    overflow: visible;
  }

  /* NOTE: flex children must stretch, otherwise the TOC and sidebar shrink to their text. */
  .bl-single-grid {
    display: flex;
    flex-direction: column;
    align-items: stretch;
  }

  .bl-side {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    align-items: start;
    gap: 14px;
    order: 3;
  }

  .bl-related-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .bl-row {
    grid-template-columns: minmax(0, 190px) minmax(0, 1fr);
  }

  .bl-side {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bl-side .bl-panel:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .bl-related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .bl-related-grid .bl-rel:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .bl-related-grid .bl-rel:last-child:nth-child(odd) .bl-rel-media {
    aspect-ratio: 21 / 9;
  }
}

@media (max-width: 640px) {
  .bl-search {
    flex-wrap: wrap;
    border-radius: 20px;
    padding: 10px;
  }

  .bl-search button {
    width: 100%;
  }

  .bl-row,
  .bl-side,
  .bl-related-grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .bl-featured-media,
  .bl-row-media {
    aspect-ratio: 16 / 9;
    max-height: 220px;
  }

  .bl-cover {
    aspect-ratio: 16 / 9;
    max-height: 240px;
  }

  .bl-content {
    font-size: 15.5px;
    line-height: 1.7;
  }

  .bl-inline-cta {
    padding: 20px 16px;
  }

  .bl-related-grid .bl-rel:last-child:nth-child(odd) .bl-rel-media {
    aspect-ratio: 16 / 9;
  }
}
