.gallery-focus {
  background: #f7f6f2;
  color: #fff;
  display: block;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  position: fixed;
  transition: opacity 240ms ease;
  visibility: hidden;
  z-index: 1000;
}

.gallery-focus.is-open {
  opacity: 1;
  pointer-events: auto;
  visibility: visible;
}

.gallery-focus__canvas {
  background: #f7f6f2;
  border-radius: 0;
  color: #111;
  inset: 0.75rem;
  overflow: hidden auto;
  position: absolute;
}

.gallery-focus__header {
  align-items: center;
  display: flex;
  justify-content: space-between;
  padding: 1.25rem 1.5rem;
  position: sticky;
  top: 0;
  z-index: 2;
}

.gallery-focus__back,
.gallery-focus__image {
  border: 0;
}

.gallery-focus__back {
  background: transparent;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 1.1rem;
  padding: 0.4rem;
}

.gallery-focus__brand {
  font-size: 3.2rem;
  font-weight: 700;
}

.gallery-focus__close { display: none; }

.gallery-focus__stage {
  align-items: center;
  display: flex;
  justify-content: center;
  min-height: calc(100vh - 10rem);
  padding: 2rem 8rem 4rem;
  position: relative;
}

.gallery-focus__image {
  height: auto;
  max-height: calc(100vh - 13rem);
  max-width: min(76vw, 1100px);
  object-fit: contain;
  width: min(76vw, 900px);
  transition: opacity 220ms ease, transform 220ms ease;
}

.gallery-focus__caption {
  color: #111;
  font-family: Arial, Helvetica, sans-serif;
  font-size: 1.3rem;
  font-weight: 400;
  letter-spacing: 0;
  position: absolute;
  right: 1.5rem;
  text-align: center;
  text-transform: none;
  top: 50%;
  transform: translateY(-50%) rotate(180deg);
  writing-mode: vertical-rl;
  z-index: 2;
}

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

.gallery-focus__next,
.gallery-focus__previous {
  display: none;
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  padding: 1rem;
  position: absolute;
  z-index: 1;
}

.gallery-focus__previous,
.gallery-focus__next {
  font-size: 2rem;
  top: 50%;
  transform: translateY(-50%);
}

.gallery-focus__previous { left: 3.5rem; }
.gallery-focus__next { right: 3.5rem; }

.gallery-focus__thumbs {
  display: flex;
  flex-direction: column;
  gap: 1.15rem;
  height: calc(100vh - 12rem);
  left: 1.5rem;
  overflow-x: hidden;
  overflow-y: auto;
  padding: 1rem 0.25rem;
  position: absolute;
  top: 5rem;
  width: 10rem;
  z-index: 1;
  scrollbar-width: none;
  overscroll-behavior: contain;
  touch-action: pan-y;
  scroll-snap-type: y proximity;
}

.gallery-focus__thumbs::-webkit-scrollbar { display: none; }

.gallery-focus__thumb {
  background: transparent;
  border: 0;
  cursor: pointer;
  flex: 0 0 auto;
  opacity: 0.58;
  padding: 0;
  width: 6rem;
  scroll-snap-align: center;
  transform: translateZ(0);
  transition: opacity 0.79s cubic-bezier(.22, 1, .36, 1), transform 0.79s cubic-bezier(.22, 1, .36, 1), width 0.79s cubic-bezier(.22, 1, .36, 1);
}

.gallery-focus__thumb.is-active { opacity: 1; }

.gallery-focus__thumb:nth-child(4n + 2) { margin-left: 3rem; }
.gallery-focus__thumb:nth-child(4n + 3) { margin-left: 0.2rem; }
.gallery-focus__thumb:nth-child(4n + 4) { margin-left: -2rem; }

.gallery-focus__thumb img {
  display: block;
  height: 5.25rem;
  object-fit: cover;
  width: 100%;
}

.gallery-focus__info {
  align-items: center;
  display: none;
  font-size: clamp(2.4rem, 4vw, 4.8rem);
  justify-content: center;
  line-height: 1.1;
  min-height: calc(100vh - 12rem);
  padding: 8rem 12vw;
  text-align: center;
}

.gallery-focus.is-info .gallery-focus__stage { display: none; }
.gallery-focus.is-info .gallery-focus__info { display: flex; }

