/* MAISHA_MENU_IZQUIERDO_STICKY_V1
   Menú público de Biblioteca visible al bajar.
   Anclado a su contenido: se detiene al llegar al pie de página.
   No cambia el encabezado ni el pie institucional. */
body.ma-library > main.ma-library-layout {
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  display: grid !important;
  grid-template-columns: minmax(174px, 200px) minmax(0, 1fr);
  gap: clamp(16px, 2.2vw, 34px);
  align-items: start;
  padding: 0 clamp(14px, 2vw, 36px) !important;
}
body.ma-library > main.ma-library-layout > .ma-container {
  grid-column: 2;
  min-width: 0;
  width: 100%;
  max-width: 1160px;
  padding: 0 clamp(5px, 1.15vw, 22px);
}
body.ma-library > main.ma-library-layout > nav.ma-library-sections {
  position: sticky !important;
  top: 88px !important;
  z-index: 85;
  align-self: start;
  grid-column: 1;
  box-sizing: border-box;
  display: flex !important;
  flex-direction: column !important;
  flex-wrap: nowrap !important;
  align-items: stretch !important;
  justify-content: flex-start !important;
  gap: 6px !important;
  width: 100% !important;
  max-width: 100% !important;
  margin: 22px 0 0 !important;
  padding: 13px 10px !important;
  background: #23172f !important;
  border: 1px solid #735b78 !important;
  border-radius: 13px !important;
  box-shadow: 0 8px 25px rgba(8, 5, 15, .18);
}
body.ma-library > main.ma-library-layout > nav.ma-library-sections a {
  display: block;
  text-align: left;
  white-space: normal !important;
  padding: 11px 12px;
  border-radius: 9px;
  color: #f0d6a9 !important;
  text-decoration: none;
  font-weight: 650;
}
body.ma-library > main.ma-library-layout > nav.ma-library-sections a:hover,
body.ma-library > main.ma-library-layout > nav.ma-library-sections a:focus-visible {
  background: #473152;
  color: #fff7e3 !important;
  outline-offset: 2px;
}
body.ma-library #catalogo,
body.ma-library #comunidad,
body.ma-library #circulos,
body.ma-library #membresia {scroll-margin-top: 96px}

/* En pantallas pequeñas permanece visible como barra superior, alineada a la izquierda,
   sin reducir el espacio de lectura con una columna lateral. */
@media (max-width: 1079px) {
  body.ma-library > main.ma-library-layout {
    display: block !important;
    padding: 0 !important;
  }
  body.ma-library > main.ma-library-layout > nav.ma-library-sections {
    position: sticky !important;
    top: 74px !important;
    z-index: 85;
    width: 100% !important;
    margin: 0 !important;
    padding: 8px 12px !important;
    border-radius: 0 !important;
    border-left: 0 !important;
    border-right: 0 !important;
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: nowrap !important;
    justify-content: flex-start !important;
    align-items: center !important;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    scrollbar-width: thin;
  }
  body.ma-library > main.ma-library-layout > nav.ma-library-sections a {
    flex: 0 0 auto;
    white-space: nowrap !important;
    padding: 9px 11px;
  }
  body.ma-library > main.ma-library-layout > .ma-container {
    width: 100%;
    max-width: 1160px;
    margin: auto;
    padding: 0 22px;
  }
  body.ma-library #catalogo,
  body.ma-library #comunidad,
  body.ma-library #circulos,
  body.ma-library #membresia {scroll-margin-top: 142px}
}
