/* Gallery size control. Medium = the site's normal layout, so it changes nothing by default.
   Applies to every .gallery on the page (portfolio grid and flash sections). */

.scale-bar {
  display: flex;
  justify-content: flex-end;
  gap: 8px;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px 12px;
  background: var(--bg);
}

.scale-btn.sort-btn {
  width: auto;
  padding: 0 14px;
  font-family: 'Share Tech Mono', monospace;
  font-size: 12px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.scale-btn {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--txt);
  background: var(--surf);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 8px;
  cursor: pointer;
}

/* Desktop */
html[data-gallery-scale="small"] .gallery {
  grid-template-columns: repeat(auto-fill, minmax(130px, 170px));
  gap: 12px;
}

html[data-gallery-scale="large"] .gallery {
  grid-template-columns: repeat(auto-fill, minmax(340px, 440px));
  gap: 24px;
}

/* Phones: small = one more column than the page's setting, large = a single column. */
@media (max-width: 560px) {
  html[data-gallery-scale="small"] .gallery {
    grid-template-columns: repeat(calc(var(--mobile-gallery-columns, 3) + 1), minmax(0, 1fr));
    gap: 6px;
  }

  html[data-gallery-scale="large"] .gallery {
    grid-template-columns: minmax(0, 1fr);
    gap: 12px;
  }
}
