/* ============================================================
   Flora + Nathan — wedding site
   Colors, fonts, and spacing live in CSS variables — tweak in :root.
   ============================================================ */

/* Custom font — loaded from assets/fonts so it works for every visitor. */
@font-face {
  font-family: 'FloraHandwritingChunky';
  src: url('assets/fonts/FloraHandwritingChunky-Regular.ttf') format('truetype');
  font-weight: normal;
  font-style: normal;
  font-display: swap;
}

:root {
  --green: #8aa57a;
  --green-dark: #6c8a5e;
  --ink: #0c0c0c;
  --hand-font: 'FloraHandwritingChunky', 'Kalam', 'Caveat', cursive;
  --serif-font: 'Libre Baskerville', Georgia, serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  color: var(--ink);
  font-family: var(--serif-font);
  background: var(--green);
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
}

a { color: inherit; }

img { max-width: 100%; height: auto; }

/* ----------------------------- NAV ----------------------------- */

.nav {
  position: absolute;
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 24px 40px;
  z-index: 10;
  gap: 16px;
}

.nav__brand {
  font-family: var(--hand-font);
  font-size: 28px;
  text-decoration: none;
  letter-spacing: 0.01em;
  flex-shrink: 0;
}

.nav__links {
  display: flex;
  gap: 32px;
  margin-left: auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav__links a {
  font-family: var(--hand-font);
  font-size: 26px;
  text-decoration: none;
  padding: 4px 0;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease;
}

.nav__links a:hover,
.nav__links a.is-active {
  border-bottom-color: currentColor;
}

/* Light nav (over hero photo) */
.page-home .nav { color: #fff; }
.page-home .nav a { text-shadow: 0 1px 10px rgba(0, 0, 0, 0.45); }

/* Dark nav (on green pages) */
.page-green .nav { color: var(--ink); }

/* Hamburger toggle — visually hidden checkbox + bars label.
   Hidden on desktop; the bars appear only on phones (see media query). */
.nav__toggle {
  position: absolute;
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}
.nav__bars { display: none; }

/* ----------------------------- HERO ----------------------------- */

.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  overflow: hidden;
}

.hero__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Show more of the top of the photo so Nathan's face isn't cropped */
  object-position: center 6%;
}

.hero__overlay {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.45);
  padding: 0 20px;
  /* Shift the title + RSVP block down and to the left, ~10% of viewport each */
  transform: translate(-10vw, 10vh);
}

.hero__title {
  font-family: var(--hand-font);
  font-weight: 400;
  font-size: clamp(40px, 6.2vw, 78px);
  line-height: 1.15;
  margin: 0 0 32px 0;
}

/* ----------------------------- BUTTONS ----------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  font-family: var(--serif-font);
  font-size: 17px;
  letter-spacing: 0.02em;
  padding: 12px 36px;
  min-width: 140px;
  border-radius: 0;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, transform 0.05s ease;
}

.btn--outline {
  border: 2px solid #fff;
  color: #fff;
  background: transparent;
  font-family: var(--hand-font);
  font-size: 40px;
  padding: 8px 64px;
  letter-spacing: 0.04em;
}
.btn--outline:hover { background: rgba(255, 255, 255, 0.15); }

.btn--solid {
  background: var(--ink);
  color: #fff;
  border: 2px solid var(--ink);
}
.btn--solid:hover { background: #2a2a2a; }
.btn--solid:active { transform: translateY(1px); }

/* ----------------------------- PAGE SECTIONS ----------------------------- */

.page {
  min-height: 100vh;
  padding: 120px 24px 96px;
  text-align: center;
}

.page--green {
  background: var(--green);
  color: var(--ink);
}

.page__title {
  font-family: var(--hand-font);
  font-weight: 400;
  font-size: clamp(36px, 4.5vw, 56px);
  margin: 0 0 24px 0;
}

.page__title--block {
  letter-spacing: 0.04em;
}

/* ----------------------------- EVENT CARDS ----------------------------- */

.event {
  max-width: 640px;
  margin: 0 auto 32px;
  text-align: center;
}

.event__icon {
  display: block;
  margin: 16px auto;
  width: 230px;
  max-width: 100%;
  height: auto;
}

.event__name {
  font-family: var(--serif-font);
  font-weight: 600;
  font-size: 21px;
  margin: 4px 0;
}

.event__time,
.event__venue,
.event__address,
.event__note {
  margin: 4px 0;
  font-size: 18px;
}

.event__time {
  font-size: 20px;
}

.event__address a {
  text-decoration: underline;
  text-underline-offset: 3px;
  word-break: break-word;
}

