/* ==========================================================================
   Landing page — Research / Publications (#nsrl-rp)
   Two columns: sticky intro + pill switch on the left, numbered list on the right.
   repub-display.js renders the rows, the skeleton rows and runs the switcher.
   The pill switch answers the test feedback (users could not tell Research /
   Publications were clickable).
   ========================================================================== */

.nsrl-rp {
  width: 100%;
  padding: var(--nsrl-section-y) var(--nsrl-gutter);
  background-color: var(--nsrl-color-surface-alt);
}

.nsrl-rp .nsrl-rp__inner {
  max-width: var(--nsrl-container-wide);
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.4fr);
  gap: clamp(32px, 6vw, 96px);
  align-items: start;
}

/* ---------- Intro (sticky on desktop) ---------- */
.nsrl-rp__intro {
  position: -webkit-sticky;
  position: sticky;
  top: calc(var(--nsrl-anchor-offset) - 40px);
}
.nsrl-rp .nsrl-rp__title-main { max-width: 10ch; }
.nsrl-rp p.nsrl-rp__lead {
  max-width: 40ch;
  margin: 24px 0 32px;
  font-size: var(--nsrl-fs-lead);
  line-height: var(--nsrl-lh-body);
  color: var(--nsrl-color-text);
}

/* ---------- Pill switch ---------- */
.nsrl-rp__header-wrapper { margin: 0; }

html body .nsrl-rp button.nsrl-rp__heading-btn {
  display: inline-flex;
  align-items: center;
  margin: 0;
  padding: 5px;
  min-height: 0;
  font: inherit;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  color: inherit;
  background: var(--nsrl-color-card);
  border: 1px solid rgba(11, 61, 36, 0.1);
  border-radius: var(--nsrl-radius-pill);
  box-shadow: var(--nsrl-shadow-sm);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: box-shadow var(--nsrl-dur-base) ease;
}
html body .nsrl-rp button.nsrl-rp__heading-btn:hover {
  background: var(--nsrl-color-card);
  box-shadow: var(--nsrl-shadow-md);
}
html body .nsrl-rp button.nsrl-rp__heading-btn:focus-visible {
  outline: 2px solid var(--nsrl-color-accent);
  outline-offset: 3px;
}

.nsrl-rp .nsrl-rp__heading {
  display: flex;
  align-items: stretch;
  gap: 4px;
  margin: 0;
  font-family: var(--nsrl-font-body);
  font-size: var(--nsrl-fs-sm);
  font-weight: var(--nsrl-fw-bold);
  line-height: 1.2;
  color: var(--nsrl-color-heading);
}
.nsrl-rp .nsrl-rp__option {
  display: inline-flex;
  align-items: center;
  padding: 11px 22px;
  border-radius: var(--nsrl-radius-pill);
  color: var(--nsrl-color-slate);
  transition: background-color var(--nsrl-dur-base) var(--nsrl-ease-out), color var(--nsrl-dur-fast) ease;
}
.nsrl-rp .nsrl-rp__option.is-active {
  background-color: var(--nsrl-color-green-900);
  color: #ffffff;
}
.nsrl-rp button.nsrl-rp__heading-btn:hover .nsrl-rp__option:not(.is-active) {
  background-color: var(--nsrl-color-green-50);
  color: var(--nsrl-color-green-900);
}
.nsrl-rp .nsrl-rp__separator { display: none; }

/* ---------- Sliding panels ---------- */
.nsrl-rp__stage {
  position: relative;
  overflow: hidden;
  transition: height 0.4s var(--nsrl-ease-in-out);
}
.nsrl-rp__panel {
  transition: transform 0.45s var(--nsrl-ease-in-out), opacity 0.3s ease;
}
.nsrl-rp__panel:not(.is-active) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
}
.nsrl-rp__panel.is-active {
  opacity: 1;
  transform: translateX(0);
}

/* ---------- Numbered list ---------- */
.nsrl-rp .nsrl-rp__list {
  display: flex;
  flex-direction: column;
  border-top: 1px solid rgba(11, 61, 36, 0.14);
}

.nsrl-rp .nsrl-rp__item {
  border-bottom: 1px solid rgba(11, 61, 36, 0.14);
  border-radius: 0;
  transition: background-color var(--nsrl-dur-base) ease, border-radius var(--nsrl-dur-base) ease;
  animation: nsrl-rise-in 0.5s var(--nsrl-ease-out) both;
}
.nsrl-rp .nsrl-rp__item:nth-child(2) { animation-delay: 0.05s; }
.nsrl-rp .nsrl-rp__item:nth-child(3) { animation-delay: 0.1s; }
.nsrl-rp .nsrl-rp__item:nth-child(4) { animation-delay: 0.15s; }
.nsrl-rp .nsrl-rp__item:nth-child(n+5) { animation-delay: 0.2s; }
.nsrl-rp .nsrl-rp__item.is-expanded {
  background: var(--nsrl-color-card);
  border-radius: var(--nsrl-radius-lg);
  border-bottom-color: transparent;
  box-shadow: inset 0 0 0 1px rgba(11, 61, 36, 0.1);
}

