/*
 * Shared structural polish for pages that use the Aizumanga site chrome.
 * Theme palettes intentionally stay in each page stylesheet; this file owns
 * layout, responsive behavior and touch sizing so those rules cannot drift.
 */

.site-chrome {
  grid-template-columns: minmax(0, 1fr) auto auto auto;
  min-width: 0;
}

.site-chrome__brand,
.site-chrome__status,
.theme-picker {
  white-space: nowrap;
}

.site-chrome nav {
  min-width: 0;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: thin;
}

.site-chrome nav a {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  min-height: 30px;
  white-space: nowrap;
}

.theme-picker {
  min-width: 0;
}

.theme-picker select {
  min-height: 28px;
}

@media (max-width: 860px) {
  .site-chrome {
    grid-template-columns: minmax(0, 1fr) auto auto;
  }

  .site-chrome__brand {
    display: none;
  }

  .theme-picker span {
    display: none;
  }
}

@media (max-width: 600px) {
  .site-chrome {
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 5px;
    padding-inline: 5px;
  }

  .site-chrome__status {
    display: none;
  }

  .site-chrome nav a {
    min-height: 38px;
    padding-inline: 7px;
  }

  .theme-picker select {
    max-width: 92px;
    min-height: 34px;
  }

  .gallery-search-form input,
  .gallery-search-form select,
  .gallery-search-form button,
  .random-image-control button,
  .character-links a,
  .footer-links a {
    min-height: 36px;
  }
}

@media (max-width: 480px) {
  /* Two narrow sidebar columns made counters/merch/rating panels cramped. */
  .sidebar {
    grid-template-columns: minmax(0, 1fr);
  }

  .sidebar > * {
    min-width: 0;
    grid-column: auto !important;
  }

  .site-chrome nav a {
    min-height: 42px;
  }
}
