/* ============================================================
   RSVP Page — CSS Animation Version (rsvp1)
   Design tokens inherited: --dark, --accent, --gray, fonts
   ============================================================ */

/* --- Layout Overrides --- */
.site-header {
  background: #fff;
  border-bottom: 1px solid rgba(18, 31, 56, 0.08);
}

/* ============================================================
   Section 1 — Hero Parallax
   ============================================================ */
.rsvp-hero {
  position: relative;
  width: 100%;
  min-height: 75vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background-image: url('https://theaisle.qodeinteractive.com/elementor/wp-content/uploads/2018/12/rsvp-title-img-1.jpg');
  background-size: cover;
  background-position: center center;
  background-repeat: no-repeat;
  background-attachment: fixed;
  overflow: hidden;
}

.rsvp-hero-spacer {
  height: 100px;
}

.rsvp-hero-title {
  margin: 0;
  padding: 0;
  text-align: center;
}

.rsvp-hero-title .rsvp-st-title-word {
  display: inline-block;
  font-family: var(--font-heading);
  font-size: 50px;
  font-weight: 300;
  letter-spacing: 0.095em;
  color: #ffffff;
  text-transform: uppercase;
  margin: 0 8px;
}

/* ============================================================
   Section 2 — Decorative Slider Area
   ============================================================ */
.rsvp-slider {
  position: relative;
  width: 100%;
  height: 300px;
  min-height: 300px;
  background-color: #eaf1f4;
  background-image: url('https://theaisle.qodeinteractive.com/elementor/wp-content/uploads/2018/12/rsvp-back-img.png');
  background-repeat: no-repeat;
  background-size: cover;
  background-position: center center;
  transition: min-height 0.3s ease;
}

.rsvp-slider-inner {
  position: relative;
  width: 100%;
  height: 300px;
  min-height: 300px;
  max-width: 1200px;
  margin: 0 auto;
  transition: min-height 0.3s ease;
}

/* --- Decorative elements (base — hidden, animations defined below) --- */
.rsvp-slide-decor {
  position: absolute;
  opacity: 0;
}

.rsvp-slide-decor img {
  display: block;
  width: 100%;
  height: auto;
}

/* Photo — left side */
.rsvp-slide-photo {
  left: 0;
  top: 50%;
  width: 316px;
  transform: translateY(-50%) translateX(-50px) translateY(70px);
  animation: rsvpFadeSlideLeft 0.8s ease-out 0.3s forwards;
  z-index: 2;
}

/* Polaroid — right side */
.rsvp-slide-polaroid {
  right: 0;
  top: 50%;
  width: 348px;
  transform: translateY(-50%) translateX(50px) translateY(70px);
  animation: rsvpFadeSlideRight 0.9s ease-out 0.1s forwards;
  z-index: 3;
}

/* Leaf — far right */
.rsvp-slide-leaf {
  right: 0;
  top: 50%;
  width: 450px;
  transform: translateY(-45%) translateX(70px);
  animation: rsvpFadeSlideRight 0.8s ease-out 0.2s forwards;
  z-index: 1;
}

/* Flower — top center, overflows upward into hero (40% overlap) */
.rsvp-slide-flower {
  left: 50%;
  top: -160px;
  width: 547px;
  transform: translateX(-50%) translateX(-50px) translateY(120px);
  animation: rsvpFadeSlideDown 0.94s ease-out 0.3s forwards;
  z-index: 4;
}

/* ============================================================
   Section 3 — RSVP Form Overlay (over the slider)
   ============================================================ */
.rsvp-slider {
  position: relative;
}

.rsvp-form-overlay {
  position: absolute;
  top: 50%;
  left: calc(25vw - (25vw / 3));
  width: 25vw;
  height: auto;
  background: #fff;
  padding: 40px 32px;
  box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
  z-index: 20;
  transform: translateY(-50%);
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
}

.rsvp-form-overlay .rsvp-form {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.rsvp-form-overlay .rsvp-form-title {
  font-family: var(--font-heading);
  font-size: 22px;
  font-weight: 300;
  letter-spacing: 0.095em;
  color: var(--dark);
  text-transform: uppercase;
  margin: 0 0 20px;
  line-height: 1.36em;
}

.rsvp-form-overlay .rsvp-input {
  display: block;
  width: 100%;
  padding: 10px 0;
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--gray);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(18, 31, 56, 0.12);
  outline: none;
  transition: border-color 0.3s ease;
  box-sizing: border-box;
}

.rsvp-form-overlay .rsvp-input:focus {
  border-bottom-color: var(--accent);
}

.rsvp-form-overlay .rsvp-input::placeholder {
  color: var(--gray);
  opacity: 0.7;
}

