/* =======================
   Reset & Basics
   ======================= */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  font-family: 'Figtree', sans-serif;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  cursor: url('images/MIMI.cur'), auto;
  max-width: 100vw;
  overflow-x: hidden;
}

/* =======================
   Header
   ======================= */
header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background: rgb(124,149,117);
  display: flex;
  align-items: center;
  padding: 0 1rem;
  z-index: 1001;
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: nowrap;
  width: 100%;
}

.site-title {
  color: white;
  font-size: 1.5rem;
}

.nav-toggle {
  font-size: 1.5rem;
  background: none;
  border: none;
  color: white;
  cursor: pointer;
  display: none; /* hidden on desktop */
}

/* Nav links (desktop) */
.section-nav {
  display: flex;
  gap: 1.5rem;
  margin-left: auto;
  flex-wrap: nowrap;
}

.section-nav a {
  color: white;
  text-decoration: none;
  font-weight: bold;
  white-space: nowrap;
}

/* Close button hidden by default */
.nav-close {
  display: none;
}

/* =======================
   Main
   ======================= */
main {
  height: 100vh;
  overflow-y: scroll;
  scroll-snap-type: y mandatory;
}

/* Sections */
.section {
  scroll-snap-align: start;
  min-height: 100vh;
  display: flex;
  justify-content: center;
  align-items: center;
  padding-top: 60px;
  font-size: 2rem;
}

/* Welcome Section */
#welcome { 
  background: #f0f5f0;
  position: relative;
  width: 100%;
  min-height: 100vh;
  background-image: url('images/ringphoto.JPG');
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  display: flex;
  justify-content: center;
  align-items: center;
}

/* Dark Overlay for Text Readability */
#welcome .overlay {
  background: rgba(124,149,117, 0.8);
  padding: 3rem 2rem;
  border-radius: 15px;
  text-align: center;
}

/* Heading */
#welcome h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #f9f9f9;
}

/* Paragraph */
#welcome p {
  font-size: 1.5rem;
  margin-bottom: 2rem;
  color: #f0f0f0;
}

/* Button */
#welcome .btn {
  display: inline-block;
  padding: 0.75rem 2rem;
  background-color: #7ca975;
  color: white;
  text-decoration: none;
  border-radius: 10px;
  font-size: 1.2rem;
  transition: background-color 0.3s ease;
}

#welcome .btn:hover {
  background-color: #67935f;
}

/* Info Section */
#info { background: #e4ebe4; }

.info-overlay {
  background: white;
  max-width: 800px;
  min-width: 0;
  min-height: 700px;
  width: 90%;
  padding: 2rem 2.5rem;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  position: relative;
  z-index: 10;
}

.info-overlay h2 {
  font-size: 3rem;
  margin-bottom: 1rem;
  color: #7ca975;
  text-align: center;
}

.info-overlay p.info-main {
  font-size: 1.5rem;
  margin-bottom: 0.75rem;
  color: #7ca975;
  text-align: center;
}

.info-overlay p.info-sub {
  font-size: 1.2rem;
  margin-bottom: 0.5rem;
  color: #7ca975;
  text-align: center;
}

.side-photo {
  max-width: 300px;
  height: auto;
  border-radius: 15px;
  z-index: 1;
  position: relative;
  margin-left: auto;
  margin-right: auto;
}

/* RSVP Section */
#rsvp {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  background: #f0f5f0;
  min-height: 100vh;
  scroll-snap-align: start;
}

/* RSVP overlay */
.rsvp-overlay {
  background: rgba(255, 255, 255, 0.8);
  max-width: 480px;
  width: 90%;
  padding: 2rem 2.5rem;
  border-radius: 15px;
  box-shadow: 0 10px 25px rgba(0,0,0,0.12);
  position: relative;
  z-index: 10;
}

/* RSVP Form */
#rsvpForm h2 {
  font-size: 3rem;
  margin-bottom: 0.5rem;
  color: #7ca975;
  text-align: center;
}

#rsvpForm p {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
  color: #7ca975;
  text-align: center;
}

.input-container {
  margin-bottom: 1.5rem;
}

.input-container input[type="text"] {
  width: 100%;
  padding: 0.65rem 1rem;
  border-radius: 8px;
  border: 1.5px solid #a8bfa1;
  font-size: 1rem;
  text-align: center;
}

.button-group {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 1.8rem;
}

.toggle-btn {
  padding: 0.6rem 1.5rem;
  border: 2px solid #7ca975;
  border-radius: 12px;
  background-color: white;
  color: #7ca975;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s ease;
}

.toggle-btn.selected {
  background-color: #7ca975;
  color: white;
}

.radio-group {
  display: flex;
  justify-content: center;
  gap: 30px;
  margin-bottom: 1.8rem;
}

#rsvpForm label {
  display: block;
  margin-top: 10px;
  margin-bottom: 15px;
  font-weight: 600;
  color: #92bd79;
  text-align: center;
  font-size: 1.5rem;
}

.radio-group label {
  font-weight: 600;
  color: #7ca975;
  cursor: pointer;
}

.radio-group input[type="radio"] {
  margin-right: 0.35rem;
  cursor: pointer;
}

#rsvpForm button[type="submit"] {
  width: 100%;
  background-color: #7ca975;
  border: none;
  border-radius: 12px;
  padding: 0.85rem 1rem;
  color: white;
  font-size: 1.2rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.25s ease;
}

#rsvpForm button[type="submit"]:hover {
  background-color: #6a8b5d;
}

#loadingSpinner {
  display: none;
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 60px;
  height: 60px;
  z-index: 20;
}

