/* ===========================================================================
   Deven & Ashley - public stylesheet
   ---------------------------------------------------------------------------
   Palette : warm ivory ground, sage as the working accent, brass used sparingly
             for small marks only, charcoal text.
   Type    : Fraunces (display serif, light weights) + Karla (body sans).
   Signature element: the arch. It frames the hero photograph, and its curve is
             echoed by the gallery feature image and the RSVP panel.
   ======================================================================== */

/* --- Tokens ------------------------------------------------------------- */
:root {
  --ivory: #FBF6EE;
  --ivory-deep: #F4ECE0;
  --paper: #FFFDF8;
  --ink: #2E2B27;
  --ink-soft: #6C6357;
  --ink-faint: #96897A;
  --sage: #5F7256;
  --sage-deep: #4C5C45;
  --sage-soft: #E7EBE1;
  --rose: #B07A72;
  --rose-soft: #F6E9E6;
  --brass: #A8873F;
  --line: #E7DCCB;

  --font-display: "Fraunces", "Iowan Old Style", Georgia, "Times New Roman", serif;
  --font-body: "Karla", "Helvetica Neue", Helvetica, Arial, sans-serif;

  --shell: 68rem;
  --radius: 5px;
  --arch: 999px 999px var(--radius) var(--radius) / 58% 58% 3% 3%;
  --shadow: 0 1px 2px rgba(46, 43, 39, 0.04), 0 12px 28px -22px rgba(46, 43, 39, 0.4);
}

/* --- Reset -------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--sage-deep); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brass); }

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 300;
  line-height: 1.12;
  letter-spacing: -0.005em;
  margin: 0;
}

p { margin: 0 0 1rem; }

:focus-visible {
  outline: 2px solid var(--sage-deep);
  outline-offset: 3px;
  border-radius: 2px;
}

.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem; z-index: 100;
  background: var(--sage); color: var(--paper);
  padding: 0.6rem 1rem; border-radius: var(--radius);
  transition: top 0.15s ease;
}
.skip-link:focus { top: 1rem; color: var(--paper); }

/* --- Layout ------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: var(--shell);
  margin: 0 auto;
  padding: 0 1.5rem;
}
.shell--narrow { max-width: 40rem; }
.shell--form { max-width: 46rem; }

.section { padding: clamp(3.25rem, 8vw, 6rem) 0; scroll-margin-top: 5rem; }

.section__title {
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  margin-bottom: 1.25rem;
}

.section__intro { color: var(--ink-soft); margin-bottom: 2rem; max-width: 34rem; }

.eyebrow {
  font-family: var(--font-body);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 1rem;
}

.rule {
  display: block;
  width: 100%;
  max-width: 12rem;
  margin: 2.25rem auto 0;
  height: 1px;
  background: var(--line);
  position: relative;
}
.rule::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  transform: translate(-50%, -50%) rotate(45deg);
  background: var(--brass);
}

.pending {
  color: var(--ink-faint);
  font-style: italic;
}

/* --- Header ------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(251, 246, 238, 0.92);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-stuck { border-bottom-color: var(--line); }

.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 3.75rem;
  flex-wrap: wrap;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.4rem;
  text-decoration: none;
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.wordmark:hover { color: var(--ink); }
.wordmark__amp {
  font-family: var(--font-display);
  font-size: 1.15rem;
  color: var(--brass);
  letter-spacing: 0;
  position: relative;
  top: 0.05em;
}

.site-nav { display: flex; align-items: center; gap: 1.35rem; }
.site-nav a {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  color: var(--ink-soft);
  text-decoration: none;
  padding: 0.35rem 0;
  border-bottom: 1px solid transparent;
}
.site-nav a:hover { color: var(--ink); border-bottom-color: var(--brass); }
.site-nav .site-nav__cta {
  border: 1px solid var(--sage);
  border-radius: 999px;
  color: var(--sage-deep);
  padding: 0.35rem 1rem;
}
.site-nav .site-nav__cta:hover {
  background: var(--sage);
  color: var(--paper);
  border-color: var(--sage);
}

/* --- Hero --------------------------------------------------------------- */
.hero { padding: clamp(2.5rem, 7vw, 5rem) 0 clamp(2.5rem, 7vw, 4.5rem); }

.hero__inner {
  display: grid;
  grid-template-columns: 1.02fr 0.98fr;
  gap: clamp(2rem, 5vw, 4rem);
  align-items: center;
}

.hero__names {
  font-size: clamp(2.5rem, 7.5vw, 4.25rem);
  display: flex;
  flex-direction: column;
  gap: 0.1em;
  margin-bottom: 1.25rem;
}
.hero__names .amp {
  font-size: 0.62em;
  color: var(--brass);
  font-weight: 300;
  margin-left: 0.06em;
}

