/* ── Custom font ─────────────────────────────────────── */
@font-face {
  font-family: "Hourglass of Shine";
  src: url("fonts/Hourglass of Shine.fad08634b9f5.otf") format("opentype");
  font-display: swap;
}

/* ── Pico theme overrides ────────────────────────────── */
:root {
  --pico-primary: #93256b;
  --pico-primary-hover: #7a1e5a;
  --pico-primary-focus: rgba(147, 37, 107, 0.25);
  --pico-primary-inverse: #fff;
  --pico-border-radius: 0.5rem;
  scroll-behavior: smooth;
}

/* ── Global ──────────────────────────────────────────── */
html {
  scroll-behavior: smooth;
}

body {
  background: #eef1f8;
  min-height: 100vh;
}

main.container {
  max-width: 930px;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

/* ── Header ──────────────────────────────────────────── */
.rsvp-header {
  text-align: center;
  margin-bottom: 2rem;
  animation: fadeSlideDown 0.8s ease-out both;
}

.rsvp-header h1 {
  font-family: "Hourglass of Shine", cursive;
  font-size: 3rem;
  color: #93256b;
  margin-bottom: 0.25rem;
  font-weight: normal;
}

.rsvp-header h2 {
  color: #3c5598;
  font-size: 1rem;
}

.rsvp-header .subtitle {
  color: #3c5598;
  font-size: 1.1rem;
  margin: 0;
}

/* ── Card sections ───────────────────────────────────── */
.card {
  background: #fff;
  border-radius: var(--pico-border-radius);
  padding: 2rem;
  box-shadow: 0 2px 16px rgba(60, 85, 152, 0.08);
  animation: fadeSlideUp 0.5s ease-out both;
}

/* ── Side-by-side name fields ────────────────────────── */
.name-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

/* ── Collapsible sections (attendance details) ───────── */
.collapsible {
  overflow: hidden;
  transition: max-height 0.5s ease, opacity 0.4s ease, margin 0.4s ease;
  max-height: 500px;
  opacity: 1;
  margin-top: 1rem;
}

.collapsible.collapsed {
  max-height: 0;
  opacity: 0;
  margin-top: 0;
  pointer-events: none;
}

/* ── Plus-one guest blocks ───────────────────────────── */
.plus-one-block {
  border: 1px solid rgba(147, 37, 107, 0.2);
  border-radius: var(--pico-border-radius);
  padding: 1.25rem;
  margin-top: 1rem;
  position: relative;
  animation: fadeSlideUp 0.4s ease-out both;
}

.plus-one-block .plus-one-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.75rem;
}

.plus-one-block .plus-one-header h3 {
  margin: 0;
  font-size: 1rem;
  color: #3c5598;
}

.plus-one-block .btn-remove {
  background: none;
  border: none;
  color: #93256b;
  cursor: pointer;
  font-size: 0.85rem;
  padding: 0.25rem 0.5rem;
  border-radius: 0.25rem;
  transition: background 0.2s ease, color 0.2s ease;
}

.plus-one-block .btn-remove:hover {
  background: rgba(147, 37, 107, 0.1);
}

.plus-one-block.removing {
  animation: fadeSlideOut 0.3s ease-in forwards;
}

/* ── Button group ────────────────────────────────────── */
.button-group {
  display: flex;
  gap: 0.75rem;
  margin-top: 1.5rem;
  flex-wrap: wrap;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

.button-group button {
  flex: 1;
  min-width: 140px;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.button-group button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(147, 37, 107, 0.15);
}

.button-group button:active {
  transform: translateY(0);
  box-shadow: none;
}

/* ── Attendance radio group ──────────────────────────── */
.attendance-group {
  border: none;
  padding: 0;
}

.attendance-group legend {
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.attendance-group label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-right: 1.5rem;
  cursor: pointer;
}

/* ── Summary ─────────────────────────────────────────── */
#summaryContent {
  animation: fadeIn 0.4s ease-out both;
}

#summaryContent h3 {
  color: #3c5598;
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 1rem;
}

#summaryContent dl {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 0.35rem 1rem;
  margin: 0;
}

