/* ==========================================================================
   Blog — public reader (shell, hero, column layouts, index cards)
   ========================================================================== */

:root {
  /* Centered public shell (used with body.full-bleed / @full_bleed) */
  --blog-shell-max: 100rem;       /* ~1152px — try 64rem if still wide */
  --blog-shell-pad-x: 1.5rem;
  --blog-hero-text-max: 42rem;
  --blog-cover-max: 48rem;

  /* Column layouts */
  --blog-gap: 3rem;
  --blog-main-max: 40rem;
  --blog-2col-main: 4fr;
  --blog-2col-margin: 1fr;
  --blog-3col-side: 1fr;
  --blog-3col-main: 3fr;

  /* Fonts */
  --blog-font-sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --blog-font-serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
}

/* ==========================================================================
   Page shell — balanced horizontal centering (public blog only)
   ========================================================================== */

.blog-shell {
  width: 100%;
  max-width: var(--blog-shell-max);
  margin-left: auto;
  margin-right: auto;
  padding: .10rem var(--blog-shell-pad-x) 3rem;
  box-sizing: border-box;
  font-family: var(--blog-font-sans);
}

.blog-shell--index {
  max-width: 75rem;
}

/* ==========================================================================
   Post hero (HappyRobot-inspired top)
   ========================================================================== */

.blog-hero {
  width: 100%;
  max-width: none;
  margin: 0 0 2.5rem;
  text-align: center;
  font-family: var(--blog-font-serif);
  font-weight: 500;          /* HR titles often aren’t ultra-bold */
  letter-spacing: -0.02em;
  line-height: 1.12;
}

/* Crumbs left-aligned within the same centered text column as the title */
.blog-hero__breadcrumb {
  max-width: var(--blog-hero-text-max);
  margin: 0 auto 1.5rem;
  text-align: left;
}

.blog-hero__breadcrumb-list {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem 0.5rem;
  list-style: none;
  margin: 0;
  padding: 0;
  font-size: 0.875rem;
  color: #6c757d;
}

.blog-hero__breadcrumb-link {
  color: #6c757d;
  text-decoration: none;
}

.blog-hero__breadcrumb-link:hover {
  color: var(--primary-bg-color, #14679f);
  text-decoration: underline;
}

.blog-hero__breadcrumb-sep {
  color: #adb5bd;
  user-select: none;
}

.blog-hero__breadcrumb-current {
  color: #495057;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.blog-hero__text {
  max-width: var(--blog-hero-text-max);
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 2rem;
}

.blog-hero__title {
  margin: 0 0 1rem;
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #1a1a1a;
}

.blog-hero__subtitle {
  margin: 0 auto 1.5rem;
  max-width: 36rem;
  font-size: 1.05rem;
  line-height: 1.55;
  color: #5c5c5c;
  font-family: var(--blog-font-sans);
  font-weight: 400;
}

.blog-hero__meta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.blog-hero__avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
}

.blog-hero__avatar--fallback {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-bg-color, #14679f);
  color: #fff;
  font-size: 0.95rem;
  font-weight: 600;
}

.blog-hero__meta-text {
  display: inline-flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 0.5rem;
  font-size: 0.95rem;
  color: #495057;
}

.blog-hero__author {
  font-weight: 600;
  color: #212529;
}

.blog-hero__meta-dot {
  color: #adb5bd;
}

.blog-hero__published-label {
  color: #6c757d;
}

.blog-hero__published time {
  color: #495057;
}

.blog-hero__cover {
  margin: 0 auto 1.25rem;
  max-width: var(--blog-cover-max);
  border-radius: 0.5rem;
  overflow: hidden;
  background: #f1f3f5;
}

.blog-hero__cover-img {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(24rem, 50vh);
  object-fit: cover;
  object-position: center;
}

.blog-hero__page-label {
  margin: 0.5rem 0 0;
  font-size: 0.9rem;
}

.blog-post > .blog-page-layout {
  margin-top: 0.75rem;
  width: 100%;
}

@media (max-width: 575.98px) {
  .blog-hero__breadcrumb-current {
    white-space: normal;
  }

  .blog-hero__cover-img {
    max-height: 16rem;
  }
}

/* ==========================================================================
   Column layouts (main_only / two_left / two_right / three)
   ========================================================================== */

.blog-page-layout {
  display: grid;
  gap: var(--blog-gap);
  align-items: start;
  width: 100%;
}

.blog-main {
  min-width: 0; /* prevent grid blowout from wide images/pre */
}

