/*******************************
 Autocallable Distributions
 ******************************/

/* This page uses full-bleed section backgrounds rather than the framed
   content column, so the site-wide .inner-wrapper side border (see
   utilities.css) is switched off inside every section on this page —
   otherwise it reads as one continuous blue rule from hero to footer. */
.ad-hero .inner-wrapper,
.ad-body .inner-wrapper,
.ad-tradeoff .inner-wrapper,
.ad-definitions .inner-wrapper,
.ad-disclosures .inner-wrapper {
  border-inline-width: 0;
}

/* ---------- Hero ---------- */

.ad-hero {
  background: rgb(var(--neutral-0));
  color: rgb(var(--neutral-99));
  padding-block: 2.5rem 0;
}

.ad-breadcrumbs {
  display: flex;
  gap: 0.5rem;
  align-items: center;
  color: rgb(var(--neutral-60));
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.ad-breadcrumbs-current {
  color: rgb(var(--brand-citrine));
}

.ad-hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 3rem;
  align-items: end;
  padding-block: 3.5rem 3rem;
}

.ad-tag {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgb(var(--brand-citrine));
  color: rgb(var(--neutral-0));
  padding: 5px 10px;
  border-radius: var(--border-radius);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.ad-hero-title {
  font-family: "PP Formula", sans-serif;
  font-weight: 500;
  font-size: 68px;
  line-height: 100%;
  letter-spacing: -0.01em;
  margin: 1.5rem 0 0;
}

.ad-hero-sub {
  color: rgb(var(--neutral-70));
  max-width: 56ch;
  margin: 1.5rem 0 0;
}

.ad-hero-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 2rem;
}

.ad-hero-actions .button img.svg {
  width: 1rem;
  height: 1rem;
}

.ad-hero-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5px;
  background: rgb(var(--neutral-20));
}

.ad-hero-stat {
  background: rgb(var(--neutral-0));
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
}

.ad-hero-stat-label {
  color: rgb(var(--neutral-60));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-hero-stat-label--citrine {
  color: rgb(var(--brand-citrine));
}

.ad-hero-stat-value {
  font-size: 38px;
  font-weight: 400;
  line-height: 120%;
  margin-top: 10px;
}

.ad-hero-stat-value--citrine {
  color: rgb(var(--brand-citrine));
}

.ad-hero-stat-value--small {
  font-size: 22px;
  line-height: 130%;
  margin-top: 12px;
}

/* ---------- Body / Next distribution band ---------- */

.ad-body {
  padding-block: 3rem 0;
}

.ad-next-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 48px;
  flex-wrap: nowrap;
  background: rgb(var(--brand-azure));
  border-radius: var(--border-radius);
  padding: 24px 28px;
}

.ad-next-item {
  display: flex;
  flex-direction: column;
  white-space: nowrap;
}

.ad-next-note {
  flex: 1;
  max-width: 420px;
  white-space: normal;
  color: rgb(var(--neutral-100));
  margin: 0;
}

.ad-next-band-left {
  display: flex;
  align-items: flex-start;
  gap: 2rem;
  flex-wrap: wrap;
}

.ad-next-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(var(--neutral-100));
}

.ad-next-month {
  display: block;
  font-size: 22px;
  font-weight: 400;
  color: rgb(var(--neutral-100));
  margin-top: 8px;
}

.ad-next-dates {
  display: flex;
  gap: 2rem;
  flex-wrap: wrap;
  color: rgb(var(--neutral-100));
}

.ad-next-dates-label {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(var(--neutral-100));
}

.ad-next-dates-value {
  display: block;
  color: rgb(var(--neutral-100));
  margin-top: 8px;
}

/* ---------- Controls row ---------- */

.ad-controls-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.5rem;
  flex-wrap: wrap;
  margin-top: 3.5rem;
}

.ad-controls-heading {
  font-family: "PP Formula", sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 130%;
  margin: 0;
}

