/* ====== WAG layout (scoped to posts) ====== */
:root{
  --wag-share: 48px;
  --wag-gap: 2rem;
  --wag-content: 700px;
  --wag-ad: 160px;
  --wag-header: 890px;
  --wag-sticky-header: 96px;
  --wag-header-bg: var(--section-bg, var(--color-bg-secondary, #f5f6f8));
  --wag-grid: calc(var(--wag-share) + var(--wag-gap) + var(--wag-content) + var(--wag-gap) + var(--wag-ad));
  --wag-hero-bg: var(--wag-header-bg, #f5f6f8);
}

/* Remove global section gap JUST on this template */
.wag-no-gap .section + .section{ margin-top:0 !important; padding-top:0 !important; }
.wag-no-gap .section{ --section-gap:0 !important; }

/* Header base + make it a full-width grey band */
.article-header.section[data-layout-grid="custom"]{
  display:block !important;
  background: var(--wag-hero-bg) !important;
  box-shadow:none !important;
  border:0 !important;
  margin:.5rem 0 0 0 !important;   /* no bottom margin */
  padding:.5rem 0 0 !important;    /* small top only */
  min-height:auto !important;
}

/* Header container matches grid and is centered */
.wag-header{
  width: var(--wag-grid) !important;
  max-width: var(--wag-grid) !important;
  margin-left:auto !important;
  margin-right:auto !important;
  box-sizing:border-box;
}

/* Headline/hero card */
.wag-header-card{
  background: transparent !important;
  border-radius: 0;
  padding: .75rem 0 1rem 0;
  overflow: hidden;
}
.wag-header .article-header__content{ margin-bottom:.5rem; }
.wag-header .article-header__title{ margin-top:0 !important; margin-bottom:.25rem !important; }
.wag-header .article-header__figure{ margin-top:.5rem; background:transparent !important; }
.wag-header .article-header__figure--16x9 > img{
  width:100% !important; height:auto; aspect-ratio:16/9; object-fit:cover; display:block;
}

/* Main area + grid */
.article-header.section + .article-main.section{ margin-top:0 !important; }
.article-main.section{ display:block !important; padding-top:0 !important; background:transparent !important; }

.wag-content-grid{
  width: var(--wag-grid);
  margin: 0 auto;
  display: grid !important;
  grid-template-columns: var(--wag-share) minmax(0, var(--wag-content)) var(--wag-ad) !important;
  column-gap: var(--wag-gap) !important;
  align-items: start;
  box-sizing: border-box;
  margin-top:.5rem !important;
}

.wag-content-grid .article-sharing{
  grid-column:1;
  position:sticky !important;
  top: calc(var(--wag-sticky-header) + 12px);
  align-self:start;
  width: var(--wag-share);
  margin:0;
  text-align:left !important;
}
.wag-content-grid .article-sharing *{ transform:none !important; }

.wag-content-grid .article-content__main{ grid-column:2; max-width: var(--wag-content); overflow-wrap:anywhere; }
.wag-content-grid .article-content__main > *{ max-width:100%; }
.wag-content-grid .article-content__main p,
.wag-content-grid .article-content__main ul,
.wag-content-grid .article-content__main ol,
.wag-content-grid .article-content__main figure,
.wag-content-grid .article-content__main img{ max-width:100%; height:auto; }

.wag-content-grid .article-content__ad-160x600{
  grid-column:3;
  position:sticky;
  top: calc(var(--wag-sticky-header) + 12px);
  width: var(--wag-ad);
  min-height:600px;
  justify-self:end;
}

.article-tags, .article-authors{ max-width: var(--wag-content); margin: 2rem auto 0; }
.article-authors{ margin-top:1.5rem; }
.article-newsletter{ display:none !important; }

/* ===== ID-scoped hero gap kill ===== */
#wag-hero{ padding-bottom:0 !important; margin-bottom:0 !important; min-height:auto !important; }
#wag-hero::before, #wag-hero::after{ content:none !important; display:none !important; }

/* kill the theme 16:9 padding shim */
#wag-hero .article-header__figure--16x9{ height:auto !important; min-height:0 !important; padding:0 !important; margin-bottom:0 !important; }
#wag-hero .article-header__figure--16x9::before{ content:none !important; display:none !important; padding:0 !important; }

/* keep image tidy */
#wag-hero .article-header__figure--16x9 > img{
  display:block; width:100% !important; height:auto !important;
  aspect-ratio:16/9; object-fit:cover; border-radius:12px;
}

/* Mobile */
@media (max-width: 980px){
  :root{ --wag-sticky-header: 0px; }
  .wag-header{ width:auto !important; max-width:none !important; padding:0 16px; }
  .wag-header-card{ padding:.75rem; }
  .wag-content-grid{ display:block !important; width: calc(100vw - 32px); }
  .wag-content-grid .article-content__ad-160x600{ position:static; margin-top:1.5rem; }
  .wag-content-grid .article-sharing{ position:static !important; width:auto; margin-bottom:1rem; }
}
/* Make the headline block the same width as the hero image */
#wag-hero .article-header__content{
  width: 100% !important;
  max-width: none !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
}

/* Remove theme max-widths on the actual text elements */
#wag-hero .article-header__title,
#wag-hero .article-header__excerpt,
#wag-hero .article-header__footer{
  max-width: none !important;
}

