/**
 * Gallery Wall Landing Page Styles
 * Aligned with gallery builder design
 */

/* Import Playfair Display for wall names */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,600;1,400;1,600&display=swap');

/* Reset and base */
.gw-landing-page {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif !important;
  color: #1a1a1a;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  z-index: 1; /* Create stacking context below Shopify header (z-index: 8) */
}

/* ============================================
   Hero Section - Immersive, Full Width
   ============================================ */

.gw-landing-hero {
  position: relative;
  width: 100%;
  background: #f5f0e8; /* Wall color from builder */
}

/* Mosaic grid container */
.gw-landing-mosaic {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  max-width: 1400px;
  margin: 0 auto;
}

/* Individual mosaic cell - 16:9 to match lifestyle mock aspect ratio */
.gw-landing-cell {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #e8e4dc;
  border-radius: 2px;
}

/* Preview container within cell */
.gw-landing-cell-preview {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
}

.gw-landing-cell-preview--visible {
  opacity: 1;
}

/* Make BookmarkPreview fill the container */
.gw-landing-cell-preview :global(.bookmark-preview-container) {
  width: 100%;
  height: 100%;
}

.gw-landing-cell-preview :global(.mock-background) {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ============================================
   Caption - Subtle pill in corner (always visible)
   ============================================ */

.gw-landing-caption {
  position: absolute;
  bottom: 10px;
  right: 10px;
  z-index: 1; /* Just above image, below title overlay */
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 2px;
  padding: 8px 12px;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  pointer-events: none;
  max-width: 70%;
}

/* First row pills positioned at top to avoid title overlay */
.gw-landing-cell--first-row .gw-landing-caption {
  bottom: auto;
  top: 10px;
}

.gw-landing-wall-name {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 0.8125rem;
  font-weight: 400;
  color: #fff;
  letter-spacing: 0.01em;
  line-height: 1.25;
  text-align: right;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.gw-landing-meta {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.5625rem;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.75);
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

/* ============================================
   Intro Section - Clean, Below Carousel
   ============================================ */

.gw-landing-intro {
  padding: 60px 20px 50px;
  text-align: center;
  background: #fafaf8; /* Slightly warmer white */
}

.gw-landing-headline {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 2.5rem;
  font-weight: 600;
  margin: 0 0 12px 0;
  color: #1a1a1a;
  letter-spacing: -0.01em;
}

.gw-landing-subheadline {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1.0625rem;
  color: #666;
  margin: 0 0 28px 0;
  font-weight: 400;
}

.gw-landing-cta {
  display: inline-block;
  padding: 14px 36px;
  background: #1a1a1a;
  color: #fff !important;
  text-decoration: none !important;
  border-radius: 4px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.02em;
  transition: all 0.25s ease;
}

.gw-landing-cta:hover {
  background: #333;
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  color: #fff;
  text-decoration: none;
}

.gw-landing-cta--secondary {
  background: transparent;
  color: #1a1a1a !important;
  border: 1.5px solid #1a1a1a;
}

.gw-landing-cta--secondary:hover {
  background: #1a1a1a;
  color: #fff !important;
}

/* ============================================
   Container
   ============================================ */

.gw-landing-container {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 20px;
}

/* ============================================
   Layouts Section - scroll offset for fixed header
   ============================================ */

#layouts {
  scroll-margin-top: 71px; /* Desktop header height */
}

@media (max-width: 768px) {
  #layouts {
    scroll-margin-top: 56px; /* Mobile header height */
  }
}

/* ============================================
   How It Works Section
   ============================================ */

.gw-landing-how-it-works {
  padding: 70px 0;
  background: #f5f0e8; /* Wall color */
}

.gw-landing-section-title {
  font-family: 'Playfair Display', Georgia, serif !important;
  font-size: 1.875rem;
  font-weight: 600;
  text-align: center;
  margin: 0 0 48px 0;
  color: #1a1a1a;
}

.gw-landing-steps {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 32px;
  margin-bottom: 48px;
}

.gw-landing-step {
  text-align: center;
  padding: 20px 16px;
}

.gw-landing-step-number {
  width: 44px;
  height: 44px;
  margin: 0 auto 16px;
  background: #1a1a1a;
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 600;
}

.gw-landing-step-title {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 8px 0;
  color: #1a1a1a;
}

.gw-landing-step-desc {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 0.875rem;
  color: #666;
  margin: 0;
  line-height: 1.6;
}

.gw-landing-how-cta {
  text-align: center;
}

/* ============================================
   FAQ Section
   ============================================ */

.gw-landing-faq {
  padding: 70px 0;
  background: #fafaf8;
}

.gw-landing-faq-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}

.gw-landing-faq-item {
  background: #fff;
  border-radius: 6px;
  overflow: hidden;
  border: 1px solid #e8e4dc;
  transition: border-color 0.2s ease;
}

