/* ============================================================
   MINH THỨC & THỊ THAO — Wedding Gallery
   Phong cách: Lãng mạn ấm áp (hồng phấn / gold / lung linh)
   ============================================================ */

:root {
  --blush: #f7e7e1;
  --blush-deep: #e8c8bd;
  --rose: #c98b7e;
  --rose-deep: #a86657;
  --gold: #c9a24b;
  --gold-light: #e3c988;
  --cream: #fdf8f4;
  --ink: #4a3b36;
  --ink-soft: #7a6a63;
  --white: #fffdfb;
  --shadow: 30px 40px 80px -30px rgba(120, 80, 60, 0.35);
  --font-serif: "Cormorant Garamond", Georgia, serif;
  --font-script: "Dancing Script", cursive;
  --font-body: "Be Vietnam Pro", -apple-system, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--cream);
  color: var(--ink);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }

/* ================= HERO ================= */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.08);
  transition: opacity 1.6s ease, background-image 0s;
  opacity: 0;
  animation: heroZoom 18s ease-in-out infinite alternate;
}
.hero-bg.show { opacity: 1; }
@keyframes heroZoom {
  from { transform: scale(1.08); }
  to   { transform: scale(1.2); }
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(30,15,10,0.15) 0%, rgba(40,20,15,0.5) 100%),
    linear-gradient(to bottom, rgba(0,0,0,0.25), rgba(60,35,28,0.55));
}
.hero-content {
  position: relative;
  z-index: 3;
  color: var(--white);
  padding: 2rem;
  animation: fadeUp 1.6s ease both;
}
.hero-pretitle {
  font-family: var(--font-script);
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  color: var(--gold-light);
  margin-bottom: 0.6rem;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.hero-names {
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(3rem, 9vw, 7rem);
  line-height: 1.05;
  letter-spacing: 0.02em;
  text-shadow: 0 4px 40px rgba(0,0,0,0.4);
  display: flex;
  flex-direction: column;
  gap: 0.1em;
}
.hero-names .amp {
  font-family: var(--font-script);
  font-size: 0.55em;
  color: var(--gold-light);
  font-weight: 400;
  margin: -0.05em 0;
}
.hero-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  margin: 1.6rem 0 1rem;
  color: var(--gold-light);
  font-size: 1.1rem;
}
.hero-divider span {
  display: block;
  width: clamp(40px, 12vw, 90px);
  height: 1px;
  background: linear-gradient(to var(--dir, right), transparent, var(--gold-light));
}
.hero-divider span:last-child { --dir: left; }
.hero-date {
  font-family: var(--font-serif);
  font-size: clamp(1.1rem, 2.4vw, 1.6rem);
  letter-spacing: 0.35em;
  padding-left: 0.35em;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
}
.scroll-cue {
  position: absolute;
  bottom: 2.2rem;
  left: 50%;
  transform: translateX(-50%);
  width: 26px;
  height: 42px;
  border: 2px solid rgba(255,255,255,0.6);
  border-radius: 20px;
  z-index: 3;
}
.scroll-cue span {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 4px;
  height: 8px;
  margin-left: -2px;
  background: var(--white);
  border-radius: 2px;
  animation: scrollDot 1.6s ease infinite;
}
@keyframes scrollDot {
  0% { opacity: 0; transform: translateY(0); }
  40% { opacity: 1; }
  80% { opacity: 0; transform: translateY(14px); }
  100% { opacity: 0; }
}

/* ================= INTRO ================= */
.intro {
  text-align: center;
  padding: clamp(4rem, 10vw, 8rem) 1.5rem clamp(2rem, 6vw, 4rem);
  max-width: 800px;
  margin: 0 auto;
}
.intro-script {
  font-family: var(--font-script);
  font-size: clamp(1.6rem, 4vw, 2.6rem);
  color: var(--rose-deep);
  line-height: 1.4;
}
.intro-line {
  width: 70px;
  height: 2px;
  margin: 2rem auto 0;
  background: linear-gradient(to right, transparent, var(--gold), transparent);
}

/* ================= GALLERY ================= */
.gallery-wrap {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 clamp(1rem, 4vw, 3rem) 4rem;
}
.section-head {
  text-align: center;
  margin: clamp(3rem, 8vw, 6rem) 0 clamp(1.5rem, 4vw, 3rem);
}
.section-head .sh-eyebrow {
  font-family: var(--font-script);
  font-size: clamp(1.3rem, 3vw, 2rem);
  color: var(--rose);
  display: block;
  margin-bottom: 0.2rem;
}
.section-head .sh-title {
  font-family: var(--font-serif);
  font-weight: 600;
  font-size: clamp(2rem, 5vw, 3.2rem);
  color: var(--ink);
  letter-spacing: 0.04em;
}
.section-head .sh-title::after {
  content: "";
  display: block;
  width: 50px;
  height: 2px;
  margin: 1rem auto 0;
  background: var(--gold);
  opacity: 0.7;
}

/* Masonry columns */
.masonry {
  column-gap: clamp(10px, 1.5vw, 18px);
  columns: 3;
}
@media (max-width: 900px) { .masonry { columns: 2; } }
@media (max-width: 540px) { .masonry { columns: 1; } }

