/* The gallery inherits the site's typography and palette. */
.mstyk-model-gallery {
  display: grid;
  min-width: 0;
  gap: 0;
  --mstyk-gallery-ink: var(--deep-plum, #2a1530);
  --mstyk-gallery-line: var(--line, #e7e4dc);
  --mstyk-gallery-paper: var(--paper, #fbfaf7);
}

.mstyk-gallery-original[hidden],
.mstyk-family-lookbook[hidden],
.mstyk-gallery-disclosure[hidden] {
  display: none !important;
}

.gallery-shop-image.mstyk-gallery-image-frame {
  display: block;
  aspect-ratio: auto;
}

.mstyk-model-lead,
.mstyk-model-thumb,
.mstyk-family-photo {
  display: block;
  padding: 0;
  width: 100%;
  cursor: pointer;
  color: inherit;
  font: inherit;
  background: transparent;
  border: 0;
}

.mstyk-model-lead,
.mstyk-family-photo {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  background: var(--soft, #f7f5ef);
}

.mstyk-model-lead {
  aspect-ratio: 4 / 5;
}

.mstyk-model-gallery .mstyk-model-lead img,
.mstyk-model-gallery .mstyk-model-thumb img,
.mstyk-family-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  margin: 0;
  max-width: none;
  max-height: none;
  border-radius: 0;
}

.mstyk-model-gallery .mstyk-model-lead img {
  aspect-ratio: 4 / 5;
}

.mstyk-model-gallery .mstyk-model-lead img.mstyk-model-fallback {
  object-fit: contain;
}

.mstyk-model-enlarge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 6px 9px;
  color: #fff;
  background: #221527e6;
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .035em;
  line-height: 1.15;
}

.mstyk-model-thumbs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  gap: 5px;
  padding: 8px;
  border-bottom: 1px solid var(--mstyk-gallery-line);
  background: var(--mstyk-gallery-paper);
}

.mstyk-model-thumb {
  display: grid;
  min-width: 0;
  max-width: 90px;
  align-content: start;
  gap: 5px;
  color: var(--mstyk-gallery-ink);
  border: 1px solid transparent;
  padding: 3px 3px 5px;
  text-align: center;
  font-size: .64rem;
  font-weight: 750;
  line-height: 1.14;
}

.mstyk-model-gallery .mstyk-model-thumb img {
  aspect-ratio: 4 / 5;
  height: auto;
  width: min(100%, 48px);
  justify-self: center;
  min-width: 0;
  background: var(--soft, #f7f5ef);
}

.mstyk-model-thumb[aria-pressed="true"] {
  border-color: var(--mstyk-gallery-ink);
  background: #fff;
  box-shadow: inset 0 -2px var(--mstyk-gallery-ink);
}

.mstyk-model-thumb:hover,
.mstyk-model-thumb:focus-visible {
  border-color: var(--mstyk-gallery-ink);
}

.mstyk-model-lead:focus-visible,
.mstyk-family-photo:focus-visible {
  outline: 2px solid var(--deep-plum, #2a1530);
  outline-offset: -4px;
}

.mstyk-model-thumb:focus-visible,
.mstyk-gallery-dialog button:focus-visible {
  outline: 2px solid var(--teal, #087f8c);
  outline-offset: 2px;
}

.mstyk-family-lookbook {
  display: grid;
  gap: clamp(16px, 2.8vw, 32px);
  margin: clamp(40px, 7vw, 88px) 0 0;
  padding: clamp(20px, 4vw, 44px) 0 0;
  border-top: 1px solid var(--line, #e7e4dc);
}

.mstyk-gallery-header h2 {
  margin: 0;
  color: var(--deep-plum, #2a1530);
  font-family: Georgia, 'Times New Roman', serif;
  font-weight: 500;
  line-height: .97;
}

.mstyk-family-photos {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(10px, 1.45vw, 20px);
}

.mstyk-family-photo {
  aspect-ratio: 3 / 2;
  border: 1px solid var(--line, #e7e4dc);
}

.mstyk-family-photo img {
  transition: transform .18s ease;
}

@media (hover: hover) {
  .mstyk-family-photo:hover img {
    transform: scale(1.025);
  }
}

html:has(.mstyk-gallery-dialog[open]) {
  overflow: hidden;
  scroll-behavior: auto;
}

.mstyk-gallery-dialog {
  position: fixed;
  inset: 0;
  margin: auto;
  width: min(780px, calc(100% - 24px));
  max-height: calc(100% - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid var(--line, #e7e4dc);
  border-radius: 12px;
  padding: clamp(12px, 2.5vw, 24px);
  color: var(--ink, #171318);
  background: var(--paper, #fbfaf7);
  box-shadow: 0 20px 100px #170c1bb0;
}

.mstyk-gallery-dialog::backdrop {
  background: #171019dc;
}

.mstyk-gallery-header,
.mstyk-gallery-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}

.mstyk-gallery-header h2 {
  font-size: clamp(1.45rem, 3.4vw, 2.6rem);
}

.mstyk-gallery-header .mstyk-gallery-close {
  margin-inline-start: auto;
}

.mstyk-gallery-stage {
  margin: 12px 0 8px;
}

.mstyk-gallery-stage-media {
  height: min(60vh, 590px);
  height: min(60dvh, 590px);
  display: grid;
  position: relative;
  place-items: center;
  background: #211b23;
}

.mstyk-gallery-stage-media img {
  display: block;
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  min-height: 0;
  object-fit: contain;
}

.mstyk-gallery-caption,
.mstyk-gallery-disclosure {
  color: var(--muted, #67645e);
  font-size: .8rem;
  line-height: 1.4;
}

.mstyk-gallery-caption {
  min-height: 2.2em;
  padding: 7px 2px 0;
}

.mstyk-gallery-disclosure {
  margin: 9px 0 0;
}

.mstyk-gallery-nav,
.mstyk-gallery-close {
  color: var(--deep-plum, #2a1530);
  background: transparent;
  border: 1px solid var(--line, #e7e4dc);
  border-radius: 0;
  padding: 6px 10px;
  min-height: 44px;
  cursor: pointer;
  font: inherit;
  font-size: .82rem;
  font-weight: 750;
  white-space: nowrap;
}

.mstyk-gallery-nav:hover,
.mstyk-gallery-close:hover {
  border-color: currentColor;
}

.mstyk-gallery-count {
  font-size: .8rem;
  font-variant-numeric: tabular-nums;
}

.mstyk-gallery-unavailable {
  display: grid;
  height: 100%;
  margin: 0;
  padding: 1rem;
  place-items: center;
  font-size: .85rem;
}

.mstyk-gallery-stage-media .mstyk-gallery-unavailable {
  color: #fff;
}

@media (max-width: 620px) {
  .mstyk-family-photos {
    grid-template-columns: 1fr;
  }

  .mstyk-model-thumbs {
    gap: 3px;
    padding: 5px;
  }

  .mstyk-model-thumb {
    padding: 2px 1px 4px;
  }

  .mstyk-model-enlarge {
    right: 7px;
    bottom: 7px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mstyk-family-photo img {
    transition: none;
  }
}
