/* AL HASM V8.1 — Detail gallery layout fix.
   The illustrative media notice is now OUTSIDE the flex row and cannot steal photo width.
   Loaded on property detail pages only, after the existing theme styles. */

.detail-top-grid { align-items: start; }
.detail-top-grid > .v81-gallery-column { min-width: 0; width: 100%; align-self: start; }
.v81-gallery-column .detail-gallery {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  width: 100%;
  height: clamp(410px, 44vw, 660px);
  min-height: 0;
  max-height: none;
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #240e1e;
}
.v81-gallery-column .detail-main-photo {
  position: relative;
  display: block;
  flex: 1 1 0;
  min-width: 0;
  width: auto;
  height: 100%;
  overflow: hidden;
  border-radius: 0;
}
.v81-gallery-column .detail-main-photo > img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  object-position: center;
}
.v81-gallery-column .detail-thumbs {
  box-sizing: border-box;
  display: flex;
  flex: 0 0 104px;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  width: 104px;
  min-width: 104px;
  height: 100%;
  max-height: 100%;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  overscroll-behavior: contain;
  padding: 9px;
  background: #260e1c;
  scrollbar-width: thin;
  scrollbar-color: #90647a #260e1c;
}
.v81-gallery-column .detail-thumbs .thumb {
  display: block;
  flex: 0 0 auto;
  width: 100%;
  height: 75px;
  min-height: 75px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: 9px;
  overflow: hidden;
  background: #3d2534;
}
.v81-gallery-column .detail-thumbs .thumb.selected { border-color: #d6aa67; }
.v81-gallery-column .detail-thumbs .thumb:focus-visible,
.v81-gallery-column .gallery-arrow:focus-visible,
.v81-gallery-column .gallery-toggles a:focus-visible,
.v81-gallery-column .gallery-toggles button:focus-visible {
  outline: 2px solid #f5d39b;
  outline-offset: 2px;
}
.v81-gallery-column .detail-thumbs .thumb img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
}
.v81-gallery-column .v4-gallery-disclaimer {
  box-sizing: border-box;
  display: block;
  position: static;
  width: 100%;
  margin: 12px 0 0;
  padding: 12px 15px;
  border: 1px solid #ece0d9;
  border-radius: 10px;
  background: #faf4f0;
  color: #66515c;
  font-size: 12px;
  line-height: 1.65;
}
.v81-gallery-column .gallery-toggles {
  z-index: 3;
  inset-inline-start: 14px;
  inset-inline-end: auto;
  top: 14px;
  max-width: calc(100% - 28px);
  flex-wrap: wrap;
}
.v81-gallery-column .gallery-arrow,
.v81-gallery-column .gallery-count { z-index: 2; }
/* Many media buttons were overflowing the right-side info card. */
.detail-price-panel .panel-topline {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.detail-price-panel .panel-topline > * { max-width: 100%; }
.detail-price-panel .detail-fav { margin-inline-start: auto; margin-left: 0; }
@media (max-width: 1024px) {
  .v81-gallery-column .detail-gallery { height: clamp(385px, 55vw, 570px); }
}
@media (max-width: 640px) {
  .v81-gallery-column .detail-gallery {
    display: flex;
    flex-direction: column;
    height: auto;
    min-height: 0;
    border-radius: 13px;
  }
  .v81-gallery-column .detail-main-photo {
    flex: 0 0 auto;
    width: 100%;
    min-width: 0;
    height: clamp(270px, 72vw, 410px);
  }
  .v81-gallery-column .detail-thumbs {
    flex: 0 0 auto;
    flex-direction: row;
    width: 100%;
    min-width: 0;
    max-width: 100%;
    height: 86px;
    max-height: 86px;
    padding: 8px;
    gap: 7px;
    overflow-x: auto;
    overflow-y: hidden;
  }
  .v81-gallery-column .detail-thumbs .thumb {
    flex: 0 0 80px;
    width: 80px;
    height: 68px;
    min-height: 68px;
  }
  .v81-gallery-column .gallery-toggles {
    top: 10px;
    inset-inline-start: 10px;
    max-width: calc(100% - 20px);
    gap: 4px;
    padding: 3px;
  }
  .v81-gallery-column .gallery-toggles button,
  .v81-gallery-column .gallery-toggles a { font-size: 10px; padding: 6px 9px; }
  .v81-gallery-column .gallery-arrow { top: 58%; }
  .v81-gallery-column .v4-gallery-disclaimer { font-size: 11px; padding: 10px 12px; }
  .detail-price-panel .detail-fav { margin-inline-start: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .v81-gallery-column .detail-main-photo > img { transition: none !important; transform: none !important; }
}