html body .nsrl-rp button.nsrl-rp__row {
  display: grid;
  grid-template-columns: 64px 1fr 44px;
  align-items: center;
  gap: 0;
  width: 100%;
  min-height: 0;
  margin: 0;
  padding: 28px 16px 28px 0;
  font: inherit;
  text-align: left;
  text-transform: none;
  letter-spacing: normal;
  white-space: normal;
  color: inherit;
  background: none;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
html body .nsrl-rp button.nsrl-rp__row:hover,
html body .nsrl-rp button.nsrl-rp__row:focus { background: none; color: inherit; }
html body .nsrl-rp button.nsrl-rp__row:focus-visible {
  outline: 2px solid var(--nsrl-color-accent);
  outline-offset: -2px;
  border-radius: var(--nsrl-radius-lg);
}

.nsrl-rp .nsrl-rp__num {
  font-family: var(--nsrl-font-display);
  font-size: 1rem;
  font-style: italic;
  font-weight: 400;
  font-variant-numeric: tabular-nums;
  text-align: center;
  color: var(--nsrl-color-gold-700);
}

.nsrl-rp .nsrl-rp__title {
  min-width: 0;
  overflow-wrap: anywhere;
  font-family: var(--nsrl-font-display);
  font-size: clamp(1.25rem, 1.05rem + 0.8vw, 1.75rem);
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.015em;
  color: var(--nsrl-color-heading);
  transition: color var(--nsrl-dur-fast) ease, transform var(--nsrl-dur-base) var(--nsrl-ease-out);
}
.nsrl-rp button.nsrl-rp__row:hover .nsrl-rp__title { color: var(--nsrl-color-teal-800); transform: translateX(6px); }
.nsrl-rp .nsrl-rp__item.is-expanded .nsrl-rp__title { transform: none; }

.nsrl-rp .nsrl-rp__arrow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  font-size: 16px;
  color: var(--nsrl-color-green-900);
  border: 1px solid rgba(11, 61, 36, 0.18);
  transition: transform var(--nsrl-dur-base) var(--nsrl-ease-out), background-color var(--nsrl-dur-fast) ease, color var(--nsrl-dur-fast) ease, border-color var(--nsrl-dur-fast) ease;
}
.nsrl-rp button.nsrl-rp__row:hover .nsrl-rp__arrow {
  background: var(--nsrl-color-green-900);
  border-color: var(--nsrl-color-green-900);
  color: #ffffff;
}
.nsrl-rp .nsrl-rp__item.is-expanded .nsrl-rp__arrow {
  transform: rotate(90deg);
  background: var(--nsrl-color-gold-500);
  border-color: var(--nsrl-color-gold-500);
  color: var(--nsrl-color-green-950);
}

.nsrl-rp__detail {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.4s var(--nsrl-ease-out);
}
.nsrl-rp__item.is-expanded .nsrl-rp__detail { grid-template-rows: 1fr; }
.nsrl-rp__detail-inner { overflow: hidden; min-height: 0; }

.nsrl-rp p.nsrl-rp__summary {
  max-width: 60ch;
  margin: -8px 60px 20px 64px;
  font-size: var(--nsrl-fs-body);
  line-height: var(--nsrl-lh-body);
  color: var(--nsrl-color-text);
}
.nsrl-rp .nsrl-rp__link { margin: 0 20px 28px 64px; }

.nsrl-rp p.nsrl-rp__empty {
  margin: 0;
  padding: 32px 24px;
  font-size: var(--nsrl-fs-body);
  line-height: var(--nsrl-lh-body);
  text-align: center;
  color: var(--nsrl-color-text-muted);
  border-bottom: 1px solid rgba(11, 61, 36, 0.14);
}

.nsrl-rp .nsrl-rp__item--skeleton { animation: none; }
.nsrl-rp .nsrl-rp__item--skeleton .nsrl-skel--num { margin: 0 auto; }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .nsrl-rp .nsrl-rp__inner { grid-template-columns: 1fr; gap: 40px; }
  .nsrl-rp__intro { position: static; }
  .nsrl-rp .nsrl-rp__title-main { max-width: none; }
}
@media (max-width: 768px) {
  html body .nsrl-rp button.nsrl-rp__row { grid-template-columns: 44px 1fr 40px; padding: 20px 12px 20px 0; }
  .nsrl-rp .nsrl-rp__arrow { width: 38px; height: 38px; }
  .nsrl-rp p.nsrl-rp__summary { margin: -4px 16px 16px 44px; }
  .nsrl-rp .nsrl-rp__link { margin-left: 44px; }
}
@media (max-width: 480px) {
  html body .nsrl-rp button.nsrl-rp__heading-btn { width: 100%; }
  .nsrl-rp .nsrl-rp__heading { width: 100%; }
  .nsrl-rp .nsrl-rp__option { flex: 1 1 50%; justify-content: center; padding: 11px 8px; }
  .nsrl-rp .nsrl-rp__link { margin-right: 12px; width: calc(100% - 56px); }
}

@media (prefers-reduced-motion: reduce) {
  .nsrl-rp__stage,
  .nsrl-rp__panel,
  .nsrl-rp__detail,
  .nsrl-rp .nsrl-rp__arrow,
  .nsrl-rp .nsrl-rp__option,
  .nsrl-rp .nsrl-rp__title,
  .nsrl-rp .nsrl-rp__item { transition: none; animation: none; }
  .nsrl-rp button.nsrl-rp__row:hover .nsrl-rp__title { transform: none; }
}
