/* S2 homepage opt 2026-11-26 — local preview only.
   Scoped to the homepage hooks added in index.html. Does not invent
   live/online status. Existing static badges are untouched. */

/* ---- Hero title: keep wording, balance the two desktop lines ---- */
.s2-home-hero .dh {
  max-width: 860px;
}

.s2-home-hero .dh h1 {
  max-width: 100%;
}

@media (min-width: 768px) {
  .s2-home-hero .s2-h1-second {
    display: block;
  }
}

/* ---- Product cards: equal-height rows, actions on one baseline ---- */
#products.dir .dl {
  align-items: stretch;
}

#products.dir .row.prod {
  display: grid !important;
  grid-template-columns: 52px minmax(0, 1fr);
  grid-template-rows: auto auto 1fr auto !important;
  align-content: stretch !important;
  align-items: stretch;
  height: 100%;
  min-height: 0;
}

#products.dir .row.prod > .ic {
  grid-column: 1;
  grid-row: 1;
  align-self: start;
}

#products.dir .row.prod .tl {
  grid-column: 2;
  grid-row: 1;
  padding-right: 36px; /* room for the corner index */
  min-width: 0;
}

#products.dir .row.prod .ds {
  grid-column: 1 / -1;
  grid-row: 2;
  /* keep a consistent blurb block so tags/buttons share a baseline */
  min-height: 2.6em;
}

#products.dir .row.prod .ft {
  /* already hidden; stay out of the grid flow */
  display: none;
}

#products.dir .row.prod .mt {
  grid-column: 1 / -1;
  grid-row: 3;
  align-self: end;
  margin-top: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 10px;
  width: 100%;
  min-height: 28px;
}

#products.dir .row.prod > a.btn,
#products.dir .row.prod > a.kw-pri,
#products.dir .row.prod > a.kw-sec,
#products.dir .row.prod > a[data-pwa="web"] {
  grid-column: 1 / -1 !important;
  grid-row: 4;
  align-self: end;
  justify-self: stretch;
  width: 100%;
  max-width: 100%;
  margin-top: 0;
  box-sizing: border-box;
  white-space: nowrap;
}

/* Index numbers: a bit larger, higher contrast, inset so they do not overflow */
#products.dir .row.prod > .rk {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 1;
  box-sizing: border-box;
  min-width: 1.55em;
  height: 1.55em;
  padding: 0 5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.92rem;
  font-weight: 800;
  line-height: 1;
  letter-spacing: 0;
  color: var(--pr, #0f766e);
  background: color-mix(in srgb, var(--pr, #0f766e) 12%, var(--sf, #fff));
  border: 1px solid color-mix(in srgb, var(--pr, #0f766e) 28%, transparent);
  border-radius: 7px;
}

@media (max-width: 640px) {
  #products.dir .row.prod {
    grid-template-columns: 44px minmax(0, 1fr);
    grid-template-rows: auto auto auto auto !important;
  }

  #products.dir .row.prod .tl {
    padding-right: 0;
  }

  #products.dir .row.prod > .rk {
    position: absolute;
    top: 8px;
    right: 8px;
    min-width: 1.45em;
    height: 1.45em;
    font-size: 0.86rem;
  }

  #products.dir .row.prod .ds,
  #products.dir .row.prod .mt,
  #products.dir .row.prod > a.btn,
  #products.dir .row.prod > a.kw-pri,
  #products.dir .row.prod > a.kw-sec,
  #products.dir .row.prod > a[data-pwa="web"] {
    grid-column: 2 / -1 !important;
  }

  #products.dir .row.prod > a.btn,
  #products.dir .row.prod > a.kw-pri,
  #products.dir .row.prod > a.kw-sec,
  #products.dir .row.prod > a[data-pwa="web"] {
    width: auto;
    max-width: 100%;
    justify-self: start;
    white-space: nowrap;
  }
}

/* ---- Comparison table: short Sign-up labels stay on one line ---- */
.s2-home-cmp .s2-signup-label {
  display: inline-block;
  white-space: nowrap;
  font-weight: 600;
}

@media (min-width: 761px) {
  .s2-home-cmp table.cmp td[data-label="Sign-up"] {
    white-space: nowrap;
  }
}


/* Tablet: longer "Start in Browser" CTAs must not split platform names mid-word. */
@media (min-width: 761px) and (max-width: 1100px) {
  .s2-home-cmp table.cmp td.n {
    min-width: 9.25rem;
  }
  .s2-home-cmp table.cmp td.n .s2-cmp-platform,
  .s2-home-cmp table.cmp td.n strong {
    overflow-wrap: break-word;
    word-break: normal;
    hyphens: none;
  }
  .s2-home-cmp table.cmp tbody tr[data-product-id] td.go > a[href][target] {
    width: auto !important;
    max-width: 9.5rem;
    white-space: nowrap !important;
    overflow-wrap: normal !important;
    font-size: 0.75rem !important;
    padding: 8px 8px !important;
    letter-spacing: 0;
  }
}

/* ---- Featured Streamers: pin View Profile to a shared baseline ---- */
@media (min-width: 641px) {
  .sd .sd-grid,
  .sd .s2-hosts-rail {
    align-items: stretch;
  }

  .sd .sd-grid > .sc,
  .sd .s2-hosts-rail > .sc {
    display: flex;
    flex-direction: column;
    height: 100%;
  }

  .sd .sc .info {
    flex: 1 1 auto;
    display: flex;
    flex-direction: column;
    min-height: 0;
  }

  .sd .sc .cta {
    margin-top: auto;
    width: 100%;
  }
}

/* ---- Mobile <768px: Featured Streamers above the 15-row table ----
   No compact top-3 card set exists; the 15-card grid would still force
   a long scroll. Streamers (3 profiles + View Profile) go first. */
@media (max-width: 767.98px) {
  main {
    display: flex;
    flex-direction: column;
  }

  main > .s2-home-hero {
    order: 1;
  }

  main > .s2-home-streamers-wrap {
    order: 2;
    margin-top: 8px !important;
  }

  main > .s2-home-cmp {
    order: 3;
  }

  main > #products {
    order: 4;
  }

  main > *:not(.s2-home-hero):not(.s2-home-streamers-wrap):not(.s2-home-cmp):not(#products) {
    order: 5;
  }
}
