/* ==========================================================================
   USAMA & MARYAM — LUXURY MUGHAL WEDDING INVITATION
   Responsive Stylesheet: css/responsive.css
   Mobile-First • Android & iOS Verified • Tablet & Desktop Adaptive
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. TABLET & SMALL LAPTOPS (max-width: 1024px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 1024px) {
  .section {
    padding: clamp(2rem, 4vh, 3.5rem) clamp(1rem, 3vw, 2rem);
  }

  .announcement-names-block {
    gap: 1.25rem;
  }

  .name-card {
    min-width: 180px;
    padding: 1.2rem;
  }

  .person-name {
    font-size: clamp(1.8rem, 4vw, 2.8rem);
  }

  .families-grid {
    gap: 1.25rem;
  }

  .family-card {
    min-width: 250px;
    padding: 1.8rem 1.4rem;
  }

  .events-cards-grid {
    gap: 1rem;
  }

  .event-card {
    min-width: 240px;
    padding: 1.8rem 1.2rem;
  }

  .countdown-box {
    min-width: 75px;
    padding: 1rem 0.5rem;
  }
}

/* --------------------------------------------------------------------------
   2. MOBILE & TABLET PORTRAIT (max-width: 768px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 768px) {
  /* Allow natural scroll-snap and full visibility without clipping */
  html {
    scroll-snap-type: y proximity;
  }

  .section {
    min-height: 100vh;
    min-height: 100dvh;
    height: auto;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding: 4.5rem 1rem 3.5rem 1rem;
    justify-content: flex-start;
  }

  /* Entrance Screen on Mobile */
  #entrance {
    height: 100vh;
    height: 100dvh;
    justify-content: center;
    overflow: hidden;
    padding: 1.5rem 1rem;
  }

  .palace-door {
    width: 50%;
  }

  .door-inner-panel {
    padding: 0.5rem;
  }

  .center-medallion, .medallion {
    width: 130px;
    height: 130px;
  }

  .center-medallion svg, .medallion svg {
    width: 130px;
    height: 130px;
  }

  .main-title.entrance-names {
    font-size: clamp(2rem, 8vw, 3.2rem);
  }

  .sub-badge {
    font-size: 0.75rem;
    letter-spacing: 3px;
    padding: 0.35rem 1rem;
  }

  .entrance-content {
    margin-bottom: 2.5rem;
  }

  /* Navigation & Controls on Mobile */
  .global-controls {
    top: 0.85rem;
    right: 0.85rem;
    gap: 0.5rem;
  }

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

  .control-btn svg {
    width: 16px;
    height: 16px;
  }

  .nav-dots-container {
    right: 0.6rem;
    gap: 8px;
  }

  .nav-dot {
    width: 8px;
    height: 8px;
  }

  .scroll-indicator-container {
    bottom: 0.85rem;
  }

  .scroll-label {
    font-size: 0.75rem;
    letter-spacing: 2px;
  }

  /* Section 2: Announcement on Mobile */
  .announcement-frame.royal-arch-container {
    padding: 1.8rem 1.2rem;
    border-radius: 10px;
  }

  .bismillah-svg {
    max-width: 220px;
  }

  .announcement-names-block {
    flex-direction: column;
    gap: 0.75rem;
    margin: 1.25rem 0;
  }

  .name-card {
    width: 100%;
    min-width: unset;
    padding: 1rem 1.25rem;
  }

  .decorative-amp {
    font-size: 2rem;
    margin: -0.25rem 0;
  }

  .announcement-message {
    font-size: 1.05rem;
    line-height: 1.7;
    margin: 1rem auto;
  }

  .announcement-pill-badge {
    font-size: 0.85rem;
    padding: 0.45rem 1.1rem;
    letter-spacing: 1px;
  }

  /* Section 3: Letter on Mobile */
  .letter-parchment-card {
    padding: 2.2rem 1.2rem 1.8rem 1.2rem;
    border-radius: 10px;
  }

  .letter-seal svg {
    width: 55px;
    height: 55px;
  }

  .letter-seal {
    top: -28px;
  }

  .letter-para {
    font-size: 1.02rem;
    line-height: 1.8;
  }

  /* Section 4: Families on Mobile — CLEAR CARDS IN SEQUENCE */
  .families-grid {
    flex-direction: column;
    gap: 1.2rem;
    margin-top: 1rem;
    width: 100%;
  }

  .family-card {
    width: 100%;
    max-width: 100%;
    min-width: unset;
    padding: 1.6rem 1.2rem;
    border: 1.5px solid var(--color-gold-40);
    background: var(--gradient-card);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.7);
  }

  .family-member-name {
    font-size: 1.8rem;
  }

  .family-relation {
    font-size: 1.15rem;
  }

  .families-union-emblem svg {
    width: 60px;
    height: 60px;
  }

  /* Section 5: Events on Mobile — CLEAR CARDS IN SEQUENCE */
  .events-cards-grid {
    flex-direction: column;
    gap: 1rem;
    margin-top: 1rem;
    width: 100%;
  }

  .event-card {
    width: 100%;
    max-width: 100%;
    min-width: unset;
    padding: 1.4rem 1.2rem;
    border: 1.5px solid var(--color-gold-40);
    background: var(--gradient-card);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.7);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
  }

  .event-badge {
    font-size: 0.75rem;
    letter-spacing: 2px;
    padding: 0.3rem 0.9rem;
    margin-bottom: 0.6rem;
  }

  .event-icon-container {
    margin: 0.25rem auto 0.6rem auto;
  }

  .event-svg-icon {
    width: 52px;
    height: 52px;
  }

  .event-name {
    font-size: 1.5rem;
    margin-bottom: 0.25rem;
  }

  .event-date {
    font-size: 1.1rem;
    margin-bottom: 0.25rem;
  }

  .event-day-tag {
    font-size: 0.88rem;
  }

  /* Section 6: Countdown on Mobile */
  .countdown-frame-box {
    padding: 1.8rem 1rem;
    border-radius: 10px;
  }

  .countdown-timer-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0.5rem;
    margin: 1.4rem 0;
  }

  .countdown-box {
    min-width: unset;
    width: 100%;
    padding: 0.85rem 0.25rem;
  }

  .countdown-num {
    font-size: clamp(1.6rem, 5.5vw, 2.2rem);
  }

  .countdown-label {
    font-size: 0.68rem;
    letter-spacing: 1.5px;
  }

  /* Section 7: Venue on Mobile */
  .venue-card {
    padding: 1.6rem 1rem;
    border-radius: 10px;
  }

  .venue-name {
    font-size: 1.6rem;
  }

  .venue-location {
    font-size: 1.1rem;
  }

  .venue-address-desc {
    font-size: 0.95rem;
    margin-bottom: 1.2rem;
  }

  /* Section 8: RSVP on Mobile */
  .rsvp-card-wrapper {
    padding: 1.6rem 1.2rem;
    border-radius: 10px;
  }

  .rsvp-buttons-group {
    flex-direction: column;
    gap: 0.75rem;
  }

  .btn-rsvp {
    width: 100%;
    min-width: unset;
  }

  /* Section 9: Closing on Mobile */
  .closing-content-block {
    padding: 1.8rem 1.2rem;
    border-radius: 10px;
  }

  .arabic-prayer-text {
    font-size: 1.5rem;
    line-height: 2;
  }

  .prayer-translation {
    font-size: 1rem;
  }

  .closing-couple-names {
    font-size: 1.8rem;
  }

  .closing-actions-grid {
    flex-direction: column;
    gap: 0.75rem;
  }

  .closing-actions-grid .action-btn {
    width: 100%;
  }

  .corner-ornament {
    width: 80px;
    height: 80px;
  }
}

