/* ==============================================================
   FORMAL REPORT — template-report.php

   Loaded only on posts using the "Formal Report" template, after
   journal.css and before style.css (see inc/enqueue.php).

   Everything inside .iw-rpt-body is styled from plain elements —
   h2, h3, h4, p, ul, ol, table, blockquote, hr, figure — so content
   pasted from Word or Google Docs needs no classes. The optional
   components at the end (.iw-rpt-summary, .iw-rpt-callout …) are
   for authors who want more.

   Palette, font and radii are the theme's own tokens.
   ============================================================== */

.iw-rpt {
  --rpt-measure: 76ch;
  --rpt-rail: 270px;
  --rpt-gap: 40px;
  background: var(--iw-bg);
}

.iw-rpt-wrap {
  max-width: var(--iw-max-width);
  margin: 0 auto;
  padding: 0 var(--iw-pad);
}

/* ══════════════════════════════════════════
   COVER
   ══════════════════════════════════════════ */
.iw-rpt-cover {
  position: relative;
  background:
    radial-gradient(circle at 88% 12%, rgba(234,88,12,.20), transparent 42%),
    radial-gradient(circle at 8% 100%, rgba(124,58,237,.22), transparent 45%),
    var(--iw-navy);
  color: #fff;
  padding: 34px 0 0;
  overflow: hidden;
}
/* Faint ruled-paper texture — a document, not a banner */
.iw-rpt-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 100% 28px;
  pointer-events: none;
}
.iw-rpt-cover .iw-rpt-wrap { position: relative; }

