/*
 * M307.2 — Mobile vertical spacing and bottom navigation clearance.
 * Preserves M307.1 horizontal overflow fix and existing visual styling.
 * The live screenshot showed a large reserved gap between the portal block
 * and the next homepage section, plus the fixed bottom navigation covering
 * lower service cards. M204.2.36 uses content-visibility:auto with a 520px
 * intrinsic placeholder; disable that placeholder on mobile so real content
 * determines section height.
 */
@media (max-width: 767px) {
  /* Remove synthetic 520px section placeholders that create empty vertical space. */
  body.shk-managed-home-active #shikshan-homepage .shk-home-section,
  body.shk-managed-home-active .shk-managed-homepage .shk-home-section {
    content-visibility: visible !important;
    contain-intrinsic-size: none !important;
    min-height: 0 !important;
    height: auto !important;
  }

  /* Tighten the transition from the portal panel to the next content section. */
  body.shk-managed-home-active #shikshan-homepage .shk-m243-portals {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  body.shk-managed-home-active .shk-managed-homepage .shk-m243-portals {
    margin-bottom: 0 !important;
    padding-bottom: 0 !important;
  }
  body.shk-managed-home-active #shikshan-homepage .shk-home-section-quick_features,
  body.shk-managed-home-active .shk-managed-homepage .shk-home-section-quick_features {
    margin-top: 0 !important;
    padding-top: 12px !important;
  }

  /* Do not let empty Gutenberg spacer blocks reserve large vertical gaps. */
  body.shk-managed-home-active #shikshan-homepage .wp-block-spacer,
  body.shk-managed-home-active .shk-managed-homepage .wp-block-spacer {
    height: auto !important;
    max-height: 14px !important;
    min-height: 0 !important;
    margin-block: 0 !important;
  }

  /* Reserve scrollable space after the final content for the fixed bottom bar. */
  body.home.shk-managed-home-active #shikshan-homepage,
  body.home.shk-managed-home-active .shk-managed-homepage {
    padding-bottom: calc(136px + env(safe-area-inset-bottom, 0px)) !important;
    scroll-padding-bottom: calc(136px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.home.shk-managed-home-active .shk-managed-homepage .shk-home-section:last-child,
  body.home.shk-managed-home-active .shk-managed-homepage .shk-home-section:last-of-type {
    padding-bottom: calc(136px + env(safe-area-inset-bottom, 0px)) !important;
  }
  body.home.shk-managed-home-active .shikshan-global-bottom-nav {
    bottom: calc(5px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
@media (max-width: 390px) {
  body.home.shk-managed-home-active #shikshan-homepage,
  body.home.shk-managed-home-active .shk-managed-homepage {
    padding-bottom: calc(144px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