.event__note {
  font-style: italic;
  opacity: 0.9;
  margin-top: 16px;
}

.event__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 24px;
}

/* ----------------------------- DIVIDER ----------------------------- */

.divider {
  margin: 64px auto;
  max-width: 900px;
}
.divider img {
  width: 100%;
  height: auto;
  opacity: 0.85;
}

/* ----------------------------- HELPERS ----------------------------- */

.todo-hint {
  display: block;
  margin-top: 8px;
  font-size: 13px;
  font-style: italic;
  opacity: 0.6;
}

/* ----------------------------- BOSTON ----------------------------- */

.boston {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.boston__lede {
  max-width: 640px;
  margin: 0 auto 32px;
  text-align: center;
  font-style: italic;
  font-size: 17px;
  opacity: 0.85;
}

.boston__heading {
  font-family: var(--hand-font);
  font-weight: 400;
  font-size: 42px;
  margin: 32px 0 12px;
  line-height: 1.1;
}

.boston__list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.boston__item {
  margin: 0 0 18px;
  line-height: 1.5;
}

.boston__name {
  font-family: var(--serif-font);
  font-weight: 600;
  font-size: 18px;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.boston__desc {
  display: block;
  font-size: 17px;
  margin-top: 2px;
}

@media (max-width: 700px) {
  .boston__lede { font-size: 15px; }
  .boston__heading { font-size: 34px; }
  .boston__name { font-size: 16px; }
  .boston__desc { font-size: 15px; }
}

/* ----------------------------- FAQ ----------------------------- */

.faq {
  max-width: 640px;
  margin: 0 auto;
  text-align: left;
}

.faq__item {
  margin: 0;
  border-bottom: 2px solid rgba(12, 12, 12, 0.28);
}
.faq__item:first-child {
  border-top: 2px solid rgba(12, 12, 12, 0.28);
}
.faq__item[open] {
  padding-bottom: 16px;
}

.faq__q {
  font-family: var(--serif-font);
  font-weight: 600;
  font-size: 21px;
  margin: 0;
  padding: 18px 40px 18px 0;
  line-height: 1.25;
  cursor: pointer;
  position: relative;
  list-style: none;
}
.faq__q::-webkit-details-marker { display: none; }
.faq__q::after {
  content: "+";
  position: absolute;
  right: 4px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--hand-font);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
}
.faq__item[open] > .faq__q::after {
  content: "−";
}

.faq__a {
  font-family: var(--serif-font);
  font-size: 18px;
  margin: 4px 0;
  line-height: 1.55;
}

.faq__a a,
.faq__list a {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.faq__list {
  font-size: 18px;
  margin: 4px 0;
  padding-left: 24px;
}
.faq__list li { margin: 4px 0; }

@media (max-width: 700px) {
  .faq__q { font-size: 18px; }
  .faq__a, .faq__list { font-size: 16px; }
}

/* ----------------------------- RSVP FORM ----------------------------- */

.rsvp {
  max-width: 720px;
  margin: 0 auto;
  text-align: left;
}

.rsvp__step { margin-top: 8px; }

.rsvp__lede {
  font-size: 18px;
  text-align: center;
  margin: 0 0 24px;
}

.rsvp__hint {
  font-size: 15px;
  font-style: italic;
  opacity: 0.85;
  text-align: center;
  margin: 12px 0 0;
}

/* Search box + suggestions */
.rsvp__search {
  position: relative;
  max-width: 480px;
  margin: 0 auto;
}

.rsvp__input,
.rsvp__field input,
.rsvp__field textarea {
  width: 100%;
  font-family: var(--serif-font);
  font-size: 18px;
  padding: 12px 16px;
  border: 2px solid var(--ink);
  background: #fff;
  color: var(--ink);
  border-radius: 0;
}
.rsvp__input { font-size: 20px; text-align: center; }

.rsvp__input:focus,
.rsvp__field input:focus,
.rsvp__field textarea:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(12, 12, 12, 0.15);
}

.rsvp__suggestions {
  position: absolute;
  left: 0; right: 0; top: calc(100% + 4px);
  list-style: none;
  margin: 0; padding: 0;
  background: #fff;
  border: 2px solid var(--ink);
  z-index: 5;
  max-height: 320px;
  overflow-y: auto;
}

.rsvp__suggestion {
  padding: 10px 16px;
  cursor: pointer;
  font-size: 17px;
  border-top: 1px solid rgba(12, 12, 12, 0.1);
  display: flex;
  flex-direction: column;
}
.rsvp__suggestion:first-child { border-top: none; }
.rsvp__suggestion:hover,
.rsvp__suggestion.is-active { background: rgba(138, 165, 122, 0.25); }
.rsvp__suggestion strong { font-weight: 600; }
.rsvp__suggestion-party {
  font-size: 14px;
  opacity: 0.7;
  font-style: italic;
  margin-top: 2px;
}
.rsvp__suggestion--empty {
  cursor: default;
  font-style: italic;
  opacity: 0.7;
}
.rsvp__suggestion--empty:hover { background: transparent; }

/* Loading state */
.rsvp__loading {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  padding: 48px 16px;
  font-size: 17px;
  font-style: italic;
  opacity: 0.85;
}
.rsvp__loading[hidden] { display: none; }

.rsvp__spinner {
  display: inline-block;
  width: 22px;
  height: 22px;
  border: 3px solid rgba(12, 12, 12, 0.2);
  border-top-color: var(--ink);
  border-radius: 50%;
  animation: rsvp-spin 0.9s linear infinite;
}

@keyframes rsvp-spin {
  to { transform: rotate(360deg); }
}

/* Grid */
.rsvp__grid-wrap {
  margin: 16px 0 24px;
  overflow-x: auto;
}

.rsvp__grid {
  width: 100%;
  border-collapse: collapse;
  font-size: 17px;
}

.rsvp__grid th,
.rsvp__grid td {
  padding: 12px 8px;
  text-align: center;
  vertical-align: middle;
  border-bottom: 1px solid rgba(12, 12, 12, 0.18);
}

.rsvp__grid th {
  font-family: var(--serif-font);
  font-weight: 600;
  font-size: 16px;
}
.rsvp__day {
  display: inline-block;
  margin-top: 2px;
  font-size: 13px;
  font-weight: 400;
  opacity: 0.7;
  font-style: italic;
}

.rsvp__grid-name {
  text-align: left;
  font-weight: 500;
  min-width: 160px;
}

.rsvp__row--plusone .rsvp__grid-name {
  display: flex;
  align-items: center;
  gap: 10px;
}

.rsvp__plusone-label {
  font-family: var(--hand-font);
  font-size: 24px;
  line-height: 1;
}

.rsvp__plusone-name {
  flex: 1;
  font-family: var(--serif-font);
  font-size: 16px;
  padding: 6px 10px;
  border: 2px solid var(--ink);
  background: #fff;
}

.rsvp__row--toggle td {
  padding: 14px 8px 6px;
  border-bottom: none;
  text-align: left;
}

/* Custom checkboxes */
.rsvp__check {
  display: inline-flex;
  align-items: center;
  cursor: pointer;
}
.rsvp__check input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rsvp__check-box {
  width: 28px;
  height: 28px;
  border: 2px solid var(--ink);
  background: #fff;
  display: inline-block;
  position: relative;
}
.rsvp__check input:checked + .rsvp__check-box::after {
  content: "";
  position: absolute;
  left: 6px; top: 1px;
  width: 8px; height: 16px;
  border: solid var(--ink);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}
.rsvp__check input:focus-visible + .rsvp__check-box {
  box-shadow: 0 0 0 3px rgba(12, 12, 12, 0.25);
}
.rsvp__check-sr {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

/* Toggle (uses same box style, but inline with label text) */
.rsvp__toggle {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  font-size: 17px;
}
.rsvp__toggle input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.rsvp__toggle-box {
  width: 22px;
  height: 22px;
  border: 2px solid var(--ink);
  background: #fff;
  position: relative;
  flex-shrink: 0;
}
.rsvp__toggle input:checked + .rsvp__toggle-box::after {
  content: "";
  position: absolute;
  left: 4px; top: -1px;
  width: 6px; height: 13px;
  border: solid var(--ink);
  border-width: 0 3px 3px 0;
  transform: rotate(45deg);
}

/* Generic field (notes, email) */
.rsvp__field {
  margin: 20px 0;
}
.rsvp__field label {
  display: block;
  font-size: 16px;
  font-weight: 500;
  margin-bottom: 6px;
}
.rsvp__field textarea {
  resize: vertical;
  font-family: var(--serif-font);
}

/* "Can't make it?" row above the grid */
.rsvp__decline {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-bottom: 12px;
  font-size: 16px;
  font-style: italic;
}

.btn--small {
  font-size: 14px;
  padding: 6px 16px;
  min-width: 0;
}

/* Actions row */
.rsvp__actions {
  display: flex;
  gap: 16px;
  justify-content: center;
  margin-top: 24px;
  flex-wrap: wrap;
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border: 2px solid var(--ink);
}
.btn--ghost:hover { background: rgba(12, 12, 12, 0.08); }

.btn--solid:disabled,
.btn--ghost:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* Tablet / small laptop */
@media (max-width: 1024px) {
  .nav { padding: 20px 28px; }
  .nav__links { gap: 24px; }
  .nav__links a { font-size: 24px; }
}

/* Phones */
@media (max-width: 700px) {
  .nav {
    padding: 14px 18px;
    gap: 8px;
    flex-wrap: wrap;
    align-items: center;
  }
  .nav__brand { font-size: 24px; }

  /* Show the hamburger (3 horizontal lines) at the far right */
  .nav__bars {
    display: flex;
    flex-direction: column;
    gap: 5px;
    margin-left: auto;
    padding: 8px 4px;
    cursor: pointer;
  }
  .nav__bars span {
    width: 26px;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
    transition: transform 0.25s ease, opacity 0.2s ease;
  }

  /* Collapse the links — hidden until the hamburger toggles them open */
  .nav__links {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: center;
    gap: 18px;
    margin: 8px 0 0;
  }

  /* Open state: a full-page overlay in the site green, links centered. */
  .nav__toggle:checked ~ .nav__links {
    display: flex;
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100vh;
    margin: 0;
    padding: 0;
    justify-content: center;
    gap: 34px;
    background: var(--green);
    z-index: 20;
  }
  .nav__toggle:checked ~ .nav__links a {
    color: #fff;
    text-shadow: none;
  }
  .nav__links a { font-size: 34px; padding: 2px 0; }

  /* Keep the toggle tappable above the overlay and morph it into a close (X). */
  .nav__toggle:checked ~ .nav__bars {
    position: fixed;
    top: 14px;
    right: 18px;
    z-index: 30;
    color: #fff;
  }
  .nav__toggle:checked ~ .nav__bars span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
  .nav__toggle:checked ~ .nav__bars span:nth-child(2) { opacity: 0; }
  .nav__toggle:checked ~ .nav__bars span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

  /* The mobile photo (assets/home-mobile-green.jpg via <picture>) is a full
     portrait polaroid with the names + date already printed on it. So we drop
     the HTML title and let the image flow in normal layout, with the RSVP
     button sitting in the green space below it. */
  .hero {
    height: auto;
    min-height: 0;
    background: var(--green);
  }
  /* Inset the polaroid from the screen edges (top clears the nav) */
  .hero picture { display: block; padding: 56px 24px 0; }
  .hero__photo {
    position: static;
    width: 100%;
    height: auto;
  }
  .hero__title { display: none; }   /* names + date are baked into the mobile photo */
  .hero__overlay {
    position: static;
    height: auto;
    transform: none;
    padding: 28px 16px 44px;
  }
  .btn--outline { font-size: 30px; padding: 6px 44px; text-shadow: none; }

  .page { padding: 96px 16px 64px; }   /* nav collapses to a single kebab row on mobile */
  .page__title { margin-bottom: 16px; }
  .event { margin-bottom: 24px; }
  .event__name { font-size: 20px; }
  .event__time, .event__venue, .event__address, .event__note { font-size: 16px; }
  .event__time { font-size: 19px; }

  .event__actions { gap: 10px; }
  /* Only stretch the event-card buttons — leave .btn--outline on the hero alone */
  .event__actions .btn {
    min-width: 0;
    flex: 1 1 140px;
    padding: 12px 14px;
    font-size: 16px;
  }

  .divider { margin: 40px auto; }
}

/* Small phones */
@media (max-width: 380px) {
  .nav__links { gap: 10px; }
  .nav__links a { font-size: 19px; }
  .nav__toggle:checked ~ .nav__links a { font-size: 28px; }
  .hero__title { font-size: 32px; }
  .btn--outline { font-size: 26px; padding: 6px 36px; }
}

/* RSVP responsive */
@media (max-width: 700px) {
  .rsvp__lede { font-size: 17px; }
  .rsvp__input { font-size: 18px; }
  .rsvp__grid { font-size: 15px; }
  .rsvp__grid th, .rsvp__grid td { padding: 10px 4px; }
  .rsvp__grid th { font-size: 14px; }
  .rsvp__day { font-size: 12px; }
  .rsvp__grid-name { min-width: 110px; font-size: 15px; }
  .rsvp__check-box { width: 26px; height: 26px; }
  .rsvp__check input:checked + .rsvp__check-box::after {
    left: 6px; top: 1px; width: 7px; height: 14px;
  }
  .rsvp__plusone-label { font-size: 20px; }
  .rsvp__plusone-name { font-size: 14px; }
}
