/* theme/page.css */

/* Page container */

.page {
  max-width: 1120px;
  margin: 0 auto;
  padding: 1.5rem 1rem 2.5rem;
}

/* Hero */

.hero {
  margin: 1.5rem 0 1.25rem;
}

.hero__content {
  background: linear-gradient(135deg, #2563eb, #14b8a6);
  color: #f9fafb;
  border-radius: 1rem;
  padding: 1.75rem 1.5rem;
}

.hero__content h1 {
  margin: 0 0 0.5rem;
  font-size: 1.75rem;
}

.hero__content p {
  margin: 0;
  font-size: 0.95rem;
}

/* Filters */

.filters {
  margin-bottom: 1rem;
  background: #ffffff;
  border-radius: 0.75rem;
  padding: 0.75rem 0.9rem;
  box-shadow: 0 10px 15px -12px rgba(15, 23, 42, 0.18);
}

.filters__row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: flex-end;
}

.filters__field {
  display: flex;
  flex-direction: column;
  flex: 1 1 160px;
  min-width: 0;
}

.filters__field--small {
  max-width: 140px;
}

.filters__field label {
  font-size: 0.75rem;
  color: #6b7280;
  margin-bottom: 0.15rem;
}

.filters__field input,
.filters__field select {
  border-radius: 999px;
  border: 1px solid #d1d5db;
  padding: 0.4rem 0.8rem;
  font-size: 0.85rem;
  outline: none;
  background-color: #f9fafb;
}

.filters__field input:focus,
.filters__field select:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 1px rgba(37, 99, 235, 0.15);
  background-color: #ffffff;
}

.filters__summary {
  margin-left: auto;
  font-size: 0.85rem;
  color: #6b7280;
}

.filters__summary p {
  margin: 0;
}

/* Property list */

.property-list__header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0.75rem;
}

.property-list__header h2 {
  margin: 0;
  font-size: 1.1rem;
}

.property-list__header p {
  margin: 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.property-list__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

@media (min-width: 640px) {
  .property-list__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .property-list__grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

.property-list__load-more {
  margin-top: 1rem;
  text-align: center;
}

/* Property card */

.property-card {
  background: #ffffff;
  border-radius: 0.75rem;
  overflow: hidden;
  box-shadow: 0 10px 15px -10px rgba(15, 23, 42, 0.2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.property-card__link {
  display: block;
}

.property-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 18px 25px -16px rgba(15, 23, 42, 0.3);
}

.property-card__image-wrapper {
  position: relative;
  padding-top: 60%;
  overflow: hidden;
}

.property-card__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.property-card__status {
  position: absolute;
  left: 0.75rem;
  bottom: 0.75rem;
  background: rgba(15, 118, 110, 0.95);
  color: #f9fafb;
  font-size: 0.75rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
}

.property-card__body {
  padding: 0.75rem 0.85rem 0.85rem;
}

.property-card__title {
  margin: 0;
  font-size: 1rem;
}

.property-card__location {
  margin: 0.15rem 0;
  font-size: 0.85rem;
  color: #6b7280;
}

.property-card__price {
  margin: 0.35rem 0;
  font-weight: 600;
  color: #111827;
}

.property-card__description {
  margin: 0 0 0.4rem;
  font-size: 0.85rem;
  color: #4b5563;
}

.property-card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  font-size: 0.8rem;
  color: #6b7280;
}

/* Detail page */

.back-link {
  display: inline-block;
  margin: 1rem 0 0.5rem;
  font-size: 0.85rem;
  color: #2563eb;
}

.detail {
  margin-top: 0.5rem;
}

/* Always stacked: image above description card on all screens */
.detail__layout {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}


@media (min-width: 768px) {
  .detail__layout {
    grid-template-columns: minmax(0, 3fr) minmax(0, 4fr);
  }
}

/* Detail main image: always 16:9, all screen sizes */
.detail__image {
  background: #111827;
  border-radius: 1rem;
  overflow: hidden;
  position: relative;
  aspect-ratio: 16 / 9;
}

.detail__image img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: opacity 0.3s ease;
}

.detail__image img.is-fading {
  opacity: 0;
}


.detail__status {
  position: absolute;
  left: 1rem;
  bottom: 1rem;
  background: rgba(15, 23, 42, 0.9);
  color: #f9fafb;
  font-size: 0.8rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
}

.detail__info {
  background: #ffffff;
  border-radius: 1rem;
  padding: 1.25rem 1.1rem 1.4rem;
  box-shadow: 0 16px 30px -20px rgba(15, 23, 42, 0.3);
}

.detail__title {
  margin: 0;
  font-size: 1.4rem;
}

.detail__location {
  margin: 0.25rem 0 0;
  font-size: 0.9rem;
  color: #6b7280;
}

.detail__price {
  margin: 0.75rem 0 0.5rem;
  font-size: 1.1rem;
  font-weight: 600;
}

.detail__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0.6rem 0 1rem;
  font-size: 0.8rem;
}

