/*
BioGurukul Mobile Footer Complete Visibility Fix v10.10.66
Author: Abhishek Das
*/

@media (max-width: 782px) {
  /* The footer must grow naturally; never crop its final rows. */
  footer,
  .site-footer,
  #colophon,
  .ast-footer-overlay,
  .site-primary-footer-wrap,
  .site-above-footer-wrap,
  .site-below-footer-wrap,
  .footer-adv-overlay,
  .elementor-location-footer {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    box-sizing: border-box !important;
    clear: both !important;
  }

  /* Convert desktop footer columns into a clean single-column mobile stack. */
  footer .ast-builder-grid-row,
  .site-footer .ast-builder-grid-row,
  #colophon .ast-builder-grid-row,
  footer .ast-container,
  .site-footer .ast-container,
  #colophon .ast-container,
  footer .footer-widget-area,
  .site-footer .footer-widget-area,
  #colophon .footer-widget-area,
  footer .footer-widgets,
  .site-footer .footer-widgets,
  #colophon .footer-widgets,
  footer .footer-inner,
  .site-footer .footer-inner,
  #colophon .footer-inner,
  footer .footer-container,
  .site-footer .footer-container,
  #colophon .footer-container,
  footer .wp-block-columns,
  .site-footer .wp-block-columns,
  #colophon .wp-block-columns,
  footer .elementor-container,
  .site-footer .elementor-container,
  #colophon .elementor-container,
  footer .elementor-row,
  .site-footer .elementor-row,
  #colophon .elementor-row,
  footer .bgk-footer-stable-row,
  .site-footer .bgk-footer-stable-row,
  #colophon .bgk-footer-stable-row,
  footer .bgk-footer-top-row-has-teacher,
  .site-footer .bgk-footer-top-row-has-teacher,
  #colophon .bgk-footer-top-row-has-teacher {
    display: grid !important;
    grid-template-columns: minmax(0, 1fr) !important;
    grid-auto-flow: row !important;
    align-items: start !important;
    justify-items: stretch !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    gap: 20px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding-left: 16px !important;
    padding-right: 16px !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  /* Every footer column stays inside the phone viewport. */
  footer .ast-builder-grid-row > *,
  .site-footer .ast-builder-grid-row > *,
  #colophon .ast-builder-grid-row > *,
  footer .footer-widget-area > *,
  .site-footer .footer-widget-area > *,
  #colophon .footer-widget-area > *,
  footer .footer-widgets > *,
  .site-footer .footer-widgets > *,
  #colophon .footer-widgets > *,
  footer .wp-block-columns > *,
  .site-footer .wp-block-columns > *,
  #colophon .wp-block-columns > *,
  footer .elementor-container > *,
  .site-footer .elementor-container > *,
  #colophon .elementor-container > *,
  footer .bgk-footer-stable-row > *,
  .site-footer .bgk-footer-stable-row > *,
  #colophon .bgk-footer-stable-row > * {
    display: block !important;
    flex: 0 0 100% !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    min-height: 0 !important;
    max-height: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    overflow: visible !important;
    box-sizing: border-box !important;
  }

  /* Final Teacher Partner column: remove desktop fixed dimensions. */
  footer .bgk-footer-teacher-stable-column,
  .site-footer .bgk-footer-teacher-stable-column,
  #colophon .bgk-footer-teacher-stable-column,
  .bgk-footer-teacher-stable-column {
    display: block !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    max-height: none !important;
    margin: 0 !important;
    padding: 0 !important;
    overflow: visible !important;
  }

  footer h1,
  footer h2,
  footer h3,
  footer h4,
  footer h5,
  footer h6,
  .site-footer h1,
  .site-footer h2,
  .site-footer h3,
  .site-footer h4,
  .site-footer h5,
  .site-footer h6,
  #colophon h1,
  #colophon h2,
  #colophon h3,
  #colophon h4,
  #colophon h5,
  #colophon h6,
  footer a,
  .site-footer a,
  #colophon a,
  footer p,
  .site-footer p,
  #colophon p {
    max-width: 100% !important;
    white-space: normal !important;
    overflow-wrap: anywhere !important;
    word-break: normal !important;
  }

  footer ul,
  .site-footer ul,
  #colophon ul {
    max-width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    box-sizing: border-box !important;
  }

  footer img,
  .site-footer img,
  #colophon img,
  .elementor-location-footer img {
    max-width: 100% !important;
    height: auto !important;
    object-fit: contain !important;
  }

  /* Copyright/privacy row can wrap instead of leaving content outside screen. */
  footer .ast-footer-copyright,
  .site-footer .ast-footer-copyright,
  #colophon .ast-footer-copyright,
  footer .site-info,
  .site-footer .site-info,
  #colophon .site-info,
  .bgk-footer-privacy-menu {
    display: flex !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: center !important;
    width: 100% !important;
    min-width: 0 !important;
    max-width: 100% !important;
    height: auto !important;
    text-align: center !important;
    gap: 8px !important;
    white-space: normal !important;
  }

  /* Keep the last footer item clear of mobile browser/PWA bottom controls. */
  footer,
  .site-footer,
  #colophon,
  .elementor-location-footer {
    padding-bottom: max(24px, env(safe-area-inset-bottom)) !important;
  }
}

@media (max-width: 380px) {
  footer .ast-builder-grid-row,
  .site-footer .ast-builder-grid-row,
  #colophon .ast-builder-grid-row,
  footer .ast-container,
  .site-footer .ast-container,
  #colophon .ast-container,
  footer .bgk-footer-stable-row,
  .site-footer .bgk-footer-stable-row,
  #colophon .bgk-footer-stable-row {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
}
