/* ============================================================
   PAGES/PROPERTY.CSS - Single property detail page styles
   ============================================================ */

/* ── Hero price and meta ── */

.prop-price {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 700;
  color: var(--color-accent);
  line-height: 1.1;
  margin-bottom: 0.75rem;
}

.prop-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  margin-top: 0.25rem;
}

.prop-status-badge {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  padding: 0.35rem 0.875rem;
  border-radius: var(--radius-sm);
  background: var(--color-accent);
  color: var(--color-primary);
}

.prop-status-badge--active {
  background: var(--color-accent);
  color: var(--color-primary);
}

.prop-status-badge--sold,
.prop-status-badge--closed {
  background: #64748b;
  color: var(--color-white);
}

.prop-status-badge--pending,
.prop-status-badge--under-contract {
  background: #0ea5e9;
  color: var(--color-white);
}

.prop-mls-pill {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  color: rgba(255, 255, 255, 0.7);
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: var(--radius-sm);
  padding: 0.3rem 0.75rem;
  letter-spacing: 0.04em;
}


/* ── Gallery ── */

.prop-gallery {
  margin-bottom: 2.5rem;
}

.prop-gallery__main {
  width: 100%;
  max-height: 560px;
  overflow: hidden;
  border-radius: var(--radius-md);
  background: #0a0f1a;
  border: 1px solid var(--color-border);
  position: relative;
}

/* Button wrapper that makes the whole main photo clickable */
.prop-gallery__open-lightbox {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
  cursor: zoom-in;
  position: relative;
}

.prop-gallery__open-lightbox img {
  width: 100%;
  max-height: 560px;
  object-fit: contain;
  display: block;
  border-radius: var(--radius-md);
  transition: opacity 0.2s ease;
}

/* "View Photos" hint that appears on hover */
.prop-gallery__zoom-hint {
  position: absolute;
  bottom: 0.875rem;
  right: 0.875rem;
  background: rgba(10, 39, 73, 0.82);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

.prop-gallery__open-lightbox:hover .prop-gallery__zoom-hint,
.prop-gallery__open-lightbox:focus-visible .prop-gallery__zoom-hint {
  opacity: 1;
}

.prop-gallery__main--empty {
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-text-muted);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.prop-gallery__thumbs {
  display: flex;
  flex-direction: row;
  gap: 0.5rem;
  overflow-x: auto;
  margin-top: 0.75rem;
  padding-bottom: 0.25rem;
  scrollbar-width: thin;
  scrollbar-color: var(--color-border) transparent;
}

.prop-gallery__thumbs::-webkit-scrollbar {
  height: 4px;
}

.prop-gallery__thumbs::-webkit-scrollbar-track {
  background: transparent;
}

.prop-gallery__thumbs::-webkit-scrollbar-thumb {
  background: var(--color-border);
  border-radius: 2px;
}

.prop-gallery__thumb {
  flex-shrink: 0;
  width: 80px;
  height: 60px;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-bg-slate);
  transition: border-color var(--transition), opacity var(--transition);
  outline: none;
}

.prop-gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.prop-gallery__thumb:hover {
  border-color: var(--color-accent);
  opacity: 0.9;
}

.prop-gallery__thumb.is-active {
  border-color: var(--color-accent);
}

.prop-gallery__thumb:focus-visible {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(10, 39, 73, 0.2);
}

.prop-gallery__count {
  margin-top: 0.5rem;
  font-size: 0.8rem;
  color: var(--color-text-muted);
  font-weight: 500;
}


/* ── Specs bar ── */

.prop-specs-bar {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--color-white);
}

.prop-spec-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.25rem 1rem;
  text-align: center;
  border-right: 1px solid var(--color-border);
  gap: 0.35rem;
}

.prop-spec-item:last-child {
  border-right: none;
}

.prop-spec-item__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.prop-spec-item__value {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-primary);
}


/* ── Gated section ── */

#gatedSection {
  position: relative;
  overflow: hidden;
}

/* Gated content is always in the DOM so the section has real height.
   Section headings stay sharp; only the actual content is blurred. */
.prop-gated-content {
  /* no blur on the container itself */
}

#gatedSection:not(.is-unlocked) .prop-gated-content {
  user-select: none;
  pointer-events: none;
}

/* Blur only the content, not the headings */
#gatedSection:not(.is-unlocked) #propDescription,
#gatedSection:not(.is-unlocked) #propDetailsGrid,
#gatedSection:not(.is-unlocked) #propAgent,
#gatedSection:not(.is-unlocked) .realtor-badge {
  filter: blur(4px);
  opacity: 0.6;
  transition: filter 0.5s ease, opacity 0.5s ease;
}

