/* ==========================================================================
   Flexable — Rankings board

   Layout for the category + location ranking page: hero, the three searchable
   filters, the ranked list, the closing statement, the cross-link grid and the
   methodology drawer.

   Tokens, .flxb-wrap, the nav and the footer all come from base.css — the
   design mock shipped its own :root, nav and footer, and those are dropped
   here so the page inherits the same chrome as the rest of the site.

   Scoped under .flxb-home throughout, for the same reason base.css is: the
   parent theme styles bare h1/h2/p and would otherwise win.
   ========================================================================== */

/* Board-local shades. The mock ran a slightly cooler grey ramp than the V3
   tokens; these keep the ranked list reading as a dense table rather than as
   marketing copy. */

.flxb-rank {
  --flxb-rank-dim: #9a9da0;
  --flxb-rank-label: #85888b;
  --flxb-rank-value: #3e4244;
  --flxb-rank-hairline: #eceeee;
}

.flxb-rankings-body .flxb-wrap {
  width: min(1120px, calc(100% - 40px));
}

@media (max-width: 900px) {
  .flxb-rankings-body .flxb-wrap {
    width: min(100% - 28px, 1120px);
  }
}

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

.flxb-rank-hero {
  padding: 74px 0 34px;
}

.flxb-rank-overline {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #929598;
}

.flxb-rank-overline i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--flxb-brand);
}

.flxb-home .flxb-rank-title {
  margin: 17px 0 0;
  max-width: 980px;
  font-size: clamp(46px, 6.5vw, 76px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.06em;
}

.flxb-rank-title .flxb-rank-place {
  color: #8b8e91;
}

.flxb-rank-intro {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 30px;
  margin-top: 24px;
}

.flxb-home .flxb-rank-intro p {
  margin: 0;
  max-width: 590px;
  font-size: 14px;
  line-height: 1.65;
  color: #74787b;
}

.flxb-rank-method-link {
  margin-left: auto;
  padding: 0;
  border: 0;
  background: transparent;
  font-size: 11px !important;
  font-weight: 690 !important;
  color: #35383b;
  white-space: nowrap;
  cursor: pointer;
}

.flxb-rank-method-link:hover {
  color: #08743e;
}

/* ---------- Filter bar ---------- */

.flxb-rank-controls {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 42px;
  padding: 13px 0;
  border-top: 1px solid var(--flxb-line);
  border-bottom: 1px solid var(--flxb-line);
}

.flxb-rank-sep {
  width: 1px;
  height: 18px;
  background: var(--flxb-line);
}


.flxb-rank-select {
  position: relative;
}

.flxb-rank-select-trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  height: 34px;
  padding: 0 27px 0 0;
  border: 0;
  background: transparent;
  font-size: 11px !important;
  font-weight: 690 !important;
  color: #35383b;
  white-space: nowrap;
  cursor: pointer;
}

.flxb-rank-select-trigger::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-left: 2px;
  border-right: 1.5px solid #8c8f92;
  border-bottom: 1.5px solid #8c8f92;
  transform: rotate(45deg) translateY(-2px);
}

.flxb-rank-menu {
  position: absolute;
  top: 42px;
  left: 0;
  z-index: 65;
  width: 250px;
  padding: 8px;
  border: 1px solid var(--flxb-line);
  border-radius: 14px;
  background: var(--flxb-panel);
  box-shadow: 0 16px 38px rgba(24, 26, 28, 0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-4px);
  transition: 0.14s ease;
}

.flxb-rank-select.is-open .flxb-rank-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.flxb-rank-menu-location {
  width: 230px;
}

.flxb-rank-menu-range {
  width: 220px;
}

.flxb-rank-search {
  display: flex;
  align-items: center;
  height: 36px;
  margin-bottom: 6px;
  padding: 0 10px;
  border: 1px solid #e8eaeb;
  border-radius: 10px;
  background: #fcfcfc;
}

.flxb-rank-search svg {
  flex: 0 0 auto;
  width: 14px;
  height: 14px;
  stroke: var(--flxb-rank-dim);
}

.flxb-rank-search input {
  width: 100%;
  padding: 0 0 0 8px;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 11px;
  color: #303336;
}

.flxb-rank-search input::placeholder {
  color: #a2a5a8;
}

