/* ══════════════════════════════════════════════
   RESPONSIVE LAYOUTS & BREAKPOINTS
══════════════════════════════════════════════ */

/* ══════════════════════════════════════════════
   1. DESKTOP & LARGE SCREENS (≥ 1024px)
══════════════════════════════════════════════ */
@media (min-width: 1024px) {
  /* Grand Events: 3 cards in a row on desktop (slightly reduced by 5-10%) */
  #dollhouse-cards {
    grid-template-columns: repeat(3, 1fr);
    max-width: 1100px;
    gap: clamp(28px, 3.5vw, 56px) clamp(20px, 3vw, 48px);
  }
  .dollhouse-card {
    max-width: clamp(275px, 25vw, 380px);
  }

  /* Top Architectural Canopy on Desktop (Refined ~65-75% framing scale) */
  #dollhouse-section .events-top-decor {
    padding: 0 clamp(20px, 3vw, 50px);
  }
  #dollhouse-section .events-lantern-item.lantern-left-far,
  #dollhouse-section .events-lantern-item.lantern-right-far {
    width: clamp(130px, 13vw, 210px);
  }
  #dollhouse-section .events-lantern-item.lantern-left-near,
  #dollhouse-section .events-lantern-item.lantern-right-near {
    width: clamp(95px, 9.5vw, 155px);
  }
  #dollhouse-section .events-lantern-item.lantern-center {
    width: clamp(110px, 11vw, 175px);
  }

  /* Hero Decorations on Desktop (Refined ~60-75% scale, edge-anchored) */
  #hero .corner-comp.top-left-large,
  #hero .corner-comp.top-right-large {
    width: clamp(90px, 9.5vw, 150px);
  }
  #hero .corner-comp.top-left-small,
  #hero .corner-comp.top-right-small {
    width: clamp(52px, 5.5vw, 85px);
  }
  /* Move small garlands slightly inward so they don’t crowd the edges */
  #hero .corner-comp.top-left-small  { left:  clamp(55px, 6.5vw, 95px); }
  #hero .corner-comp.top-right-small { right: clamp(55px, 6.5vw, 95px); }

  /* Frames Gallery on Desktop: 4 equal columns */
  #frames-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: clamp(28px, 3.8vw, 56px);
    max-width: 1440px;
    padding: 0 40px;
  }

  .frame-item:nth-child(1) {
    transform: rotate(-1.2deg) translateY(14px);
  }
  .frame-item:nth-child(1) img {
    width: clamp(240px, 22vw, 360px);
  }

  .frame-item:nth-child(2) {
    transform: rotate(0.8deg) translateY(-18px);
  }
  .frame-item:nth-child(2) img {
    width: clamp(270px, 26vw, 420px);
  }

  .frame-item:nth-child(3) {
    transform: rotate(-0.8deg) translateY(14px);
  }
  .frame-item:nth-child(3) img {
    width: clamp(240px, 22vw, 360px);
  }

  .frame-item:nth-child(4) {
    transform: rotate(1deg) translateY(-8px);
  }
  .frame-item:nth-child(4) img {
    width: clamp(252px, 24vw, 378px);
  }

  /* Carousel Desktop */
  .carousel-card {
    width: clamp(240px, 22vw, 340px);
  }

  /* Event Detail View Desktop Zoom */
  #event-detail-view,
  .event-hero {
    background-size: 130% auto;
    background-position: center 15%;
  }
  .event-hero-artwork-wrap {
    max-width: clamp(360px, 46vw, 580px);
  }
}