.ad-controls-sub {
  color: rgb(var(--neutral-30));
  margin: 0.5rem 0 0;
}

.ad-controls {
  display: flex;
  align-items: flex-end;
  gap: 1rem;
  flex-wrap: wrap;
}

.ad-control-field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.ad-control-label {
  color: rgb(var(--neutral-40));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-controls .select-etf-products {
  min-width: 190px;
  max-width: none;
  height: 44px;
  padding-block: 0;
  padding-inline: 1em;
  border: 1.5px solid rgb(var(--brand-azure));
}

.ad-controls .select-etf-products select {
  height: 100%;
  line-height: 44px;
  display: flex;
  align-items: center;
}

.ad-view-toggle {
  min-width: 12rem;
  height: 44px;
  padding: 0;
  display: flex;
  align-items: stretch;
}

.ad-view-toggle fieldset {
  position: relative;
  width: 100%;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
}

.ad-view-toggle label {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  position: relative;
  z-index: 1;
}

.ad-view-toggle .ad-view-toggle__float {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  z-index: 0;
}

.ad-view-toggle input[type="radio"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 50%;
  height: 100%;
  appearance: none;
  background: transparent;
  margin: 0;
  cursor: pointer;
  transform: none;
}

.ad-view-toggle input[type="radio"]:nth-of-type(2) {
  left: 50%;
}

.ad-view-toggle
  input[type="radio"]:nth-of-type(1):checked
  ~ .ad-view-toggle__float {
  transform: translateX(0%);
}

.ad-view-toggle
  input[type="radio"]:nth-of-type(2):checked
  ~ .ad-view-toggle__float {
  transform: translateX(100%);
}

/* ---------- Table view ---------- */

.ad-table-wrapper {
  margin-top: 1.5rem;
  overflow-x: auto;
  border: 1.5px solid rgb(var(--brand-azure));
}

.ad-table {
  /* Fixed min-width (previously 1180px) made this wider than the page's
     actual content column (max-width-inner: 1184px minus the
     .inner-wrapper's 2rem side padding, ~1120px usable), which forced a
     horizontal scrollbar on every desktop viewport, even ones wide enough
     to show the whole table. width: 100% instead lets it fill exactly the
     column every other page on the site uses. */
  width: 100%;
  background: rgb(var(--brand-azure));
  display: flex;
  flex-direction: column;
  gap: 1.5px;
}

/* The data rows aren't direct children of .ad-table - renderTable() injects
   them into #adTableBody, one level down - so .ad-table's own flex gap only
   ever separated the header row from that one wrapper, leaving every data
   row flush against the next with no line between them. Making #adTableBody
   itself a flex column with the same gap + azure background repeats the
   same gap-as-gridline trick one level down, so each data row gets the same
   1.5px azure horizontal rule the columns already get vertically. */
#adTableBody {
  display: flex;
  flex-direction: column;
  gap: 1.5px;
  background: rgb(var(--brand-azure));
}

.ad-table-row {
  display: grid;
  /* Fixed px widths here previously summed to more than the content column
     can hold. Each column below uses minmax(floor, share) so the row
     compresses smoothly to whatever the actual column width is, instead of
     overflowing it and triggering .ad-table-wrapper's horizontal scroll. */
  grid-template-columns:
    minmax(64px, 0.6fr)
    minmax(150px, 1.8fr)
    minmax(64px, 0.7fr)
    minmax(96px, 1fr)
    minmax(92px, 0.95fr)
    minmax(64px, 0.7fr)
    minmax(88px, 0.95fr)
    minmax(84px, 0.9fr)
    minmax(84px, 0.9fr)
    minmax(64px, 0.7fr);
  gap: 1.5px;
}

.ad-table-cell {
  background: rgb(var(--neutral-100));
  padding: 18px 14px;
  min-height: 24px;
  display: flex;
  align-items: center;
}

