/* ══════════════════════════════════════════════════════════════
   PREMIUM HERO VISUAL SYSTEM
   One reusable component: image -> dark/translucent overlay ->
   glass content surface -> text + CTA. Brand palette only
   (black / red / gold), mobile-first. Used on the 15-page premium
   visual hero set; not a full-page glassmorphism theme.

   Structure:
   <div class="hero-visual" style="--hv-focal-y:35%; ...">
     <div class="hero-visual__background">
       <img ...>                          <- real, crawlable <img>
     </div>
     <div class="hero-visual__overlay"></div>
     <div class="hero-visual__content">
       <div class="hero-visual__glass"> ...existing hero markup... </div>
     </div>
   </div>

   Per-page config via inline custom properties on .hero-visual:
     --hv-focal-x / --hv-focal-y   object-position of the bg <img>
     --hv-focal-x-m / --hv-focal-y-m  mobile-only focal override
     --hv-overlay                  overlay strength (0-1)
     --hv-glass-w                  max-width of the glass panel
     --hv-glass-align              flex-start | center | flex-end
     --hv-min-h / --hv-min-h-m     desktop / mobile min-height
   ══════════════════════════════════════════════════════════════ */

.hero-visual {
  --hv-focal-x: 50%;
  --hv-focal-y: 50%;
  --hv-focal-x-m: var(--hv-focal-x);
  --hv-focal-y-m: var(--hv-focal-y);
  --hv-overlay: 0.62;
  --hv-glass-w: 640px;
  --hv-glass-align: flex-start;
  --hv-min-h: 92vh;
  --hv-min-h-m: 100vh;
  position: relative;
  overflow: hidden;
  display: flex;
  align-items: center;
  min-height: var(--hv-min-h-m);
  isolation: isolate;
}

.hero-visual__background {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-visual__background img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: var(--hv-focal-x-m) var(--hv-focal-y-m);
  display: block;
}

.hero-visual__overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(180deg, rgba(10,10,10,0.55) 0%, rgba(10,10,10, var(--hv-overlay)) 45%, rgba(10,10,10,0.92) 100%),
    linear-gradient(90deg, rgba(10,10,10,0.88) 0%, rgba(10,10,10,0.35) 55%, rgba(10,10,10,0.15) 100%);
  pointer-events: none;
}

.hero-visual__content {
  position: relative;
  z-index: 2;
  width: 100%;
  display: flex;
  justify-content: var(--hv-glass-align);
  padding: 96px 20px 48px;
}

.hero-visual__glass {
  width: 100%;
  max-width: var(--hv-glass-w);
  background: rgba(10, 10, 10, 0.46);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(200, 169, 110, 0.16);
  border-radius: 20px;
  box-shadow:
    0 1px 0 rgba(255,255,255,0.05) inset,
    0 30px 60px rgba(0,0,0,0.45);
  padding: 32px 26px;
}

/* Text contrast inside the glass panel must stay strong regardless of
   the page's own default text colors. */
.hero-visual__glass h1,
.hero-visual__glass h2 {
  color: #ffffff;
}
.hero-visual__glass p {
  color: rgba(240, 236, 226, 0.86);
}

@media (min-width: 640px) {
  .hero-visual__glass { padding: 40px 36px; }
}

@media (min-width: 900px) {
  .hero-visual {
    min-height: var(--hv-min-h);
  }
  .hero-visual__background img {
    object-position: var(--hv-focal-x) var(--hv-focal-y);
  }
  .hero-visual__content {
    padding: 0 48px;
  }
}

/* Product/tool-hub pages: the hero must stay compact (roughly one
   viewport on desktop, not 1-1.5x) since a tool UI follows immediately
   below it. */
.hero-visual--compact {
  --hv-min-h-m: 78vh;
  --hv-min-h: 62vh;
}

/* Blog articles: same full-frame photo treatment as the tool/hub pages
   (performance-tools, homepage) - only the alignment (bottom-aligned
   caption) and the absence of a hard CTA differ, to keep the
   informational tone. The image itself must read as a real, full hero,
   not a cropped strip. */
.hero-visual--article {
  --hv-min-h-m: 82vh;
  --hv-min-h: 78vh;
  align-items: flex-end;
}
.hero-visual--article .hero-visual__content {
  padding: 0 20px 28px;
}
.hero-visual--article .hero-visual__glass {
  padding: 20px 22px;
  border-radius: 16px;
}
@media (min-width: 900px) {
  .hero-visual--article .hero-visual__content { padding: 0 48px 40px; }
  .hero-visual--article .hero-visual__glass { padding: 26px 32px; }
}
.hero-visual--article .hero-visual__glass h1 {
  font-size: clamp(24px, 4vw, 34px);
  margin: 0 0 8px;
}
.hero-visual--article .hero-visual__meta {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  font-size: 13px;
  color: rgba(230, 224, 208, 0.75);
}

@media (prefers-reduced-motion: reduce) {
  .hero-visual__background img { transition: none; }
}

/* ── Homepage variant ─────────────────────────────────────────────
   The homepage hero already implements IMAGE (CSS background-image)
   -> OVERLAY (its own gradient) -> a real photo carousel. This adds
   only the missing GLASS layer around the text content, rather than
   restructuring the section and risking the carousel's own JS. */
.hero-content.hv-glass {
  background: rgba(10, 10, 10, 0.46);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border: 1px solid rgba(200, 169, 110, 0.16);
  border-radius: 20px;
  box-shadow: 0 1px 0 rgba(255,255,255,0.05) inset, 0 30px 60px rgba(0,0,0,0.45);
  padding: 28px 24px;
}
@media (min-width: 640px) {
  .hero-content.hv-glass { padding: 36px 40px; }
}
