/*
 * DICHANA v8.5.74 — Targeted Hero Top-Rhythm Correction
 * Source baseline: production-confirmed v8.5.70.
 *
 * Corrective strategy:
 * - Fully retires the v8.5.72/v8.5.73 absolute first-content anchor approach.
 * - Preserves page families that were already balanced in v8.5.70.
 * - Corrects only hero families whose legacy min-height / vertical centering created
 *   oversized blank areas above the visible breadcrumb and hero copy.
 * - Never adds top padding to an inner content container.
 */

body.header-content-v8574 {
  --dcn-corrected-hero-top: clamp(116px, 7.1vw, 128px);
  --dcn-corrected-hero-bottom: clamp(54px, 4.4vw, 72px);
  --dcn-corrected-scroll-offset: 108px;
}

/*
 * These are the hero families that showed excessive top whitespace.
 * The normal page hero, Batch 2 service pages, Contact, Quotation, Homepage and 404
 * intentionally keep their v8.5.70 geometry because they were already balanced.
 */
body.header-content-v8574 :where(
  main > .batch3-page-hero,
  main > .batch4-page-hero,
  main > .standard-v8562-hero,
  main > .product-library-hero,
  main > .blog-hero-v8563,
  main article > .article-hero-v8563,
  main > .backward-redirect
) {
  box-sizing: border-box !important;
  min-height: 0 !important;
  height: auto !important;
  padding-top: var(--dcn-corrected-hero-top) !important;
  padding-bottom: var(--dcn-corrected-hero-bottom) !important;
  margin-top: 0 !important;
  align-items: start !important;
  align-content: start !important;
}

/* Remove legacy inner-grid height and centering without manufacturing a second top gap. */
body.header-content-v8574 :where(
  .batch3-page-hero > .batch3-hero-grid,
  .batch4-page-hero > .batch4-hero-grid,
  .standard-v8562-hero > .standard-v8562-hero-grid,
  .product-library-hero > .product-library-hero-grid,
  .article-hero-v8563 > .article-hero-grid
) {
  box-sizing: border-box !important;
  min-height: 0 !important;
  height: auto !important;
  padding-top: 0 !important;
  margin-top: 0 !important;
  align-items: start !important;
  align-content: start !important;
}

/* Keep the first visible breadcrumb/copy block free from inherited top offsets. */
body.header-content-v8574 :where(
  .batch3-hero-grid,
  .batch4-hero-grid,
  .standard-v8562-hero-grid,
  .product-library-hero-grid,
  .blog-hero-v8563 > .container,
  .article-hero-grid,
  .backward-redirect > div
) > :first-child {
  margin-top: 0 !important;
}

@media (max-width: 1120px) {
  body.header-content-v8574 {
    --dcn-corrected-hero-top: calc(102px + env(safe-area-inset-top));
    --dcn-corrected-hero-bottom: 54px;
    --dcn-corrected-scroll-offset: calc(94px + env(safe-area-inset-top));
  }
}

@media (max-width: 760px) {
  body.header-content-v8574 {
    --dcn-corrected-hero-top: calc(88px + env(safe-area-inset-top));
    --dcn-corrected-hero-bottom: 42px;
    --dcn-corrected-scroll-offset: calc(82px + env(safe-area-inset-top));
  }
}

@media (max-width: 430px) {
  body.header-content-v8574 {
    --dcn-corrected-hero-top: calc(84px + env(safe-area-inset-top));
  }
}

body.header-content-v8574 main [id] {
  scroll-margin-top: var(--dcn-corrected-scroll-offset);
}
