/* WZB 4.0.6 — ONE site shell + ONE reading rail.
 * Applied after the legacy segmented CSS, not to homepage or Elementor-only
 * layout internals. All article/hub/archive types share these measures.
 */
:root {
  --wzb-editorial-shell: 1200px;
  --wzb-editorial-reading: 960px;
  --wzb-editorial-gutter: 24px;
}

/* Same outer shell for legacy page, post, Pillar and archive templates. */
body:is(.single-post,.page,.archive) :is(.wzb-container,.wzb-archive-shell) {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wzb-editorial-shell);
  margin-inline: auto;
  padding-inline: var(--wzb-editorial-gutter);
}
/* Reading rail centered identically irrespective of outer template. */
body:is(.single-post,.page,.archive) :is(
  .wzb-single__header, .wzb-page__header,
  .wzb-single__content, .wzb-page__content,
  .wzb-single__thumbnail, .wzb-page__thumbnail,
  .wzb-pillar__content, .wzb-pillar-takeaways,
  .wzb-pillar .wzb-toc--auto, .wzb-pillar-faq,
  .wzb-archive__header
) {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wzb-editorial-reading) !important;
  margin-inline: auto !important;
}
/* Hero used to be ~1152px even when all its body elements measured 960px. */
body.page .wzb-pillar-hero > .wzb-pillar-hero__layout {
  box-sizing: border-box;
  max-width: calc(var(--wzb-editorial-reading) + 2 * var(--wzb-editorial-gutter));
  width: 100%;
  margin-inline: auto;
}
body.page .wzb-pillar-hero__layout--with-media {
  grid-template-columns: minmax(0,1.17fr) minmax(0,.83fr);
  column-gap: clamp(24px,3vw,42px);
}
body.page .wzb-pillar-hero__content { min-width: 0; }
body.page :is(.wzb-pillar-hero__title,.wzb-page__title),
body.single-post .wzb-single__title,
body.page .wzb-page__content.entry-content h1 {
  font-family: var(--wzb-font-head);
  font-size: clamp(30px,4.1vw,48px) !important;
  font-weight: 900;
  line-height: 1.14;
  letter-spacing: -.035em;
  overflow-wrap: break-word;
  color: var(--wzb-ink) !important;
}
body.page .wzb-pillar-hero { padding-block: clamp(36px,5vw,58px); }
body.page .wzb-pillar-hero__subtitle { font-size: 17px; line-height: 1.7; }
body:is(.single-post,.page) :is(.wzb-single__header,.wzb-page__header) { padding-top: 38px; }
body:is(.single-post,.page) :is(.wzb-single__thumbnail,.wzb-page__thumbnail) {
  margin-block: 22px 32px;
  overflow: hidden;
  border-radius: 12px;
}
body:is(.single-post,.page) :is(.wzb-single__thumbnail-img,.wzb-page__thumbnail-img) {
  width: 100%; height: auto; object-fit: cover;
}
/* Keep old freeform page content within the same rail; allow tables and media
 * to shrink without expanding the viewport. Embedded Elementor widgets are
 * left to their own responsive containers. */
body:is(.single-post,.page) :is(.wzb-single__content,.wzb-page__content,.wzb-pillar__content) { min-width: 0; }
body:is(.single-post,.page) :is(.wzb-single__content,.wzb-page__content,.wzb-pillar__content) :is(img,video,iframe,figure,table) { max-width: 100%; }
body:is(.single-post,.page) :is(.wzb-single__content,.wzb-page__content,.wzb-pillar__content) :is(pre,table,.wp-block-table) { overflow-x: auto; }
body:is(.single-post,.page) :is(.wzb-single__content,.wzb-page__content,.wzb-pillar__content) :is(.wzb-toc,.wzb-callout,.wzb-faq,.wzb-checklist,.wzb-note,.wzb-pillar-takeaways) {
  box-sizing: border-box;
  max-width: 100% !important;
  margin-inline: auto !important;
}
body:is(.single-post,.page) :is(.wzb-single__content,.wzb-page__content,.wzb-pillar__content) :is(.wzb-toc,.wzb-faq,.wzb-checklist,.wzb-callout,.wzb-note) { overflow-wrap: break-word; }
/* Normalise media and other old banner content without changing native image ratio. */
body.page .wzb-pillar-hero__media { border-radius: 12px; }
body.page .wzb-pillar-hero__image { aspect-ratio: 4/3; width: 100%; }
body.page .wzb-pillar-takeaways,
body.page .wzb-pillar .wzb-toc--auto { box-sizing: border-box; }
/* Consistent full-size section grids used at the end of topic hubs and posts. */
body.page :is(.wzb-pillar-grid,.wzb-editorial-browser__section) { max-width: 100%; margin: 46px auto; }
body.single-post .wzb-related { width: 100%; max-width: 100%; margin-inline: auto; }

