/* ==========================================================================
   DESIGN SYSTEM & CUSTOM STYLING - JULIANA & GUILHERME
   ========================================================================== */

/* --- Custom Font Face Definitions --- */
@font-face {
  font-family: "BellMT";
  src: url("../fonts/BELL-MT-REGULAR.TTF") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "BellMT";
  src: url("../fonts/BELL-MT-ITAIC.TTF") format("truetype");
  font-weight: normal;
  font-style: italic;
}
@font-face {
  font-family: "BellMT";
  src: url("../fonts/BELL-MT-BOLD.TTF") format("truetype");
  font-weight: bold;
  font-style: normal;
}
@font-face {
  font-family: "Philosopher";
  src: url("../fonts/Philosopher-Regular.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}
@font-face {
  font-family: "Kingsguard";
  src: url("../fonts/Kingsguard.ttf") format("truetype");
  font-weight: normal;
  font-style: normal;
}

/* --- Color Palette variables --- */
:root {
  --color-cream-white: #fffef7;
  --color-cream-yellow: #fffbd6;
  --color-soft-peach: #ffd0b5;
  --color-vibrant-orange: #fd6746;
  --color-pale-lilac: #f4ebf5;
  --color-soft-purple: #d2afe0;
  --color-medium-purple: #8e3491;
  --color-dark-purple: #6b1b60;
  --color-light-sage: #c7c9a1;
  --color-muted-green: #97a061;
  --color-dark-sage: #65722d;
  --color-deep-olive: #596928;
}

/* --- Font Utility Classes --- */
.font-bell-reg {
  font-family: "BellMT", serif;
  font-weight: normal;
  font-style: normal;
}
.font-bell-italic {
  font-family: "BellMT", serif;
  font-weight: normal;
  font-style: italic;
}
.font-bell-bold {
  font-family: "BellMT", serif;
  font-weight: bold;
  font-style: normal;
}
.font-philosopher {
  font-family: "Philosopher", sans-serif;
  font-weight: normal;
}
.font-kingsguard {
  font-family: "Kingsguard", sans-serif;
  font-weight: normal;
  font-style: normal;
}

/* --- Global Styling --- */
body {
  background-color: var(--color-cream-white);
  color: var(--color-dark-purple);
  font-family: "BellMT", serif;
  overflow-x: hidden;
  position: relative;
}

/* Body lock when envelope is closed */
body.envelope-locked {
  overflow: hidden;
  height: 100vh;
}

/* --- Interactive Envelope Styles --- */
#envelope-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: var(--color-cream-white);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  transition:
    opacity 0.8s cubic-bezier(0.4, 0, 0.2, 1),
    visibility 0.8s;
}

#envelope-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.envelope-wrapper {
  position: relative;
  width: 90vw;
  max-width: 480px;
  height: 320px;
  background-color: var(--color-dark-purple);
  border-radius: 4px;
  box-shadow: 0 15px 35px rgba(107, 27, 96, 0.25);
  perspective: 1000px;
}

/* Envelope Flaps */
.envelope-flap-top {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 45vw solid transparent;
  border-right: 45vw solid transparent;
  border-top: 160px solid var(--color-medium-purple);
  transform-origin: top;
  transition:
    transform 0.6s ease 0.2s,
    border-top-color 0.4s,
    z-index 0.1s ease 0.4s;
  z-index: 4;
}

@media (min-width: 480px) {
  .envelope-flap-top {
    border-left: 240px solid transparent;
    border-right: 240px solid transparent;
    border-top: 160px solid var(--color-medium-purple);
  }
}

.envelope-flap-bottom {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 0;
  border-left: 45vw solid transparent;
  border-right: 45vw solid transparent;
  border-bottom: 160px solid var(--color-dark-purple);
  z-index: 3;
}

@media (min-width: 480px) {
  .envelope-flap-bottom {
    border-left: 240px solid transparent;
    border-right: 240px solid transparent;
    border-bottom: 160px solid var(--color-dark-purple);
  }
}

.envelope-flap-left {
  position: absolute;
  top: 0;
  left: 0;
  width: 0;
  height: 0;
  border-top: 160px solid transparent;
  border-bottom: 160px solid transparent;
  border-left: 225px solid rgba(107, 27, 96, 0.95);
  z-index: 3;
}
@media (max-width: 480px) {
  .envelope-flap-left {
    border-left-width: 45vw;
  }
}

