:root {
  --sand: #f3ead7;
  --grass: #446444;
  --leaf: #7b9b6a;
  --sun: #e5b751;
  --ink: #223029;
  --card: #fffaf0;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Avenir Next", "Gill Sans", sans-serif;
  color: var(--ink);
  background-color: var(--sand);
  background-image:
    url("../images/wildflower-pattern.svg"),
    radial-gradient(circle at 20% 0%, #f8f0df 0%, var(--sand) 50%, #efe3c7 100%);
  background-repeat: repeat, no-repeat;
  background-size: 420px 520px, cover;
  background-attachment: fixed, fixed;
}

.site-header {
  display: flex;
  gap: 1rem;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 1.25rem;
  background: rgba(255, 250, 240, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 20;
}

.brand {
  font-weight: 700;
  letter-spacing: 0.02em;
}

nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.7rem;
}

nav a {
  text-decoration: none;
  color: var(--ink);
  padding: 0.35rem 0.5rem;
  border-radius: 0.4rem;
}

nav a:hover {
  background: #e8dec7;
}

.cta {
  background: var(--grass);
  color: #fff;
}

main {
  max-width: 1100px;
  margin: 0 auto;
  padding: 1rem;
}

.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 1rem;
  align-items: center;
  margin: 1rem 0 2rem;
}

.hero-copy h1 {
  font-size: clamp(2rem, 5vw, 3.2rem);
  margin: 0.2rem 0 0.8rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  color: #3d503d;
}

.hero-photo-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.75rem;
}

.hero-photo-grid img {
  width: 100%;
  height: 320px;
  object-fit: cover;
  border-radius: 0.8rem;
  box-shadow: 0 8px 24px rgba(34, 48, 41, 0.18);
}

.photo-invitation {
  margin: -0.5rem 0 2rem;
}

.photo-invitation a {
  color: var(--grass);
}

.photo-gallery {
  columns: 3;
  column-gap: 1rem;
  margin-top: 1.5rem;
}

.photo-gallery-item {
  display: block;
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 0.8rem;
}

.photo-gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

.photo-gallery-item:focus-visible {
  outline: 3px solid var(--grass);
  outline-offset: 4px;
}

.story-page {
  max-width: 900px;
  margin: 0 auto;
  padding: 1rem 0;
}

.story-intro {
  max-width: 720px;
  margin: 0 auto 1.5rem;
  text-align: center;
}

.story-intro h1 {
  margin: 0.25rem 0 0.75rem;
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", serif;
  font-size: clamp(2.5rem, 7vw, 4rem);
  font-weight: 400;
}

.story-cover {
  max-width: 660px;
  margin: 0 auto 2rem;
}

.story-cover img {
  display: block;
  width: 100%;
  max-height: 620px;
  object-fit: cover;
  object-position: center 38%;
  border-radius: 0.8rem;
  box-shadow: 0 8px 24px rgba(34, 48, 41, 0.18);
}

.story-section,
.story-milestone {
  background: var(--card);
  border: 1px solid #ebdec0;
  border-radius: 0.8rem;
  padding: clamp(1.2rem, 4vw, 2rem);
  line-height: 1.75;
}

.story-section {
  margin: 0 0 1.25rem;
}

.story-section h2,
.story-milestone h2,
.story-gallery-section h2 {
  margin: 0.2rem 0 0.8rem;
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", serif;
  font-size: clamp(1.7rem, 4vw, 2.2rem);
  font-weight: 400;
  line-height: 1.2;
}

.story-section p:last-child,
.story-milestone p:last-child {
  margin-bottom: 0;
}

.story-milestones {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1.25rem;
}

.story-gallery-section {
  margin-top: 2rem;
  text-align: center;
}

.story-gallery {
  columns: 3;
  column-gap: 1rem;
  margin-top: 1.25rem;
  text-align: left;
}

.story-gallery-item {
  display: block;
  break-inside: avoid;
  margin-bottom: 1rem;
  border-radius: 0.8rem;
}

.story-gallery-item img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: inherit;
}

.story-gallery-item:focus-visible {
  outline: 3px solid var(--grass);
  outline-offset: 4px;
}

