/**
 * DetailView — hero banner and body layout (all CMS templates).
 * Uses .cms-detail-hero / .cms-detail-page so home-page .hero-header rules are unchanged.
 */
body[class*="cms-active-template"] #app .cms-detail-page {
  overflow-x: clip;
  max-width: 100%;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero {
  background-color: #111;
  overflow-x: clip;
  max-width: 100%;
  box-sizing: border-box;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero:not(.cms-detail-hero--has-bg) {
  min-height: 0;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero--has-bg {
  background-size: cover !important;
  background-position: center center !important;
  background-repeat: no-repeat !important;
  min-height: clamp(320px, 38vw, 520px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero .hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: var(--cms-image-overlay, rgba(0, 0, 0, 0.5));
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero .position-relative {
  position: relative;
  z-index: 2;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero .container {
  max-width: 100%;
  min-width: 0;
  width: 100%;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero .row {
  margin-left: 0;
  margin-right: 0;
  max-width: 100%;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero [class*="col-"] {
  min-width: 0;
  max-width: 100%;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero h1 {
  max-width: 100%;
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
  hyphens: auto;
}

/* Detail body section (below hero) */
body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid {
  overflow-x: clip;
  max-width: 100%;
  box-sizing: border-box;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid .container {
  max-width: 100%;
  min-width: 0;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid .row {
  margin-left: 0;
  margin-right: 0;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid [class*="col-"] {
  min-width: 0;
  max-width: 100%;
}

body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid h2,
body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid p {
  overflow-wrap: break-word;
  word-wrap: break-word;
  word-break: break-word;
}

@media (max-width: 991.98px) {
  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero h1.display-3 {
    font-size: clamp(1.5rem, 5vw, 2.5rem) !important;
    line-height: 1.2 !important;
  }
}

@media (max-width: 767.98px) {
  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero {
    padding-top: 2.5rem !important;
    padding-bottom: 2.5rem !important;
    margin-bottom: 2rem !important;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero:not(.cms-detail-hero--has-bg) {
    min-height: auto;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero--has-bg {
    min-height: clamp(220px, 50vw, 380px);
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero .container.py-5 {
    padding-top: 1.25rem !important;
    padding-bottom: 1.25rem !important;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero [class*="col-"] {
    text-align: center !important;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero h1.display-3 {
    font-size: clamp(1.25rem, 6.5vw, 2rem) !important;
    line-height: 1.15 !important;
    letter-spacing: 0.01em;
    text-align: center !important;
    margin-bottom: 0 !important;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid {
    padding-top: 2rem !important;
    padding-bottom: 2rem !important;
    margin-bottom: 2rem !important;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid .container {
    padding-left: 1rem;
    padding-right: 1rem;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid .row {
    --bs-gutter-x: 1.25rem;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid h2 {
    font-size: clamp(1.2rem, 5vw, 1.65rem);
    text-align: center;
    margin-bottom: 1rem !important;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid .mb-3 {
    text-align: center;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid p {
    font-size: 15px !important;
    line-height: 1.7 !important;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid .img-fluid {
    display: block;
    max-width: 100%;
    height: auto;
    margin-left: auto;
    margin-right: auto;
  }

  body[class*="cms-active-template"] #app .hero-header.cms-detail-hero + .container-fluid .btn {
    display: inline-block;
    max-width: 100%;
  }
}

/* Default template: palette-aware overlay from cms-default-bridge.css takes precedence */
body.cms-active-template-default #app .hero-header.cms-detail-hero .hero-overlay {
  background: color-mix(in srgb, var(--dark) 45%, transparent) !important;
}
