:root {
  --rust: #9f4f0d;
  --maroon: #661313;
  --green-dark: #21360b;
  --teal-dark: #194d3c;
  --brown: #4d290f;
  --gold: #ffbe40;
  --cream: #faf5ea;
  --cream-deep: #f1e6d2;
  --ink: #3a2414;

  --font-heading: 'Playfair Display', Georgia, serif;
  --font-body: 'Alice', Georgia, serif;

  /* Height of the fixed header; interior pages pad by this much. */
  --header-h: 89px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 18px;
  line-height: 1.65;
  height: 100%;
}

body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

h1, h2, h3, h4 {
  font-family: var(--font-heading);
  color: var(--maroon);
  font-weight: 600;
  letter-spacing: 0.02em;
  margin-top: 0;
}

a {
  color: var(--rust);
  text-decoration: none;
}
a:hover { text-decoration: underline; }

img { max-width: 100%; display: block; }

.container {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 1.5rem;
}

/* Header / nav */
.site-header {
  color: var(--cream);
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  flex-shrink: 0;
  transition: box-shadow 0.3s ease;
}
/* The brown bar, faded in once the page is scrolled */
.site-header::after {
  content: "";
  position: absolute;
  inset: 0;
  background-color: var(--green-dark); /* #21360b */
  background-image: url("https://www.transparenttextures.com/patterns/low-contrast-linen.png");
  opacity: 1;
  transition: opacity 0.35s ease;
  pointer-events: none;
}
.site-header__inner {
  position: relative;
  z-index: 1;
  width: 100%;
  padding: 0.9rem clamp(1.5rem, 3vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
}

/* Interior pages sit below the fixed bar; the hero page slides under it. */
main { padding-top: var(--header-h); }
body.has-hero main { padding-top: 0; }

/* Over the hero the bar is fully transparent until the reader scrolls;
   legibility comes from the hero's own scrim (see .hero::before). */
body.has-hero .site-header::after { opacity: 0; }
body.has-hero .site-header.is-scrolled::after { opacity: 1; }

.site-header.is-scrolled,
body:not(.has-hero) .site-header { box-shadow: 0 2px 6px rgba(0,0,0,0.15); }

body.has-hero .site-header:not(.is-scrolled) .brand,
body.has-hero .site-header:not(.is-scrolled) .site-nav a,
body.has-hero .site-header:not(.is-scrolled) .nav-group__toggle {
  text-shadow: 0 1px 4px rgba(0,0,0,0.55);
}

/* Mobile drawer needs a solid bar behind it whatever the scroll position */
.site-header:has(.nav-toggle:checked)::after { opacity: 1; }

.brand {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  color: var(--gold);
  letter-spacing: 0.08em;
}
.brand:hover { text-decoration: none; opacity: 0.85; }

.site-nav {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
}
.site-nav a {
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1.25rem;
}
.site-nav a:hover { color: var(--gold); text-decoration: none; }
.nav-cta {
  background: var(--gold);
  color: var(--brown) !important;
  padding: 0.5rem 1.3rem;
  border-radius: 3px;
  font-weight: bold;
  text-shadow: none !important;
}
.nav-cta:hover { background: #ffd579; }

/* Nav dropdown groups */
.nav-group { position: relative; }
.nav-group__toggle {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: none;
  padding: 0;
  cursor: pointer;
  color: var(--cream);
  font-family: var(--font-body);
  font-size: 1.25rem;
  line-height: inherit;
}
.nav-group__toggle:hover { color: var(--gold); }
.nav-caret {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid currentColor;
  transition: transform 0.15s ease;
}
.nav-group.is-open .nav-caret { transform: rotate(180deg); }

.nav-group__menu {
  position: absolute;
  top: 100%;
  left: -0.85rem;
  min-width: 190px;
  margin-top: 0.9rem;
  padding: 0.5rem 0;
  background-color: var(--green-dark);
  background-image: url("https://www.transparenttextures.com/patterns/low-contrast-linen.png");
  border-top: 2px solid var(--gold);
  border-radius: 0 0 4px 4px;
  box-shadow: 0 8px 18px rgba(0,0,0,0.25);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  /* the visibility delay keeps the panel alive briefly after the pointer
     leaves, so a quick corner-cut on the way to a link doesn't close it */
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0s linear 0.25s;
}
/* Invisible bridge across the gap between the label and the panel, so the
   pointer never crosses dead space on its way down to the links. */
.nav-group__menu::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 100%;
  height: 0.9rem;
}
.nav-group:hover .nav-group__menu,
.nav-group:focus-within .nav-group__menu,
.nav-group.is-open .nav-group__menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition-delay: 0s;
}
.nav-group__menu a {
  display: block;
  padding: 0.5rem 1.1rem;
  white-space: nowrap;
}
.nav-group__menu a:hover { background: rgba(255,190,64,0.15); color: var(--gold); }