.envelope-flap-right {
  position: absolute;
  top: 0;
  right: 0;
  width: 0;
  height: 0;
  border-top: 160px solid transparent;
  border-bottom: 160px solid transparent;
  border-right: 225px solid rgba(107, 27, 96, 0.95);
  z-index: 3;
}
@media (max-width: 480px) {
  .envelope-flap-right {
    border-right-width: 45vw;
  }
}

/* Card Inside */
.envelope-card {
  position: absolute;
  top: 10px;
  left: 5%;
  width: 90%;
  height: 90%;
  background-color: var(--color-cream-white);
  border: 1px solid var(--color-soft-purple);
  border-radius: 4px;
  z-index: 2;
  transition: transform 0.8s cubic-bezier(0.4, 0, 0.2, 1) 0.5s;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 20px;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.envelope-card .monogram-img {
  max-height: 50px;
  margin-bottom: 10px;
}

.envelope-card .couple-names {
  font-size: 1.5rem;
  color: var(--color-dark-purple);
  margin-bottom: 5px;
}

.envelope-card .envelope-hint {
  font-size: 0.8rem;
  letter-spacing: 1px;
  text-transform: uppercase;
  color: var(--color-muted-green);
}

/* Wax Seal Button */
.wax-seal-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  z-index: 5;
  cursor: pointer;
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transition: transform 0.3s ease;
}

.wax-seal-container:hover {
  transform: translate(-50%, -50%) scale(1.08);
}

.wax-seal-img {
  width: 75px;
  height: 75px;
  object-fit: contain;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.3));
  animation: seal-pulse 2s infinite ease-in-out;
}

.wax-seal-label {
  margin-top: 10px;
  font-family: "Philosopher", sans-serif;
  color: var(--color-cream-yellow);
  font-size: 0.9rem;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  pointer-events: none;
  opacity: 0.9;
}

/* Animation keyframes for seal pulse */
@keyframes seal-pulse {
  0%,
  100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.06);
  }
}

/* Open Envelope States */
.envelope-wrapper.open .envelope-flap-top {
  transform: rotateX(180deg);
  border-top-color: var(--color-dark-purple);
  z-index: 1;
}

.envelope-wrapper.open .envelope-card {
  transform: translateY(-135px) scale(1.02);
  z-index: 4;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.envelope-wrapper.open .wax-seal-container {
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.5);
  pointer-events: none;
  transition:
    opacity 0.4s ease,
    transform 0.4s ease;
}

/* --- Section Layouts --- */
.section-padding {
  padding: 80px 0;
}

.section-padding-bottom {
  padding: 0 0 80px 0;
}
@media (max-width: 768px) {
  .section-padding {
    padding: 50px 0;
  }
}

.invitation-intro {
  background-image: url("../images/ESTAMPA.png");
  background-size: cover;
  background-position: center;
  position: relative;
  padding: 100px 0;
  border-bottom: 2px solid var(--color-pale-lilac);
}

.invitation-intro::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(
    255,
    254,
    247,
    0.92
  ); /* Overlays ESTAMPA to keep text highly legible */
  z-index: 1;
}

.invitation-intro .container {
  position: relative;
  z-index: 2;
}

.monogram-main {
  max-width: 100px;
  height: auto;
  margin-bottom: 25px;
}

.title-wedding {
  font-size: 3.5rem;
  color: var(--color-dark-purple);
  margin-bottom: 20px;
}
@media (max-width: 768px) {
  .title-wedding {
    font-size: 2.6rem;
  }
}

.subtitle-wedding {
  font-size: 1.1rem;
  letter-spacing: 2px;
  text-transform: uppercase;
  color: var(--color-medium-purple);
}

.wedding-text-muted {
  font-size: 1rem;
  color: var(--color-deep-olive);
  max-width: 600px;
  margin: 0 auto;
  line-height: 1.6;
}

.wedding-details-info {
  font-size: 1.25rem;
  color: var(--color-dark-purple);
  margin: 30px 0;
  letter-spacing: 1px;
}

/* --- Scroll Overlap Layouts --- */
.scroll-overlap-container {
  position: relative;
  height: 180vh; /* Determines scroll duration */
  background-color: var(--color-cream-white);
  margin: 0;
  z-index: 1;
}

.scroll-overlap-container.bg-cream {
  background-color: var(--color-cream-white);
}

.sticky-photo-wrapper {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
  padding: 0;
}