.gallery-focus.is-index .gallery-focus__stage { display: none; }
.gallery-focus.is-index .gallery-focus__thumbs {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 3rem 6rem;
  height: calc(100% - 9rem);
  left: 4rem;
  padding: 6rem 4rem 8rem;
  top: 0;
  width: calc(100% - 8rem);
}

.gallery-focus.is-index .gallery-focus__thumb {
  align-self: center;
  margin: 0 !important;
  width: 100%;
}

.gallery-focus.is-index-opening .gallery-focus__thumb {
  opacity: 0.35;
  transform: scale(0.82);
}

.gallery-focus.is-index-opening .gallery-focus__thumb:nth-child(3n + 2) { transition-delay: 0.04s; }
.gallery-focus.is-index-opening .gallery-focus__thumb:nth-child(3n + 3) { transition-delay: 0.08s; }

.gallery-focus.is-index .gallery-focus__thumb img {
  height: auto;
  max-height: 13rem;
  object-fit: contain;
}

.gallery-focus__footer {
  bottom: 1.25rem;
  display: flex;
  gap: 2.5rem;
  left: 50%;
  position: absolute;
  transform: translateX(-50%);
  z-index: 3;
}

.gallery-focus__footer-action,
.gallery-focus__footer-back {
  background: transparent;
  border: 0;
  color: inherit;
  cursor: pointer;
  font: inherit;
  font-size: 2.2rem;
  font-weight: 700;
  padding: 0;
}

.gallery-focus__counter {
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  height: 1px;
  overflow: hidden;
  position: absolute;
  white-space: nowrap;
  width: 1px;
}

body.gallery-focus-is-open { overflow: hidden; }

@media (min-width: 769px) and (max-width: 1100px) {
  .gallery-focus__brand { font-size: 2.6rem; }
  .gallery-focus__stage { padding-left: 6rem; padding-right: 6rem; }
  .gallery-focus__image { max-width: calc(100vw - 13rem); width: min(72vw, 760px); }
  .gallery-focus__thumbs { left: 1rem; width: 8rem; }
  .gallery-focus__thumb { width: 5rem; }
  .gallery-focus.is-index .gallery-focus__thumbs {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 2rem;
    left: 2rem;
    padding-left: 2rem;
    padding-right: 2rem;
    width: calc(100% - 4rem);
  }
}

@media (max-width: 768px) {
  .gallery-focus__canvas { border-radius: 0; inset: 0; }
  .gallery-focus__brand { font-size: 2rem; }
  .gallery-focus__header { padding: 1rem 1rem 0.5rem; }
  .gallery-focus__back { font-size: 1rem; }
  .gallery-focus__stage { min-height: calc(100svh - 11rem); padding: 4rem 1rem 6rem; }
  .gallery-focus__image { max-height: calc(100svh - 14rem); max-width: 88vw; width: auto; }
  .gallery-focus__caption { bottom: 9rem; font-size: 1.1rem; right: 0.75rem; top: auto; transform: none; writing-mode: vertical-rl; }
  .gallery-focus__thumbs { bottom: 4.1rem; flex-direction: row; height: 4.3rem; left: 0.75rem; padding: 0.15rem 0.25rem; top: auto; width: calc(100% - 1.5rem); touch-action: pan-x; scroll-snap-type: x proximity; }
  .gallery-focus__thumb { width: 4.5rem; }
  .gallery-focus__thumb img { height: 4rem; }
  .gallery-focus.is-index .gallery-focus__thumbs {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 1rem;
    bottom: 0;
    height: calc(100% - 4rem);
    left: 0.5rem;
    padding: 4rem 1rem 5rem;
    width: calc(100% - 1rem);
  }
  .gallery-focus__info { font-size: clamp(2rem, 8vw, 3rem); min-height: calc(100svh - 8rem); padding: 5rem 1.25rem 7rem; }
  .gallery-focus__previous,
  .gallery-focus__next { font-size: 1.5rem; }
  .gallery-focus__previous { left: 0.5rem; }
  .gallery-focus__next { right: 0.5rem; }
  .gallery-focus__footer { gap: 1.2rem; }
  .gallery-focus__footer-action,
  .gallery-focus__footer-back { font-size: 1.8rem; }
}
