/* ------------------------------
   GLOBAL RESET + BASE STYLES
--------------------------------*/
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  height: 100%;
  width: 100%;
  overflow-x: hidden;
  background: #fffdf9;
  font-family: 'Italianno', cursive;
}

/* Body starts BELOW the floral banner */
body {
  margin-top: 12vh; /* banner height */
}

/* ------------------------------
   FLORAL BANNER (unchanged)
--------------------------------*/
.floral-banner {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100vw;
  overflow: hidden;
  z-index: 1;
}

.floral-img {
  width: 110vw;
  max-width: none;
  transform: translateX(-5vw);
}

/* ------------------------------
   CLEAN MASONRY GRID
--------------------------------*/
.photo-grid {
  column-count: 2;
  column-gap: 12px;
  padding: 12px;
  position: relative;
  z-index: 2; /* ensures grid is above banner */
}

@media (min-width: 600px) {
  .photo-grid { column-count: 3; }
}

@media (min-width: 900px) {
  .photo-grid { column-count: 4; }
}

.photo-card {
  display: inline-block;
  width: 100%;
  break-inside: avoid;
  margin-bottom: 12px;
  border-radius: 12px;
  overflow: hidden;
  background: #ffffff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.08);
  cursor: pointer;
  transition: transform 0.2s ease;
}

.photo-card:hover {
  transform: scale(1.02);
}

.photo-card img {
  width: 100%;
  display: block;
  min-height: 120px; /* prevents collapse */
  background: #f3f3f3;
  object-fit: cover;
}

.photo-name {
  font-family: 'Italianno', cursive;
  font-size: 1.4rem;
  padding: 6px 10px 10px;
  color: #7a6f68;
  text-align: center;
}
/* ------------------------------
   FIXED UPLOAD MODAL (RESTORED)
--------------------------------*/
.upload-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 4000; /* ABOVE banner + grid */
}

.upload-modal.show {
  display: flex;
}

.upload-modal-content {
  width: 90%;
  max-width: 420px;
  background: #fffdfb;
  border-radius: 16px;
  padding: 18px 16px 16px;
  box-shadow: 0 4px 16px rgba(0,0,0,0.18);
  position: relative;
  z-index: 4100;
    display: flex;
  flex-direction: column;
  font-family: 'Alice', serif;
  gap: 14px; /* spacing between fields */
}

.upload-modal-content h2,
.upload-modal-content .modal-title {
  font-family: 'Alice', serif;
  font-size: 1.6rem;
  color: #5a4a42;
  text-align: center;
  margin-bottom: 4px;
}

.close-modal {
  position: absolute;
  top: 8px;
  right: 12px;
  font-size: 1.6rem;
  cursor: pointer;
  z-index: 4200;
}

/* ------------------------------
   SIMPLE IMAGE MODAL
--------------------------------*/
.image-modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  display: none;
  justify-content: center;
  align-items: center;
  z-index: 3000;
}

.image-modal.show {
  display: flex;
}

.modal-image {
  max-width: 90vw;
  max-height: 80vh;
  border-radius: 12px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.4);
}

.modal-caption {
  /* position caption at the bottom of the viewport overlay */
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  font-family: 'Alice', cursive;
  font-size: 1.6rem;
  color: #000000;
  text-align: center;
  max-width: calc(100% - 10px);
  padding: 8px 12px;
  background: rgba(255, 255, 255, 1);
  border-radius: 10px;
  z-index: 3050; /* ensure caption sits above the modal image but below close button */
}

.close-image-modal {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 2.4rem;
  color: #fff;
  cursor: pointer;
  z-index: 3100; /* sits above caption (3050) */
}