.photo-frame {
  position: relative;
  width: 100%;
  max-width: 1920px;
  height: 100vh;
  background-color: transparent;
  border: none;
  box-shadow: none;
  border-radius: 0;
  overflow: hidden;
}

/* Slide containers for blurred backgrounds (desktop) */
.photo-slide {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.photo-slide.overlay-img {
  z-index: 2;
  clip-path: inset(100% 0% 0% 0%); /* Hidden initially */
  /* Transitions are driven by JS */
}

/* Blurred background image for vertical photos */
.photo-frame .blur-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(30px) brightness(0.75);
  transform: scale(1.1);
  opacity: 0.65;
  z-index: 1;
}

/* Sharp centered foreground image */
.photo-frame .sharp-fg {
  position: relative;
  width: 100%;
  height: 100%;
  object-fit: contain;
  z-index: 2;
}

/* Default photo-frame images styling (e.g. for Photo 4 & 5) */
.photo-slide img:not(.blur-bg):not(.sharp-fg) {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.1s ease-out;
}

.photo-frame .bg-img {
  z-index: 1;
}

.photo-frame .overlay-img {
  z-index: 2;
}

/* --- Photo Frame Decorations --- */
.photo-decorations-container {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 100%;
  height: 100%;
  max-width: calc(
    80vh * 1.5
  ); /* 3:2 aspect ratio width constraint on desktop */
  max-height: calc(
    min(100vw, 1920px) / 1.5
  ); /* 3:2 aspect ratio height constraint on desktop */
  z-index: 10;
  pointer-events: none;
  overflow: visible;
}