.gw-landing-faq-item:hover {
  border-color: #d0ccc4;
}

.gw-landing-faq-question {
  padding: 18px 22px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-weight: 600;
  font-size: 0.9375rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: space-between;
  list-style: none;
  color: #1a1a1a;
}

.gw-landing-faq-question::-webkit-details-marker {
  display: none;
}

.gw-landing-faq-question::after {
  content: '+';
  font-size: 1.25rem;
  font-weight: 300;
  color: #999;
  transition: transform 0.2s ease;
}

.gw-landing-faq-item[open] .gw-landing-faq-question::after {
  content: '−';
}

.gw-landing-faq-answer {
  padding: 0 22px 18px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  color: #555;
  margin: 0;
  font-size: 0.875rem;
  line-height: 1.7;
}

/* ============================================
   Product USPs Section
   ============================================ */

.gw-landing-usps {
  padding: 48px 0 64px;
  background: #fff;
}

.gw-landing-usps-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
  margin-top: 32px;
}

.gw-landing-usp-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

.gw-landing-usp-image {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 4px;
}

.gw-landing-usp-text {
  margin-top: 12px;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.4;
  color: #333;
  font-weight: 500;
}

/* Desktop: 3 columns */
@media (min-width: 768px) {
  .gw-landing-usps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 32px;
  }

  .gw-landing-usp-text {
    font-size: 16px;
  }
}

/* ============================================
   Placeholder cells
   ============================================ */