.iw-rpt-crumbs .iw-breadcrumbs,
.iw-rpt-crumbs .iw-breadcrumbs a,
.iw-rpt-crumbs .iw-breadcrumbs span { color: rgba(255,255,255,.62); }
.iw-rpt-crumbs .iw-breadcrumbs { margin-bottom: 26px; font-size: 12.5px; }
.iw-rpt-crumbs .iw-breadcrumbs a:hover { color: #fff; }

.iw-rpt-eyebrow {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  margin-bottom: 16px;
}
.iw-rpt-eyebrow i { width: 26px; height: 2px; background: var(--iw-orange); display: block; }
.iw-rpt-type {
  color: var(--iw-navy);
  background: var(--iw-yellow);
  padding: 4px 10px;
  border-radius: var(--iw-radius-xs);
}
.iw-rpt-eyebrow a { color: rgba(255,255,255,.85); }
.iw-rpt-eyebrow a:hover { color: var(--iw-yellow); }
.iw-rpt-dot {
  width: 4px; height: 4px; border-radius: 50%;
  background: currentColor; opacity: .5; display: inline-block;
}

.iw-rpt-kicker {
  font-size: 14px;
  font-weight: 500;
  color: var(--iw-yellow);
  margin-bottom: 8px;
  letter-spacing: .2px;
}
.iw-rpt-title {
  color: #fff;
  font-size: clamp(28px, 4.6vw, 52px);
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -.03em;
  max-width: 22ch;
  margin-bottom: 18px;
}
.iw-rpt-standfirst {
  font-size: clamp(15.5px, 1.6vw, 18px);
  line-height: 1.65;
  color: rgba(255,255,255,.82);
  max-width: 64ch;
  margin-bottom: 26px;
}

.iw-rpt-byline { display: flex; align-items: center; gap: 14px; margin-bottom: 24px; }
.iw-rpt-byline img { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.35); }
.iw-rpt-by { font-size: 14px; font-weight: 600; color: #fff; }
.iw-rpt-by a { color: #fff; text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(255,255,255,.4); }
.iw-rpt-by a:hover { text-decoration-color: var(--iw-orange); }
.iw-rpt-dates { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 12.5px; color: rgba(255,255,255,.65); margin-top: 2px; }

.iw-rpt-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 30px; }
.iw-rpt-actions .iw-jbtn { padding: 12px 22px; font-size: 13.5px; border: 0; cursor: pointer; font-family: inherit; }
.iw-rpt-btn-light { border: 1.5px solid rgba(255,255,255,.4) !important; color: #fff; }
.iw-rpt-btn-light:hover { background: #fff; color: var(--iw-navy); }
.iw-rpt-share { margin: 0 0 0 auto; display: flex; flex-wrap: wrap; gap: 8px; }
.iw-rpt-share .iw-share-btn {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: var(--iw-radius-xs);
  border: 1px solid rgba(255,255,255,.28);
  background: rgba(255,255,255,.06);
  color: #fff;
  cursor: pointer;
}
.iw-rpt-share .iw-share-btn:hover { background: #fff; color: var(--iw-navy); border-color: #fff; }

/* Facts strip, sitting on the cover's bottom edge */
.iw-rpt-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  border-top: 1px solid rgba(255,255,255,.16);
  margin: 0;
}
.iw-rpt-facts > div { padding: 16px 18px 18px 0; }
.iw-rpt-facts > div + div { padding-left: 18px; border-left: 1px solid rgba(255,255,255,.12); }
.iw-rpt-facts dt {
  font-size: 10.5px; font-weight: 700; letter-spacing: 1.4px;
  text-transform: uppercase; color: rgba(255,255,255,.55);
}
.iw-rpt-facts dd { margin: 4px 0 0; font-size: 20px; font-weight: 800; color: #fff; }

/* ══════════════════════════════════════════
   LAYOUT — contents rail + document
   ══════════════════════════════════════════ */
.iw-rpt-layout {
  display: grid;
  grid-template-columns: var(--rpt-rail) minmax(0, 1fr);
  gap: var(--rpt-gap);
  align-items: start;
  padding-top: 40px;
  padding-bottom: 60px;
}
/* No rail (short report): the document takes the full width */
.iw-rpt-layout > .iw-rpt-doc:only-child { grid-column: 1 / -1; max-width: 920px; margin: 0 auto; width: 100%; }

.iw-rpt-rail {
  position: sticky;
  top: 100px;
  max-height: calc(100vh - 120px);
  overflow-y: auto;
  scrollbar-width: thin;
}
.iw-rpt-contents > summary {
  list-style: none;
  cursor: pointer;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.6px;
  text-transform: uppercase;
  color: var(--iw-muted);
  padding: 0 0 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.iw-rpt-contents > summary::-webkit-details-marker { display: none; }
.iw-rpt-contents > summary::after {
  content: "";
  width: 8px; height: 8px;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(45deg);
  transition: transform var(--iw-t);
}
.iw-rpt-contents[open] > summary::after { transform: rotate(-135deg); }
.iw-rpt-rail .iw-toc { margin: 0; padding: 16px 18px; background: #fff; }
.iw-rpt-rail .iw-toc-item--h2 > a { font-weight: 600; color: var(--iw-navy); }
.iw-rpt-rail .iw-toc-item--h2 + .iw-toc-item--h2 { margin-top: 4px; }
.iw-rpt-rail .iw-toc-item--h3 a { padding-left: 24px; font-size: 12.5px; }
.iw-rpt-rail .iw-toc-item--h4 { display: none; }

/* The document card */
.iw-rpt-doc {
  background: #fff;
  border: 1px solid var(--iw-border);
  border-radius: var(--iw-radius);
  box-shadow: var(--iw-shadow-sm);
  padding: 44px 52px 40px;
  min-width: 0;
}
.iw-rpt-figure { margin: -44px -52px 34px; }
.iw-rpt-figure img { width: 100%; height: auto; display: block; border-radius: var(--iw-radius) var(--iw-radius) 0 0; }
.iw-rpt-figure figcaption { font-size: 12.5px; color: var(--iw-muted); padding: 8px 52px 0; }

/* ══════════════════════════════════════════
   BODY — automatic formatting of plain content
   ══════════════════════════════════════════ */
.iw-rpt-body {
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--iw-gray-900);
  counter-reset: rpt-h2 rpt-h3;
  overflow-wrap: break-word;   /* long URLs and words never widen the page */
}
.iw-rpt-body > * { max-width: var(--rpt-measure); }
/* Elementor lays out its own sections and columns: no reading-width cap
   on the layout, only on running text inside Text Editor widgets. */
.iw-rpt-body--el > * { max-width: none; }
.iw-rpt-body > .iw-rpt-table,
.iw-rpt-body > figure,
.iw-rpt-body > .wp-block-table,
.iw-rpt-body > .iw-quiz,
.iw-rpt-body > .iw-rpt-takeaways,
.iw-rpt-body > .iw-rpt-findings { max-width: none; }

.iw-rpt-body p { margin: 0 0 1.25em; }
.iw-rpt-body > :first-child { margin-top: 0; }

/* Anchors land below the sticky header */
.iw-rpt-body [id] { scroll-margin-top: 110px; }

/* ── Headings ──
   Content headings only: no class (classic editor, Elementor Text
   Editor), the block editor's .wp-block-heading, or Elementor's Heading
   widget. A heading with any other class is a widget's own title (icon
   box, post grid, quiz) and keeps its design. Mirrors
   iw_is_content_heading() in inc/article-tools.php.

   counter-SET, not counter-reset, on h2: in Elementor every heading sits
   in its own widget, so h3 is not a sibling of h2 and a reset scoped to
   the h2 would never reach it — every sub-section would number "x.1". */
.iw-rpt-body :is(h2:not([class]), h2[class="iw-rpt-numbered"], h2.wp-block-heading, h2.elementor-heading-title) {
  font-family: var(--iw-font);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 800;
  line-height: 1.25;
  color: var(--iw-navy);
  margin: 2.4em 0 .7em;
  padding: 0 0 12px;
  border-bottom: 2px solid var(--iw-navy);
  display: block;            /* text flow, not flex: on a phone a long
                                heading wraps BESIDE its number badge
                                instead of dropping under it */
  counter-increment: rpt-h2;
  counter-set: rpt-h3 0;
}
.iw-rpt-body :is(h3:not([class]), h3[class="iw-rpt-numbered"], h3.wp-block-heading, h3.elementor-heading-title) {
  font-family: var(--iw-font);
  font-size: clamp(17.5px, 1.9vw, 19.5px);
  font-weight: 700;
  line-height: 1.3;
  color: var(--iw-navy);
  margin: 1.9em 0 .55em;
  display: block;
  counter-increment: rpt-h3;
}
.iw-rpt-body :is(h4:not([class]), h4.wp-block-heading, h4.elementor-heading-title) {
  font-family: var(--iw-font);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: 1.2px;
  text-transform: uppercase;
  color: var(--iw-orange-t);
  margin: 1.7em 0 .5em;
}
.iw-rpt-body :is(h5:not([class]), h6:not([class]), h5.wp-block-heading, h6.wp-block-heading) { font-size: 15px; font-weight: 700; margin: 1.4em 0 .4em; }

/* Number badge — numbers already in the heading text ("2.1 …") */
.iw-rpt-num {
  display: inline-block;
  margin-right: .55em;
  vertical-align: .18em;
  font-size: .62em;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--iw-orange);
  padding: .45em .6em;
  border-radius: var(--iw-radius-xs);
  letter-spacing: 0;
}
.iw-rpt-body h3 .iw-rpt-num { background: transparent; color: var(--iw-orange-t); padding: 0; font-size: .85em; vertical-align: baseline; margin-right: .45em; }

/* Auto-numbering — "Auto-number sections" ticked in Report details.
   Skipped on headings that already carry their own number. */
.iw-rpt--autonum .iw-rpt-body :is(h2:not([class]), h2.wp-block-heading:not(.iw-rpt-numbered), h2.elementor-heading-title:not(.iw-rpt-numbered))::before {
  content: counter(rpt-h2);
  display: inline-block;
  margin-right: .55em;
  vertical-align: .18em;
  font-size: .62em;
  font-weight: 800;
  line-height: 1;
  color: #fff;
  background: var(--iw-orange);
  padding: .45em .6em;
  border-radius: var(--iw-radius-xs);
}
.iw-rpt--autonum .iw-rpt-body :is(h3:not([class]), h3.wp-block-heading:not(.iw-rpt-numbered), h3.elementor-heading-title:not(.iw-rpt-numbered))::before {
  content: counter(rpt-h2) "." counter(rpt-h3);
  margin-right: .45em;
  font-size: .85em;
  font-weight: 800;
  color: var(--iw-orange-t);
}
.iw-rpt--autonum .iw-rpt-rail .iw-toc-list { counter-reset: toc-h2; }
.iw-rpt--autonum .iw-rpt-rail .iw-toc-item--h2 { counter-increment: toc-h2; counter-reset: toc-h3; }
.iw-rpt--autonum .iw-rpt-rail .iw-toc-item--h3 { counter-increment: toc-h3; }
.iw-rpt--autonum .iw-rpt-rail .iw-toc-item--h2 > a::before { content: counter(toc-h2) ". "; color: var(--iw-orange-t); }
.iw-rpt--autonum .iw-rpt-rail .iw-toc-item--h3 > a::before { content: counter(toc-h2) "." counter(toc-h3) " "; }

/* ── Which lists are "content" lists ──
   Lists with NO class (classic editor, Elementor Text Editor widget),
   block-editor lists (.wp-block-list), and the report component lists.
   Lists that carry any other class belong to a widget — an Elementor
   icon list, menu, social icons, a form — and are left completely alone,
   or they would sprout diamonds and number circles. */

/* ── Bullet lists ── */
.iw-rpt-body :is(ul:not([class]), ul.wp-block-list, ul.iw-rpt-takeaways) {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4em;
}
.iw-rpt-body :is(ul:not([class]), ul.wp-block-list, ul.iw-rpt-takeaways) > li {
  position: relative;
  padding-left: 26px;
  margin-bottom: .7em;
}
.iw-rpt-body :is(ul:not([class]), ul.wp-block-list) > li::before {
  content: "";
  position: absolute;
  left: 4px;
  top: .72em;
  width: 8px; height: 8px;
  border-radius: 2px;
  background: var(--iw-orange);
  transform: rotate(45deg);
}
.iw-rpt-body li > :is(ul:not([class]), ul.wp-block-list) > li::before { background: transparent; border: 1.5px solid var(--iw-orange); border-radius: 50%; transform: none; }
.iw-rpt-body li > strong:first-child { color: var(--iw-navy); }

/* ── Numbered lists ── */
.iw-rpt-body :is(ol:not([class]), ol.wp-block-list, ol.iw-rpt-findings, ol.iw-rpt-timeline) {
  list-style: none;
  padding: 0;
  margin: 0 0 1.4em;
  counter-reset: rpt-ol;
}
.iw-rpt-body :is(ol:not([class]), ol.wp-block-list, ol.iw-rpt-findings, ol.iw-rpt-timeline) > li {
  position: relative;
  padding-left: 42px;
  margin-bottom: .8em;
  counter-increment: rpt-ol;
  min-height: 28px;
}
.iw-rpt-body :is(ol:not([class]), ol.wp-block-list, ol.iw-rpt-findings, ol.iw-rpt-timeline) > li::before {
  content: counter(rpt-ol);
  position: absolute;
  left: 0;
  top: .1em;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--iw-navy);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  line-height: 28px;
  text-align: center;
}
.iw-rpt-body li > :is(ol:not([class]), ol.wp-block-list) > li::before { background: var(--iw-gray-100); color: var(--iw-navy); }
.iw-rpt-body li > ul, .iw-rpt-body li > ol { margin: .6em 0 0; }

/* ── Tables ── */
.iw-rpt-table {
  margin: 1.8em 0 2em;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--iw-border);
  border-radius: var(--iw-radius);
  background: #fff;
}
.iw-rpt-table:focus-visible { outline: 2px solid var(--iw-orange); outline-offset: 2px; }
.iw-rpt-body table {
  display: table;          /* undo journal.css display:block — the wrapper scrolls instead */
  width: 100%;
  min-width: 560px;
  border-collapse: collapse;
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
}
.iw-rpt-body thead th {
  background: var(--iw-navy);
  color: #fff;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 1px;
  text-transform: uppercase;
  text-align: left;
  padding: 13px 16px;
  white-space: nowrap;
}
.iw-rpt-body tbody td,
.iw-rpt-body tbody th {
  padding: 13px 16px;
  border-top: 1px solid var(--iw-border);
  vertical-align: top;
  text-align: left;
}
.iw-rpt-body tbody tr:nth-child(even) { background: var(--iw-gray-50); }
.iw-rpt-body tbody tr:hover { background: var(--iw-peach); }
.iw-rpt-body tbody td:first-child,
.iw-rpt-body tbody th:first-child { font-weight: 700; color: var(--iw-navy); min-width: 150px; }
.iw-rpt-body table p { margin: 0; }

/* Block-editor Table block (<figure class="wp-block-table">): core adds a
   border on every cell and a 3px rule under the header — use ours. */
.iw-rpt-body .wp-block-table { margin: 1.8em 0 2em; }
.iw-rpt-body .wp-block-table .iw-rpt-table { margin: 0; }
.iw-rpt-body .wp-block-table thead { border-bottom: 0; }
.iw-rpt-body .wp-block-table th,
.iw-rpt-body .wp-block-table td { border: 0; border-top: 1px solid var(--iw-border); }
.iw-rpt-body .wp-block-table thead th { border-top: 0; }
.iw-rpt-body .wp-block-table figcaption { text-align: left; font-size: 12.5px; color: var(--iw-muted); margin-top: 8px; }

/* Group-block boxes keep their padding even with the inner container
   older WordPress versions add around the children. */
.iw-rpt-body .wp-block-group__inner-container > :first-child { margin-top: 0; }
.iw-rpt-body .wp-block-group__inner-container > :last-child { margin-bottom: 0; }
.iw-rpt-body caption { caption-side: bottom; font-size: 12.5px; color: var(--iw-muted); padding: 10px 16px; text-align: left; }

/* ── Quotes, rules, media, code ── */
/* Plain and block-editor quotes only — a quote widget with its own
   classes (e.g. Elementor's blockquote) keeps its own design. */
.iw-rpt-body :is(blockquote:not([class]), blockquote.wp-block-quote) {
  margin: 1.8em 0;
  padding: 18px 24px;
  border-left: 4px solid var(--iw-orange);
  background: var(--iw-peach);
  border-radius: 0 var(--iw-radius) var(--iw-radius) 0;
  font-size: 17px;
  color: var(--iw-gray-700);
}
.iw-rpt-body blockquote p:last-child { margin-bottom: 0; }
.iw-rpt-body blockquote cite { display: block; margin-top: 8px; font-size: 13px; font-style: normal; font-weight: 600; color: var(--iw-muted); }
.iw-rpt-body hr { border: 0; height: 1px; background: var(--iw-border); margin: 2.4em 0; }
.iw-rpt-body img { max-width: 100%; height: auto; border-radius: var(--iw-radius-sm); }
/* Plain and block-editor figures; an Elementor image widget spaces itself. */
.iw-rpt-body :is(figure:not([class]), figure[class*="wp-block-"]) { margin: 1.8em 0; }
.iw-rpt-body figcaption { font-size: 12.5px; color: var(--iw-muted); margin-top: 8px; }
.iw-rpt-body code { background: var(--iw-gray-100); padding: 2px 6px; border-radius: 4px; font-size: .9em; }
/* Text links only. Links with a class are buttons, cards and icons —
   an Elementor button would otherwise get orange underlined text on an
   orange background. */
.iw-rpt-body a:not([class]) { color: var(--iw-orange-t); text-decoration: underline; text-underline-offset: 3px; }
.iw-rpt-body a:not([class]):hover { color: var(--iw-navy); }
.iw-rpt-body dl { margin: 0 0 1.4em; }
.iw-rpt-body dt { font-weight: 700; color: var(--iw-navy); margin-top: .8em; }
.iw-rpt-body dd { margin: .2em 0 0 0; padding-left: 16px; border-left: 2px solid var(--iw-border); }

/* ══════════════════════════════════════════
   OPTIONAL COMPONENTS — add the class in the Code/Text editor
   ══════════════════════════════════════════ */

/* Each component works three ways:
     block editor  → class on the List / Group block itself
     classic / HTML → <ol class="iw-rpt-findings"> etc.
     Elementor     → class in Advanced → CSS Classes, which lands on the
                     widget's WRAPPER, so the list is a descendant:
                     .iw-rpt-findings ol
   The ".iw-rpt-body" prefix lifts the boxes above Elementor's default
   container/widget padding while staying below any per-widget style the
   author sets in Elementor, which always wins. */

/* Executive summary panel */
.iw-rpt-body .iw-rpt-summary {
  background: linear-gradient(180deg, var(--iw-gray-50), #fff);
  border: 1px solid var(--iw-border);
  border-top: 4px solid var(--iw-navy);
  border-radius: var(--iw-radius);
  padding: 28px 32px 14px;
  margin: 0 0 2.4em;
}
.iw-rpt-body .iw-rpt-summary h2:first-child,
.iw-rpt-body .iw-rpt-summary .elementor-widget:first-child .elementor-heading-title { margin-top: 0; }
.iw-rpt-body .iw-rpt-summary > * { max-width: none; }

/* Note / warning / tip */
.iw-rpt-body .iw-rpt-callout {
  border: 1px solid #bfdbfe;
  border-left: 4px solid var(--iw-blue);
  background: #eff6ff;
  border-radius: 0 var(--iw-radius) var(--iw-radius) 0;
  padding: 16px 20px;
  margin: 1.6em 0;
  font-size: 15.5px;
}
.iw-rpt-body .iw-rpt-callout--warn { border-color: #fde68a; border-left-color: var(--iw-yellow); background: #fffbeb; }
.iw-rpt-body .iw-rpt-callout--tip  { border-color: #a7f3d0; border-left-color: var(--iw-green);  background: #ecfdf5; }
.iw-rpt-body .iw-rpt-callout > :last-child,
.iw-rpt-body .iw-rpt-callout p:last-child { margin-bottom: 0; }

/* Key findings as numbered cards */
.iw-rpt-body :is(ol.iw-rpt-findings, .iw-rpt-findings ol) { display: grid; gap: 14px; }
.iw-rpt-body :is(ol.iw-rpt-findings, .iw-rpt-findings ol) > li {
  margin: 0;
  padding: 18px 20px 18px 66px;
  border: 1px solid var(--iw-border);
  border-radius: var(--iw-radius);
  background: #fff;
}
.iw-rpt-body :is(ol.iw-rpt-findings, .iw-rpt-findings ol) > li::before { left: 20px; top: 18px; background: var(--iw-orange); }

/* Step timeline */
.iw-rpt-body :is(ol.iw-rpt-timeline, .iw-rpt-timeline ol) > li { padding-bottom: .4em; }
.iw-rpt-body :is(ol.iw-rpt-timeline, .iw-rpt-timeline ol) > li:not(:last-child)::after {
  content: "";
  position: absolute;
  left: 13px;
  top: 32px;
  bottom: -14px;
  width: 2px;
  background: var(--iw-border);
}
.iw-rpt-body :is(ol.iw-rpt-timeline, .iw-rpt-timeline ol) > li::before { background: #fff; color: var(--iw-navy); border: 2px solid var(--iw-orange); line-height: 24px; }

/* Takeaway cards */
.iw-rpt-body :is(ul.iw-rpt-takeaways, .iw-rpt-takeaways ul) {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(230px, 100%), 1fr));
  gap: 14px;
}
.iw-rpt-body :is(ul.iw-rpt-takeaways, .iw-rpt-takeaways ul) > li {
  margin: 0;
  padding: 18px 20px;
  border: 1px solid var(--iw-border);
  border-top: 3px solid var(--iw-green);
  border-radius: var(--iw-radius);
  background: #fff;
  font-size: 15px;
  line-height: 1.6;
}
.iw-rpt-body :is(ul.iw-rpt-takeaways, .iw-rpt-takeaways ul) > li::before { display: none; }
.iw-rpt-body :is(ul.iw-rpt-takeaways, .iw-rpt-takeaways ul) > li > strong:first-child { display: block; margin-bottom: 4px; }

/* Quiz fallback — static questions shown until the quiz is set up.
   Two forms: text enclosed in [iw_quiz]…[/iw_quiz], or a
   <div class="iw-quiz-static"> after [iw_quiz], which hides itself
   as soon as the interactive quiz renders in front of it. */
.iw-rpt-body .iw-quiz ~ .iw-quiz-static { display: none; }
.iw-quiz-static,
.iw-quiz-fallback {
  border: 1px dashed var(--iw-gray-300);
  border-radius: var(--iw-radius);
  padding: 20px 24px 6px;
  margin: 1.4em 0;
}
.iw-quiz-static details, .iw-quiz-fallback details { margin: 0 0 1.2em; }
.iw-quiz-static summary, .iw-quiz-fallback summary { cursor: pointer; font-weight: 700; color: var(--iw-orange-t); }
.iw-rpt-body .iw-quiz-static ol > li > ul { margin-top: .5em; }
.iw-rpt-body .iw-quiz-static ol > li > ul > li { margin-bottom: .25em; font-size: 15px; }
.iw-rpt-body .iw-quiz-static ol > li > ul > li::before { display: none; }
.iw-rpt-body .iw-quiz-static ol > li > ul > li { padding-left: 8px; }

/* The interactive quiz inside the body keeps its own design */
.iw-rpt-body .iw-quiz ul > li::before,
.iw-rpt-body .iw-quiz ol > li::before { display: none; }
.iw-rpt-body .iw-quiz h2 { border: 0; padding: 0; margin-top: 0; display: block; }

/* ══════════════════════════════════════════
   END MATTER + RELATED
   ══════════════════════════════════════════ */
.iw-rpt-end { margin-top: 44px; padding-top: 8px; border-top: 1px solid var(--iw-border); }
.iw-rpt-end > * + * { margin-top: 30px; }

.iw-rpt-related { padding: 10px 0 70px; }
.iw-rpt-related-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(250px, 100%), 1fr));
  gap: 20px;
}
.iw-rpt-related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  background: #fff;
  border: 1px solid var(--iw-border);
  border-radius: var(--iw-radius);
  overflow: hidden;
  padding-bottom: 16px;
  transition: box-shadow var(--iw-t), transform var(--iw-t);
}
.iw-rpt-related-card:hover { box-shadow: var(--iw-shadow); transform: translateY(-2px); }
.iw-rpt-related-card img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.iw-rpt-related-t { font-weight: 700; color: var(--iw-navy); padding: 0 16px; line-height: 1.4; }
.iw-rpt-related-d { font-size: 12.5px; color: var(--iw-muted); padding: 0 16px; }