/* Perched bird at top-right corner of the photo box */
.decor-bird-perched {
  position: absolute;
  z-index: 10;
  top: calc(10vh + 20px);
  right: 20px;
  width: 90px;
  height: auto;
  transform: translate(15%, -85%);
  z-index: 11;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Flying bird at bottom-left corner of the photo box */
.decor-bird-flying {
  position: absolute;
  bottom: calc(10vh + 30px);
  left: calc(3vw + 30px);
  width: 180px;
  height: auto;
  transform: translate(-100%, -15%);
  z-index: 11;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* Mushrooms at bottom-right corner of the photo box */
.decor-mushrooms {
  position: absolute;
  bottom: calc(10vh + 30px);
  right: 40px;
  width: 100px;
  height: auto;
  transform: translate(15%, 85%);
  z-index: 11;
  filter: drop-shadow(0 4px 8px rgba(0, 0, 0, 0.15));
}

/* --- Intermediate Details Section --- */
.flower-divider {
  max-height: 80px;
  width: auto;
  margin: 25px auto;
}

.section-date-place {
  background-color: var(--color-cream-white);
  text-align: center;
}

.big-date {
  font-size: 2.2rem;
  color: var(--color-dark-purple);
  letter-spacing: 2px;
  text-transform: uppercase;
}

.big-time {
  font-size: 1.5rem;
  color: var(--color-medium-purple);
  letter-spacing: 3px;
  margin: 10px 0;
}

.location-title {
  font-family: "Philosopher", sans-serif;
  font-size: 1.8rem;
  color: var(--color-dark-sage);
  margin-top: 15px;
}

/* --- Interactive Action Buttons Section --- */
.section-buttons {
  background-color: var(--color-pale-lilac);
  border-top: 1px solid var(--color-soft-purple);
  border-bottom: 1px solid var(--color-soft-purple);
}

.section-buttons .intro-text {
  font-family: "Philosopher", sans-serif;
  font-size: 1.35rem;
  color: var(--color-dark-purple);
  margin-bottom: 40px;
}

.wedding-btn-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
  max-width: 420px;
  margin: 0 auto;
}

.btn-wedding-action {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: 15px 25px;
  background-color: var(--color-dark-purple);
  color: var(--color-cream-white);
  border: 2px solid var(--color-dark-purple);
  border-radius: 50px;
  font-family: "Philosopher", sans-serif;
  font-size: 1.15rem;
  transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: 0 4px 12px rgba(107, 27, 96, 0.15);
  text-decoration: none;
  cursor: pointer;
}

.btn-wedding-action:hover {
  background-color: transparent;
  color: var(--color-dark-purple);
  transform: translateY(-3px);
  box-shadow: 0 8px 20px rgba(107, 27, 96, 0.25);
}

.btn-wedding-action .btn-icon {
  width: 26px;
  height: 26px;
  object-fit: contain;
  margin-right: 18px;
  transition: transform 0.35s ease;
}

.btn-wedding-action:hover .btn-icon {
  transform: scale(1.15) rotate(5deg);
}

/* Modal Custom Styling */
.modal-content {
  background-color: var(--color-cream-white);
  border: 3px solid var(--color-soft-purple);
  border-radius: 12px;
  box-shadow: 0 10px 30px rgba(107, 27, 96, 0.15);
}

.modal-header {
  border-bottom: 1px solid var(--color-soft-purple);
  padding: 20px 25px;
}

.modal-title {
  font-family: "Philosopher", sans-serif;
  color: var(--color-dark-purple);
  font-weight: normal;
}

.modal-body {
  padding: 25px;
  font-size: 1.05rem;
  color: var(--color-dark-purple);
  line-height: 1.6;
}

.modal-footer {
  border-top: 1px solid var(--color-soft-purple);
  padding: 15px 25px;
}

.btn-modal-close {
  background-color: var(--color-medium-purple);
  color: var(--color-cream-white);
  border: none;
  padding: 8px 20px;
  border-radius: 20px;
  font-family: "Philosopher", sans-serif;
  font-size: 0.95rem;
  transition: all 0.3s;
}

.btn-modal-close:hover {
  background-color: var(--color-dark-purple);
}

/* --- Rules Guidelines Section --- */
.section-rules {
  background-color: var(--color-cream-white);
}

.rules-title {
  font-size: 2.5rem;
  color: var(--color-dark-purple);
  margin-bottom: 40px;
}

.rules-list {
  list-style: none;
  padding: 0;
  max-width: 680px;
  margin: 0 auto;
  text-align: left;
}

.rules-list li {
  position: relative;
  padding-left: 45px;
  margin-bottom: 25px;
  font-size: 1.3rem;
  line-height: 1.6;
  color: var(--color-dark-purple);
}

/* Custom Bullet Marker */
.rules-list li::before {
  content: "";
  position: absolute;
  left: 8px;
  top: 6px;
  width: 20px;
  height: 20px;
  background-image: url("../icons/like.png"); /* Like icon as bullet */
  background-size: contain;
  background-repeat: no-repeat;
}

.rule-highlight {
  font-weight: bold;
  color: var(--color-medium-purple);
}

/* --- Footer --- */
footer {
  background-color: var(--color-dark-purple);
  color: var(--color-cream-white);
  padding: 50px 0;
}

.footer-monogram {
  max-width: 70px;
  opacity: 0.85;
  margin-bottom: 20px;
}

.footer-text {
  font-size: 0.95rem;
  opacity: 0.8;
}

/* --- Mobile Viewport Adjustments (100vh overrides) --- */
@media (max-width: 767px) {
  /* Set photos 1, 2, 4, 5 to 80vh height and cover */
  .photo-frame {
    height: 100vh !important;
  }

  /* Hide blur background layers on mobile devices */
  .photo-frame .blur-bg {
    display: none !important;
  }

  /* Force sharp foregrounds (Photos 1, 2) and generic images (Photos 4, 5) to cover */
  .photo-frame .sharp-fg,
  .photo-frame .photo-slide img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    object-fit: cover !important;
  }

  /* Set Photo 3 to 100vh height and cover */
  .photo-003-mobile {
    height: 100vh !important;
    object-fit: cover !important;
  }

  /* Align Photo 2 to the left on mobile to show the couple */
  .photo-frame img[src*="002.jpg"] {
    object-position: left center !important;
  }

  /* Reset decorations container to 80vh and center vertically on mobile */
  .photo-decorations-container {
    width: 100% !important;
    height: 80vh !important;
    max-width: 100% !important;
    max-height: 80vh !important;
    top: 50% !important;
    left: 50% !important;
    transform: translate(-50%, -50%) !important;
  }

  /* Position perched bird near top-right corner of screen */
  .decor-bird-perched {
    width: 85px;
    top: -85px;
    right: 0px;
    transform: translate(0, 0);
  }

  /* Position flying bird near bottom-left corner of screen */
  .decor-bird-flying {
    width: 120px;
    bottom: 8%;
    left: 15px;
    transform: translate(0, 0);
  }

  /* Position mushrooms at bottom-right corner of screen */
  .decor-mushrooms {
    width: 80px;
    bottom: 0;
    right: 10px;
    transform: translate(0, 15%);
  }
}
