/* ==============================================================================
   RESPONSIVE DESIGN & MOBILE OPTIMIZATION
   Mobile First Strategy: 360px, 375px, 390px, 414px, 430px, Tablet & Desktop
   ============================================================================== */

/* Mobile Base & Small Screens (<= 768px) */
@media screen and (max-width: 768px) {
  section {
    padding: 4.5rem 0;
  }

  .container {
    padding: 0 1.25rem;
  }

  /* Couple Layout Stacking */
  .couple-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .couple-center-divider {
    order: 2;
    margin: -1rem 0;
  }

  .divider-vertical-line {
    display: none;
  }

  .couple-card:first-child {
    order: 1;
  }

  .couple-card:last-child {
    order: 3;
  }

  .portrait-wrapper {
    width: 210px;
    height: 270px;
  }

  /* Timeline Mobile Vertical Layout */
  .timeline-line {
    left: 20px;
  }

  .timeline-marker {
    left: 20px;
    width: 14px;
    height: 14px;
  }

  .timeline-item {
    flex-direction: row !important;
    padding-left: 45px;
    margin-bottom: 2.5rem;
  }

  .timeline-content {
    width: 100% !important;
    text-align: left !important;
    padding: 1.25rem 1.5rem;
  }

  /* RSVP & Guestbook Stacking */
  .rsvp-container-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .rsvp-card, .guestbook-card {
    padding: 2rem 1.5rem;
  }

  /* Events Grid */
  .events-grid {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .event-card {
    padding: 2.25rem 1.5rem;
  }

  /* Countdown on Mobile */
  .countdown-box {
    gap: 8px;
  }

  .countdown-unit {
    padding: 12px 8px;
    min-width: 68px;
  }

  .countdown-number {
    font-size: 1.85rem;
  }

  /* Gallery Grid on Mobile */
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
  }

  .gallery-item {
    aspect-ratio: 1/1;
  }

  .gallery-overlay {
    opacity: 1;
    background: linear-gradient(180deg, transparent 50%, rgba(8, 21, 16, 0.85) 100%);
    padding: 10px;
  }

  .gallery-caption {
    font-size: 0.8rem;
    transform: none;
  }

  /* Floating controls & Bottom Nav */
  .floating-controls {
    bottom: 80px;
    right: 14px;
  }

  .control-btn {
    width: 44px;
    height: 44px;
  }

  .bottom-nav {
    bottom: 12px;
    width: calc(100% - 28px);
    max-width: 420px;
    justify-content: space-around;
    padding: 6px 4px;
    padding-bottom: calc(6px + env(safe-area-inset-bottom, 0px));
  }

  .nav-item {
    padding: 6px 8px;
    font-size: 0.6rem;
  }

  .nav-item svg {
    width: 16px;
    height: 16px;
  }

  /* Lightbox controls */
  .lightbox-prev { left: 10px; }
  .lightbox-next { right: 10px; }
  .lightbox-close { top: 12px; right: 12px; }
}

/* Extra Small Phones: 360px & 375px */
@media screen and (max-width: 380px) {
  .cover-names {
    font-size: 2rem;
  }

  .btn-open-invitation {
    padding: 14px 28px;
    font-size: 0.78rem;
    letter-spacing: 0.15em;
  }

  .guest-invitation-box {
    padding: 1.25rem 1rem;
  }

  .guest-name {
    font-size: 1.2rem;
  }

  .countdown-unit {
    min-width: 60px;
    padding: 10px 4px;
  }

  .countdown-number {
    font-size: 1.6rem;
  }

  .countdown-label {
    font-size: 0.6rem;
  }

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

  .nav-item span {
    display: none; /* Icon-only on very narrow displays */
  }

  .nav-item {
    padding: 8px 12px;
  }
}

/* Tablets (769px to 1024px) */
@media screen and (min-width: 769px) and (max-width: 1024px) {
  .couple-grid {
    gap: 1.5rem;
  }

  .portrait-wrapper {
    width: 200px;
    height: 260px;
  }

  .timeline-content {
    width: 42%;
  }

  .rsvp-container-grid {
    gap: 2rem;
  }
}

/* Large Screens (>= 1200px) */
@media screen and (min-width: 1200px) {
  .hero-names-full {
    font-size: 3.8rem;
  }

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