.blog-main-content {
  max-width: var(--blog-main-max);
  font-family: var(--blog-font-sans);
  font-size: 1.0625rem;      /* ~17px */
  line-height: 1.75;
  color: #1f2937;
}
/* Headings inside Action Text body */
.blog-main-content h1,
.blog-main-content h2,
.blog-main-content h3,
.blog-main-content h4 {
  font-family: var(--blog-font-serif);
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
  color: #111;
}

.blog-main-content h2 {
  margin-top: 2rem;
  margin-bottom: 0.75rem;
  font-size: 1.5rem;
}

.blog-main-content h3 {
  margin-top: 1.5rem;
  margin-bottom: 0.5rem;
  font-size: 1.25rem;
}

.blog-main-content p {
  margin-bottom: 1.1rem;
}

.blog-main-content a {
  color: var(--primary-bg-color, #14679f);
}

.blog-main-content > *:last-child {
  margin-bottom: 0;
}

.blog-main-content img,
.blog-main-content video {
  max-width: 100%;
  height: auto;
}

.blog-main-content figure {
  margin: 1.25rem 0;
}

.blog-main-content pre {
  max-width: 100%;
  overflow-x: auto;
}

.blog-margin {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

/* ---------- Margin cards ---------- */

.blog-margin-card,
.blog-hero__meta,
.blog-hero__breadcrumb {
  font-family: var(--blog-font-sans);
  overflow: hidden;
  background: #fff;
}

.blog-margin-card__media {
  width: 100%;
  height: auto;
  display: block;
}

.blog-margin-card__embed iframe {
  border: 0;
  width: 100%;
  height: 100%;
}

.blog-margin-card__caption {
  line-height: 1.4;
}

/* ---------- Desktop / large tablet: real columns ---------- */

@media (min-width: 992px) {
  .blog-page-layout--main_only {
    grid-template-columns: minmax(0, 1fr);
    max-width: var(--blog-main-max);
    margin-inline: auto;
  }

  .blog-page-layout--main_only .blog-main-content {
    max-width: none;
  }

  /* main + right ≈ 80/20 */
  .blog-page-layout--two_right {
    grid-template-columns:
      minmax(0, var(--blog-2col-main))
      minmax(12rem, var(--blog-2col-margin));
    grid-template-areas: "main right";
  }

  .blog-page-layout--two_right .blog-main {
    grid-area: main;
  }

  .blog-page-layout--two_right .blog-margin--right {
    grid-area: right;
  }

  /* left + main ≈ 20/80 */
  .blog-page-layout--two_left {
    grid-template-columns:
      minmax(12rem, var(--blog-2col-margin))
      minmax(0, var(--blog-2col-main));
    grid-template-areas: "left main";
  }

  .blog-page-layout--two_left .blog-margin--left {
    grid-area: left;
  }

  .blog-page-layout--two_left .blog-main {
    grid-area: main;
  }

  /* left + main + right ≈ 20/60/20 */
  .blog-page-layout--three {
    grid-template-columns:
      minmax(11rem, var(--blog-3col-side))
      minmax(0, var(--blog-3col-main))
      minmax(11rem, var(--blog-3col-side));
    grid-template-areas: "left main right";
  }

  .blog-page-layout--three .blog-margin--left {
    grid-area: left;
  }

  .blog-page-layout--three .blog-main {
    grid-area: main;
  }

  .blog-page-layout--three .blog-margin--right {
    grid-area: right;
  }

  /* Main uses full grid cell in multi-col layouts */
  .blog-page-layout--two_left .blog-main-content,
  .blog-page-layout--two_right .blog-main-content,
  .blog-page-layout--three .blog-main-content {
    max-width: none;
  }

  .blog-margin-card {
    position: relative;
  }
}

/* ---------- Below lg: single column, MAIN FIRST ---------- */

@media (max-width: 991.98px) {
  .blog-page-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .blog-page-layout .blog-main {
    order: 1;
  }

  .blog-page-layout .blog-margin--left {
    order: 2;
  }

  .blog-page-layout .blog-margin--right {
    order: 3;
  }

  .blog-main-content {
    max-width: none;
  }
}

/* ==========================================================================
   Blog index cards
   ========================================================================== */

.blog-index-card {
  transition: transform 0.15s ease, box-shadow 0.15s ease;
  overflow: hidden;
}

.blog-index-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.5rem 1rem rgba(0, 0, 0, 0.1) !important;
}

.blog-index-cover {
  height: 180px;
  object-fit: cover;
  width: 100%;
}

.blog-index-cover-placeholder {
  height: 180px;
  background: linear-gradient(135deg, #e9ecef, #ced4da);
}