/* ══════════════════════════════════════════
   ELEMENTOR — posts whose content is built with Elementor
   (.iw-rpt-body--el, set by template-report.php)

   Theme look by default; anything the author styles on an individual
   widget in Elementor still wins (per-widget CSS is more specific).
   ══════════════════════════════════════════ */

/* Heading widgets: widgets space themselves, so lighter margins */
.iw-rpt-body--el :is(h2.elementor-heading-title) { margin: 1.2em 0 .2em; }
.iw-rpt-body--el :is(h3.elementor-heading-title) { margin: .9em 0 .1em; }
.iw-rpt-body--el :is(h4.elementor-heading-title) { margin: .6em 0 0; }
.iw-rpt-body--el > .elementor > :first-child .elementor-heading-title { margin-top: 0; }

/* Text Editor widget: report typography over Elementor's global text style */
.iw-rpt-body--el .elementor-widget-text-editor {
  font-family: var(--iw-font);
  font-size: 16.5px;
  line-height: 1.8;
  color: var(--iw-gray-900);
}
.iw-rpt-body--el .elementor-widget-text-editor p { max-width: var(--rpt-measure); }
.iw-rpt-body--el .elementor-widget-text-editor > :last-child > :last-child,
.iw-rpt-body--el .elementor-widget-text-editor p:last-child { margin-bottom: 0; }

