/* =============================================
   Stay SF - Editorial Style Design
   A fresh, magazine-inspired layout
   ============================================= */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --black: #1a1a1a;
  --white: #fefefe;
  --cream: #f7f5f0;
  --gray: #6b6b6b;
  --light-gray: #e5e5e5;
  --accent: #2d5a27;
  --accent-light: #4a7c43;
  --highlight: #e8f0e6;
  --font-serif: 'Instrument Serif', Georgia, serif;
  --font-sans: 'Outfit', -apple-system, sans-serif;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-sans);
  background: var(--cream);
  color: var(--black);
  line-height: 1.5;
}

/* =============================================
   Top Bar
   ============================================= */

.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 2rem;
  background: var(--white);
  border-bottom: 1px solid var(--light-gray);
}

.logo {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  text-decoration: none;
  color: var(--black);
}

.logo span {
  color: var(--accent);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.date-display {
  font-size: 0.85rem;
  color: var(--gray);
}

.saved-btn {
  padding: 0.5rem 1rem;
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
  transition: background 0.2s;
}

.saved-btn:hover {
  background: var(--accent);
}

.saved-btn span {
  display: inline-block;
  margin-left: 0.25rem;
  padding: 0.1rem 0.4rem;
  background: var(--white);
  color: var(--black);
  border-radius: 2px;
  font-size: 0.75rem;
}

/* =============================================
   Hero Section - Editorial Layout
   ============================================= */

.hero {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  padding: 4rem 2rem;
  max-width: 1400px;
  margin: 0 auto;
}

.hero-left {
  padding-top: 2rem;
}

.tagline {
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: var(--gray);
  margin-bottom: 0.5rem;
}

.hero h1 {
  font-family: var(--font-serif);
  font-size: clamp(4rem, 10vw, 8rem);
  font-weight: 400;
  line-height: 0.9;
  margin-bottom: 1.5rem;
}

.hero-desc {
  font-size: 1.1rem;
  color: var(--gray);
  max-width: 400px;
  line-height: 1.7;
}

.hero-right {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.search-wrapper {
  margin-bottom: 1.5rem;
}

.search-wrapper input {
  width: 100%;
  padding: 1.25rem 1.5rem;
  font-size: 1rem;
  font-family: var(--font-sans);
  border: 2px solid var(--black);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s;
}

.search-wrapper input:focus {
  border-color: var(--accent);
}

.search-wrapper input::placeholder {
  color: var(--gray);
}

.quick-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-chip {
  padding: 0.6rem 1.2rem;
  background: transparent;
  border: 1px solid var(--light-gray);
  font-family: var(--font-sans);
  font-size: 0.85rem;
  cursor: pointer;
  transition: all 0.2s;
}

.filter-chip:hover {
  border-color: var(--black);
}

.filter-chip.active {
  background: var(--black);
  color: var(--white);
  border-color: var(--black);
}

/* =============================================
   Stats Strip
   ============================================= */

.stats-strip {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 3rem;
  padding: 2rem;
  background: var(--white);
  border-top: 1px solid var(--light-gray);
  border-bottom: 1px solid var(--light-gray);
}

.stat-item {
  text-align: center;
}

.stat-num {
  display: block;
  font-family: var(--font-serif);
  font-size: 2rem;
}

.stat-text {
  font-size: 0.8rem;
  color: var(--gray);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.stat-divider {
  width: 1px;
  height: 40px;
  background: var(--light-gray);
}

/* =============================================
   Listings Section
   ============================================= */

.listings-section {
  max-width: 1400px;
  margin: 0 auto;
  padding: 3rem 2rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 2rem;
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--light-gray);
}

.section-header h2 {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
}

.results-info {
  color: var(--gray);
  font-size: 0.9rem;
}

/* Loader */
.loader {
  text-align: center;
  padding: 4rem;
}

.loader-text {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1.2rem;
  color: var(--gray);
}

/* Listings Grid - Varied Heights */
.listings-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 1.5rem;
}

/* =============================================
   Listing Card - Clean Editorial Style
   ============================================= */

.listing-card {
  background: var(--white);
  border: 1px solid var(--light-gray);
  cursor: pointer;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.listing-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 12px 40px rgba(0,0,0,0.1);
}

/* Vary card sizes for visual interest */
.listing-card:nth-child(5n+1) .card-img {
  aspect-ratio: 4/3;
}

.listing-card:nth-child(5n+2) .card-img {
  aspect-ratio: 1/1;
}

.listing-card:nth-child(5n+3) .card-img {
  aspect-ratio: 3/4;
}

.listing-card:nth-child(5n+4) .card-img {
  aspect-ratio: 16/10;
}

.listing-card:nth-child(5n+5) .card-img {
  aspect-ratio: 4/3;
}

.card-img {
  position: relative;
  overflow: hidden;
  aspect-ratio: 4/3;
}

.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.listing-card:hover .card-img img {
  transform: scale(1.03);
}

.save-btn {
  position: absolute;
  top: 0.75rem;
  right: 0.75rem;
  width: 32px;
  height: 32px;
  background: var(--white);
  border: none;
  cursor: pointer;
  font-size: 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.2s;
}

.listing-card:hover .save-btn {
  opacity: 1;
}

.save-btn.saved {
  opacity: 1;
  background: var(--accent);
  color: var(--white);
}

.superhost-tag {
  position: absolute;
  bottom: 0.75rem;
  left: 0.75rem;
  padding: 0.3rem 0.6rem;
  background: var(--black);
  color: var(--white);
  font-size: 0.7rem;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

.card-body {
  padding: 1.25rem;
}

.card-hood {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.25rem;
  font-weight: 400;
  margin-bottom: 0.75rem;
  line-height: 1.3;
}

.card-desc {
  font-size: 0.9rem;
  color: var(--gray);
  line-height: 1.5;
  margin-bottom: 1rem;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-footer {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 1rem;
  border-top: 1px solid var(--light-gray);
}

.host-info {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.host-img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  object-fit: cover;
}

.host-name {
  font-size: 0.85rem;
}

.host-label {
  font-size: 0.7rem;
  color: var(--gray);
}

.card-price {
  text-align: right;
}

.price-amount {
  font-family: var(--font-serif);
  font-size: 1.25rem;
}

.price-label {
  font-size: 0.7rem;
  color: var(--gray);
}

/* =============================================
   Empty State
   ============================================= */

.empty-state {
  text-align: center;
  padding: 4rem 2rem;
}

.empty-state p {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 1rem;
  color: var(--gray);
}

.empty-state button {
  padding: 0.75rem 1.5rem;
  background: var(--black);
  color: var(--white);
  border: none;
  font-family: var(--font-sans);
  cursor: pointer;
}

/* =============================================
   Modal
   ============================================= */

.modal {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.7);
  justify-content: center;
  align-items: center;
  padding: 2rem;
}

.modal.open {
  display: flex;
}

.modal-box {
  background: var(--white);
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
}

.modal-large {
  max-width: 800px;
}

.modal-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1.25rem 1.5rem;
  border-bottom: 1px solid var(--light-gray);
}

.modal-top h3 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1.25rem;
}