/* ══════════════════════════════════════════════
   2. TABLET SCREENS (768px – 1023px)
══════════════════════════════════════════════ */
@media (min-width: 768px) and (max-width: 1023px) {
  /* Grand Events: 2-column on tablet */
  #dollhouse-cards {
    grid-template-columns: repeat(2, 1fr);
    max-width: 760px;
    gap: clamp(22px, 3.5vw, 38px);
  }
  .dollhouse-card:nth-child(3) {
    grid-column: 1 / span 2;
    justify-self: center;
    max-width: clamp(240px, 38vw, 330px);
  }
  .dollhouse-card {
    max-width: clamp(240px, 38vw, 330px);
  }

  /* Top Architectural Canopy on Tablet */
  #dollhouse-section .events-lantern-item.lantern-left-far,
  #dollhouse-section .events-lantern-item.lantern-right-far {
    width: clamp(100px, 13vw, 145px);
  }
  #dollhouse-section .events-lantern-item.lantern-left-near,
  #dollhouse-section .events-lantern-item.lantern-right-near {
    width: clamp(72px, 9.5vw, 110px);
  }
  #dollhouse-section .events-lantern-item.lantern-center {
    width: clamp(82px, 11vw, 125px);
  }

  /* Hero Decorations on Tablet */
  #hero .corner-comp.top-left-large,
  #hero .corner-comp.top-right-large {
    width: clamp(80px, 11vw, 115px);
  }
  #hero .corner-comp.top-left-small,
  #hero .corner-comp.top-right-small {
    width: clamp(48px, 6.5vw, 68px);
  }

  /* Frames on Tablet: 2x2 grid — 4 frames fit naturally */
  #frames-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(24px, 4vw, 40px);
    max-width: 760px;
    padding: 0 24px;
  }
  .frame-item {
    grid-column: span 1;
  }
  .frame-item img {
    width: 100%;
    height: auto;
  }

  /* Carousel Tablet */
  .carousel-card {
    width: clamp(200px, 28vw, 260px);
  }

  /* Event Detail View Tablet */
  #event-detail-view,
  .event-hero {
    background-size: cover;
    background-position: center top;
  }
  .event-hero-artwork-wrap {
    max-width: clamp(300px, 52vw, 440px);
  }
}

/* ══════════════════════════════════════════════
   3. MOBILE SCREENS (< 768px)
══════════════════════════════════════════════ */
@media (max-width: 767px) {

  /* ── Mobile Hero Section: Seamless Height (ZERO Gap to Frames Section) ── */
  #hero {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    overflow: hidden;
  }

  #hero-img-wrap {
    height: clamp(550px, 85vh, 770px);
    width: 100%;
    overflow: hidden;
  }

  #hero-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
  }

  #hero-text-outer {
    top: clamp(80px, 13vh, 120px);
    padding: 0 clamp(18px, 5vw, 32px);
    gap: clamp(12px, 2vh, 24px);
  }

  #hero-text-group {
    gap: clamp(6px, 1.2vh, 14px);
  }

  .display-title {
    font-size: clamp(34px, 8.5vw, 54px);
    line-height: 1.08;
  }
  

  .tagline {
    font-size: clamp(14px, 3.8vw, 18px);
  }

  /* ── Mobile Hanging Lanterns in Hero (Framing outward with breathing margin) ── */
  #hero .corner-comp.top-left-large {
    left: -4px;
    top: 0;
    width: clamp(95px, 26vw, 135px);
  }
  #hero .corner-comp.top-left-large .comp-lantern {
    width: 55%;
    margin-top: -10%;
  }

  #hero .corner-comp.top-right-large {
    right: -4px;
    top: 0;
    width: clamp(95px, 26vw, 135px);
  }
  #hero .corner-comp.top-right-large .comp-lantern {
    width: 55%;
    margin-top: -10%;
  }

 #hero .corner-comp.top-left-small {
    top: 0;
    left: clamp(60px, 16vw, 85px);
    width: clamp(38px, 10vw, 50px);
}

