.ibf-storymap {
  overflow-x: hidden;
}

/* overflow: clip (not hidden) avoids making .ibf-storymap a scroll container on
   this route, which was defeating position: sticky on .ibf-chapter-tag. */
body.page-ibf-story .ibf-storymap {
  overflow-x: clip;
  overflow-y: clip;
}

.ibf-storymap *,
.ibf-storymap *::before,
.ibf-storymap *::after {
  box-sizing: border-box;
}

.ibf-storymap img {
  display: block;
}

.ibf-storymap {
  --cof-picof: #A05FB4;
  --cof-sascof: #72BF44;
  --cof-aseancof: #009EDB;
  --cof-neacof: #ED1847;
  --cof-tpcf: #2EC4B6;
  --cof-tpcf-boundary-fill: rgba(46,196,182,0.55);
  --cof-tpcf-boundary-stroke: #0E8074;
  --cof-focraii: #F58220;
}

/* Progress */
.ibf-storymap #reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: var(--z-flyout);
  width: 100%;
  height: 2px;
  background: var(--escap-blue);
  transform: scaleX(0);
  transform-origin: 0 0;
  transition: transform 80ms linear;
}

.ibf-storymap .lightbox-overlay {
  margin: auto;
  border: none;
  padding: 0;
  max-width: 100vw;
  max-height: none;
  box-sizing: border-box;
  background: transparent;
  cursor: zoom-out;
}

/* The flex layout is gated on [open]: an ungated display: flex would outrank
   the UA dialog:not([open]) rule and keep the closed dialog on screen. */
.ibf-storymap .lightbox-overlay[open] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-8);
}

.ibf-storymap .lightbox-overlay::backdrop {
  background: var(--modal-backdrop);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.ibf-storymap .lightbox-overlay img {
  max-width: min(100%, 720px);
  max-height: 85vh;
  box-sizing: border-box;
  background: var(--white);
  padding: var(--space-6);
  cursor: default;
}

.ibf-storymap .lightbox-overlay video {
  max-width: min(100%, 960px);
  max-height: 85vh;
  box-sizing: border-box;
  cursor: default;
}

.ibf-storymap .lightbox-close {
  font: inherit;
  position: absolute;
  top: var(--space-6);
  inset-inline-end: var(--space-7);
  width: var(--space-9);
  height: var(--space-9);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--escap-blue-deep);
  font-size: var(--text-3xl);
  line-height: 1;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.ibf-storymap .lightbox-close:hover {
  color: var(--escap-blue);
}

.ibf-storymap [data-lightbox] {
  cursor: zoom-in;
}

.ibf-storymap [data-lightbox]:focus-visible {
  outline: 3px solid var(--escap-blue);
  outline-offset: 2px;
}

.ibf-storymap .visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: var(--space-0);
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.ibf-storymap .component-error {
  display: grid;
  place-items: center;
  align-content: center;
  gap: var(--space-3);
  min-height: 320px;
  padding: var(--space-6);
  border: 1px solid var(--border);
  background: var(--off-white);
  color: var(--fg-muted);
  text-align: center;
}

.ibf-storymap .component-error p {
  max-width: 60ch;
  margin: 0;
}

.ibf-storymap .component-error button {
  min-height: 44px;
  padding: var(--space-2) var(--space-4);
  border: 1px solid var(--escap-blue);
  border-radius: var(--radius-1);
  background: var(--escap-blue);
  color: var(--white);
  font: inherit;
  cursor: pointer;
}

.ibf-storymap .skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: var(--z-modal);
  padding: var(--space-2) var(--space-4);
  background: var(--escap-blue);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform 0.2s var(--ease-standard);
}

.ibf-storymap .skip-link:focus {
  transform: translateY(0);
}

/* Nav */
.ibf-storymap .site-nav {
  position: sticky;
  top: 0;
  left: 0;
  right: 0;
  z-index: var(--z-dropdown);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-4) clamp(var(--space-4), 3vw, var(--space-8));
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border-bottom: 1px solid var(--escap-blue-wash);
  box-shadow: var(--shadow-sm);
}

.ibf-storymap .nav-brand {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);
  color: var(--escap-blue);
  font-family: var(--font-condensed);
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-decoration: none;
  text-transform: uppercase;
}

.ibf-storymap .nav-brand::before {
  content: '';
  width: 10px;
  height: 10px;
  border-radius: var(--radius-1);
  background: var(--escap-blue);
}

.ibf-storymap .nav-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: var(--space-2);
  padding: var(--space-0);
  margin: var(--space-0);
  list-style: none;
}

.ibf-storymap .nav-links li {
  margin: var(--space-0);
}

.ibf-storymap .nav-links a {
  padding: var(--space-2) var(--space-3);
  border: 1px solid transparent;
  border-radius: var(--radius-1);
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-decoration: none;
  text-transform: uppercase;
  transition: background var(--t-fast) var(--ease-standard), border-color var(--t-fast) var(--ease-standard), color var(--t-fast) var(--ease-standard);
}

.ibf-storymap .nav-links a:hover {
  border-color: var(--escap-blue);
  background: var(--escap-blue-wash);
  color: var(--escap-blue);
}

/* Side dots */
.ibf-storymap .side-nav {
  position: fixed;
  right: 22px;
  top: 50%;
  z-index: 90;
  display: flex;
  flex-direction: column;
  gap: var(--space-0);
  transform: translateY(-50%);
}

.ibf-storymap .side-dot {
  position: relative;
  display: grid;
  width: 24px;
  height: 24px;
  place-items: center;
  padding: var(--space-0);
  border: none;
  background: transparent;
  cursor: pointer;
}

.ibf-storymap .side-dot::before {
  position: relative;
  z-index: 1;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--line-200);
  content: "";
  transition: background var(--t-fast) var(--ease-standard), transform var(--t-fast) var(--ease-standard);
}

.ibf-storymap .side-dot::after {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 2px;
  height: 24px;
  translate: -50% 0;
  background: var(--line-200);
  content: "";
  transition: background var(--t-fast) var(--ease-standard);
}

.ibf-storymap .side-dot:last-child::after {
  display: none;
}

.ibf-storymap .side-dot.completed::before {
  background: var(--escap-gold);
}

.ibf-storymap .side-dot.completed::after {
  background: var(--escap-gold);
}

.ibf-storymap .side-dot.active::before {
  background: var(--escap-blue);
  transform: scale(1.6);
  animation: dot-pulse 2s ease-in-out 3; /* finite: WCAG 2.2.2 */
}

@keyframes dot-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(0, 104, 184, 0.6); }
  70%  { box-shadow: 0 0 0 8px rgba(0, 104, 184, 0); }
  100% { box-shadow: 0 0 0 0 rgba(0, 104, 184, 0); }
}

.ibf-storymap .side-dot:focus-visible {
  outline: 2px solid var(--escap-blue);
  outline-offset: 3px;
}

/* Sections */
.ibf-storymap section {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100svh;
  padding: var(--space-12) var(--space-7);
  scroll-margin-top: 86px;
}

/* Off-screen sections skip layout and paint until scrolled near (same as
   coastal-story). #hero paints first; #climate-outlook-forums stays rendered so
   Leaflet never measures a zero-size map. The :not() list keeps both at the
   same specificity as this rule. */
.ibf-storymap main section:not(#hero):not(#climate-outlook-forums) {
  content-visibility: auto;
  contain-intrinsic-size: auto 100svh;
}

