/* Adapted from React Bits Accordion Gallery by David Haz.
   https://reactbits.dev/components/accordion-gallery
   License: licenses/react-bits-accordion-gallery.txt */
.work-gallery {
  --work-gallery-gap: 10px;
  --work-gallery-ease: cubic-bezier(.23, 1, .32, 1);
  display: flex;
  gap: var(--work-gallery-gap);
  height: clamp(420px, 36vw, 600px);
  margin: 0 4%;
  padding: 0;
  list-style: none;
  perspective: 1400px;
  scroll-margin-top: 110px;
}
.work-gallery:empty { display: none; }
.work-gallery-panel {
  position: relative;
  flex: 1 1 0;
  min-width: 0;
  min-height: 0;
  border-radius: 16px;
  background: var(--navy);
  box-shadow: 0 10px 30px -18px #000c;
}
.work-gallery.is-ready .work-gallery-panel {
  transition: flex-grow .6s var(--work-gallery-ease), transform .6s var(--work-gallery-ease);
}
.work-gallery.is-ready .work-gallery-panel.is-active { flex-grow: var(--work-gallery-grow); }
.work-gallery-link { position: absolute; inset: 0; display: block; border-radius: inherit; color: #fff; -webkit-tap-highlight-color: transparent; }
.work-gallery-link:focus-visible { outline: 2px solid var(--orange); outline-offset: 4px; }
.work-gallery-frame { position: absolute; inset: 0; overflow: hidden; border-radius: inherit; }
.work-gallery-media {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 100%;
  height: 100%;
  transform: translate3d(-50%, -50%, 0);
}
.work-gallery.is-ready .work-gallery-media {
  width: var(--work-gallery-media-size);
  filter: grayscale(1);
  transition: transform .6s var(--work-gallery-ease), filter .6s var(--work-gallery-ease);
}
.work-gallery.is-ready .is-active .work-gallery-media { filter: grayscale(0); }
.work-gallery-media img { display: block; width: 100%; height: 100%; object-fit: cover; user-select: none; }
.work-gallery-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, #080707e6 100%);
  pointer-events: none;
}
.work-gallery-shade::after { content: ''; position: absolute; inset: 0; background: #080707; opacity: 0; transition: opacity .6s var(--work-gallery-ease); }
.work-gallery.is-ready .work-gallery-panel:not(.is-active) .work-gallery-shade::after { opacity: .35; }
.work-gallery-caption {
  position: absolute;
  inset-inline: 24px;
  bottom: 26px;
  display: flex;
  align-items: center;
  gap: 14px;
  pointer-events: none;
}
.work-gallery-accent { width: 3px; height: 34px; border-radius: 3px; background: var(--orange); flex: none; }
.work-gallery-copy { display: block; min-width: 0; flex: 1; }
.work-gallery-title { display: block; font-size: clamp(1.25rem, 2vw, 2rem); font-weight: 700; line-height: 1.2; text-transform: uppercase; text-wrap: balance; }
.work-gallery-genre { display: block; margin-top: 8px; font-size: 12px; line-height: 1.5; }
.work-gallery-arrow { display: flex; flex: none; }
.work-gallery-arrow .icon { width: 26px; height: 26px; }
[dir=rtl] .work-gallery-arrow { transform: rotate(180deg); }
.work-gallery.is-ready .work-gallery-caption { opacity: 0; transform: translateX(-14px); transition: opacity .3s var(--work-gallery-ease), transform .6s var(--work-gallery-ease); }
[dir=rtl] .work-gallery.is-ready .work-gallery-caption { transform: translateX(14px); }
.work-gallery.is-ready .is-active .work-gallery-caption { opacity: 1; transform: translateX(0); transition-delay: .06s; }
@media (max-width: 600px) {
  .work-gallery { flex-direction: column; height: auto; margin-inline: 6%; perspective: none; scroll-margin-top: 96px; }
  .work-gallery-panel { flex: auto; min-height: 220px; }
  .work-gallery.is-ready { height: 620px; }
  .work-gallery.is-ready .work-gallery-panel { flex: 1 1 0; min-height: 64px; transform: none !important; }
  .work-gallery.is-ready .work-gallery-panel.is-active { flex-grow: var(--work-gallery-grow); }
  .work-gallery.is-ready .work-gallery-media { width: 100%; height: var(--work-gallery-media-size); }
  .work-gallery-caption { inset-inline: 18px; bottom: 18px; gap: 10px; }
  .work-gallery-title { font-size: 20px; }
  .work-gallery.is-ready .work-gallery-panel:not(.is-active) .work-gallery-caption { opacity: 1; transform: none; bottom: 14px; }
  .work-gallery.is-ready .work-gallery-panel:not(.is-active) .work-gallery-title { font-size: 14px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .work-gallery.is-ready .work-gallery-panel:not(.is-active) .work-gallery-genre,
  .work-gallery.is-ready .work-gallery-panel:not(.is-active) .work-gallery-accent,
  .work-gallery.is-ready .work-gallery-panel:not(.is-active) .work-gallery-arrow { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .work-gallery *, .work-gallery *::after { transition: none !important; }
  .work-gallery.is-ready .work-gallery-panel { transform: none !important; }
  .work-gallery.is-ready .work-gallery-media { transform: translate3d(-50%, -50%, 0) !important; }
}
@media print {
  .work-gallery.is-ready { height: auto; flex-direction: column; }
  .work-gallery.is-ready .work-gallery-panel { min-height: 260px; transform: none !important; }
  .work-gallery.is-ready .work-gallery-caption { opacity: 1; transform: none; }
}
