/* Reset and layout helpers */
*, *::before, *::after {
  box-sizing: border-box;
}

html, body {
  width: 100%;
  min-width: 0;
  margin: 0;
  padding: 0;
  overflow-x: hidden;
  font-family: 'Abhaya Libre', serif;
  color: #494b48;
  background-color: #fffceb;
  background: url('https://media-api.xogrp.com/images/ffc6294c-ae7a-4f2f-993d-48a87de08fd6~rt_auto-rs_2880.h?ordering=explicit&quality=90');
  background-repeat: no-repeat;
  background-position: center top;
  background-position-y: -250px;
}

/* Mobile background image */
@media (max-width: 600px) {
  html, body {
    background-image: url('https://media-api.xogrp.com/images/ffc6294c-ae7a-4f2f-993d-48a87de08fd6~rt_auto-rs_430.h?ordering=explicit&quality=90');
    background-position: center top;
    background-attachment: scroll;    
    background-position-y: -20px;
  }
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.wedding-date img {
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  border-radius: 0.5rem;
  object-fit: contain;
}

.button-link {
  /* fluid button sizing for responsive/mobile */
  width: min(92%, 420px);
  max-width: 420px;
  min-height: 48px; /* comfortable touch target */
  display: inline-flex;
  font-family: 'Abhaya Libre', serif;
  font-size: clamp(16px, 2.6vw, 22px);
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 1.1px;
  font-weight: 700;
  color: #ffffff;
  background: #313133;
  border: none;
  border-radius: 1000px;
  cursor: pointer;
  outline: none;
  position: relative;
  padding: 10px 16px;
  margin: 12px auto;
  overflow: visible;
  animation: borderPulse 1.2s infinite cubic-bezier(.2,.8,.2,1);
}

.wedding-place p {
  color: inherit;
  text-decoration: none;
  font-size: clamp(1.5rem, 5vw, 2.0rem);
  letter-spacing: 0.24rem;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  text-align: center;
  margin: 35px auto;
  font-family: Abhaya Libre;
}

@keyframes borderPulse {
  0% {
    box-shadow: inset 0px 0px 0px 5px rgba(255, 255, 255, 0.4), 0px 0px 0px 0px rgba(255,255,255,1);
  }
  50% {
    box-shadow: inset 0px 0px 0px 5px rgba(255, 255, 255, 0.2), 0px 0px 0px 5px rgba(255,255,255,0.5);
  } 
  100% {
    box-shadow: inset 0px 0px 0px 5px #313133, 0px 0px 0px 10px rgba(255,255,255,0);
  }
}

/* Header */
.header-container {
  width: 100%;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  min-height: 50vh;
  padding: 2.5rem 1rem;
  text-align: center;
  background-size: cover;
  background-attachment: scroll;
  position: relative;
}

.header-format {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding-top: 5.5rem;
}

.header-title {
  line-height: 1;
  margin: 1.5rem 0.5rem;
  color: #494b48;
  font-size: clamp(1.6rem, 6vw, 3rem);
  text-transform: uppercase;
  letter-spacing: clamp(0.04rem, 1vw, 0.4rem);
  font-weight: 400;
}
@media (max-width: 600px) {
  .header-title {
    font-size: clamp(2.8rem, 10vw, 5.5rem);
  }
}

.header-subtitle {

  font-size: 1.5rem;
  color: #494b48;
  letter-spacing: clamp(0.04rem, 1vw, 0.4rem);
  font-weight: 400;
}
@media (max-width: 600px) {
  .header-subtitle {
    font-size: clamp(0.2rem, 4vw, 5.5rem);
  }
}

.header-text {
  font-size: clamp(0.8rem, 2.5vw, 1rem);
  color: #494b48;
  margin: 0.6rem 0 1rem;
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  font-weight: 400;
}

/* Navigation */
.navbar-container {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  margin: 2rem auto;
  padding: 0 1rem;
}

.ul-format {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.25rem);
  padding: 0;
  margin: 0;
  list-style: none;
}

