.gallery-item {
  border: 0;
  padding: 0;
  background: #0a1628;
  text-align: inherit;
  font: inherit;
}
.gallery-item img { display: block; }
.gallery-item:focus-visible,
.gallery-controls button:focus-visible {
  outline: 3px solid var(--color-accent);
  outline-offset: 5px;
}
.gallery-item:focus-visible .gallery-item-overlay svg { opacity: 1; transform: scale(1); }
.gallery-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 20px;
  margin-bottom: 20px;
  scroll-margin-top: 110px;
}
.gallery-toolbar[hidden] { display: none; }
.gallery-caption { margin: 0; color: var(--color-primary); font-size: .9rem; }
.gallery-controls { display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.gallery-controls button {
  padding: 10px 14px;
  min-height: 44px;
  min-width: 44px;
  border: 1px solid rgba(10,22,40,.25);
  background: transparent;
  color: #0a1628;
  font: inherit;
  font-size: .8rem;
  cursor: pointer;
  transition: background .2s, color .2s;
}
.gallery-controls button:hover { background: #0a1628; color: white; }
.gallery-grid.is-expanded { grid-template-columns: repeat(10, minmax(0, 1fr)); }
.gallery-grid.is-expanded .gallery-item {
  grid-column: span 2;
  grid-row: auto;
  height: clamp(90px, 12vw, 155px);
  opacity: .72;
  transform: none;
  transition: opacity .25s;
}
.gallery-grid.is-expanded .gallery-item img { min-height: 0; }
.gallery-grid.is-expanded .gallery-item:hover,
.gallery-grid.is-expanded .gallery-item:focus-visible { opacity: 1; }
.gallery-grid.is-expanded .gallery-item.is-selected {
  grid-column: 1 / -1;
  order: -1;
  height: clamp(320px, 60vw, 650px);
  opacity: 1;
  box-shadow: 0 16px 40px rgba(10,22,40,.14);
}
.gallery-grid.is-expanded .is-selected img { object-fit: contain; transform: none; }
.gallery-grid.is-expanded .is-selected .gallery-item-overlay { display: none; }
@media (max-width: 767px) {
  .gallery-toolbar { align-items: flex-start; flex-direction: column; gap: 12px; }
  .gallery-grid.is-expanded { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
  .gallery-grid.is-expanded .gallery-item { height: 90px; }
  .gallery-grid.is-expanded .gallery-item.is-selected { height: clamp(250px, 70vw, 440px); }
}
@media (prefers-reduced-motion: reduce) {
  .gallery-item, .gallery-item img, .gallery-item-overlay, .gallery-item-overlay svg,
  .gallery-controls button { transition: none !important; }
}
