/* Figma Final Designs > Explore (section 270:2830), "Explore Landing Page" (270:3015). */

.explore-page { padding-top: 44px; }
.explore-page .page-title { margin: 0 0 34px; font-size: 34px; line-height: 35px; letter-spacing: -0.85px; }
.ex-section + .ex-section { margin-top: 40px; } /* 597:27196..27480: sections start 40px apart */
/* Section head: 23px tall, no rule, 16px above the content (Figma 597:27197) */
.ex-head { display: flex; align-items: flex-start; justify-content: space-between; height: 23px; margin-bottom: 16px; }
.ex-head .link-btn { font-size: 13px; margin-top: 6px; }
.ex-h2 { margin: 0; font-size: 19px; font-weight: 600; letter-spacing: -0.285px; line-height: 1.2; }

/* ── Top rated funds ─────────────────────────────────────── */
.ex-cards { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ex-card { display: flex; flex-direction: column; height: 188px; border: 1px solid var(--line-soft); padding: 19px 19px 17px; color: inherit; background: #fff; }
.ex-card:hover { border-color: var(--line); }
.ex-card-top { display: flex; align-items: flex-start; justify-content: space-between; }
.ex-card-tile, .ex-card-tile:has(img) { width: 40px; height: 40px; border: 0; border-radius: 0; background: var(--surface); font-size: 16px; }
.ex-card-tile:has(img) { padding: 1px; }
.ex-card-score { display: flex; flex-direction: column; align-items: flex-end; white-space: nowrap; }
.ex-card-n { font-size: 16px; font-weight: 600; letter-spacing: -0.4px; line-height: 1.2; }
.ex-card-word { font-size: 12px; line-height: 1.55; }
.ex-card-score:not(.good):not(.bad) .ex-card-n, .ex-card-score:not(.good):not(.bad) .ex-card-word { color: var(--ink); }
/* name sits just above the return strip: 32px under the tile for one line (Figma 597:27207), less for two */
.ex-card-name {
  margin: auto 0 20px; font-size: 15px; font-weight: 400; letter-spacing: 0; line-height: 1.6;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.ex-card-return { position: relative; flex: none; height: 34px; border-top: 1px solid var(--hair); }
.ex-card-return-label { position: absolute; left: 0; top: 18px; font-size: 11px; letter-spacing: 0.66px; text-transform: uppercase; color: var(--muted); line-height: normal; }
.ex-card-return-val { position: absolute; right: 2px; top: 14px; font-size: 16px; font-weight: 600; letter-spacing: -0.4px; line-height: 1.2; }

/* ── Category / sector tiles ─────────────────────────────── */
.ex-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.ex-tile {
  display: flex; align-items: center; gap: 14px; height: 75px; padding: 0 20px; color: inherit;
  border: 1px solid var(--line-soft); background: #fff;
}
.ex-tile:hover { border-color: var(--line); }
.ex-tile img { flex: none; width: 30px; height: 30px; }
.ex-tile-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.ex-tile-name { line-height: 18px; font-size: 15px; font-weight: 600; letter-spacing: -0.18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-tile-sub { font-size: 12px; color: var(--muted); }
.ex-badge { align-self: flex-start; display: inline-flex; align-items: center; justify-content: center; min-width: 79px; height: 20px; padding: 0 8px; white-space: nowrap; font-size: 10.5px; line-height: normal; }
.ex-badge.good { background: #d9ede5; color: var(--good); }
.ex-badge.bad { background: #f4dad3; color: var(--bad); }

/* ── Top sectors (Figma 597:27334): 312px cards, a 49px header over two top funds ───────── */
.ex-sectors { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; }
.ex-sector { border: 1px solid var(--line-soft); background: #fff; min-height: 153px; }
.ex-sector-head { display: flex; align-items: center; gap: 14px; height: 49px; padding: 0 9px; color: inherit; border-bottom: 1px solid var(--line-soft); }
.ex-sector-head img:first-child { flex: none; width: 30px; height: 30px; }
.ex-sector-name { flex: 1; min-width: 0; font-size: 15px; font-weight: 600; line-height: 18px; letter-spacing: -0.18px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-sector-go { flex: none; width: 6px; height: 9px; }
.ex-sector-head:hover { background: var(--surface); }
.ex-sector-body { display: flex; flex-direction: column; gap: 12px; padding: 9px 9px 9px; }
.ex-sector-cols { display: flex; justify-content: space-between; font-family: var(--mono); font-size: 11px; line-height: 1.4; color: var(--muted); }
.ex-sector-fund { display: flex; align-items: center; gap: 8px; height: 24px; color: inherit; } /* 597:27357: tile 24 + 8 + a 190px name, so the name is cut well before the return */
.ex-sector-fund + .ex-sector-fund { margin-top: -4px; }
.ex-sector-tile { flex: none; width: 24px; height: 24px; font-size: 12px; background: var(--surface); }
.ex-sector-tile img { width: 21px; height: 21px; object-fit: contain; }
.ex-sector-fund-name { flex: 0 1 190px; min-width: 0; max-width: 190px; font-size: 12px; line-height: 1.55; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.ex-sector-fund:hover .ex-sector-fund-name { color: var(--ink); }
.ex-sector-ret { flex: none; margin-left: auto; font-size: 14px; font-weight: 600; line-height: 1.4; }
.ex-sector-ret.good { color: var(--good); }
.ex-sector-ret.bad { color: var(--bad); }

/* The match count is announced to screen readers only; the design has no count line above the table. */
#exCount { position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Section title with the Design system's 13px info icon (icon/info, 138:155) */
.ex-h2-info { display: flex; align-items: center; gap: 8px; }
.ex-h2-info .pop { left: 0; transform: none; }

/* ── Filter bar (Design system pill, node 246:3795) ──────── */
.ex-filters {
  display: flex; flex-wrap: wrap; gap: 8px; position: sticky; top: var(--topbar-h, 81px); z-index: 30;
  background: #fff; padding: 8px 0; margin: -8px 0 4px; /* 12px to the table; the padding gives the bar room while it sticks under the top bar */
}
.ex-filter { position: relative; }
.ex-pill {
  display: flex; align-items: center; gap: 8px; height: 37px; padding: 0 14px;
  border: 1px solid var(--line-soft); border-radius: 20px; background: #fff;
  font-size: 12.5px; font-weight: 500; color: var(--ink-2); white-space: nowrap;
}
.ex-pill img { width: 9px; height: 6px; }
.ex-pill:hover { border-color: var(--line); }
.ex-pill.set { background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 600; }
.ex-pill.open { border-color: var(--faint); } /* Figma 597:27494: the open pill's border darkens to #9a9aa5 */
.ex-x { display: inline-flex; align-items: center; justify-content: center; width: 10px; height: 10px; }
.ex-x img { width: 10px; height: 10px; }
.ex-pop {
  position: absolute; z-index: 20; top: calc(100% + 8px); left: 0; min-width: 220px;
  background: #fff; border: 1px solid var(--line); box-shadow: 0 10px 11.5px rgba(12, 12, 16, 0.12);
}
.ex-pop {
  border-color: var(--line-soft); box-shadow: 0 4px 8px rgba(13, 13, 18, 0.1); /* Figma 597:28129 */
}
.ex-pop.ex-pop-opts { width: 168px; min-width: 0; } /* Figma 270:3409 */
/* Category menu: 280px (layout/filter-panel), 12px padding, 24px checkbox rows, a hairline and a Clear link below */
.ex-pop.ex-pop-cats { width: 280px; }
.ex-pop-checks { display: flex; flex-direction: column; gap: 12px; padding: 12px; max-height: 336px; }
.ex-pop-checks .check { flex: none; }
.ex-pop-checks .box { border-color: var(--line); }
.ex-pop-foot { padding: 8px 12px; border-top: 1px solid var(--hair); }
.ex-pop-foot .link-btn { font-size: 14px; line-height: 1.55; }
.ex-pop-list { max-height: 260px; overflow: auto; }
.ex-pop-opt {
  display: block; width: 100%; text-align: left; padding: 12px 14px; font-size: 13px;
  border-bottom: 1px solid var(--hair);
}
.ex-pop-opt:last-child { border-bottom: 0; }
.ex-pop-opt:hover { background: var(--surface); }
.ex-pop-opt.on { font-weight: 600; }
.ex-pop-find { padding: 8px 10px 0; }
.ex-pop-find input { width: 100%; height: 32px; border: 1px solid var(--line); padding: 0 9px; font-size: 12.5px; }

/* ── All funds table ─────────────────────────────────────── */
/* Figma 270:3255: the table sits in a bordered white card (20px sides/top, 6px bottom); the scheme column takes the
   remaining width and every metric column is 103px. The fund tile is the smaller 20px "Fund initial" (143:232). */
.ex-table-card { background: #fff; border: 1px solid var(--line-soft); padding: 20px 20px 6px; }
.ex-table { min-width: 1127px; }
.ex-table .thead, .ex-table .trow { grid-template-columns: minmax(200px, 1fr) repeat(9, 103px); }
.ex-table .thead { height: auto; padding-bottom: 11px; border-bottom-color: var(--line); }
.ex-table .th { height: auto; font-size: 11px; line-height: 1.4; letter-spacing: 0.66px; }
.ex-table .trow { height: 50px; }
/* Figma 597:27484: every figure is regular 14px; only the Score is semibold (grey, green when Strong) */
.ex-table .td { font-size: 14px; font-weight: 400; line-height: 1.55; }
.ex-table .td.score { font-size: 14px; font-weight: 600; letter-spacing: 0; line-height: 1.4; color: var(--ink-2); }
.ex-table .td.score .good { color: var(--good); }
.ex-table .td.score .bad { color: var(--bad); }
.ex-table .td.scheme { font-size: 14px; }
.ex-table .trow:last-child { border-bottom: 0; } /* the card's own border closes the list */
.ex-table .td.scheme { gap: 14px; }
.ex-fund-tile { width: 20px; height: 20px; font-size: 12px; font-weight: 400; color: var(--faint); }
.ex-more { display: inline-block; margin-top: 16px; }

@media (max-width: 1100px) {
  .ex-sectors { grid-template-columns: repeat(2, 1fr); }
  .ex-cards { grid-template-columns: repeat(2, 1fr); }
  .ex-tiles { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 860px) {
  .ex-sectors { grid-template-columns: 1fr; }
  .ex-cards { grid-template-columns: 1fr; }
  .ex-tiles { grid-template-columns: repeat(2, 1fr); }
}

/* ── All categories (Figma 597:27651): groups of 64px tiles with a name and a fund count ──────── */
.cats-page .page-title { margin-bottom: 32px; }
.cats-groups { display: flex; flex-direction: column; gap: 40px; padding-bottom: 72px; }
.cats-group .ex-h2 { margin-bottom: 16px; line-height: 1.3; }
.cats-tiles { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.cat-tile { display: flex; flex-direction: column; justify-content: center; gap: 4px; height: 64px; padding: 0 20px; color: inherit; border: 1px solid var(--line-soft); background: #fff; }
.cat-tile:hover { border-color: var(--line); }
.cat-tile-name { font-size: 14px; font-weight: 600; line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cat-tile-meta { display: flex; align-items: center; gap: 8px; font-size: 12px; line-height: 1.55; color: var(--muted); white-space: nowrap; }
.ex-badge.cat-flag { min-width: 0; height: auto; padding: 2px 6px; font-size: 12px; line-height: 1.55; align-self: auto; }
@media (max-width: 1100px) { .cats-tiles { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 860px) { .cats-tiles { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
