/* ==========================================================================
   OUR MINI WORLD & BEAUTIFUL MEMORIES 📖❤️
   - Photo album portal with "Click to enter our mini world ❤️"
   - Organized scrapbook-style layout with proper spacing, captions, thumbnails, and categories
   - Video cards with clear play indicators and custom viewer
   - Mobile-first, fully responsive design
   ========================================================================== */

.memories-section {
  position: relative;
  max-width: 1100px;
  margin: 0 auto;
  padding: 4.5rem 1.5rem 6rem;
}

/* ==========================================================================
   1. MINI WORLD PORTAL CARD (Album / Photo Book Icon & Invitation)
   ========================================================================== */

.mini-world-portal {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 1.5px solid rgba(255, 182, 193, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 50px rgba(220, 70, 115, 0.16), 0 0 35px rgba(255, 182, 193, 0.25);
  padding: 3.5rem 2rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2rem;
  transition: transform 0.35s ease, box-shadow 0.35s ease;
}

.mini-world-portal:hover {
  box-shadow: 0 25px 60px rgba(220, 70, 115, 0.22), 0 0 45px rgba(255, 182, 193, 0.35);
}

/* Photo Album Graphic */
.portal-album-graphic {
  position: relative;
  width: 140px;
  height: 160px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto;
  cursor: pointer;
}

.album-cover {
  width: 120px;
  height: 145px;
  background: linear-gradient(135deg, #ff4d79 0%, #ff7597 50%, #f7a1b5 100%);
  border-radius: 14px 18px 18px 14px;
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow: 0 14px 32px rgba(255, 77, 121, 0.35), inset -2px 0 6px rgba(0,0,0,0.1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  position: relative;
  z-index: 2;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.album-spine {
  position: absolute;
  left: 2px;
  top: 10px;
  bottom: 10px;
  width: 8px;
  background: #d6336c;
  border-radius: 4px;
  box-shadow: inset 1px 0 2px rgba(0,0,0,0.2);
  z-index: 3;
}

.album-emboss {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.2rem;
}

.album-icon-large {
  font-size: 3.2rem;
  filter: drop-shadow(0 4px 10px rgba(0,0,0,0.15));
  animation: heartPulse 3s infinite ease-in-out;
}

.album-badge-heart {
  font-size: 1.3rem;
  margin-top: -6px;
}

/* Peeking Polaroid Previews */
.album-peeking-photos {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 1;
}

.peek-polaroid {
  position: absolute;
  width: 48px;
  height: 58px;
  background: #ffffff;
  border: 1.5px solid #ffccd8;
  border-radius: 6px;
  box-shadow: 0 6px 14px rgba(0,0,0,0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.3rem;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.peek-1 {
  top: -12px;
  left: -20px;
  transform: rotate(-18deg);
}

.peek-2 {
  top: -14px;
  right: -20px;
  transform: rotate(16deg);
}

.peek-3 {
  bottom: -10px;
  right: -18px;
  transform: rotate(24deg);
}

.mini-world-portal:hover .peek-1 {
  transform: rotate(-26deg) translate(-8px, -6px);
}

.mini-world-portal:hover .peek-2 {
  transform: rotate(24deg) translate(8px, -6px);
}

.mini-world-portal:hover .peek-3 {
  transform: rotate(32deg) translate(6px, 6px);
}

.mini-world-portal:hover .album-cover {
  transform: scale(1.06) rotate(-2deg);
}

/* Portal Text Block */
.portal-text-block {
  max-width: 580px;
  margin: 0 auto;
}

.portal-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5.5vw, 2.8rem);
  color: var(--text-primary);
  margin: 0.6rem 0 0.5rem;
  line-height: 1.25;
}

.portal-subtitle {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 1.8rem;
}

/* The Button: "Click to enter our mini world ❤️" */
.enter-mini-world-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  padding: 0.95rem 2.4rem;
  border-radius: var(--radius-full);
  background: linear-gradient(135deg, #ff4d79 0%, #ff7597 100%);
  color: #ffffff;
  font-family: var(--font-sans);
  font-size: 1.05rem;
  font-weight: 600;
  border: none;
  cursor: pointer;
  box-shadow: 0 10px 28px rgba(255, 77, 121, 0.38), 0 0 20px rgba(255, 182, 193, 0.3);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
  outline: none;
  -webkit-tap-highlight-color: transparent;
}

.enter-mini-world-btn .btn-icon {
  font-size: 1.3rem;
}

.enter-mini-world-btn:hover {
  transform: translateY(-3px) scale(1.03);
  box-shadow: 0 14px 34px rgba(255, 77, 121, 0.48), 0 0 25px rgba(255, 77, 121, 0.4);
}

.enter-mini-world-btn:active {
  transform: translateY(0) scale(0.98);
}

.portal-count-tag {
  margin-top: 1rem;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-muted);
}

/* ==========================================================================
   2. SCRAPBOOK GALLERY CONTAINER
   ========================================================================== */

.scrapbook-gallery-container {
  margin-top: 3.5rem;
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.scrapbook-gallery-container.is-hidden {
  display: none;
}

.scrapbook-gallery-header {
  text-align: center;
  margin-bottom: 2.5rem;
}

.scrapbook-nav-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
  gap: 1rem;
}

.back-to-portal-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.45rem 1.1rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(255, 182, 193, 0.7);
  color: var(--text-secondary);
  font-size: 0.85rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

.back-to-portal-btn:hover {
  background: #ffffff;
  color: var(--pink-primary);
  border-color: var(--pink-primary);
  transform: translateX(-3px);
}

.scrapbook-header-pill {
  font-size: 0.82rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--pink-primary);
  background: #fff0f5;
  padding: 0.35rem 0.9rem;
  border-radius: var(--radius-full);
  border: 1px solid #ffd6e0;
}

.scrapbook-inner-title {
  font-family: var(--font-serif);
  font-size: clamp(2rem, 5vw, 2.6rem);
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.scrapbook-inner-desc {
  font-size: 0.98rem;
  color: var(--text-secondary);
  max-width: 480px;
  margin: 0 auto 1.8rem;
}

/* Category Filters */
.memories-filter-bar {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.7rem;
  flex-wrap: wrap;
  margin-bottom: 2.2rem;
}

.filter-chip {
  padding: 0.5rem 1.3rem;
  border-radius: var(--radius-full);
  font-size: 0.86rem;
  font-weight: 500;
  border: 1px solid rgba(255, 182, 193, 0.65);
  background: rgba(255, 255, 255, 0.9);
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.25s ease;
  outline: none;
  box-shadow: 0 3px 10px rgba(220, 80, 120, 0.08);
}

.filter-chip:hover {
  background: #ffffff;
  border-color: var(--pink-primary);
  color: var(--pink-primary);
  transform: translateY(-2px);
}

.filter-chip.is-active {
  background: linear-gradient(135deg, #ff4d79, #ff7597);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(255, 77, 121, 0.35);
}

/* ==========================================================================
   3. SCRAPBOOK / POLAROID GRID
   ========================================================================== */

.scrapbook-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 2.2rem 1.8rem;
  align-items: start;
}

/* Individual Scrapbook Polaroid Card */
.polaroid-card {
  background: #ffffff;
  padding: 0.75rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 182, 193, 0.5);
  box-shadow: 0 8px 24px rgba(214, 60, 105, 0.1), 0 2px 6px rgba(0, 0, 0, 0.04);
  cursor: pointer;
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.35s ease;
  position: relative;
  overflow: hidden;
  text-align: left;
  display: flex;
  flex-direction: column;
}

/* Gentle organic tilts for genuine scrapbook look */
.polaroid-card:nth-child(3n+1) { transform: rotate(-1.2deg); }
.polaroid-card:nth-child(3n+2) { transform: rotate(1deg); }
.polaroid-card:nth-child(3n+3) { transform: rotate(-0.6deg); }

.polaroid-card:hover {
  transform: scale(1.03) rotate(0deg) translateY(-6px) !important;
  box-shadow: 0 18px 40px rgba(214, 60, 105, 0.22);
  z-index: 10;
}

.polaroid-scrapbook-caption {
  font-family: 'Caveat', 'Kalam', cursive, sans-serif;
  font-size: 1.2rem;
  font-weight: 700;
  color: #3b282d;
  text-align: center;
  padding: 0.6rem 0.3rem 0.2rem;
  line-height: 1.25;
  letter-spacing: 0.2px;
}

/* Washi tape accent on card top */
.polaroid-card::before {
  content: '';
  position: absolute;
  top: -5px;
  left: 50%;
  transform: translateX(-50%);
  width: 65px;
  height: 18px;
  background: rgba(255, 200, 215, 0.7);
  border: 1px dashed rgba(255, 150, 180, 0.45);
  border-radius: 2px;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.04);
  z-index: 5;
}

/* Thumbnail Media Container */
.polaroid-media-container {
  position: relative;
  width: 100%;
  aspect-ratio: 4 / 3.4;
  background: #fff4f7;
  border-radius: 10px;
  overflow: hidden;
  margin-bottom: 0;
}

.polaroid-img,
.polaroid-video-thumb {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.4s ease;
}

.polaroid-card:hover .polaroid-img,
.polaroid-card:hover .polaroid-video-thumb {
  transform: scale(1.05);
}

/* Clear Video Badge & Pulsing Play Overlay */
.media-type-badge {
  position: absolute;
  top: 9px;
  right: 9px;
  padding: 0.25rem 0.65rem;
  border-radius: var(--radius-full);
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 182, 193, 0.6);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--pink-primary);
  display: flex;
  align-items: center;
  gap: 0.25rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
  z-index: 3;
}

