/* NOVARIS HOME PREMIUM GRID v6 — consistent 2-column services layout */
#root .grid:has(> .novaris-home-premium-card) {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  grid-auto-flow: row !important;
  align-items: stretch !important;
  column-gap: clamp(18px, 2.2vw, 32px) !important;
  row-gap: clamp(22px, 2.8vw, 40px) !important;
}

#root .grid:has(> .novaris-home-premium-card) > .novaris-home-premium-card {
  grid-column: auto !important;
  grid-row: auto !important;
  width: auto !important;
  min-width: 0 !important;
  max-width: none !important;
  align-self: stretch !important;
}

#root .grid:has(> .novaris-home-premium-card) > .novaris-home-premium-card .novaris-home-scroll-reveal {
  max-width: none !important;
}

@media (max-width: 680px) {
  #root .grid:has(> .novaris-home-premium-card) {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 0 !important;
    row-gap: 22px !important;
  }
}

@media (prefers-reduced-motion: reduce) {
  #root .grid:has(> .novaris-home-premium-card) > .novaris-home-premium-card {
    transform: none !important;
  }
}

/* Target the actual Home.tsx services grid used by the active homepage. */
#root [class~="grid-cols-1"][class~="sm:grid-cols-2"][class~="lg:grid-cols-3"] {
  grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
}

@media (max-width: 680px) {
  #root [class~="grid-cols-1"][class~="sm:grid-cols-2"][class~="lg:grid-cols-3"] {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    column-gap: 12px !important;
    row-gap: 18px !important;
  }
}

/* Keep the first homepage service title on one line on narrow screens. */
@media (max-width: 680px) {
  #root [class~="grid-cols-1"][class~="sm:grid-cols-2"][class~="lg:grid-cols-3"] > :first-child h3 {
    white-space: nowrap !important;
    font-size: clamp(0.58rem, 2.8vw, 0.75rem) !important;
    letter-spacing: 0.04em !important;
  }
}

/* Keep every homepage service title on one line on narrow screens. */
@media (max-width: 680px) {
  #root [class~="grid-cols-1"][class~="sm:grid-cols-2"][class~="lg:grid-cols-3"] > * h3 {
    white-space: nowrap !important;
    font-size: clamp(0.46rem, 2.35vw, 0.72rem) !important;
    letter-spacing: 0.025em !important;
    line-height: 1.15 !important;
  }
}
