@import url(https://fonts.googleapis.com/css?family=Unica+One);

body {
  margin: 0;
  background: rgb(245, 245, 245);
  color: rgb(17, 34, 51);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
}

/* Page header */
.header {
  font: 100%/1.4 "Unica One", sans-serif;
  text-transform: uppercase;
  font-weight: 400;
  font-size: clamp(20px, 4.5vw, 40px);
  margin: 16px 1.66% 0;
  border-bottom: 2px solid rgb(17, 34, 51);
  padding-bottom: 16px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
}

a:link,
a:visited,
a:hover,
a:active {
  color: rgb(17, 34, 51);
  text-decoration: none;
}

/* Instagram link in the header */
.insta {
  font-size: 0.55em;
  white-space: nowrap;
}

/* Thumbnail grid: 3 columns everywhere, gaps scale with the screen */
.thumbnailgrid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 3.3%;
  padding: 1.66%;
}

.thumb-btn {
  display: block;
  padding: 0;
  border: 0;
  background: rgb(225, 225, 225);
  aspect-ratio: 1 / 1;
  overflow: hidden;
  cursor: pointer;
}

.thumbnail {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s;
}

.thumb-btn:hover .thumbnail,
.thumb-btn:focus-visible .thumbnail {
  opacity: 0.7;
}

.thumb-btn:focus-visible {
  outline: 3px solid rgb(17, 34, 51);
  outline-offset: 3px;
}

@media (max-width: 600px) {
  .thumbnailgrid {
    gap: 4px;
    padding: 4px;
  }
}

/* Full-size photo viewer */
.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 10;
  background-color: rgba(0, 0, 0, 0.92);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 56px 64px 16px;
  box-sizing: border-box;
}

.modal.open {
  display: flex;
}

.modal-content {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  max-height: calc(100dvh - 150px);
  object-fit: contain;
  animation: zoom 0.35s ease-out;
}

#caption {
  width: 100%;
  max-width: 700px;
  text-align: center;
  color: whitesmoke;
  padding: 12px 0 0;
  min-height: 48px;
}

#caption strong {
  display: block;
  font: 22px/1.3 "Unica One", sans-serif;
  text-transform: uppercase;
  font-weight: 400;
}

#caption span {
  display: block;
  font-size: 13px;
  opacity: 0.7;
  margin-top: 2px;
}

@keyframes zoom {
  from { transform: scale(0.85); opacity: 0; }
  to   { transform: scale(1);    opacity: 1; }
}

.close,
.nav-arrow {
  position: absolute;
  background: none;
  border: 0;
  color: whitesmoke;
  cursor: pointer;
  line-height: 1;
  padding: 0;
  transition: color 0.2s;
}

.close {
  top: 8px;
  right: 20px;
  font-size: 56px;
}

.nav-arrow {
  top: 50%;
  transform: translateY(-50%);
  font-size: 64px;
  width: 56px;
  height: 96px;
}

.prev { left: 4px; }
.next { right: 4px; }

.close:hover,
.close:focus-visible,
.nav-arrow:hover,
.nav-arrow:focus-visible {
  color: #bbb;
}

/* Phones: photo uses the full width, arrows sit over it, swipe also works */
@media (max-width: 700px) {
  .modal {
    padding: 56px 0 16px;
  }
  .nav-arrow {
    font-size: 44px;
    width: 44px;
    height: 72px;
    text-shadow: 0 0 6px rgba(0, 0, 0, 0.8);
  }
}

@media (prefers-reduced-motion: reduce) {
  .modal-content { animation: none; }
  .thumbnail { transition: none; }
}
