/* ==========================================================================
   INFINITE CASTLE — Responsive (mobile-first → tablet → desktop)
   ========================================================================== */

/* Ponsel kecil (≤ 360px) */
@media (max-width: 360px) {
  .countdown { gap: 5px; }
  .countdown__unit { min-width: 56px; }
  .countdown__value { font-size: 1.7rem; }
  .countdown--large .countdown__unit { min-width: 60px; }
  .countdown--large .countdown__value { font-size: 2rem; }
  .gate__tagline { letter-spacing: 0.32em; }
  .btn--open { padding: 1.1em 2em; letter-spacing: 0.26em; }
  .site-nav__list a { font-size: 0.55rem; }
}

/* Layar rendah (ponsel landscape) */
@media (max-height: 520px) and (orientation: landscape) {
  .gate { align-items: center; padding-top: 12px; padding-bottom: 12px; }
  .gate__names { font-size: clamp(2.4rem, 8vw, 4rem); }
  .gate__tagline { margin-bottom: 14px; }
  .gate__options { margin-top: 12px; }
  .hall__photo { display: none; }
}

/* Tablet (≥ 640px) */
@media (min-width: 640px) {
  .section { padding: 120px 0 128px; }
  .panel { padding: 40px 36px; }
  .gallery__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
  .gallery__item:nth-child(3n + 2) { translate: 0 32px; }
  .gift__accounts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .couple-cards { grid-template-columns: 1fr auto 1fr; align-items: center; gap: 24px; }
  .countdown__unit { min-width: 76px; }
  .countdown--large .countdown__unit { min-width: 96px; padding: 16px 10px 12px; }
  .countdown--large .countdown__value { font-size: 3rem; }
}

/* Desktop (≥ 960px) */
@media (min-width: 960px) {
  :root { --pager-h: 88px; }

  /* Navigasi pindah ke atas */
  .site-nav,
  .is-ready .site-nav.is-open {
    top: 0;
    bottom: auto;
    left: 0;
    right: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 36px;
    border-top: 0;
    background: linear-gradient(180deg, rgba(17, 17, 22, 0.88), rgba(17, 17, 22, 0));
    transform: translateY(-100%);
  }
  .is-ready .site-nav { opacity: 1; visibility: visible; transform: none; }
  .site-nav__brand {
    display: grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border: 1px solid var(--c-gold-line);
    border-radius: 50%;
    font-family: var(--font-display);
    font-size: 1rem;
    text-decoration: none;
    color: var(--c-ivory);
    transition: border-color 0.3s;
  }
  .site-nav__brand:hover { border-color: var(--c-gold); }
  .site-nav__list { display: flex; gap: 4px; }
  .site-nav__list a {
    flex-direction: row;
    gap: 8px;
    height: 44px;
    padding: 0 14px;
    border-radius: 0;
    font-family: var(--font-caps);
    font-size: 0.64rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--c-ivory-faint);
    border-bottom: 1px solid transparent;
  }
  .site-nav__list a .icon { color: inherit; }
  .site-nav__list a.is-active { background: none; }

  /* Pager mengambang di tengah bawah */
  .room-pager {
    left: 50%;
    right: auto;
    bottom: 24px;
    width: min(560px, calc(100% - 220px));
    height: 60px;
    padding: 0 8px;
    border: 1px solid rgba(198, 166, 106, 0.35);
    border-radius: 999px;
    background: rgba(17, 17, 22, 0.8);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transform: translate(-50%, 140%);
  }
  .is-ready .room-pager { transform: translate(-50%, 0); }
  .room-pager__btn { padding: 0 1.1em; }
  .room-pager__btn-text { display: inline; }
  .room-pager__menu { display: none; }

  .section { padding: 104px 0 110px; }

  /* Ruangan dengan konten di satu sisi: sisi lain dibiarkan terbuka untuk dunia 3D */
  .section[data-align] > .container { width: min(600px, 46vw); margin-inline: 0; }
  .section[data-align='left'] > .container { margin-left: 6vw; }
  .section[data-align='right'] > .container { margin-left: auto; margin-right: 6vw; }
  .section[data-align='left'] {
    background: linear-gradient(90deg, rgba(17, 17, 22, 0.9) 0%, rgba(17, 17, 22, 0.72) 40%, rgba(17, 17, 22, 0.08) 66%, rgba(17, 17, 22, 0) 100%);
  }
  .section[data-align='right'] {
    background: linear-gradient(270deg, rgba(17, 17, 22, 0.9) 0%, rgba(17, 17, 22, 0.72) 40%, rgba(17, 17, 22, 0.08) 66%, rgba(17, 17, 22, 0) 100%);
  }
  .section[data-align] .section-head { text-align: left; }
  .section[data-align] .section-head__kanji { left: 0; transform: none; }
  .section[data-align] .ornament { justify-content: flex-start; }
  .section[data-align] .ornament span:first-child { display: none; }
  .section[data-align] .section-lead,
  .section[data-align] .story__quote { margin-left: 0; }
  .section[data-align] .gift__reveal { justify-content: flex-start; }
  .site-nav__list a .icon { width: 15px; height: 15px; }
  .site-nav__list a.is-active { border-bottom-color: var(--c-gold); }

  .float-controls { top: auto; right: 28px; bottom: 28px; flex-direction: column; gap: 10px; }
  .toast-region { bottom: 32px; }

  .gate { padding-bottom: 5vh; }
  .gate__inner { max-width: 960px; }
  .gate__names { white-space: nowrap; font-size: clamp(4rem, 6.4vw, 6.4rem); }
  .gate__tagline { margin-bottom: 22px; }

  /* Aula: teks di kiri, foto di kanan — pusat layar dibiarkan terbuka untuk pelaminan 3D */
  .hall {
    background: linear-gradient(90deg, rgba(17, 17, 22, 0.82) 0%, rgba(17, 17, 22, 0.45) 38%, rgba(17, 17, 22, 0) 62%, rgba(17, 17, 22, 0.35) 100%);
  }
  .hall__layout {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    text-align: left;
  }
  .hall__text { align-items: flex-start; max-width: 520px; }
  .hall__photo { order: 0; width: 300px; }
  .hall .countdown { justify-content: flex-start; }

  .event-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px; }
  .event-card { padding: 84px 40px 42px; }

}

/* Desktop lebar */
@media (min-width: 1280px) {
  .hall__photo { width: 340px; margin-right: 2vw; }
}

/* Perangkat sentuh: hilangkan efek hover yang "lengket" */
@media (hover: none) {
  .btn--gold:hover { background: rgba(198, 166, 106, 0.1); color: var(--c-ivory); box-shadow: none; }
  .btn--gold:active { background: var(--c-gold); color: var(--c-obsidian); }
}
