/* ==========================================================================
   Robotic pool cleaner buyer guides (best/guide.njk) and their hub (best/guides.njk)

   These pages are built from best.css. This file holds only what the /best/
   category guides do not need: a headline scale for long titles, the product
   hero, the notice, inline live prices, the ranked pick card, the spec table,
   in-copy links and lists, the checklist, text-only related cards, and the
   hub's guide index. Loaded with `guidePage: true` (base.njk).
   ========================================================================== */

.best-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.best-guide--topic section[id],
.best-guide--topic #glance-heading {
  scroll-margin-top: 110px;
}

/* Headline scale: these titles are full sentences, not three-word category names */
.best-guide--topic .best-guide-hero__copy h1 {
  font-size: clamp(1.9rem, 3.6vw + 0.6rem, 3.4rem);
  letter-spacing: -0.04em;
  line-height: 1.05;
  text-wrap: balance;
}

.best-guide--topic .best-section-heading h2 {
  font-size: clamp(1.7rem, 3.1vw, 2.6rem);
  letter-spacing: -0.032em;
  line-height: 1.08;
  text-wrap: balance;
}

.best-guide--topic .best-guide-cta h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.9rem);
  line-height: 1.06;
  text-wrap: balance;
}

/* Hero: the top pick's product photo instead of a lifestyle image */
.best-guide-hero__media--product {
  display: block;
  background: #f5f5f7;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.07);
}

.best-guide-hero__media--product img {
  padding: clamp(1rem, 3vw, 2.25rem);
  object-fit: contain;
  mix-blend-mode: multiply;
}

/* Quick answer: the first thing a reader should take away */
.best-guide--topic .best-article-verdict {
  padding: 1.5rem 1.6rem 1.6rem;
}

.best-guide--topic .best-article-verdict p {
  color: var(--best-ink);
  font-size: 1.08rem;
  line-height: 1.62;
}

/* Notice: a limit the reader must know before the picks */
.best-notice {
  margin-top: 1.25rem;
  padding: 1.25rem 1.5rem 1.35rem;
  border-left: 4px solid #c77700;
  border-radius: 0 15px 15px 0;
  background: #fff4e5;
}

.best-notice__label {
  display: block;
  margin-bottom: 0.4rem;
  color: #7a4700;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.2;
  text-transform: uppercase;
}

.best-notice p {
  margin: 0;
  color: #4d3408;
  font-size: 0.98rem;
  line-height: 1.62;
}