/* Tabbing to a control scrolls it clear of the fixed nav instead of behind it. */
.ibf-storymap a[href],
.ibf-storymap button,
.ibf-storymap video,
.ibf-storymap input,
.ibf-storymap select,
.ibf-storymap textarea,
.ibf-storymap [tabindex] {
  scroll-margin-top: 96px;
}

.ibf-storymap .wrap {
  width: 100%;
  max-width: var(--container-lg);
  margin: var(--space-0) auto;
}

.ibf-storymap .eyebrow {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
  color: var(--escap-blue);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-regular);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.ibf-storymap .eyebrow::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 24px;
  height: 1px;
  background: currentColor;
}

.ibf-storymap .section-h {
  max-width: 22ch;
  margin-bottom: var(--space-5);
  color: var(--escap-blue);
  font-family: var(--font-sans);
  font-size: clamp(var(--text-3xl), 4vw, var(--text-6xl));
  font-weight: var(--weight-medium);
  line-height: var(--lh-tight);
}

.ibf-storymap .section-lead {
  max-width: 62ch;
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: clamp(var(--text-base), 1.3vw, var(--text-lg));
  line-height: var(--lh-base);
}

.ibf-storymap .chapter {
  position: relative;
}

.ibf-storymap .ibf-chapter-tag {
  position: sticky;
  top: 86px;
  z-index: var(--z-dropdown);
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: var(--space-3);
  pointer-events: none;
}

body.page-ibf-story .ibf-storymap .ibf-chapter-tag {
  top: 56px;
}

.ibf-storymap .ibf-chapter-tag-inner {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  padding: var(--space-2) var(--space-4);
  background: rgba(255, 255, 255, 0.78);
  backdrop-filter: blur(8px);
  border-radius: var(--radius-1);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
}

.ibf-storymap .ibf-chapter-tag-rule {
  flex-shrink: 0;
  width: 4px;
  height: 22px;
  background: color-mix(in oklab, var(--escap-gold) 45%, transparent);
}

.ibf-storymap .ibf-chapter-tag-title {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  color: var(--fg-muted);
}

.ibf-storymap .ibf-qgis-copy .eyebrow {
  color: var(--escap-blue);
}

.ibf-storymap .ibf-qgis-copy .section-h {
  color: var(--escap-blue);
}

.ibf-storymap .ibf-qgis-copy .section-lead,
.ibf-storymap .ibf-qgis-copy ol,
.ibf-storymap .ibf-qgis-copy li,
.ibf-storymap .ibf-qgis-copy p {
  color: var(--fg-muted);
}

.ibf-storymap .ibf-image-stack {
  display: grid;
  gap: var(--space-5);
}

/* Reveal */
.ibf-storymap .rv {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.45s var(--ease-standard), transform 0.45s var(--ease-standard);
}

.ibf-storymap .rv.in {
  opacity: 1;
  transform: none;
}

.ibf-storymap .rv.d1 { transition-delay: 0.08s; }
.ibf-storymap .rv.d2 { transition-delay: 0.16s; }
.ibf-storymap .rv.d3 { transition-delay: 0.24s; }

/* The hero is useful content, not a deferred interaction. Keep it readable
   while the below-fold application waits for user intent. */
.ibf-storymap #hero .rv {
  opacity: 1;
  transform: none;
  transition: none;
}

/* 1. Hero */
.ibf-storymap #hero {
  position: relative;
  overflow: hidden;
  padding-top: 0;
  background-image: linear-gradient(130deg, rgba(0, 56, 102, 0.88) 0%, rgba(23, 53, 78, 0.52) 100%), url('https://images.unsplash.com/photo-1563545919071-8cbc2604cdb9?auto=format&fit=crop&w=2400&q=80');
  background-position: center;
  background-size: cover;
  background-attachment: fixed;
  color: var(--white);
}

/* ponytail: background-attachment:fixed is unreliable on iOS/Android — fall back to normal scroll on touch devices */
@media (hover: none), (max-width: 767.98px) {
  .ibf-storymap #hero {
    background-attachment: scroll;
  }
}

@media (max-width: 767.98px) {
  .ibf-storymap #hero {
    background-image: linear-gradient(130deg, rgba(0, 56, 102, 0.88) 0%, rgba(23, 53, 78, 0.52) 100%), url('https://images.unsplash.com/photo-1563545919071-8cbc2604cdb9?auto=format&fit=crop&w=1000&q=75');
  }
}

.ibf-storymap #hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at top left, rgba(0, 104, 184, 0.18), transparent 52%), radial-gradient(ellipse at bottom right, rgba(244, 190, 24, 0.10), transparent 55%);
  pointer-events: none;
}

.ibf-storymap #hero .wrap {
  position: relative;
  z-index: 1;
}

.ibf-storymap .hero-kicker {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  margin-bottom: var(--space-6);
  color: var(--escap-gold);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-widest);
  text-transform: uppercase;
}

.ibf-storymap .hero-kicker::before {
  content: '';
  display: block;
  width: 24px;
  height: 1px;
  background: var(--escap-gold);
}

.ibf-storymap .hero-h1 {
  /* 14ch in Roboto Light; em, because ch follows the fallback font until Roboto loads and re-wrapped the title. */
  max-width: 7.77em;
  margin-bottom: var(--space-7);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: clamp(var(--text-6xl), 6vw, var(--text-8xl));
  font-weight: var(--weight-light);
  line-height: var(--lh-tight);
}

.ibf-storymap .hero-h1 i {
  color: var(--escap-gold);
  font-style: normal;
  font-weight: var(--weight-medium);
}

.ibf-storymap .hero-sub {
  max-width: 60ch;
  margin-bottom: var(--space-8);
  color: rgba(255, 255, 255, 0.8);
  font-family: var(--font-sans);
  font-size: clamp(var(--text-base), 1.3vw, var(--text-lg));
  line-height: var(--lh-base);
}

.ibf-storymap .hero-chips {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.ibf-storymap .chip {
  padding: var(--space-2) var(--space-5);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: var(--radius-1);
  background: rgba(255, 255, 255, 0.10);
  backdrop-filter: blur(8px);
  color: var(--white);
  text-decoration: none;
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.ibf-storymap .hero-coast {
  position: fixed;
  left: 0;
  bottom: 0px;
  width: 100%;
  opacity: 0.6;
}

.ibf-storymap .hero-coast .wave-primary {
  animation: coast-drift-primary 13s ease-in-out 4 alternate; /* finite (even count ends at rest): WCAG 2.2.2 */
  transform-origin: center bottom;
}

.ibf-storymap .hero-coast .wave-secondary {
  animation: coast-drift-secondary 16s ease-in-out 4 alternate; /* finite (even count ends at rest): WCAG 2.2.2 */
  transform-origin: center bottom;
}

@keyframes coast-drift-primary {
  from { transform: scaleY(1); opacity: 0.95; }
  to { transform: scaleY(1.12); opacity: 0.78; }
}

@keyframes coast-drift-secondary {
  from { transform: scaleY(1.12); opacity: 0.55; }
  to { transform: scaleY(1); opacity: 0.72; }
}

.ibf-storymap #resources .eyebrow {
  color: var(--escap-gold);
}

.ibf-storymap #resources .eyebrow::before {
  background: var(--escap-gold);
}

.ibf-storymap #resources .section-h {
  color: var(--white);
}

