/*
 * M307 — Full-width mobile layout and spacing polish.
 * Mobile-only: preserve the desktop/tablet homepage and existing M306 hero grid.
 */
@media (max-width: 767px) {
  /* Break the complete hero section out of Astra's constrained content column.
     Break out the parent rather than shifting only the header child. */
  body.shk-managed-home-active .shk-home-section-hero {
    position: relative !important;
    left: 50% !important;
    right: auto !important;
    transform: none !important;
    width: 100vw !important;
    max-width: 100vw !important;
    min-width: 0 !important;
    margin-left: -50vw !important;
    margin-right: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
    overflow: visible !important;
  }
  body.shk-managed-home-active .shk-home-section-hero > .shk-home-section-inner,
  body.shk-managed-home-active .shk-home-section-hero .shk-home-section-content {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    box-sizing: border-box !important;
  }
  body.shk-managed-home-active .shk-home-section-hero .shk-public-header {
    position: relative !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 7px clamp(10px, 3vw, 18px) !important;
    border-radius: 0 0 18px 18px !important;
    box-sizing: border-box !important;
  }
  body.shk-managed-home-active .shk-home-section-hero .shk-public-header-main {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 68px !important;
    margin: 0 !important;
    padding: 4px 0 !important;
    gap: 8px !important;
    box-sizing: border-box !important;
  }

  /* One shared mobile content gutter for portal and all homepage sections. */
  body.shk-managed-home-active #shikshan-homepage .shk-m243-home {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 !important;
    padding: 0 0 calc(88px + env(safe-area-inset-bottom, 0px)) !important;
    box-sizing: border-box !important;
  }
  body.shk-managed-home-active #shikshan-homepage .shk-m243-portals {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 0 auto 12px !important;
    padding: 18px clamp(12px, 3.8vw, 20px) 8px !important;
    box-sizing: border-box !important;
  }
  body.shk-managed-home-active #shikshan-homepage .shk-m243-portals .shk-home-portals,
  body.shk-managed-home-active #shikshan-homepage .shk-m243-portals .shk-home-portals-inner,
  body.shk-managed-home-active #shikshan-homepage .shk-m243-portals .shk-home-portals-grid {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
  }
  body.shk-managed-home-active #shikshan-homepage .shk-m243-portals .shk-home-portals-heading {
    margin-top: 0 !important;
    margin-bottom: 14px !important;
  }

  /* Normalize section spacing; remove accidental spacer-like vertical gaps. */
  body.shk-managed-home-active #shikshan-homepage .shk-m243-home + .shk-home-section,
  body.shk-managed-home-active #shikshan-homepage .shk-home-section {
    width: calc(100% - 24px) !important;
    max-width: none !important;
    min-width: 0 !important;
    margin: 12px auto !important;
    padding: 18px clamp(12px, 3.6vw, 18px) !important;
    box-sizing: border-box !important;
  }
  body.shk-managed-home-active #shikshan-homepage .shk-home-section-inner,
  body.shk-managed-home-active #shikshan-homepage .shk-home-section-content {
    width: 100% !important;
    max-width: none !important;
    min-width: 0 !important;
    margin-top: 0 !important;
    margin-bottom: 0 !important;
    box-sizing: border-box !important;
  }
  body.shk-managed-home-active #shikshan-homepage .shk-home-section > :first-child,
  body.shk-managed-home-active #shikshan-homepage .shk-home-section-inner > :first-child {
    margin-top: 0 !important;
  }
  body.shk-managed-home-active #shikshan-homepage .shk-home-section > :last-child,
  body.shk-managed-home-active #shikshan-homepage .shk-home-section-inner > :last-child {
    margin-bottom: 0 !important;
  }
  body.shk-managed-home-active #shikshan-homepage .wp-block-spacer {
    max-height: 18px !important;
  }

  /* Reserve enough scroll space for the floating five-item bottom navigation. */
  body.home.shk-managed-home-active,
  body.home.shk-managed-home-active #page,
  body.home.shk-managed-home-active .site-content,
  body.home.shk-managed-home-active .entry-content {
    padding-bottom: 0 !important;
  }
  body.home.shk-managed-home-active #shikshan-homepage {
    padding-bottom: calc(104px + 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.shk-managed-home-active #shikshan-homepage .shk-m243-portals {
    padding-left: 10px !important;
    padding-right: 10px !important;
  }
  body.shk-managed-home-active #shikshan-homepage .shk-home-section {
    width: calc(100% - 20px) !important;
    margin-top: 10px !important;
    margin-bottom: 10px !important;
    padding: 15px 11px !important;
  }
  body.home.shk-managed-home-active #shikshan-homepage {
    padding-bottom: calc(100px + env(safe-area-inset-bottom, 0px)) !important;
  }
}
@media (prefers-reduced-motion: reduce) {
  body.shk-managed-home-active #shikshan-homepage * {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    transition-duration: .01ms !important;
  }
}
