/* ================================================================
   style.css — Undangan Digital
   Semua warna via CSS variables → diset oleh script.js dari config.js
================================================================ */

/* ── VARIABLES (fallback, overridden by JS) ───────────────────── */
:root {
  --accent:       #d4726a;
  --accent-dark:  #8b3530;
  --accent-mid:   #e8a09b;
  --accent-pale:  #fdf0ef;
  --accent-line:  #f5cec9;
  --cover-bg:     linear-gradient(160deg, #fff5f4 0%, #ffe8e6 100%);
  --hero-bg:      #fff9f8;
  --page-bg:      #fffbfb;
  --cd-bg:        linear-gradient(135deg, #d4726a, #c05850);
  --text-dark:    #2a1614;
  --text-mid:     #7a4040;
  --text-light:   #b08080;

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body:    'Jost', sans-serif;
  --ease:         cubic-bezier(0.4, 0, 0.2, 1);
  --radius:       10px;
}

/* ── RESET ─────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html   { scroll-behavior: smooth; }
body   { font-family: var(--font-body); background: var(--page-bg); color: var(--text-dark); overflow-x: hidden; -webkit-font-smoothing: antialiased; }
img    { max-width: 100%; display: block; }
a      { text-decoration: none; color: inherit; }

/* ── COVER PAGE ────────────────────────────────────────────────── */
.cover-page {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: var(--cover-bg);
  overflow: hidden;
}

.cover-page.closing {
  animation: coverSlide 0.9s cubic-bezier(0.76, 0, 0.24, 1) forwards;
}

@keyframes coverSlide {
  to { transform: translateY(-100%); opacity: 0; }
}

/* Petals canvas */
#petalsCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.cover-content {
  position: relative;
  z-index: 2;
  text-align: center;
  padding: 2rem;
  animation: fadeUp 1s 0.2s ease both;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(28px); }
  to   { opacity: 1; transform: translateY(0); }
}

.cover-badge {
  display: inline-block;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-pale);
  border: 1px solid var(--accent-line);
  padding: 0.28rem 0.9rem;
  border-radius: 100px;
  margin-bottom: 1.4rem;
}

.cover-names {
  font-family: var(--font-display);
  font-size: clamp(3.5rem, 16vw, 6.5rem);
  font-weight: 300;
  color: var(--text-dark);
  line-height: 0.95;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.cover-amp {
  font-style: italic;
  font-size: 0.42em;
  color: var(--accent);
  line-height: 1.6;
}

.cover-divider {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  width: 160px;
  margin: 1rem auto;
}

.cdiv-line    { flex: 1; height: 0.5px; background: var(--accent-mid); }
.cdiv-diamond { width: 5px; height: 5px; background: var(--accent-mid); transform: rotate(45deg); flex-shrink: 0; }

.cover-date {
  font-size: 0.68rem;
  font-weight: 300;
  letter-spacing: 0.2em;
  color: var(--text-mid);
  margin-bottom: 0.5rem;
}

.cover-guest {
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1rem;
  color: var(--text-mid);
  min-height: 1.4rem;
  margin-bottom: 1.8rem;
}

.cover-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 2rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 2px;
  font-family: var(--font-body);
  font-size: 0.7rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}

.cover-btn:hover {
  opacity: 0.88;
  transform: translateY(-2px);
  box-shadow: 0 8px 20px rgba(0,0,0,0.12);
}

.cover-hint {
  position: absolute;
  bottom: 1.8rem;
  font-size: 0.62rem;
  color: var(--text-light);
  letter-spacing: 0.12em;
  animation: blink 2.5s ease infinite;
}

@keyframes blink {
  0%, 100% { opacity: 0.3; }
  50%       { opacity: 0.7; }
}

/* ── MUSIC FAB ──────────────────────────────────────────────────── */
.music-fab {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 500;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1.5px solid var(--accent);
  background: var(--page-bg);
  color: var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.3s var(--ease);
  box-shadow: 0 2px 14px rgba(0,0,0,0.1);
}