.ibf-storymap #resources .section-lead {
  color: rgba(255, 255, 255, 0.68);
}

.ibf-storymap .stat-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-4);
  margin-top: var(--space-10);
  background: transparent;
}

.ibf-storymap .stat-cell {
  padding: var(--space-8) var(--space-6);
  border: 1px solid rgba(255, 255, 255, 0.10);
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  transition: border-color 0.2s var(--ease-standard), background 0.2s var(--ease-standard);
}

.ibf-storymap .stat-cell:hover {
  background: rgba(255, 255, 255, 0.12);
}

.ibf-storymap .stat-cell.active {
  border-color: var(--escap-gold);
  background: rgba(255, 255, 255, 0.12);
}

.ibf-storymap .stat-cell:focus-visible {
  outline: 2px solid var(--escap-gold);
  outline-offset: 2px;
}

.ibf-storymap .stat-hint {
  margin: var(--space-4) var(--space-0) var(--space-0);
  color: rgba(255, 255, 255, 0.55);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  text-align: center;
}

.ibf-storymap #case-studies .stat-hint {
  color: var(--fg-muted);
}

.ibf-storymap .panel-shell {
  margin-top: var(--space-6);
}

.ibf-storymap .panel {
  display: none;
  position: relative;
  padding: var(--space-8) var(--space-7);
  border-radius: var(--radius-4);
  background: var(--white);
  color: var(--fg);
  box-shadow: var(--shadow-lg);
}

.ibf-storymap .panel.show {
  display: block;
}

/* panel sits on a white surface even though #context is dark, so its
   eyebrow/section-h need their own (non-dark-surface) colors */
.ibf-storymap #context .panel .eyebrow {
  color: var(--escap-blue);
}

.ibf-storymap #context .panel .section-h {
  color: var(--escap-blue);
}

.ibf-storymap .panel-shell .section-h {
  font-size: clamp(var(--text-xl), 4vw, var(--text-4xl));
  width: 100%;
  max-width: none;
}

.ibf-storymap .panel-shell .section-lead {
  width: 100%;
  max-width: none;
}

.ibf-storymap #context .panel .section-lead {
  color: var(--fg);
}

.ibf-storymap .panel-close {
  font: inherit;
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 32px;
  height: 32px;
  border: 1px solid var(--border);
  border-radius: var(--radius-pill);
  background: var(--white);
  color: var(--fg-muted);
  font-size: var(--text-xl);
  line-height: 1;
  cursor: pointer;
}

.ibf-storymap .panel-close:hover,
.ibf-storymap .panel-close:focus-visible {
  border-color: var(--escap-blue);
  color: var(--escap-blue);
}

.ibf-storymap .panel-close:focus-visible {
  outline: 2px solid var(--escap-blue);
  outline-offset: 2px;
}

.ibf-storymap .stat-n {
  margin-bottom: var(--space-3);
  color: var(--escap-gold);
  font-family: var(--font-condensed);
  font-size: clamp(var(--text-5xl), 3.5vw, var(--text-7xl));
  font-variant-numeric: tabular-nums;
  font-weight: var(--weight-bold);
  line-height: 1;
}

.ibf-storymap .stat-lbl {
  color: rgba(255, 255, 255, 0.6);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  line-height: 1.45;
  text-transform: uppercase;
}

/* dark closing section */
.ibf-storymap #resources {
  background: var(--escap-blue-deep);
}
/* Leaflet Map & Cooperative Gesture Overlay */

@keyframes pin-pulse {
  0% {
    transform: scale(0.5);
    opacity: 0.95;
  }
  100% {
    transform: scale(2.8);
    opacity: 0;
  }
}

/* Section rhythm: white → pale → dark, dark kept at #context/#timescale/#climate-outlook-forums/#resources,
   assigned per section id (#hero keeps its own background and text colors) */
.ibf-storymap #context,
.ibf-storymap #timescale,
.ibf-storymap #climate-outlook-forums {
  background: var(--escap-blue-deep);
  color: var(--white);
}

/* The default blue ring is ~2.2:1 on navy; gold is ~7.4:1. */
.ibf-storymap :is(#climate-outlook-forums, #resources) :focus-visible {
  outline-color: var(--escap-gold);
}

.ibf-storymap #context .eyebrow,
.ibf-storymap #timescale .eyebrow,
.ibf-storymap #climate-outlook-forums .eyebrow {
  color: var(--escap-gold);
}

.ibf-storymap #context .eyebrow::before,
.ibf-storymap #timescale .eyebrow::before,
.ibf-storymap #climate-outlook-forums .eyebrow::before {
  background: var(--escap-gold);
}

.ibf-storymap #context .section-h,
.ibf-storymap #timescale .section-h,
.ibf-storymap #climate-outlook-forums .section-h {
  color: var(--white);
}

.ibf-storymap #context .section-lead,
.ibf-storymap #timescale .section-lead,
.ibf-storymap #climate-outlook-forums .section-lead {
  color: rgba(255, 255, 255, 0.72);
}

.ibf-storymap #what-is-ibf,
.ibf-storymap #sendai,
.ibf-storymap #inputs,
.ibf-storymap #ibf-next-tool,
.ibf-storymap #next {
  background: var(--white);
}

.ibf-storymap #case-studies {
  background: var(--escap-blue-wash);
}

.ibf-storymap #users,
.ibf-storymap #interpret {
  background: var(--escap-blue-wash);
}

.ibf-storymap [data-panel="agriculture"] .eyebrow {
  color: var(--escap-blue);
}

.ibf-storymap .ibf-source {
  margin-top: var(--space-5);
  color: var(--fg-muted);
  font-size: var(--text-xs);
  font-style: italic;
}

.ibf-storymap .ibf-mini-grid {
  grid-template-columns: 1fr;
  margin-top: var(--space-0);
}

/* Compound selector so this outranks .insight-grid's auto-fit rule regardless of source order */
.ibf-storymap .insight-grid.ibf-mini-grid {
  grid-template-columns: 1fr;
}

.ibf-storymap .ibf-mini-grid > .section-h {
  margin-inline: auto;
  text-align: center;
}

.ibf-storymap .ibf-mini-grid .insight-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  margin-top: var(--space-4);
}

.ibf-storymap .ibf-mini-grid .insight-row .insight-card {
  flex: 1 1 220px;
}

.ibf-storymap .ibf-image-card {
  padding: var(--space-5);
  border: 1px solid var(--border);
  border-radius: var(--radius-2);
  background: var(--white);
  box-shadow: var(--shadow-lg);
  text-align: center;
}

.ibf-storymap .ibf-image-card img,
.ibf-storymap .ibf-image-card video {
  width: 100%;
  height: auto;
  border-radius: var(--radius-1);
}

/* Pause/play for looping inline videos (WCAG 2.2.2); the frame is added by JS. */
.ibf-storymap .media-frame {
  position: relative;
  display: block;
}

.ibf-storymap .media-frame video {
  display: block;
}

.ibf-storymap .media-toggle {
  position: absolute;
  right: var(--space-3);
  bottom: var(--space-3);
  display: grid;
  place-items: center;
  width: var(--space-8);
  height: var(--space-8);
  padding: var(--space-0);
  border: 1px solid var(--white);
  border-radius: var(--radius-pill);
  background: var(--escap-blue-deep);
  color: var(--white);
  cursor: pointer;
}