.nav-toggle, .nav-toggle-label { display: none; }

@media (max-width: 760px) {
  .nav-toggle-label {
    display: flex;
    flex-direction: column;
    gap: 4px;
    cursor: pointer;
  }
  .nav-toggle-label span {
    width: 24px;
    height: 2px;
    background: var(--cream);
  }
  .site-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.75rem;
    padding-top: 1rem;
  }
  .nav-toggle:checked ~ .site-nav {
    display: flex;
  }

  /* Groups become labeled sections inside the drawer */
  .nav-group { width: 100%; }
  .nav-group__toggle {
    pointer-events: none;
    font-size: 0.75rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--gold);
    margin-bottom: 0.4rem;
  }
  .nav-caret { display: none; }
  .nav-group__menu {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    margin: 0;
    padding: 0 0 0 0.9rem;
    min-width: 0;
    background: none;
    border: none;
    border-left: 2px solid rgba(255,190,64,0.35);
    border-radius: 0;
    box-shadow: none;
  }
  .nav-group__menu a { padding: 0.35rem 0; }
  .nav-group__menu a:hover { background: none; }
}

/* Hero */
.hero {
  position: relative;
  overflow: hidden;
  text-align: center;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 4rem 1.5rem;
  background: linear-gradient(180deg, var(--cream-deep), var(--cream));
}
/* Dark gradient across the top of the hero, so the transparent nav bar
   stays legible over whatever the photo is doing up there. */
.hero::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: calc(var(--header-h) * 2.2);
  background: linear-gradient(
    180deg,
    rgba(0,0,0,0.62) 0%,
    rgba(0,0,0,0.34) 42%,
    rgba(0,0,0,0) 100%
  );
  z-index: 2; /* above the photo and the mobile cream overlay, below the copy */
  pointer-events: none;
}
.hero__bg-image {
  position: absolute;
  inset: 0 45% 0 0;
  background-size: cover;
  background-position: center 20%;
  opacity: 0.9;
  -webkit-mask-image: linear-gradient(to right, black 55%, transparent 100%);
  mask-image: linear-gradient(to right, black 55%, transparent 100%);
  z-index: 0;
}
.hero__overlay {
  position: absolute;
  inset: 0;
  background: rgba(250, 245, 234, 0);
  z-index: 1;
  pointer-events: none;
}
.hero__content {
  position: relative;
  z-index: 3;
  width: 100%;
}

/* Medium and large screens: photo on the left, content in the right column */
@media (min-width: 761px) {
  .hero {
    justify-content: flex-end;
    padding: 5rem clamp(3rem, 9vw, 9rem);
  }
  .hero__content {
    width: min(58%, 620px);
    margin-left: auto;
  }
}
@media (min-width: 761px) and (max-width: 1080px) {
  .countdown { gap: 0.75rem; }
  .countdown__unit { min-width: 74px; padding: 0.85rem 0.5rem; }
  .countdown__number { font-size: 1.9rem; }
}

