/* gs/report-nav: report layout with a sticky section menu in the left margin or across the top. */

.gs-report {
  --gs-report-accent: #1C7293;
  --gs-report-tint: color-mix(in srgb, var(--gs-report-accent) 9%, transparent);
  --gs-report-ink: #2E2D2C;
  --gs-report-muted: #737271;
  --gs-report-rule: #E4E4E4;
  --gs-report-bar-top: 64px;      /* fixed site/white paper header height on small screens */
  --gs-report-nav-top: 104px;     /* header height on desktop + breathing room */
  --gs-report-bar-height: 52px;
  --gs-report-header: 80px;       /* fixed white paper header height on desktop */
  position: relative;
}

/* The section menu replaces the white paper's hamburger menu on pages that use this block. */
body:has(.gs-report:not(.gs-report--preview)) .navbar-whitepaper .nav-menu-open {
  display: none;
}

body:has(.gs-report:not(.gs-report--preview)) .navbar-whitepaper .nav-menu-open + * {
  margin-left: 0 !important;
}

/* ---------- Report body ---------- */

.gs-report__body {
  min-width: 0;
  counter-reset: gs-report-section;
}

.gs-report__body :is(h2, h3).wp-block-heading,
.gs-report__body :is(h2, h3)[id] {
  scroll-margin-top: calc(var(--gs-report-bar-top) + var(--gs-report-bar-height) + 20px);
}

/* Each H2 opens a new section with a tinted "chapter" panel, so section breaks are easy to spot. */
.gs-report .gs-report__body h2 {
  margin-top: 6rem;
  margin-bottom: 2.25rem;
  padding: 2rem 1.5rem 2.25rem;
  border-top: 4px solid var(--gs-report-accent);
  border-radius: 0 0 8px 8px;
  background: var(--gs-report-tint);
}

.gs-report .gs-report__body > h2:first-child,
.gs-report .gs-report__body > .wp-block-group:first-child > h2:first-child {
  margin-top: 0;
}

@media (min-width: 768px) {
  .gs-report .gs-report__body h2 {
    padding: 2.5rem 2.25rem 2.75rem;
  }
}

/* Top-bar layout: the section panel runs the full width of the page, text stays in the column.
   The extra width is painted with a shadow and clipped to the heading's height, so the page
   never scrolls sideways. */
.gs-report--top .gs-report__body h2 {
  position: relative;
  padding-left: 0;
  padding-right: 0;
  border-top: 0;
  border-radius: 0;
  box-shadow: 0 0 0 100vmax var(--gs-report-tint);
  clip-path: inset(0 -100vmax);
}

.gs-report--top .gs-report__body h2::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: var(--gs-report-accent);
  box-shadow: 0 0 0 100vmax var(--gs-report-accent);
  clip-path: inset(0 -100vmax);
}

@media (min-width: 768px) {
  .gs-report--top .gs-report__body h2 {
    padding: 3rem 0 3.25rem;
  }
}

.gs-report--numbered .gs-report__body h2 {
  counter-increment: gs-report-section;
}

.gs-report--numbered .gs-report__body h2::before {
  content: "Section " counter(gs-report-section, decimal-leading-zero);
  display: block;
  margin-bottom: 0.875rem;
  font-family: Graphik, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gs-report-accent);
}

@media print {
  .gs-report .gs-report__body h2 {
    break-before: page;
    background: none;
  }
}

/* Optional lede paragraph under a section heading (add CSS class "gs-report-lede"). */
.gs-report__body p.gs-report-lede {
  font-size: 1.3rem;
  line-height: 1.5;
  font-style: italic;
  color: var(--gs-report-ink);
  margin-bottom: 2rem;
}

/* Card: a Group block with the CSS class "gs-report-card" gets a light grey rounded panel. */
.gs-report__body .gs-report-card {
  margin: 0 0 3rem;
  padding: 1.5rem 1.25rem;
  border-radius: 12px;
  background: #F4F4F3;
}

.gs-report__body .gs-report-card > :first-child {
  margin-top: 0;
}

.gs-report__body .gs-report-card > :last-child {
  margin-bottom: 0;
}

@media (min-width: 768px) {
  .gs-report__body .gs-report-card {
    padding: 2rem 2.25rem;
  }
}

/* Story image: a Group block with the CSS class "gs-story-media" holding a wide image and a
   button; the button sits over the image's bottom right corner. */