.photo {
  position: relative;
  margin-bottom: clamp(10px, 1.5vw, 18px);
  break-inside: avoid;
  border-radius: 10px;
  overflow: hidden;
  cursor: pointer;
  background: var(--blush);
  box-shadow: 0 10px 30px -12px rgba(120,80,60,0.3);
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.9s ease, transform 0.9s ease, box-shadow 0.4s ease;
}
.photo.in { opacity: 1; transform: none; }
.photo img {
  width: 100%;
  height: auto;
  transition: transform 0.7s cubic-bezier(0.2,0.8,0.2,1);
}
.photo::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(60,35,28,0.35), transparent 45%);
  opacity: 0;
  transition: opacity 0.4s ease;
}
.photo:hover { box-shadow: 0 24px 50px -18px rgba(120,80,60,0.5); }
.photo:hover img { transform: scale(1.06); }
.photo:hover::after { opacity: 1; }

/* Loading skeleton shimmer */
.photo.skeleton {
  min-height: 260px;
  background: linear-gradient(100deg, var(--blush) 30%, var(--white) 50%, var(--blush) 70%);
  background-size: 200% 100%;
  animation: shimmer 1.4s infinite;
  cursor: default;
}
@keyframes shimmer {
  from { background-position: 200% 0; }
  to   { background-position: -200% 0; }
}

/* ================= LOADER ================= */
.loader {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--ink-soft);
}
.loader-heart {
  font-size: 3rem;
  color: var(--rose);
  animation: beat 1.2s ease infinite;
}
@keyframes beat {
  0%,100% { transform: scale(1); }
  25% { transform: scale(1.18); }
  40% { transform: scale(0.96); }
}
.error-box {
  max-width: 640px;
  margin: 3rem auto;
  padding: 1.5rem 1.8rem;
  border: 1px solid var(--blush-deep);
  border-radius: 12px;
  background: var(--white);
  color: var(--rose-deep);
  line-height: 1.7;
  font-size: 0.95rem;
}
.error-box code {
  background: var(--blush);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  font-size: 0.9em;
}

/* ================= FOOTER ================= */
.footer {
  text-align: center;
  padding: clamp(4rem, 10vw, 7rem) 1.5rem clamp(3rem, 6vw, 4rem);
  background: linear-gradient(to bottom, var(--cream), var(--blush));
}
.footer-heart {
  font-size: 1.8rem;
  color: var(--rose);
  animation: beat 1.6s ease infinite;
}
.footer-names {
  font-family: var(--font-serif);
  font-size: clamp(1.8rem, 5vw, 3rem);
  color: var(--ink);
  margin: 0.6rem 0 0.3rem;
}
.footer-date {
  font-family: var(--font-serif);
  letter-spacing: 0.3em;
  padding-left: 0.3em;
  color: var(--ink-soft);
}
.footer-thanks {
  font-family: var(--font-script);
  font-size: 1.5rem;
  color: var(--rose);
  margin-top: 1.5rem;
}

/* ================= LIGHTBOX ================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(30,18,14,0.94);
  backdrop-filter: blur(6px);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: fadeIn 0.35s ease;
}
.lightbox[hidden] { display: none; }
.lb-stage {
  position: relative;
  max-width: 92vw;
  max-height: 88vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-stage img {
  max-width: 92vw;
  max-height: 88vh;
  border-radius: 6px;
  box-shadow: 0 30px 80px rgba(0,0,0,0.6);
  animation: lbIn 0.4s ease;
}
@keyframes lbIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}
.lb-close, .lb-nav {
  position: fixed;
  background: rgba(255,255,255,0.12);
  border: none;
  color: #fff;
  cursor: pointer;
  border-radius: 50%;
  transition: background 0.25s ease, transform 0.25s ease;
  z-index: 101;
}
.lb-close {
  top: 1.4rem; right: 1.6rem;
  width: 48px; height: 48px;
  font-size: 2rem; line-height: 1;
}
.lb-nav {
  top: 50%;
  transform: translateY(-50%);
  width: 56px; height: 56px;
  font-size: 1.4rem;
}
.lb-prev { left: 1.6rem; }
.lb-next { right: 1.6rem; }
.lb-close:hover, .lb-nav:hover { background: rgba(255,255,255,0.28); }
.lb-nav:hover { transform: translateY(-50%) scale(1.1); }
.lb-counter {
  position: fixed;
  bottom: 1.4rem;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255,255,255,0.85);
  font-size: 0.9rem;
  letter-spacing: 0.15em;
  z-index: 101;
}
.lb-spinner {
  position: absolute;
  width: 44px; height: 44px;
  border: 3px solid rgba(255,255,255,0.25);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.lb-spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }

@media (max-width: 640px) {
  .lb-nav { width: 44px; height: 44px; }
  .lb-prev { left: 0.5rem; }
  .lb-next { right: 0.5rem; }
  .lb-close { top: 0.8rem; right: 0.8rem; }
}

/* ================= TO TOP ================= */
.to-top {
  position: fixed;
  bottom: 1.6rem;
  right: 1.6rem;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: none;
  background: var(--rose);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transform: translateY(20px);
  transition: opacity 0.4s ease, transform 0.4s ease, background 0.3s ease;
  z-index: 50;
  box-shadow: 0 8px 24px rgba(168,102,87,0.5);
}
.to-top.show { opacity: 1; pointer-events: auto; transform: none; }
.to-top:hover { background: var(--rose-deep); }

/* ================= UTIL ================= */
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to   { opacity: 1; transform: none; }
}

/* Falling petals decoration */
.petal {
  position: fixed;
  top: -30px;
  z-index: 40;
  pointer-events: none;
  color: var(--blush-deep);
  opacity: 0.7;
  animation: fall linear forwards;
}
@keyframes fall {
  to { transform: translateY(105vh) rotate(360deg); opacity: 0; }
}
