/* Teaching photographs extend the existing musician editorial layout. */
.teaching-gallery,
.lesson-photo-strip {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--group-space, 32px);
  max-width: var(--measure, 1200px);
  margin-inline: auto;
  align-items: start;
}

.lesson-photo-strip {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Two opening photographs introduce the studio before the compact photo grid. */
@media (min-width: 1001px) {
  .teaching-gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
  .teaching-gallery > .teaching-photo {
    grid-column: span 2;
  }
  .teaching-gallery > .teaching-photo:nth-child(-n+2) {
    grid-column: span 3;
  }
}

.teaching-photo {
  min-width: 0;
  margin: 0;
}

.teaching-photo-link {
  display: block;
  color: var(--ink, #111111);
}

.teaching-photo-link:hover {
  opacity: .88;
}

.teaching-gallery .teaching-photo img,
.lesson-photo-strip .teaching-photo img,
.split .teaching-home-photo img {
  display: block;
  width: 100%;
  height: auto;
  max-height: none;
  margin: 0;
  object-fit: contain;
}

.teaching-photo figcaption,
.teaching-home-photo figcaption {
  margin-top: 12px;
  color: var(--muted, #595959);
  font-size: 13px;
  line-height: 1.6;
}

.teaching-gallery-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: 24px;
  font-size: 14px;
  font-weight: 500;
}

body.teaching-lightbox-open {
  overflow: hidden;
}

.teaching-lightbox {
  --focus: #f7f5ef;
  width: min(1200px, calc(100% - 48px));
  max-width: none;
  height: min(920px, calc(100vh - 48px));
  height: min(920px, calc(100dvh - 48px));
  max-height: none;
  padding: 24px;
  margin: auto;
  border: 1px solid #595959;
  border-radius: 0;
  background: #111111;
  color: #f7f5ef;
  color-scheme: dark;
  overflow: auto;
  scrollbar-color: #858585 #111111;
}

.teaching-lightbox[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  gap: 20px;
}

.teaching-lightbox::backdrop {
  background: rgba(0, 0, 0, .84);
}

.teaching-lightbox__header,
.teaching-lightbox__navigation {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.teaching-lightbox__title {
  margin: 0;
  font-family: var(--display, Georgia, serif);
  font-size: 30px;
  line-height: 1.1;
}

.teaching-lightbox__button {
  min-height: 44px;
  padding: 10px 16px;
  border: 1px solid #858585;
  border-radius: 2px;
  background: transparent;
  color: #f7f5ef;
  font: 500 14px/1.5 var(--body, sans-serif);
}

.teaching-lightbox__button:hover {
  border-color: #f7f5ef;
  background: #333333;
}

.teaching-lightbox__button:focus-visible,
.teaching-lightbox a:focus-visible {
  outline: 2px solid #f7f5ef;
  outline-offset: 4px;
}

.teaching-lightbox__figure {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  gap: 12px;
  min-width: 0;
  min-height: 0;
  margin: 0;
}

.teaching-lightbox__media {
  display: grid;
  min-width: 0;
  min-height: 0;
  place-items: center;
}

.teaching-lightbox__image,
.teaching-lightbox__status {
  grid-area: 1 / 1;
}

.teaching-lightbox__image {
  display: block;
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  object-fit: contain;
}

.teaching-lightbox__status {
  max-width: 36ch;
  padding: 24px;
  margin: 0;
  color: #f7f5ef;
  text-align: center;
  font-size: 15px;
}

.teaching-lightbox__status a,
.teaching-lightbox__status a:hover {
  color: #f7f5ef;
}

.teaching-lightbox__caption {
  color: #cccccc;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
}

.teaching-lightbox__counter {
  margin: 0;
  color: #cccccc;
  font-size: 13px;
  font-variant-numeric: tabular-nums;
  text-align: center;
}

@media (max-width: 1000px) {
  .teaching-gallery {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 760px) {
  .lesson-photo-strip {
    grid-template-columns: minmax(0, 1fr);
  }

  .teaching-lightbox {
    width: calc(100% - 24px);
    height: calc(100vh - 24px);
    height: calc(100dvh - 24px);
    padding: 16px;
  }

  .teaching-lightbox[open] {
    gap: 16px;
  }

  .teaching-lightbox__title {
    font-size: 26px;
  }

  .teaching-lightbox__button {
    padding-inline: 12px;
  }

  .teaching-lightbox__navigation {
    gap: 8px;
  }
}

@media (max-width: 540px) {
  .teaching-gallery {
    grid-template-columns: minmax(0, 1fr);
  }
}
