@import url("https://fonts.googleapis.com/css2?family=Manrope:wght@400;500;700;800&family=Playfair+Display:wght@500;700;800&display=swap");

:root {
  --bg: #f8f2e8;
  --bg-soft: #fff9f1;
  --card: #fffaf4;
  --text: #323547;
  --muted: #75795e;
  --line: #e8dcc9;
  --accent: #ff7c33;
  --accent-dark: #eb6422;
  --accent-soft: #ffd8c9;
  --sage: #bcc39a;
  --coral: #f7ab9d;
  --navy: #3b4659;
  --berry: #ff7f67;
  --radius: 22px;
  --shadow: 0 14px 36px rgba(66, 73, 91, 0.12);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  background:
    radial-gradient(1400px 700px at 15% -20%, #fffefb 0%, transparent 70%),
    radial-gradient(1200px 600px at 100% 120%, #f4e7d5 0%, transparent 72%),
    linear-gradient(180deg, #fbf6ee 0%, var(--bg) 100%);
  color: var(--text);
  font-family: "Manrope", "Segoe UI", sans-serif;
  min-height: 100%;
}

.bg-shape {
  position: fixed;
  border-radius: 999px;
  filter: blur(6px);
  opacity: 0.52;
  pointer-events: none;
}

.bg-shape-a {
  width: 340px;
  height: 340px;
  right: -100px;
  top: -90px;
  background: radial-gradient(circle, #ffd8c5 0%, rgba(255, 216, 197, 0) 72%);
}

.bg-shape-b {
  width: 320px;
  height: 320px;
  left: -100px;
  bottom: -120px;
  background: radial-gradient(circle, #dce2c0 0%, rgba(220, 226, 192, 0) 72%);
}

.page {
  width: min(1100px, 94vw);
  margin: 26px auto 56px;
  position: relative;
  z-index: 1;
}

.page::after {
  content: "";
  position: fixed;
  right: -20px;
  bottom: -16px;
  width: clamp(130px, 20vw, 240px);
  aspect-ratio: 1.3 / 1;
  background: url('/assets/icons/floral-spray.svg') no-repeat center/contain;
  transform: scaleX(-1) rotate(-12deg);
  opacity: 0.56;
  pointer-events: none;
  z-index: 0;
}

.card {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.62), rgba(255, 255, 255, 0.62)),
    linear-gradient(180deg, var(--card), var(--bg-soft));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 26px;
  margin-bottom: 18px;
  backdrop-filter: blur(2px);
}

.hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-top: 30px;
  padding-left: 24px;
  padding-right: 24px;
  text-align: center;
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background:
    radial-gradient(420px 170px at 12% -4%, rgba(255, 153, 107, 0.18) 0%, transparent 70%),
    radial-gradient(380px 160px at 90% 4%, rgba(188, 195, 154, 0.2) 0%, transparent 72%);
}

.floral-corner {
  position: absolute;
  width: clamp(96px, 15vw, 148px);
  opacity: 0.9;
  pointer-events: none;
  user-select: none;
  z-index: 0;
  filter: drop-shadow(0 8px 12px rgba(59, 70, 89, 0.16));
}

.floral-corner-left {
  top: 2px;
  left: 8px;
}

.floral-corner-right {
  top: 2px;
  right: 8px;
  transform: scaleX(-1);
}

.hero > :not(.floral-corner) {
  position: relative;
  z-index: 1;
}

.kicker {
  margin: 0 0 6px;
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.72rem;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  color: #90996f;
}

.hero h1 {
  margin: 0;
  font-size: clamp(2.2rem, 6.2vw, 3.6rem);
  line-height: 0.98;
  font-family: "Playfair Display", "Georgia", serif;
  letter-spacing: 0.01em;
  max-width: 100%;
}

.lead {
  margin: 12px 0 6px;
  font-size: clamp(1.15rem, 3.2vw, 1.55rem);
  font-family: "Playfair Display", "Georgia", serif;
  color: var(--navy);
}

.sublead {
  margin: 0 0 20px;
  color: var(--muted);
  max-width: 68ch;
  margin-left: auto;
  margin-right: auto;
}

.upload-cta {
  border: 1.5px dashed #e0b18f;
  border-radius: 18px;
  padding: 20px;
  background:
    linear-gradient(180deg, #fff9ef, #fff6e8),
    radial-gradient(220px 140px at 8% 20%, rgba(247, 171, 157, 0.13) 0, transparent 74%),
    radial-gradient(180px 120px at 94% 76%, rgba(188, 195, 154, 0.14) 0, transparent 72%);
  text-align: center;
  transition: 220ms ease;
}

.upload-cta.drag-over {
  border-color: var(--accent);
  background: linear-gradient(180deg, #fff3e4, #ffe8cd);
  transform: translateY(-1px);
}

#mediaInput {
  position: absolute;
  left: -9999px;
}

.btn-primary,
.btn-secondary {
  appearance: none;
  border: 0;
  border-radius: 999px;
  padding: 14px 20px;
  cursor: pointer;
  font-size: 1rem;
  font-family: "Manrope", sans-serif;
  font-weight: 700;
  transition: transform 120ms ease, box-shadow 160ms ease, background-color 160ms ease;
}

.btn-primary {
  width: min(100%, 460px);
  min-height: 62px;
  font-size: 1.1rem;
  letter-spacing: 0.01em;
  color: #fff;
  background: linear-gradient(120deg, #ff6f2f, #ff8a3d 62%, #ff9d4e);
  box-shadow: 0 10px 22px rgba(255, 111, 47, 0.35);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 24px rgba(255, 111, 47, 0.44);
}

.btn-primary:active,
.btn-secondary:active {
  transform: translateY(1px);
}

.btn-secondary {
  color: var(--navy);
  background: #f8efe2;
  border: 1px solid #e4cfb0;
}

.btn-secondary:hover {
  background: #f1e5d5;
}

.micro {
  margin: 12px 0 0;
  font-size: 0.9rem;
}

.muted {
  color: var(--muted);
}

.status {
  margin-top: 12px;
  min-height: 22px;
  font-size: 0.95rem;
}

.progress-wrap {
  margin-top: 10px;
}

.progress-bar {
  width: 100%;
  height: 12px;
  background: #eadfce;
  border-radius: 99px;
  overflow: hidden;
}

.progress-bar span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, #ff7c33, #ff9a53);
  transition: width 180ms ease;
}

.progress-text {
  margin: 8px 0 0;
  font-size: 0.9rem;
  color: var(--muted);
}

.gallery-section h2 {
  margin: 0;
  font-size: 1.7rem;
  font-family: "Playfair Display", "Georgia", serif;
  color: var(--navy);
}

.section-head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, rgba(255, 124, 51, 0.36), rgba(188, 195, 154, 0.34));
}

.gallery-tools {
  display: flex;
  justify-content: flex-end;
  margin: 10px 0 12px;
}

#startSlideshowBtn {
  min-height: 42px;
  white-space: nowrap;
}

