:root {
  --page-bg: #ffffff;
  --text: #333333;
  --footer-text: #595959;
  --gallery-gap: 20px;
  --thumb-width: 250px;
  --thumb-height: 350px;
  --row-max-width: calc((var(--thumb-width) * 5) + (var(--gallery-gap) * 4));
  --header-top-padding: 10px;
  --hover-duration: 1500ms;
}

* {
  box-sizing: border-box;
}

html {
  font-size: 16px;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: var(--page-bg);
  font-family: Arial, Helvetica, sans-serif;
  line-height: 1.4;
}

body.is-locked {
  overflow: hidden;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

a {
  color: inherit;
}

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 1000;
  transform: translateY(-160%);
  padding: 8px 12px;
  color: #ffffff;
  background: #000000;
}

.skip-link:focus {
  transform: translateY(0);
}

.page-wrap {
  min-height: 100vh;
  padding-top: var(--header-top-padding);
  display: flex;
  flex-direction: column;
}

.site-header {
  width: 100%;
  background: #ffffff;
}

.site-header__inner {
  width: min(1100px, calc(100% - 30px));
  min-height: 68px;
  margin: 0 auto;
  display: block;
}

.site-logo {
  min-height: 1px;
  text-decoration: none;
}


.site-main {
  flex: 1;
}

.gallery {
  width: min(var(--row-max-width), calc(100% - 30px));
  margin: 0 auto;
  padding-top: 15px;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(5, var(--thumb-width));
  gap: var(--gallery-gap);
  justify-content: center;
}

.gallery-card {
  position: relative;
  display: block;
  width: var(--thumb-width);
  height: var(--thumb-height);
  overflow: hidden;
  border: 0;
  padding: 0;
  background: #eeeeee;
  cursor: pointer;
  isolation: isolate;
}

.gallery-card img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  transform: scale(1);
  transition: transform var(--hover-duration) ease, filter var(--hover-duration) ease;
}

.gallery-card::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: rgba(0, 0, 0, 0.18);
  opacity: 0;
  transition: opacity 300ms ease;
  pointer-events: none;
}

.gallery-card:hover img,
.gallery-card:focus-visible img {
  transform: scale(1.12);
}

.gallery-card:hover::after,
.gallery-card:focus-visible::after {
  opacity: 1;
}

.gallery-card__tooltip {
  position: absolute;
  left: 50%;
  bottom: 16px;
  z-index: 2;
  max-width: calc(100% - 28px);
  transform: translate(-50%, 8px);
  padding: 7px 10px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.72);
  border-radius: 2px;
  font-size: 13px;
  line-height: 1.25;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  opacity: 0;
  transition: opacity 220ms ease, transform 220ms ease;
  pointer-events: none;
}

.gallery-card:hover .gallery-card__tooltip,
.gallery-card:focus-visible .gallery-card__tooltip {
  opacity: 1;
  transform: translate(-50%, 0);
}

.site-footer {
  padding: 22px 0 30px;
  color: var(--footer-text);
  font-size: 14px;
}

.site-footer__inner {
  width: min(1100px, calc(100% - 30px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 15px;
}

.site-footer p {
  margin: 0;
}

.site-footer p:last-child {
  text-align: right;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer a:hover,
.site-footer a:focus-visible {
  text-decoration: underline;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: grid;
  place-items: center;
  padding: 40px 70px 30px;
  color: #ffffff;
  background: rgba(30, 30, 30, 0.62);
  opacity: 0;
  visibility: hidden;
  transition: opacity 180ms ease, visibility 180ms ease;
}

.lightbox.is-open {
  opacity: 1;
  visibility: visible;
}

.lightbox__count {
  position: fixed;
  top: 7px;
  left: 0;
  z-index: 103;
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  line-height: 1;
}

.lightbox__toolbar {
  position: fixed;
  top: 0;
  right: 0;
  z-index: 103;
  display: flex;
  align-items: stretch;
  height: 36px;
  background: rgba(30, 30, 30, 0.72);
}

.lightbox__tool {
  width: 40px;
  height: 36px;
  display: grid;
  place-items: center;
  appearance: none;
  border: 0;
  color: rgba(255, 255, 255, 0.9);
  background: transparent;
  font: 22px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.lightbox__tool:hover,
.lightbox__tool:focus-visible {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

.lightbox__figure {
  position: relative;
  margin: 0;
  max-width: calc(100vw - 180px);
  max-height: calc(100vh - 90px);
  display: flex;
  flex-direction: column;
  align-items: center;
}

.lightbox__image {
  display: block;
  max-width: calc(100vw - 180px);
  max-height: calc(100vh - 125px);
  width: auto;
  height: auto;
  object-fit: contain;
  box-shadow: 0 20px 65px rgba(0, 0, 0, 0.35);
  transform: scale(1);
  transition: transform 220ms ease;
}

.lightbox.is-zoomed .lightbox__image {
  transform: scale(1.28);
  cursor: zoom-out;
}

.lightbox__caption {
  min-height: 32px;
  width: 100%;
  margin-top: 0;
  padding: 11px 16px 12px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.78);
  text-align: center;
  font-size: 14px;
  line-height: 1.35;
}

.lightbox__nav {
  position: fixed;
  top: 50%;
  z-index: 102;
  width: 50px;
  height: 80px;
  transform: translateY(-50%);
  appearance: none;
  border: 0;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(30, 30, 30, 0.5);
  font: 48px/1 Arial, Helvetica, sans-serif;
  cursor: pointer;
}

.lightbox__nav:hover,
.lightbox__nav:focus-visible {
  background: rgba(30, 30, 30, 0.78);
  outline: none;
}

.lightbox__nav--prev {
  left: 0;
}

.lightbox__nav--next {
  right: 0;
}

@media (max-width: 1360px) {
  .gallery-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .gallery-card {
    width: 100%;
    height: auto;
    aspect-ratio: 5 / 7;
  }
}

@media (max-width: 992px) {
  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

}

@media (max-width: 768px) {
  :root {
    --gallery-gap: 15px;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .lightbox {
    padding: 42px 52px 22px;
  }

  .lightbox__figure,
  .lightbox__image {
    max-width: calc(100vw - 118px);
  }

  .lightbox__image {
    max-height: calc(100vh - 122px);
  }

  .lightbox__nav {
    width: 42px;
    height: 70px;
    font-size: 42px;
  }

  .site-footer__inner {
    grid-template-columns: 1fr;
  }

  .site-footer p,
  .site-footer p:last-child {
    text-align: center;
  }
}

@media (max-width: 480px) {
  :root {
    --gallery-gap: 12px;
  }

  .gallery-grid {
    grid-template-columns: 1fr;
  }

  .gallery-card {
    max-width: 250px;
    margin: 0 auto;
  }

  .lightbox {
    padding-left: 0;
    padding-right: 0;
  }

  .lightbox__figure,
  .lightbox__image {
    max-width: 100vw;
  }

  .lightbox__image {
    max-height: calc(100vh - 120px);
  }

  .lightbox__nav {
    top: auto;
    bottom: 50px;
    transform: none;
  }
}
