/* ============================================
 * blog-single-layout.css
 *
 * The blog single post's page-level scaffolding, ported from the
 * inline <style> block of the static preview-blog-single.html:
 *   - .blog-single-layout       — the 2-col rail + article grid
 *   - .blog-single-dock         — mobile bottom-left CONTENTS pill
 *   - .blog-single-sheet        — mobile TOC bottom sheet
 *
 * Module-layer file (loads after the shared layer). Enqueued by
 * single.php alongside the five blog-single module stylesheets.
 * ============================================ */

/* ===== Article layout grid ===== */

/* Top padding only — the related-articles section below carries its
   own padding-bottom, so the gap isn't double-stacked. */
.blog-single-layout {
  background: var(--color-white);
  padding-block: var(--space-section-y-mobile) 0;
}

/* News + Marketing Matters singles have NO related-articles section,
   so the article column (ending in the author bio) would butt straight
   up against the footer. Restore the missing bottom padding for those
   post types only. */
.single-news .blog-single-layout,
.single-marketing_matters .blog-single-layout {
  padding-bottom: var(--space-section-y-mobile);
}

.blog-single-layout__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.blog-single-layout__article {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  min-width: 0;
}

@media (min-width: 1024px) {
  .blog-single-layout {
    padding-block: var(--space-5xl) 0;
  }

  /* Desktop bottom padding for the no-related singles, matching the top. */
  .single-news .blog-single-layout,
  .single-marketing_matters .blog-single-layout {
    padding-bottom: var(--space-5xl);
  }

  /* No align-items:start — the rail track stretches to the article
     height so the sticky TOC inside it has scroll room. */
  .blog-single-layout__grid {
    grid-template-columns: 299px 1fr;
    gap: var(--space-5xl);
  }

  /* Article column fills its 1fr track so its right edge lines up
     with the navbar CTA / footer column edge. */
  .blog-single-layout__article {
    gap: var(--space-4xl);
  }
}

/* ===== Mobile bottom dock ===== */

/* Mirrors the scroll-top button on the right: same 24/32 offsets and
   48px height so the vertical centres align. Hidden ≥1024px (the rail
   TOC handles desktop). */
.blog-single-dock {
  position: fixed;
  left: var(--space-md);
  bottom: var(--space-md);
  z-index: 50;
  height: 48px;
  display: inline-flex;
  align-items: center;
  padding: 0 var(--space-md);
  background: var(--color-navy);
  color: var(--color-white);
  border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
}

@media (min-width: 1024px) {
  .blog-single-dock {
    display: none;
  }
}

.blog-single-dock__btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-xs);
  padding: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font-family: var(--font-sans);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  cursor: pointer;
  height: 100%;
}

/* ===== Mobile TOC sheet ===== */

/* Always in the DOM; data-open drives the animation. Visibility flips
   at the end of the close transition so a hidden sheet can't catch taps. */
.blog-single-sheet {
  position: fixed;
  inset: 0;
  background: rgba(9, 22, 59, 0);
  visibility: hidden;
  transition: background-color 220ms ease, visibility 0s linear 220ms;
  z-index: 60;
}

.blog-single-sheet[data-open] {
  background: rgba(9, 22, 59, 0.5);
  visibility: visible;
  transition: background-color 220ms ease, visibility 0s linear 0s;
}

.blog-single-sheet__panel {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--color-white);
  border-radius: 24px 24px 0 0;
  padding: var(--space-lg) var(--space-md) calc(var(--space-md) + env(safe-area-inset-bottom, 0px));
  max-height: 70svh;
  overflow-y: auto;
  transform: translateY(100%);
  transition: transform 280ms cubic-bezier(0.32, 0.72, 0, 1);
}

.blog-single-sheet[data-open] .blog-single-sheet__panel {
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .blog-single-sheet,
  .blog-single-sheet__panel {
    transition: none;
  }
}

.blog-single-sheet__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-md);
  margin: 0 0 var(--space-md) 0;
}

.blog-single-sheet__title {
  font-family: var(--font-sans);
  font-weight: var(--weight-bold);
  font-size: var(--text-sm);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-navy);
  margin: 0;
}

.blog-single-sheet__close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border: 0;
  background: transparent;
  color: var(--color-navy);
  cursor: pointer;
  flex-shrink: 0;
}

.blog-single-sheet__list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-left: 1px solid var(--color-navy-divider);
}

.blog-single-sheet__link {
  display: block;
  padding: var(--space-sm) 0 var(--space-sm) var(--space-md);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--color-navy-muted);
  text-decoration: none;
  position: relative;
}

.blog-single-sheet__link::before {
  content: "";
  position: absolute;
  left: -1px;
  top: 0;
  bottom: 0;
  width: 2px;
  background: transparent;
}

.blog-single-sheet__link--active {
  color: var(--color-navy);
  font-weight: 600;
}

.blog-single-sheet__link--active::before {
  background: var(--color-pink-stop);
}