.li-format {
  text-decoration: none;
  color: #494b48;
  font-size: clamp(0.9rem, 2.2vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  padding: 0.5rem 1rem;
  border-bottom: 1px solid transparent;
  display: inline-block;
  transition: color 0.25s, border-bottom 0.25s, transform 0.15s;
}

.li-format:hover, .li-format:active, .li-format.active {
  color: #000;
  border-bottom-color: #000;
  transform: scale(1.05);
}

/* Section core visible/hidden states and fade helpers */
.section {
  opacity: 0;
  transform: translateY(6px);
  will-change: opacity, transform;
}
.section.visible {
  opacity: 1;
  transform: none;
}

/* Keyframe-based fade animations (used for cross-fade control) */
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeOut {
  from { opacity: 1; transform: translateY(0); }
  to   { opacity: 0; transform: translateY(6px); }
}
.fade-in {
  animation: fadeIn 500ms ease-in-out both;
}
.fade-out {
  animation: fadeOut 500ms ease-in-out both;
}

@media (prefers-reduced-motion: reduce) {
  .fade-in, .fade-out { animation: none !important; }
  .section { transition: none !important; }
}

/* Main container */
.main-container {
  flex: 1 0 auto;
  width: 100%;
  /* Limit the content width so it adapts to its contents and stays centered */
  max-width: 1100px;
  margin: 0 auto; /* center */
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  padding: 1rem;
  background: transparent;
  position: relative;
  z-index: 1; /* lower than header (header has z-index:3) */
}

/* Reusable two-column blocks (home, rsvp, photos) */
.home-content,
.rsvp-content,
.photos-content {
  display: flex;
  flex-direction: row;
  gap: 1rem;
  width: 100%;
  max-width: 1000px;
  margin: 0.5rem auto;
  padding: 0 1rem;
  align-items: stretch;
}

.home-content > *, .rsvp-content > *, .photos-content > * {
  flex: 1 1 0;
  min-width: 0;
}

/* Give the wedding-place column more room on wider screens */
.wedding-place {
  flex: 1.6 1 0;
}

/* Slightly reduce left column so combined width stays balanced */
.wedding-date {
  flex: 0.9 1 0;
}

.wedding-date,
.rsvp-confirmation,
.photos-instructions {
  /* photos-instructions should stack its children vertically (span above p) */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  padding: 1.25rem;
  border-right: 1px solid #3b3b3b;
  text-align: center;
}

@media (max-width: 900px) {
  .photos-instructions {
    border-right: none;
    border-bottom: 1px solid #3b3b3b;
  }
}

.wedding-date,
.rsvp-confirmation {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  border-right: 1px solid #3b3b3b;
  text-align: center;
}

.wedding-place,
.rsvp-list,
.photos-qr {
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  text-align: center;
}

/* Ensure the RSVP column centers its content vertically when layout is two-column */
.rsvp-content {
  /* center the RSVP block both axes so the button appears in the middle */
  align-items: center;
  justify-content: center;
  min-height: 40vh; /* give vertical room so centering is visible */
}

.rsvp-form {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0;
}

/* Stack text above the button in the wedding-place block */
.wedding-place {
  flex-direction: column;
  gap: 0.6rem;
}

/* Place top: icon + text row */
.place-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  text-align: center;
  padding: 0.25rem 0.5rem;
}

.place-icon {
  width: 7rem;
  height: 7rem;
  flex: 0 0 auto;
}

.place-text {
  margin: 0;
  font-size: clamp(0.95rem, 2.6vw, 1.1rem);
  line-height: 1.2;
  letter-spacing: 0.02rem;
}

@media (max-width: 600px) {
  .place-icon { width: 3.8rem; height: 3.8rem; }
  /* stack icon above text on small screens */
  .place-top {
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
  }
  .place-text { text-align: center; }
  .button-link { width: 100%; max-width: none; min-height: 48px; font-size: 16px; }
}