@media (max-width: 760px) {
  .hero__bg-image {
    inset: 0;
    -webkit-mask-image: none;
    mask-image: none;
    opacity: 1;
  }
  /* Lighter than it looks it should be: the copy keeps its contrast from
     the halo below rather than from washing the photo out. */
  .hero__overlay {
    background: linear-gradient(
      180deg,
      rgba(250, 245, 234, 0.42) 0%,
      rgba(250, 245, 234, 0.60) 38%,
      rgba(250, 245, 234, 0.60) 72%,
      rgba(250, 245, 234, 0.40) 100%
    );
  }
  /* Soft cream halo so the dark type still reads over the photo. */
  .hero__content {
    text-shadow:
      0 0 12px rgba(250, 245, 234, 0.95),
      0 0 4px rgba(250, 245, 234, 0.9),
      0 1px 2px rgba(250, 245, 234, 0.8);
  }
  /* Elements with their own solid background don't need it. */
  .hero .countdown__unit,
  .hero .btn { text-shadow: none; }
}
.hero__names {
  font-family: var(--font-heading);
  font-size: clamp(2.5rem, 7vw, 4.5rem);
  color: var(--maroon);
  margin: 0 0 0.5rem;
}
.hero__date {
  font-size: 1.15rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--rust);
  margin-bottom: 1.5rem;
}
.hero__details {
  max-width: 520px;
  margin: 0 auto 2rem;
  color: var(--brown);
}
.hero__details p { margin: 0.3rem 0; }
.hero__venue {
  font-family: var(--font-heading);
  font-size: clamp(1.3rem, 2.4vw, 1.65rem);
  color: var(--maroon);
  line-height: 1.25;
}
.hero__address {
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-dark);
}
.hero__ceremony {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.15rem;
  color: var(--brown);
  margin-top: 0.9rem !important;
}
.hero__ceremony em {
  font-style: normal;
  color: var(--rust);
}

.divider {
  width: 60px;
  height: 3px;
  background: var(--gold);
  margin: 1.5rem auto;
  border: none;
}

/* Countdown */
.countdown {
  display: flex;
  justify-content: center;
  gap: 1.5rem;
  flex-wrap: nowrap; /* the four units always stay on one row */
  margin: 2rem 0;
}
.countdown__unit {
  flex: 0 1 auto;
  min-width: 90px;
  background: var(--teal-dark);
  color: var(--cream);
  border-radius: 6px;
  padding: 1rem 0.75rem;
}
.countdown__number {
  font-family: var(--font-heading);
  font-size: 2.2rem;
  display: block;
}
.countdown__label {
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}
@media (max-width: 560px) {
  .countdown { gap: 0.5rem; margin: 1.5rem 0; }
  .countdown__unit {
    flex: 1 1 0;
    min-width: 0;
    padding: 0.7rem 0.2rem;
  }
  .countdown__number { font-size: 1.6rem; }
  .countdown__label { font-size: 0.62rem; letter-spacing: 0.04em; }
}
@media (max-width: 360px) {
  .countdown__number { font-size: 1.35rem; }
  .countdown__label { font-size: 0.55rem; }
}

/* Buttons */
.btn {
  display: inline-block;
  background: var(--rust);
  color: var(--cream) !important;
  padding: 0.75rem 1.8rem;
  border-radius: 4px;
  font-family: var(--font-heading);
  font-size: 1.05rem;
  text-decoration: none !important;
}
.btn:hover { background: var(--maroon); }
.btn--gold {
  background: var(--gold);
  color: var(--brown) !important;
}
.btn--lg {
  padding: 0.9rem 2.4rem;
  font-size: 1.2rem;
  letter-spacing: 0.06em;
}
.btn--gold:hover { background: #ffd579; }

/* Content sections */
.section { padding: 3rem 1.5rem; }
.section--alt { background: var(--cream-deep); }
.section-title {
  text-align: center;
  margin-bottom: 2rem;
}

/* Homepage intro note */
.section--intro {
  padding: 4.5rem 1.5rem;
  background: var(--cream-deep);
}
.intro-layout {
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 2.15fr);
  align-items: center;
  gap: clamp(2rem, 4vw, 3.5rem);
}
.intro-photo img {
  width: 100%;
  height: auto; /* the width/height attrs would otherwise beat aspect-ratio */
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 8px;
  box-shadow: 0 10px 26px rgba(77, 41, 15, 0.22);
}
@media (max-width: 760px) {
  .intro-layout {
    grid-template-columns: 1fr;
    gap: 2.25rem;
    justify-items: center;
  }
  .intro-photo { max-width: 260px; }
}
.intro-lead {
  font-family: var(--font-heading);
  font-style: italic;
  font-weight: 500;
  font-size: clamp(1.6rem, 3.6vw, 2.6rem);
  line-height: 1.3;
  color: var(--maroon);
  max-width: 22ch;
  margin: 0 auto;
}
.intro-sub {
  font-size: clamp(1rem, 1.6vw, 1.15rem);
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--teal-dark);
  max-width: 34ch;
  margin: 0 auto 0.75rem;
}
.intro-flourish {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.5rem;
  color: var(--rust);
  margin: 0;
}