/* The table is wider than most viewports and scrolls horizontally
   (.ad-table-wrapper: overflow-x: auto); pin the Ticker column so it
   stays visible as a reference while scrolling right to Payment/19a-1. */
.ad-table-row > .ad-table-cell:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  box-shadow: 1.5px 0 0 0 rgb(var(--brand-azure));
}

.ad-table-row > .ad-table-head:first-child {
  z-index: 2;
}

.ad-table-head {
  background: rgb(var(--neutral-0));
  color: rgb(var(--neutral-99));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-head-citrine {
  color: rgb(var(--brand-citrine));
}

.ad-align-right {
  justify-content: flex-end;
  text-align: right;
}

/* Center Dist. Rate (5th) and ROC (6th) — header + data */
.ad-table-row > .ad-table-cell:nth-child(5),
.ad-table-row > .ad-table-cell:nth-child(6) {
  justify-content: center;
  text-align: center;
}

/* The Payment / 19a-1 boundary is the same 1.5px azure grid-gap line as every
   other column boundary, but the 19a-1 column is narrow with sparse,
   right-aligned content ("PDF" or nothing), so the divider doesn't read as
   clearly as it does between fuller text columns like Ex & Record / Payment.
   Add an explicit left border on the last column so that boundary reads with
   the same visual weight regardless of column content. */
.ad-table-row > .ad-table-cell:last-child,
.ad-table-row > .ad-table-head:last-child {
  border-left: 1.5px solid rgb(var(--brand-azure));
}

.ad-table-ticker {
  color: rgb(var(--brand-azure));
}

.ad-table-freq {
  font-size: 14px;
  font-family: "Inter", sans-serif;
  line-height: 120%;
  font-weight: 300;
  color: rgb(var(--neutral-20));
}

.ad-table-rate-pill,
.ad-table-sec-pill {
  padding: 7px 10px;
  border-radius: var(--border-radius);
}

.ad-table-rate-pill {
  background: rgb(var(--brand-citrine));
  color: rgb(var(--neutral-0));
}

.ad-table-sec-pill {
  background: rgb(var(--brand-amethyst-light));
  color: rgb(var(--neutral-0));
}

.ad-table-cell--pill {
  padding: 9px 14px;
}

.ad-table-notice-link {
  font-family: "Inter", "JetBrains Mono", sans-serif;
  font-size: 13px;
  text-decoration: none;
  border-bottom: 1.5px solid rgb(var(--brand-azure));
  padding-bottom: 2px;
}

/* ---------- Card view ---------- */

.ad-cards-wrapper {
  margin-top: 1.5rem;
}

.ad-cards {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

.ad-card {
  background: rgb(var(--neutral-100));
  border: 1.5px solid rgb(var(--neutral-80));
  border-radius: var(--border-radius);
  padding: 24px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.ad-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}

.ad-card-ticker-wrap {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.ad-card-ticker {
  font-family: "Inter", "JetBrains Mono", sans-serif;
  font-size: 18px;
  color: rgb(var(--brand-azure));
}

.ad-card-freq {
  font-family: "Inter", "JetBrains Mono", sans-serif;
  font-size: 12px;
  color: rgb(var(--neutral-40));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-card-notice {
  font-family: "Inter", "JetBrains Mono", sans-serif;
  font-size: 12px;
  text-decoration: none;
  color: rgb(var(--neutral-30));
  border: 1.5px solid rgb(var(--neutral-80));
  border-radius: var(--border-radius);
  padding: 6px 8px;
}

.ad-card-name {
  font-size: 16px;
  font-weight: 300;
  line-height: 140%;
  color: rgb(var(--neutral-10));
}

.ad-card-rate-row {
  display: flex;
  align-items: baseline;
  gap: 10px;
  border-top: 1.5px solid rgb(var(--neutral-80));
  padding-top: 20px;
}

.ad-card-rate-value {
  font-size: 44px;
  font-weight: 400;
  line-height: 100%;
}

.ad-card-rate-label {
  font-family: "Inter", "JetBrains Mono", sans-serif;
  font-size: 12px;
  color: rgb(var(--neutral-40));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-card-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}

.ad-card-stat {
  background: rgb(var(--neutral-90));
  border-radius: var(--border-radius);
  padding: 12px;
}

.ad-card-stat-label {
  font-family: "Inter", "JetBrains Mono", sans-serif;
  font-size: 11px;
  color: rgb(var(--neutral-40));
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.ad-card-stat-value {
  font-family: "Inter", "JetBrains Mono", sans-serif;
  font-size: 15px;
  margin-top: 6px;
}

.ad-card-stat-value--pay {
  font-family: "Inter", sans-serif;
  font-size: 14px;
  font-weight: 300;
}

.ad-disclaimer-note {
  font-style: italic;
  color: rgb(var(--neutral-30));
  max-width: 100ch;
  margin: 1.25rem 0 0;
}

.ad-disclaimer-note i {
  display: block;
}

.ad-disclaimer-note i + i {
  margin-top: 0.5rem;
}

/* ---------- The Trade-Off ---------- */

.ad-tradeoff {
  padding-block: 4.5rem 0;
}

.ad-tradeoff-panel {
  background: rgb(var(--brand-amethyst));
  border-radius: var(--border-radius);
  padding: 40px;
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: 2.5rem;
  align-items: start;
}

.ad-tradeoff-tag {
  display: block;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(var(--neutral-10));
}

.ad-tradeoff-title {
  font-family: "PP Formula", sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 125%;
  margin: 1rem 0 0;
  color: rgb(var(--neutral-0));
}

.ad-tradeoff-copy {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  color: rgb(var(--neutral-0));
}

.ad-tradeoff-copy p {
  margin: 0;
}

/* ---------- Definitions ---------- */

.ad-definitions {
  padding-block: 4.5rem 0;
}

.ad-section-title {
  font-family: "PP Formula", sans-serif;
  font-weight: 500;
  font-size: 32px;
  line-height: 130%;
  margin: 0;
}

.ad-definitions-grid {
  margin-top: 1.75rem;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5px;
  background: rgb(var(--neutral-80));
  border: 1.5px solid rgb(var(--neutral-80));
}

.ad-definition {
  background: rgb(var(--neutral-99));
  padding: 28px 24px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.ad-definition-term {
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: rgb(var(--brand-azure));
}

.ad-definition p {
  color: rgb(var(--neutral-10));
  margin: 0;
}

/* ---------- Disclosures ---------- */

.ad-disclosures {
  padding-block: 4.5rem 5.5rem;
}

.ad-disclosures-panel {
  border-top: 1.5px solid rgb(var(--neutral-80));
  padding-top: 2rem;
}

.ad-disclosures-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  margin-bottom: 1.5rem;
}

.ad-notices-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 12px;
  background-color: rgb(223, 252, 83);
  border-radius: 999px;
  color: black;
  text-decoration: none;
  width: fit-content;
  flex-shrink: 0;
}

.ad-notices-link:hover {
  opacity: 0.85;
}

.ad-disclosures-toggle {
  all: unset;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex: 0 0 auto;
}

.ad-disclosures-toggle-label {
  flex-shrink: 0;
  white-space: nowrap;
}

.ad-disclosures-title {
  font-family: "PP Formula", sans-serif;
  font-weight: 500;
  font-size: 24px;
  color: rgb(var(--neutral-0));
}

.ad-disclosures-toggle-label {
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: rgb(var(--brand-azure));
}

.ad-disclosures-body {
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  margin-top: 1.5rem;
  max-width: 96ch;
}

.ad-disclosures-body p {
  color: rgb(var(--neutral-30));
  margin: 0;
}

/* ---------- Responsive ---------- */

@media (max-width: 61rem) {
  .ad-hero-grid {
    grid-template-columns: 1fr;
  }

  .ad-tradeoff-panel {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 50rem) {
  .ad-hero-title {
    font-size: 40px;
  }

  .ad-controls-row {
    flex-direction: column;
    align-items: flex-start;
  }

  /* .ad-next-item spans are white-space: nowrap by default (fine on a wide
     single row); stacking the band vertically on narrower screens needs
     that relaxed so labels like "Next Expected Distribution" can wrap
     instead of forcing the band to overflow horizontally. */
  .ad-next-band {
    flex-direction: column;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 1.25rem;
  }

  .ad-next-item {
    white-space: normal;
  }

  .ad-next-note {
    max-width: none;
  }
}

@media (max-width: 40rem) {
  .ad-hero-stats {
    grid-template-columns: 1fr;
  }

  .ad-next-band {
    padding: 20px;
    gap: 1rem;
  }

  .ad-next-month {
    font-size: 19px;
  }

  .ad-disclosures-toggle {
    align-items: flex-start;
  }

  .ad-disclosures-title {
    font-size: 19px;
  }

  .ad-disclosures-toggle-label {
    margin-top: 3px;
  }

  .ad-table-wrapper {
    position: relative;
  }

  .ad-table-wrapper::after {
    content: "\2192 scroll for more";
    position: sticky;
    left: 0;
    display: block;
    width: 100%;
    padding: 6px 14px;
    background: rgb(var(--neutral-90));
    color: rgb(var(--neutral-40));
    font-family: "Inter", "JetBrains Mono", sans-serif;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }
}


/* ---------- Skeleton loader ---------- */

.ad-align-center {
  justify-content: center;
  text-align: center;
}

.ad-skeleton-bar {
  display: block;
  height: 14px;
  border-radius: 4px;
  background: linear-gradient(
    90deg,
    rgb(var(--neutral-90)) 25%,
    rgb(var(--neutral-80)) 37%,
    rgb(var(--neutral-90)) 63%
  );
  background-size: 400% 100%;
  animation: ad-skeleton-shimmer 1.4s ease infinite;
}

.ad-skeleton-card {
  gap: 14px;
}

@keyframes ad-skeleton-shimmer {
  0% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0 50%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .ad-skeleton-bar {
    animation: none;
  }
}

/* Shimmer over text that is filled in from the API (hero stats, next-expected
   band, period heading/subline). Text is hidden, not removed, so the layout
   doesn't jump when the real values arrive. */
.ad-is-loading {
  display: block;
  width: fit-content;
  min-width: 8ch;
  min-height: 1.2em;
  border-radius: 4px;
  color: transparent !important;
  user-select: none;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    rgb(var(--neutral-90)) 25%,
    rgb(var(--neutral-80)) 37%,
    rgb(var(--neutral-90)) 63%
  );
  background-size: 400% 100%;
  animation: ad-skeleton-shimmer 1.4s ease infinite;
}

/* On the dark hero and the azure "next expected" band use a translucent
   light shimmer instead of the light-grey one. */
.ad-hero .ad-is-loading,
.ad-next-band .ad-is-loading {
  background: linear-gradient(
    90deg,
    rgb(var(--neutral-100) / 0.14) 25%,
    rgb(var(--neutral-100) / 0.3) 37%,
    rgb(var(--neutral-100) / 0.14) 63%
  );
  background-size: 400% 100%;
}

@media (prefers-reduced-motion: reduce) {
  .ad-is-loading {
    animation: none;
  }
}

/* Clickable ticker / ETF name / 19a-1 links in the table and card views */
a.ad-link {
  text-decoration: none;
}

a.ad-link:hover,
a.ad-link:focus-visible {
  text-decoration: underline;
}

a.ad-card-ticker {
  display: block;
}

.ad-card-ticker-wrap a.ad-card-ticker {
  display: inline;
}

        