.gs-report__body .gs-story-media {
  position: relative;
  margin: 1.75rem 0 2.5rem;
  overflow: hidden;
  border-radius: 12px;
  background: #1E1E1D;
}

.gs-report__body .gs-story-media .wp-block-image {
  margin: 0;
}

.gs-report__body .gs-story-media .wp-block-image img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

/* Soft shade in the corner so the button stands out on bright images. */
.gs-report__body .gs-story-media::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: radial-gradient(ellipse at 100% 100%, rgba(20, 20, 19, 0.55) 0%, rgba(20, 20, 19, 0) 45%);
}

.gs-report__body .gs-story-media .wp-block-buttons {
  position: absolute;
  right: 0.875rem;
  bottom: 0.875rem;
  z-index: 1;
  margin: 0;
}

.gs-report__body .gs-story-media .wp-block-button__link {
  padding: 0.5rem 0.875rem;
  font-size: 0.75rem;
  box-shadow: 0 6px 18px -6px rgba(0, 0, 0, 0.45);
}

.gs-report__body .gs-story-media .wp-block-button__link::after {
  content: "\2192";
  margin-left: 0.5rem;
  transition: transform 0.2s;
}

.gs-report__body .gs-story-media .wp-block-button__link:hover::after {
  transform: translateX(3px);
}

@media (min-width: 768px) {
  .gs-report__body .gs-story-media .wp-block-buttons {
    right: 1.25rem;
    bottom: 1.25rem;
  }

  .gs-report__body .gs-story-media .wp-block-button__link {
    padding: 0.75rem 1.375rem;
    font-size: 0.875rem;
  }
}

/* Buttons inside the report pick up the accent color. */
.gs-report__body .wp-block-button__link {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.375rem;
  border-radius: 999px;
  font-family: Graphik, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.2;
  color: #fff !important;
  text-decoration: none !important;
  background: var(--gs-report-accent);
  transition: filter 0.2s;
}

.gs-report__body .wp-block-button__link:hover {
  filter: brightness(0.9);
}

/* ---------- Section menu ---------- */

.gs-report__nav {
  font-family: Graphik, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  color: var(--gs-report-ink);
}

.gs-report__nav ol,
.gs-report__nav ul,
.gs-report__nav li {
  list-style: none !important;
  margin: 0;
  padding: 0;
}

.gs-report__nav a {
  text-decoration: none !important;
  color: inherit;
}

.gs-report__nav-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  padding: 0 0 0.75rem 0.875rem;
}

.gs-report__nav-label {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gs-report-ink);
}

.gs-report__nav-meta {
  font-size: 0.75rem;
  color: var(--gs-report-muted);
  white-space: nowrap;
}

.gs-report__progress {
  height: 3px;
  background: var(--gs-report-rule);
  border-radius: 3px;
  overflow: hidden;
}

.gs-report__progress span {
  display: block;
  height: 100%;
  width: 100%;
  background: var(--gs-report-accent);
  transform: scaleX(0);
  transform-origin: left center;
}

.gs-report__list {
  counter-reset: none;
}

.gs-report__item + .gs-report__item {
  margin-top: 2px;
}

.gs-report__link {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: baseline;
  gap: 0.625rem;
  padding: 0.6rem 0.75rem 0.6rem 0.875rem;
  border-left: 3px solid transparent;
  border-radius: 0 6px 6px 0;
  font-size: 0.9375rem;
  line-height: 1.3;
  font-weight: 500;
  transition: background-color 0.2s, border-color 0.2s, color 0.2s;
}

.gs-report:not(.gs-report--numbered) .gs-report__link {
  grid-template-columns: 1fr auto;
}

.gs-report__link:hover {
  background: #F6F6F5;
}

.gs-report__num {
  font-size: 0.75rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  color: var(--gs-report-muted);
  transition: color 0.2s;
}

.gs-report__time {
  font-size: 0.6875rem;
  color: var(--gs-report-muted);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.2s;
}

.gs-report__link:hover .gs-report__time,
.gs-report__item.is-active .gs-report__time {
  opacity: 1;
}

/* Sections already read: number takes the accent color. */
.gs-report__item.is-read .gs-report__num {
  color: var(--gs-report-accent);
}

/* Current section. */
.gs-report__item.is-active > .gs-report__link {
  border-left-color: var(--gs-report-accent);
  background: var(--gs-report-tint);
  color: var(--gs-report-accent);
  font-weight: 600;
}

