/* LX-PRODUCT-HERO
   Hero fill: extend under the header and breadcrumbs, and soften remaining
   edges so there is no hard seam.

   Pages:
   - product details (.lxp--ai / --disk / --docs / --mail / --meet /
     --verification, and .ide-page)
   - partner programme landing (.lxp--partner > .lxpp)
   - news listing and article (.lxnw-hero / .lxnw-ahero)
   - shared hex-background hero (.hsx-hero): /business/, /hosting/domains/**
     /hosting/marketplace/, /hosting/podbor-tarifa/

   Does not change typography or section copy.

   Root cause:
   - entry.css already pulls many wrappers up with
     margin-top: calc(-1 * var(--lx-bleed-top)) and matching padding-top,
     and lifts [class*="gridbg"] / [class*="__vignette"] by the same amount.
   - The visible cut is either:
     a) a particle canvas ([class*="-net"], inset:0 / top:0 and height:100%
        of the hero) still starting at the hero box under the breadcrumbs;
     b) a page root (.lxai, .lxpp, …) with overflow:clip and a solid
        background, which clips an already-positioned __glow at the
        breadcrumb / header line, so the gold wash reads as a hard-edged
        rectangle (top + apparent left/right sides);
     c) .hsx-hero overflow:hidden with .hsx-hero__bg (hex poster) starting
        at the hero box under the crumbs.
   - Decorative __glow orbs that are already pulled up (negative top)
     only need their clipping ancestor unclipped.
   - On viewports ≤1199px the desktop .header is hidden, but a mobile chrome
     (logo bar, optional geo card, crumbs) is taller than --lx-header-full-h
     (56px), so the existing bleed (~97px) stops short of the top of the page.

   How to ship (Nuxt, do not edit hashed /_nuxt/*.css by hand):
   - add this file as assets/css/lx-product-hero.css and import it from
     the default layout or nuxt.config.css, or drop the block into
     ProductsShell.vue / the product layout. Then rebuild and deploy.
   - cache-bust comes with the new hashed bundle.
   - live workaround: serve from /home/bitrix/lx-nuxt/shared/ via nginx
     location = /lx-product-hero.css and inject a <link> with sub_filter.

   Desktop bleed stays --lx-bleed-top: calc(36px + var(--lx-header-full-h))
   (208px at 1440).
*/

/* Mobile: cover the real mobile chrome (logo bar + optional geo + crumbs).
   Overshoot is safe — margin-top and padding-top stay in sync, extra fill
   sits above the viewport. 240px covers the logo bar + optional geo card
   + crumbs (measured crumbs bottom is ~215px, ~231px on /products/meet/). */
@media (width <= 1199px) {
  .app-main:has(> .breadcrumbs) {
    --lx-bleed-top: calc(240px + env(safe-area-inset-top, 0px));
  }
}

/* Full-bleed fill layers (canvas / network) must start at the top of the
   already-lifted wrapper (under header + crumbs), not at the hero content box.
   inset shorthand resets the original inset:0 + height:100%. */
main.app-main > .breadcrumbs + :has(.home-hero, [class*="hero__glow"], [class*="-hero"], .hb__hero-glow) :is(canvas, [class*="-net"]),
main.app-main > :first-child:not(.breadcrumbs):has(.home-hero, [class*="hero__glow"], [class*="-hero"], .hb__hero-glow) :is(canvas, [class*="-net"]) {
  inset: calc(-1 * var(--lx-bleed-top)) 0 0 0;
  height: calc(100% + var(--lx-bleed-top));
}

/* Soften the bottom of the network so it does not end in a hard line
   against the next block. Grid and vignette already have their own masks. */
main.app-main > .breadcrumbs + :has(.home-hero, [class*="hero__glow"], [class*="-hero"], .hb__hero-glow) :is(canvas, [class*="-net"]),
main.app-main > :first-child:not(.breadcrumbs):has(.home-hero, [class*="hero__glow"], [class*="-hero"], .hb__hero-glow) :is(canvas, [class*="-net"]) {
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
  mask-image: linear-gradient(to bottom, #000 0%, #000 70%, transparent 100%);
}

/* Keep header, geo chip and breadcrumbs above the extended canvas. */
.app-main > .breadcrumbs {
  position: relative;
  z-index: 2;
}


/* The product / partner root (.lxai, .lxpp, …) starts after the bleed
   padding and is overflow:clip with a solid background:var(--lx*-bg).
   That clips the already extended vignette/grid/canvas/glow at the
   breadcrumb line, so the gold/blue radial wash reads as a hard-edged
   lighter rectangle under the crumbs (top + apparent left/right sides).
   Let fills paint under the header and drop the solid panel; the page
   background comes from .app-shell. */
.lxp :is(.lxai, .lxdk, .lxdc, .lxm, .lxmt, .lxv, .lxpp) {
  overflow: visible;
  background-color: transparent;
}

/* IDE uses .ide-page instead of .lxp; reuse the same bleed if it was missed.
   (IDE has no network/grid layers today, so this is layout-only.) */
main.app-main > .breadcrumbs + .ide-page:has(.ide-hero) {
  margin-top: calc(-1 * var(--lx-bleed-top));
  padding-top: var(--lx-bleed-top);
}

/* News listing (.lxnw-hero) and article (.lxnw-ahero): the gold __glow is
   already positioned above the hero (top: negative), but the hero is
   overflow:hidden and starts under the header, which cuts the wash into
   a hard-edged panel. Unclip so the glow paints behind the header.
   Selectors must beat .lxnw.lxnw--list .lxnw-hero and .lxnw .lxnw-ahero. */
.lxnw.lxnw--list .lxnw-hero,
.lxnw.lxnw--detail .lxnw-ahero,
.lxnw .lxnw-ahero {
  overflow: visible !important;
}

/* Shared hex-background hero (.hsx-hero on /business/, /hosting/domains/**,
   /hosting/marketplace/, /hosting/podbor-tarifa/): overflow:hidden +
   .hsx-hero__bg { inset:0 } starts the poster at the breadcrumb line.
   Expand the clipping box under the chrome; keep overflow:hidden so the
   hex fill and the existing bottom fade (::after) stay inside the hero.
   Extra padding-top keeps typography where it was. */
.hsx-hero {
  margin-top: calc(-1 * var(--lx-bleed-top));
}
.hsx-hero.hsx-hero--lg {
  padding-top: calc(56px + var(--lx-bleed-top));
}
.hsx-hero.hsx-hero--md {
  padding-top: calc(48px + var(--lx-bleed-top));
}
@media (width <= 767px) {
  .hsx-hero.hsx-hero--lg,
  .hsx-hero.hsx-hero--md {
    padding-top: calc(40px + var(--lx-bleed-top));
  }
}
