/*
 * WaaFaa homepage -- the products band.
 *
 * Replaces the single-product PIOS band that used to sit in this slot. PIOS is
 * still the thing this section leads with, but as the FEATURED card of five
 * rather than the only one -- a PIOS band directly above a products grid that
 * also contains PIOS read as the same product announced twice.
 *
 * Shape: one wide featured card (copy + spec panel), then a four-up row of the
 * rest. That is the standard "flagship + catalogue" band, and it is why the
 * section can carry five products without becoming a fifth screen of homepage.
 *
 * Palettes are the DARK stops, taken from each product's own landing tokens --
 * the same five as products.css, and the two files must agree. Light-mode stops
 * live in waafaa-theme-modes.css.
 */

body .waafaa-home-products {
  position: relative;
  /* The section carries id="products"; the header is fixed, so an anchor jump
     would otherwise land with the heading hidden behind it. Matches pricing.css
     and the band this replaced. */
  scroll-margin-top: 7rem;
}

/* One wide wash behind the band, so it reads as a spotlight rather than another
   card row. Carried over from the PIOS band, whose cyan/blue this still is. */
body .waafaa-home-products::before {
  background:
    radial-gradient(ellipse 60% 70% at 78% 22%, rgba(34, 211, 238, 0.1), transparent 70%),
    radial-gradient(ellipse 55% 80% at 12% 78%, rgba(99, 102, 241, 0.13), transparent 70%);
  content: "";
  inset: 0;
  pointer-events: none;
  position: absolute;
}

body .waafaa-home-products > * {
  position: relative;
  z-index: 1;
}

body .waafaa-home-products__head {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 2.25rem;
  max-width: 44rem;
}

/*
 * Core's block-gap adds margin-block-start to every sibling block but the
 * first. Each container here is a grid with its own gap, so that margin is
 * doubled-up spacing -- and inside a stat it drops the label away from its
 * number. The homepage has no blanket reset for this the way inner-common.css
 * does for "-grid" containers, so each new container has to state it. The
 * "__grid"/"-grid" containers below are already covered by home-common.css.
 */
body .waafaa-home-products__head > *,
body .waafaa-prod-feature > *,
body .waafaa-prod-feature__copy > *,
body .waafaa-prod-feature__panel > *,
body .waafaa-prod-feature__stats > *,
body .waafaa-prod-stat > *,
body .waafaa-prod-mini > *,
body .waafaa-prod-mini__head > *,
body .waafaa-prod-mini__titles > *,
body .waafaa-prod-mini__foot > * {
  margin-block-start: 0 !important;
}

/* ---------- Featured card: PIOS ---------- */

body .waafaa-prod-feature {
  --prod-accent: #4d92ff;
  --prod-accent-2: #22d3ee;
  align-items: center;
  border-color: rgba(34, 211, 238, 0.22) !important;
  display: grid;
  gap: 2.75rem;
  grid-template-columns: minmax(0, 1.08fr) minmax(18rem, 0.92fr);
  margin-block-start: 0 !important;
  overflow: hidden;
  padding: 2.25rem;
  position: relative;
}

