/* =========================================================
   AI Search Ranking page
   Design source: Figma "AI Search Present - Final" node 4095:90828
   ========================================================= */

/* ---------- Section widths ---------- */

.site-main > .rank-banner {
  width: 100%;
}

.site-main > .rank-board {
  width: min(1084px, calc(100% - 48px));
}

.site-main > .hl-slider,
.site-main > .pin-cards,
.site-main > .rank-articles {
  width: min(1264px, calc(100% - 48px));
}

/* ---------- Banner ---------- */

.rank-banner {
  position: relative;
  overflow: hidden;
  padding: clamp(56px, 4rem + 3vw, 100px) 24px;
}

.rank-banner__bg {
  position: absolute;
  inset: 0;
  pointer-events: none;
}

.rank-banner__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: bottom;
}

/* Figma: mockup art occupies the right 2/3, bleeding past the top edge. */
.rank-banner__art-clip {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.rank-banner__art {
  position: absolute;
  top: -7.7%;
  left: 32.5%;
  width: 69.1%;
  height: 123.8%;
  object-fit: cover;
}

.rank-banner__gradient {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(91.6deg, #1c73e9 42.64%, rgba(42, 196, 139, 0.2) 98.5%);
}

.rank-banner__content {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 16px;
  width: min(1264px, 100%);
  margin: 0 auto;
  color: #fff;
}

.rank-banner__title {
  max-width: 665px;
  font-size: clamp(2.25rem, 1.5rem + 2.5vw, 3.5rem);
  font-weight: 700;
  line-height: 1.29;
}

.rank-banner__desc {
  max-width: 665px;
  font-size: clamp(1.125rem, 1rem + 0.9vw, 1.625rem);
  line-height: 1.54;
}

/* ---------- Ranking board ---------- */

.rank-board {
  display: flex;
  flex-direction: column;
  gap: 40px;
}

.rank-board__header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
  text-align: center;
}

.rank-board__title-row {
  display: flex;
  gap: 8px;
  align-items: center;
}

.rank-board__icon {
  width: 48px;
  height: 48px;
}

.rank-board__title {
  font-size: clamp(2rem, 1.4rem + 2.2vw, 3.25rem);
  font-weight: 700;
  line-height: 1.5;
  color: #1e1e1e;
}

.rank-board__subtitle {
  max-width: 912px;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.5;
  color: #1e1e1e;
}

/* ---------- Filters ---------- */

.rank-board__filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: flex-end;
  width: 100%;
}

.rank-filter {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 10px 12px 10px 20px;
  border: 1px solid rgba(28, 28, 28, 0.1);
  border-radius: 99px;
  background: transparent;
  font-family: inherit;
  font-size: 16px;
  line-height: 1;
  color: #000;
  cursor: pointer;
}

.rank-filter:first-child {
  gap: 16px;
  padding-left: 16px;
}

.rank-filter__avatars {
  display: flex;
  align-items: center;
}

.rank-filter__avatar {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 20px;
  height: 20px;
  margin-right: -7.5px;
  border-radius: 50%;
  background: #fff;
}

.rank-filter__avatar:last-child {
  margin-right: 0;
}

.rank-filter__avatar img {
  width: 15px;
  height: 15px;
  object-fit: contain;
}

.rank-filter__label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.rank-filter__chevron {
  width: 20px;
  height: 20px;
}

.rank-board__updated {
  flex: 1;
  align-self: center;
  font-size: 16px;
  line-height: 1.5;
  text-align: right;
  color: #888;
}

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

.rank-table-wrap {
  width: 100%;
  overflow-x: auto;
  /* Room for the card's drop shadow inside the scroll container (all edges).
     Horizontal bleed stays within the page's 24px gutters. */
  padding: 24px 24px 48px;
  margin: -24px -24px -48px;
}