/* Smooth reveal on unlock */
#gatedSection.is-unlocked #propDescription,
#gatedSection.is-unlocked #propDetailsGrid,
#gatedSection.is-unlocked #propAgent,
#gatedSection.is-unlocked .realtor-badge {
  filter: none;
  opacity: 1;
}

/* Gate overlay — covers the full section, sits above blurred content */
.prop-gate {
  position: absolute;
  inset: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 3rem 1.5rem;
  background: rgba(244, 245, 247, 0.72);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
}

/* The actual card inside the overlay */
.prop-gate__inner {
  max-width: 500px;
  width: 100%;
  background: var(--color-white);
  border-radius: var(--radius-lg);
  border: 1px solid var(--color-border);
  box-shadow: var(--shadow-xl);
  padding: 2.75rem 2.5rem;
  text-align: center;
}

.prop-gate__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0 auto 1.5rem;
  background: rgba(10, 39, 73, 0.06);
  border-radius: 50%;
  color: var(--color-primary);
}

.prop-gate__title {
  font-family: var(--font-body);
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.prop-gate__desc {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  line-height: 1.7;
  margin-bottom: 2rem;
}

.prop-gate__form {
  text-align: left;
}

.prop-gate__field-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-text);
  margin-bottom: 0.5rem;
}

.prop-gate__required {
  color: var(--color-accent);
}

.prop-gate__optional {
  font-weight: 400;
  font-size: 0.7rem;
  color: var(--color-text-muted);
  letter-spacing: 0;
  text-transform: none;
}

.prop-gate__error {
  font-size: 0.8rem;
  color: #dc2626;
  margin-bottom: 1rem;
  min-height: 1.2em;
}

.prop-gate__submit {
  width: 100%;
  justify-content: center;
}

/* Hide overlay when unlocked */
#gatedSection.is-unlocked .prop-gate {
  display: none;
}


/* ── Gated content sections ── */

.prop-section {
  margin-bottom: 3rem;
}

.prop-section:last-of-type {
  margin-bottom: 0;
}

.prop-section__title {
  font-family: var(--font-subheading);
  font-size: 1.25rem;
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.25rem;
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--color-border);
}


/* ── Property description ── */

.prop-description {
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--color-text);
  max-width: 76ch;
}


/* ── Details grid ── */

.prop-details-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  overflow: hidden;
}

.prop-detail-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  padding: 1rem 1.25rem;
  border-right: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  background: var(--color-white);
}

.prop-detail-item:nth-child(even) {
  border-right: none;
}

.prop-detail-item:nth-last-child(-n+2) {
  border-bottom: none;
}

.prop-detail-item__label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-text-muted);
}

.prop-detail-item__value {
  font-size: 0.9rem;
  font-weight: 600;
  color: var(--color-text);
}


/* ── Agent card ── */

.prop-agent {
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 1.75rem 2rem;
  background: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  flex-wrap: wrap;
}

.prop-agent__info {
  flex: 1;
  min-width: 200px;
}

.prop-agent__icon {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(10, 39, 73, 0.06);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-primary);
  margin-bottom: 0.75rem;
}

.prop-agent__name {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.2rem;
}