/* Links written into the copy (they carry no class) */
.best-guide--topic p a:not([class]),
.best-guide--topic li a:not([class]),
.best-guide--topic td a:not([class]) {
  color: var(--best-blue);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

.best-guide--topic p a:not([class]):hover,
.best-guide--topic li a:not([class]):hover,
.best-guide--topic td a:not([class]):hover {
  color: #0077ed;
}

.best-guide--topic .best-ownership p a:not([class]),
.best-guide--topic .best-guide-cta p a:not([class]) {
  color: #8cc4ff;
}

.best-guide--topic .best-notice p a:not([class]) {
  color: #7a4700;
}

/* Introduction above the short list */
.best-guide--topic .best-quick {
  padding-top: 5rem;
}

.best-lead {
  max-width: 820px;
  margin-bottom: 3.5rem;
  color: #313135;
  font-size: 1.1rem;
  line-height: 1.75;
}

/* A live price outside a product card. The wrapper is a .shop-card only so that
   inventory.js refreshes the .shop-card-price inside it; none of the card styling applies. */
.shop-card.best-live-price {
  position: static;
  display: inline;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  text-align: inherit;
  transition: none;
}

.shop-card.best-live-price:hover {
  transform: none;
  border-color: transparent;
  box-shadow: none;
}

.best-live-price .shop-card-price {
  color: inherit;
  font: inherit;
}

/* What matters: body copy a step larger than the category guides' short blurbs */
.best-guide--topic .best-look-for__grid h3 {
  font-size: 1.05rem;
}

.best-guide--topic .best-look-for__grid p {
  color: #515154;
  font-size: 0.9rem;
  line-height: 1.62;
}

/* Ranked pick card (a .shop-card.best-product-card with the guide's own argument inside) */
.best-product-grid--single {
  grid-template-columns: minmax(0, 680px);
}

.best-pick-card .shop-card-media {
  aspect-ratio: 4 / 3;
}

.best-pick-card .best-product-card__badge {
  display: inline-flex;
  gap: 0.5rem;
  align-items: center;
  padding-left: 0.42rem;
}

.best-pick-card__rank {
  display: grid;
  flex: 0 0 auto;
  width: 1.3rem;
  height: 1.3rem;
  place-items: center;
  border-radius: 50%;
  background: #fff;
  color: #1d1d1f;
  font-size: 0.7rem;
  letter-spacing: 0;
}

.best-pick-card .best-product-card__best-for {
  font-size: 0.88rem;
  line-height: 1.5;
}

.best-pick-card__why {
  display: grid;
  gap: 0.85rem;
}

.best-pick-card .best-product-card__verdict {
  color: #424245;
  font-size: 0.95rem;
  line-height: 1.65;
}

.best-pick-card .best-product-card__specs {
  margin-bottom: 0;
}

.best-pick-card .best-product-card__specs dd {
  font-size: 0.84rem;
}

.best-pick-card .best-product-card__bottom-line {
  margin-bottom: 1.4rem;
  padding: 0.95rem 0;
  border-top: 0;
  font-size: 0.88rem;
  line-height: 1.58;
}

.best-pick-card .shop-card-actions .shop-card-add {
  border: 0;
  cursor: pointer;
  font-family: inherit;
}

.best-pick-card .shop-card-actions .shop-card-add[disabled] {
  cursor: not-allowed;
}

.best-guide--topic .best-recommendations .best-expert-note {
  max-width: 900px;
}

/* Comparison table with robots across the top and specifications down the side */
.best-comparison__table--specs {
  min-width: calc(150px + var(--best-cols, 4) * 170px);
  table-layout: fixed;
}

.best-comparison__table--specs thead th {
  color: var(--best-ink);
  font-size: 0.86rem;
  letter-spacing: -0.01em;
  text-transform: none;
  vertical-align: bottom;
}

.best-comparison__table--specs thead th:first-child {
  width: 150px;
  color: #6e6e73;
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.best-comparison__table--specs thead th a {
  color: inherit;
}

.best-comparison__table--specs thead th a:hover {
  color: var(--best-blue);
}

.best-comparison__table--specs th:first-child {
  position: sticky;
  z-index: 1;
  left: 0;
}

.best-comparison__table--specs tbody th {
  width: 150px;
  box-shadow: 1px 0 0 var(--best-line);
  color: #515154;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  line-height: 1.4;
  text-transform: uppercase;
}

.best-comparison__table--specs .shop-card-price {
  color: var(--best-ink);
  font-weight: 650;
}

/* Tables written into a guide section */
.best-longform .best-comparison__scroll {
  margin-top: 1.75rem;
}

.best-comparison__table--data {
  min-width: 560px;
}

.best-comparison__table--data tbody th {
  width: auto;
  color: var(--best-ink);
  font-weight: 650;
}

/* In-depth sections: tighter bands, lists inside the prose */
.best-guide--topic .best-longform {
  padding: 5rem 0;
}

.best-guide--topic .best-prose {
  font-size: 1.02rem;
}

.best-prose ul {
  display: grid;
  gap: 0.6rem;
  margin: 0 0 1.25rem;
  padding-left: 1.3rem;
}

.best-prose ul:last-child {
  margin-bottom: 0;
}

.best-prose li {
  padding-left: 0.2rem;
}

.best-prose li::marker {
  color: var(--best-blue);
}

/* Checklist: the ownership steps without a title line */
.best-steps article {
  align-items: start;
}

.best-steps article p {
  color: rgba(255, 255, 255, 0.84);
  font-size: 0.93rem;
  line-height: 1.62;
}

.best-steps article p strong {
  color: #fff;
}

/* FAQ answers run longer here than in the category guides */
.best-guide--topic .best-faq__list p {
  color: #515154;
  font-size: 0.95rem;
  line-height: 1.68;
}

/* Verdict */
.best-guide--topic .best-guide-cta__inner {
  align-items: center;
}

.best-guide--topic .best-guide-cta p {
  color: rgba(255, 255, 255, 0.78);
  font-size: 1.02rem;
  line-height: 1.65;
}

.best-guide--topic .best-guide-cta p + p {
  margin-top: 0.9rem;
}

/* Related guides: the "more guides" card without a thumbnail */
.best-more-guides__card--text {
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 0.95rem 1.1rem;
}

.best-more-guides__card--text > span:first-child {
  display: flex;
  min-width: 0;
  flex-direction: column;
}

.best-more-guides__card--text small {
  letter-spacing: 0.05em;
}

.best-more-guides__card--text strong {
  overflow: visible;
  font-size: 0.95rem;
  line-height: 1.3;
  text-overflow: clip;
  white-space: normal;
}

.best-guide--topic .best-more-guides__all {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  align-items: center;
  justify-content: center;
}

/* --------------------------------------------------------------------------
   Hub: /best/robotic-pool-cleaner-guides/
   -------------------------------------------------------------------------- */
.best-guides-hub .best-hub-hero__copy h1 {
  font-size: clamp(2.4rem, 4.6vw + 0.5rem, 4.4rem);
  letter-spacing: -0.05em;
  line-height: 1;
  text-wrap: balance;
}

.best-guides-index {
  padding: 5.5rem 0 6.5rem;
  background: #fbfbfd;
}

.best-guides-cluster {
  scroll-margin-top: 110px;
}

.best-guides-cluster + .best-guides-cluster {
  margin-top: 3.75rem;
  padding-top: 3.75rem;
  border-top: 1px solid var(--best-line);
}

.best-guides-cluster .best-section-heading {
  margin-bottom: 1.5rem;
}

.best-guides-cluster .best-section-heading h2 {
  font-size: clamp(1.55rem, 2.6vw, 2.2rem);
  letter-spacing: -0.03em;
  line-height: 1.1;
}

.best-guides-list {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.best-guides-list li {
  min-width: 0;
}

.best-guides-card {
  display: flex;
  height: 100%;
  flex-direction: column;
  gap: 0.4rem;
  padding: 1.1rem 1.2rem 1.15rem;
  border: 1px solid var(--best-line);
  border-radius: 16px;
  background: #fff;
  color: var(--best-ink);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.best-guides-card:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 113, 227, 0.3);
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.06);
}

.best-guides-card strong {
  font-size: 1.02rem;
  letter-spacing: -0.015em;
  line-height: 1.25;
}

.best-guides-card span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--best-muted);
  font-size: 0.82rem;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.best-guides-card em {
  margin-top: auto;
  padding-top: 0.3rem;
  color: var(--best-blue);
  font-size: 0.72rem;
  font-style: normal;
  font-weight: 650;
  letter-spacing: 0.02em;
}