.ibf-storymap .media-toggle:hover {
  background: var(--escap-blue);
}

/* White + navy double ring: visible over any video frame. */
.ibf-storymap .media-toggle:focus-visible {
  outline: 2px solid var(--white);
  outline-offset: 0;
  box-shadow: 0 0 0 4px var(--escap-blue-deep); /* raw: ring geometry */
}

.ibf-storymap .media-toggle svg {
  width: var(--space-4);
  height: var(--space-4);
  fill: currentColor;
}

@media (hover: none) {
  .ibf-storymap .media-toggle {
    width: var(--space-9); /* ≥44px touch target */
    height: var(--space-9);
  }
}

.ibf-storymap .ibf-image-card p {
  margin: var(--space-3) var(--space-0) var(--space-0);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  font-style: italic;
}

.ibf-storymap .ibf-image-card-title {
  margin: var(--space-0) var(--space-0) var(--space-3);
  color: var(--escap-blue);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.ibf-storymap #ibf-next-tool .section-lead {
  max-width: none;
}

.ibf-storymap #ibf-next-tool .ibf-image-card video,
.ibf-storymap #ibf-next-tool .ibf-image-card img {
  max-height: 55vh;
  object-fit: cover;
}

.ibf-storymap .cof-explorer {
  margin-top: var(--space-10);
}

.ibf-storymap .cof-map-wrap {
  position: relative;
}

.ibf-storymap .cof-map {
  display: block;
  width: 100%;
  height: 660px; /* raw: map canvas height */
  border: 1px solid var(--border);
  z-index: 0;
}

.ibf-storymap .cof-sidebar {
  position: absolute;
  left: 18px;
  bottom: 18px;
  width: 320px;
  max-height: 90%;
  z-index: 10;
  display: flex;
  flex-direction: column;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(2px);
  border: 1px solid var(--border);
  border-radius: var(--radius-1);
  padding: var(--space-4) var(--space-5) var(--space-4);
  box-shadow: var(--shadow-sm);
}

.ibf-storymap .cof-sidebar-overview {
  display: none;
}

.ibf-storymap .cof-sidebar.is-empty .cof-sidebar-overview {
  display: block;
  overflow-y: auto;
}

.ibf-storymap .cof-sidebar.is-empty .cof-sidebar-head,
.ibf-storymap .cof-sidebar.is-empty .cof-sidebar-full,
.ibf-storymap .cof-sidebar.is-empty .cof-sidebar-list {
  display: none;
}

.ibf-storymap .cof-sidebar-overview-p {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--fg);
  margin: var(--space-0) var(--space-0) var(--space-3);
}

.ibf-storymap .cof-sidebar-overview-p:last-of-type {
  margin-bottom: var(--space-4);
}

.ibf-storymap .cof-sidebar-callout {
  background: var(--white);
  border: 1px solid var(--border);
  border-left: 4px solid var(--escap-blue);
  border-radius: var(--radius-1);
  padding: var(--space-3) var(--space-4);
}

/* Sits below the forum buttons, outside the map. */
.ibf-storymap .cof-explorer > .cof-sidebar-callout {
  margin-top: var(--space-5);
}

.ibf-storymap .cof-sidebar-callout-label {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  color: var(--fg-muted);
  margin: var(--space-0) var(--space-0) var(--space-1);
}

.ibf-storymap .cof-sidebar-callout-text {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--fg);
  margin: var(--space-0);
}

.ibf-storymap .cof-sidebar-head {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-1);
  flex-shrink: 0;
}

.ibf-storymap .cof-sidebar-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #999;
  flex-shrink: 0;
}

.ibf-storymap .cof-sidebar-title {
  font-size: var(--text-lg);
  font-weight: var(--weight-bold);
  color: var(--fg);
}

.ibf-storymap .cof-sidebar-full {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  margin: var(--space-1) var(--space-0) var(--space-3);
}

.ibf-storymap .cof-sidebar-list {
  list-style: none;
  margin: var(--space-0);
  padding: var(--space-3) var(--space-1) var(--space-0) var(--space-0);
  border-top: 1px solid var(--border);
  font-size: var(--text-sm);
  line-height: 1.75;
  overflow-y: auto;
  columns: 2;
  column-gap: 16px;
  color: var(--fg);
}

.ibf-storymap .cof-sidebar-note {
  column-span: all;
  font-size: var(--text-xs);
  color: var(--fg-muted);
  margin: var(--space-0) var(--space-0) var(--space-2);
}

.ibf-storymap .cof-stepper {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-3);
  margin-bottom: var(--space-4);
}

.ibf-storymap .cof-step {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--border);
  background: var(--white);
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  cursor: pointer;
  transition: all var(--t-fast) var(--ease-standard);
}

.ibf-storymap .cof-step:hover {
  border-color: var(--escap-blue-pale);
}

.ibf-storymap .cof-step.active {
  border-color: var(--escap-blue);
  background: var(--escap-blue);
  color: var(--white);
}

@keyframes ibf-frame-cycle {
  0%, 6% {
    opacity: 0;
    transform: translate3d(34px, 18px, 0) rotateY(-10deg) scale(0.94);
  }
  10%, 30% {
    opacity: 1;
    transform: translate3d(0, 0, 0) rotateY(0deg) scale(1);
  }
  36%, 100% {
    opacity: 0;
    transform: translate3d(-30px, -10px, 0) rotateY(8deg) scale(0.96);
  }
}

@keyframes ibf-path-draw {
  0% { stroke-dashoffset: 700; }
  30% { stroke-dashoffset: 466; }
  62% { stroke-dashoffset: 233; }
  92%, 100% { stroke-dashoffset: 0; }
}

@keyframes ibf-pulse-travel {
  0%, 28% { transform: translateX(0); }
  34%, 62% { transform: translateX(350px); }
  68%, 100% { transform: translateX(700px); }
}

@keyframes ibf-step-active {
  0%, 7% { opacity: 0.18; }
  10%, 30% { opacity: 1; }
  36%, 100% { opacity: 0.18; }
}

@keyframes ibf-glow-breathe {
  0%, 100% { transform: scale(0.92); opacity: 0.55; }
  50% { transform: scale(1.08); opacity: 1; }
}

.ibf-storymap #resources .resource-card {
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.06);
}

/* 5. Framework */

@keyframes flow-connector-bounce {
  0%, 100% { transform: translateY(0); opacity: 0.6; }
  50% { transform: translateY(4px); opacity: 1; }
}

.ibf-storymap .split-wrap {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(320px, 1.1fr);
  gap: var(--space-10);
  align-items: center;
}

.ibf-storymap .insight-grid {
  display: grid;
  gap: var(--space-4);
  margin-top: var(--space-10);
}

.ibf-storymap .insight-grid {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

/* Sendai targets: 3 up top, 2 centered on the row below */
.ibf-storymap #sendai .insight-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
}

.ibf-storymap #sendai .insight-card {
  flex: 0 1 calc(33.333% - 11px);
  min-width: 220px;
  text-align: center;
}

.ibf-storymap .insight-card,
.ibf-storymap .resource-card {
  padding: var(--space-7);
  border: 1px solid var(--border);
  background: var(--white);
}

.ibf-storymap .insight-card span,
.ibf-storymap .resource-card span {
  display: inline-block;
  margin-bottom: var(--space-4);
  color: var(--escap-blue);
  font-family: var(--font-condensed);
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: 1;
}

