/* Portfolio heading: three separate reading zones, with no text overlap. */
.portfolio-head {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 520px) !important;
  grid-template-rows: auto auto !important;
  column-gap: clamp(50px, 7vw, 130px) !important;
  row-gap: clamp(38px, 5vw, 76px) !important;
  align-items: start !important;
  overflow: visible !important;
  padding-top: clamp(64px, 8vw, 120px) !important;
  padding-bottom: clamp(82px, 10vw, 150px) !important;
}

.portfolio-head .section-kicker {
  grid-column: 1 / -1 !important;
  grid-row: 1 !important;
  position: static !important;
  width: auto !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
  transform: none !important;
  align-self: start !important;
}

.portfolio-head h2 {
  grid-column: 1 !important;
  grid-row: 2 !important;
  position: static !important;
  width: min(100%, 820px) !important;
  max-width: 820px !important;
  margin: 0 !important;
  padding: 0 0 0 clamp(0px, 2vw, 34px) !important;
  transform: none !important;
  font-size: clamp(62px, 6vw, 110px) !important;
  line-height: .88 !important;
  letter-spacing: -.035em !important;
  white-space: nowrap !important;
}

.portfolio-head > p:last-child {
  grid-column: 2 !important;
  grid-row: 2 !important;
  position: static !important;
  align-self: end !important;
  width: 100% !important;
  max-width: 520px !important;
  margin: clamp(58px, 7vw, 108px) 0 0 !important;
  padding: 26px 30px !important;
  transform: none !important;
}

.portfolio-zoomable {
  cursor: zoom-in !important;
}

.portfolio-zoomable:focus-visible {
  outline: 3px solid #340910;
  outline-offset: 4px;
}

.image-viewer {
  width: 100vw;
  max-width: none;
  height: 100vh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(15, 19, 23, .97);
  color: #f3eee4;
  overflow: hidden;
}

.image-viewer::backdrop {
  background: rgba(15, 19, 23, .92);
}

.image-viewer__stage {
  position: relative;
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr) 68px;
  align-items: center;
  width: 100%;
  height: 100%;
  padding: 38px;
}

.image-viewer figure {
  display: flex;
  min-width: 0;
  height: 100%;
  margin: 0;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 15px;
}

.image-viewer figure img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: calc(100vh - 118px);
  object-fit: contain;
  box-shadow: 0 18px 70px rgba(0, 0, 0, .34);
}

.image-viewer figcaption {
  min-height: 16px;
  font-size: 10px;
  line-height: 1.4;
  letter-spacing: .12em;
  text-align: center;
  text-transform: uppercase;
  opacity: .72;
}

.image-viewer button {
  border: 1px solid rgba(243, 238, 228, .4);
  background: rgba(25, 44, 59, .45);
  color: #f3eee4;
  cursor: pointer;
}

.image-viewer button:hover,
.image-viewer button:focus-visible {
  border-color: #f3eee4;
  background: #f3eee4;
  color: #192c3b;
  outline: none;
}

.image-viewer__close {
  position: absolute;
  z-index: 2;
  top: 22px;
  right: 24px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 30px;
  line-height: 1;
}

.image-viewer__nav {
  width: 48px;
  height: 48px;
  justify-self: center;
  border-radius: 50%;
  font-size: 22px;
}

@media (max-width: 900px) {
  .portfolio-head {
    grid-template-columns: 1fr !important;
    grid-template-rows: auto auto auto !important;
    row-gap: 30px !important;
  }

  .portfolio-head .section-kicker,
  .portfolio-head h2,
  .portfolio-head > p:last-child {
    grid-column: 1 !important;
    grid-row: auto !important;
  }

  .portfolio-head h2 {
    padding-left: 0 !important;
    font-size: clamp(50px, 10.5vw, 84px) !important;
  }

  .portfolio-head > p:last-child {
    margin-top: 12px !important;
    justify-self: start !important;
  }
}

@media (max-width: 620px) {
  .portfolio-head h2 {
    font-size: clamp(41px, 12.5vw, 62px) !important;
    white-space: normal !important;
  }

  .image-viewer__stage {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    padding: 64px 8px 24px;
  }

  .image-viewer__nav {
    width: 38px;
    height: 38px;
  }

  .image-viewer__close {
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
  }

  .image-viewer figure img {
    max-height: calc(100vh - 130px);
  }
}

@media (prefers-reduced-motion: reduce) {
  .image-viewer *,
  .portfolio-zoomable {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
