html,
body {
  min-height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at 10% 28rem, rgba(239, 209, 204, 0.42), transparent 28rem),
    radial-gradient(circle at 90% 65rem, rgba(220, 233, 228, 0.58), transparent 32rem),
    var(--event-bg);
}

.gallery-header {
  position: relative;
  display: grid;
  min-height: 430px;
  place-items: center;
  overflow: hidden;
  padding: 78px 22px 52px;
  background:
    linear-gradient(90deg, rgba(255, 250, 245, 0.96) 0%, rgba(255, 250, 245, 0.82) 46%, rgba(255, 250, 245, 0.18) 100%),
    url("/convite/assets/wide-pink-horse.jpg") 68% 42% / cover no-repeat;
}

.gallery-header::after {
  position: absolute;
  inset: auto 0 0;
  height: 90px;
  content: "";
  background: linear-gradient(transparent, var(--event-bg));
}

.header-floral {
  position: absolute;
  z-index: 1;
  top: -70px;
  left: -70px;
  width: min(35vw, 330px);
  opacity: 0.78;
}

.header-nav {
  position: absolute;
  z-index: 3;
  top: 20px;
  right: 24px;
  display: flex;
  gap: 8px;
}

.header-nav a {
  padding: 8px 13px;
  border: 1px solid rgba(93, 71, 65, 0.16);
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.74);
  color: var(--event-ink);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
  backdrop-filter: blur(8px);
}

.header-content {
  position: relative;
  z-index: 2;
  width: min(1050px, 100%);
  text-align: left;
}

.header-monogram {
  width: 110px;
  margin-bottom: 8px;
}

.eyebrow {
  margin: 0 0 7px;
  color: var(--event-gold);
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.24em;
  text-transform: uppercase;
}

.gallery-header h1 {
  margin: 0;
  color: var(--event-ink);
  font-family: var(--event-serif);
  font-size: clamp(4rem, 9vw, 7.6rem);
  font-weight: 400;
  letter-spacing: 0.08em;
  line-height: 0.84;
  text-transform: uppercase;
}

.event-date {
  margin: 20px 0 0;
  color: var(--event-muted);
  font-family: var(--event-serif);
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.3em;
}

main {
  width: min(1220px, 100%);
  margin: 0 auto;
  padding: 28px 24px 64px;
}

.gallery-intro {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.gallery-intro h2 {
  max-width: 650px;
  margin: 0;
  color: var(--event-ink);
  font-family: var(--event-serif);
  font-size: clamp(2.1rem, 5vw, 3.7rem);
  font-weight: 400;
  line-height: 1;
}

.send-button,
#btnCarregarMais {
  padding: 13px 20px;
  border: 1px solid rgba(183, 148, 114, 0.35);
  border-radius: 999px;
  background: rgba(255, 250, 245, 0.78);
  color: var(--event-ink);
  cursor: pointer;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-decoration: none;
  text-transform: uppercase;
}

.gallery-status {
  margin: 36px 0;
  color: var(--event-muted);
  font-family: var(--event-serif);
  font-size: 1.2rem;
  text-align: center;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  padding: 0;
  border: 0;
  border-radius: 14px;
  aspect-ratio: 1;
  background: var(--event-sage-soft);
  box-shadow: 0 8px 24px rgba(93, 71, 65, 0.1);
  cursor: pointer;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 300ms ease;
}

.gallery-item:hover img {
  transform: scale(1.035);
}

.video-label {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(93, 71, 65, 0.78);
  color: #fff;
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  backdrop-filter: blur(6px);
}

.load-more-wrap {
  padding: 30px 0 0;
  text-align: center;
}

.photo-modal {
  position: fixed;
  z-index: 9999;
  inset: 0;
  display: flex;
  align-items: center;
  flex-direction: column;
  justify-content: center;
  background: rgba(37, 29, 27, 0.96);
}

.photo-modal[hidden] {
  display: none;
}

.modal-close {
  position: fixed;
  z-index: 3;
  top: 14px;
  right: 16px;
  display: grid;
  width: 44px;
  height: 44px;
  place-items: center;
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  cursor: pointer;
  font-size: 1.8rem;
}

.modal-media-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: calc(100vh - 92px);
  padding: 18px;
}

.modal-media-wrap img,
.modal-media-wrap video {
  max-width: 100%;
  max-height: 100%;
  border-radius: 14px;
}

.modal-actions {
  display: flex;
  gap: 10px;
  width: min(500px, 100%);
  height: 76px;
  padding: 10px 16px 16px;
}

.modal-actions button {
  flex: 1;
  border: 0;
  border-radius: 999px;
  background: var(--event-bg-soft);
  color: var(--event-ink);
  cursor: pointer;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

@media (max-width: 860px) {
  .gallery-header {
    min-height: 390px;
    background:
      linear-gradient(90deg, rgba(255, 250, 245, 0.94), rgba(255, 250, 245, 0.52)),
      url("/convite/assets/wide-pink-horse.jpg") 62% center / cover no-repeat;
  }

  .gallery-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
}

@media (max-width: 580px) {
  .gallery-header {
    min-height: 370px;
    align-items: end;
    padding: 80px 18px 70px;
  }

  .header-nav {
    top: 14px;
    right: 14px;
  }

  .header-monogram {
    width: 90px;
  }

  .gallery-header h1 {
    font-size: clamp(3.2rem, 17vw, 4.5rem);
  }

  main {
    padding: 18px 10px 46px;
  }

  .gallery-intro {
    align-items: stretch;
    flex-direction: column;
    padding: 0 6px;
  }

  .send-button {
    text-align: center;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 7px;
  }

  .gallery-item {
    border-radius: 10px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .gallery-item img {
    transition: none;
  }
}