/* Optional: nicer line breaks on the big H1 */
#wag-hero .article-header__title{
  text-wrap: balance;
  line-height: 1.1;
}

/* === Force headline to full header width === */
#wag-hero .wag-header,
#wag-hero .wag-header-card{
  padding-left: 0 !important;
  padding-right: 0 !important;
}

#wag-hero .article-header__content{
  display: block !important;
  inline-size: 100% !important;      /* logical width */
  max-inline-size: none !important;   /* kill theme caps */
  width: 100% !important;             /* physical width, for older browsers */
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Remove any width caps on the text blocks themselves */
#wag-hero h1.article-header__title,
#wag-hero .article-header__excerpt,
#wag-hero .article-header__footer{
  max-inline-size: none !important;
  max-width: none !important;
  width: 100% !important;
}

/* Optional: nicer breaks for the big title */
#wag-hero h1.article-header__title{
  text-wrap: balance;
  line-height: 1.1;
}
/* ===== Final header sizing: band full-width, content at grid width ===== */

/* 1) Keep the grey band full-width, but remove any bottom gap */
#wag-hero{
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* 2) Constrain the inner header container to the grid width and center it */
#wag-hero .wag-header{
  width: var(--wag-grid) !important;
  max-width: var(--wag-grid) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 3) No side padding on the card so title width == image width */
#wag-hero .wag-header-card{
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 4) Let the headline/content blocks use the full container width */
#wag-hero .article-header__content,
#wag-hero .article-header__title,
#wag-hero .article-header__excerpt,
#wag-hero .article-header__footer{
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* 5) Image already stretches to container width; keep it tidy */
#wag-hero .article-header__figure--16x9 > img{
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* (Optional) nicer line breaks on big H1 */
#wag-hero .article-header__title{
  text-wrap: balance;
  line-height: 1.12;
}

/* === Make the headline span the same width as the image === */
#wag-hero .article-header__content{
  display:block !important;
  width:100% !important;
  max-width:none !important;
  padding-left:0 !important;
  padding-right:0 !important;
  margin-left:0 !important;
  margin-right:0 !important;
}

/* Uncap every direct child: H1, excerpt, footer/meta */
#wag-hero .article-header__content > *{
  width:100% !important;
  max-width:none !important;
  margin-left:0 !important;
  margin-right:0 !important;
  padding-left:0 !important;
  padding-right:0 !important;
}

/* Optional: tidy big-title wrapping */
#wag-hero h1.article-header__title{
  text-wrap: balance;
  line-height:1.12;
}
/* Beat ultra-specific theme selectors */
#wag-hero .wag-header > .wag-header-card > .article-header__content > h1.article-header__title{
  width:100% !important;
  max-width:none !important;
}
/* Make the title wrapper NOT create a box */
#wag-hero .article-header__content{
  display: contents !important;   /* children (H1/meta) now live in the parent box */
  container: none !important;     /* cancel container queries */
  max-width: none !important;
  width: auto !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Ensure the title/meta use the full header container width */
#wag-hero h1.article-header__title,
#wag-hero .article-header__excerpt,
#wag-hero .article-header__footer{
  width: 100% !important;
  max-width: none !important;
  margin-left: 0 !important;
  margin-right: 0 !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

/* Optional: nicer line breaks */
#wag-hero h1.article-header__title{
  text-wrap: balance;
  line-height: 1.12;
}
/* === WaG Hero headline + image alignment === */

