/* Lockwood Property Management — public listings pages
   Builds on design tokens from style.css. Classes below match the markup
   produced by functions/listings/index.js and functions/listings/[slug].js. */

/* ============ LISTINGS INDEX GRID ============ */
.listings-index { padding-bottom: 3rem; }
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
  margin-top: 1rem;
}

.listing-card {
  position: relative;
  background: #fff;
  border: 1px solid rgba(26,43,74,0.08);
  border-radius: 4px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(15,28,53,0.06);
  transition: transform 0.2s, box-shadow 0.2s;
  display: flex;
  flex-direction: column;
  text-decoration: none;
  color: var(--text);
}
.listing-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 6px 18px rgba(15,28,53,0.12);
}

.listing-photo {
  aspect-ratio: 4 / 3;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  background-color: #e8e4dc;
  position: relative;
}
.listing-photo-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  background-image: linear-gradient(135deg, #d8d3c5 0%, #e8e4dc 100%);
  color: rgba(26,43,74,0.55);
  font-family: var(--sans);
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.listing-photo-empty span { font-weight: 600; }

.listing-badge {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  font-family: var(--sans);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.35rem 0.7rem;
  border-radius: 2px;
  z-index: 2;
}
.listing-badge-available {
  background: var(--gold);
  color: var(--navy4);
}
.listing-badge-pending {
  background: var(--navy);
  color: var(--cream);
}
.listing-badge-leased {
  background: #6b6f7a;
  color: #fff;
}

.listing-card-body {
  padding: 1.1rem 1.2rem 1.3rem;
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  flex: 1;
}
.listing-rent {
  font-family: var(--serif);
  color: var(--navy);
  font-size: 1.5rem;
  font-weight: 700;
  line-height: 1.2;
}
.listing-rent .per-mo {
  font-size: 0.8rem;
  font-weight: 400;
  color: var(--muted);
  letter-spacing: 0.02em;
}
.listing-address {
  font-family: var(--body);
  font-size: 1.1rem;
  font-weight: 500;
  color: var(--text);
  line-height: 1.3;
}
.listing-city {
  font-family: var(--sans);
  color: var(--muted);
  font-size: 0.85rem;
}
.listing-specs {
  margin-top: 0.35rem;
  font-family: var(--sans);
  color: var(--navy2);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.02em;
}
.listing-avail {
  font-family: var(--sans);
  color: var(--gold3);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin-top: 0.3rem;
}

/* ============ EMPTY STATE ============ */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  background: #fff;
  border: 1px solid rgba(26,43,74,0.08);
  border-radius: 4px;
  max-width: 680px;
  margin: 1rem auto;
}
.empty-state p {
  font-family: var(--body);
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 0.8rem;
}
.empty-state p:last-child { margin-bottom: 0; }
.empty-state a { color: var(--gold3); font-weight: 700; }

/* ============ DETAIL PAGE ============ */
.listing-detail { padding-bottom: 3rem; }

.listing-hero h1 {
  text-transform: none;
  font-size: clamp(1.6rem, 3.5vw, 2.2rem);
  letter-spacing: 0.02em;
}

.listing-status-row {
  display: flex;
  gap: 0.6rem;
  margin-bottom: 1.2rem;
}
.listing-status-row .listing-badge {
  position: static;
  top: auto;
  left: auto;
}

.listing-gallery {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  grid-template-rows: 230px 230px;
  gap: 0.5rem;
  margin-bottom: 2rem;
}
.listing-gallery img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: 4px;
  background: #e8e4dc;
}
.listing-gallery img:first-child {
  grid-row: span 2;
}
.listing-gallery img:nth-child(n+6) {
  display: none;
}
.listing-gallery-empty {
  grid-column: span 3;
  grid-row: span 2;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #e8e4dc;
  border-radius: 4px;
  padding: 3rem;
  text-align: center;
}
.listing-gallery-empty p {
  font-family: var(--sans);
  color: var(--muted);
  letter-spacing: 0.04em;
}

.listing-specs-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 1rem 1.5rem;
  background: #fff;
  border: 1px solid rgba(26,43,74,0.08);
  border-radius: 4px;
  padding: 1.4rem 1.6rem;
  margin-bottom: 2rem;
}
.listing-specs-grid .spec {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.listing-specs-grid .spec-label {
  font-family: var(--sans);
  font-size: 0.72rem;
  color: var(--muted);
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.listing-specs-grid .spec-value {
  font-family: var(--body);
  color: var(--navy);
  font-size: 1.05rem;
  font-weight: 500;
}

.listing-description {
  background: #fff;
  border: 1px solid rgba(26,43,74,0.08);
  border-radius: 4px;
  padding: 1.5rem 1.8rem;
  margin-bottom: 2rem;
}
.listing-description p {
  font-family: var(--body);
  font-size: 1.05rem;
  color: var(--text);
  margin-bottom: 0.9rem;
  line-height: 1.75;
}
.listing-description p:last-child { margin-bottom: 0; }

/* ============ RELATED LINKS STRIP ============ */
.related {
  max-width: 1000px;
  margin: 2rem auto;
  padding: 1.5rem 1.6rem;
  text-align: center;
}
.related h3 {
  font-family: var(--serif);
  color: var(--navy);
  font-size: 1rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.related-grid {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
}
.related-grid a {
  font-family: var(--sans);
  color: var(--navy);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.55rem 1rem;
  border: 1px solid rgba(26,43,74,0.2);
  border-radius: 2px;
  background: #fff;
}
.related-grid a:hover {
  background: var(--navy);
  color: var(--cream);
  border-color: var(--navy);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 700px) {
  .listings-grid { grid-template-columns: 1fr; }
  .listing-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    gap: 0.4rem;
  }
  .listing-gallery img:first-child { grid-row: auto; }
  .listing-gallery img { height: 240px; }
  .listing-gallery-empty { grid-column: auto; grid-row: auto; }
}
