/* ============================================================
   style.css — Undangan Pernikahan: Aulia & Izul
   Mobile-first, custom properties override Tailwind inline styles
   ============================================================ */

/* ── Reset & Base ─────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }

body {
  font-family: 'Be Vietnam Pro', sans-serif;
  background-color: #fcf9f8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body.overlay-open {
  overflow: hidden;
}

/* ── Anchor Scroll Offset (hindari tertutup fixed header) ─── */
section[id] {
  scroll-margin-top: 4rem;
}

/* ── Material Symbols ─────────────────────────────────────── */
.material-symbols-outlined {
  font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24;
  vertical-align: middle;
}

/* ── Invitation Overlay Transition ────────────────────────── */
#invitation-overlay {
  transition: opacity 0.45s ease-out, visibility 0.45s ease-out;
}
#invitation-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* ── Scroll Reveal Animation ──────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.55s ease-out, transform 0.55s ease-out;
}
.reveal.active {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  #invitation-overlay,
  #toast {
    transition: none;
  }
}

/* ── Decorative Frames ────────────────────────────────────── */
.hand-drawn-border {
  border: 2px solid #620800;
  border-radius: 255px 15px 225px 15px/15px 225px 15px 255px;
}

.oval-frame {
  border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%;
  border: 4px solid #620800;
  overflow: hidden;
}

.paper-shadow {
  box-shadow: 4px 4px 0px 0px #620800;
}

/* ── Dot Grid Background ──────────────────────────────────── */
.bg-pattern {
  background-image: radial-gradient(#e2bfb8 0.5px, transparent 0.5px);
  background-size: 20px 20px;
}

/* ── Countdown Tabular Numbers ────────────────────────────── */
.tabular-nums {
  font-variant-numeric: tabular-nums;
}

/* ── Messages Feed ────────────────────────────────────────── */
#messages-feed {
  overflow-y: auto;
  max-height: 20rem;
  padding-right: 0.5rem;
  margin-top: 1.5rem;
}

#messages-feed::-webkit-scrollbar        { width: 4px; }
#messages-feed::-webkit-scrollbar-track  { background: transparent; }
#messages-feed::-webkit-scrollbar-thumb  {
  background: #e2bfb8;
  border-radius: 999px;
}

#messages-feed .message-card {
  border-bottom: 1px solid #e2bfb8;
  padding-bottom: 0.75rem;
  margin-bottom: 0.75rem;
}
#messages-feed .message-card:last-child {
  border-bottom: none;
}

/* ── Attendance Badges (RSVP & Messages) ──────────────────── */
.attendance-badge {
  display: inline-flex;
  align-items: center;
  padding: 0.125rem 0.5rem;
  border-radius: 9999px;
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.4;
}
.badge-hadir {
  background-color: #e6f4ea;
  color: #1e6b3a;
}
.badge-mungkin {
  background-color: #fef3c7;
  color: #92400e;
}
.badge-tidak-hadir {
  background-color: #ece8e6;
  color: #5a413c;
}

/* ── Toast Notification ───────────────────────────────────── */
#toast {
  position: fixed;
  bottom: 5.5rem;
  left: 50%;
  transform: translate(-50%, 16px);
  z-index: 120;
  max-width: min(90vw, 420px);
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  background-color: #303030;
  color: #fcf9f8;
  font-size: 0.875rem;
  font-weight: 500;
  text-align: center;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.2);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease-out, transform 0.25s ease-out, visibility 0.25s ease-out;
}
#toast.show {
  opacity: 1;
  visibility: visible;
  transform: translate(-50%, 0);
}
#toast.toast-error {
  background-color: #93000a;
}
#toast.toast-success {
  background-color: #620800;
}

/* ── Form & Interactive Focus Ring (aksesibilitas) ────────── */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible {
  outline: 2px solid #620800;
  outline-offset: 2px;
}

/* ── Touch Optimization ───────────────────────────────────── */
a, button, label {
  touch-action: manipulation;
}

/* ── Submit Button States ─────────────────────────────────── */
button[type="submit"]:disabled {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ── Bottom Nav Safe Area (iOS) ───────────────────────────── */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
  .pb-safe { padding-bottom: env(safe-area-inset-bottom); }
}

/* ── Responsive Images ────────────────────────────────────── */
img {
  max-width: 100%;
  height: auto;
}

/* ── Print: hide music & nav ──────────────────────────────── */
@media print {
  #music-toggle, nav, #toast { display: none !important; }
}
