/* Vanya & Adam — F2 design language.
   TOKEN HEXES ARE LOCKED BY tests/contrast.test.ts — change them only with that test. */

@font-face { font-family: "Great Vibes"; src: url("/fonts/great-vibes-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair-display-500.woff2") format("woff2"); font-weight: 500; font-display: swap; }
@font-face { font-family: "Playfair Display"; src: url("/fonts/playfair-display-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-italic.woff2") format("woff2"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Cormorant Garamond"; src: url("/fonts/cormorant-garamond-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-regular.woff2") format("woff2"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Inter"; src: url("/fonts/inter-600.woff2") format("woff2"); font-weight: 600; font-display: swap; }

:root {
  --wash-top: #fbfaf5;
  --wash-bottom: #eef2f8;
  --panel: #ffffff;
  --ink: #434b57;
  --ink-deep: #2f3742;
  --slate: #5b7396;
  --slate-deep: #46597a;
  --gold: #7a6437;
  --gold-bright: #cbb475;
  --blue-soft: #93a8c0;
  --blue-faint: #dde5ee;
  --muted: #6d7683;
  --serif: "Cormorant Garamond", Georgia, serif;
  --display: "Playfair Display", Georgia, serif;
  --script: "Great Vibes", cursive;
  --ui: "Inter", system-ui, sans-serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  font-family: var(--serif);
  font-size: 1.2rem;
  line-height: 1.6;
  color: var(--ink);
  background: linear-gradient(180deg, var(--wash-top) 0%, var(--wash-bottom) 100%) fixed;
  min-height: 100vh;
}

/* ---- Navigation (A1's formal top) ---- */
.site-nav {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: clamp(1rem, 4vw, 2.2rem);
  padding: 1.1rem 1rem;
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.6);
  border-bottom: 1px solid var(--blue-faint);
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 10;
}
.site-nav a { color: var(--slate-deep); text-decoration: none; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--ink-deep); text-decoration: underline; text-underline-offset: 4px; }
.site-nav a[aria-current="page"] { color: var(--ink-deep); font-weight: 600; }
.site-nav a.nav-rsvp { color: var(--gold); font-weight: 600; }

/* ---- Typography ---- */
.eyebrow {
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.4em;
  text-transform: uppercase;
  color: var(--gold);
}
.names-script {
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(3rem, 10vw, 4.8rem);
  line-height: 1.1;
  color: var(--slate);
}
h1, h2, h3 { font-family: var(--display); color: var(--ink-deep); font-weight: 600; }
h2 { font-size: clamp(1.6rem, 4vw, 2.1rem); }
h3 { font-size: 1.25rem; }
.subtle { color: var(--muted); }        /* only use inside .card / white panels */
.small-ui { font-family: var(--ui); font-size: 0.85rem; }

/* ---- Gold divider (M4's thread) ---- */
.gold-divider {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  margin: 1.2rem auto;
  color: var(--gold);
  font-size: 0.7rem;
}
.gold-divider::before, .gold-divider::after {
  content: "";
  width: 2.4rem;
  height: 1px;
  background: var(--gold-bright);
}

/* ---- Layout ---- */
.page-wrap { max-width: 44rem; margin: 0 auto; padding: 2.5rem 1.25rem 4rem; position: relative; }
.hero { text-align: center; padding: 3.5rem 1rem 3rem; position: relative; }

/* ---- Botanical corners ---- */
.corner { position: fixed; width: clamp(90px, 18vw, 170px); opacity: 0.5; pointer-events: none; z-index: 0; }
.corner--tr { top: 0; right: 0; transform: scaleX(-1); }
.corner--tl { top: 0; left: 0; }
.corner--bl { bottom: 0; left: 0; transform: scaleY(-1); }
.corner--br { bottom: 0; right: 0; transform: scale(-1, -1); }

