/*
 * Copyright (c) 2026 Reside Here LLC. All rights reserved.
 * No AI training, fine-tuning, or inclusion in AI/ML training datasets without prior written permission.
 * See LICENSE.txt for terms. Third-party materials retain their own licenses.
 */
.property-gallery {
  position: relative;
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 0.4rem;
  background: var(--cream);
  color: var(--ink);
}

.property-gallery-slides {
  display: grid;
  gap: 1.5rem;
}

.property-gallery[data-gallery-ready='true'] .property-gallery-slides {
  gap: 0;
}

.property-slide {
  min-width: 0;
  margin: 0;
}

.property-slide[hidden],
.property-gallery-controls[hidden] {
  display: none !important;
}

.property-slide > img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: contain;
  object-position: center;
  border-radius: 0.35rem 0.35rem 0 0;
  background: var(--sage);
}

@media (min-width: 901px) {
  .property-slide > img {
    aspect-ratio: auto;
  }
}

.property-slide figcaption {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem 0.75rem;
  padding: 0.375rem 0.75rem;
  background: var(--cream);
  color: var(--ink);
}

.property-slide figcaption strong {
  min-width: 0;
  font-family: var(--serif);
  font-size: 1.125rem;
  font-weight: 400;
  line-height: 1.25;
  letter-spacing: normal;
}

.property-slide figcaption a {
  display: inline-flex;
  align-items: center;
  justify-self: end;
  min-height: 44px;
  max-width: 100%;
  padding-block: 0.35rem;
  color: var(--green);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.6;
  text-decoration: underline;
  text-underline-offset: 0.22em;
  text-decoration-thickness: 1px;
  overflow-wrap: anywhere;
}

.property-slide figcaption a:hover {
  text-decoration-thickness: 2px;
}

.property-gallery-controls {
  position: static;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  grid-template-areas: 'dots';
  align-items: center;
  gap: 0;
  padding: 0;
}

[data-gallery-previous] {
  grid-area: previous;
  left: calc(var(--gallery-image-left, 0px) + 0.65rem);
}

[data-gallery-next] {
  grid-area: next;
  right: calc(var(--gallery-image-right, 0px) + 0.65rem);
}

.gallery-control-label {
  display: none;
}

.property-gallery-controls button {
  position: absolute;
  top: var(--gallery-image-center, 4rem);
  transform: translateY(-50%);
  z-index: 1;
  display: inline-flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 0.65rem;
  min-width: 48px;
  min-height: 48px;
  max-width: 100%;
  padding: 0.65rem;
  border: 1px solid rgb(255 255 255 / 65%);
  border-radius: 50%;
  background: rgb(15 30 22 / 22%);
  color: #fff;
  backdrop-filter: blur(2px);
  font: inherit;
  font-size: 0.9375rem;
  font-weight: 600;
  line-height: 1.5;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.property-gallery-controls button:hover {
  background: rgb(15 30 22 / 65%);
  border-color: #fff;
  color: #fff;
}

.property-gallery-controls button:disabled {
  opacity: 0.55;
  cursor: default;
}

.property-gallery-controls button svg {
  width: 1.25rem;
  height: 1.25rem;
  flex-shrink: 0;
  stroke-width: 2;
  filter: drop-shadow(0 1px 1px #000);
}

.property-gallery-controls [data-gallery-status] {
  grid-area: status;
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  min-width: 0;
  margin: 0;
  color: var(--muted);
  font-size: 0.9375rem;
  line-height: 1.6;
  text-align: center;
}

.gallery-dots {
  position: absolute;
  top: calc(var(--gallery-image-bottom, 10rem) - 12px);
  left: 50%;
  transform: translate(-50%, -100%);
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  width: max-content;
  max-width: calc(100% - 2rem);
  padding: 0.5rem 0.65rem;
  border-radius: 99px;
  background: rgb(15 30 22 / 50%);
  color: #fff;
  pointer-events: none;
}

.gallery-dots [data-gallery-dot] {
  display: block;
  width: 6px;
  height: 6px;
  border: 1px solid currentColor;
  border-radius: 99px;
  color: inherit;
}

.gallery-dots [aria-current='true'] {
  width: 18px;
  border-width: 3px;
}

:root[data-accessibility-enabled='true'] .gallery-control-label {
  display: inline;
}

:root[data-accessibility-enabled='true'] .property-gallery-controls button {
  position: static;
  transform: none;
  border-radius: 0.3rem;
  padding: 0.6rem 0.9rem;
  border-color: var(--forest);
  background: var(--cream);
  color: var(--forest);
  backdrop-filter: none;
}

:root[data-accessibility-enabled='true'] .property-gallery-controls button:hover {
  background: var(--forest);
  color: var(--cream);
}

:root[data-accessibility-enabled='true'] .property-gallery-controls button svg {
  filter: none;
}

:root[data-accessibility-enabled='true'] .property-gallery-controls {
  position: static;
  grid-template-columns: auto minmax(0, 1fr) auto;
  grid-template-areas: 'previous status next';
  gap: 0.5rem 0.75rem;
  padding: 0.5rem 0.75rem;
  border-top: 1px solid var(--line);
}

:root[data-accessibility-enabled='true'] .property-gallery-controls [data-gallery-status] {
  position: static;
  width: auto;
  height: auto;
  overflow: visible;
  clip-path: none;
  white-space: normal;
}

:root:is([data-text-size]:not([data-text-size='100']), [data-text-spacing='true'])
  .property-slide
  figcaption {
  grid-template-columns: minmax(0, 1fr);
  align-items: flex-start;
}

:root:is([data-text-size]:not([data-text-size='100']), [data-text-spacing='true'])
  .property-slide
  figcaption
  a {
  justify-self: start;
}

@media (max-width: 620px) {
  :root[data-accessibility-enabled='true'] .property-gallery-controls {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-template-areas: 'status status' 'previous next';
  }

  :root[data-accessibility-enabled='true'] .property-gallery-controls button {
    gap: 0.4rem;
    padding-inline: 0.5rem;
  }

  :root:is([data-text-size]:not([data-text-size='100']), [data-text-spacing='true'])
    .property-gallery-controls {
    grid-template-columns: minmax(0, 1fr);
    grid-template-areas: 'status' 'previous' 'next';
  }
}

@media (forced-colors: active) {
  .property-gallery,
  .property-gallery-controls {
    border-color: CanvasText;
  }

  .property-gallery-controls button {
    border: 2px solid ButtonText;
    background: ButtonFace;
    color: ButtonText;
    backdrop-filter: none;
  }

  .gallery-dots {
    background: Canvas;
    color: CanvasText;
    border: 1px solid CanvasText;
  }
}

/* Give property photos a prominent frame beside the owner-managed message. */
.direct-hero {
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.25fr);
  gap: 3rem;
}

.direct-hero h1 {
  font-size: clamp(2.5rem, calc(3.6vw * var(--text-scale, 1)), 3.25rem);
}

.direct-hero .hero-visual {
  align-self: center;
  width: 100%;
  max-width: 900px;
  margin-inline: auto;
}

@media (max-width: 1000px) {
  .direct-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 2rem;
  }
}

@media print {
  .property-gallery .property-slide[hidden] {
    display: block !important;
  }

  .property-gallery-controls {
    display: none !important;
  }

  .property-gallery-slides {
    gap: 1rem;
  }

  .property-slide {
    break-inside: avoid;
  }
}
