/* ==========================================================================
   Sample listing page
   Static, read-only showcase that mirrors the real dashboard property page so
   visitors can see what a Staycado home looks like before requesting access.
   Depends on base.css + marketing.css tokens/components.
   ========================================================================== */

.listing {
  max-width: 960px;
  margin: 0 auto;
  padding: 2.5rem 2rem 2rem;
}

/* Hero image (shorter banner so it doesn't dominate the page) */
/* Photos: no-JS fallback is a simple grid; /js/sample-gallery.js upgrades it
   into a carousel (see the carousel section at the bottom of this file). */
.sample-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 1.75rem;
}

.sample-gallery > img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
}

/* Once enhanced, the carousel lays out normally (not as a grid). */
.sample-gallery--enhanced {
  display: block;
}

/* Header: title, location, specs */
.listing__title {
  font-size: 2.5rem;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 0.35rem;
}

.listing__location {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  color: var(--color-text-subtle);
  font-size: 1.05rem;
  margin-bottom: 1.25rem;
}

.listing__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  padding: 1.25rem 0;
  border-top: 1px solid var(--color-border);
  border-bottom: 1px solid var(--color-border);
  margin-bottom: 2rem;
}

.listing__badge {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--color-text-muted);
  font-weight: 500;
}

.listing__badge .icon {
  color: var(--color-primary);
}

/* Content sections */
.listing__section {
  margin-bottom: 2.5rem;
}

.listing__section h2 {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 1.4rem;
  margin-bottom: 0.85rem;
  color: var(--color-text);
}

.listing__section h2 .icon {
  color: var(--color-primary);
}

.listing__section p {
  color: var(--color-text-muted);
  line-height: 1.8;
}

/* "Good to know" - full-width horizontal cards (title left, text right) */
.listing__info-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
}

.listing__info-grid .info-card {
  display: grid;
  grid-template-columns: 220px 1fr;
  gap: 1.5rem;
  align-items: start;
}

.listing__info-grid .info-card h3 {
  font-size: 1.1rem;
  margin-bottom: 0;
}

@media (max-width: 600px) {
  .listing__info-grid .info-card {
    grid-template-columns: 1fr;
    gap: 0.5rem;
  }
}

/* Location map (keyless Google Maps embed, display only) */
.listing__map {
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.listing__map iframe {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 0;
}

/* Read-only availability calendar (two months side by side) */
.calendars {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
}

.calendar {
  flex: 1 1 320px;
  max-width: 420px;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 1.25rem;
}

.calendar__month {
  text-align: center;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 1rem;
}

.calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.calendar__dow {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  color: var(--color-text-faint);
  text-transform: uppercase;
  padding-bottom: 0.25rem;
}

.cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
  border-radius: var(--radius-sm);
  background: var(--cal-available-bg);
  color: var(--cal-available-text);
  border: 1px solid var(--cal-available-border);
}

.cal-day--muted {
  background: transparent;
  color: transparent;
  border-color: transparent;
}

.cal-day--booked {
  background: var(--cal-booked-bg);
  color: var(--cal-booked-text);
  text-decoration: line-through;
  border-color: var(--cal-booked-border);
}

.calendar__legend {
  display: flex;
  gap: 1.25rem;
  margin-top: 1rem;
  font-size: 0.8rem;
  color: var(--color-text-subtle);
}