.polaroid-video-play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(61, 15, 35, 0.2);
  transition: background 0.25s ease;
}

.polaroid-card:hover .polaroid-video-play-overlay {
  background: rgba(61, 15, 35, 0.35);
}

.play-circle-icon {
  width: 50px;
  height: 50px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--pink-primary);
  font-size: 1.25rem;
  padding-left: 4px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.2);
  transition: transform 0.25s ease, background 0.2s ease;
}

.polaroid-card:hover .play-circle-icon {
  transform: scale(1.15);
  background: #ffffff;
}

/* Card Text */
.polaroid-info-block {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.polaroid-caption {
  font-family: var(--font-serif);
  font-size: 1rem;
  color: var(--text-primary);
  line-height: 1.45;
  margin: 0;
}

.polaroid-date {
  font-size: 0.78rem;
  color: var(--text-muted);
  font-weight: 500;
}

/* ==========================================================================
   4. FULLSCREEN LIGHTBOX & CUSTOM VIDEO VIEWER
   ========================================================================== */

.lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(45, 10, 25, 0.8);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s;
  padding: 1rem;
}

.lightbox-overlay.is-active {
  opacity: 1;
  visibility: visible;
}

.lightbox-container {
  width: 100%;
  max-width: 920px;
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  position: relative;
}