.gallery {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  max-height: min(72vh, 760px);
  overflow: auto;
  padding-right: 0;
  scroll-behavior: smooth;
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.gallery::-webkit-scrollbar {
  width: 0;
  height: 0;
  display: none;
}

.tile {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
  background: #f0e4d3;
  aspect-ratio: 1 / 1;
  cursor: pointer;
  box-shadow: 0 6px 14px rgba(59, 70, 89, 0.16);
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.tile:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 18px rgba(59, 70, 89, 0.2);
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 240ms ease;
}

.tile:hover img {
  transform: scale(1.03);
}

.tile .video-mark {
  position: absolute;
  inset: auto auto 8px 8px;
  background: rgba(41, 50, 65, 0.78);
  color: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 700;
}

#loadMoreBtn {
  margin-top: 14px;
  width: 100%;
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(18, 14, 10, 0.92);
  z-index: 120;
  display: block;
}

.lightbox[hidden] {
  display: none !important;
}

.lb-content {
  position: absolute;
  top: max(48px, env(safe-area-inset-top));
  right: max(50px, env(safe-area-inset-right));
  bottom: max(64px, env(safe-area-inset-bottom));
  left: max(50px, env(safe-area-inset-left));
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.lb-content img,
.lb-content video {
  width: auto !important;
  height: auto !important;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain !important;
  border-radius: 12px;
  transform-origin: center center;
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.4);
}

.lb-close,
.lb-nav {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.24);
  font-size: 2rem;
  border-radius: 999px;
  width: 46px;
  height: 46px;
  cursor: pointer;
  backdrop-filter: blur(3px);
}

.lb-close {
  position: absolute;
  top: 16px;
  right: 16px;
}

.lb-prev {
  position: absolute;
  left: max(8px, env(safe-area-inset-left));
  top: 50%;
  transform: translateY(-50%);
}

.lb-next {
  position: absolute;
  right: max(8px, env(safe-area-inset-right));
  top: 50%;
  transform: translateY(-50%);
}

.lb-actions {
  position: absolute;
  left: 50%;
  bottom: max(8px, env(safe-area-inset-bottom));
  transform: translateX(-50%);
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
  width: min(96vw, 760px);
  padding: 0 8px;
}

@media (max-width: 699px) {
  .card {
    padding: 20px;
  }

  .hero {
    padding-top: 28px;
    padding-left: 14px;
    padding-right: 14px;
  }

  .floral-corner {
    width: 86px;
    opacity: 0.86;
  }

  .floral-corner-left {
    top: 2px;
    left: 4px;
  }

  .floral-corner-right {
    top: 2px;
    right: 4px;
  }

  .hero h1 {
    max-width: 100%;
  }

  .gallery-tools {
    justify-content: stretch;
  }

  #startSlideshowBtn {
    width: 100%;
  }

  .gallery {
    max-height: min(64vh, 560px);
  }

  .lb-content {
    top: max(46px, env(safe-area-inset-top));
    right: 8px;
    bottom: max(74px, env(safe-area-inset-bottom));
    left: 8px;
  }

  .lb-prev,
  .lb-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 3;
  }

  .lb-prev {
    left: 8px;
  }

  .lb-next {
    right: 8px;
  }

  .lb-content img,
  .lb-content video {
    width: auto !important;
    height: auto !important;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain !important;
  }

  .lb-actions {
    width: calc(100vw - 8px);
    bottom: max(8px, env(safe-area-inset-bottom));
  }

  .lb-nav {
    width: 38px;
    height: 38px;
    font-size: 1.55rem;
  }
}

@media (min-width: 700px) {
  .gallery {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .gallery {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}
