:root {
  --aa-white: #fff;
  --aa-black: #050505;
  --aa-header-height: 70px;
}

html {
  scroll-behavior: smooth;
}

body.aa-gallery-template,
.aa-gallery {
  background: var(--aa-white);
}

.aa-gallery {
  color: var(--aa-black);
  font-family: "Helvetica Neue", Inter, Arial, sans-serif;
  font-weight: 300;
  min-height: 100vh;
  overflow-x: clip;
  width: 100%;
  --aa-columns: 2;
  --aa-gap: 58px;
  --aa-max-width: 1440px;
}

.aa-gallery *,
.aa-gallery *::before,
.aa-gallery *::after {
  box-sizing: border-box;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
}

.aa-gallery button {
  font: inherit;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  -webkit-touch-callout: none;
  border-color: transparent;
  outline: 1px solid transparent !important;
  outline-offset: 0;
  touch-action: manipulation;
  user-select: none;
}

.aa-gallery button:focus,
.aa-gallery button:focus-visible,
.aa-gallery button:active {
  background: transparent;
  box-shadow: none;
  outline: 1px solid transparent !important;
}

.aa-gallery-header {
  align-items: center;
  background: rgba(255, 255, 255, 0);
  display: flex;
  height: var(--aa-header-height);
  justify-content: space-between;
  left: 0;
  padding: 0 clamp(18px, 4vw, 56px);
  position: fixed;
  right: 0;
  top: 0;
  transition: background-color 0.4s ease, backdrop-filter 0.4s ease;
  z-index: 40;
}

.aa-gallery-header.is-scrolled {
  backdrop-filter: blur(14px);
  background: rgba(255, 255, 255, 0.78);
}

.aa-gallery-logo {
  color: var(--aa-black);
  display: block;
  height: 28px;
  line-height: 0;
  text-decoration: none;
  width: min(250px, 58vw);
}

.aa-gallery-logo svg {
  display: block;
  height: 100%;
  width: 100%;
}

.aa-gallery-menu {
  appearance: none;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: pointer;
  display: grid;
  gap: 7px;
  height: 34px;
  margin: 0;
  padding: 8px 0;
  place-content: center;
  width: 34px;
}

.aa-gallery-menu span {
  background: currentColor;
  display: block;
  height: 1px;
  width: 22px;
}

.aa-gallery-grid {
  align-items: start;
  display: grid;
  gap: clamp(12px, 3.4vw, var(--aa-gap));
  grid-auto-flow: dense;
  grid-auto-rows: 8px;
  grid-template-columns: repeat(var(--aa-columns), minmax(0, 1fr));
  margin-left: auto;
  margin-right: auto;
  max-width: var(--aa-max-width);
  padding: calc(var(--aa-header-height) + clamp(32px, 7vw, 112px)) clamp(16px, 6vw, 112px) clamp(80px, 12vw, 180px);
}