/* Tablet */
@media (max-width: 1050px) {
  .best-guides-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* Mobile */
@media (max-width: 760px) {
  /* best.css sizes every div inside the contents bar to 100%, its own gutter wrapper included;
     on these pages the bar keeps the page gutter */
  .best-guide--topic .best-toc .best-section-inner,
  .best-guides-hub .best-toc .best-section-inner {
    width: min(100% - 36px, 1200px);
  }

  .best-guide--topic .best-quick {
    padding-top: 3.5rem;
  }

  .best-lead {
    margin-bottom: 2.75rem;
    font-size: 1.03rem;
    line-height: 1.7;
  }

  .best-guide--topic .best-article-verdict {
    padding: 1.2rem 1.15rem 1.3rem;
  }

  .best-guide--topic .best-article-verdict p {
    font-size: 1.02rem;
  }

  .best-notice {
    padding: 1.1rem 1.15rem 1.2rem;
  }

  .best-product-grid--single {
    grid-template-columns: 1fr;
  }

  .best-guide--topic .best-longform {
    padding: 3.5rem 0;
  }

  .best-comparison__table--specs {
    min-width: calc(112px + var(--best-cols, 4) * 150px);
  }

  .best-comparison__table--specs th,
  .best-comparison__table--specs td {
    padding: 0.85rem 0.8rem;
  }

  .best-comparison__table--specs thead th:first-child,
  .best-comparison__table--specs tbody th {
    width: 112px;
  }

  .best-guide--topic .best-guide-cta__inner {
    align-items: flex-start;
  }

  .best-guides-index {
    padding: 4rem 0 4.75rem;
  }

  .best-guides-cluster + .best-guides-cluster {
    margin-top: 2.75rem;
    padding-top: 2.75rem;
  }

  .best-guides-list {
    grid-template-columns: 1fr;
    gap: 0.6rem;
  }

  .best-guides-card {
    padding: 0.95rem 1.05rem 1rem;
  }

  .best-guides-card span {
    -webkit-line-clamp: 2;
  }
}

@media (prefers-reduced-motion: reduce) {
  .best-guides-card {
    transition: none;
  }
}