.gs-report__item.is-active .gs-report__num {
  color: var(--gs-report-accent);
}

/* Sub-sections: all visible without JS; with JS only the current section's open. */
.gs-report__sublist {
  margin: 0.25rem 0 0.5rem 0 !important;
  padding-left: calc(0.875rem + 3px) !important;
}

.gs-report.is-enhanced .gs-report__sublist {
  display: none;
}

.gs-report.is-enhanced .gs-report__item.is-active .gs-report__sublist {
  display: block;
}

.gs-report--numbered .gs-report__sublist {
  padding-left: calc(0.875rem + 3px + 1.5rem) !important;
}

.gs-report__sublink {
  position: relative;
  display: block;
  padding: 0.3rem 0.5rem 0.3rem 0.875rem;
  font-size: 0.8125rem;
  line-height: 1.35;
  color: var(--gs-report-muted) !important;
  border-left: 1px solid var(--gs-report-rule);
  transition: color 0.2s, border-color 0.2s;
}

.gs-report__sublink:hover {
  color: var(--gs-report-ink) !important;
}

.gs-report__sublink.is-active {
  color: var(--gs-report-ink) !important;
  font-weight: 600;
  border-left-color: var(--gs-report-accent);
}

.gs-report__actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.25rem;
  margin-top: 1.25rem;
  padding: 1rem 0 0 0.875rem;
  border-top: 1px solid var(--gs-report-rule);
}

.gs-report__action {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  color: var(--gs-report-muted) !important;
  background: none;
  border: 0;
  cursor: pointer;
  transition: color 0.2s;
}

.gs-report__action:hover {
  color: var(--gs-report-accent) !important;
}

.gs-report__nav a:focus-visible,
.gs-report__nav button:focus-visible {
  outline: 2px solid var(--gs-report-accent);
  outline-offset: 2px;
}

/* Per-section progress segments: only used by the top bar. */
.gs-report__seg {
  display: none;
}

/* Mobile "Jump to section" toggle. */
.gs-report__toggle {
  display: none;
}

/* ---------- Small screens: sticky "Jump to section" bar ---------- */

@media (max-width: 1023.98px) {
  .gs-report__nav {
    position: sticky;
    top: var(--gs-report-bar-top);
    z-index: 20;
    margin: 0 -1.25rem 2rem;
    background: #fff;
    border-bottom: 1px solid var(--gs-report-rule);
  }

  .gs-report__nav-inner {
    position: relative;
  }

  .gs-report__toggle {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    width: 100%;
    min-height: var(--gs-report-bar-height);
    padding: 0.5rem 1.25rem;
    background: none;
    border: 0;
    text-align: left;
    font: inherit;
    color: var(--gs-report-ink);
    cursor: pointer;
  }

  .gs-report__toggle-label {
    flex-shrink: 0;
    font-size: 0.6875rem;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--gs-report-muted);
  }

  .gs-report__toggle-current {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    font-size: 0.9375rem;
    font-weight: 600;
    color: var(--gs-report-accent);
  }

  .gs-report__toggle-icon {
    flex-shrink: 0;
    transition: transform 0.2s;
  }

  .gs-report__toggle[aria-expanded="true"] .gs-report__toggle-icon {
    transform: rotate(180deg);
  }

  .gs-report__progress {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -1px;
    height: 2px;
    border-radius: 0;
    background: transparent;
  }

  .gs-report__nav-head {
    display: none;
  }

  /* Without JS the menu simply shows inline; with JS it becomes a drop-down panel. */
  .gs-report__menu {
    padding: 0.5rem 0.5rem 1rem;
  }

  .gs-report.is-enhanced .gs-report__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    max-height: min(70vh, 560px);
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-bottom: 1px solid var(--gs-report-rule);
    box-shadow: 0 16px 32px -12px rgba(30, 30, 29, 0.25);
  }

  .gs-report.is-enhanced.is-open .gs-report__menu {
    display: block;
  }

  .gs-report:not(.is-enhanced) .gs-report__toggle {
    display: none;
  }

  .gs-report__time {
    opacity: 1;
  }
}

/* ---------- Desktop: menu in the left margin ---------- */