.aa-gallery-item {
  grid-column: span 1;
  grid-row-end: span var(--aa-row-span, 32);
  min-width: 0;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.aa-gallery-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.aa-gallery-item--small,
.aa-gallery-item--medium {
  grid-column: span 1;
}

.aa-gallery-item--large {
  grid-column: 1 / -1;
}

.aa-gallery-frame {
  appearance: none;
  aspect-ratio: var(--aa-aspect-ratio, 4 / 5);
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
  cursor: zoom-in;
  display: block;
  line-height: 0;
  margin: 0;
  overflow: hidden;
  padding: 0;
  position: relative;
  width: 100%;
}

.aa-gallery--no-lightbox .aa-gallery-frame {
  cursor: default;
}

.aa-gallery-frame img,
.aa-gallery-frame video {
  background: transparent;
  display: block;
  height: 100%;
  inset: 0;
  max-width: none;
  object-fit: cover;
  position: absolute;
  transform: scale(1);
  transition: transform 0.4s ease;
  width: 100%;
}

.aa-gallery-frame img[src],
.aa-gallery-frame video[src] {
  opacity: 1;
}

@media (hover: hover) {
  .aa-gallery-frame:hover img,
  .aa-gallery-frame:hover video {
    transform: scale(1.025);
  }
}

.aa-lightbox {
  align-items: center;
  background: #000;
  display: grid;
  inset: 0;
  justify-items: center;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 0.28s ease;
  z-index: 100000;
}

.aa-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.aa-lightbox-stage {
  align-items: center;
  display: flex;
  height: 100dvh;
  justify-content: center;
  padding: clamp(28px, 6vw, 76px);
  width: 100vw;
}

.aa-lightbox-stage img,
.aa-lightbox-stage video {
  display: block;
  max-height: 92dvh;
  max-width: 92vw;
  object-fit: contain;
  transform: scale(1);
  transition: transform 0.24s ease;
}

.aa-lightbox.is-zoomed .aa-lightbox-stage img,
.aa-lightbox.is-zoomed .aa-lightbox-stage video {
  cursor: zoom-out;
  transform: scale(1.7);
}

.aa-lightbox-control {
  accent-color: #9b9b9b;
  appearance: none;
  background: transparent !important;
  border: 0 !important;
  border-radius: 0;
  box-shadow: none !important;
  color: #f4f4f4;
  cursor: pointer;
  display: block;
  margin: 0;
  outline: 0 !important;
  padding: 0;
  position: fixed;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: rgba(0, 0, 0, 0) !important;
  -webkit-touch-callout: none;
  touch-action: manipulation;
  user-select: none;
  -webkit-user-select: none;
  z-index: 100010;
}

.aa-lightbox-control:focus,
.aa-lightbox-control:focus-visible,
.aa-lightbox-control:active,
.aa-lightbox-control:hover {
  accent-color: #9b9b9b;
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
  color: #f4f4f4;
  filter: none;
  outline: 0 !important;
}

.aa-lightbox-close {
  height: 42px;
  right: clamp(18px, 3vw, 36px);
  top: clamp(18px, 3vw, 36px);
  width: 42px;
}

.aa-lightbox-tool {
  height: 42px;
  top: clamp(18px, 3vw, 36px);
  width: 42px;
}

.aa-lightbox-zoom {
  right: calc(clamp(18px, 3vw, 36px) + 54px);
}

.aa-lightbox-fullscreen {
  right: calc(clamp(18px, 3vw, 36px) + 108px);
}

.aa-lightbox-zoom::before,
.aa-lightbox-zoom::after,
.aa-lightbox-fullscreen::before,
.aa-lightbox-fullscreen::after {
  content: "";
  position: absolute;
}

.aa-lightbox-zoom::before {
  border: 1px solid #fff;
  border-radius: 50%;
  height: 16px;
  left: 9px;
  top: 8px;
  width: 16px;
}

.aa-lightbox-zoom::after {
  background: #fff;
  height: 1px;
  left: 23px;
  top: 24px;
  transform: rotate(45deg);
  width: 11px;
}

.aa-lightbox-fullscreen::before {
  border-color: #fff;
  border-style: solid;
  border-width: 1px 1px 0 0;
  height: 12px;
  right: 9px;
  top: 9px;
  width: 12px;
}

.aa-lightbox-fullscreen::after {
  border-color: #fff;
  border-style: solid;
  border-width: 0 0 1px 1px;
  bottom: 9px;
  height: 12px;
  left: 9px;
  width: 12px;
}

.aa-lightbox-close::before,
.aa-lightbox-close::after {
  background: #fff;
  content: "";
  height: 1px;
  left: 9px;
  position: absolute;
  top: 20px;
  width: 24px;
}

.aa-lightbox-close::before {
  transform: rotate(45deg);
}

.aa-lightbox-close::after {
  transform: rotate(-45deg);
}

.aa-lightbox-arrow {
  height: 56px;
  top: 50%;
  transform: translateY(-50%);
  width: 56px;
}

.aa-lightbox-arrow::before {
  border-color: #f4f4f4;
  border-style: solid;
  border-width: 0 1px 1px 0;
  content: "";
  height: 24px;
  left: 16px;
  position: absolute;
  top: 16px;
  width: 24px;
}

.aa-lightbox-arrow:focus::before,
.aa-lightbox-arrow:focus-visible::before,
.aa-lightbox-arrow:active::before {
  border-color: #9b9b9b;
}

.aa-lightbox-prev {
  left: clamp(18px, 3vw, 42px);
}

.aa-lightbox-prev::before {
  transform: rotate(135deg);
}

.aa-lightbox-next {
  right: clamp(18px, 3vw, 42px);
}

.aa-lightbox-next::before {
  transform: rotate(-45deg);
}

body.aa-lightbox-open {
  overflow: hidden;
}

@media (max-width: 640px) {
  :root {
    --aa-header-height: 64px;
  }

  .aa-gallery-grid {
    gap: 14px;
    grid-auto-rows: 6px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding-left: 14px;
    padding-right: 14px;
  }

  .aa-gallery-item--large {
    grid-column: 1 / -1;
  }

  .aa-lightbox-arrow {
    height: 48px;
    width: 48px;
  }

  .aa-lightbox-arrow::before {
    height: 20px;
    left: 14px;
    top: 14px;
    width: 20px;
  }

  .aa-lightbox-tool {
    top: 14px;
  }

  .aa-lightbox-zoom {
    right: 64px;
  }

  .aa-lightbox-fullscreen {
    right: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .aa-gallery-item,
  .aa-gallery-frame img,
  .aa-gallery-frame video,
  .aa-lightbox {
    transition: none;
  }
}