.close-modal {
  width: 36px;
  height: 36px;
  background: var(--cream);
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-modal:hover {
  background: var(--light-gray);
}

/* Saved List */
.saved-list {
  padding: 1rem;
}

.empty-saved {
  text-align: center;
  padding: 2rem;
  color: var(--gray);
  font-style: italic;
}

.saved-item {
  display: flex;
  gap: 1rem;
  padding: 1rem;
  border-bottom: 1px solid var(--light-gray);
  cursor: pointer;
}

.saved-item:hover {
  background: var(--cream);
}

.saved-item img {
  width: 80px;
  height: 60px;
  object-fit: cover;
}

.saved-item-info h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  font-size: 1rem;
  margin-bottom: 0.25rem;
}

.saved-item-info p {
  font-size: 0.85rem;
  color: var(--accent);
}

/* Detail Modal */
#detailBody {
  padding: 0;
}

.detail-img {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
}

.detail-content {
  padding: 2rem;
}

.detail-hood {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.detail-title {
  font-family: var(--font-serif);
  font-size: 2rem;
  font-weight: 400;
  margin-bottom: 0.5rem;
}

.detail-price {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.detail-price span {
  font-family: var(--font-sans);
  font-size: 0.9rem;
  color: var(--gray);
}

.detail-section {
  margin-bottom: 1.5rem;
}

.detail-section h4 {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 1px;
  margin-bottom: 0.5rem;
  color: var(--gray);
}

.detail-section p {
  line-height: 1.7;
  color: var(--black);
}

.detail-host {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem;
  background: var(--cream);
  margin-bottom: 1.5rem;
}

.detail-host img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
}

.detail-host-info h4 {
  font-family: var(--font-serif);
  font-weight: 400;
  margin-bottom: 0.25rem;
}

.detail-host-info p {
  font-size: 0.85rem;
  color: var(--gray);
}

.amenities-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.amenity-item {
  padding: 0.4rem 0.8rem;
  background: var(--cream);
  font-size: 0.8rem;
}

.detail-link {
  display: inline-block;
  padding: 1rem 2rem;
  background: var(--black);
  color: var(--white);
  text-decoration: none;
  margin-top: 1rem;
  transition: background 0.2s;
}

.detail-link:hover {
  background: var(--accent);
}

/* =============================================
   Footer
   ============================================= */

.footer {
  margin-top: 4rem;
  padding: 3rem 2rem;
  background: var(--black);
  color: var(--white);
  text-align: center;
}

.footer-inner p {
  margin-bottom: 0.5rem;
}

.footer-small {
  font-size: 0.8rem;
  color: var(--gray);
}

/* =============================================
   Responsive Design
   ============================================= */

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 2rem 1.5rem;
  }

  .hero h1 {
    font-size: 4rem;
  }

  .hero-left {
    padding-top: 0;
  }

  .stats-strip {
    flex-wrap: wrap;
    gap: 1.5rem;
  }

  .stat-divider {
    display: none;
  }
}

@media (max-width: 600px) {
  .topbar {
    padding: 1rem;
  }

  .date-display {
    display: none;
  }

  .hero {
    padding: 1.5rem 1rem;
  }

  .hero h1 {
    font-size: 3rem;
  }

  .listings-section {
    padding: 2rem 1rem;
  }

  .listings-grid {
    grid-template-columns: 1fr;
  }

  .section-header {
    flex-direction: column;
    gap: 0.5rem;
    align-items: flex-start;
  }

  .modal {
    padding: 1rem;
  }

  .modal-box {
    max-height: 90vh;
  }
}

/* =============================================
   Subtle Animations
   ============================================= */

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

.listing-card {
  animation: fadeIn 0.4s ease;
}