#summaryContent dt {
  font-weight: 600;
  color: #555;
}

#summaryContent dd {
  margin: 0;
}

#summaryContent .guest-summary {
  margin-top: 1rem;
  padding: 0.75rem 1rem;
  border-left: 3px solid #93256b;
  background: rgba(147, 37, 107, 0.03);
  border-radius: 0 0.25rem 0.25rem 0;
}

/* ── Thank you page ──────────────────────────────────── */
.thankyou-card {
  text-align: center;
}

.thankyou-card h2 {
  color: #3c5598;
  animation: fadeSlideDown 0.6s ease-out both;
}

.thankyou-card > p {
  animation: fadeIn 0.6s 0.2s ease-out both;
}

.thankyou-card .hint {
  font-size: 0.9rem;
  color: #888;
  margin-top: 1.5rem;
}

/* ── Map blocks (thankyou card) ──────────────────────── */
.map-block {
  margin: 2rem 0;
  padding: 1.5rem;
  background: linear-gradient(135deg, #fdf6f9, #f4f0fa);
  border-radius: 1rem;
  text-align: left;
}

.map-figure {
  margin: 0 0 1rem;
  overflow: hidden;
  border-radius: 0.75rem;
  box-shadow: 0 4px 20px rgba(60, 85, 152, 0.12);
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94),
              box-shadow 0.4s ease;
}

.map-figure:hover {
  transform: scale(1.02);
  box-shadow: 0 8px 30px rgba(60, 85, 152, 0.18);
}

.map-img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: 0.75rem 0.75rem 0 0;
}

.map-figure figcaption {
  padding: 0.5rem 0.75rem;
  font-size: 0.85rem;
  color: #93256b;
  font-weight: 600;
  text-align: center;
  background: rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(4px);
}

.map-block p {
  margin-top: 0.75rem;
  line-height: 1.6;
  color: #444;
}

.map-block a {
  font-weight: 500;
}

/* ── Directions block ────────────────────────────────── */
.directions-block {
  margin: 2rem 0;
  padding: 1.5rem;
  background: #fff;
  border-left: 4px solid #93256b;
  border-radius: 0 0.75rem 0.75rem 0;
  text-align: left;
  box-shadow: 0 2px 12px rgba(60, 85, 152, 0.06);
}

.directions-block ul {
  padding-left: 1.25rem;
  margin: 0.5rem 0 0;
}

.directions-block li {
  margin-bottom: 0.5rem;
  line-height: 1.5;
}

/* ── Staggered entrance animations ───────────────────── */
.anim-stagger-1 {
  animation: fadeSlideUp 0.6s 0.3s ease-out both;
}

.anim-stagger-2 {
  animation: fadeSlideUp 0.6s 0.5s ease-out both;
}

.anim-stagger-3 {
  animation: fadeSlideUp 0.6s 0.7s ease-out both;
}

.anim-stagger-4 {
  animation: fadeSlideUp 0.6s 0.9s ease-out both;
}

/* ── Visibility helper ───────────────────────────────── */
.hidden {
  display: none !important;
}

/* ── Cross-fade between form and summary ─────────────── */
.fade-out {
  animation: fadeOut 0.3s ease-in forwards;
}

.fade-in {
  animation: fadeIn 0.4s ease-out both;
}

/* ── Keyframes ───────────────────────────────────────── */
@keyframes fadeSlideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlideUp {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes fadeSlideOut {
  to {
    opacity: 0;
    transform: translateY(-10px);
    max-height: 0;
    padding: 0;
    margin: 0;
    border-width: 0;
    overflow: hidden;
  }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes fadeOut {
  from { opacity: 1; }
  to   { opacity: 0; }
}

/* ── Responsive tweaks ───────────────────────────────── */
@media (max-width: 480px) {
  .rsvp-header h1 {
    font-size: 2.2rem;
  }

  .card {
    padding: 1.25rem;
  }

  .button-group {
    flex-direction: column;
  }

  .button-group button {
    min-width: unset;
  }

  .name-group {
    grid-template-columns: 1fr;
  }
}