.calendar__legend span {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.calendar__legend i {
  width: 14px;
  height: 14px;
  border-radius: 4px;
  display: inline-block;
}

.legend-free {
  background: #d1fae5;
}

.legend-booked {
  background: #fecaca;
}

/* Read-only banner + final CTA */
.listing__banner {
  background: var(--color-bg-soft);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 0.85rem 1.25rem;
  color: var(--color-text-subtle);
  font-size: 0.9rem;
  margin-bottom: 2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.listing__banner .icon {
  color: var(--color-primary);
  flex: 0 0 auto;
}

.listing__cta {
  text-align: center;
  background: var(--gradient-soft);
  border-radius: var(--radius-lg);
  padding: 3rem 2rem;
  margin-top: 1rem;
}

.listing__cta h2 {
  font-size: 1.8rem;
  margin-bottom: 0.75rem;
  color: var(--color-text);
}

.listing__cta p {
  color: var(--color-text-subtle);
  margin-bottom: 1.5rem;
}

@media (max-width: 768px) {
  .listing {
    padding: 2rem 1.25rem 2rem;
  }

  .listing__title {
    font-size: 2rem;
  }

  .sample-gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 480px) {
  .sample-gallery {
    grid-template-columns: 1fr;
  }
}

/* =================================================================
   Photo carousel + "View all" overlay + lightbox
   Mirrors the production dashboard experience (dashboard image-gallery.css),
   built here as a static, Firebase-free version by /js/sample-gallery.js.
   ================================================================= */

/* Carousel */
.carousel-stage {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  background: var(--color-bg-soft);
  /* JS handles horizontal swipe; keep vertical page scroll native */
  touch-action: pan-y;
}

/* Horizontal filmstrip: one slide per photo, translated to swipe between them */
.carousel-track {
  display: flex;
  height: 100%;
  will-change: transform;
}

.carousel-track.animating {
  transition: transform 0.3s ease;
}

.carousel-slide {
  flex: 0 0 100%;
  height: 100%;
}

.carousel-main-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  cursor: zoom-in;
  display: block;
}

/* Portrait photos letterbox (side bars); landscape/square fill via cover above. */
.carousel-main-image.is-portrait {
  object-fit: contain;
}

.carousel-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: none;
  border-radius: var(--radius-full);
  background: rgba(var(--color-white-rgb), 0.85);
  color: var(--color-text);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  z-index: var(--z-badge);
}

.carousel-arrow:hover {
  background: rgba(var(--color-white-rgb), 1);
  box-shadow: var(--shadow-lg);
}

.carousel-arrow--prev {
  left: var(--spacing-md);
}

.carousel-arrow--next {
  right: var(--spacing-md);
}

.carousel-arrow--prev:hover {
  transform: translateY(-50%) translateX(-4px);
}

.carousel-arrow--next:hover {
  transform: translateY(-50%) translateX(4px);
}

.carousel-view-all {
  position: absolute;
  bottom: var(--spacing-md);
  right: var(--spacing-md);
  display: flex;
  align-items: center;
  gap: var(--spacing-xs);
  padding: var(--spacing-sm) var(--spacing-md);
  border: none;
  border-radius: var(--radius-md);
  background: rgba(var(--color-white-rgb), 0.9);
  color: var(--color-text);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: var(--transition-fast);
  z-index: var(--z-badge);
}

.carousel-view-all:hover {
  background: rgba(var(--color-white-rgb), 1);
}

.carousel-thumbs {
  display: flex;
  gap: var(--spacing-sm);
  margin-top: var(--spacing-sm);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding-bottom: var(--spacing-xs);
}

.carousel-thumb {
  flex: 0 0 auto;
  width: 84px;
  height: 64px;
  border: 2px solid transparent;
  border-radius: var(--radius-md);
  overflow: hidden;
  padding: 0;
  cursor: pointer;
  opacity: 0.6;
  transition: var(--transition-fast);
  scroll-snap-align: center;
}

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

.carousel-thumb:hover {
  opacity: 0.85;
}

.carousel-thumb.active {
  opacity: 1;
  border-color: var(--color-primary);
}