/* "Stretch section" sets an inline width equal to the whole window,
   which overflows the document card — keep stretched sections inside it. */
.iw-rpt-body--el .elementor-section.elementor-section-stretched {
  width: auto !important;
  left: auto !important;
}
.iw-rpt--elementor .iw-rpt-doc { overflow-x: clip; }

/* Components applied to an Elementor Container (CSS Classes field) */
.iw-rpt-body--el .e-con.iw-rpt-summary,
.iw-rpt-body--el .e-con.iw-rpt-callout { --gap: 10px; }

/* ── Tables: also beat Elementor's global table style, which puts a
   border round every cell and tints every other cell's background ── */
.iw-rpt-body .iw-rpt-table :is(td, th) {
  border: 0;
  border-top: 1px solid var(--iw-border);
  background-color: transparent;
}
.iw-rpt-body .iw-rpt-table thead th { border-top: 0; background-color: var(--iw-navy); }
.iw-rpt-body .iw-rpt-table tbody tr:nth-child(even) > :is(td, th) { background-color: var(--iw-gray-50); }
.iw-rpt-body .iw-rpt-table tbody tr:hover > :is(td, th) { background-color: var(--iw-peach); }

/* ── Embeds and media never overflow ── */
.iw-rpt-body :is(iframe, video, embed, object) { max-width: 100%; }
.iw-rpt-body video { height: auto; }

