.hwe-hero {
  position: relative;
  isolation: isolate;
  background-color: var(--hwe-hero-background-color);
  background-image: var(--hwe-hero-background-image);
  background-size: cover;
  background-position: center;
  color: var(--hwe-hero-text-color);
  border-bottom: 4px solid rgba(255, 255, 255, 0.15);
}
.hwe-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    color-mix(in srgb, var(--hwe-hero-background-color) 35%, transparent) 0%,
    color-mix(in srgb, var(--hwe-hero-background-color) 72%, transparent) 100%
  );
  pointer-events: none;
  z-index: 0;
}
.hwe-hero > .container {
  position: relative;
  z-index: 1;
}
.hwe-kicker {
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.75rem;
  opacity: 0.8;
  margin: 0;
}
.hwe-footer {
  background: var(--hwe-footer-color);
  color: #fff;
}
.hwe-footer-name {
  font-weight: 600;
}
.hwe-footer-link {
  color: #fff;
  text-decoration: none;
  font-size: 0.9rem;
}
.card {
  border-radius: 0.25rem;
  box-shadow: none;
  border: 1px solid #e2e8f0;
}
.btn-primary {
  --bs-btn-bg: var(--hwe-hero-background-color);
  --bs-btn-border-color: var(--hwe-hero-background-color);
  --bs-btn-hover-bg: var(--hwe-hero-background-color);
  --bs-btn-hover-border-color: var(--hwe-hero-background-color);
  border-radius: 0.2rem;
}
.hwe-emergency {
  padding: .5rem 1rem;
  text-align: center;
  background: rgba(0, 0, 0, 0.2);
  background: color-mix(in srgb, var(--hwe-footer-color) 80%, #000);
  color: #fff;
}
/* Desktop: the hero text stays on the left half of the container so the picture shows on the right. */
@media (min-width: 992px) {
  .hwe-hero > .container > * {
    max-width: 50%;
    text-align: left;
  }
}
/* Left gutter that mirrors the portrait's right margin, so the copy does not hug the edge (mobile keeps the container gutter). */
@media (min-width: 992px) {
  .hwe-hero-copy { padding-left: clamp(1.5rem, 5vw, 4rem); }
}

/* Overlay nav (data-hwe-nav="overlay"): the bar floats over the hero (transparent, hero text colour) and gets the menu colour once
   the page scrolls or the mobile menu is open. nav.js toggles .is-scrolled / .is-open. */
.hwe-nav-overlay {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 30;
  background-color: transparent;
  transition: background-color .2s ease;
  --bs-navbar-brand-color: var(--hwe-hero-text-color, #fff);
  --bs-navbar-brand-hover-color: var(--hwe-hero-text-color, #fff);
  --bs-navbar-color: var(--hwe-hero-text-color, #fff);
  --bs-navbar-hover-color: var(--hwe-hero-text-color, #fff);
  --bs-navbar-active-color: var(--hwe-hero-text-color, #fff);
}
.hwe-nav-overlay .nav-link { white-space: nowrap; }
.hwe-nav-overlay.is-scrolled,
.hwe-nav-overlay.is-open { background-color: var(--hwe-menu-color); }
.hwe-nav-overlay + .hwe-hero > .container { padding-top: 6.5rem !important; }
@media (prefers-reduced-motion: reduce) {
  .hwe-nav-overlay { transition: none; }
}

/* Optional hero portrait (Foto do hero): only rendered when filled. Fixed 3:4 box, cover crop, max width, so any
   uploaded proportion fits. Mobile stacks it under the text; desktop: text on the left half, portrait on the right. */
.hwe-hero-figure { margin-top: 1.75rem; }
.hwe-hero-portrait {
  display: block;
  width: min(14rem, 70%);
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 1.25rem;
  border: 4px solid rgba(255, 255, 255, .85);
  box-shadow: 0 20px 50px rgba(0, 0, 0, .25);
}
@media (min-width: 992px) {
  .hwe-hero > .container:has(.hwe-hero-figure) {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    column-gap: 2rem;
    align-items: center;
  }
  .hwe-hero > .container:has(.hwe-hero-figure) > * { max-width: none; }
  .hwe-hero-figure { margin-top: 0; margin-right: clamp(1.5rem, 5vw, 4rem); justify-self: end; width: min(19rem, 100%); }
  .hwe-hero-portrait { width: 100%; }
}