.ibf-storymap .insight-card h3 {
  margin: var(--space-0) var(--space-0) var(--space-3);
  color: var(--escap-blue);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.ibf-storymap .insight-card p {
  margin: var(--space-0);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  line-height: var(--lh-base);
}

.ibf-storymap #case-studies .insight-card {
  cursor: pointer;
  transition: border-color 0.2s var(--ease-standard), box-shadow 0.2s var(--ease-standard);
}

.ibf-storymap #case-studies .insight-card:hover {
  box-shadow: var(--shadow-sm);
}

.ibf-storymap #case-studies .insight-card.active {
  border-color: var(--escap-blue);
  box-shadow: var(--shadow-md);
}

.ibf-storymap #case-studies .insight-card:focus-visible {
  outline: 2px solid var(--escap-blue);
  outline-offset: 2px;
}

/* Sendai Framework target colors (per UNDRR target-card scheme: A-D, G) */
.ibf-storymap .insight-card.sendai-target:nth-child(1) .sendai-face-front,
.ibf-storymap .insight-card.sendai-target:nth-child(1) .sendai-face-back { background: #fbdcc4; } /* Target A */
.ibf-storymap .insight-card.sendai-target:nth-child(2) .sendai-face-front,
.ibf-storymap .insight-card.sendai-target:nth-child(2) .sendai-face-back { background: #c9effa; } /* Target B */
.ibf-storymap .insight-card.sendai-target:nth-child(3) .sendai-face-front,
.ibf-storymap .insight-card.sendai-target:nth-child(3) .sendai-face-back { background: #f0cfee; } /* Target C */
.ibf-storymap .insight-card.sendai-target:nth-child(4) .sendai-face-front,
.ibf-storymap .insight-card.sendai-target:nth-child(4) .sendai-face-back { background: #d7f0d0; } /* Target D */
.ibf-storymap .insight-card.sendai-target:nth-child(5) .sendai-face-front,
.ibf-storymap .insight-card.sendai-target:nth-child(5) .sendai-face-back { background: #dce6f5; } /* Target G */

.ibf-storymap .insight-card.sendai-target span {
  color: var(--escap-blue-deep);
}

.ibf-storymap .insight-card.sendai-target h3 {
  color: var(--escap-blue-dark);
}

.ibf-storymap .insight-card.sendai-target {
  /* Longest front-face title (Target G) needs ~7 wrapped lines at the narrowest
     (min-width: 220px) card width before the flip faces clip. */
  height: 260px;
  padding: 0;
  border: 0;
  background: transparent;
  perspective: 1000px;
  cursor: pointer;
}

.ibf-storymap .sendai-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border: 1px solid var(--border);
}

.ibf-storymap .insight-card.sendai-target:hover .sendai-flip-inner,
.ibf-storymap .insight-card.sendai-target:focus-within .sendai-flip-inner,
.ibf-storymap .insight-card.sendai-target.flipped .sendai-flip-inner {
  transform: rotateY(180deg);
  border-color: var(--escap-blue-dark);
}

.ibf-storymap .insight-card.sendai-target:focus-visible {
  outline: 2px solid var(--escap-blue-dark);
  outline-offset: 2px;
}

.ibf-storymap .sendai-face-front,
.ibf-storymap .sendai-face-back {
  position: absolute;
  width: 100%;
  height: 100%;
  padding: var(--space-7);
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.ibf-storymap .sendai-face-front {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.ibf-storymap .sendai-face-back {
  display: flex;
  align-items: center;
  border-left: 4px solid var(--escap-blue-dark);
  transform: rotateY(180deg);
  overflow-y: auto;
  text-align: left;
}

.ibf-storymap .insight-card.sendai-target .sendai-face-back-desc {
  margin: var(--space-0);
  color: var(--escap-blue-dark);
  font-size: var(--text-sm);
  line-height: var(--lh-base);
}

@media (max-width: 767.98px) {
  .ibf-storymap #sendai .insight-card.sendai-target {
    flex: 100%;
    height: 300px;
  }
}
@media (max-width: 575.98px) {
  .ibf-storymap #sendai .insight-card.sendai-target {
    height: 260px;
  }
}

/* separates the EW4ALL sub-section from the value-chain content above it
   within the "Last mile" panel */
.ibf-storymap .ew4all-block {
  padding: var(--space-7);
  border-radius: var(--radius-3);
  background: var(--escap-blue-deep);
  color: var(--fg-onbrand);
}

.ibf-storymap #context .panel .ew4all-block .eyebrow {
  color: var(--escap-gold);
}

.ibf-storymap #context .panel .ew4all-block .section-h,
.ibf-storymap #context .panel .ew4all-block .section-lead {
  color: var(--fg-onbrand);
}

.ibf-storymap .ew4all-block .ibf-source {
  color: var(--fg-onbrand);
}

.ibf-storymap .ew4all-block .ibf-source a {
  color: var(--fg-onbrand);
}

/* EW4ALL pillar cards: full-color partner org logo centered below the body copy */
.ibf-storymap .ew4all-pillars .insight-card {
  display: flex;
  flex-direction: column;
  border-color: var(--escap-blue-deep);
}

.ibf-storymap .ew4all-pillars .insight-card img {
  display: block;
  width: auto;
  height: 60px;
  margin: var(--space-4) auto var(--space-0);
  margin-top: auto;
}

.ibf-storymap .process-card {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr;
  gap: var(--space-3);
  align-items: center;
  padding: var(--space-7);
  border: 1px solid var(--border);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.ibf-storymap .process-card div {
  min-height: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-4);
  background: var(--escap-blue-wash);
  color: var(--escap-blue);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wide);
  text-align: center;
  text-transform: uppercase;
}

.ibf-storymap .process-card span {
  display: inline-block;
  color: var(--escap-blue-pale);
  font-family: var(--font-condensed);
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  animation: process-arrow-flow 1.4s ease-in-out 3; /* finite: WCAG 2.2.2 */
}

@keyframes process-arrow-flow {
  0%, 100% { transform: translateX(0); opacity: 0.55; }
  50% { transform: translateX(10px); opacity: 1; }
}

/* 7. Data Inputs */
.ibf-storymap .hazex-accordion {
  margin-top: var(--space-10);
  border: 1px solid var(--border);
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.ibf-storymap .hazex-band {
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
}

.ibf-storymap .hazex-band:last-child {
  border-bottom: none;
}

.ibf-storymap .hazex-band-head {
  display: flex;
  align-items: center;
  gap: var(--space-5);
  width: 100%;
  border: 0;
  cursor: pointer;
  text-align: left;
  padding: var(--space-6) var(--space-6);
  color: var(--white);
  font-family: inherit;
}

.ibf-storymap .hazex-band[data-key="hazard"] .hazex-band-head {
  background: var(--escap-blue-deep);
}

.ibf-storymap .hazex-band[data-key="exposure"] .hazex-band-head {
  background: var(--escap-blue-dark);
}

.ibf-storymap .hazex-band-label {
  min-width: 190px;
  flex-shrink: 0;
}

.ibf-storymap .hazex-band-name {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
}

.ibf-storymap .hazex-band-sub {
  display: block;
  margin-top: var(--space-1);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  opacity: 0.82;
}

.ibf-storymap .hazex-band-summary {
  flex: 1;
  font-size: var(--text-xs);
  line-height: var(--lh-base);
  opacity: 0.9;
}

.ibf-storymap .hazex-chevron {
  flex-shrink: 0;
  width: 20px;
  height: 20px;
  opacity: 0.9;
  transition: transform var(--t-base) var(--ease-standard);
}

.ibf-storymap .hazex-band.open .hazex-chevron {
  transform: rotate(180deg);
}

.ibf-storymap .hazex-band-body {
  max-height: 0;
  overflow: hidden;
  background: var(--paper);
  transition: max-height 0.35s var(--ease-standard);
}

.ibf-storymap .hazex-band-body-inner {
  padding: var(--space-6);
}

.ibf-storymap .hazex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: var(--space-3);
}

.ibf-storymap .hazex-item {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: var(--space-4) var(--space-4);
  border: 1px solid var(--border);
  background: var(--white);
}

.ibf-storymap .hazex-item-title {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  color: var(--fg);
}

.ibf-storymap .hazex-item-desc {
  font-size: var(--text-xs);
  color: var(--fg-muted);
  line-height: var(--lh-base);
}

.ibf-storymap a.hazex-item {
  text-decoration: none;
  cursor: pointer;
  transition: border-color var(--t-base) var(--ease-standard), box-shadow var(--t-base) var(--ease-standard), transform var(--t-base) var(--ease-standard);
}

.ibf-storymap a.hazex-item:hover {
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.ibf-storymap .hazex-band[data-key="hazard"] a.hazex-item:hover {
  border-color: var(--escap-blue-deep);
}

.ibf-storymap .hazex-band[data-key="exposure"] a.hazex-item:hover {
  border-color: var(--escap-blue-dark);
}

.ibf-storymap .hazex-item-link-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
}

.ibf-storymap .hazex-ext-icon {
  flex-shrink: 0;
  width: 13px;
  height: 13px;
  opacity: 0.55;
}

.ibf-storymap .hazex-item-source {
  margin-top: auto;
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

.ibf-storymap .hazex-hint {
  margin: var(--space-4) var(--space-0) var(--space-0);
  font-size: var(--text-xs);
  color: var(--fg-muted);
}

@media (max-width: 767.98px) {
  .ibf-storymap .hazex-band-head {
    flex-wrap: wrap;
    gap: var(--space-3);
    padding: var(--space-5);
  }

  .ibf-storymap .hazex-band-label {
    min-width: 0;
  }

  .ibf-storymap .hazex-band-summary {
    width: 100%;
    order: 3;
  }

  .ibf-storymap .hazex-band-body-inner {
    padding: var(--space-5);
  }
}

.ibf-storymap .timescale-grid {
  display: grid;
  grid-template-columns: 1fr 1.6fr;
  gap: var(--space-6);
  margin-top: var(--space-10);
}

.ibf-storymap .timescale-banner {
  padding: var(--space-4) var(--space-5);
  background: var(--un-orange);
  color: var(--gray-900);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  text-align: center;
}

.ibf-storymap .timescale-subcols {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-6);
  margin-top: var(--space-6);
}

.ibf-storymap .timescale-flow {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-2);
  margin-top: var(--space-6);
  text-align: center;
}