/* ---- Buttons ---- */
.btn, .btn-outline {
  display: inline-block;
  font-family: var(--ui);
  font-size: 0.72rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  padding: 0.85rem 2.2rem;
  text-decoration: none;
  cursor: pointer;
  border-radius: 2px;
  transition: background 0.15s ease, color 0.15s ease;
}
.btn { background: var(--slate); color: #ffffff; border: 1px solid var(--slate); }
.btn:hover, .btn:focus-visible { background: var(--slate-deep); border-color: var(--slate-deep); }
.btn-outline { background: transparent; color: var(--slate-deep); border: 1px solid var(--slate); }
.btn-outline:hover, .btn-outline:focus-visible { background: var(--slate); color: #ffffff; }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }

/* ---- Cards & forms ---- */
.card {
  background: var(--panel);
  border: 1px solid var(--blue-faint);
  border-radius: 6px;
  padding: 1.6rem;
  margin: 1.2rem 0;
  box-shadow: 0 1px 2px rgba(70, 89, 122, 0.06);
  position: relative;
  z-index: 1;
}
.field { margin-bottom: 1rem; }
.field label { display: block; font-family: var(--ui); font-size: 0.8rem; color: var(--ink-deep); margin-bottom: 0.35rem; }
.field input[type="text"], .field input[type="password"] {
  width: 100%;
  font-family: var(--ui);
  font-size: 1.05rem;
  padding: 0.7rem 0.9rem;
  border: 1px solid var(--blue-faint);
  border-radius: 4px;
  color: var(--ink-deep);
  background: var(--panel);
}
.field input:focus-visible { outline: 2px solid var(--slate); outline-offset: 1px; }

/* ---- Choice pills (RSVP yes/no) ---- */
.pill-group { display: inline-flex; gap: 0.5rem; }
.pill {
  font-family: var(--ui);
  font-size: 0.8rem;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--blue-faint);
  border-radius: 999px;
  background: var(--panel);
  color: var(--ink);
  cursor: pointer;
}
.pill[aria-pressed="true"] { background: var(--slate); border-color: var(--slate); color: #ffffff; }
.pill:disabled { opacity: 0.55; cursor: not-allowed; }
.pill[aria-pressed="true"].pill-no { background: var(--slate-deep); border-color: var(--slate-deep); }

/* ---- Notices ---- */
.notice { font-family: var(--ui); font-size: 0.9rem; padding: 0.8rem 1rem; border-radius: 4px; margin: 1rem 0; }
.notice-ok { background: #e7efe7; color: #2d4a2f; border: 1px solid #c6d9c6; }
.notice-err { background: #f7e8e6; color: #7a2e25; border: 1px solid #e4c3bd; }

/* ---- Tables (admin) ---- */
.table-scroll { overflow-x: auto; }
table.data { border-collapse: collapse; width: 100%; font-family: var(--ui); font-size: 0.88rem; background: var(--panel); }
table.data th, table.data td { border: 1px solid var(--blue-faint); padding: 0.5rem 0.7rem; text-align: left; color: var(--ink); }
table.data th { background: var(--wash-top); color: var(--ink-deep); font-weight: 600; }

footer.site-footer {
  text-align: center;
  font-family: var(--ui);
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--slate-deep);
  padding: 2rem 0 2.5rem;
}

/* ---- Photo gallery ---- */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr));
  gap: 0.8rem;
  margin-top: 0.9rem;
}
.photo-tile { margin: 0; }
.photo-tile a { display: block; border-radius: 8px; overflow: hidden; border: 1px solid var(--blue-faint); background: var(--panel); }
.photo-tile img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform 0.2s ease; }
.photo-tile a:hover img { transform: scale(1.03); }
.photo-tile figcaption { margin-top: 0.35rem; text-align: center; }

/* ---- Reply-by deadline banner (events + rsvp pages) ---- */
.reply-banner {
  display: inline-flex;
  gap: 0.4rem;
  align-items: baseline;
  font-family: var(--ui);
  font-size: 0.85rem;
  color: var(--gold);
  background: #f7f2e4;
  border: 1px solid var(--gold-bright);
  border-radius: 6px;
  padding: 0.5rem 0.9rem;
  margin-top: 0.8rem;
}