/* Full-width grey band, no bottom padding/margin */
#wag-hero {
  background: var(--wag-hero-bg, #f5f6f8) !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
  border: 0 !important;
  box-shadow: none !important;
}

/* Inner container matches your 3-column grid width */
#wag-hero .wag-header {
  width: var(--wag-grid) !important;
  max-width: var(--wag-grid) !important;
  margin-left: auto !important;
  margin-right: auto !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  box-sizing: border-box;
}

/* No side padding on hero card */
#wag-hero .wag-header-card {
  background: transparent !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
  border-radius: 0;
  overflow: hidden;
}

/* New text wrapper fills full container width */
#wag-hero .wag-header__text {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Headline stretches full width and wraps nicely */
#wag-hero .wag-header__text h1.article-header__title {
  width: 100% !important;
  max-width: none !important;
  text-wrap: balance;
  line-height: 1.12;
  margin-top: 0;
  margin-bottom: .25rem;
}

/* Hero image keeps 16:9 ratio and rounded corners */
#wag-hero .article-header__figure--16x9 {
  border-radius: 12px !important;
  overflow: hidden !important;
  margin-top: .5rem;
  margin-bottom: 0 !important;
}
#wag-hero .article-header__figure--16x9 > img {
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: 12px !important;
}

/* Remove extra space below hero section */
#wag-hero + .article-main.section {
  padding-top: 0 !important;
  margin-top: 0 !important;
}

/* Mobile adjustments */
@media (max-width: 980px) {
  #wag-hero .wag-header {
    width: auto !important;
    max-width: none !important;
    padding: 0 16px;
  }
  #wag-hero .wag-header-card {
    padding: .75rem;
  }
}
/* ===== Hard kill the space under the hero (scoped to post template) ===== */

/* 0) Make sure our template disables any global .section gap */
.article.wag-no-gap .section + .section { margin-top:0 !important; padding-top:0 !important; }
.article.wag-no-gap .section { --section-gap:0 !important; }
.article.wag-no-gap { row-gap:0 !important; gap:0 !important; }

/* 1) The header section itself must not add space */
#wag-hero{
  padding-bottom:0 !important;
  margin-bottom:0 !important;
  min-height:0 !important;
}
#wag-hero::before,
#wag-hero::after{ content:none !important; display:none !important; }

/* 2) The figure must not create a phantom box (ratio shim/padding/margins) */
#wag-hero .article-header__figure,
#wag-hero .article-header__figure--16x9{
  margin-bottom:0 !important;
  padding-bottom:0 !important;
  height:auto !important;
  min-height:0 !important;
}
#wag-hero .article-header__figure--16x9::before,
#wag-hero .article-header__figure--16x9::after{
  content:none !important;
  display:none !important;
  padding:0 !important;
}

/* 3) The band below must not add a top gap */
#wag-hero + .article-main.section{
  margin-top:0 !important;
  padding-top:0 !important;
}

/* 4) Belt-and-braces: the card itself shouldn’t add bottom padding */
#wag-hero .wag-header-card{ padding-bottom:.25rem !important; }

/* --- Remove the fake height under the hero image (ratio shim) --- */
#wag-hero figure.article-header__figure.article-header__figure--16x9{
  padding: 0 !important;
  margin: .5rem 0 0 0 !important;  /* top only, no bottom */
  height: auto !important;
  min-height: 0 !important;
  aspect-ratio: 16/9;              /* let the browser handle the ratio */
  overflow: hidden !important;     /* keeps corners tidy if rounded elsewhere */
}

/* Nuke the theme's ::before padding box */
#wag-hero figure.article-header__figure.article-header__figure--16x9::before{
  content: none !important;
  display: none !important;
  padding: 0 !important;
}

/* Make sure the image itself isn’t forcing extra space */
#wag-hero figure.article-header__figure.article-header__figure--16x9 > img{
  display: block;
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 16/9;
  object-fit: cover;
}

/* Ensure the section below sits flush */
#wag-hero + .article-main.section{
  margin-top: 0 !important;
  padding-top: 0 !important;
}
/* === Custom Hero Image & Text Spacing === */
.article-header__figure {
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .article-header__figure {
        margin-bottom: 1.25rem;
    }
}

.post-content > p:first-of-type {
    margin-top: 2rem;
}

@media (max-width: 768px) {
    .post-content > p:first-of-type {
        margin-top: 1.25rem;
    }
}