.hero__meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
  font-size: 1rem;
  color: var(--ink-soft);
  letter-spacing: 0.02em;
  margin-bottom: 1.75rem;
}
.hero__dot { width: 4px; height: 4px; border-radius: 50%; background: var(--brass); }
.hero__date { color: var(--ink); }

.hero__actions {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  flex-wrap: wrap;
  margin: 0;
}
.hero__deadline { font-size: 0.9rem; color: var(--ink-faint); }

.hero__photo { position: relative; }

.arch { position: relative; }
.arch::after {
  content: "";
  position: absolute;
  inset: -0.7rem -0.7rem 1.1rem;
  border: 1px solid var(--line);
  border-radius: var(--arch);
  pointer-events: none;
}
.arch .photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--arch);
}

/* --- Photograph placeholders ------------------------------------------- */
.photo--empty {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  background:
    repeating-linear-gradient(
      135deg,
      var(--ivory-deep) 0 12px,
      #F0E7D9 12px 24px
    );
  border: 1px solid var(--line);
  color: var(--ink-faint);
  text-align: center;
  padding: 1.5rem;
  min-height: 9rem;
}
.photo__mark {
  width: 10px; height: 10px;
  transform: rotate(45deg);
  border: 1px solid var(--brass);
}
.photo__label {
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1.5;
}

/* --- Welcome ------------------------------------------------------------ */
.section--welcome { text-align: center; }
.section--welcome .section__title { margin-bottom: 1.5rem; }
.lede {
  font-family: var(--font-display);
  font-size: clamp(1.15rem, 2.4vw, 1.4rem);
  line-height: 1.55;
  color: var(--ink);
  font-weight: 300;
}

/* --- Gallery ------------------------------------------------------------ */
.section--gallery { background: var(--ivory-deep); }

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
}
.gallery__item { margin: 0; }
.gallery__item .photo {
  width: 100%;
  height: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: var(--radius);
}
.gallery__item--feature { grid-column: span 2; grid-row: span 2; }
.gallery__item--feature .photo {
  aspect-ratio: auto;
  min-height: 100%;
  border-radius: var(--arch);
}

/* --- Detail cards ------------------------------------------------------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(15.5rem, 1fr));
  gap: 1.1rem;
}

.card {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.6rem 1.5rem;
  box-shadow: var(--shadow);
}
.card--wide { grid-column: span 2; }
.card--accent { background: var(--sage-soft); border-color: #D7DFCF; }

.card__eyebrow {
  font-size: 0.68rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin: 0 0 0.55rem;
}
.card__title { font-size: 1.3rem; margin-bottom: 0.65rem; }
.card__body { color: var(--ink-soft); margin-bottom: 0.85rem; }
.card__body:last-child { margin-bottom: 0; }

.card__list { margin: 0; display: grid; grid-template-columns: auto 1fr; gap: 0.35rem 1rem; }
.card__list dt {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-faint);
  padding-top: 0.15rem;
}
.card__list dd { margin: 0; color: var(--ink); }

/* --- Buttons ------------------------------------------------------------ */
.button {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.92rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  line-height: 1.2;
  padding: 0.85rem 1.6rem;
  border-radius: 999px;
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, transform 0.18s ease;
}
.button--primary { background: var(--sage); color: var(--paper); }
.button--primary:hover { background: var(--sage-deep); color: var(--paper); transform: translateY(-1px); }
.button--ghost { background: transparent; color: var(--sage-deep); border-color: var(--sage); }
.button--ghost:hover { background: var(--sage-soft); color: var(--sage-deep); }
.button--large { padding: 1rem 2.2rem; font-size: 1rem; }
.button[disabled] { opacity: 0.55; cursor: progress; transform: none; }

/* --- RSVP --------------------------------------------------------------- */
.section--rsvp {
  background:
    linear-gradient(to bottom, var(--ivory) 0 6rem, var(--sage-soft) 6rem 100%);
}

.rsvp-form {
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: 1.75rem 1.75rem var(--radius) var(--radius);
  padding: clamp(1.5rem, 4vw, 2.5rem);
  box-shadow: var(--shadow);
}
.rsvp-form.is-hidden { display: none; }

.field-group {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 0 0 1.75rem;
  padding: 1.5rem 0 0;
}
.field-group:first-of-type { border-top: 0; padding-top: 0; }

.field-group__legend {
  font-family: var(--font-display);
  font-size: 1.15rem;
  padding: 0;
  margin-bottom: 1rem;
}

