/* Theme-header clearance and final spacing corrections for public STEIN.S pages. */
[data-steins-header-offset] {
  background-color: var(--steins-header-surface);
  padding-top: var(--steins-header-clearance);
  box-sizing: border-box;
}

.steins-about-root .so-hero {
  padding-top: clamp(106px, 12vw, 160px);
}

.steins-contact-root .scn-hero {
  padding-top: clamp(112px, 13vw, 170px);
}

.steins-cases-root .sk-film {
  padding-top: clamp(48px, 6vw, 76px);
}

@media (min-width: 621px) {
  .steins-services-root .ss-hero--editorial .ss-hero__layout {
    padding-top: 82px;
  }
}

/* Gutenberg leaves an empty paragraph after these shortcodes on production pages. */
.steins-template-content > :is(.steins-services-root, .steins-cases-root, .steins-case-capal-root, .steins-case-guabi-root) + .wp-block-paragraph:empty {
  display: none !important;
  margin: 0 !important;
}

/* These pages are usually wrapped by a Gutenberg shortcode block. Remove only
 * the adjacent empty block that Gutenberg leaves after the approved cases. */
.steins-template-content > .wp-block-shortcode:has(> :is(.steins-case-capal-root, .steins-case-guabi-root)) + .wp-block-paragraph:empty {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

/* Some imported shortcode pages arrive with empty paragraph/code siblings both
 * before and after the root. Limit this cleanup to the two approved cases. */
.steins-template-content:has(> :is(.steins-case-capal-root, .steins-case-guabi-root)) > :is(.wp-block-paragraph, p, code):empty {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

/* Whitespace-containing residue is checked by textContent in the scoped JS.
 * :not(:has(*)) would also match and hide real plain-text paragraphs. */
.steins-template-content [data-steins-empty-residue] {
  display: none !important;
  height: 0 !important;
  margin: 0 !important;
  min-height: 0 !important;
  padding: 0 !important;
}

@media (max-width: 800px) {
  .steins-about-root .so-hero {
    padding-top: 92px;
  }

  .steins-contact-root .scn-hero {
    padding-top: 92px;
  }

  .steins-cases-root .sk-film {
    padding-top: 38px;
  }
}

@media (max-width: 620px) {
  .steins-services-root .ss-hero--editorial .ss-hero__layout {
    padding-top: 68px;
  }

  .steins-cases-root .sk-film {
    padding-top: 32px;
  }
}