#hero .corner-comp.top-right-small {
    top: 0;
    right: clamp(60px, 16vw, 85px);
    width: clamp(38px, 10vw, 50px);
}

  #hero .corner-comp.top-left-small .comp-lantern,
  #hero .corner-comp.top-right-small .comp-lantern {
    width: 48%;
    margin-top: -10%;
  }

  #hero .garland-top {
    max-height: clamp(65px, 16vw, 95px);
  }

  /* ── Mobile Frames Gallery: Exactly 2 Columns, 15-20% Larger ── */
  #frames-section {
    padding: clamp(44px, 6.5vh, 72px) clamp(12px, 3vw, 20px) clamp(24px, 4vh, 40px);
  }

  #frames-section .display-title {
    font-size: clamp(32px, 8.5vw, 48px);
  }

  #frames-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: clamp(16px, 4.2vw, 24px);
    padding: 0 clamp(6px, 1.8vw, 12px);
    max-width: 520px;
    margin: 0 auto;
    align-items: center;
    justify-items: center;
  }

  .frame-item {
    grid-column: span 1 !important;
    width: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .frame-item img {
    width: 100% !important;
    height: auto !important;
    max-width: 100% !important;
    object-fit: contain;
    filter: none !important;
  }

  .frame-item:nth-child(1) { transform: rotate(-0.8deg) !important; }
  .frame-item:nth-child(2) { transform: rotate(0.6deg) !important; }
  .frame-item:nth-child(3) { transform: rotate(-0.5deg) !important; }
  .frame-item:nth-child(4) { transform: rotate(0.8deg) !important; }

  /* ── Mobile Polaroid Section ── */
  #polaroid-rope-section {
    padding: clamp(24px, 4vh, 48px) clamp(12px, 3vw, 20px) clamp(48px, 7vh, 80px);
  }

  #polaroids-row {
    gap: 18px;
  }

  /* ── Mobile Red Section Top Canopy (Preserved mobile framing scale) ── */
  #dollhouse-section {
    padding-top: clamp(105px, 15vh, 145px);
  }

  /* Mobile heading moved down slightly — creates breathing room below canopy */
  #dollhouse-section .section-head {
    margin-top: clamp(28px, 4.5vh, 44px);
    gap: clamp(8px, 1.5vh, 16px);
    margin-bottom: clamp(36px, 5.5vh, 60px);
  }

  #dollhouse-section .events-top-decor {
    padding: 0 4px;
  }
  #dollhouse-section .events-lantern-item.lantern-left-far,
  #dollhouse-section .events-lantern-item.lantern-right-far {
    width: clamp(95px, 25vw, 145px);
  }
  /* Mobile near-garlands shifted up slightly for breathing room around heading */
  #dollhouse-section .events-lantern-item.lantern-left-near,
  #dollhouse-section .events-lantern-item.lantern-right-near {
    width: clamp(72px, 19vw, 110px);
    margin-top: -16px;
  }
  #dollhouse-section .events-lantern-item.lantern-center {
    width: clamp(82px, 22vw, 125px);
  }

  /* ── Mobile Grand Events: 1 Card per Row (Reduced by 5-10%) ── */
  #dollhouse-cards {
    grid-template-columns: 1fr;
    max-width: 320px;
    gap: clamp(24px, 5vh, 40px);
    margin-top: clamp(24px, 4vh, 50px);
  }

  .dollhouse-card {
    grid-column: 1;
    max-width: clamp(225px, 75vw, 290px);
    margin: 0 auto;
  }

  /* ── Mobile RSVP Prominence ── */
  .rsvp-family-card {
    padding: clamp(22px, 4vh, 36px) clamp(16px, 4.5vw, 28px);
    margin-top: 24px;
    width: 100%;
  }

  .rsvp-family-names {
    font-size: clamp(24px, 6.2vw, 34px);
    line-height: 1.22;
  }

  .rsvp-family-special {
    font-size: clamp(15px, 4vw, 19px);
  }

  /* ── Mobile Event Detail View (Zoomed & Immersive) ── */
  #event-detail-view {
    background-size: cover;
    background-position: center top;
  }

  .event-hero {
    min-height: clamp(380px, 62vh, 560px);
    padding: clamp(50px, 8vh, 70px) 16px 24px;
    background-size: cover;
    background-position: center top;
  }

  .event-hero-artwork-wrap {
    max-width: clamp(260px, 80vw, 380px);
    margin-bottom: 14px;
  }

  .event-hero-img {
    max-height: 52vh;
  }

  .event-hero-text {
    padding: 10px 16px;
  }

  .ev-title {
    font-size: clamp(30px, 9vw, 48px);
  }

  .ev-details-row {
    flex-direction: column;
    align-items: center;
    gap: 22px;
  }

  .ev-detail-item {
    flex: 0 0 auto;
    width: 100%;
  }

  #event-back-btn {
    top: 10px;
    left: 10px;
    padding: 8px 16px;
    font-size: 13px;
  }

  .ev-dresscode-card {
    padding: 20px 16px;
  }

  .ev-dresscode-palette {
    gap: 14px;
  }

  /* ── Mobile Carousel: 1.3 - 2 images visible ── */
  .carousel-wrapper {
    padding: 12px 0;
  }

  .carousel-track {
    gap: 14px;
    animation-duration: 26s;
  }

  .carousel-card {
    width: clamp(170px, 56vw, 230px);
  }
}