.music-fab:hover    { background: var(--accent); color: #fff; }
.music-fab.playing  { animation: musicPulse 2s ease infinite; }

@keyframes musicPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0.15); }
  50%       { box-shadow: 0 0 0 7px rgba(0,0,0,0); }
}

/* ── MAIN ───────────────────────────────────────────────────────── */
.hidden  { display: none !important; }
.visible { display: block; }

/* ── SCROLL REVEAL ──────────────────────────────────────────────── */
.reveal {
  opacity: 0;
  transform: translateY(32px);
  transition: opacity 0.85s var(--ease), transform 0.85s var(--ease);
}
.reveal.on { opacity: 1; transform: translateY(0); }

/* ── ORNAMENT ───────────────────────────────────────────────────── */
.ornament {
  text-align: center;
  padding: 0.5rem 0;
  font-size: 0.72rem;
  color: var(--accent-mid);
  letter-spacing: 0.55rem;
}

/* ── SECTION COMMON ─────────────────────────────────────────────── */
.sec {
  padding: 3.5rem 1.4rem;
  max-width: 680px;
  margin: 0 auto;
}

.sec-tag {
  font-size: 0.6rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--accent);
  text-align: center;
  margin-bottom: 0.5rem;
}

.sec-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 7vw, 2.6rem);
  font-weight: 300;
  color: var(--text-dark);
  text-align: center;
  line-height: 1.2;
  margin-bottom: 0.4rem;
}

.sec-title::after {
  content: '';
  display: block;
  width: 32px;
  height: 1px;
  background: var(--accent);
  margin: 0.7rem auto 1.8rem;
}

.sec-sub {
  text-align: center;
  font-size: 0.82rem;
  color: var(--text-light);
  margin-top: -1.4rem;
  margin-bottom: 2rem;
}

/* ── HERO / BISMILLAH ───────────────────────────────────────────── */
.sec-hero {
  background: var(--hero-bg);
  text-align: center;
  padding: 4rem 1.8rem 3.5rem;
  max-width: 100%;
}

.arabic {
  font-size: clamp(1.4rem, 5vw, 2rem);
  color: var(--accent-dark);
  line-height: 1.8;
  margin-bottom: 1.2rem;
}

.verse {
  font-family: var(--font-display);
  font-size: clamp(0.92rem, 3vw, 1.1rem);
  font-style: italic;
  color: var(--text-mid);
  line-height: 1.9;
  max-width: 520px;
  margin: 0 auto 0.6rem;
}

.verse-src {
  font-size: 0.7rem;
  color: var(--accent);
  letter-spacing: 0.1em;
}

/* ── COUPLE ─────────────────────────────────────────────────────── */
.couple-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
}

.couple-card {
  flex: 1;
  max-width: 200px;
  text-align: center;
}

.c-avatar {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-line);
  padding: 3px;
  background: var(--accent-pale);
  margin: 0 auto 1rem;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-display);
  font-size: 2.5rem;
  font-weight: 300;
  color: var(--accent-dark);
  overflow: hidden;
}

.c-avatar.has-photo { padding: 0; background: transparent; }

.c-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
}

.c-name {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 0.4rem;
}

.c-sub {
  font-size: 0.76rem;
  color: var(--text-light);
  line-height: 1.7;
  margin-bottom: 0.5rem;
  white-space: pre-line;
}

.c-ig {
  font-size: 0.72rem;
  color: var(--accent);
  transition: color 0.2s;
}
.c-ig:hover { color: var(--accent-dark); }

.couple-mid {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.6rem;
  padding: 0 0.5rem;
  flex-shrink: 0;
}

.cmid-line  { width: 0.5px; height: 44px; background: var(--accent-line); }
.cmid-heart { font-size: 1.2rem; color: var(--accent); animation: heartbeat 2s ease infinite; }

@keyframes heartbeat {
  0%, 100% { transform: scale(1); }
  50%       { transform: scale(1.3); }
}