.ibf-storymap .timescale-box {
  width: 100%;
  padding: var(--space-5) var(--space-5);
  background: #d6ecfa;
  color: var(--escap-blue-dark);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.ibf-storymap .timescale-arrow {
  color: var(--escap-blue-tint);
  font-size: var(--text-xl);
  line-height: 1;
}

.ibf-storymap .timescale-result {
  width: 100%;
  padding: var(--space-4) var(--space-5);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
}

.ibf-storymap .timescale-result.dark { background: var(--escap-blue-deep); }
.ibf-storymap .timescale-result.mid { background: var(--escap-blue); }
.ibf-storymap .timescale-result.deep { background: var(--un-blue-aa); }

.ibf-storymap .timescale-notes {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  margin-top: var(--space-5);
}

.ibf-storymap .timescale-note {
  padding: var(--space-4) var(--space-5);
  border: 1px solid var(--border);
  background: var(--white);
}

.ibf-storymap .timescale-note h3 {
  margin: var(--space-0) var(--space-0) var(--space-2);
  color: var(--escap-blue);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-weight: var(--weight-medium);
}

.ibf-storymap .timescale-note p {
  margin: var(--space-0);
  color: var(--fg-muted);
  font-size: var(--text-xs);
  line-height: var(--lh-base);
}

@media (max-width: 767.98px) {
  .ibf-storymap .timescale-grid,
  .ibf-storymap .timescale-subcols {
    grid-template-columns: 1fr;
  }
}

.ibf-storymap .interpret-image {
  position: relative;
  width: 100%;
  overflow: hidden;
  max-height: 60vh;
  aspect-ratio: 2048 / 1577;
  margin-top: var(--space-8);
}

.ibf-storymap .interpret-image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

.ibf-storymap .interpret-callout {
  position: absolute;
  max-width: 260px;
  padding: var(--space-3) var(--space-4);
  border-radius: var(--radius-4);
  font-size: var(--text-base);
  line-height: var(--lh-snug);
  box-shadow: var(--shadow-lg);
  transform: translate(-50%, -50%);
}

.ibf-storymap .interpret-callout::before {
  content: "";
  position: absolute;
  top: -6px;
  left: -6px;
  /* raw: no space/radius token matches 10px marker size without visible resizing */
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: currentColor;
  border: 2px solid var(--white);
}

.ibf-storymap .interpret-callout b {
  display: block;
  margin-bottom: var(--space-1);
  font-size: var(--text-xl);
}

.ibf-storymap .interpret-callout span {
  color: var(--gray-900);
}

.ibf-storymap .interpret-callout--below-normal {
  left: 44%;
  top: 46%;
  color: var(--un-yellow-shade);
  background: var(--un-yellow-tint-50);
}

.ibf-storymap .interpret-callout--near-normal {
  left: 46%;
  top: 87%;
  color: var(--escap-blue);
  background: var(--escap-blue-wash);
}

.ibf-storymap .interpret-callout--above-normal {
  left: 75%;
  top: 85%;
  color: var(--escap-blue-dark);
  background: var(--escap-blue-pale);
}

@media (max-width: 767.98px) {
  .ibf-storymap .interpret-image {
    max-height: none;
    overflow: visible;
    aspect-ratio: auto;
  }

  .ibf-storymap .interpret-image img {
    height: auto;
    object-fit: unset;
  }

  .ibf-storymap .interpret-callout {
    position: static;
    display: block;
    transform: none;
    max-width: none;
    margin-top: var(--space-3);
    padding: var(--space-1) var(--space-3);
  }

  .ibf-storymap .interpret-callout b {
    font-size: var(--text-base);
  }

  .ibf-storymap .interpret-callout span {
    font-size: var(--text-xs);
  }

  .ibf-storymap .interpret-callout--below-normal {
    color: var(--gray-900);
  }
}

.ibf-storymap .pathway-board {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  margin-top: var(--space-10);
  border: 1px solid var(--border);
  background: var(--escap-blue-wash);
}

.ibf-storymap .pathway-board::before {
  content: '';
  position: absolute;
  left: 8%;
  right: 8%;
  top: 38px;
  z-index: 1;
  height: 2px;
  background: linear-gradient(90deg, var(--escap-gold), var(--escap-blue-pale));
  opacity: 0.55;
}

.ibf-storymap .pathway-step {
  position: relative;
  min-height: 330px;
  padding: var(--space-11) var(--space-7) var(--space-7);
  background: var(--white);
  border-right: 1px solid var(--border);
}

.ibf-storymap .pathway-step::before {
  content: '';
  position: absolute;
  top: 31px;
  left: 28px;
  z-index: 1;
  width: 16px;
  height: 16px;
  border: 3px solid var(--escap-blue-deep);
  border-radius: 50%;
  background: var(--escap-gold);
}

.ibf-storymap .pathway-step.outcome {
  background: linear-gradient(180deg, var(--escap-blue-wash), var(--white));
}

.ibf-storymap .pathway-n {
  display: block;
  margin-bottom: var(--space-7);
  color: var(--escap-blue);
  font-family: var(--font-condensed);
  font-size: clamp(var(--text-6xl), 7vw, var(--text-8xl));
  font-weight: var(--weight-bold);
  line-height: 0.75;
}

.ibf-storymap .pathway-step h3 {
  margin: var(--space-0) var(--space-0) var(--space-4);
  color: var(--escap-blue-deep);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}

.ibf-storymap .pathway-step p {
  margin: var(--space-0);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  line-height: var(--lh-base);
}

.ibf-storymap .resource-card {
  min-height: 220px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  text-align: center;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
  transition: transform var(--t-base) var(--ease-standard), box-shadow var(--t-base) var(--ease-standard);
}

.ibf-storymap .resource-card:hover,
.ibf-storymap .resource-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.ibf-storymap .resource-card.dark {
  border-radius: var(--radius-2);
  background: #1b6478;
  border-color: #1b6478;
}

.ibf-storymap .resource-card.dark h3 {
  margin: var(--space-0);
  color: var(--white);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

.ibf-storymap #resources .resource-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
  justify-content: center;
}

.ibf-storymap #resources .resource-row-1 .resource-card {
  flex: 0 1 calc(33.333% - 11px);
  min-width: 200px;
  min-height: 220px;
  padding: var(--space-7);
}
.ibf-storymap #resources .resource-row-1 .resource-card h3 {
  font-size: var(--text-base);
}