/* --- Select (dropdown) matching input style --- */
.rsvp-form-overlay .rsvp-select {
  display: block;
  width: 100%;
  padding: 10px 0;
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--gray);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(18, 31, 56, 0.12);
  border-radius: 0;
  outline: none;
  box-sizing: border-box;
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  cursor: pointer;
  transition: border-color 0.3s ease;
}

.rsvp-form-overlay .rsvp-select:focus {
  border-bottom-color: var(--accent);
}

.rsvp-form-overlay .rsvp-select option {
  color: #333;
  background: #fff;
}

/* --- Textarea (comment section) --- */
.rsvp-form-overlay .rsvp-textarea {
  display: block;
  width: 100%;
  padding: 10px 0;
  margin-bottom: 12px;
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 300;
  color: var(--gray);
  background: transparent;
  border: none;
  border-bottom: 1px solid rgba(18, 31, 56, 0.12);
  outline: none;
  resize: vertical;
  min-height: 44px;
  box-sizing: border-box;
  transition: border-color 0.3s ease;
}

.rsvp-form-overlay .rsvp-textarea:focus {
  border-bottom-color: var(--accent);
}

.rsvp-form-overlay .rsvp-textarea::placeholder {
  color: var(--gray);
  opacity: 0.7;
}

/* --- Child row: age (1/4) + name (3/4) --- */
.rsvp-form-overlay .rsvp-child-row {
  display: flex;
  gap: 10px;
  align-items: center;
}

.rsvp-form-overlay .rsvp-child-row .rsvp-age-input {
  width: 25%;
  flex-shrink: 0;
}

.rsvp-form-overlay .rsvp-child-row .rsvp-name-input {
  width: 75%;
}