@media (min-width: 1024px) {
  .gs-report {
    display: grid;
    grid-template-columns: minmax(14rem, 17rem) minmax(0, 1fr);
    column-gap: clamp(2.5rem, 5vw, 5rem);
    align-items: start;
  }

  .gs-report__nav {
    position: sticky;
    top: var(--gs-report-nav-top);
    max-height: calc(100vh - var(--gs-report-nav-top) - 1.5rem);
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: thin;
    padding-bottom: 1rem;
  }

  .gs-report__progress {
    margin: 0 0 1rem 0.875rem;
  }

  /* Titles get the full width; reading time drops under the current section's title. */
  .gs-report__link {
    grid-template-columns: auto 1fr;
    row-gap: 0.125rem;
  }

  .gs-report:not(.gs-report--numbered) .gs-report__link {
    grid-template-columns: 1fr;
  }

  .gs-report__time {
    display: none;
    grid-column: -2;
    opacity: 1;
    font-weight: 500;
  }

  .gs-report__item.is-active .gs-report__time {
    display: block;
  }

  .gs-report__body {
    max-width: 46rem;
    grid-column: 2;
  }

  .gs-report__body :is(h2, h3).wp-block-heading,
  .gs-report__body :is(h2, h3)[id] {
    scroll-margin-top: calc(var(--gs-report-nav-top) - 8px);
  }
}

@media (min-width: 1280px) {
  .gs-report__body {
    max-width: 48rem;
  }
}

/* ---------- Desktop: horizontal bar across the top ---------- */

