/* =========================================================================
   Fortezza hero backgrounds — CRITICAL LAYER
   Real <div class="fortezza-hero-bg"><img></div> injected in HTML + ::before
   fallback.  Root-absolute image URLs (/assets/...).
   ========================================================================= */

/* --- Global image visibility --- */
html img,
html img:not(.loaded),
img[data-src],
img[data-image],
.fortezza-hero-bg img {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Kill broken clip-path */
.section-border {
  clip-path: none !important;
  -webkit-clip-path: none !important;
  background: transparent !important;
  background-color: transparent !important;
}

/* --- Injected hero background div (primary — real <img> tag) --- */
.fortezza-hero-bg {
  position: absolute !important;
  z-index: 0 !important;
  top: var(--sqs-site-gutter, 4vw) !important;
  right: var(--sqs-site-gutter, 4vw) !important;
  bottom: calc(var(--sqs-site-gutter, 4vw) + 6vw) !important;
  left: var(--sqs-site-gutter, 4vw) !important;
  overflow: hidden !important;
  pointer-events: none !important;
  border-radius: 0 !important;
}
.fortezza-hero-bg img {
  display: block !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: cover !important;
  object-position: center 42% !important;
  opacity: 1 !important;
  visibility: visible !important;
  position: static !important;
  max-width: none !important;
}

.page-section.has-background {
  position: relative !important;
  isolation: isolate;
}
.page-section.has-background .content-wrapper,
.page-section.has-background .section-divider-display {
  position: relative !important;
  z-index: 2 !important;
}

/* Hide Squarespace background only when we injected a replacement hero */
.page-section.has-background:has(.fortezza-hero-bg) .section-background {
  display: none !important;
}

/* Restore native backgrounds + overlays on sections without injected hero */
.page-section.has-background:not(:has(.fortezza-hero-bg)) .section-background {
  display: block !important;
}

/* --- Readability: dark scrim over injected hero photos --- */
.fortezza-hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: rgba(0, 0, 0, 0.5);
}

/* Match original Squarespace overlay strengths where known */
[data-section-id="6863641cbff9642b262ffb82"] .fortezza-hero-bg::after {
  background: rgba(0, 0, 0, 0.65);
}

[data-section-id="685876db180d410a81ab3c4b"] .fortezza-hero-bg::after {
  background: rgba(0, 0, 0, 0.42);
}

[data-section-id="686c9c7a13ac120cfc57252f"] .fortezza-hero-bg::after {
  background: rgba(0, 0, 0, 0.35);
}

/* Text over hero photos without Squarespace text-block background */
.page-section.has-background:has(.fortezza-hero-bg)
  .sqs-block-html:not(.sqs-background-enabled)
  .sqs-html-content
  :is(h1, h2, h3, h4, h5, h6, p, a, span, li) {
  text-shadow:
    0 1px 2px rgba(0, 0, 0, 0.9),
    0 2px 14px rgba(0, 0, 0, 0.55);
}

/* Extra contrast panel for long copy on busy heroes (About, service pages) */
.page-section.has-background:has(.fortezza-hero-bg)
  .sqs-block-html:not(.sqs-background-enabled)
  .sqs-text-block-container {
  background-color: rgba(12, 12, 12, 0.58) !important;
  padding: clamp(1rem, 2.5vw, 1.75rem) clamp(1.25rem, 3vw, 2.25rem) !important;
  border-radius: 6px !important;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.22) !important;
}

/* Keep homepage / commercial heroes that already have text boxes unchanged */
.page-section.has-background .sqs-background-enabled .sqs-text-block-container {
  box-shadow: none !important;
}

/* ::before fallback if HTML injection missing */
[data-section-id="67c7c3445e03545e66104fdd"].has-background:not(:has(.fortezza-hero-bg))::before {
  content: "" !important;
  display: block !important;
  position: absolute !important;
  z-index: 0 !important;
  top: 4vw !important; right: 4vw !important; bottom: 10vw !important; left: 4vw !important;
  background: url("/assets/img/nashville-skyline-hero-1920.jpg") center 42% / cover no-repeat !important;
}

.sqs-gallery-block-grid img:not(.loaded) {
  opacity: 1 !important;
}