body .waafaa-prod-feature::before {
  background: linear-gradient(90deg, var(--prod-accent) 0%, var(--prod-accent-2) 100%);
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

body .waafaa-prod-feature__copy {
  display: grid;
  gap: 1.1rem;
  max-width: 38rem;
}

body .waafaa-prod-feature .waafaa-eyebrow {
  color: var(--prod-accent-2) !important;
}

body .waafaa-prod-feature__copy h3 {
  font-size: clamp(1.6rem, 2.6vw, 2.1rem) !important;
  font-weight: 900;
  letter-spacing: -0.02em;
  line-height: 1.1 !important;
}

body .waafaa-prod-feature__lede {
  background: linear-gradient(135deg, var(--prod-accent) 0%, var(--prod-accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-size: 1.25rem !important;
  font-weight: 850;
  line-height: 1.3 !important;
}

body .waafaa-prod-feature__points {
  display: grid;
  gap: 0.55rem;
  list-style: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body .waafaa-prod-feature__points li {
  font-size: 0.9rem;
  line-height: 1.55;
  padding-left: 1.5rem;
  position: relative;
}

body .waafaa-prod-feature__points li::before {
  background: linear-gradient(135deg, var(--prod-accent), var(--prod-accent-2));
  border-radius: 50%;
  content: "";
  height: 0.45rem;
  left: 0.25rem;
  position: absolute;
  top: 0.55rem;
  width: 0.45rem;
}

body .waafaa-prod-feature__install {
  margin: 0 !important;
}

body .waafaa-prod-feature__install code,
body .waafaa-prod-feature__note code {
  background: rgba(34, 211, 238, 0.1);
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 0.35rem;
  color: var(--prod-accent-2);
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.82rem;
  padding: 0.3rem 0.55rem;
  white-space: nowrap;
}

body .waafaa-prod-feature__note code {
  font-size: 0.74rem;
  padding: 0.15rem 0.35rem;
}

body .waafaa-prod-feature__actions .waafaa-button--primary .wp-block-button__link {
  background: linear-gradient(135deg, var(--prod-accent) 0%, var(--prod-accent-2) 100%);
  color: #04121f;
}

body .waafaa-prod-feature__actions .waafaa-button--ghost .wp-block-button__link {
  border-color: rgba(34, 211, 238, 0.34);
  color: var(--prod-accent-2);
}

/* ---------- Featured card: spec panel ---------- */

body .waafaa-prod-feature__panel {
  background: rgba(4, 11, 22, 0.55);
  border: 1px solid var(--waafaa-border);
  border-radius: 0.75rem;
  display: grid;
  gap: 1.25rem;
  padding: 1.75rem;
}

body .waafaa-prod-feature__logo {
  margin: 0 !important;
}

body .waafaa-prod-feature__logo img {
  display: block;
  height: 3.5rem;
  width: auto;
}

body .waafaa-prod-feature__kicker {
  color: var(--waafaa-text) !important;
  font-size: 1.02rem !important;
  font-weight: 800;
  line-height: 1.4 !important;
}

body .waafaa-prod-feature__stats {
  border-top: 1px solid var(--waafaa-border);
  display: grid;
  gap: 1.25rem 1.5rem;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding-top: 1.35rem;
}

body .waafaa-prod-stat {
  display: grid;
  gap: 0.25rem;
}

body .waafaa-prod-stat__value {
  background: linear-gradient(135deg, var(--prod-accent) 0%, var(--prod-accent-2) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent !important;
  font-size: 1.7rem !important;
  font-weight: 900;
  line-height: 1.05 !important;
}

body .waafaa-prod-stat__label {
  font-size: 0.78rem !important;
  line-height: 1.4 !important;
}

body .waafaa-prod-feature__note {
  border-top: 1px solid var(--waafaa-border);
  font-size: 0.8rem !important;
  line-height: 1.65 !important;
  padding-top: 1.1rem;
}

/* ---------- The other four ---------- */

body .waafaa-home-products__grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-block-start: 1.25rem !important;
}

body .waafaa-prod-mini {
  --prod-accent: var(--waafaa-blue);
  --prod-accent-2: var(--waafaa-purple);
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  overflow: hidden;
  padding: 1.4rem;
  position: relative;
  transition: border-color 0.18s ease, box-shadow 0.18s ease, transform 0.18s ease;
}

body .waafaa-prod-mini::before {
  background: linear-gradient(90deg, var(--prod-accent) 0%, var(--prod-accent-2) 100%);
  content: "";
  height: 3px;
  left: 0;
  position: absolute;
  right: 0;
  top: 0;
}

body .waafaa-prod-mini::after {
  background: radial-gradient(circle at 100% 0%, var(--prod-accent) 0%, transparent 62%);
  content: "";
  height: 9rem;
  opacity: 0.1;
  pointer-events: none;
  position: absolute;
  right: 0;
  top: 0;
  width: 9rem;
}

body .waafaa-prod-mini > * {
  position: relative;
  z-index: 1;
}

body .waafaa-prod-mini:hover,
body .waafaa-prod-mini:focus-within {
  border-color: color-mix(in srgb, var(--prod-accent) 45%, transparent);
  box-shadow: 0 1.25rem 3rem color-mix(in srgb, var(--prod-accent) 20%, transparent);
  transform: translateY(-4px);
}

body .waafaa-prod-mini__head {
  align-items: center;
  display: flex;
  gap: 0.7rem;
}

body .waafaa-prod-mini__icon {
  align-items: center;
  background: color-mix(in srgb, var(--prod-accent) 14%, transparent);
  border: 1px solid color-mix(in srgb, var(--prod-accent) 32%, transparent);
  border-radius: 0.6rem;
  display: flex;
  flex: 0 0 auto;
  height: 2.8rem;
  justify-content: center;
  margin: 0 !important;
  width: 2.8rem;
}

body .waafaa-prod-mini__icon img {
  border-radius: 0.4rem;
  display: block;
  height: 1.7rem;
  object-fit: contain;
  width: 1.7rem;
}

body .waafaa-prod-mini__titles {
  display: grid;
  gap: 0.15rem;
  min-width: 0;
}

body .waafaa-prod-mini__titles h3 {
  font-size: 0.98rem !important;
  font-weight: 850;
  line-height: 1.25 !important;
}

body .waafaa-prod-mini__kind {
  color: var(--waafaa-muted) !important;
  font-size: 0.64rem !important;
  font-weight: 800;
  letter-spacing: 0.09em;
  line-height: 1.35 !important;
  text-transform: uppercase;
}

/* Two lines at this size. Written to two; the min-height keeps the four
   taglines on one baseline when one of them lands on a single line. */
body .waafaa-prod-mini__tagline {
  color: var(--prod-accent) !important;
  font-size: 0.9rem !important;
  font-weight: 800;
  line-height: 1.35 !important;
  min-height: 2.7em;
}

body .waafaa-prod-mini > p:not([class]) {
  font-size: 0.85rem !important;
  line-height: 1.6 !important;
  min-height: 6.4em;
}

body .waafaa-prod-mini code {
  background: color-mix(in srgb, var(--prod-accent) 12%, transparent);
  border-radius: 0.3rem;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.85em;
  padding: 0.1rem 0.3rem;
}

/* margin-top:auto pins the footer to the card's base so all four line up. */
body .waafaa-prod-mini__foot {
  display: grid;
  gap: 0.7rem;
  justify-items: start;
  margin-block-start: auto !important;
  padding-top: 0.35rem;
}

body .waafaa-prod-mini__status {
  background: color-mix(in srgb, var(--prod-accent) 13%, transparent) !important;
  border-color: color-mix(in srgb, var(--prod-accent) 30%, transparent) !important;
  color: var(--prod-accent) !important;
  font-size: 0.7rem !important;
}

body .waafaa-prod-mini__link {
  font-size: 0.85rem !important;
  font-weight: 700;
  line-height: 1.4 !important;
}

body .waafaa-prod-mini__link a {
  color: var(--prod-accent) !important;
  text-decoration: none;
}

body .waafaa-prod-mini__link a::after {
  content: " \2192";
}

body .waafaa-prod-mini__link a:hover,
body .waafaa-prod-mini__link a:focus-visible {
  text-decoration: underline;
}

body .waafaa-home-products__more {
  display: flex;
  justify-content: center;
  margin-block-start: 2rem !important;
}

/* ---------- Per-product palettes (dark mode) ---------- */

/* These four must stay equal to their counterparts in products.css. The fifth,
   PIOS, is the featured card and declares its own stops above. */

body .waafaa-prod-mini--extlytics {
  --prod-accent: #74c2a8;
  --prod-accent-2: #2f9c80;
}

body .waafaa-prod-mini--plinth {
  --prod-accent: #63b795;
  --prod-accent-2: #d9a441;
}

body .waafaa-prod-mini--commentaura {
  --prod-accent: #4fa3d1;
  --prod-accent-2: #7fc6e8;
}

body .waafaa-prod-mini--zain {
  --prod-accent: #8b7cff;
  --prod-accent-2: #f0df4b;
}

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

@media (max-width: 1060px) {
  body .waafaa-prod-feature {
    gap: 2rem;
    grid-template-columns: minmax(0, 1fr);
  }

  body .waafaa-prod-feature__copy {
    max-width: none;
  }

  body .waafaa-home-products__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 660px) {
  body .waafaa-prod-feature {
    padding: 1.5rem;
  }

  body .waafaa-prod-feature__panel {
    padding: 1.35rem;
  }

  body .waafaa-prod-stat__value {
    font-size: 1.4rem !important;
  }

  body .waafaa-prod-feature__install code {
    font-size: 0.74rem;
    white-space: normal;
  }

  body .waafaa-home-products__grid {
    grid-template-columns: minmax(0, 1fr);
  }

  /* One column: the min-heights only add dead space. */
  body .waafaa-prod-mini__tagline,
  body .waafaa-prod-mini > p:not([class]) {
    min-height: 0;
  }
}