.ibf-storymap #resources .resource-row-2 {
  margin-top: var(--space-7);
}

.ibf-storymap #resources .resource-row-2 .resource-card {
  flex: 0 1 calc(16.5% - 13px);
  min-width: 100px;
  min-height: 150px;
  padding: var(--space-5);
}
.ibf-storymap #resources .resource-row-2 .resource-card h3 {
  font-size: var(--text-sm);
}

.ibf-storymap #resources .resource-card .subtitle {
  margin: var(--space-2) var(--space-0) var(--space-0);
  font-size: var(--text-xs);
  opacity: 0.8;
  color: var(--white);
}

@media (max-width: 991.98px) {
  .ibf-storymap #resources .resource-row-1 .resource-card {
    flex: 1 1 calc(50% - 8px);
    min-width: 140px;
  }
  .ibf-storymap #resources .resource-row-2 .resource-card {
    flex: 1 1 calc(33.333% - 11px);
    min-width: 110px;
  }
}

@media (max-width: 575.98px) {
  .ibf-storymap #resources .resource-row-1 .resource-card,
  .ibf-storymap #resources .resource-row-2 .resource-card {
    flex: 1 1 100%;
  }
}

.ibf-storymap .sdg-explorer {
  margin-top: var(--space-10);
}

.ibf-storymap .sdg-icon-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-3);
}

@media (max-width: 767.98px) {
  .ibf-storymap .sdg-icon-grid {
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  }
}

.ibf-storymap .sdg-icon-btn {
  height: 228px;
  background-color: transparent;
  perspective: 1000px;
  cursor: pointer;
}

.ibf-storymap .sdg-flip-inner {
  position: relative;
  width: 100%;
  height: 100%;
  transition: transform 0.6s;
  transform-style: preserve-3d;
  border: 1px solid var(--border);
}

.ibf-storymap .sdg-icon-btn:hover .sdg-flip-inner,
.ibf-storymap .sdg-icon-btn:focus-within .sdg-flip-inner,
.ibf-storymap .sdg-icon-btn.flipped .sdg-flip-inner {
  transform: rotateY(180deg);
  border-color: var(--escap-blue-pale);
}

.ibf-storymap .sdg-icon-btn:focus-visible {
  outline: 2px solid var(--escap-blue);
  outline-offset: 2px;
}

.ibf-storymap .sdg-face-front,
.ibf-storymap .sdg-face-back {
  position: absolute;
  width: 100%;
  height: 100%;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}

.ibf-storymap .sdg-face-front {
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--white);
}

.ibf-storymap .sdg-face-front img {
  width: auto;
  height: 100%;
  max-width: 100%;
  aspect-ratio: 1;
  object-fit: contain;
}

.ibf-storymap .sdg-face-back {
  display: flex;
  flex-direction: column;
  padding: var(--space-4);
  background: var(--escap-blue-wash);
  border-left: 4px solid var(--escap-blue);
  transform: rotateY(180deg);
  overflow-y: auto;
}

.ibf-storymap .sdg-face-back h3 {
  margin: var(--space-0) var(--space-0) var(--space-3);
  color: var(--escap-blue);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
}

.ibf-storymap .sdg-face-back p {
  margin: var(--space-0) var(--space-0) var(--space-3);
  color: var(--fg-muted);
  font-size: var(--text-sm);
  line-height: var(--lh-base);
  flex: 1;
}

.ibf-storymap .sdg-face-back-link {
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  color: var(--escap-blue);
  text-decoration: none;
  text-transform: uppercase;
}

.ibf-storymap .sdg-face-back-link:hover {
  text-decoration: underline;
}

@media (max-width: 767.98px) {
  .ibf-storymap .sdg-icon-btn {
    height: 275px;
  }
}
@media (max-width: 575.98px) {
  .ibf-storymap .sdg-icon-btn {
    height: 228px;
  }
}

.ibf-storymap .gfcs-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(300px, 0.85fr);
  gap: var(--space-10);
  align-items: center;
  margin-top: var(--space-10);
}
@media (max-width: 767.98px) {
  .ibf-storymap .gfcs-layout {
    grid-template-columns: 1fr;
  }
}

.ibf-storymap .gfcs-text p {
  margin: var(--space-0) var(--space-0) var(--space-3);
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: var(--lh-base);
}
.ibf-storymap .gfcs-text p strong {
  color: var(--escap-blue-dark);
}
.ibf-storymap .gfcs-text ul {
  margin: var(--space-3) var(--space-0) var(--space-5);
  padding-left: var(--space-5);
}
.ibf-storymap .gfcs-text li {
  color: var(--escap-blue-dark);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-bold);
  line-height: var(--lh-loose);
}

.ibf-storymap .gfcs-panel {
  border: 1px solid var(--un-purple-tint);
  border-radius: var(--radius-4);
  padding: var(--space-7) var(--space-6) var(--space-8);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}