/* --- Radio Buttons --- */
.rsvp-form-overlay .rsvp-radio-group {
  margin-bottom: 14px;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.rsvp-form-overlay .rsvp-radio {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
  font-family: var(--font-body);
  font-size: 12px;
  font-weight: 300;
  color: var(--gray);
  margin-right: 12px;
  user-select: none;
}

.rsvp-form-overlay .rsvp-radio input[type="radio"] {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
}

.rsvp-form-overlay .rsvp-radio .rsvp-radio-indicator {
  display: inline-block;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 2px solid var(--gray);
  margin-right: 6px;
  position: relative;
  flex-shrink: 0;
  transition: border-color 0.3s ease;
}

.rsvp-form-overlay .rsvp-radio input[type="radio"]:checked + .rsvp-radio-indicator {
  border-color: var(--accent);
}

.rsvp-form-overlay .rsvp-radio input[type="radio"]:checked + .rsvp-radio-indicator::after {
  content: '';
  position: absolute;
  top: 2px;
  left: 2px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.rsvp-form-overlay .rsvp-radio input[type="radio"]:focus-visible + .rsvp-radio-indicator {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

/* --- Submit Button (matching .slide-btn-outline) --- */
.rsvp-form-overlay .rsvp-submit-btn {
  display: inline-block;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  text-transform: uppercase;
  letter-spacing: 2px;
  border: 1px solid var(--accent);
  padding: 12px 40px;
  position: relative;
  background-color: transparent;
  transition: color 0.35s ease-out;
  overflow: hidden;
  cursor: pointer;
}

.rsvp-form-overlay .rsvp-submit-btn:hover {
  color: var(--accent);
  background: transparent;
}

/* ============================================================
   Shared Button Line System (for outline and submit buttons)
   ============================================================ */
.rsvp-btn-text {
  position: relative;
  z-index: 2;
}

.rsvp-btn-line {
  position: absolute;
  background: var(--accent);
  transition: transform 0.4s ease-out;
  z-index: 1;
}

/* Top line */
.rsvp-btn-line-top {
  left: 4px;
  top: 4px;
  height: 1px;
  width: calc(100% - 8px);
  transform: scaleX(1);
  transform-origin: right center;
}

/* Right line */
.rsvp-btn-line-right {
  right: 4px;
  top: 4px;
  width: 1px;
  height: calc(100% - 8px);
  transform: scaleY(1);
  transform-origin: center top;
}

/* Bottom line */
.rsvp-btn-line-bottom {
  right: 4px;
  bottom: 4px;
  height: 1px;
  width: calc(100% - 8px);
  transform: scaleX(1);
  transform-origin: left center;
}

/* Left line */
.rsvp-btn-line-left {
  left: 4px;
  bottom: 4px;
  width: 1px;
  height: calc(100% - 8px);
  transform: scaleY(1);
  transform-origin: center bottom;
}

/* Hover: all lines disappear */
.rsvp-submit-btn:hover .rsvp-btn-line-top {
  transform: scaleX(0);
}
.rsvp-submit-btn:hover .rsvp-btn-line-bottom {
  transform: scaleX(0);
}
.rsvp-submit-btn:hover .rsvp-btn-line-right {
  transform: scaleY(0);
}
.rsvp-submit-btn:hover .rsvp-btn-line-left {
  transform: scaleY(0);
}

/* ============================================================
   CSS Keyframe Animations (Version 1 only)
   ============================================================ */
@keyframes rsvpFadeSlideLeft {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(-50px) translateY(70px);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) translateX(0) translateY(0);
  }
}

@keyframes rsvpFadeSlideRight {
  0% {
    opacity: 0;
    transform: translateY(-50%) translateX(50px) translateY(70px);
  }
  100% {
    opacity: 1;
    transform: translateY(-50%) translateX(0) translateY(0);
  }
}

@keyframes rsvpFadeSlideDown {
  0% {
    opacity: 0;
    transform: translateX(-50%) translateX(-50px) translateY(120px);
  }
  100% {
    opacity: 1;
    transform: translateX(-50%) translateX(0) translateY(0);
  }
}

@keyframes rsvpFadeSlideRightLeaf {
  0% {
    opacity: 0;
    transform: translateY(-45%) translateX(70px);
  }
  100% {
    opacity: 1;
    transform: translateY(-45%) translateX(0);
  }
}

/* Override leaf animation to use its own keyframe */
.rsvp-slide-leaf {
  animation-name: rsvpFadeSlideRightLeaf;
}

/* ============================================================
   Back to Top (override transparent header assumption)
   ============================================================ */
.back-to-top.visible {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* ============================================================
   Responsive — Tablet (max 1024px)
   ============================================================ */
@media (max-width: 1024px) {

  .rsvp-slide-photo,
  .rsvp-slide-polaroid,
  .rsvp-slide-leaf,
  .rsvp-slide-flower {
    display: none;
  }

  .rsvp-slider {
    height: 340px;
  }

  .rsvp-slider-inner {
    height: 340px;
    min-height: 340px;
  }

  .rsvp-form-overlay {
    left: 50%;
    width: 40vw;
    transform: translate(-50%, -50%);
  }

}

/* ============================================================
   Responsive — Mobile (max 768px)
   ============================================================ */
@media (max-width: 768px) {

  .rsvp-hero {
    min-height: 280px;
    background-attachment: scroll;
  }

  .rsvp-hero-title .rsvp-st-title-word {
    font-size: 32px;
    margin: 0 4px;
  }

  .rsvp-hero-spacer {
    height: 60px;
  }

  .rsvp-slider {
    height: auto;
    min-height: 270px;
  }

  .rsvp-slider-inner {
    height: auto;
    min-height: 270px;
  }

  .rsvp-form-overlay {
    position: static;
    width: auto;
    height: auto;
    margin: 0 16px;
    padding: 24px 20px;
    transform: none;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.08);
  }

  .rsvp-form-overlay .rsvp-form-title {
    font-size: 22px;
    margin-bottom: 16px;
  }

  .rsvp-form-overlay .rsvp-input,
  .rsvp-form-overlay .rsvp-select,
  .rsvp-form-overlay .rsvp-textarea {
    padding: 8px 0;
    margin-bottom: 10px;
    font-size: 13px;
  }

}

/* ============================================================
   Responsive — Small Mobile (max 480px)
   ============================================================ */
@media (max-width: 480px) {

  .rsvp-hero {
    min-height: 220px;
  }

  .rsvp-hero-title .rsvp-st-title-word {
    font-size: 24px;
    margin: 0 3px;
  }

  .rsvp-hero-spacer {
    height: 40px;
  }

  .rsvp-form-overlay .rsvp-form-title {
    font-size: 18px;
  }

  .rsvp-form-overlay {
    margin: 0 10px;
    padding: 20px 16px;
  }

  .rsvp-form-overlay .rsvp-radio-group {
    flex-direction: column;
    gap: 6px;
  }

  .rsvp-form-overlay .rsvp-radio {
    margin-right: 0;
  }

}

/* ============================================================
   Joke overlay — "Sorry" message
   ============================================================ */
.rsvp-joke-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 99999;
  display: flex;
  align-items: center;
  justify-content: center;
}

.rsvp-joke-box {
  background: #fff;
  padding: 40px 50px;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  text-align: center;
  max-width: 420px;
}

.rsvp-joke-text {
  font-family: var(--font-script);
  font-size: 28px;
  color: var(--dark);
  margin: 0;
  line-height: 1.4;
}