/* Topic reading shelf, inserted into the actual hub content at run time. */
body.page .wzb-editorial-related {
  display: block;
  box-sizing: border-box;
  clear: both;
  width: 100%;
  max-width: var(--wzb-editorial-reading) !important;
  margin: 38px auto 42px !important;
  padding: 24px;
  border: 1px solid #dce3e8;
  border-left: 4px solid var(--wzb-signal,#ff5a1f);
  border-radius: 12px;
  background: #f7f9fa;
  color: #18232c !important;
}
body.page .wzb-editorial-related__head {
  display: grid; grid-template-columns: minmax(0,1fr) minmax(0,230px);
  align-items: end; gap: 18px; margin-bottom: 20px;
}
body.page .wzb-editorial-related__kicker {
  display: block; margin-bottom: 5px;
  color: #b63b14; text-transform: uppercase; letter-spacing: .11em;
  font-size: 10px; font-weight: 800;
}
body.page .entry-content .wzb-editorial-related h2,
body.page .wzb-editorial-related h2 {
  display: block; margin: 0 !important; padding: 0 !important;
  border: 0 !important; border-radius: 0 !important;
  background: transparent !important; box-shadow: none !important;
  font-size: clamp(21px,2.3vw,26px) !important;
  line-height: 1.2 !important; letter-spacing: -.025em;
  color: #18232c !important;
}
body.page .wzb-editorial-related h2::before,
body.page .wzb-editorial-related h2::after { content: none !important; display: none !important; }
body.page .wzb-editorial-related__head > p { margin: 0; font-size: 13px; color: #53616c; line-height: 1.55; }
body.page .wzb-editorial-related__grid { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px; }
body.page .wzb-editorial-related--count-1 .wzb-editorial-related__grid { grid-template-columns: minmax(0,1fr); }
body.page .wzb-editorial-related--count-2 .wzb-editorial-related__grid { grid-template-columns: repeat(2,minmax(0,1fr)); }
body.page .wzb-editorial-related__card {
  min-width: 0; overflow: hidden; display: flex; flex-direction: column;
  border: 1px solid #dfe5e9; border-radius: 10px; background: #fff;
}
body.page .wzb-editorial-related__image { display: block; width: 100%; background: #e5e9ec; text-decoration: none; }
body.page .wzb-editorial-related__image img,
body.page .wzb-editorial-related__placeholder { display: flex; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
body.page .wzb-editorial-related__placeholder { justify-content: center; align-items: center; font-family: var(--wzb-font-head); color: #71808b; font-size: 24px; font-weight: 900; }
body.page .wzb-editorial-related__body { display: flex; flex: 1; flex-direction: column; padding: 15px; }
body.page .wzb-editorial-related__card h3 {
  margin: 0 0 9px !important; padding: 0 !important; border: 0 !important;
  font-size: 16.5px !important; line-height: 1.35 !important;
  font-weight: 800; color: #1c2730 !important; overflow-wrap: anywhere;
}
body.page .wzb-editorial-related__card h3 a { color: inherit !important; text-decoration: none; }
body.page .wzb-editorial-related__card h3 a:hover { color: #b63b14 !important; }
body.page .wzb-editorial-related__body > p { margin: 0 0 16px; color: #52616c !important; line-height: 1.55; font-size: 13px; }
body.page .wzb-editorial-related__link { margin-top: auto; color: #aa3915; font-weight: 800; font-size: 12px; }
/* Single-story categories work as a composed image-and-text card. */
body.page .wzb-editorial-related--count-1 .wzb-editorial-related__card { flex-direction: row; }
body.page .wzb-editorial-related--count-1 .wzb-editorial-related__image { flex: 0 0 40%; }
body.page .wzb-editorial-related--count-1 .wzb-editorial-related__image img,
body.page .wzb-editorial-related--count-1 .wzb-editorial-related__placeholder { height: 100%; min-height: 166px; aspect-ratio: auto; }
body.page .wzb-editorial-related--count-1 .wzb-editorial-related__body { padding: 20px; }

body.page .wzb-editorial-browser { width: 100%; }
body.page .wzb-editorial-browser__section { border-top: 1px solid #e2e6e9; padding-top: 28px; }
body.page .wzb-editorial-browser__heading { margin-bottom: 20px; }
body.page .wzb-editorial-browser__heading h2 { margin: 5px 0 !important; padding: 0 !important; border: 0 !important; font-size: clamp(24px,3vw,30px) !important; background: transparent !important; }
body.page .wzb-editorial-browser__heading p { color: #59656d; font-size: 14px; margin: 0; }

@media (max-width: 900px) {
  body.page .wzb-pillar-hero__layout--with-media { grid-template-columns: 1fr; gap: 22px; }
  body.page .wzb-pillar-hero__media { max-width: 100%; }
}
@media (max-width: 760px) {
  :root { --wzb-editorial-gutter: 18px; }
  body.page .wzb-editorial-related { padding: 18px; margin-block: 30px !important; }
  body.page .wzb-editorial-related__head { display: block; }
  body.page .wzb-editorial-related__head > p { margin-top: 8px; }
  body.page .wzb-editorial-related__grid,
  body.page .wzb-editorial-related--count-2 .wzb-editorial-related__grid { grid-template-columns: 1fr; }
  body.page .wzb-editorial-related__card,
  body.page .wzb-editorial-related--count-1 .wzb-editorial-related__card { flex-direction: row; }
  body.page .wzb-editorial-related__image,
  body.page .wzb-editorial-related--count-1 .wzb-editorial-related__image { flex: 0 0 35%; }
  body.page .wzb-editorial-related__image img,
  body.page .wzb-editorial-related__placeholder { min-height: 144px; height: 100%; aspect-ratio: auto; }
  body.page .wzb-editorial-related__body,
  body.page .wzb-editorial-related--count-1 .wzb-editorial-related__body { padding: 12px; }
}
@media (max-width: 420px) {
  body.page .wzb-editorial-related__card,
  body.page .wzb-editorial-related--count-1 .wzb-editorial-related__card { flex-direction: column; }
  body.page .wzb-editorial-related__image,
  body.page .wzb-editorial-related--count-1 .wzb-editorial-related__image { flex-basis: auto; }
  body.page .wzb-editorial-related__image img,
  body.page .wzb-editorial-related__placeholder { aspect-ratio: 16/9; min-height: 0; height: auto; }
}

/* Elementor-built landing pages can intentionally contain full-width widgets;
 * keep that explicit builder contract instead of forcing a 960px widget rail. */
body.wzb-has-elementor-content:is(.page,.single-post) :is(.wzb-page__content,.wzb-single__content) {
  max-width: var(--wzb-editorial-shell) !important;
}

/* Related grids, rankings and intelligence blocks use the SAME visible rail as
 * the actual prose (instead of the old wider 1152px strip). */
body.page .wzb-pillar > .wzb-container > :is(
  .wzb-pillar-grid,.wzb-hub-intelligence,.wzb-hub-block,
  .wzb-hub-tools,.wzb-editorial-browser__section
),
body.page .wzb-editorial-browser__section,
body.single-post .wzb-related {
  box-sizing: border-box;
  width: 100%;
  max-width: var(--wzb-editorial-reading) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}
body.archive .wzb-archive-shell {
  max-width: calc(var(--wzb-editorial-reading) + 2 * var(--wzb-editorial-gutter)) !important;
}