/* ══════════════════════════════════════════
   RESPONSIVE — every device

     ≥1440   large desktop — wider rail
     ≤1200   small laptop  — narrower rail
     ≤1024   tablet        — one column, contents folds above the text
     ≤720    phone         — edge-to-edge document, stacked actions
     ≤400    small phone   — tighter spacing, smaller type
   Plus touch-friendly targets wherever there is no mouse.
   ══════════════════════════════════════════ */
@media (min-width: 1440px) {
  .iw-rpt { --rpt-rail: 290px; --rpt-gap: 48px; }
}
@media (max-width: 1200px) {
  .iw-rpt { --rpt-rail: 230px; --rpt-gap: 28px; }
  .iw-rpt-doc { padding: 38px 40px 36px; }
  .iw-rpt-figure { margin: -38px -40px 30px; }
  .iw-rpt-figure figcaption { padding: 8px 40px 0; }
}
@media (max-width: 1024px) {
  .iw-rpt-layout { grid-template-columns: minmax(0, 1fr); gap: 20px; padding-top: 24px; }
  .iw-rpt-rail { position: static; max-height: none; overflow: visible; }
  .iw-rpt-contents {
    background: #fff;
    border: 1px solid var(--iw-border);
    border-radius: var(--iw-radius);
    padding: 14px 18px;
  }
  .iw-rpt-contents > summary { padding: 0; font-size: 12px; color: var(--iw-navy); min-height: 24px; }
  .iw-rpt-contents[open] > summary { padding-bottom: 10px; }
  .iw-rpt-rail .iw-toc { border: 0; padding: 0; background: transparent; }
  /* A long contents list scrolls inside itself instead of pushing the
     report a whole screen down. */
  .iw-rpt-contents[open] .iw-toc-list { max-height: 55vh; overflow-y: auto; overscroll-behavior: contain; }
  .iw-rpt-share { margin-left: 0; }
  .iw-rpt-layout > .iw-rpt-doc:only-child { max-width: none; }
}
@media (max-width: 720px) {
  .iw-rpt-cover { padding-top: 22px; }
  .iw-rpt-crumbs .iw-breadcrumbs { margin-bottom: 18px; }
  .iw-rpt-standfirst { margin-bottom: 20px; }
  .iw-rpt-doc { padding: 26px 18px 28px; border-radius: 0; border-left: 0; border-right: 0; }
  .iw-rpt-layout { padding-left: 0; padding-right: 0; }
  .iw-rpt-rail { padding: 0 16px; }
  .iw-rpt-figure { margin: -26px -18px 24px; }
  .iw-rpt-figure img { border-radius: 0; }
  .iw-rpt-figure figcaption { padding: 8px 18px 0; }
  .iw-rpt-body,
  .iw-rpt-body--el .elementor-widget-text-editor { font-size: 16px; line-height: 1.75; }

  /* Facts: a clean 2 × 2 grid instead of a ragged wrap */
  .iw-rpt-facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .iw-rpt-facts > div,
  .iw-rpt-facts > div + div { padding: 12px 12px 14px 0; border-left: 0; }
  .iw-rpt-facts > div:nth-child(even) { padding-left: 14px; border-left: 1px solid rgba(255,255,255,.12); }
  .iw-rpt-facts > div:nth-child(n+3) { border-top: 1px solid rgba(255,255,255,.12); }
  .iw-rpt-facts dd { font-size: 17px; }

  .iw-rpt-actions .iw-jbtn { width: 100%; justify-content: center; }
  .iw-rpt-share { width: 100%; justify-content: flex-start; flex-wrap: wrap; }

  /* Components */
  .iw-rpt-body .iw-rpt-summary { padding: 20px 18px 8px; }
  .iw-rpt-body .iw-rpt-callout { padding: 14px 16px; font-size: 15px; }
  .iw-rpt-body :is(ol.iw-rpt-findings, .iw-rpt-findings ol) > li { padding: 16px 16px 16px 56px; }
  .iw-rpt-body :is(ol.iw-rpt-findings, .iw-rpt-findings ol) > li::before { left: 16px; top: 16px; }
  .iw-rpt-body :is(blockquote:not([class]), blockquote.wp-block-quote) { padding: 14px 18px; font-size: 16px; }

  /* Tables scroll sideways; a slightly narrower minimum means fewer do */
  .iw-rpt-body table { min-width: 520px; font-size: 13.5px; }
  .iw-rpt-body thead th,
  .iw-rpt-body tbody :is(td, th) { padding: 11px 12px; }
  .iw-rpt-body tbody :is(td, th):first-child { min-width: 120px; }

  .iw-rpt-related { padding-bottom: 50px; }
}
@media (max-width: 400px) {
  .iw-rpt-wrap { padding: 0 14px; }
  .iw-rpt-rail { padding: 0 14px; }
  .iw-rpt-doc { padding: 22px 14px 24px; }
  .iw-rpt-figure { margin: -22px -14px 20px; }
  .iw-rpt-title { font-size: 26px; }
  .iw-rpt-standfirst { font-size: 15px; }
  .iw-rpt-body,
  .iw-rpt-body--el .elementor-widget-text-editor { font-size: 15.5px; }
  /* Plain lists only — the card components keep their own padding */
  .iw-rpt-body :is(ul:not([class]), ul.wp-block-list):where(:not(.iw-rpt-takeaways)) > li { padding-left: 22px; }
  .iw-rpt-body :is(ol:not([class]), ol.wp-block-list, ol.iw-rpt-timeline):where(:not(.iw-rpt-findings)) > li { padding-left: 36px; }
  .iw-rpt-body :is(ol.iw-rpt-findings, .iw-rpt-findings ol) > li { padding: 14px 14px 14px 52px; }
  .iw-rpt-body :is(ol.iw-rpt-findings, .iw-rpt-findings ol) > li::before { left: 14px; top: 14px; }
  .iw-rpt-num { font-size: .58em; }
  .iw-rpt-facts dd { font-size: 16px; }
}