.spinner-inner {
  width: 100%;
  height: 100%;
  border: 8px solid #c4d0bc;
  border-top: 8px solid #7ca975;
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* Thank You Message */
#thankYouMessage {
  display: none;
  position: absolute;
  top: 15%;
  left: 50%;
  transform: translateX(-50%);
  background: #7ca975;
  color: white;
  padding: 40px 60px;
  border-radius: 20px;
  font-weight: 700;
  font-size: 1rem;
  text-align: center;
  box-shadow: 0 12px 30px rgba(0,0,0,0.4);
  width: 400px;
  max-width: 90%;
  min-width: 300px;
  cursor: grab;
  z-index: 20;
}

#closeThankYou {
  position: absolute;
  top: 0.3rem;
  right: 1rem;
  font-size: 2rem;
  cursor: pointer;
  color: white;
}

#photos { background: #e4ebe4; }
#honeymoon { background: #f0f5f0; }

/* Footer */
footer {
  background: rgb(124,149,117);
  color: white;
  text-align: center;
  padding: 1rem;
  position: fixed;
  bottom: 0;
  width: 100%;
}

/* Grid photo layout */
.rsvp-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-auto-rows: 150px;
  gap: 5px;
  grid-auto-flow: dense;
  width: 100%;
  position: absolute;
  top: 0;
  left: 0;
  z-index: 1;
  box-sizing: border-box;
  max-width: 100%;
}

.grid-photo {
  background-size: cover;
  background-position: center;
  width: 100%;
  height: 100%;
  border: #6a8b5d 2px solid;
  box-sizing: content-box;
}

.photo1 { background-image: url('images/example-photo.jpg'); grid-column: span 2; grid-row: span 2; }
.photo2 { background-image: url('images/example-photo.jpg'); }
.photo3 { background-image: url('images/example-photo.jpg'); }
.photo4 { background-image: url('images/example-photo.jpg'); grid-row: span 3; grid-column: span 2; }
.photo5, .photo6, .photo7, .photo10, .photo11, .photo12,
.photo13, .photo14 {
  background-image: url('images/example-photo.jpg');
}
.photo8 { background-image: url('images/example-photo.jpg'); grid-column: span 2; }
.photo9 { background-image: url('images/example-photo.jpg'); grid-row: span 2; }

/* =======================
   Mobile Styles ≤768px
   ======================= */
@media (max-width: 768px) {

  .site-title {
    font-size: 1.2rem;
  }

  /* Show hamburger on mobile */
  .nav-toggle {
    display: block;
  }

  /* Slide-in nav */
  .section-nav {
    position: fixed;
    top: 60px;
    right: -250px;
    width: 250px;
    height: calc(100% - 60px);
    background-color: rgb(124,149,117);
    flex-direction: column;
    padding-top: 20px;
    transition: right 0.3s ease;
    z-index: 1000;
  }

  .section-nav.show {
    right: 0;
  }

  .section-nav a {
    padding: 1rem;
    border-bottom: 1px solid rgba(255,255,255,0.3);
    font-size: 1.2rem;
    color: white;
  }

  /* Close button visible on mobile */
  .nav-close {
    display: block;
    position: absolute;
    top: 10px;
    right: 15px;
    font-size: 2rem;
    background: none;
    border: none;
    color: white;
    cursor: pointer;
    z-index: 1010;
  }

  #welcome h1 {
    font-size: 2rem;
  }

  #welcome p {
    font-size: 1.2rem;
  }

  #welcome .overlay {
    padding: 2rem 1rem;
  }

  .info-overlay {
    min-width: auto;
    width: 90%;
    max-width: 90%;
    min-height: auto;
    padding: 1.5rem 1.5rem;
  }

  .side-photo {
    display: none;
  }

  .info-section {
    background: url('images/mobile-bg.jpg') no-repeat center center;
    background-size: cover;
    padding: 6rem 2rem;
  }

  .rsvp-overlay {
    max-width: 95%;
  }

  .rsvp-grid {
    display: none;
  }
}

/* Mobile Popup Styles */
 #mobilePopup {
  display: none; /* hidden by default */
  position: fixed;
  bottom: 50px;
  left: 50%;
  transform: translateX(-50%);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  cursor: grab;
  max-width: 90vw;      /* added: never wider than screen */
}

/* Speech bubble */
#speechBubble {
  position: relative;
  background: #ffffff;
  color: #333;
  padding: 1.5rem 2rem;
  border-radius: 25px;
  width: 100%;           /* use full popup width */
  font-size: 1.1rem;
  text-align: center;
  box-shadow: 0 8px 20px rgba(0,0,0,0.3);
  box-sizing: border-box;
}

/* Speech bubble arrow */
#speechBubble::after {
  content: '';
  position: absolute;
  bottom: -20px;
  left: 50%;
  transform: translateX(-50%);
  border-width: 10px 10px 0 10px;
  border-style: solid;
  border-color: #ffffff transparent transparent transparent;
}

/* Close button */
#closePopup {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #7ca975;
  border: none;
  color: white;
  font-size: 1.5rem;
  border-radius: 50%;
  width: 28px;
  height: 28px;
  cursor: pointer;
  z-index: 10;
}

/* Cat image */
#popupCat {
  width: 80px;           /* fixed size */
  height: 80px;
  margin-top: 15px;
  object-fit: contain;   /* scale without distortion */
  display: block;        /* prevent inline gaps */
}

/* Bounce animation */
.bounce-word {
  display: inline-block;
  opacity: 0;
  transform: translateY(-20px);
  animation: bounceIn 0.5s forwards;
}

@keyframes bounceIn {
  0% {
    opacity: 0;
    transform: translateY(-20px);
  }
  50% {
    opacity: 1;
    transform: translateY(5px);
  }
  100% {
    opacity: 1;
    transform: translateY(0);
  }
}

/* Hide popup on desktop */
@media (min-width: 769px) {
  #mobilePopup {
    display: none !important;
  }
}