.lightbox-close-btn {
  position: absolute;
  top: -48px;
  right: 0;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.95);
  border: 1px solid rgba(255, 182, 193, 0.7);
  color: var(--text-primary);
  font-size: 1.45rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 15px rgba(0, 0, 0, 0.25);
  transition: all 0.2s ease;
  outline: none;
  z-index: 15;
}

.lightbox-close-btn:hover {
  background: #ff4d79;
  color: #ffffff;
  transform: scale(1.08);
}

.lightbox-stage {
  width: 100%;
  max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: #fff5f8;
  border: 1px solid rgba(255, 182, 193, 0.6);
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.35);
  position: relative;
}

.lightbox-stage img {
  max-width: 100%;
  max-height: 72vh;
  object-fit: contain;
  display: block;
}

.lightbox-stage video {
  max-width: 100%;
  max-height: 72vh;
  display: block;
  background: #000000;
}

/* Lightbox Nav Buttons */
.lightbox-nav-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  border: 1px solid rgba(255, 182, 193, 0.7);
  color: var(--text-primary);
  font-size: 1.6rem;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
  transition: all 0.2s ease;
  outline: none;
  z-index: 10;
}

.lightbox-nav-btn:hover {
  background: #ff4d79;
  color: #ffffff;
  transform: translateY(-50%) scale(1.1);
}

.lightbox-prev-btn { left: -26px; }
.lightbox-next-btn { right: -26px; }

.lightbox-footer {
  margin-top: 1rem;
  text-align: center;
  color: #ffffff;
  max-width: 600px;
}

.lightbox-caption {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  margin-bottom: 0.35rem;
  text-shadow: 0 2px 6px rgba(0,0,0,0.5);
}

.lightbox-counter {
  font-size: 0.85rem;
  color: #ffd2dc;
  font-weight: 500;
}

/* ==========================================================================
   5. MOBILE-FIRST RESPONSIVE OPTIMIZATION
   ========================================================================== */

@media (max-width: 768px) {
  .memories-section {
    padding: 3.5rem 1rem 4.5rem;
  }

  .mini-world-portal {
    padding: 2.5rem 1.4rem;
    gap: 1.5rem;
  }

  .enter-mini-world-btn {
    width: 100%;
    padding: 0.9rem 1.5rem;
    font-size: 1rem;
  }

  .scrapbook-grid {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    gap: 1.5rem 1.2rem;
  }

  .lightbox-prev-btn { left: 6px; width: 42px; height: 42px; font-size: 1.4rem; }
  .lightbox-next-btn { right: 6px; width: 42px; height: 42px; font-size: 1.4rem; }
  .lightbox-close-btn { top: -42px; right: 4px; width: 38px; height: 38px; }
}

@media (max-width: 480px) {
  .memories-filter-bar {
    gap: 0.45rem;
    margin-bottom: 1.6rem;
  }

  .filter-chip {
    padding: 0.4rem 0.85rem;
    font-size: 0.78rem;
  }

  .mini-world-portal {
    padding: 2rem 1.1rem;
    border-radius: 22px;
  }

  .portal-title {
    font-size: 1.7rem;
  }

  .portal-subtitle {
    font-size: 0.92rem;
    margin-bottom: 1.4rem;
  }

  .enter-mini-world-btn {
    font-size: 0.95rem;
    padding: 0.85rem 1.2rem;
  }

  .scrapbook-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 0.9rem;
  }

  .polaroid-card {
    padding: 0.55rem;
    border-radius: 12px;
    transform: none !important;
  }

  .lightbox-caption {
    font-size: 0.98rem;
  }
}