.rank-table {
  display: flex;
  flex-direction: column;
  gap: 24px;
  min-width: 720px;
  padding: 28px 42px;
  border-radius: 26px;
  background: #fff;
  filter: drop-shadow(0 8px 12.5px #f4f5fc) drop-shadow(0 20px 12.5px rgba(244, 245, 252, 0.5));
}

/* Head and rows share one column template so labels stay over their data
   at every container width. */
.rank-table__head,
.rank-row {
  display: grid;
  grid-template-columns: minmax(60px, 220px) minmax(180px, 370px) minmax(90px, max-content) minmax(140px, 1fr);
  align-items: center;
}

.rank-table__head {
  padding-bottom: 9px;
  border-bottom: 1px solid rgba(136, 136, 136, 0.3);
}

.rank-table__col {
  position: relative;
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.5;
  color: transparent;
  background-image: var(--gradient-brand, linear-gradient(135deg, #1c73e9 38.87%, #2ac48b 88.955%));
  background-clip: text;
  -webkit-background-clip: text;
}

/* Sits over the brand names (logo 38px + 17px gap into the column). */
.rank-table__col--brand { justify-self: start; padding-left: 55px; }
.rank-table__col--mention { justify-self: center; }
.rank-table__col--perf { justify-self: end; padding-right: 8px; }

.rank-info {
  display: grid;
  place-items: center;
  width: 21px;
  height: 21px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.rank-info img {
  width: 21px;
  height: 21px;
}

/* ---------- Tooltip ---------- */

.rank-tooltip {
  position: absolute;
  top: calc(100% + 2px);
  left: 50%;
  z-index: 5;
  display: none;
  flex-direction: column;
  width: 320px;
  transform: translateX(-24px);
}

.rank-tooltip.is-open {
  display: flex;
}

.rank-tooltip--right {
  left: auto;
  right: 0;
  transform: none;
}

.rank-tooltip__beak {
  display: block;
  width: 18px;
  height: 14px;
  margin-left: 14px;
  transform: scaleY(-1);
}

/* Figma-exported SVGs declare width/height 100% — size them via the box. */
.rank-tooltip__beak img {
  display: block;
  width: 18px;
  height: 14px;
}

.rank-tooltip__close img {
  display: block;
  width: 12px;
  height: 12px;
}

.rank-tooltip--right .rank-tooltip__beak {
  align-self: flex-end;
  margin-right: 14px;
}

.rank-tooltip--right .rank-tooltip__box {
  border-radius: 8px 0 8px 8px;
}

.rank-tooltip__box {
  display: flex;
  flex-direction: column;
  padding: 12px;
  border-radius: 0 8px 8px 8px;
  background: #fff;
  box-shadow: 0 4px 32px -4px rgba(111, 108, 143, 0.12), 0 3px 8px -2px rgba(92, 93, 164, 0.06);
}

.rank-tooltip__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 6px;
}

.rank-tooltip__label {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  font-size: 14px;
  font-weight: 500;
  line-height: 1.15;
  letter-spacing: -0.005em;
  color: transparent;
  background-image: var(--gradient-brand, linear-gradient(135deg, #1c73e9 38.87%, #2ac48b 88.955%));
  background-clip: text;
  -webkit-background-clip: text;
}

.rank-tooltip__label-icon {
  width: 16px;
  height: 16px;
}

.rank-tooltip__close {
  display: grid;
  place-items: center;
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
}

.rank-tooltip__text {
  font-size: 14px;
  font-weight: 400;
  line-height: 18px;
  letter-spacing: -0.005em;
  text-align: left;
  color: #888;
}

/* ---------- Rows ---------- */

.rank-table__body {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-row {
  padding-right: 8px;
}

.rank-row__rank {
  font-size: 19px;
  font-weight: 500;
  line-height: 1.5;
  color: #0a112f;
}

.rank-row__brand {
  display: flex;
  gap: 17px;
  align-items: center;
}

.rank-row__logo,
.rank-row__logo img {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 50%;
}

.rank-row__name {
  font-size: 21px;
  line-height: 1.6;
  color: #0a112f;
}

.rank-row__mention {
  justify-self: center;
  font-size: 21px;
  font-weight: 700;
  line-height: 1.5;
  color: #0a112f;
}

.rank-row__perf {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: flex-end;
  padding-inline: 17px;
  font-size: 21px;
  font-weight: 500;
  line-height: 1.5;
}

.rank-row__perf small {
  font-size: 15px;
  font-weight: 500;
}

.rank-row__perf--up { color: #2bc48b; }
.rank-row__perf--down { color: #e02525; }
.rank-row__perf--flat { color: #888; }

/* The Figma source SVGs point the wrong way; the design flips them 180°. */
.rank-row__trend {
  width: 21px;
  height: 21px;
  transform: rotate(180deg);
}

.rank-row__trend--flat {
  display: flex;
  flex-direction: column;
  gap: 3px;
  align-items: center;
  justify-content: center;
}

.rank-row__trend--flat i {
  width: 13px;
  height: 5px;
  border-radius: 12px;
  background-image: linear-gradient(180deg, rgba(233, 233, 233, 0.8), rgba(130, 130, 130, 0.8));
}

/* All three trend glyphs render; show only the one matching the row's
   direction so JS can switch direction by swapping the perf class alone. */
.rank-row__trend {
  display: none;
}

.rank-row__perf--up .rank-row__trend--up,
.rank-row__perf--down .rank-row__trend--down {
  display: block;
}

.rank-row__perf--flat .rank-row__trend--flat {
  display: flex;
}

/* ---------- Filter dropdowns ---------- */

.rank-filter-group {
  position: relative;
}

.rank-filter[aria-expanded="true"] {
  border-color: transparent;
  background-image: linear-gradient(135deg, rgba(28, 115, 233, 0.12), rgba(42, 196, 139, 0.12));
}

.rank-filter[aria-expanded="true"] .rank-filter__chevron {
  transform: rotate(180deg);
}

.rank-filter__chevron {
  transition: transform var(--duration-fast) ease;
}

.rank-filter__menu[hidden] {
  display: none;
}

.rank-filter__menu {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  z-index: 20;
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 200px;
  max-height: 320px;
  margin: 0;
  padding: 12px;
  overflow-y: auto;
  list-style: none;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 4px 32px -4px rgba(111, 108, 143, 0.16), 0 3px 8px -2px rgba(92, 93, 164, 0.08);
}

.rank-filter__option {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 16px;
  line-height: 1.4;
  color: #000;
  cursor: pointer;
}

.rank-filter__option:hover,
.rank-filter__option:focus-visible {
  background: var(--color-surface-soft);
  outline: none;
}

.rank-filter__option.is-selected {
  background-image: linear-gradient(135deg, rgba(28, 115, 233, 0.12), rgba(42, 196, 139, 0.12));
  font-weight: 600;
}

.rank-filter__option-icon {
  display: grid;
  place-items: center;
  overflow: hidden;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06);
}

.rank-filter__option-icon img {
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.rank-row.is-hidden {
  display: none;
}

.rank-table__empty {
  padding: 32px 0;
  font-size: 18px;
  text-align: center;
  color: var(--color-text-muted);
}

/* ---------- Highlight slider ---------- */

.hl-slider {
  position: relative;
}

.hl-slider__viewport {
  overflow: hidden;
}

.hl-slider__track {
  display: flex;
  transition: transform var(--duration-normal) var(--ease-out);
}

.hl-slide {
  display: flex;
  flex: 0 0 100%;
  gap: 48px;
  align-items: flex-start;
}

.hl-slide__image {
  display: block;
  flex: 0 0 min(634px, 48vw);
  height: auto;
  aspect-ratio: 634 / 363;
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 36px 45px rgba(28, 115, 233, 0.08);
}

.hl-slide__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hl-slide__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
  min-width: 0;
  padding-top: 32px;
}

.hl-slide__eyebrow {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  font-size: 20px;
  line-height: 2;
  letter-spacing: 0.02em;
  color: #000;
}

.hl-slide__flame {
  width: 32px;
  height: 32px;
}

.hl-slide__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: clamp(2rem, 1.5rem + 1.7vw, 3rem);
  font-weight: 600;
  line-height: 1.17;
}

.hl-slide__title a {
  color: transparent;
  background-image: var(--gradient-brand, linear-gradient(146deg, #1c73e9 38.87%, #2ac48b 88.955%));
  background-clip: text;
  -webkit-background-clip: text;
}

.hl-slide__excerpt {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  font-size: 24px;
  line-height: 1.5;
  color: #757575;
  opacity: 0.8;
}

.hl-slide__cta {
  display: inline-flex;
  gap: 8px;
  align-items: center;
  padding: 12px 24px 12px 32px;
  border: 1px solid var(--color-brand-blue);
  border-radius: 100px;
  box-shadow: 0 1px 2px rgba(16, 24, 40, 0.05);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.33;
}

.hl-slide__cta span {
  color: transparent;
  background-image: var(--gradient-brand, linear-gradient(126deg, #1c73e9 38.87%, #2ac48b 88.955%));
  background-clip: text;
  -webkit-background-clip: text;
}

.hl-slide__cta-icon {
  width: 20px;
  height: 20px;
}

.hl-slider .slider-dots--sm {
  justify-content: center;
  width: min(634px, 48vw);
  margin-top: 24px;
}

.hl-slider__arrows {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 12px;
}

.hl-slider__arrows .slider-arrow {
  position: static;
  transform: none;
}

.hl-slider__arrows .slider-arrow:hover {
  transform: scale(1.06);
}

/* ---------- Pin cards ---------- */

.pin-cards {
  display: flex;
  flex-direction: column;
  gap: 60px;
}

.pin-card {
  display: flex;
  gap: 24px;
  align-items: center;
  padding: 24px 24px 24px 80px;
  border-radius: 24px;
  background: #fff;
  filter: drop-shadow(0 8px 12.5px #f4f5fc) drop-shadow(0 20px 12.5px rgba(244, 245, 252, 0.5));
}

.pin-card--flip {
  flex-direction: row-reverse;
  padding: 24px 80px 24px 24px;
  border-radius: 40px;
}

/* Citation variant: taller cards (Figma py-60). */
.pin-card--roomy {
  padding-block: 60px;
}

.pin-card__text {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}

.pin-card__title {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.75rem);
  font-weight: 600;
  line-height: 1.27;
  color: #000;
}

.pin-card__desc {
  font-size: clamp(1.25rem, 1rem + 1vw, 2rem);
  line-height: 1.38;
  color: #000;
  opacity: 0.8;
}

.pin-card__media {
  position: relative;
  flex: 0 0 min(568px, 45%);
  height: auto;
  aspect-ratio: 568 / 426;
  container-type: inline-size;
}

.pin-card__media .pin-card__img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.pin-card__media--chart .pin-card__img,
.pin-card__media--shield .pin-card__img {
  object-fit: cover;
  border-radius: 16px;
}

/* White patch covering the stock logo baked into the orbit artwork. It cannot
   be a pseudo of the label: with background-clip:text the gradient glyphs are
   painted in the background layer, underneath any negative-z pseudo. */
.pin-card__media--orbit::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 24cqw;
  height: 10.6cqw;
  background: #fff;
  transform: translate(-50%, -50%);
}

.pin-card__label {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 1;
  max-width: 21.2cqw;
  transform: translate(-50%, -50%);
  font-size: 3.5cqw;
  font-weight: 700;
  line-height: 1.2;
  text-align: center;
  color: transparent;
  background-image: var(--gradient-brand, linear-gradient(114deg, #1c73e9 38.87%, #2ac48b 88.955%));
  background-clip: text;
  -webkit-background-clip: text;
}

/* ---------- Articles ---------- */

.rank-articles {
  display: flex;
  flex-direction: column;
  gap: 48px;
}

.rank-articles__header {
  display: flex;
  flex-direction: column;
  gap: 16px;
  text-align: center;
}

.rank-articles__title {
  font-size: clamp(1.75rem, 1.3rem + 1.6vw, 2.5rem);
  font-weight: 700;
  line-height: 1.5;
  color: var(--color-text-strong);
}

.rank-articles__subtitle {
  max-width: 900px;
  margin: 0 auto;
  font-size: clamp(1.125rem, 1rem + 0.6vw, 1.5rem);
  line-height: 1.65;
  color: var(--color-text-muted);
}

.rank-articles__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 48px 24px;
}

.blog-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: 16px;
  background: #fff;
  filter: drop-shadow(0 8px 12.5px #f4f5fc) drop-shadow(0 20px 12.5px rgba(244, 245, 252, 0.5));
}

.blog-card__image {
  display: block;
  height: 202px;
}

.blog-card__image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.blog-card__body {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
}

.blog-card__title {
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  font-size: 20px;
  font-weight: 500;
  line-height: 1.4;
  letter-spacing: 0.02em;
  color: #1a202e;
}

.blog-card__title a:hover {
  color: var(--color-brand-blue);
}

.blog-card__date {
  margin-top: auto;
  padding-top: 4px;
  font-size: 14px;
  line-height: 1.43;
  color: var(--color-text-faint);
}

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

.rank-pagination {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
}

.rank-pagination .page-numbers {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 1.3px 3.9px rgba(62, 62, 62, 0.1);
  font-size: 15.75px;
  font-weight: 500;
  color: #333;
}

.rank-pagination .page-numbers.current {
  background: var(--gradient-brand, linear-gradient(106deg, #1c73e9 38.87%, #2ac48b 88.955%));
  font-weight: 600;
  color: #fff;
}

.rank-pagination .page-numbers img {
  width: 8px;
  height: 13px;
}

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

@media (max-width: 1024px) {
  .hl-slide {
    flex-direction: column;
    gap: 24px;
  }

  .hl-slide__image {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 634 / 363;
  }

  .hl-slide__body {
    padding-top: 0;
    padding-bottom: 72px;
  }

  .hl-slider .slider-dots--sm {
    width: 100%;
  }

  .pin-card,
  .pin-card--flip {
    flex-direction: column;
    padding: 24px;
  }

  .pin-card__media {
    flex: none;
    width: 100%;
    height: auto;
    aspect-ratio: 568 / 426;
  }

  .rank-articles__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .rank-board__updated {
    flex: none;
    width: 100%;
    text-align: left;
  }

  .rank-articles__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  .rank-tooltip {
    width: min(320px, 80vw);
  }
}