.gw-landing-cell--placeholder {
  background: linear-gradient(135deg, #f5f0e8 0%, #ebe6de 100%);
}

/* ============================================
   Responsive Styles
   ============================================ */

@media (max-width: 1024px) {
  .gw-landing-steps {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .gw-landing-mosaic {
    grid-template-columns: repeat(2, 1fr);
    gap: 3px;
    padding: 3px;
  }

  /* Mobile row mosaic - no extra padding needed */
  .gw-landing-mosaic--mobile-row {
    padding: 0 3px;
    max-width: none;
  }

  /* First mobile row - padding top */
  .gw-landing-hero--mobile .gw-landing-mosaic--mobile-row:first-child {
    padding-top: 3px;
  }

  /* Last mobile row - padding bottom */
  .gw-landing-hero--mobile .gw-landing-mosaic--mobile-row:last-child {
    padding-bottom: 3px;
  }

  .gw-landing-cell {
    aspect-ratio: 16 / 9;
  }

  .gw-landing-headline {
    font-size: 1.875rem;
  }

  .gw-landing-subheadline {
    font-size: 1rem;
  }

  .gw-landing-intro {
    padding: 48px 20px 40px;
  }

  /* Smaller caption pill on mobile */
  .gw-landing-caption {
    bottom: 8px;
    right: 8px;
    padding: 6px 10px;
    max-width: 75%;
  }

  .gw-landing-wall-name {
    font-size: 0.6875rem;
  }

  .gw-landing-meta {
    font-size: 0.5rem;
  }

  .gw-landing-section-title {
    font-size: 1.5rem;
    margin-bottom: 36px;
  }

  .gw-landing-steps {
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }

  .gw-landing-step {
    padding: 16px 12px;
  }

  .gw-landing-faq-grid {
    grid-template-columns: 1fr;
  }

  .gw-landing-how-it-works,
  .gw-landing-faq {
    padding: 56px 0;
  }
}

@media (max-width: 480px) {
  .gw-landing-mosaic {
    grid-template-columns: repeat(2, 1fr);
  }

  .gw-landing-headline {
    font-size: 1.5rem;
  }

  .gw-landing-cta {
    padding: 12px 28px;
    font-size: 0.875rem;
  }

  .gw-landing-steps {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .gw-landing-caption {
    padding: 5px 8px;
  }

  .gw-landing-wall-name {
    font-size: 0.625rem;
  }

  .gw-landing-meta {
    display: none; /* Hide time on very small screens */
  }
}

/* ============================================
   SSR Skeleton - Renders before JS loads
   ============================================ */

.gw-skeleton {
  background: #f5f0e8;
  min-height: 100vh;
  width: 100%;
}

.gw-skeleton-desktop {
  display: block;
  width: 100%;
}

.gw-skeleton-mobile {
  display: none;
  width: 100%;
}

@media (max-width: 768px) {
  .gw-skeleton-desktop {
    display: none !important;
  }
  .gw-skeleton-mobile {
    display: block !important;
  }
}

/* Desktop skeleton mosaic */
.gw-skeleton-mosaic {
  position: relative;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  padding: 4px;
  max-width: 1400px;
  margin: 0 auto;
}

.gw-skeleton-cell {
  position: relative;
  width: 100%;
  background: linear-gradient(90deg, #e8e4dc 25%, #ebe7df 50%, #e8e4dc 75%);
  background-size: 200% 100%;
  animation: gw-shimmer 1.5s infinite;
  border-radius: 2px;
  /* Fallback for aspect-ratio */
  padding-bottom: 56.25%; /* 16:9 */
}

@supports (aspect-ratio: 16 / 9) {
  .gw-skeleton-cell {
    padding-bottom: 0;
    aspect-ratio: 16 / 9;
  }
}

.gw-skeleton-overlay {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(245, 240, 232, 0.92);
  border-radius: 8px;
  padding: 40px 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.gw-skeleton-title {
  width: 280px;
  height: 36px;
  background: #e0dbd3;
  border-radius: 4px;
}

.gw-skeleton-cta {
  width: 180px;
  height: 48px;
  background: #d0cbc3;
  border-radius: 6px;
}

/* Desktop skeleton content */
.gw-skeleton-content {
  display: flex;
  gap: 32px;
  max-width: 1400px;
  margin: 0 auto;
  padding: 40px 20px;
}

.gw-skeleton-sidebar {
  width: 220px;
  flex-shrink: 0;
  background: #fff;
  border-radius: 12px;
  padding: 24px;
  height: fit-content;
}

.gw-skeleton-filter-title {
  width: 60px;
  height: 20px;
  background: #e8e4dc;
  border-radius: 4px;
  margin-bottom: 24px;
}

.gw-skeleton-filter-group {
  margin-bottom: 24px;
}

.gw-skeleton-filter-label {
  width: 40px;
  height: 12px;
  background: #e8e4dc;
  border-radius: 2px;
  margin-bottom: 12px;
}

.gw-skeleton-filter-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.gw-skeleton-filter-option {
  width: 100%;
  height: 32px;
  background: #f5f2ed;
  border-radius: 6px;
}

.gw-skeleton-grid {
  flex: 1;
}

.gw-skeleton-grid--desktop {
  column-count: 3;
  column-gap: 24px;
}

.gw-skeleton-card {
  break-inside: avoid;
  margin-bottom: 24px;
  background: #fff;
  border-radius: 10px;
  overflow: hidden;
}

.gw-skeleton-card-image {
  background: linear-gradient(90deg, #e8e4dc 25%, #ebe7df 50%, #e8e4dc 75%);
  background-size: 200% 100%;
  animation: gw-shimmer 1.5s infinite;
  /* Fallback for aspect-ratio */
  padding-bottom: 75%; /* 4:3 */
}

@supports (aspect-ratio: 4 / 3) {
  .gw-skeleton-card-image {
    padding-bottom: 0;
    aspect-ratio: 4 / 3;
  }
}

.gw-skeleton-card-info {
  padding: 18px 20px 20px;
}

.gw-skeleton-card-name {
  width: 70%;
  height: 22px;
  background: #e8e4dc;
  border-radius: 4px;
  margin-bottom: 8px;
}

.gw-skeleton-card-meta {
  width: 50%;
  height: 14px;
  background: #f0ece6;
  border-radius: 3px;
  margin-bottom: 16px;
}

.gw-skeleton-card-cta {
  width: 100px;
  height: 40px;
  background: #d0cbc3;
  border-radius: 6px;
}

/* Mobile skeleton */
.gw-skeleton-mosaic-mobile {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px;
  padding: 4px;
}

.gw-skeleton-header-mobile {
  padding: 20px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
}

.gw-skeleton-header-mobile .gw-skeleton-title {
  width: 220px;
  height: 28px;
}

.gw-skeleton-header-mobile .gw-skeleton-cta {
  width: 160px;
  height: 44px;
}

.gw-skeleton-filters-mobile {
  display: flex;
  gap: 8px;
  padding: 10px 10px;
  background: #fff;
  margin: 0 10px 10px;
  border-radius: 12px;
}

.gw-skeleton-dropdown {
  flex: 1;
  height: 40px;
  background: #f5f2ed;
  border-radius: 8px;
}

.gw-skeleton-grid--mobile {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  padding: 0 10px;
}

.gw-skeleton-grid--mobile .gw-skeleton-card {
  margin-bottom: 0;
}

.gw-skeleton-card-image--square {
  padding-bottom: 100%; /* 1:1 */
}

@supports (aspect-ratio: 1 / 1) {
  .gw-skeleton-card-image--square {
    padding-bottom: 0;
    aspect-ratio: 1 / 1;
  }
}

.gw-skeleton-grid--mobile .gw-skeleton-card-info {
  padding: 8px 10px 10px;
}

.gw-skeleton-grid--mobile .gw-skeleton-card-name {
  width: 80%;
  height: 16px;
  margin-bottom: 6px;
}

.gw-skeleton-grid--mobile .gw-skeleton-card-cta {
  width: 100%;
  height: 36px;
}

@keyframes gw-shimmer {
  0% { background-position: -200% 0; }
  100% { background-position: 200% 0; }
}