/* ── EVENT CARDS ─────────────────────────────────────────────────── */
.event-grid {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.event-card {
  background: #fff;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 1.6rem 1.3rem;
  text-align: center;
  position: relative;
  overflow: hidden;
  box-shadow: 0 2px 12px rgba(0,0,0,0.04);
}

.event-top-bar {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2.5px;
  background: var(--accent);
}

.event-icon  { font-size: 1.6rem; margin-bottom: 0.5rem; }

.event-name {
  font-family: var(--font-display);
  font-size: 1.35rem;
  font-weight: 400;
  color: var(--text-dark);
  margin-bottom: 0.5rem;
}

.event-date  { font-size: 0.82rem; color: var(--text-dark); margin-bottom: 0.2rem; }
.event-time  { font-size: 0.78rem; color: var(--accent); font-weight: 500; margin-bottom: 0.5rem; }
.event-loc   { font-size: 0.76rem; color: var(--text-light); line-height: 1.65; margin-bottom: 1rem; }

.btn-maps {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.45rem 1rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  color: var(--accent-dark);
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  transition: all 0.3s var(--ease);
  background: transparent;
  cursor: pointer;
}
.btn-maps:hover { background: var(--accent); color: #fff; }

/* ── COUNTDOWN ──────────────────────────────────────────────────── */
.sec-countdown {
  background: var(--cd-bg);
  padding: 4rem 1.4rem;
  text-align: center;
  max-width: 100%;
}

.sec-countdown .sec-inner {
  max-width: 680px;
  margin: 0 auto;
}

.sec-countdown .sec-tag   { color: rgba(255,255,255,0.65); }
.sec-countdown .sec-title { color: #fff; }
.sec-countdown .sec-title::after { background: rgba(255,255,255,0.5); }

.cd-grid {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.cd-box {
  background: rgba(255,255,255,0.18);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: 8px;
  padding: 0.85rem 0.9rem;
  min-width: 62px;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.cd-num {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 8vw, 2.8rem);
  font-weight: 300;
  color: #fff;
  line-height: 1;
  display: block;
}

.cd-lbl {
  font-size: 0.55rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.6);
  margin-top: 0.2rem;
  display: block;
}

.cd-sep {
  font-size: 1.6rem;
  color: rgba(255,255,255,0.4);
  align-self: flex-start;
  padding-top: 0.7rem;
}

.cd-msg {
  margin-top: 1.5rem;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.1rem;
  color: rgba(255,255,255,0.85);
  min-height: 1.5rem;
}

/* ── GALLERY ─────────────────────────────────────────────────────── */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.55rem;
}

.gal-item {
  border-radius: 8px;
  overflow: hidden;
  background: var(--accent-pale);
  border: 1px solid var(--accent-line);
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transform: scale(0.94);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.gal-item.on { opacity: 1; transform: scale(1); }
.gal-item:first-child { grid-column: span 2; aspect-ratio: 16/9; }

.gal-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.gal-ph {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  font-size: 1.2rem;
  opacity: 0.4;
}
.gal-ph small { font-size: 0.7rem; color: var(--text-light); }

/* ── RSVP ────────────────────────────────────────────────────────── */
.rsvp-box {
  background: #fff;
  border: 1px solid var(--accent-line);
  border-radius: var(--radius);
  padding: 1.8rem 1.4rem;
  box-shadow: 0 2px 16px rgba(0,0,0,0.04);
}

.f-group { margin-bottom: 1.2rem; }

.f-label {
  display: block;
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-mid);
  margin-bottom: 0.45rem;
}

.f-input {
  width: 100%;
  border: 1px solid var(--accent-line);
  border-radius: 6px;
  padding: 0.65rem 0.9rem;
  font-family: var(--font-body);
  font-size: 0.85rem;
  color: var(--text-dark);
  background: var(--accent-pale);
  outline: none;
  transition: border-color 0.25s;
  resize: vertical;
}
.f-input:focus { border-color: var(--accent); background: #fff; }

.radio-row { display: flex; flex-wrap: wrap; gap: 0.5rem; }

.r-opt {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  font-size: 0.8rem;
  color: var(--text-mid);
  padding: 0.42rem 0.85rem;
  border: 1px solid var(--accent-line);
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.22s;
  user-select: none;
}
.r-opt input { display: none; }
.r-opt.sel   { background: var(--accent-pale); border-color: var(--accent); color: var(--accent-dark); }

.btn-primary {
  width: 100%;
  padding: 0.82rem;
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  font-family: var(--font-body);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  cursor: pointer;
  transition: all 0.3s var(--ease);
}
.btn-primary:hover    { opacity: 0.88; transform: translateY(-2px); box-shadow: 0 6px 18px rgba(0,0,0,0.1); }
.btn-primary:disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; }

.f-feedback {
  margin-top: 0.75rem;
  text-align: center;
  font-size: 0.82rem;
  font-style: italic;
  min-height: 1.3rem;
  color: var(--accent-dark);
}

/* ── GUESTBOOK ───────────────────────────────────────────────────── */
.gb-list { display: flex; flex-direction: column; gap: 0.75rem; }

.gb-card {
  background: #fff;
  border-left: 2.5px solid var(--accent);
  border-radius: 0 8px 8px 0;
  padding: 0.85rem 1rem;
  box-shadow: 0 1px 8px rgba(0,0,0,0.04);
  animation: gbIn 0.38s ease both;
}
@keyframes gbIn {
  from { transform: translateX(-14px); opacity: 0; }
  to   { transform: none; opacity: 1; }
}

.gb-top  { display: flex; justify-content: space-between; align-items: flex-start; gap: 0.6rem; margin-bottom: 0.3rem; }
.gb-name { font-size: 0.88rem; font-weight: 400; color: var(--text-dark); }

.gb-badge {
  font-size: 0.62rem;
  padding: 0.15rem 0.55rem;
  border-radius: 100px;
  background: var(--accent-pale);
  color: var(--accent-dark);
  border: 1px solid var(--accent-line);
  white-space: nowrap;
  flex-shrink: 0;
}

.gb-msg { font-size: 0.8rem; color: var(--text-mid); line-height: 1.65; font-style: italic; }

/* ── CLOSING ─────────────────────────────────────────────────────── */
.sec-closing {
  background: var(--hero-bg);
  text-align: center;
  padding: 4.5rem 2rem;
  max-width: 100%;
}

.closing-orn   { font-size: 0.72rem; color: var(--accent); letter-spacing: 0.5rem; margin-bottom: 1.2rem; }

.closing-names {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 10vw, 3.8rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text-dark);
  margin-bottom: 1.3rem;
}

.closing-text {
  font-size: 0.84rem;
  color: var(--text-mid);
  line-height: 1.9;
  max-width: 440px;
  margin: 0 auto 1.2rem;
}

.closing-sign {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent-dark);
  font-size: 0.9rem;
  margin-bottom: 2rem;
}

/* ── FOOTER ──────────────────────────────────────────────────────── */
.site-footer {
  text-align: center;
  padding: 1.4rem;
  font-size: 0.68rem;
  color: var(--text-light);
  letter-spacing: 0.08em;
  border-top: 1px solid var(--accent-line);
}

/* ── DESKTOP ─────────────────────────────────────────────────────── */
@media (min-width: 580px) {
  .event-grid { flex-direction: row; }
  .event-card { flex: 1; }

  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .gal-item:first-child { grid-column: span 1; aspect-ratio: 1; }

  .cover-names { flex-direction: row; gap: 0.3em; }
  .cover-amp   { font-size: 0.55em; align-self: flex-end; padding-bottom: 0.2em; }

  .couple-card { max-width: 240px; }
  .couple-mid  { padding: 0 1rem; }
}

@media (min-width: 768px) {
  .sec { padding: 5rem 2rem; }
}