.flxb-rank-options {
  max-height: 264px;
  padding: 2px;
  overflow: auto;
}

.flxb-rank-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  height: 34px;
  padding: 0 9px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  font-size: 11px !important;
  text-align: left;
  color: #484b4e;
  cursor: pointer;
}

.flxb-rank-option:hover,
.flxb-rank-option.is-active {
  background: #f4f6f5;
  color: var(--flxb-ink);
}

.flxb-rank-option.is-selected {
  font-weight: 700;
  color: #08743e;
}

.flxb-rank-empty {
  padding: 13px 9px;
  font-size: 10.5px;
  color: var(--flxb-rank-dim);
}

/* ---------- Board ---------- */

.flxb-rank-board {
  padding: 26px 0 78px;
}

.flxb-rank-board-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}

.flxb-rank-board-meta span {
  font-size: 10px;
  color: var(--flxb-rank-dim);
}

.flxb-rank-board-meta b {
  font-size: 10px;
  font-weight: 700;
  color: #55595c;
}

/* Columns: position, person, skills, price, chevron. */
.flxb-rank-row {
  display: grid;
  grid-template-columns: 72px minmax(250px, 1.3fr) minmax(260px, 1fr) 150px 28px;
  gap: 18px;
  align-items: center;
  min-height: 92px;
  padding: 0 6px;
  border-bottom: 1px solid var(--flxb-rank-hairline);
  transition: 0.16s ease;
  /* The row is an <a>, so base.css's 16px link line-height would otherwise
     set the height of the name/meta stack. */
  line-height: normal;
}

.flxb-rank-row:hover {
  background: #fafbfa;
}

/* The board's own bottom edge does the closing, so the final row needs no
   rule. Filtering happens in SQL, so the last row is always the DOM-last one. */
.flxb-rank-row:last-child {
  border-bottom: 0;
}

.flxb-rank-row.is-first {
  min-height: 144px;
  border-top: 0;
  border-bottom: 1px solid #dceee2;
  background: linear-gradient(
    90deg,
    rgba(233, 250, 239, 0.55),
    rgba(253, 253, 253, 0) 62%
  );
}

.flxb-rank-no {
  font-size: 24px;
  font-weight: 760;
  letter-spacing: -0.05em;
  color: #b5b8ba;
}

.flxb-rank-row.is-top .flxb-rank-no {
  color: #707477;
}

.flxb-rank-row.is-first .flxb-rank-no {
  font-size: 48px;
  font-weight: 790;
  color: #05a951;
}

.flxb-rank-person {
  display: flex;
  align-items: center;
  gap: 13px;
  min-width: 0;
}

.flxb-rank-person img {
  width: 46px;
  height: 46px;
  border-radius: 14px;
  border: 1px solid #e8eaea;
  object-fit: cover;
}

.flxb-rank-row.is-first .flxb-rank-person img {
  width: 66px;
  height: 66px;
  border-radius: 18px;
}

.flxb-rank-person h2 {
  display: block;
  overflow: hidden;
  font-size: 13px;
  color: #282b2e;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.flxb-rank-row.is-first .flxb-rank-person b {
  font-size: 19px;
  letter-spacing: -0.035em;
}

.flxb-rank-person span,
.flxb-rank-focus span,
.flxb-rank-price span {
  display: block;
  margin-bottom: 4px;
  font-size: 10px;
  color: var(--flxb-rank-dim);
}

.flxb-rank-person span {
  display: block;
  overflow: hidden;
  margin-top: 4px;
  margin-bottom: 0;
  font-size: 10px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.flxb-rank-person > div {
  min-width: 0;
}

.flxb-rank-focus b,
.flxb-rank-price b {
  display: block;
  overflow: hidden;
  font-size: 10.5px;
  font-weight: 660;
  color: var(--flxb-rank-value);
  white-space: nowrap;
  text-overflow: ellipsis;
}

.flxb-rank-row.is-first .flxb-rank-focus b,
.flxb-rank-row.is-first .flxb-rank-price b {
  font-size: 11.5px;
}

.flxb-rank-arrow {
  font-size: 16px;
  text-align: right;
  color: #8d9193;
}

.flxb-rank-row.is-first .flxb-rank-arrow {
  color: #078143;
}

.flxb-rank-row:hover .flxb-rank-arrow {
  color: #08743e;
}

/* Shown when the project-range filter matches nothing. */
.flxb-rank-noresults {
  padding: 44px 6px;
  font-size: 12px;
  color: var(--flxb-rank-label);
}

/* ---------- Closing statement + cross-links ---------- */

.flxb-rank-after {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 30px;
  padding: 30px 0 72px;
  border-top: 1px solid var(--flxb-line);
}

.flxb-rank-statement {
  max-width: 470px;
  font-size: 22px;
  font-weight: 720;
  line-height: 1.25;
  letter-spacing: -0.035em;
}

.flxb-rank-statement span {
  color: #8a8d90;
}

.flxb-rank-explore {
  padding: 0 0 72px;
}

.flxb-rank-explore-head {
  margin-bottom: 10px;
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--flxb-rank-dim);
}

