/* =========================================================
   156-admin-sticky-tabs.css
   Täielik sticky-fix admin tabs + rail jaoks.
   WP admin #wpcontent/html overflow blokeeris CSS sticky.
   ========================================================= */

/* Eemalda overflow-blokeering WP admin wrapper'itel (ainult teema seadete lehel) */
.toplevel_page_valgusallikad-options #wpwrap,
.toplevel_page_valgusallikad-options #wpcontent,
.toplevel_page_valgusallikad-options #wpbody,
.toplevel_page_valgusallikad-options #wpbody-content {
  overflow: visible !important;
}

/* TABS — sticky täpsete väärtustega */
.wp-admin .vlg-admin-wrap .vlg-admin-tabs-pro {
  position: sticky !important;
  top: 32px !important;
  z-index: 100 !important;
  background: linear-gradient(180deg,#f8fafc,#f1f5f9) !important;
  border-radius: 18px !important;
  border: 1px solid #e2e8f0 !important;
  box-shadow: 0 4px 20px rgba(15,23,42,.10) !important;
  /* Takista allpool olevat sisu läbi paistmast */
  isolation: isolate !important;
}

.wp-admin.no-admin-bar .vlg-admin-wrap .vlg-admin-tabs-pro {
  top: 0 !important;
}

/* Mobiili admin bar on 46px */
@media screen and (max-width: 782px) {
  .wp-admin .vlg-admin-wrap .vlg-admin-tabs-pro {
    top: 46px !important;
  }
}

/* RAIL — sticky koos korrektse top-väärtusega */
.wp-admin .vlg-admin-wrap .vlg-admin-section-rail {
  position: sticky !important;
  top: 148px !important; /* 32px bar + ~116px tabs */
  z-index: 90 !important;
  align-self: start !important;
  max-height: calc(100vh - 164px) !important;
  overflow-y: auto !important;
  scrollbar-width: thin !important;
  scrollbar-color: #e2e8f0 transparent !important;
  background: linear-gradient(180deg,#fff,#fafbfd) !important;
  border: 1px solid #e2e8f0 !important;
  border-radius: 18px !important;
  box-shadow: 0 4px 16px rgba(15,23,42,.07) !important;
}

.wp-admin.no-admin-bar .vlg-admin-wrap .vlg-admin-section-rail {
  top: 116px !important;
  max-height: calc(100vh - 132px) !important;
}

@media screen and (max-width: 782px) {
  .wp-admin .vlg-admin-wrap .vlg-admin-section-rail {
    top: 162px !important;
    max-height: calc(100vh - 178px) !important;
  }
}

/* Grid peab lubama sticky */
.wp-admin .vlg-admin-wrap .vlg-admin-studio-layout-v2 {
  align-items: start !important;
  /* Ei ole overflow! */
}

/* Section intro (orange banner) — sticky tabs all */
.wp-admin .vlg-admin-wrap .vlg-admin-section-intro {
  position: sticky !important;
  top: 148px !important;
  z-index: 89 !important;
}
.wp-admin.no-admin-bar .vlg-admin-wrap .vlg-admin-section-intro {
  top: 116px !important;
}

/* Submit bar — põhjas sticky */
.wp-admin .vlg-admin-wrap .vlg-admin-submitbar {
  position: sticky !important;
  bottom: 0 !important;
  z-index: 95 !important;
  background: rgba(255,255,255,.97) !important;
  backdrop-filter: blur(12px) !important;
  border-top: 1px solid #e2e8f0 !important;
  box-shadow: 0 -4px 20px rgba(15,23,42,.08) !important;
  padding: 12px 20px !important;
}

/* Mobiilil rail pole sticky */
@media (max-width: 1100px) {
  .wp-admin .vlg-admin-wrap .vlg-admin-section-rail {
    position: static !important;
    max-height: none !important;
    overflow-y: visible !important;
  }
}