/* --------------------------------------------------------------------------
   3. SMALL MOBILE PHONES (max-width: 420px)
   -------------------------------------------------------------------------- */
@media screen and (max-width: 420px) {
  .section {
    padding: 4.2rem 0.75rem 3.2rem 0.75rem;
  }

  .section-title {
    font-size: 1.45rem;
  }

  .section-kicker {
    font-size: 0.78rem;
    letter-spacing: 3px;
  }

  .main-title.entrance-names {
    font-size: 1.9rem;
  }

  .name-card {
    padding: 0.85rem 1rem;
  }

  .person-name {
    font-size: 1.6rem;
  }

  .family-card {
    padding: 1.3rem 0.9rem;
  }

  .family-member-name {
    font-size: 1.55rem;
  }

  .event-card {
    padding: 1.2rem 0.85rem;
  }

  .event-name {
    font-size: 1.35rem;
  }

  .countdown-num {
    font-size: 1.45rem;
  }

  .countdown-label {
    font-size: 0.62rem;
    letter-spacing: 1px;
  }

  .arabic-prayer-text {
    font-size: 1.35rem;
    line-height: 1.9;
  }

  .btn {
    padding: 0.75rem 1.25rem;
    font-size: 0.95rem;
  }
}

/* --------------------------------------------------------------------------
   4. LANDSCAPE MOBILE (max-height: 520px)
   -------------------------------------------------------------------------- */
@media screen and (orientation: landscape) and (max-height: 520px) {
  .section {
    min-height: auto;
    padding: 3.5rem 1rem 2rem 1rem;
    justify-content: flex-start;
  }

  #entrance {
    height: auto;
    min-height: 100vh;
  }

  .events-cards-grid {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .event-card {
    flex: 1;
    min-width: 200px;
    padding: 1rem;
  }

  .families-grid {
    flex-direction: row;
    flex-wrap: wrap;
  }

  .family-card {
    flex: 1;
    min-width: 220px;
  }
}

/* --------------------------------------------------------------------------
   5. SAFE AREA INSETS (iPhone Notch & Home Indicator)
   -------------------------------------------------------------------------- */
@supports (padding: env(safe-area-inset-top)) {
  .global-controls {
    top: calc(0.85rem + env(safe-area-inset-top));
    right: calc(0.85rem + env(safe-area-inset-right));
  }

  .scroll-indicator-container {
    bottom: calc(0.85rem + env(safe-area-inset-bottom));
  }

  .section {
    padding-top: calc(4.5rem + env(safe-area-inset-top));
    padding-bottom: calc(3.5rem + env(safe-area-inset-bottom));
  }
}