@media (max-width: 800px) {
  .photo-gallery,
  .story-gallery {
    columns: 2;
  }
}

@media (max-width: 500px) {
  .photo-gallery,
  .story-gallery {
    columns: 1;
  }

  .story-milestones {
    grid-template-columns: 1fr;
  }
}

.actions {
  display: flex;
  gap: 0.7rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-block;
  text-decoration: none;
  border: 1px solid var(--grass);
  color: var(--grass);
  padding: 0.6rem 0.9rem;
  border-radius: 0.55rem;
}

.btn-primary {
  background: var(--grass);
  color: white;
}

.section {
  background: var(--card);
  padding: 1rem;
  border-radius: 0.8rem;
  box-shadow: 0 8px 24px rgba(34, 48, 41, 0.1);
}

.travel-map {
  margin: 1.5rem 0 0;
  width: min(100%, 420px);
}

.travel-map img {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  border-radius: 0.5rem;
}

.travel-map figcaption {
  margin-top: 0.5rem;
  font-size: 0.9rem;
  color: #3b483f;
}

.card-grid {
  display: grid;
  gap: 0.9rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.card {
  background: var(--card);
  border: 1px solid #ebdec0;
  border-radius: 0.75rem;
  padding: 0.9rem;
}

.metric {
  font-size: 2rem;
  margin: 0.3rem 0;
}

.form {
  display: grid;
  gap: 0.8rem;
}

label {
  display: grid;
  gap: 0.3rem;
  font-weight: 600;
}

input,
select,
textarea,
button {
  font: inherit;
  border: 1px solid #ccbda0;
  border-radius: 0.45rem;
  padding: 0.55rem;
}

.error {
  color: #8f2a2a;
  font-weight: 600;
}

.form-embed {
  display: flex;
  justify-content: center;
}

.form-embed iframe {
  max-width: 100%;
  border: none;
}

.guest-results {
  list-style: none;
  padding: 0;
  display: grid;
  gap: 0.7rem;
}

.guest-results button {
  text-align: left;
  width: 100%;
}

#guest-search {
  max-width: 36rem;
}

#guest-search p {
  margin: 0;
}

#rsvp-selector button {
  cursor: pointer;
}

#rsvp-selector :focus-visible {
  outline: 3px solid var(--grass);
  outline-offset: 3px;
}

.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 0.5rem;
}

.faq-list {
  display: grid;
  gap: 0.9rem;
}

.site-footer {
  margin-top: 2rem;
  text-align: center;
  padding: 1.2rem;
  color: #3b483f;
}

.registry-page {
  --registry-blue: #265d70;
  --registry-border: #d5d8c9;
  padding: 1.5rem;
  letter-spacing: 0;
}

.registry-page h1,
.registry-page h2 {
  font-family: "Palatino Linotype", Palatino, "Book Antiqua", serif;
  font-weight: 400;
  line-height: 1.15;
}