/* ---- Admin panel (scoped: guest pages unaffected) ---- */
.admin-head { display: flex; align-items: baseline; gap: 1rem; flex-wrap: wrap; }
.admin-head .signout { margin-left: auto; font-family: var(--ui); font-size: 0.8rem; color: var(--muted); }
.admin-head .signout a { color: var(--slate-deep); }

.admin-tabs { display: flex; gap: 0.2rem; border-bottom: 2px solid var(--blue-faint); margin: 1.2rem 0 1.4rem; overflow-x: auto; }
.admin-tab {
  font-family: var(--ui); font-size: 0.85rem; font-weight: 600; letter-spacing: 0.02em;
  color: var(--muted); padding: 0.55rem 1rem; border: 0; background: none; cursor: pointer;
  white-space: nowrap; border-bottom: 2px solid transparent; margin-bottom: -2px;
}
.admin-tab[aria-selected="true"] { color: var(--ink-deep); border-bottom-color: var(--gold-bright); }
.admin-tab .n { display: inline-block; margin-left: 0.35rem; font-size: 0.7rem; background: var(--blue-faint); color: var(--slate-deep); border-radius: 999px; padding: 0.05rem 0.45rem; }

.admin-scope input[type="text"], .admin-scope input[type="search"], .admin-scope input[type="password"],
.admin-scope input[type="date"], .admin-scope input[type="datetime-local"], .admin-scope input[type="number"],
.admin-scope select, .admin-scope textarea {
  font-family: var(--ui); font-size: 0.88rem; color: var(--ink);
  border: 1px solid var(--blue-faint); border-radius: 6px; padding: 0.45rem 0.6rem; background: var(--panel);
}
.admin-scope input:focus, .admin-scope select:focus, .admin-scope textarea:focus { outline: 2px solid var(--blue-soft); outline-offset: 1px; }

.fld { display: flex; flex-direction: column; gap: 0.25rem; font-family: var(--ui); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate); }
.fld-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); gap: 0.8rem; }
.fld-label { font-family: var(--ui); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.05em; text-transform: uppercase; color: var(--slate); }

.btn-danger {
  font-family: var(--ui); font-size: 0.82rem; background: none; color: #7a2e25;
  border: 1px solid #e4c3bd; border-radius: 6px; padding: 0.42rem 0.9rem; cursor: pointer;
}
.btn-danger:hover { background: #f7e8e6; }
.chip { font-family: var(--ui); font-size: 0.78rem; font-weight: 600; letter-spacing: 0.15em; background: var(--blue-faint); color: var(--slate-deep); border-radius: 6px; padding: 0.3rem 0.6rem; }
.warnchip { font-family: var(--ui); font-size: 0.78rem; color: #7a2e25; background: #f7e8e6; border-radius: 6px; padding: 0.3rem 0.6rem; }
.meta-row { display: flex; gap: 0.5rem; align-items: center; flex-wrap: wrap; padding-top: 0.7rem; border-top: 1px dashed var(--blue-faint); margin-top: 0.9rem; }

.pillbox {
  position: relative; display: inline-flex; align-items: center; gap: 0.35rem;
  font-family: var(--ui); font-size: 0.83rem; color: var(--ink);
  border: 1px solid var(--blue-faint); border-radius: 999px; padding: 0.3rem 0.8rem; cursor: pointer;
}
.pillbox input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.pillbox.on { background: var(--blue-faint); border-color: var(--blue-soft); color: var(--ink-deep); font-weight: 600; }
.pillbox:focus-within { outline: 2px solid var(--blue-soft); outline-offset: 1px; }

.guest-row { display: flex; gap: 0.5rem; align-items: center; padding: 0.3rem 0; }
.guest-row input { flex: 1; max-width: 18rem; }

/* ---- Accessibility: honour reduced-motion (elderly / vestibular guests) ---- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}
