/* Admin (Backend) mobile-friendly overrides
   Loaded only on /admin/* via views/partials/header.php
*/

:root{
  --admin-gap: 1rem;
}

/* Keep admin readable and compact */
main.container{
  width: min(1100px, calc(100% - 2rem));
  margin: 1.5rem auto;
}

/* Make tables scroll horizontally on small screens */
.table, table{
  width: 100%;
}
@media (max-width: 900px){
  .table, table{
    display: block;
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
  }
}

/* Forms: many admin forms use inline CSS grid (2 columns). Override to 1 column on mobile. */
@media (max-width: 900px){
  form[style*="grid-template-columns:1fr 1fr"]{
    grid-template-columns: 1fr !important;
  }
  [style*="grid-column:1/3"]{
    grid-column: 1 / 2 !important;
  }
}

/* Bigger tap targets + no iOS zoom on input focus */
@media (max-width: 900px){
  input, select, textarea, button, .button{
    font-size: 16px;
  }
  .button, button{
    padding: .7rem 1rem;
    border-radius: .85rem;
  }
}

/* Admin bubble menu becomes a mobile-friendly sheet */
@media (max-width: 720px){
  .mp-adminbubble{
    left: .5rem;
    right: .5rem;
    bottom: .5rem;
    gap: .5rem;
    justify-content: space-between;
  }
  .mp-adminbubble-links{
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: .35rem;
    max-height: 70vh;
    overflow: auto;
  }
  .mp-adminbubble a{
    width: 100%;
    justify-content: center;
    font-size: 1rem;
    padding: .65rem .85rem;
  }
}

/* Admin header: keep visible while scrolling */
@media (max-width: 900px){
  .mp-site-header{
    position: sticky;
    top: 0;
    z-index: 50;
  }
  .mp-site-header .container{
    width: calc(100% - 1rem);
  }
  main.container{
    width: calc(100% - 1rem);
    margin: 1rem auto;
  }
}

@media (max-width: 520px){
  h2{ font-size: 1.35rem; }
  h3{ font-size: 1.1rem; }
}
