/*
 * Dragon Silk Road — page top strip / hero background extension
 * Scope: six landing pages only (news, trade intelligence, opportunities,
 * downloads, about, contact). Loaded after header-orbit.css.
 *
 * 1) Four light pages: a flow strip that paints main's top padding with the
 *    hero's own base colour. Net flow height is 0, so no content moves.
 * 2) Downloads: the dark hero itself is pulled to y=0; its height grows by
 *    the same amount and padding-top pushes the content back, so the inner
 *    content box and every following section keep their page coordinates.
 * 3) Contact: same idea for the photo hero. Desktop shifts the absolute
 *    stage by the header height; flat layout uses padding-top. Because the
 *    photo is object-fit: cover, it re-crops/zooms slightly (documented).
 */

/* ------------------------------------------------------------------ */
/* 1. Light pages: top strip                                           */
/* ------------------------------------------------------------------ */

.page-top-strip {
  display: none;
  height: var(--dsr-header-height, 92px);
  margin-top: calc(-1 * var(--dsr-header-height, 92px));
  background: var(--page-top-strip-bg, transparent);
  transition: height .35s ease, margin-top .35s ease;
}

body.page-news_list .page-top-strip,
body.page-news_by_category .page-top-strip,
body.page-news_by_tag .page-top-strip {
  display: block;
}
body.page-news_list,
body.page-news_by_category,
body.page-news_by_tag {
  --page-top-strip-bg: #f7f7f7;
}

body.page-trade_intelligence .page-top-strip,
body.page-opportunities .page-top-strip {
  display: block;
}
body.page-trade_intelligence,
body.page-opportunities {
  --page-top-strip-bg: #f6f2ea;
}

body.page-about .page-top-strip {
  display: block;
}
body.page-about {
  --page-top-strip-bg: #fbfbfb;
}

/* ------------------------------------------------------------------ */
/* 2. Downloads: pull the dark hero to y=0                             */
/* ------------------------------------------------------------------ */

body.page-download_list .dlv-hero {
  --dlv-hero-lift: var(--dsr-header-height, 92px);
  margin-top: calc(-1 * var(--dsr-header-height, 92px));
  height: calc(100svh - var(--dlv-hero-chrome) + var(--dlv-hero-lift));
  padding-top: var(--dlv-hero-lift);
  transition: margin-top .35s ease, height .35s ease, padding-top .35s ease;
}

/* 821–1180: the existing page CSS brings the hero to y=75 while the header
 * is 84; keep the same content offset by using a 75px lift. */
@media (min-width: 821px) and (max-width: 1180px) {
  body.page-download_list .dlv-hero {
    --dlv-hero-lift: 75px;
  }
}

/* Header hidden: main padding is 0; do not keep the 75px lift. */
body.page-download_list.dsr-header-hidden .dlv-hero {
  --dlv-hero-lift: 0px;
}

/* ------------------------------------------------------------------ */
/* 3. Contact: pull the photo hero to y=0                              */
/* ------------------------------------------------------------------ */

/* Keep dark text on a light frosted pill over the photo, per the existing
 * image-hero frost doctrine; .44 is the current frost token. */
body.page-contact {
  --nav-tint: rgba(255, 255, 255, .44);
}

body.page-contact .ct-hero.ct-hero--scene {
  --ct-hero-lift: var(--dsr-header-height, 92px);
  margin-top: calc(-1 * var(--ct-hero-lift));
  height: calc(var(--ct-hero-h) + var(--ct-hero-lift));
  transition: margin-top .35s ease, height .35s ease, padding-top .35s ease;
}

body.page-contact .ct-hero.ct-hero--scene .ct-hero__stage {
  top: var(--ct-hero-lift);
  transition: top .35s ease;
}

/* Flat layout (<=1023): stage is in flow; push it with padding instead of
 * absolute top, and let the hero height be content-driven. */
@media (max-width: 1023px) {
  body.page-contact .ct-hero.ct-hero--scene {
    height: auto;
    padding-top: var(--ct-hero-lift);
  }
  body.page-contact .ct-hero.ct-hero--scene .ct-hero__stage {
    top: auto;
  }
}

/* ------------------------------------------------------------------ */
/* No-JS fallback: downloads keeps a light frosted nav (dark text)     */
/* ------------------------------------------------------------------ */

html.no-js body.page-download_list {
  --nav-tint: rgba(255, 255, 255, .44);
}