.card {
  background: #fff;
  border: 1px solid #e8dcc4;
  border-radius: 8px;
  padding: 1.5rem 1.75rem;
  margin-bottom: 1.25rem;
}

.schedule-day {
  border-left: 3px solid var(--gold);
  padding-left: 1.25rem;
  margin-bottom: 2rem;
}
.schedule-day h3 { margin-bottom: 0.5rem; }
.schedule-day__date {
  margin: 0 0 0.75rem;
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--rust);
}
.schedule-item {
  display: flex;
  gap: 1rem;
  margin: 0.4rem 0;
}
.schedule-item__time {
  min-width: 90px;
  font-weight: bold;
  color: var(--teal-dark);
}
.schedule-item__sub {
  display: block;
  font-size: 0.9rem;
  color: #7a6b52;
}
.schedule-heading {
  margin: 3rem 0 0.25rem;
  padding-top: 2rem;
  border-top: 1px solid #e8dcc4;
}
.schedule-note { margin-top: 0; margin-bottom: 1.5rem; }

/* Wedding party */
.party-heading {
  font-size: 1.35rem;
  margin: 2.5rem 0 1.25rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e8dcc4;
}
.party-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 1rem;
}
.party-columns {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem 2.5rem;
}
.party-column {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
@media (max-width: 640px) {
  .party-columns { grid-template-columns: 1fr; gap: 1rem; }
}

.party-member {
  background: #fff;
  border: 1px solid #e8dcc4;
  border-radius: 8px;
  padding: 1.1rem 1.25rem;
  text-align: center;
}
.party-member--honor {
  border: 2px solid var(--gold);
  background: #fffdf6;
}
.party-member__name {
  font-family: var(--font-heading);
  font-size: 1.1rem;
  color: var(--maroon);
  margin: 0;
  line-height: 1.35;
}
.party-member__role {
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--teal-dark);
  margin: 0.4rem 0 0;
}

/* Registry */
.registry-card {
  position: relative;
  max-width: 700px;
  margin: 0 auto;
  padding: 3.25rem 2.5rem 2.75rem;
  text-align: center;
  background: linear-gradient(180deg, #fff, var(--cream));
  border: 1px solid #e8dcc4;
  border-radius: 10px;
  box-shadow: 0 12px 30px rgba(77, 41, 15, 0.1);
}
/* Inset gold frame, like the rule on an invitation */
.registry-card::before {
  content: "";
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(255, 190, 64, 0.6);
  border-radius: 6px;
  pointer-events: none;
}
/* Three gold diamonds, drawn in CSS so no font has to carry the glyph */
.registry-ornament {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  margin-bottom: 1.5rem;
}
.registry-ornament i {
  width: 7px;
  height: 7px;
  background: var(--gold);
  opacity: 0.55;
  transform: rotate(45deg);
}
.registry-ornament i:nth-child(2) {
  width: 11px;
  height: 11px;
  opacity: 1;
}
.registry-lead {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: clamp(1.45rem, 3vw, 2.05rem);
  line-height: 1.35;
  color: var(--maroon);
  max-width: 20ch;
  margin: 0 auto;
}
.registry-lead em {
  display: block;
  font-style: normal;
  color: var(--rust);
  margin-top: 0.35rem;
}
.registry-body {
  font-size: 1.15rem;
  color: var(--brown);
  max-width: 32ch;
  margin: 0 auto 2rem;
}
.registry-note {
  margin: 2.25rem 0 0;
  font-size: 0.85rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal-dark);
}
.registry-note__heart {
  color: var(--rust);
  font-size: 1rem;
  letter-spacing: 0;
}