.ibf-storymap .gfcs-panel h3 {
  margin: var(--space-0) var(--space-0) var(--space-1);
  color: var(--escap-blue);
  font-family: var(--font-sans);
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  text-align: center;
}
.ibf-storymap .gfcs-panel .sub2 {
  margin: var(--space-0) var(--space-0) var(--space-6);
  color: var(--fg-muted);
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  text-align: center;
}
.ibf-storymap .gfcs-icons {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6) var(--space-5);
  justify-items: center;
}
.ibf-storymap .gfcs-row3 {
  grid-column: span 2;
  display: flex;
  justify-content: center;
  gap: var(--space-7);
}
.ibf-storymap .gfcs-icon-item {
  text-align: center;
}
.ibf-storymap .gfcs-circle {
  display: flex;
  width: 72px;
  height: 72px;
  margin: var(--space-0) auto var(--space-3);
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-pill);
  background: var(--un-purple-tint-50);
  font-size: var(--text-2xl);
}
.ibf-storymap .gfcs-icon-item .lbl {
  color: var(--fg);
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--weight-medium);
  line-height: var(--lh-snug);
}
@media (max-width: 575.98px) {
  .ibf-storymap .gfcs-icons {
    grid-template-columns: 1fr 1fr;
  }
}

/* 10. Outputs */

/* Footer */
.ibf-storymap .site-footer {
  padding: var(--space-10) var(--space-7);
  background: var(--escap-blue-dark);
  color: rgba(255, 255, 255, 0.68);
}

.ibf-storymap .footer-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: start;
  justify-content: space-between;
  gap: var(--space-7);
  max-width: var(--container-lg);
  margin: var(--space-0) auto;
}

.ibf-storymap .footer-brand {
  color: var(--white);
  font-family: var(--font-condensed);
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.ibf-storymap .footer-org {
  margin-top: var(--space-2);
  color: var(--escap-gold);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.ibf-storymap .footer-meta {
  color: rgba(255, 255, 255, 0.78);
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: var(--tracking-wider);
  line-height: 2;
  text-align: right;
  text-transform: uppercase;
}

@keyframes pulse-ring {
  0% { transform: scale(0.6); opacity: 0.8; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* Slide 11 NDC card note */
.ibf-storymap .insight-card.highlight {
  border-color: var(--escap-blue);
  background: var(--escap-blue-wash);
}

.ibf-storymap .insight-card.dark {
  background: #1b6478;
  border-color: #1b6478;
}

.ibf-storymap .insight-card.dark h3 {
  color: var(--white);
}

.ibf-storymap .insight-card.dark p {
  color: rgba(255, 255, 255, 0.8);
}

/* Responsive */
@media (max-width: 991.98px) {
  .ibf-storymap .pathway-board {
    grid-template-columns: 1fr;
  }

  .ibf-storymap .pathway-board::before {
    top: 8%;
    bottom: 8%;
    left: 36px;
    right: auto;
    width: 2px;
    height: auto;
    background: linear-gradient(180deg, var(--escap-gold), var(--escap-blue-pale));
  }

  .ibf-storymap .pathway-step {
    min-height: auto;
    padding: var(--space-9) var(--space-7) var(--space-7) var(--space-11);
  }

  .ibf-storymap .pathway-step::before {
    top: 46px;
    left: 28px;
  }

  .ibf-storymap .pathway-n {
    margin-bottom: var(--space-6);
  }

  .ibf-storymap .split-wrap {
    grid-template-columns: 1fr;
  }

  .ibf-storymap .process-card {
    grid-template-columns: 1fr;
  }

  .ibf-storymap .process-card span {
    transform: rotate(90deg);
    text-align: center;
  }

  .ibf-storymap .stat-row {
    grid-template-columns: repeat(2, 1fr);
  }

  .ibf-storymap .site-nav {
    flex-direction: column;
    align-items: flex-start;
  }

  .ibf-storymap .nav-links {
    justify-content: flex-start;
  }

}

@media (max-width: 767.98px) {
  .ibf-storymap .site-nav .nav-links,
  .ibf-storymap .side-nav {
    display: none;
  }

  .ibf-storymap section {
    padding: var(--space-10) var(--space-4);
  }

  .ibf-storymap .stat-row {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-2);
  }

  .ibf-storymap .stat-cell {
    min-width: 0;
    padding: var(--space-7) var(--space-3);
  }

}

@media (prefers-reduced-motion: reduce) {
  .ibf-storymap .rv {
    opacity: 1;
    transform: none;
  }

  .ibf-storymap .process-card span {
    animation: none;
  }

}

@media (hover: none), (max-width: 767.98px) {
  .ibf-storymap .cof-step {
    min-height: 44px;
  }
}

@media (max-width: 767.98px) {
  .ibf-storymap .cof-map {
    height: 440px; /* raw: map canvas height */
  }

  .ibf-storymap .cof-sidebar {
    position: static;
    width: auto;
    max-height: none;
    margin-top: var(--space-4);
  }

  .ibf-storymap .cof-sidebar-list {
    columns: 1;
    max-height: 260px;
  }
}

/* Deliberate exception to the .ibf-storymap-scoped convention: undoes an
   iddtheme rule that hides these page-level regions for legacy portal pages
   whose body class happens to also match [class*="page-ibf"]. */
body.page-ibf-story .region-navbar,
body.page-ibf-story .footer {
  display: block !important;
}

body.page-ibf-story .main-content__content {
  margin-bottom: 0;
}

/* First-paint loading veil: duplicated in ibf-critical.css so incomplete
   layout never flashes before deferred styles and scripts have settled. */
.ibf-storymap .ibf-page-loader {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast, 400);
  display: grid;
  place-items: center;
  background: var(--escap-blue-deep, #17354e);
  color: var(--white, #ffffff);
  opacity: 1;
  visibility: visible;
  transition: opacity var(--t-slow, 280ms) var(--ease-standard, ease), visibility var(--t-slow, 280ms) var(--ease-standard, ease);
}
.ibf-storymap .ibf-page-loader.is-loaded {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}
.ibf-storymap .ibf-page-loader[hidden] {
  display: none;
}
.ibf-storymap .ibf-page-loader-inner {
  display: flex;
  width: min(240px, calc(100vw - 48px));
  flex-direction: column;
  align-items: center;
  gap: var(--space-4, 16px);
}
.ibf-storymap .ibf-page-loader-brand {
  color: var(--white, #ffffff);
  font-family: var(--font-condensed, 'Arial Narrow', sans-serif);
  font-size: var(--text-5xl, 36px);
  font-weight: var(--weight-bold, 700);
  letter-spacing: var(--tracking-wide, 0.04em);
}
.ibf-storymap .ibf-page-loader-track {
  position: relative;
  width: 100%;
  height: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.18);
}
.ibf-storymap .ibf-page-loader-track span {
  position: absolute;
  inset: 0;
  background: var(--escap-gold, #f4be18);
  transform: translateX(-72%);
  animation: ibf-page-loading 1.2s var(--ease-standard, ease) infinite;
}
.ibf-storymap .ibf-page-loader-label {
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-sans, Arial, sans-serif);
  font-size: var(--text-sm, 14px);
}
@keyframes ibf-page-loading {
  50% { transform: translateX(72%); }
  100% { transform: translateX(172%); }
}
@media (prefers-reduced-motion: reduce) {
  .ibf-storymap .ibf-page-loader-track span {
    animation: none;
    transform: none;
  }
}

.ibf-storymap .hero-credit {
  position: absolute;
  right: var(--space-7, 32px);
  bottom: var(--space-4, 16px);
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-family: var(--font-sans);
  font-size: var(--text-xs, 12px);
  line-height: var(--lh-base, 1.5);
  text-shadow: 0 var(--space-1, 4px) var(--space-3, 12px) rgba(0, 0, 0, 0.56);
}
