[class*="radial-gradient(circle_at_80%_28%"],
[class*="linear-gradient(0deg,rgba(20,18,15,.62)"] {
  opacity: 0.9;
}

.isolate:has(.rivas-global-header) {
  isolation: auto !important;
}

/* Keep regular sections and footers aligned without changing heroes. */
section:not(:has(h1)) [class~="max-w-[1440px]"],
footer [class~="max-w-[1440px]"] {
  max-width: 1600px;
}

/* The navigation follows the viewport, not the regular section width cap. */
:root {
  --rivas-navbar-gutter: max(12px, 4.7vw);
}

.rivas-global-header {
  padding-inline: var(--rivas-navbar-gutter);
}

.rivas-global-header > div {
  max-width: none;
}

/* Align hero content with the navbar border, compensating for shell padding. */
section:has(h1) [class~="max-w-[1440px]"]:has(h1) {
  max-width: none;
  width: calc(100vw - 2 * var(--rivas-navbar-gutter));
  margin-inline: calc((100% - 100vw) / 2 + var(--rivas-navbar-gutter));
}

/* Keep image crops top-aligned across all Rivas pages. */
img {
  object-position: center top !important;
}

*, *::before, *::after {
  background-position: center top !important;
}

/* Hero-only assets use centered crops; other site images remain top-aligned. */
img[src^="/rivas/images/heroes/"],
video[poster^="/rivas/images/heroes/"],
[style*="background-image"][style*="/rivas/images/heroes/"] {
  object-position: center center !important;
  background-position: center center !important;
}

/* Only internal hero backdrops: fill their existing frame without deformation. */
.rivas-internal-hero-image {
  aspect-ratio: 16 / 7;
  object-fit: cover !important;
  object-position: center center !important;
}

/* Match the tirzepatide hero across internal image heroes only.
   Keep natural expansion for wrapped text and accessibility on small screens. */
div:has(> .rivas-internal-hero-image) [class*="min-h-"]:has(h1) {
  min-height: 620px !important;
}

@media (min-width: 768px) {
  div:has(> .rivas-internal-hero-image) [class*="min-h-"]:has(h1) {
    min-height: 680px !important;
  }
}