.faq-item { margin-bottom: 1.5rem; }
.faq-item h3 { color: var(--teal-dark); margin-bottom: 0.3rem; }

/* Forms */
.form-group { margin-bottom: 1.4rem; }
.form-group label {
  display: block;
  font-weight: bold;
  color: var(--brown);
  margin-bottom: 0.35rem;
}
.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="number"],
.form-group textarea {
  width: 100%;
  padding: 0.6rem 0.75rem;
  border: 1px solid #cbb98e;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 1rem;
  background: #fff;
}
.form-group textarea { min-height: 90px; resize: vertical; }
.radio-group { display: flex; gap: 1.5rem; }
.radio-group label { font-weight: normal; display: flex; align-items: center; gap: 0.4rem; }
.field-error { color: var(--maroon); font-size: 0.85rem; margin-top: 0.25rem; }
.help-text { color: #7a6b52; font-size: 0.9rem; margin-top: 0.25rem; }

.flash-container { max-width: 700px; margin: 1rem auto 0; padding: 0 1.5rem; }
.flash {
  padding: 0.85rem 1.1rem;
  border-radius: 4px;
  margin-bottom: 0.75rem;
}
.flash--error { background: #f7dede; color: var(--maroon); }
.flash--success { background: #e1ecdd; color: var(--green-dark); }

/* Photo gallery */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1rem;
}
.gallery img, .gallery__placeholder {
  border-radius: 6px;
  aspect-ratio: 4/3;
  object-fit: cover;
  background: var(--cream-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9a8a68;
  font-family: var(--font-heading);
}

/* Table (admin) */
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
table th, table td {
  padding: 0.6rem 0.75rem;
  border-bottom: 1px solid #e8dcc4;
  text-align: left;
  font-size: 0.92rem;
}
table th {
  background: var(--cream-deep);
  color: var(--brown);
}

/* Footer */
.site-footer {
  position: relative;
  background-color: var(--cream);
  background-image: url("../images/photos/footer.jpg");
  background-repeat: no-repeat;
  background-position: center bottom;
  background-size: cover;
  color: var(--ink);
  padding: 2.75rem 1.5rem 2.25rem;
  flex-shrink: 0;
}
.site-footer__masthead {
  position: relative;
  text-align: center;
  max-width: 1000px;
  margin: 0 auto 2rem;
  padding-bottom: 1.75rem;
  border-bottom: 1px solid rgba(77, 41, 15, 0.25);
}
.site-footer__names {
  font-family: var(--font-heading);
  font-size: 1.9rem;
  color: var(--maroon);
  margin: 0 0 0.3rem;
}
.site-footer__date {
  margin: 0;
  font-size: 1.05rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--rust);
}
.site-footer__columns {
  position: relative;
  max-width: 1000px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 2rem;
}
.footer-col { display: flex; flex-direction: column; align-items: flex-start; }
/* Columns converge on the centre: right-aligned, centred, then left-aligned */
.footer-col:nth-child(1) { align-items: flex-end; text-align: right; }
.footer-col:nth-child(2) { align-items: center; text-align: center; }
.footer-col__title {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--rust);
  margin: 0 0 0.75rem;
}
.site-footer a.footer-col__address {
  margin-top: 0.75rem;
  font-size: 1rem;
  line-height: 1.5;
  color: var(--brown);
}
.site-footer a.footer-col__address:hover { color: var(--rust); }
.site-footer a {
  color: var(--brown);
  text-decoration: none;
  font-size: 1.1rem;
  padding: 0.24rem 0;
}
.site-footer a:hover { color: var(--rust); text-decoration: underline; }

@media (max-width: 760px) {
  .site-footer__columns {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    text-align: center;
  }
  .footer-col,
  .footer-col:nth-child(1),
  .footer-col:nth-child(2) { align-items: center; text-align: center; }
}

.text-center { text-align: center; }

/* Admin mail status */
.mail-status { font-weight: bold; }
.mail-status--ok { color: var(--teal-dark); }
.mail-status--off { color: var(--maroon); font-weight: normal; }