/* ------------------------------
   RESTORE SHARE A PHOTO BUTTON
--------------------------------*/
.pretty-upload-btn {
  display: block;
  margin: 14px auto 18px;
  padding: 10px 22px;
  max-width: 320px;
  text-align: center;
  border-radius: 999px;
  border: none;
  background: #f7cfe5;
  color: #5b4a4a;
  font-family: 'Alex Brush', cursive;
  font-size: 1.35rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.pretty-upload-btn:active {
  transform: scale(0.96);
  box-shadow: 0 1px 4px rgba(0,0,0,0.1);
}

/* ------------------------------
   RESTORE PHOTO WALL HEADER
--------------------------------*/
.pw-header {
  text-align: center;
  margin-top: 20px;
  margin-bottom: 24px;
  position: relative;
  z-index: 3; /* ensures it's above the banner */
}

.pw-header h1 {
  font-family: 'Alex Brush', cursive;
  font-size: 2.6rem;
  color: #5a4a42;
  margin-bottom: 6px;
}

.pw-subtitle {
  font-family: 'Italianno', cursive;
  font-size: 1.9rem;
  color: #7a6f68;
  margin-top: 0;
}


/* ------------------------------
   FIX: Share a Photo button layering
--------------------------------*/
.pretty-upload-btn {
  position: relative;
  z-index: 5; /* ABOVE floral banner (z-index 1), BELOW modal (z-index 4000) */

  
}


/* ------------------------------
   FIX: STACKED UPLOAD MODAL FIELDS
--------------------------------*/
.upload-modal-content {
  display: flex;
  flex-direction: column;
  gap: 14px; /* spacing between fields */
}

#photoUpload,
.photo-name-input,
.photo-message-input {
  width: 100%;
  font-family: 'Alice', serif;
  display: block;
}

.photo-name-input,
.photo-message-input {
  border-radius: 10px;
  border: 1px solid #e2d4cf;
  padding: 10px;
  font-size: 1rem;
  font-family: 'Alice', serif;
}

.photo-message-input {
  min-height: 80px;
  resize: vertical;
}

.modal-upload-btn {
  display: block;
  margin: 14px auto 18px;
  padding: 10px 22px;
  max-width: 320px;
  text-align: center;
  border-radius: 999px;
  border: none;
  background: #f7cfe5;
  color: #5b4a4a;
  font-family: 'Alex Brush', cursive;
  font-size: 1.35rem;
  box-shadow: 0 2px 6px rgba(0,0,0,0.12);
  cursor: pointer;
}


/******************** CONFETTI UPLOAD ********************/
.confetti {
  position: fixed;
  top: -10px;
  width: 8px;
  height: 14px;
  background: #e8d4cc;
  opacity: 0.9;
  animation: pastelFall 3.5s ease-in forwards;
  border-radius: 2px;
}

@keyframes pastelFall {
  0% { transform: translateY(0) rotate(0deg); opacity: 1; }
  100% { transform: translateY(110vh) rotate(360deg); opacity: 0.4; }
}

/**************************** THANK YOU ************************/
.thank-you-message {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background: #fffdf9;
  padding: 12px 20px;
  border-radius: 20px;
  border: 2px solid #e8d4cc;
  font-family: 'Alex Brush', cursive;
  font-size: 1.6rem;
  color: #5a4a42;
  box-shadow: 0 4px 10px rgba(0,0,0,0.1);
  opacity: 1;
  transition: opacity 1s ease;
}

/* Thank you modal (centered) */
.thank-you-modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.45);
  z-index: 5000; /* above upload modal */
}
.thank-you-modal.show {
  display: flex;
}
.thank-you-content {
  background: #fffdf9;
  padding: 20px 24px;
  border-radius: 14px;
  text-align: center;
  box-shadow: 0 6px 18px rgba(0,0,0,0.2);
  font-family: 'Alice', serif;
  color: #5a4a42;
}
.thank-you-content p { margin: 6px 0; font-size: 1.25rem; }

/************ BACK BUTTON *****************/
.back-btn {
  position: fixed;
  bottom: 20px;
  left: 20px;
  width: 48px;
  height: 48px;
  background: #f1e3df;
  border-radius: 50%;
  display: flex;
  justify-content: center;
  align-items: center;
  text-decoration: none;
  box-shadow: 0 4px 10px rgba(0,0,0,0.15);
  z-index: 1000; /* lowered so modals (z-index >= 3000) appear above the back button */
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  opacity: 0;
  animation: fadeInBackBtn 0.6s ease forwards 0.4s;
}

@keyframes fadeInBackBtn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.back-btn:active {
  transform: scale(0.92);
  box-shadow: 0 2px 6px rgba(0,0,0,0.1);
}

.back-arrow {
  font-size: 1.8rem;
  color: #5a4a42;
  display: flex;
  align-items: center;
  justify-content: center;
}

/****** END *******/