.flxb-rank-explore-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--flxb-line);
}

.flxb-rank-explore-grid a {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 0;
  border-bottom: 1px solid var(--flxb-line);
  font-size: 11px;
  font-weight: 650;
  line-height: normal;
}

.flxb-rank-explore-grid a:nth-child(3n + 2),
.flxb-rank-explore-grid a:nth-child(3n + 3) {
  padding-left: 20px;
}

.flxb-rank-explore-grid a span {
  color: #a0a3a5;
}

/* ---------- Methodology drawer ---------- */

.flxb-rank-overlay {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(17, 18, 20, 0.18);
  backdrop-filter: blur(2px);
  opacity: 0;
  visibility: hidden;
  transition: 0.2s ease;
}

.flxb-rank-overlay.is-open {
  opacity: 1;
  visibility: visible;
}

.flxb-rank-drawer {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(460px, 94vw);
  height: 100%;
  border-left: 1px solid var(--flxb-line);
  background: var(--flxb-panel);
  transform: translateX(100%);
  transition: 0.24s cubic-bezier(0.22, 0.61, 0.36, 1);
}

.flxb-rank-overlay.is-open .flxb-rank-drawer {
  transform: translateX(0);
}

.flxb-rank-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 70px;
  padding: 0 22px;
  border-bottom: 1px solid var(--flxb-line);
}

.flxb-rank-drawer-head b {
  font-size: 14px;
}

.flxb-rank-close {
  width: 32px;
  height: 32px;
  border: 1px solid var(--flxb-line);
  border-radius: 10px;
  background: var(--flxb-panel);
  font-size: 17px;
  color: #666;
  cursor: pointer;
}

.flxb-rank-drawer-body {
  padding: 26px 22px 36px;
  overflow: auto;
}

.flxb-home .flxb-rank-method-sub {
  margin: 0 0 26px;
  font-size: 11px;
  line-height: 1.6;
  color: #85888b;
}

.flxb-rank-rule {
  display: grid;
  grid-template-columns: 26px 1fr;
  gap: 10px;
  padding: 15px 0;
  border-top: 1px solid var(--flxb-rank-hairline);
}

.flxb-rank-rule i {
  padding-top: 2px;
  font-size: 9px;
  font-style: normal;
  font-weight: 800;
  color: #a0a3a5;
}

.flxb-rank-rule b {
  display: block;
  font-size: 11px;
}

.flxb-rank-rule span {
  display: block;
  margin-top: 4px;
  font-size: 10px;
  line-height: 1.5;
  color: #878a8d;
}

.flxb-rank-method-section {
  margin-top: 26px;
}

.flxb-rank-method-section-title {
  margin-bottom: 7px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #9a9da0;
}

.flxb-home .flxb-rank-method-section p {
  margin: 0;
  font-size: 10.5px;
  line-height: 1.65;
  color: #7f8386;
}

.flxb-rank-method-facts {
  margin-top: 18px;
  border-top: 1px solid var(--flxb-line);
  border-bottom: 1px solid var(--flxb-line);
}

.flxb-rank-method-fact {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 11px 0;
  border-bottom: 1px solid #f0f1f1;
  font-size: 10px;
}

.flxb-rank-method-fact:last-child {
  border-bottom: 0;
}

.flxb-rank-method-fact span {
  color: #929598;
}

.flxb-rank-method-fact b {
  font-size: 10px;
  color: #303336;
}

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

