/* 351 ETF Strategy archive — screener: hero + search/sort toolbar + paginated table */

/* ---------- Hero ---------- */
.section-etf-archive-hero {
  background: var(--slate-0);
  /* Top padding clears the fixed .site-header (88px) plus breathing room —
     same convention as .section-etf-profile (etf-strategy.css). */
  padding: 130px 0 0;
}
/* .etf-breadcrumb itself (shared class, styled in etf-strategy.css) isn't
   loaded on this archive page — etf-strategy.css only enqueues on the single
   profile — so it needs its own full ruleset here, not just spacing. */
.etf-breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: var(--text-sm);
  color: var(--slate-500);
  padding-bottom: 6px;
  margin-bottom: 26px;
}
.etf-breadcrumb a {
  color: var(--slate-500);
  text-decoration: none;
}
.etf-breadcrumb a:hover {
  color: var(--blue-600);
}
.etf-breadcrumb__current {
  color: var(--slate-700);
}
.etf-archive-hero__grid {
  display: grid;
  grid-template-columns: minmax(320px, 6fr) minmax(0, 5fr);
  gap: 48px;
  align-items: center;
  padding-bottom: 40px;
}
.etf-archive-hero__intro {
  max-width: 820px;
  min-width: 0;
}
.etf-archive-hero__image {
  background: var(--slate-0);
  border: 0;
  border-radius: var(--radius-xl);
  padding: 12px;
  min-width: 0;
}
.etf-archive-hero__image img {
  width: 100%;
  height: 480px;
  display: block;
  object-fit: contain;
  border-radius: var(--radius-md);
}
.etf-archive-hero__eyebrow {
  font-size: var(--text-sm);
  font-weight: var(--weight-bold);
  letter-spacing: var(--tracking-wide);
  text-transform: uppercase;
  color: var(--blue-600);
  margin-bottom: 16px;
}
.etf-archive-hero__title {
  margin: 0 0 18px;
  font-size: var(--text-4xl);
  font-weight: var(--weight-bold);
  line-height: 1.06;
  letter-spacing: -0.02em;
  color: var(--ink-900);
}
.etf-archive-hero__lead {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: var(--weight-semibold);
  line-height: 1.35;
  color: var(--blue-600);
}
.etf-archive-hero__body {
  margin: 0;
  max-width: 720px;
  font-size: 18px;
  line-height: var(--leading-relaxed);
  color: var(--slate-600);
}
.etf-archive-hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

/* ---------- Search / sort toolbar ---------- */
.etf-screener-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 32px;
  border-bottom: 1px solid var(--border-subtle);
}
.etf-screener-search {
  display: flex;
  align-items: center;
  flex: 1 1 280px;
  max-width: 500px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  background: var(--slate-0);
  padding: 0 6px 0 18px;
  transition: border-color var(--duration-base) var(--ease-out);
}
.etf-screener-search:focus-within {
  border-color: var(--blue-400);
}
.etf-screener-search input {
  flex: 1;
  min-width: 0;
  border: 0px;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  padding: 10px 8px;
  font-size: var(--text-sm);
  font-family: inherit;
  color: var(--slate-700);
}
.etf-screener-search input:focus {
  outline: none;
  border: none;
}
.etf-screener-search__btn {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  border: none;
  border-radius: var(--radius-full);
  background: transparent;
  color: var(--slate-400);
  cursor: pointer;
  transition: color var(--duration-base) var(--ease-out);
}
.etf-screener-search__btn:hover {
  color: var(--blue-600);
}

/* ---------- Sort (<details>/<summary>, not a <select>) ---------- */
.etf-screener-sort {
  position: relative;
}
.etf-screener-sort__toggle {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--border-default);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  color: var(--slate-700);
  background: var(--slate-0);
  cursor: pointer;
  list-style: none;
  user-select: none;
}
.etf-screener-sort__toggle::-webkit-details-marker {
  display: none;
}
.etf-screener-sort__toggle:hover {
  border-color: var(--slate-400);
}
.etf-screener-sort__icon {
  color: var(--slate-500);
  flex-shrink: 0;
}
.etf-screener-sort__chevron {
  color: var(--slate-400);
  flex-shrink: 0;
  transition: transform var(--duration-base) var(--ease-out);
}
.etf-screener-sort[open] .etf-screener-sort__chevron {
  transform: rotate(180deg);
}
.etf-screener-sort__menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 2;
  list-style: none;
  margin: 0;
  padding: 6px;
  min-width: 160px;
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-md);
  background: var(--slate-0);
  box-shadow: var(--shadow-md);
}
.etf-screener-sort__option {
  display: block;
  padding: 8px 10px;
  border-radius: var(--radius-sm);
  font-size: var(--text-sm);
  color: var(--slate-700);
  text-decoration: none;
}
.etf-screener-sort__option:hover {
  background: var(--slate-50);
  text-decoration: none;
}
.etf-screener-sort__option.is-active {
  color: var(--blue-600);
  font-weight: var(--weight-semibold);
  background: var(--blue-50);
}