.registry-intro { max-width: 720px; margin-bottom: 2.5rem; }
.registry-intro h1 { font-size: 2.8rem; margin: 0.5rem 0 1rem; }
.registry-page p { line-height: 1.65; }
.registry-page .eyebrow { letter-spacing: 0; }
.registry-page a { text-underline-offset: 4px; }
.registry-jump { margin-top: 1.5rem; gap: 0.5rem 1.5rem; }
.registry-jump a { padding: 0.4rem 0; border-bottom: 1px solid var(--grass); border-radius: 0; }
.registry-category { padding: 2rem 0; border-top: 1px solid var(--registry-border); }
.registry-category,
#registry-gifts { scroll-margin-top: 8rem; }
.registry-category-heading { display: grid; grid-template-columns: 1fr 0.8fr; align-items: center; gap: 2rem; }
.registry-page h2 { font-size: 2rem; margin: 0.4rem 0 0.8rem; }
.registry-category-heading img { width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 6px; }
.registry-funds { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-top: 1.5rem; }
.registry-fund { display: flex; flex-direction: column; padding: 1.1rem; border: 1px solid var(--registry-border); border-top: 4px solid var(--fund-accent); border-radius: 6px; background: var(--fund-background); }
#honeymoon .registry-fund:nth-child(1) { --fund-accent: #446444; --fund-background: #eaf0e3; }
#honeymoon .registry-fund:nth-child(2) { --fund-accent: #265d70; --fund-background: #e6f0f3; }
#honeymoon .registry-fund:nth-child(3) { --fund-accent: #8b4052; --fund-background: #f7e8ec; }
#honeymoon .registry-fund:nth-child(4) { --fund-accent: #735233; --fund-background: #f7eddb; }
#home .registry-fund:nth-child(1) { --fund-accent: #356858; --fund-background: #e4efe9; }
#home .registry-fund:nth-child(2) { --fund-accent: #40547c; --fund-background: #e8ecf5; }
#home .registry-fund:nth-child(3) { --fund-accent: #86492d; --fund-background: #f8e9df; }
#home .registry-fund:nth-child(4) { --fund-accent: #655679; --fund-background: #eee8f3; }
.registry-fund-number { font-family: Palatino, serif; font-size: 1.5rem; color: var(--fund-accent); }
.registry-fund h3 { margin: 0.75rem 0 0; font-size: 1.1rem; }
.registry-fund p { font-size: 0.95rem; flex: 1; }
.registry-contribute { color: var(--fund-accent); font-weight: 600; line-height: 1.5; }
#guest-recipes { background: #f7eddb; border: 1px solid var(--registry-border); border-top: 4px solid var(--sun); border-radius: 6px; padding: 1.5rem; }
.registry-bottom { display: grid; grid-template-columns: 0.8fr 1.2fr; gap: 2rem; border-top: 1px solid var(--registry-border); padding-top: 2.5rem; margin-top: 1rem; }
.registry-traditional { align-self: center; background: #eaf0e3; border: 1px solid var(--registry-border); border-top: 4px solid var(--grass); border-radius: 6px; padding: 1.5rem; }
.registry-page .btn { border-radius: 6px; cursor: pointer; line-height: 1.5; }
.registry-page .btn:hover { background: #345034; color: white; }
.registry-page :focus-visible { outline: 3px solid var(--registry-blue); outline-offset: 4px; }
.registry-small,
.registry-payment-note { font-size: 0.9rem; color: #46524b; }
.registry-payment-note { border-top: 1px solid var(--registry-border); padding-top: 1.5rem; margin-top: 2rem; }
.registry-picker { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 1.25rem; align-items: center; }
.registry-picker[hidden],
.registry-page [hidden] { display: none; }
.registry-wheel-wrap { position: relative; width: 100%; max-width: 280px; justify-self: center; aspect-ratio: 1; }
#gift-wheel { display: block; width: 100%; height: 100%; border-radius: 50%; box-shadow: 0 0 0 5px #fffdf7, 0 0 0 6px var(--registry-border); }
.registry-wheel-pointer { position: absolute; z-index: 1; top: -10px; left: calc(50% - 10px); border-left: 10px solid transparent; border-right: 10px solid transparent; border-top: 24px solid var(--ink); }
.registry-picker-copy h2 { font-size: 1.6rem; }
.registry-pick-result { min-height: 140px; }
.registry-pick-result p { margin-bottom: 0.5rem; }
.registry-pick-result a { color: var(--registry-blue); font-weight: 600; }
.registry-page button:disabled { opacity: 0.65; cursor: wait; }

@media (max-width: 900px) {
  .registry-funds { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .registry-bottom { grid-template-columns: 1fr; }
  .registry-picker { grid-template-columns: minmax(0, 260px) minmax(0, 1fr); }
}

@media (max-width: 540px) {
  .registry-page { padding: 1rem; }
  .registry-intro h1 { font-size: 2.2rem; }
  .registry-category-heading { grid-template-columns: 1fr; gap: 0.75rem; }
  .registry-page h2 { font-size: 1.75rem; }
  .registry-funds { grid-template-columns: 1fr; }
  .registry-picker { grid-template-columns: 1fr; text-align: center; }
  .registry-picker-copy h2 { font-size: 1.6rem; }
  .registry-pick-result { min-height: 120px; }
}

@media (max-width: 840px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .travel-map {
    width: min(100%, 300px);
  }

  .hero-photo-grid img {
    height: 200px;
  }
}
