:root {
  --brand: #39ff14;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Segoe UI",
    Roboto,
    sans-serif;
  background: #ffffff;
  color: #171717;
}

button {
  font-family: inherit;
}

.gallery {
  padding: 4rem 1rem;
}

.gallery__inner {
  max-width: 72rem;
  margin: 0 auto;
}

.gallery__header {
  max-width: 42rem;
  margin: 0 auto;
  text-align: center;
}

.gallery__heading {
  margin: 0;
  font-size: clamp(1.75rem, 1.4rem + 1.8vw, 2.5rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: #171717;
}

.gallery__subheading {
  margin: 0.75rem 0 0;
  font-size: 0.875rem;
  line-height: 1.6;
  color: #737373;
}

.filmstrip {
  display: flex;
  gap: 0.75rem;
  margin-top: 2.5rem;
  overflow-x: auto;
  padding-bottom: 0.5rem;
}

.frame {
  position: relative;
  flex-shrink: 0;
  width: 8rem;
  height: 10rem;
  overflow: hidden;
  border-radius: 0.75rem;
  border: none;
  padding: 0;
  background: #f5f5f5;
  cursor: pointer;
}

.frame:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.frame__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (prefers-reduced-motion: no-preference) {
  .frame__image {
    transition:
      transform 300ms ease,
      box-shadow 300ms ease;
  }

  .frame:hover .frame__image,
  .frame:focus-visible .frame__image {
    transform: translateY(-4px);
  }
}

@media (min-width: 640px) {
  .filmstrip {
    gap: 1rem;
  }

  .frame {
    width: 10rem;
    height: 12rem;
  }
}

@media (min-width: 1024px) {
  .gallery {
    padding: 6rem 2rem;
  }

  .filmstrip {
    margin-top: 3.5rem;
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    overflow: visible;
  }

  .frame {
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 5;
  }
}

/* Lightbox */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.lightbox__panel {
  position: relative;
  display: flex;
  max-height: 100%;
  width: 100%;
  max-width: 48rem;
  flex-direction: column;
  overflow: hidden;
  border-radius: 1rem;
  background: #0a0a0a;
}

.lightbox__image {
  display: block;
  width: 100%;
  max-height: 70vh;
  object-fit: contain;
}

.lightbox__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 1rem 1.25rem;
}

.lightbox__title {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 500;
  color: #ffffff;
}

.lightbox__category {
  margin: 0.125rem 0 0;
  font-size: 0.6875rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
}

.lightbox__count {
  margin: 0;
  font-size: 0.75rem;
  color: rgba(255, 255, 255, 0.4);
}

.lightbox__control {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 999px;
  border: none;
  background: rgba(0, 0, 0, 0.4);
  color: #ffffff;
  cursor: pointer;
  transition: background-color 150ms ease;
}

.lightbox__control:hover {
  background: rgba(0, 0, 0, 0.6);
}

.lightbox__control:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.lightbox__control svg {
  width: 1.125rem;
  height: 1.125rem;
}

.lightbox__close {
  top: 0.75rem;
  right: 0.75rem;
}

.lightbox__prev {
  top: 50%;
  left: 0.75rem;
  transform: translateY(-50%);
}

.lightbox__next {
  top: 50%;
  right: 0.75rem;
  transform: translateY(-50%);
}

@keyframes al-gallery09-overlay-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes al-gallery09-panel-in {
  from {
    opacity: 0;
    transform: scale(0.96);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@media (prefers-reduced-motion: no-preference) {
  .lightbox__overlay {
    animation: al-gallery09-overlay-in 200ms ease both;
  }

  .lightbox__panel {
    animation: al-gallery09-panel-in 260ms cubic-bezier(0.16, 1, 0.3, 1) both;
  }
}