/* Center RSVP button container and allow animations to overflow */
.rsvp-form {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  overflow: visible; /* allow ring pseudo-elements to show */
  padding: 1rem 0;
}

.rsvp-form button {
  width: min(92%, 420px);
  max-width: 420px;
  min-height: 44px;
  display: inline-flex;
  font-family: 'Abhaya Libre', serif;
  font-size: clamp(16px, 3.2vw, 22px);
  align-items: center;
  justify-content: center;
  text-transform: uppercase;
  text-align: center;
  letter-spacing: 1.1px;
  font-weight: 700;
  color: #ffffff;
  background: #313133;
  border: none;
  border-radius: 1000px;
  transition: all 0.3s ease-in-out 0s;
  cursor: pointer;
  outline: none;
  position: relative;
  padding: 10px 14px;
  margin: 0 auto;
  overflow: visible;
}

@media (max-width: 600px) {
  .rsvp-form button {
    width: min(92%, 380px);
    min-height: 44px;
    font-size: clamp(15px, 4.2vw, 18px);
    padding: 8px 12px;
  }
  .button::before {
    width: calc(100% + 12px);
    height: calc(100% + 12px);
  }
}

.button::before {
content: '';
  border-radius: 1000px;
  /* size relative to the button so it scales on mobile */
  width: calc(100% + 12px);
  height: calc(100% + 12px);
  /* border: 6px solid #313133; */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  transition: all .3s ease-in-out 0s;
}

.button:hover, 
.button:focus {
  color: #ffffff;
  transform: translateY(-6px);
}

.button:hover::before, 
.button:focus::before {
  opacity: 1;
}

.button::after {
  content: '';
  width: 30px; height: 30px;
  border-radius: 100%;
  border: 6px solid #313133;
  position: absolute;
  z-index: -1;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  animation: ring 1.5s infinite;
}

.button:hover::after, 
.button:focus::after {
  animation: none;
  display: none;
}

@keyframes ring {
  0% {
    width: 30px;
    height: 30px;
    opacity: 1;
  }
  100% {
    width: 300px;
    height: 300px;
    opacity: 0;
  }
}

/* Photos Content Style (shared with main two-column layout) */

.photos-qr {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  padding: 72px 0% 72px 70px;
  width: 315px;
  max-width: 350px;
  font-family: Abhaya Libre;
  color: #494b48;
  font-size: 1rem;
  text-transform: uppercase;
  letter-spacing: 0.2rem;
  font-weight: 400;
  text-align: left;
  gap: 1.2rem;
}

/* QR container specific styles (cover both .photos-qr and .photos-qr-bar) */
.photos-qr,
.photos-qr-bar {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  max-width: 300px;
  aspect-ratio: 1 / 1;
  margin: 0.5rem auto;
  padding: 0.25rem;
}

.photos-instructions span {
  color: inherit;
  text-decoration: none;
  font-size: clamp(1.5rem, 3.8vw, 2rem);
  letter-spacing: 0.24rem;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  text-align: center;
  font-family: Abhaya Libre;
}

.photos-instructions p {
  color: inherit;
  text-decoration: none;
  font-size: clamp(1rem, 2.8vw, 1.25rem);
  letter-spacing: 0.24rem;
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.25rem;
  text-align: center;
  font-family: Abhaya Libre;
}

.photos-qr img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 0.5rem;
}

/* Questions section styling: make spans (questions) and paragraphs match page typography */
.questions-content {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: 1.25rem;
  width: 100%;
  max-width: 1000px;
  margin: 0.5rem auto;
  text-align: center; /* keep consistent with other sections */
  font-family: Abhaya Libre;
  color: #494b48;
}

.questions-content span {
  display: block;
  font-weight: 700;
  font-size: clamp(1rem, 2.6vw, 1.15rem);
  text-transform: uppercase;
  letter-spacing: 0.12rem;
  padding: 0.6rem 0.5rem;
}

