/* --- Global Styles --- */
:root {
  /* poster palette */
  --dark-brown:     #331A12;
  --parchment-text: #4D332D; /* text color matching etching */

  /* modal palette */
  --parchment:    #f4e4bc;
  --parchment-dk: #e8d49a;
  --brown-dk:     #2c1810;
  --brown-md:     #4a2010;
  --maroon:       #7a1a1a;
  --maroon-dk:    #5a1010;
  --gold:         #c8960c;
  --cream:        #fdf6e3;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  margin: 0;
  padding: 0;
  font-family: serif;
  background: #0D0604; /* very dark backup */
}

/* --- Page & Poster Layout --- */
.page-container {
  width: 100%;
  min-height: 100vh;
  background-color: #261713; /* wood background */
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 20px;
  box-sizing: border-box;
}

.poster-container {
  position: relative;
  width: 100%;
  max-width: 700px;
  height: auto;
  aspect-ratio: 0.57; /* match poster proportion */
  overflow: hidden;
  padding: 30px;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  align-items: center;
}

/* --- Image Layering --- */
.poster-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  z-index: 1; /* lowest layer */
  object-fit: cover;
}

.section-spacer {
  width: 100%;
  height: 20px;
}

/* --- Header Section --- */
.header-section {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 10px;
}

.logo {
  display: block;
  width: 75%;
  max-width: 650px;
  margin: 0 auto;
}

/* --- Central Illustration --- */
.central-illustration-section {
  position: relative;
  z-index: 10;
  width: 100%;
  margin-bottom: 20px;
}

.central-art {
  display: block;
  width: 80%;
  height: auto;
  margin: 0 auto;
}

.date-art {
  width: 75%;
}

/* --- Event Details --- */
.details-section {
  position: relative;
  z-index: 10;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 20px;
}

.date-time-block {
  display: flex;
  align-items: center;
  width: 90%;
  justify-content: space-around;
}

/* --- RSVP plaque button --- */
.rsvp-btn {
  display: block;
  width: 100%;
  border: none;
  background: transparent;
  padding: 0;
  cursor: pointer;
  transition: transform .12s ease, filter .12s ease;
}
.rsvp-art {
  width: 30%;
}
.rsvp-btn:hover { transform: translateY(-2px); filter: brightness(1.05); }
.rsvp-btn:active { transform: translateY(0); }
.rsvp-btn:focus-visible { outline: 2px solid var(--gold); outline-offset: 4px; }

/* --- Footer (Timestamp) --- */
.poster-footer {
  position: absolute;
  bottom: 25px;
  right: 35px;
  z-index: 10;
  font-family: 'Oswald', sans-serif;
  color: var(--parchment-text);
  text-transform: uppercase;
  font-weight: 700;
  font-size: 1em;
  letter-spacing: 0.1em;
}

/* ── modal overlay ── */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.75);
  z-index: 100;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--parchment);
  border-radius: 4px;
  width: 100%;
  max-width: 420px;
  box-shadow:
    0 0 0 4px #5a3010,
    0 0 0 7px #3a1e08,
    0 12px 50px rgba(0,0,0,.8);
  overflow: hidden;
  animation: slideUp .2s ease;
}
@keyframes slideUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}

.modal-header {
  background: linear-gradient(180deg, #2c1810 0%, #3d2010 100%);
  padding: 1rem 1.4rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 3px solid var(--gold);
}
.modal-title {
  font-family: 'Rye', serif;
  font-size: 1.3rem;
  color: var(--cream);
  text-shadow: 1px 1px 0 #1a0a00;
}
.modal-close {
  background: none;
  border: none;
  color: var(--parchment-dk);
  font-size: 1.5rem;
  cursor: pointer;
  line-height: 1;
  padding: .1rem .3rem;
  transition: color .15s;
}
.modal-close:hover { color: var(--gold); }

.modal-body { padding: 1.4rem; }

.form-group { margin-bottom: 1rem; }
.form-group label {
  display: block;
  font-family: 'Oswald', sans-serif;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .15em;
  text-transform: uppercase;
  color: var(--brown-md);
  margin-bottom: .35rem;
}
.form-group input,
.form-group select {
  width: 100%;
  padding: .55rem .75rem;
  border: 2px solid #c0a060;
  border-radius: 3px;
  background: var(--cream);
  color: var(--brown-dk);
  font-family: 'Lato', sans-serif;
  font-size: .95rem;
  transition: border-color .15s;
  -webkit-appearance: none;
  appearance: none;
}
.form-group input:focus,
.form-group select:focus {
  outline: none;
  border-color: var(--maroon);
}
.select-wrap {
  position: relative;
}
.select-wrap::after {
  content: '▾';
  position: absolute;
  right: .75rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--maroon);
  pointer-events: none;
  font-size: .9rem;
}

.modal-footer {
  padding: 0 1.4rem 1.4rem;
  display: flex;
  gap: .75rem;
}
.submit-btn {
  flex: 1;
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--cream);
  background: linear-gradient(180deg, var(--maroon) 0%, var(--maroon-dk) 100%);
  border: 2px solid var(--gold);
  padding: .7rem;
  border-radius: 3px;
  cursor: pointer;
  transition: background .15s;
}
.submit-btn:hover { background: linear-gradient(180deg, #9a2020 0%, var(--maroon) 100%); }
.submit-btn:disabled { opacity: .6; cursor: default; }

.cancel-btn {
  font-family: 'Oswald', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--brown-md);
  background: transparent;
  border: 2px solid #c0a060;
  padding: .7rem 1.2rem;
  border-radius: 3px;
  cursor: pointer;
  transition: border-color .15s, color .15s;
}
.cancel-btn:hover { border-color: var(--maroon); color: var(--maroon); }

.form-error {
  color: var(--maroon);
  font-size: .82rem;
  font-family: 'Lato', sans-serif;
  margin-top: .3rem;
  display: none;
}

/* success state */
.modal-success {
  padding: 2.5rem 1.4rem;
  text-align: center;
  display: none;
}
.modal-success .check { font-size: 2.5rem; margin-bottom: .6rem; }
.modal-success h3 {
  font-family: 'Rye', serif;
  font-size: 1.4rem;
  color: var(--brown-dk);
  margin-bottom: .4rem;
}
.modal-success p {
  font-family: 'Lato', sans-serif;
  color: var(--brown-md);
  font-size: .95rem;
}
