/* Portrait examples share the same custom-order detail view. */
.detail-image.portrait-slider {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  justify-content: center;
  gap: 15px;
  width: 100%;
  min-width: 0;
  min-height: 0;
  height: auto;
  padding: 35px 25px 25px;
}

.portrait-slider-stage {
  position: relative;
  flex: none;
  width: 100%;
  height: 400px;
  min-width: 0;
  min-height: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.portrait-slider-stage .portrait-slider-zoom {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
  min-width: 0;
  padding: 0;
  cursor: zoom-in;
}

.portrait-slider-stage #portrait-slide-image {
  display: block;
  width: 100%;
  height: 100%;
  max-width: 100%;
  max-height: 400px;
  object-fit: contain;
  object-position: center;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
}

.portrait-slider-controls {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) 44px;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.portrait-slider-controls > div {
  min-width: 0;
  text-align: center;
}

.portrait-slider-controls .icon-btn {
  width: 44px;
  height: 44px;
  min-width: 44px;
  min-height: 44px;
  padding: 10px;
  border: 1px solid #aeb59d;
  background: #e7e5d7;
  color: var(--olive, #3e4c36);
}

.portrait-slider-controls .icon-btn:hover {
  border-color: var(--olive, #3e4c36);
  background: #dfe4d3;
}

.portrait-slider-prev svg {
  transform: rotate(180deg);
}

#portrait-slide-counter {
  font-size: 8px;
  line-height: 1.5;
  letter-spacing: 1.5px;
  color: #657156;
}

#portrait-slide-caption {
  margin-top: 5px;
  font-family: var(--serif, Georgia, serif);
  font-size: 22px;
  line-height: 1.15;
  color: var(--ink, #30352c);
  overflow-wrap: anywhere;
}

.portrait-slider-thumbnails {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  max-width: 100%;
  min-width: 0;
  padding: 5px 3px 8px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: thin;
  scrollbar-color: #a8b198 transparent;
}

.portrait-slider-thumbnails button {
  display: flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 38px;
  width: 38px;
  height: 48px;
  min-width: 38px;
  padding: 3px;
  border: 1px solid #babdab;
  background: #f4f1e6;
  transition: border-color .18s, background-color .18s;
}

.portrait-slider-thumbnails button:hover {
  border-color: #748361;
}

.portrait-slider-thumbnails button[aria-current="true"] {
  border: 2px solid var(--olive, #3e4c36);
  padding: 2px;
  background: #d9dec9;
  box-shadow: 0 0 0 2px #b9c2a6;
}

.portrait-slider-thumbnails img {
  width: 100%;
  height: 100%;
  max-height: 40px;
  object-fit: contain;
  filter: none;
}

@media (max-width: 800px) and (min-width: 581px) {
  .detail-image.portrait-slider {
    padding: 32px 17px 24px;
    gap: 14px;
  }

  .portrait-slider-stage {
    height: 360px;
  }

  .portrait-slider-stage #portrait-slide-image {
    max-height: 360px;
  }

  .portrait-slider-thumbnails {
    justify-content: flex-start;
  }
}

@media (max-width: 580px) {
  .detail-image.portrait-slider {
    height: auto;
    min-height: 0;
    padding: 34px 19px 20px;
    gap: 13px;
  }

  .portrait-slider-stage {
    height: 290px;
    min-height: 0;
  }

  .portrait-slider-stage #portrait-slide-image {
    max-height: 290px;
  }

  .portrait-slider-controls {
    gap: 9px;
  }

  #portrait-slide-counter {
    font-size: 7px;
    letter-spacing: 1.2px;
  }

  #portrait-slide-caption {
    font-size: 21px;
  }

  .portrait-slider-thumbnails {
    justify-content: flex-start;
    gap: 5px;
    padding-top: 4px;
  }

  .portrait-slider-thumbnails button {
    flex-basis: 34px;
    width: 34px;
    min-width: 34px;
    height: 44px;
  }

  .portrait-slider-thumbnails img {
    max-height: 36px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .portrait-slider-thumbnails button {
    transition: none;
  }
}