.detail__meta div {
  display: flex;
  flex-direction: column;
}

.detail__meta strong {
  font-size: 1rem;
}

.detail__meta span {
  color: #6b7280;
}

.detail__description h2 {
  margin: 0 0 0.35rem;
  font-size: 1rem;
}

.detail__description p {
  margin: 0 0 0.75rem;
  font-size: 0.9rem;
  color: #4b5563;
}

.detail__cta {
  border-top: 1px solid #e5e7eb;
  padding-top: 0.75rem;
  margin-top: 0.75rem;
  font-size: 0.9rem;
}

/* Detail gallery */

.detail-gallery {
  margin: 0.75rem 0;
}

.detail-gallery h2 {
  margin: 0 0 0.35rem;
  font-size: 0.95rem;
}

.detail-gallery__thumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.detail-gallery__thumb {
  border: none;
  padding: 0;
  border-radius: 0.5rem;
  overflow: hidden;
  background: transparent;
  cursor: pointer;
  width: 72px;
  height: 72px;
}

.detail-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}


.detail__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 20;

  background: rgba(0,0,0,0.55);
  color: white;
  border: none;
  width: 42px;
  height: 42px;
  border-radius: 999px;

  display: flex;
  justify-content: center;
  align-items: center;

  cursor: pointer;
  font-size: 24px;
  line-height: 0;
  transition: background 0.2s ease;
}

.detail__arrow:hover {
  background: rgba(0,0,0,0.75);
}

.detail__arrow--left {
  left: 12px;
}

.detail__arrow--right {
  right: 12px;
}

/* Hide arrows if only one image */
.detail__arrow.hidden {
  display: none;
}



.lightbox {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: none;
}

.lightbox.is-open {
  display: block;
}

.lightbox__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
}

.lightbox__content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

#lightbox-image {
  max-width: 90vw;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 0.75rem;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.7);
  transition: opacity 0.3s ease;
  pointer-events: auto;
  background: #000;
}

#lightbox-image.is-fading {
  opacity: 0;
}

.lightbox__close {
  position: absolute;
  top: 16px;
  right: 20px;
  z-index: 10;
  background: transparent;
  border: none;
  color: #f9fafb;
  font-size: 32px;
  cursor: pointer;
  pointer-events: auto;
}

.lightbox__arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  z-index: 10;

  background: rgba(0, 0, 0, 0.7);
  color: white;
  border: none;
  width: 52px;
  height: 52px;
  border-radius: 999px;

  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  pointer-events: auto;
  font-size: 24px;
}

.lightbox__arrow--left {
  left: 24px;
}

.lightbox__arrow--right {
  right: 24px;
}

.lightbox-dots {
  position: absolute;
  bottom: 24px;
  display: flex;
  gap: 8px;
  pointer-events: auto;
}


.detail-dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 21;
}

.detail-dot {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  border: none;
  padding: 0;
  background: rgba(255, 255, 255, 0.4);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, opacity 0.2s ease;
}

.detail-dot.is-active {
  background: #ffffff;
  transform: scale(1.3);
  opacity: 1;
}

.detail-dot:not(.is-active) {
  opacity: 0.7;
}
