.hero-gallery {
  display: grid;
  grid-template-columns: auto minmax(0, max-content) minmax(120px, 1fr);
  align-items: center;
  gap: 16px;
  padding: 8px max(6%, calc((100% - 1400px) / 2));
  background: #061d38;
  border-top: 1px solid #34506c;
}

.hero-gallery-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}

.hero-gallery-open,
.hero-gallery-toggle {
  min-height: 44px;
  padding: 5px 8px;
  border: 0;
  border-radius: 4px;
  background: transparent;
  color: white;
  text-align: left;
  font: inherit;
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  cursor: pointer;
}

.hero-gallery-toggle {
  color: #dce8f4;
  text-align: right;
}

.hero-gallery-open:hover,
.hero-gallery-toggle:hover {
  background: #203d58;
}

.hero-gallery-thumbs {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(46px, 4.25vw, 64px);
  gap: 7px;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
  padding: 4px;
}

.hero-gallery-thumbs::-webkit-scrollbar {
  display: none;
}

.hero-gallery-thumbs button {
  display: block;
  width: 100%;
  height: 44px;
  padding: 0;
  overflow: hidden;
  border: 1px solid #7890a9;
  border-radius: 4px;
  background: #26435c;
  cursor: pointer;
}

.hero-gallery-thumbs img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-gallery-thumbs button:hover img {
  filter: brightness(1.15);
}

.hero-gallery-thumbs button[aria-pressed="true"] {
  outline: 2px solid #e4f0fc;
  outline-offset: 1px;
}

.hero-gallery .hero-photo-label {
  display: grid;
  justify-items: end;
  gap: 2px;
  min-width: 0;
  margin: 0;
  color: #fff;
  font-size: 11px;
  line-height: 1.3;
  text-align: right;
}

#hero-photo-title {
  font-weight: 700;
}

.hero-photo-label a {
  color: #d1e0ef;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.hero-art[data-current-photo] > img {
  object-position: center;
}

.hero-art[data-current-photo="pegs-training"] > img {
  object-position: center 33%;
}

.hero-art[data-current-photo="pitching-work"] > img,
.hero-art[data-current-photo^="roger-social-"] > img {
  object-fit: contain;
  object-position: 78% center;
  background: #061d38;
}

@media (max-width: 1000px) {
  .hero-gallery {
    grid-template-columns: auto minmax(0, 1fr);
    gap: 0 10px;
    padding-block: 5px;
  }

  .hero-gallery-thumbs {
    grid-column: 1 / -1;
    grid-row: 1;
    grid-auto-columns: 52px;
  }

  .hero-gallery-actions {
    grid-row: 2;
  }

  .hero-photo-label {
    grid-row: 2;
  }
}

.baseball-gallery {
  width: min(1040px, calc(100% - 42px));
  max-width: none;
  max-height: calc(100dvh - 40px);
  padding: 0;
  border: 1px solid #344f68;
  border-radius: 13px;
  background: #f5f7fa;
  color: var(--ink);
  box-shadow: 0 24px 80px #020c19ab;
}

.baseball-gallery::backdrop {
  background: #061628dd;
}

.baseball-gallery [hidden] {
  display: none;
}

.baseball-gallery-header {
  position: sticky;
  top: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 10px 22px;
  background: #061d38;
  color: #fff;
}

.baseball-gallery-header h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(29px, 4vw, 42px);
}

.gallery-close {
  display: grid;
  place-items: center;
  width: 44px;
  min-height: 44px;
  padding: 0;
  border: 1px solid #7e98b0;
  border-radius: 50%;
  background: #193753;
  color: #fff;
  font-size: 25px;
  cursor: pointer;
}

.baseball-gallery-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 13px;
  padding: 18px;
}

.baseball-gallery-grid button {
  display: block;
  min-width: 0;
  padding: 0;
  overflow: hidden;
  border: 1px solid #c4d3e1;
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  text-align: left;
  font: inherit;
  cursor: pointer;
}

.baseball-gallery-grid button:hover {
  border-color: #244f7a;
  background: #e8f0f8;
}

.baseball-gallery-grid img {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  background: #dae5f0;
}

.baseball-gallery-grid span {
  display: block;
  padding: 9px 11px;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.35;
}

.baseball-gallery-view {
  padding: 12px 18px 19px;
}

.baseball-gallery-nav,
.baseball-gallery-nav > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

.baseball-gallery-nav {
  justify-content: space-between;
  margin-bottom: 10px;
}

.baseball-gallery-nav button {
  min-height: 44px;
  padding: 5px 12px;
  border: 1px solid #afc2d4;
  border-radius: 6px;
  background: #fff;
  color: var(--ink);
  font: inherit;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
}

.baseball-gallery-nav button:hover {
  background: #e8f0f8;
}

.baseball-gallery-view figure {
  margin: 0;
}

#baseball-full-photo {
  display: block;
  width: 100%;
  height: auto;
  max-height: min(53dvh, 565px);
  border-radius: 8px;
  background: #0b2037;
  object-fit: contain;
}

.baseball-gallery-view figcaption {
  padding: 13px 3px 0;
}

.baseball-gallery-view h3 {
  margin: 0 0 4px;
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--ink);
}

.baseball-gallery-view p {
  margin: 0 0 4px;
  color: #455e76;
  font-size: 14px;
}

.baseball-gallery-view .baseball-photo-source {
  font-size: 12px;
}

.baseball-photo-source a {
  color: #234f78;
  text-decoration: underline;
}

.hero-gallery button:focus-visible,
.baseball-gallery :is(button, a):focus-visible {
  outline: 3px solid #ac642d;
  outline-offset: 2px;
}

@media (max-width: 760px) {
  .hero-gallery {
    padding-inline: 4%;
  }

  .hero-art[data-current-photo="pitching-work"] > img,
  .hero-art[data-current-photo^="roger-social-"] > img {
    object-position: center;
  }

  .baseball-gallery {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 20px);
  }

  .baseball-gallery-header {
    padding: 7px 12px;
  }

  .baseball-gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
    padding: 10px;
  }

  .baseball-gallery-grid span {
    padding: 8px;
    font-size: 12px;
  }

  .baseball-gallery-view {
    padding: 9px 10px 13px;
  }

  #baseball-full-photo {
    max-height: min(47dvh, 430px);
  }
}