@media (max-width: 900px) {
  .flxb-rank-row {
    grid-template-columns: 58px minmax(220px, 1fr) minmax(180px, 0.8fr) 28px;
  }

  .flxb-rank-price {
    display: none;
  }

  .flxb-rank-explore-grid {
    grid-template-columns: 1fr 1fr;
  }

  .flxb-rank-explore-grid a:nth-child(3n + 2),
  .flxb-rank-explore-grid a:nth-child(3n + 3) {
    padding-left: 0;
  }

  .flxb-rank-explore-grid a:nth-child(even) {
    padding-left: 18px;
  }
}

@media (max-width: 620px) {
  .flxb-rank-hero {
    padding-top: 52px;
  }

  .flxb-home .flxb-rank-title {
    font-size: 44px;
  }

  .flxb-rank-intro {
    align-items: flex-start;
    flex-direction: column;
    gap: 13px;
  }

  .flxb-rank-controls {
    flex-wrap: wrap;
  }

  /* Full-width sheet — a 250px popover anchored to a wrapped trigger lands
     off-screen on narrow viewports. */
  .flxb-rank-menu {
    position: fixed;
    top: auto;
    left: 14px;
    right: 14px;
    width: auto !important;
  }

  .flxb-rank-row,
  .flxb-rank-row.is-first {
    grid-template-columns: 46px 1fr 24px;
    gap: 10px;
    min-height: 86px;
  }

  .flxb-rank-row.is-first {
    min-height: 116px;
  }

  .flxb-rank-no {
    font-size: 18px;
  }

  .flxb-rank-row.is-first .flxb-rank-no {
    font-size: 32px;
  }

  .flxb-rank-focus,
  .flxb-rank-price {
    display: none;
  }

  .flxb-rank-person img {
    width: 42px;
    height: 42px;
    border-radius: 12px;
  }

  .flxb-rank-row.is-first .flxb-rank-person img {
    width: 54px;
    height: 54px;
    border-radius: 15px;
  }

  .flxb-rank-row.is-first .flxb-rank-person b {
    font-size: 16px;
  }

  .flxb-rank-after {
    align-items: flex-start;
    flex-direction: column;
  }

  .flxb-rank-explore-grid {
    grid-template-columns: 1fr;
  }

  .flxb-rank-explore-grid a,
  .flxb-rank-explore-grid a:nth-child(even) {
    padding-left: 0;
  }
}

/* ---------- Pagination ---------- */

.flxb-rank-pager {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 24px 12px;
  border-top: 1px solid var(--flxb-line);
}

/* Arrow groups hold the ends; the numbers take the middle. */
.flxb-rank-pager-side {
  display: flex;
  align-items: center;
  gap: 4px;
}

.flxb-rank-pager-nums {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 1 1 auto;
  flex-wrap: wrap;
  gap: 4px;
  min-width: 0;
}

.flxb-rank-pager-nums a,
.flxb-rank-pager-nums .is-current,
.flxb-rank-pager-gap {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  font-size: 12px;
  font-weight: 650;
  color: #85888b;
}

.flxb-rank-pager-nums a:hover {
  background: #f4f6f5;
  color: var(--flxb-ink);
}

.flxb-rank-pager-nums .is-current {
  color: var(--flxb-brand);
  font-weight: 780;
}

.flxb-rank-pager-gap {
  color: #b5b8ba;
  cursor: default;
}

.flxb-rank-pager-arrow {
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  color: #85888b;
}

.flxb-rank-pager-arrow svg {
  width: 15px;
  height: 15px;
}

/* One chevron asset, mirrored for first/previous. */
.flxb-rank-pager-arrow.is-back svg {
  transform: scaleX(-1);
}

.flxb-rank-pager-arrow:hover {
  background: #f4f6f5;
  color: var(--flxb-ink);
}

.flxb-rank-pager-arrow.is-disabled {
  color: #d6d9da;
  pointer-events: none;
}

@media (max-width: 620px) {
  .flxb-rank-pager {
    gap: 8px;
  }

  .flxb-rank-pager-nums {
    gap: 2px;
  }

  .flxb-rank-pager-nums a,
  .flxb-rank-pager-nums .is-current,
  .flxb-rank-pager-gap {
    min-width: 26px;
    padding: 0 3px;
  }
}