/* "View all" gallery overlay */
.gallery-overlay {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  background: var(--color-background);
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.gallery-overlay-bar {
  position: sticky;
  top: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: var(--spacing-md) var(--spacing-xl);
  background: var(--color-background);
  border-bottom: 1px solid var(--color-border-light);
}

.gallery-overlay-title {
  font-size: var(--font-size-lg);
  font-weight: var(--font-weight-semibold);
  color: var(--color-text);
}

.gallery-overlay-close {
  width: 40px;
  height: 40px;
  border: none;
  background: var(--color-bg-soft);
  color: var(--color-text);
  font-size: 24px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
}

.gallery-overlay-close:hover {
  background: var(--color-border-light);
}

.gallery-overlay-grid {
  padding: var(--spacing-xl);
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: var(--spacing-md);
}

.view-gallery-item {
  position: relative;
  aspect-ratio: 4 / 3;
  border: none;
  padding: 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  cursor: pointer;
  background: var(--color-bg-soft);
  box-shadow: var(--shadow-sm);
  transition: var(--transition-all);
}

.view-gallery-item:hover {
  box-shadow: var(--shadow-md);
}

.view-gallery-item img {
  width: 100%;
  height: 100%;
  /* Fill the uniform 4:3 tiles so the wide hero doesn't letterbox with big
     bands. The full, uncropped photo still shows in the lightbox. */
  object-fit: cover;
  display: block;
  transition: var(--transition-transform);
}

.view-gallery-item:hover img {
  transform: scale(1.03);
}

.view-gallery-hero-badge {
  position: absolute;
  top: var(--spacing-xs);
  left: var(--spacing-xs);
  background: var(--gradient-coral);
  color: var(--color-text-white);
  padding: 2px var(--spacing-xs);
  border-radius: var(--radius-sm);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semibold);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  z-index: var(--z-badge);
}

/* Fullscreen lightbox */
.fullscreen-image-modal {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: var(--z-modal);
  opacity: 0;
  visibility: hidden;
  transition: var(--transition-opacity);
}

.fullscreen-image-modal.show {
  opacity: 1;
  visibility: visible;
}

.fullscreen-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(var(--color-black-rgb), 0.95);
  cursor: pointer;
}

.fullscreen-modal-content {
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-image {
  max-width: 90%;
  max-height: 90%;
  object-fit: contain;
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-2xl);
}

.fullscreen-close-btn {
  position: absolute;
  top: var(--spacing-xl);
  right: var(--spacing-xl);
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(var(--color-white-rgb), 0.1);
  color: var(--color-text-white);
  font-size: 24px;
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  backdrop-filter: blur(10px);
  z-index: calc(var(--z-modal) + 1);
}

.fullscreen-close-btn:hover {
  background: rgba(var(--color-white-rgb), 0.2);
}

.fullscreen-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: none;
  background: rgba(var(--color-white-rgb), 0.1);
  color: var(--color-text-white);
  border-radius: var(--radius-full);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--transition-fast);
  backdrop-filter: blur(10px);
  z-index: calc(var(--z-modal) + 1);
}

.fullscreen-nav-btn:hover {
  background: rgba(var(--color-white-rgb), 0.2);
  transform: translateY(-50%) scale(1.1);
}

.fullscreen-nav-btn.prev-btn {
  left: var(--spacing-xl);
}

.fullscreen-nav-btn.next-btn {
  right: var(--spacing-xl);
}

.fullscreen-nav-btn svg {
  width: 24px;
  height: 24px;
}

.fullscreen-info {
  position: absolute;
  bottom: var(--spacing-xl);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  color: var(--color-text-white);
  background: rgba(var(--color-black-rgb), 0.5);
  padding: var(--spacing-md) var(--spacing-xl);
  border-radius: var(--radius-md);
  backdrop-filter: blur(10px);
}

.image-counter {
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semibold);
  margin-bottom: var(--spacing-xs);
  opacity: 0.9;
}

.image-title {
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-medium);
}

@media (max-width: 768px) {
  /* Carousel: swipe-only on mobile (thumbnail strip remains) */
  .carousel-arrow {
    display: none;
  }

  .gallery-overlay-bar {
    padding: var(--spacing-md);
  }

  .gallery-overlay-grid {
    padding: var(--spacing-md);
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  }

  .fullscreen-image {
    max-width: 95%;
    max-height: 85%;
  }

  .fullscreen-close-btn {
    top: var(--spacing-md);
    right: var(--spacing-md);
    width: 40px;
    height: 40px;
    font-size: 20px;
  }
}