.questions-content p {
  margin: 0 0 0.8rem 0;
  font-size: clamp(0.95rem, 2.2vw, 1.05rem);
  line-height: 1.45;
  padding: 0 0.5rem;
}

.questions-content a {
  color: #313133;
  text-decoration: underline;
}

/* QA card style: each question+answer boxed with subtle shadow */
.questions-content .qa {
  background: rgba(255,255,255,0.9);
  border-radius: 0.6rem;
  padding: 1rem;
  box-shadow: 5px 6px 18px rgba(20,20,20,0.06);
  border: 3px solid rgba(0,0,0,0.04);
}

.questions-content .qa span {
  display: block;
  margin-bottom: 0.35rem;
}

.questions-content .qa p {
  margin: 0;
}

@media (max-width: 600px) {
  .photos-qr,
  .photos-qr-bar {
    max-width: 200px; /* increased by ~25%: was 160px */
    padding: 0.15rem;
    aspect-ratio: 1 / 1;
  }
  /* Fallback for older browsers that don't support aspect-ratio */
  @supports not (aspect-ratio: 1/1) {
    .photos-qr {
      height: 0;
      padding-top: 100%;
      position: relative;
      overflow: hidden;
    }
    .photos-qr img {
      position: absolute;
      top: 0;
      left: 0;
      width: 100%;
      height: 100%;
      object-fit: contain;
    }
  }
}

/* questions-content layout already defined above (column/QA cards) */

/* Footer Style */

.footer-container {
  flex-shrink: 0;
  width: 100%;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding: 1.5rem 1rem;
  text-align: center;
  background: url('') no-repeat center top;
  background-size: cover;
  min-height: 30vh;
}

.footer-format {
  flex-shrink: 0;
  align-items: center;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: 100%;
  position: relative;
  margin-top: auto;
  padding-bottom: 2rem;
}

.footer-text {
  padding: 0 18px 16px;
  font-family: Abhaya Libre;
  color: #494b48;
  font-size: clamp(1rem, 2vw, 1.6rem);
  text-transform: uppercase;
  letter-spacing: 0.4rem;
  font-weight: 400;
}

.footer-date {
  padding: 20px 18px 0;
  font-family: Abhaya Libre;
  letter-spacing: 2px;
  color: #494b48;
  font-size: 21px;
  font-weight: normal;
  text-transform: uppercase;
  border-top: 1px solid #494b48;
}

/* @Media Queries */
@media (max-width: 900px) {
  .header-format {
    padding-top: 2rem;
  }
  .home-content, .rsvp-content, .photos-content {
    flex-direction: column;
  }
}

@media (max-width: 600px) {
  .header-container {
    padding: 0.5rem 1vw 0.2rem 1vw;
  }
  .header-format {
    max-width: 100vw;
  }
  .header-title {
    /* ensure the header remains large and readable on phones */
    font-size: clamp(1.8rem, 9vw, 2.6rem);
  }
  .wedding-date, .wedding-place, .rsvp-confirmation, .rsvp-list {
    padding: 0.75rem;
    border-right: none;
  }
  .navbar-container {
    margin: 0.5rem 0;
  }
  .li-format {
    padding: 0.4rem 0.6rem;
    font-size: 0.95rem;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }
}

/* Make header take less vertical space on small screens so more background is visible */
@media (max-width: 600px) {
  .header-container {
    min-height: 28vh; /* reduce header height on mobile */
    padding: 1rem 0.75rem; /* tighten vertical padding */
    /* show header 50px down on mobile */
    margin-top: 50px;
  }

  .header-format {
    padding-top: 1rem;
  }

  .header-title {
    margin: 0.6rem 0;
  }

  .navbar-container {
    margin: 1rem auto; /* reduce nav spacing */
  }

  /* pull main content slightly up so background shows around the header more */
  .main-container {
    padding-top: 0.5rem;
  }
}