.field { margin-bottom: 1.15rem; }
.field:last-child { margin-bottom: 0; }
.field--compact { max-width: 18rem; }

.field label,
.guest-block__label {
  display: block;
  font-size: 0.86rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  margin-bottom: 0.4rem;
}
.optional { font-weight: 400; color: var(--ink-faint); }
.req { color: var(--rose); }

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="password"],
input[type="search"],
select,
textarea {
  width: 100%;
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--ink);
  background: var(--ivory);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  min-height: 2.9rem;
}
textarea { min-height: 5rem; resize: vertical; }
select {
  appearance: none;
  background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%236C6357' d='M1 1l5 5 5-5'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 0.9rem center;
  background-size: 12px;
  padding-right: 2.4rem;
}
input:focus, select:focus, textarea:focus {
  border-color: var(--sage);
  background: var(--paper);
}

.field__hint { font-size: 0.85rem; color: var(--ink-faint); margin: 0.4rem 0 0; }
.field__error { font-size: 0.85rem; color: var(--rose); margin: 0.4rem 0 0; min-height: 0; }
.field__error:empty { display: none; }
.field--error input,
.field--error select,
.field--error textarea { border-color: var(--rose); background: var(--rose-soft); }

/* Attendance choice cards */
.choice-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.75rem; }
.choice { display: block; cursor: pointer; }
.choice input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.choice__box {
  display: block;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--ivory);
  padding: 1rem 1.1rem;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}
.choice__title { display: block; font-weight: 500; }
.choice__note { display: block; font-size: 0.85rem; color: var(--ink-faint); }
.choice input:checked + .choice__box {
  border-color: var(--sage);
  background: var(--sage-soft);
  box-shadow: inset 0 0 0 1px var(--sage);
}
.choice input:focus-visible + .choice__box { outline: 2px solid var(--sage-deep); outline-offset: 2px; }

.guest-block {
  border-left: 2px solid var(--sage-soft);
  padding: 0.25rem 0 0.25rem 1.1rem;
  margin-bottom: 1.5rem;
}
.guest-block[hidden] { display: none; }
.guest-block__label {
  font-family: var(--font-body);
  font-size: 0.7rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brass);
  margin-bottom: 0.75rem;
}

.attending-only[hidden] { display: none; }
.attending-only-field[hidden] { display: none; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  flex-wrap: wrap;
  margin-top: 0.5rem;
}
.form-actions__note { font-size: 0.85rem; color: var(--ink-faint); margin: 0; }

.privacy-note {
  margin: 1.75rem 0 0;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.85rem;
  color: var(--ink-faint);
  line-height: 1.6;
}

/* Honeypot - present for robots, gone for people */
.hp {
  position: absolute !important;
  left: -9999px;
  width: 1px; height: 1px;
  overflow: hidden;
}