.prop-agent__blurb {
  font-size: 0.875rem;
  color: var(--color-text-muted, #6b7280);
  margin-bottom: 0.5rem;
  line-height: 1.6;
}

.prop-agent__role {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: 0.875rem;
}

.prop-agent__contacts {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.prop-agent__contact-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.875rem;
  color: var(--color-text-muted);
  transition: color var(--transition);
  text-decoration: none;
}

.prop-agent__contact-link:hover {
  color: var(--color-primary);
}

.prop-agent__contact-link svg {
  stroke: var(--color-primary);
  flex-shrink: 0;
}

.prop-agent__btn {
  flex-shrink: 0;
}


/* ── REALTOR badge ── */

.realtor-badge {
  margin-top: 2.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.75rem;
}

.realtor-badge__link {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
}

.realtor-badge__link:hover {
  color: var(--color-accent);
}

.realtor-badge__icon {
  stroke: currentColor;
  flex-shrink: 0;
}

.realtor-badge__note {
  font-size: 0.75rem;
  color: var(--color-text-muted);
  line-height: 1.5;
}


/* ── Error state ── */

.prop-error {
  max-width: 480px;
  margin: 0 auto;
  padding: 4rem 2rem;
  text-align: center;
  color: var(--color-text-muted);
}

.prop-error svg {
  stroke: var(--color-text-muted);
  margin-bottom: 1.25rem;
  opacity: 0.6;
}

.prop-error__title {
  font-family: var(--font-subheading);
  font-size: 1.375rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.875rem;
}

.prop-error__message {
  font-size: 0.9rem;
  line-height: 1.7;
  margin-bottom: 2rem;
}


/* ── CTA section centered variant ── */

.cta-section__centered {
  text-align: center;
  position: relative;
  z-index: 1;
}

.cta-section__actions--center {
  justify-content: center;
}


/* ── Responsive ── */

@media (max-width: 1024px) {
  .prop-specs-bar {
    grid-template-columns: repeat(3, 1fr);
  }

  .prop-spec-item:nth-child(3) {
    border-right: none;
  }

  .prop-spec-item:nth-child(4) {
    border-top: 1px solid var(--color-border);
  }
}

@media (max-width: 768px) {
  .prop-gallery__main {
    max-height: 320px;
  }

  .prop-gallery__main img {
    max-height: 320px;
  }

  .prop-specs-bar {
    grid-template-columns: repeat(2, 1fr);
  }

  .prop-spec-item:nth-child(odd) {
    border-right: 1px solid var(--color-border);
  }

  .prop-spec-item:nth-child(even) {
    border-right: none;
  }

  .prop-spec-item:nth-child(n+3) {
    border-top: 1px solid var(--color-border);
  }

  .prop-gate__inner {
    padding: 2rem 1.5rem;
  }

  .prop-agent {
    flex-direction: column;
    align-items: flex-start;
    gap: 1.25rem;
  }

  .prop-agent__btn {
    width: 100%;
    justify-content: center;
  }

  .prop-details-grid {
    grid-template-columns: 1fr;
  }

  .prop-detail-item {
    border-right: none;
  }

  .prop-detail-item:nth-last-child(-n+2) {
    border-bottom: 1px solid var(--color-border);
  }

  .prop-detail-item:last-child {
    border-bottom: none;
  }
}

@media (max-width: 480px) {
  .prop-specs-bar {
    grid-template-columns: 1fr;
  }

  .prop-spec-item {
    border-right: none;
    border-bottom: 1px solid var(--color-border);
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
    padding: 0.875rem 1rem;
  }

  .prop-spec-item:last-child {
    border-bottom: none;
  }

  .prop-gallery__thumbs {
    gap: 0.375rem;
  }

  .prop-gallery__thumb {
    width: 64px;
    height: 48px;
  }

  .prop-gate__inner {
    padding: 1.75rem 1.25rem;
  }

  .prop-gate__title {
    font-size: 1.25rem;
  }

  .realtor-badge {
    flex-direction: column;
    align-items: flex-start;
  }
}


/* ── CTA overrides for property page ── */

.prop-contact-section {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.prop-contact-section__title {
  font-family: var(--font-subheading);
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  font-weight: 700;
  color: var(--color-primary);
  margin-bottom: 1.75rem;
}

/* Override the prop-agent flex so it centers in this context */
.prop-contact-section .prop-agent {
  justify-content: center;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 1rem;
}

.prop-contact-section .prop-agent__info {
  align-items: center;
  text-align: center;
}

.prop-contact-section .prop-agent__blurb {
  max-width: 420px;
  margin: 0 auto 0.5rem;
}


/* ── Lightbox ── */

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9000;
  background: rgba(5, 10, 20, 0.96);
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox__stage {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: calc(100vw - 160px);
  max-height: 100vh;
  padding: 2.5rem 0;
}

.lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 5rem);
  object-fit: contain;
  border-radius: var(--radius-sm);
  display: block;
  user-select: none;
}

/* Arrow buttons */
.lightbox__arrow {
  flex-shrink: 0;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  margin: 0 0.75rem;
  transition: background 0.18s, border-color 0.18s;
}

.lightbox__arrow:hover:not(:disabled) {
  background: rgba(202, 164, 93, 0.25);
  border-color: var(--color-accent);
}

.lightbox__arrow:disabled {
  opacity: 0.2;
  cursor: default;
}

/* Close button */
.lightbox__close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 44px;
  height: 44px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: background 0.18s;
  z-index: 1;
}

.lightbox__close:hover {
  background: rgba(255, 255, 255, 0.22);
}

/* Counter */
.lightbox__counter {
  position: absolute;
  bottom: 1.25rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.65);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  pointer-events: none;
}

@media (max-width: 600px) {
  .lightbox__stage {
    max-width: calc(100vw - 80px);
  }

  .lightbox__arrow {
    width: 38px;
    height: 38px;
    margin: 0 0.25rem;
  }
}