/* Touch screens: links in the contents list and share buttons get
   finger-sized targets (44px, the accessibility minimum). */
@media (pointer: coarse) {
  .iw-rpt-rail .iw-toc-item a { padding-top: 9px; padding-bottom: 9px; }
  .iw-rpt-share .iw-share-btn { width: 44px; height: 44px; }
}

/* Landscape phones: the cover would fill the whole short screen */
@media (max-height: 500px) and (orientation: landscape) {
  .iw-rpt-cover { padding-top: 16px; }
  .iw-rpt-title { font-size: clamp(24px, 4vw, 34px); margin-bottom: 10px; }
  .iw-rpt-standfirst { margin-bottom: 14px; }
  .iw-rpt-rail { max-height: none; }
}

/* ══════════════════════════════════════════
   PRINT / SAVE AS PDF
   ══════════════════════════════════════════ */
@media print {
  @page { margin: 16mm 14mm; }

  .iw-header, .iw-footer, #iw-preloader, #iw-read-progress, .skip-link,
  .iw-mobile-menu, .iw-rpt-crumbs, .iw-rpt-actions, .iw-rpt-rail,
  .iw-tts-player, .iw-reactions, .iw-quiz, .iw-comments-section,
  .iw-author-box-profile, .iw-rpt-related, .iw-cite-copy,
  #wpadminbar { display: none !important; }

  body, .iw-rpt { background: #fff !important; }
  .iw-rpt-cover {
    background: #fff !important;
    color: #000 !important;
    padding: 0 0 12px;
    border-bottom: 3px solid #1e1b4b;
  }
  .iw-rpt-cover::before { display: none; }
  .iw-rpt-title, .iw-rpt-by, .iw-rpt-by a, .iw-rpt-facts dd { color: #1e1b4b !important; }
  .iw-rpt-standfirst, .iw-rpt-dates, .iw-rpt-facts dt, .iw-rpt-eyebrow a { color: #334155 !important; }
  .iw-rpt-kicker { color: #c2410c !important; }
  .iw-rpt-facts { border-top-color: #cbd5e1; }
  .iw-rpt-facts > div + div { border-left-color: #cbd5e1; }

  .iw-rpt-layout { display: block; padding: 0; }
  .iw-rpt-doc { border: 0; box-shadow: none; padding: 0; }
  .iw-rpt-figure { margin: 12px 0; }
  .iw-rpt-body { font-size: 11pt; line-height: 1.55; }
  .iw-rpt-body > * { max-width: none; }

  .iw-rpt-body h2 { break-after: avoid; page-break-after: avoid; margin-top: 1.6em; }
  .iw-rpt-body h3, .iw-rpt-body h4 { break-after: avoid; page-break-after: avoid; }
  .iw-rpt-body table, .iw-rpt-body tr, .iw-rpt-body li, .iw-rpt-body blockquote { break-inside: avoid; page-break-inside: avoid; }
  .iw-rpt-table { overflow: visible; border-color: #cbd5e1; }
  .iw-rpt-body table { min-width: 0; font-size: 9.5pt; }
  .iw-rpt-body thead { display: table-header-group; }   /* repeat header on each page */
  .iw-rpt-body thead th, .iw-rpt-type, .iw-rpt-num, .iw-rpt-body ol > li::before {
    -webkit-print-color-adjust: exact;
    print-color-adjust: exact;
  }

  /* Show where links go, except in-page anchors */
  .iw-rpt-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 8.5pt; color: #64748b; word-break: break-all; }
}

/* Motion preferences */
@media (prefers-reduced-motion: reduce) {
  .iw-rpt-related-card, .iw-rpt-contents > summary::after { transition: none; }
}