/* Status messages */
.status:focus { outline: none; }
.status__panel {
  border: 1px solid var(--line);
  border-left: 3px solid var(--sage);
  border-radius: var(--radius);
  background: var(--paper);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.5rem;
}
.status__panel p:last-child { margin-bottom: 0; }
.status__panel--success { border-left-color: var(--sage); background: var(--sage-soft); }
.status__panel--error { border-left-color: var(--rose); background: var(--rose-soft); }
.status__panel--duplicate { border-left-color: var(--brass); background: #F7F0E2; }
.status__title { font-size: 1.35rem; margin-bottom: 0.5rem; }

.confirm-update {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  margin-top: 0.5rem;
  font-size: 0.95rem;
  cursor: pointer;
}
.confirm-update input { margin-top: 0.3rem; width: 1.05rem; height: 1.05rem; accent-color: var(--sage); }

/* --- Simple pages ------------------------------------------------------- */
.section--page { padding-top: clamp(2.5rem, 6vw, 4rem); }
.subhead {
  font-family: var(--font-display);
  font-size: 1.25rem;
  margin: 2rem 0 0.6rem;
}
.plain-list { margin: 0 0 1rem; padding-left: 1.15rem; color: var(--ink-soft); }
.plain-list li { margin-bottom: 0.35rem; }
.back-link { margin-top: 2.5rem; }

/* --- Footer ------------------------------------------------------------- */
.site-footer {
  background: var(--ink);
  color: #E8E1D6;
  padding: clamp(2.5rem, 6vw, 3.5rem) 0;
}
.site-footer a { color: #E8E1D6; }
.site-footer a:hover { color: #E3C98B; }

.site-footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 2rem;
  flex-wrap: wrap;
}

.footer-couple {
  font-family: var(--font-display);
  font-size: 1.5rem;
  margin: 0 0 0.25rem;
}
.footer-date, .footer-email, .footer-links { font-size: 0.9rem; margin: 0 0 0.25rem; color: #BDB3A5; }
.footer-links { margin-top: 0.75rem; }

.credit {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  max-width: 20rem;
  opacity: 0.75;
  transition: opacity 0.2s ease;
}
.credit:hover { opacity: 1; }
.credit__logo { width: 44px; height: auto; flex: none; }
.credit__logo--empty {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px; height: 44px;
  border: 1px dashed #6A6157;
  border-radius: var(--radius);
  font-size: 0.42rem;
  letter-spacing: 0.06em;
  text-align: center;
  padding: 0.25rem;
  color: #BDB3A5;
  flex: none;
}
.credit__text {
  font-size: 0.8rem;
  line-height: 1.5;
  color: #BDB3A5;
  margin: 0;
}
.credit__paw { white-space: nowrap; }
.credit__paw svg { fill: #E3C98B; vertical-align: -0.15em; margin-right: 0.25em; }

/* --- Responsive --------------------------------------------------------- */
@media (max-width: 62rem) {
  .card--wide { grid-column: span 1; }
}

@media (max-width: 48rem) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__photo { order: -1; max-width: 22rem; margin: 0 auto; }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .gallery__item--feature { grid-column: span 2; grid-row: span 1; }
  .gallery__item--feature .photo { aspect-ratio: 5 / 4; }
  .site-header__inner { min-height: 3.25rem; }
  .site-nav { gap: 0.9rem; }
  .site-nav a { font-size: 0.8rem; }
  .wordmark { font-size: 0.68rem; }
  .site-footer__inner { align-items: flex-start; }
}

@media (max-width: 30rem) {
  body { font-size: 1rem; }
  .wordmark { font-size: 0.62rem; letter-spacing: 0.12em; }
  .button { width: 100%; text-align: center; }
  .hero__actions { align-items: stretch; }
  .site-nav .site-nav__cta { padding: 0.3rem 0.85rem; }
}

/* --- Print -------------------------------------------------------------- */
@media print {
  .site-header, .section--rsvp, .site-footer, .button { display: none; }
  body { background: #fff; }
}

/* --- Reduced motion ----------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* ===========================================================================
   PHASE 2
   Lodging and registry buttons, the adults/children RSVP blocks, and the
   guest photo upload page. Uses the existing tokens only - no new colours.
   ======================================================================== */

/* --- Stacked link buttons inside a details card ------------------------- */
.link-list {
  list-style: none;
  margin: 0.75rem 0 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.link-list li { margin: 0; }

.button--block {
  display: block;
  width: 100%;
  text-align: center;
}

/* --- Slimmer yes/no rows in the RSVP form ------------------------------- */
.choice-row--slim { gap: 0.5rem; }
.choice--slim .choice__box { padding: 0.65rem 0.9rem; }
.choice--slim .choice__title { font-size: 0.95rem; }

.field__label {
  display: block;
  font-weight: 500;
  margin-bottom: 0.4rem;
  color: var(--ink);
}

.field-group__note {
  margin: -0.35rem 0 1rem;
  font-size: 0.92rem;
  color: var(--ink-soft, #5c574f);
  line-height: 1.5;
}

/* --- Child guest blocks ------------------------------------------------- */
.guest-block--child {
  border-left: 2px solid var(--line);
  padding-left: 1rem;
}

/* Hidden sections should take up no room at all. */
.guest-block[hidden],
#children-detail[hidden],
#adult-2-block[hidden] { display: none !important; }

/* --- Guest photo upload page -------------------------------------------- */
.section--photos { text-align: center; }
.section--photos .button { margin-top: 0.5rem; }

.section__intro--quiet {
  font-size: 0.92rem;
  color: var(--ink-soft, #5c574f);
}

.shell--narrow {
  max-width: 46rem;
  margin-inline: auto;
}

input[type="file"] {
  width: 100%;
  padding: 0.85rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
  background: var(--paper);
  font: inherit;
  font-size: 0.95rem;
  color: var(--ink);
  cursor: pointer;
}
input[type="file"]:focus-visible {
  outline: 2px solid var(--sage);
  outline-offset: 2px;
}

.status__list {
  margin: 0.5rem 0 0;
  padding-left: 1.2rem;
  font-size: 0.92rem;
  line-height: 1.6;
}

.form-actions { margin-top: 1.5rem; }

@media (max-width: 30rem) {
  .choice-row--slim { flex-direction: row; }
  .choice--slim { flex: 1 1 0; }
}