/* ---------- Table ---------- */
.section-etf-archive-table {
  padding: 40px 0 96px;
}
#etf-screener-results.is-loading {
  opacity: 0.5;
  pointer-events: none;
  transition: opacity var(--duration-base) var(--ease-out);
}
.etf-screener-table {
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--slate-0);
}
.etf-screener-row {
  display: grid;
  grid-template-columns: 2.3fr 1.3fr 1.7fr 100px;
  gap: 16px;
  align-items: center;
  padding: 18px 24px;
  border-bottom: 1px solid var(--slate-100);
  text-decoration: none;
}
.etf-screener-table > .etf-screener-row:last-child {
  border-bottom: none;
}
.etf-screener-row--head {
  background: var(--slate-50);
  font-size: var(--text-xs);
  font-weight: var(--weight-bold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wide);
  color: var(--slate-500);
}
.etf-screener-row__strategy {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.etf-screener-row__strategy img {
  width: 100px;
  height: auto;
  max-height: 36px;
  object-fit: contain;
  flex-shrink: 0;
}
.etf-screener-row__name-wrap {
  min-width: 0;
}
.etf-screener-row__name {
  font-weight: var(--weight-semibold);
  font-size: var(--text-base);
  color: var(--ink-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.etf-screener-row__ticker {
  font-family: var(--font-sans);
  font-size: var(--text-xs);
  color: var(--slate-500);
  letter-spacing: 0.02em;
}
.etf-screener-row__approach,
.etf-screener-row__universe {
  font-size: var(--text-sm);
  color: var(--slate-700);
}
.etf-screener-row__view {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--blue-600);
  font-weight: var(--weight-semibold);
  font-size: var(--text-sm);
  white-space: nowrap;
  text-decoration: none;
}
a.etf-screener-row__view:hover {
  color: var(--blue-700);
  text-decoration: none;
}

/* ---------- Pagination ---------- */
.etf-screener-pagination {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 20px;
  font-size: var(--text-sm);
  color: var(--slate-500);
}
.etf-screener-pagination__nav {
  display: flex;
  gap: 8px;
}
.etf-screener-pagination__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-default);
  background: var(--slate-0);
  color: var(--slate-700);
  text-decoration: none;
}
.etf-screener-pagination__btn:hover {
  background: var(--slate-50);
  text-decoration: none;
}
.etf-screener-pagination__btn--disabled {
  color: var(--border-default);
  cursor: default;
}

.etf-screener-disclaimer {
  margin: 24px 0 0;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--slate-400);
}
.etf-screener-empty {
  padding: 40px 0;
  font-size: var(--text-md);
  color: var(--slate-600);
}
.etf-screener-error {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 0 0 16px;
  font-size: var(--text-base);
  color: var(--slate-600);
}
.etf-screener-error__retry {
  padding: 6px 14px;
  border: 1px solid currentColor;
  border-radius: 6px;
  background: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

@media (max-width: 1024px) {
  .etf-archive-hero__grid {
    grid-template-columns: 1fr;
    gap: 40px;
  }
  .etf-archive-hero__intro {
    max-width: none;
  }
  .etf-archive-hero__title {
    font-size: var(--text-3xl);
  }
}

@media (max-width: 768px) {
  .section-etf-archive-hero {
    padding: 112px 0 0;
  }
  .etf-archive-hero__grid {
    gap: 24px;
  }
  .etf-archive-hero__image img {
    height: 260px;
  }
  .etf-archive-hero__title {
    font-size: var(--text-2xl);
  }
  .etf-archive-hero__lead {
    font-size: var(--text-md);
  }
  .etf-archive-hero__body {
    font-size: var(--text-base);
  }
  .etf-screener-row {
    grid-template-columns: 1fr;
    row-gap: 8px;
  }
  .etf-screener-row--head {
    display: none;
  }
  .etf-screener-row__view {
    justify-self: start;
  }
  .etf-screener-row__strategy img {
    width: 60px;
    max-height: 30px;
  }
}

@media (max-width: 350px) {
  .etf-archive-hero__title {
    font-size: var(--text-xl);
  }
}