@media (min-width: 1024px) {
  .gs-report--top {
    display: block;
  }

  .gs-report--top .gs-report__nav {
    position: sticky;
    top: var(--gs-report-header);
    z-index: 25;
    max-height: none;
    overflow: visible;
    padding: 0;
    margin-bottom: 3.5rem;
    background: #fff;
  }

  /* Paint the bar and its bottom rule edge to edge without widening the page. */
  .gs-report--top .gs-report__nav::before,
  .gs-report--top .gs-report__nav::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    z-index: -1;
    clip-path: inset(0 -100vmax);
  }

  .gs-report--top .gs-report__nav::before {
    top: 0;
    bottom: 0;
    background: #fff;
    box-shadow: 0 0 0 100vmax #fff;
  }

  .gs-report--top .gs-report__nav::after {
    bottom: 0;
    height: 1px;
    background: var(--gs-report-rule);
    box-shadow: 0 0 0 100vmax var(--gs-report-rule);
  }

  .gs-report--top .gs-report__nav-inner {
    display: flex;
    align-items: stretch;
  }

  .gs-report--top .gs-report__progress {
    display: none;
  }

  /* Label + total reading time on the left of the bar. */
  .gs-report--top .gs-report__nav-head {
    flex: 0 0 auto;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    padding: 0 1.5rem 0 0;
    margin-right: 0.5rem;
    border-right: 1px solid var(--gs-report-rule);
  }

  .gs-report--top .gs-report__menu {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: stretch;
  }

  .gs-report--top .gs-report__list {
    flex: 1;
    min-width: 0;
    display: flex;
  }

  .gs-report--top .gs-report__item {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
    margin: 0 !important;
  }

  .gs-report--top .gs-report__link {
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 0.2rem;
    height: 100%;
    padding: 0.95rem 0.75rem 1.05rem;
    border-left: 0;
    border-radius: 0;
    font-size: 0.8125rem;
    line-height: 1.3;
  }

  .gs-report--top .gs-report__title {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
  }

  .gs-report--top .gs-report__num {
    font-size: 0.6875rem;
    letter-spacing: 0.06em;
  }

  .gs-report--top .gs-report__item .gs-report__time {
    display: none;
  }

  .gs-report--top .gs-report__item.is-active > .gs-report__link {
    background: var(--gs-report-tint);
  }

  /* Segmented progress along the bottom edge: read sections full, current one filling up. */
  .gs-report--top .gs-report__seg {
    display: block;
    position: absolute;
    left: 2px;
    right: 2px;
    bottom: 0;
    z-index: 1;
    height: 3px;
    overflow: hidden;
    background: var(--gs-report-rule);
  }

  .gs-report--top .gs-report__seg span {
    display: block;
    height: 100%;
    background: var(--gs-report-accent);
    transform: scaleX(0);
    transform-origin: left center;
  }

  .gs-report--top:not(.is-enhanced) .gs-report__seg {
    display: none;
  }

  /* Sub-sections drop down from each section on hover or keyboard focus. */
  .gs-report.gs-report--top .gs-report__sublist,
  .gs-report.gs-report--top.is-enhanced .gs-report__item.is-active .gs-report__sublist {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 2;
    width: 20rem;
    margin: 0 !important;
    padding: 0.5rem 0.5rem 0.625rem !important;
    background: #fff;
    border: 1px solid var(--gs-report-rule);
    border-top: 0;
    border-radius: 0 0 8px 8px;
    box-shadow: 0 18px 32px -14px rgba(30, 30, 29, 0.3);
  }

  .gs-report.gs-report--top .gs-report__item:nth-last-child(-n+2) .gs-report__sublist {
    left: auto;
    right: 0;
  }

  .gs-report.gs-report--top .gs-report__item.gs-report__item:is(:hover, :focus-within) .gs-report__sublist {
    display: block;
  }

  .gs-report--top .gs-report__sublink {
    border-left: 2px solid transparent;
    border-radius: 0 4px 4px 0;
  }

  .gs-report--top .gs-report__sublink:hover {
    background: #F6F6F5;
  }

  /* Download / copy link as icon buttons at the right end of the bar. */
  .gs-report--top .gs-report__actions {
    flex: 0 0 auto;
    flex-direction: row;
    align-items: center;
    gap: 0.125rem;
    margin: 0 0 0 0.5rem;
    padding: 0 0 0 0.75rem;
    border-top: 0;
    border-left: 1px solid var(--gs-report-rule);
  }

  .gs-report--top .gs-report__action {
    position: relative;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    padding: 0;
    border-radius: 50%;
  }

  .gs-report--top .gs-report__action:hover {
    background: var(--gs-report-tint);
  }

  .gs-report--top .gs-report__action svg {
    width: 16px;
    height: 16px;
  }

  /* Labeled button (block's "Extra link"), e.g. a companion paper download. */
  .gs-report--top .gs-report__action.gs-report__action--text {
    width: auto;
    max-width: 13.5rem;
    height: auto;
    gap: 0.5rem;
    padding: 0.5rem 0.875rem;
    border: 1px solid var(--gs-report-accent);
    border-radius: 8px;
    font-size: 0.75rem;
    font-weight: 600;
    line-height: 1.25;
    color: var(--gs-report-accent) !important;
  }

  .gs-report--top .gs-report__action.gs-report__action--text:hover {
    background: var(--gs-report-accent);
    color: #fff !important;
  }

  .gs-report--top .gs-report__action--text svg {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
  }

  .gs-report--top .gs-report__action-text {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }

  /* "Link copied" confirmation pops up under the button. */
  .gs-report--top .gs-report__action.is-copied .gs-report__action-text {
    top: calc(100% + 6px);
    right: 0;
    width: auto;
    height: auto;
    clip: auto;
    padding: 0.3rem 0.6rem;
    border-radius: 4px;
    font-size: 0.75rem;
    color: #fff;
    background: var(--gs-report-ink);
  }

  .gs-report--top [data-report-top] {
    display: none;
  }

  .gs-report--top .gs-report__body {
    max-width: 46rem;
    margin-inline: auto;
  }

  .gs-report--top .gs-report__body :is(h2, h3).wp-block-heading,
  .gs-report--top .gs-report__body :is(h2, h3)[id] {
    scroll-margin-top: calc(var(--gs-report-header) + 6.5rem);
  }
}

@media (min-width: 1024px) and (max-width: 1279.98px) {
  /* Give the section names the room on narrower desktops. */
  .gs-report--top .gs-report__nav-head {
    display: none;
  }
}

@media (min-width: 1024px) and (max-width: 1599.98px) {
  /* An extra labeled button takes the label's place. */
  .gs-report--top.gs-report--has-extra .gs-report__nav-head {
    display: none;
  }
}

@media (min-width: 1280px) {
  .gs-report--top .gs-report__body {
    max-width: 48rem;
  }
}

/* ---------- Editor preview ---------- */

.gs-report--preview .gs-report__nav {
  position: static;
  margin: 0 0 1.5rem;
  padding: 1rem;
  border: 1px dashed #A1A09F;
  border-radius: 6px;
  background: #FAFAF9;
}

.gs-report--preview .gs-report__preview-note {
  margin: 0.5rem 0 0;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--gs-report-muted);
}

/* ---------- Motion and print ---------- */

@media (prefers-reduced-motion: reduce) {
  .gs-report *,
  .gs-report *::before {
    transition: none !important;
  }
}

@media print {
  .gs-report {
    display: block;
  }

  .gs-report__nav {
    display: none !important;
  }

  .gs-report__body {
    max-width: none;
  }
}
