/*
  Baby Pritchett styles.
  To restyle the whole site, change the colors and fonts in the :root blocks below.
  The first block is light mode, the second is dark mode.
*/

:root {
  --bg: #f6f1e7;          /* oat background */
  --surface: #fffaf2;     /* cards */
  --ink: #3b352e;         /* main text */
  --muted: #6e6458;       /* secondary text */
  --line: #e4dccd;        /* borders */
  --accent: #5f7155;      /* sage */
  --accent-ink: #fffaf2;  /* text on accent buttons */
  --accent-soft: #e6eadf;
  --wash: rgba(185, 132, 102, 0.14); /* soft clay glow behind the hero */
  --clay: #935f42;        /* warm secondary accent (clay) */
  --danger: #a5523f;
  --radius: 18px;
  --shadow: 0 1px 2px rgba(59, 53, 46, 0.06), 0 8px 24px rgba(59, 53, 46, 0.06);
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1f1c19;
    --surface: #2a2622;
    --ink: #eee6d8;
    --muted: #b0a596;
    --line: #3d3731;
    --accent: #9fb293;
    --accent-ink: #1f1c19;
    --accent-soft: #333a2f;
    --wash: rgba(211, 159, 128, 0.08);
    --clay: #d39f80;
    --danger: #e08a74;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 8px 24px rgba(0, 0, 0, 0.25);
    color-scheme: dark;
  }
}

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

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3 {
  font-family: var(--font-head);
  font-weight: 500;
  line-height: 1.15;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2.6rem, 11vw, 4.5rem); }
h2 { font-size: 1.6rem; }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
a { color: var(--accent); text-underline-offset: 3px; }
img { max-width: 100%; display: block; }

.wrap { width: 100%; max-width: 640px; margin: 0 auto; padding: 0 20px; }
.wrap.wide { max-width: 980px; }
main { flex: 1; padding: 24px 0 56px; }

/* Header and nav */
.site-header { padding: 18px 0 6px; }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.brand { font-family: var(--font-head); font-size: 1.25rem; color: var(--ink); text-decoration: none; }
.nav { display: flex; gap: 4px; flex-wrap: wrap; }
.nav a {
  color: var(--muted); text-decoration: none; padding: 0 14px; border-radius: 999px; font-size: 0.95rem;
  min-height: 44px; display: inline-flex; align-items: center;
}
.nav a:hover { color: var(--ink); background: var(--accent-soft); }
.nav a[aria-current="page"] { color: var(--ink); background: var(--accent-soft); }

.site-footer { color: var(--muted); font-size: 0.85rem; text-align: center; padding: 24px 0 32px; }

/* Hero */
.hero { text-align: center; padding: 28px 0 8px; position: relative; }
/* Soft warm wash behind the page top */
body::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 520px; pointer-events: none; z-index: -1;
  background: radial-gradient(ellipse 70% 60% at 50% 0%, var(--wash), transparent 70%);
}
.sprig { display: block; margin: 0 auto 12px; width: 64px; height: 40px; color: var(--accent); }
.sprig .berry { fill: var(--clay); }

/* Home page: the big title already says the name, so on phones the header shows just the nav */
@media (max-width: 560px) {
  .page-home .site-header .brand { display: none; }
  .page-home .site-header .wrap { justify-content: center; }
}
.eyebrow {
  text-transform: uppercase; letter-spacing: 0.18em; font-size: 0.78rem; color: var(--clay); margin-bottom: 10px;
}
.hero .sub { font-family: var(--font-head); font-style: italic; font-size: 1.35rem; color: var(--muted); }
.hero-photo { margin: 24px auto 0; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); max-width: 480px; }
.hero-photo img { width: 100%; height: auto; }

.countdown {
  display: inline-flex; flex-direction: column; align-items: center;
  margin: 24px auto 4px; padding: 18px 32px; border-radius: var(--radius);
  background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow);
}
.countdown .num { font-family: var(--font-head); font-size: 3rem; line-height: 1; }
.countdown .label { color: var(--muted); font-size: 0.9rem; margin-top: 6px; }

/* Cards */
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 22px; box-shadow: var(--shadow); margin: 18px 0;
}
.card.center { text-align: center; }
.card > :last-child, form > :last-child, .card > div > :last-child { margin-bottom: 0; }
.cards { display: grid; gap: 14px; }
.link-cards { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; margin-top: 18px; }
.link-card {
  display: block; text-decoration: none; color: var(--ink); background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
}
.link-card:hover { border-color: var(--accent); }
.link-card { position: relative; padding-right: 48px; }
.link-card strong { font-family: var(--font-head); font-weight: 500; font-size: 1.2rem; display: block; }
.link-card .arrow {
  position: absolute; right: 16px; top: 50%; transform: translateY(-50%);
  width: 28px; height: 28px; border-radius: 999px; background: var(--accent-soft); color: var(--accent);
  display: flex; align-items: center; justify-content: center; font-size: 1rem; line-height: 1;
}
.link-card:hover .arrow { background: var(--accent); color: var(--accent-ink); }
.link-card span { color: var(--muted); font-size: 0.9rem; }

.muted { color: var(--muted); }
.small { font-size: 0.88rem; }
.soon { color: var(--muted); font-style: italic; }
.pre { white-space: pre-line; }
.hidden { display: none !important; }

/* Detail list (shower) */
.details { display: grid; gap: 14px; margin: 0; }
.details div { display: grid; gap: 2px; }
.details dt { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.72rem; color: var(--clay); }
.details dd { margin: 0; }

/* Buttons and forms */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 500; font-size: 1rem; cursor: pointer;
  background: var(--accent); color: var(--accent-ink); border: 1px solid var(--accent);
  padding: 12px 22px; border-radius: 999px; text-decoration: none; min-height: 48px;
}
.btn:hover { filter: brightness(1.05); }
.btn:disabled { opacity: 0.6; cursor: default; }
.btn.block { width: 100%; }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.small { padding: 6px 14px; min-height: 44px; font-size: 0.88rem; }
.btn.danger { background: transparent; color: var(--danger); border-color: var(--line); }

label { display: block; font-size: 0.92rem; font-weight: 500; margin: 14px 0 6px; }
.hint { font-weight: 400; color: var(--muted); font-size: 0.85rem; }
input, textarea, select {
  width: 100%; font: inherit; font-size: 16px; color: var(--ink);
  background: var(--bg); border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px;
}
input:focus, textarea:focus, select:focus, .btn:focus-visible, a:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 2px;
}
textarea { min-height: 96px; resize: vertical; }
.row { display: grid; gap: 12px; grid-template-columns: 1fr 1fr; }
.choice { display: flex; gap: 10px; }
.choice label {
  flex: 1; margin: 0; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--line); border-radius: 12px; padding: 12px; cursor: pointer; background: var(--bg);
}
.choice input { width: auto; accent-color: var(--accent); }
.choice label:has(input:checked) { border-color: var(--accent); background: var(--accent-soft); }

.msg { margin-top: 12px; font-size: 0.95rem; }
.msg:empty { display: none; }
.msg.error { color: var(--danger); }
.msg.ok { color: var(--accent); }

/* Admin */
.admin-section h2 { margin-bottom: 4px; }
.fund-row { border: 1px solid var(--line); border-radius: 14px; padding: 14px; margin: 12px 0; background: var(--bg); }
.fund-row .tools { display: flex; gap: 6px; justify-content: flex-end; flex-wrap: wrap; margin-top: 10px; }
.stats { display: grid; gap: 10px; grid-template-columns: repeat(3, 1fr); margin: 12px 0; }
.stat { background: var(--bg); border: 1px solid var(--line); border-radius: 14px; padding: 12px; text-align: center; }
.stat b { display: block; font-family: var(--font-head); font-size: 1.8rem; font-weight: 500; }
.stat span { color: var(--muted); font-size: 0.8rem; }
.table-wrap { overflow-x: auto; }
table { width: 100%; min-width: 760px; border-collapse: collapse; font-size: 0.92rem; }
th, td { text-align: left; padding: 10px 8px; border-bottom: 1px solid var(--line); vertical-align: top; }
td { overflow-wrap: anywhere; }
.col-email { max-width: 220px; }
.col-message { min-width: 200px; }
.col-actions { white-space: nowrap; overflow-wrap: normal; }
th { color: var(--muted); font-weight: 500; font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; }
.savebar {
  position: sticky; bottom: 0; background: var(--bg); padding: 12px 0; border-top: 1px solid var(--line);
  display: flex; gap: 12px; align-items: center; flex-wrap: wrap;
}

@media (max-width: 420px) {
  .row { grid-template-columns: 1fr; }
  .link-cards { grid-template-columns: 1fr; }
  .stats { grid-template-columns: 1fr 1fr 1fr; }
  .card { padding: 18px; }
}

/* Small spacing helpers (used instead of inline styles, which the security policy blocks) */
.mt { margin-top: 16px; }
.mt-sm { margin-top: 8px; }
.mt-lg { margin-top: 28px; }
.flush { margin: 0; }
.narrow { max-width: 420px; margin: 40px auto; }
.savebar .msg { margin: 0; }

/* Shower details */
.details .when-time { color: var(--muted); }
.detail-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; }
.detail-actions .btn { flex: 1 1 160px; min-height: 44px; }
.map-link { margin-top: 10px; min-height: 44px; }

fieldset { border: 0; padding: 0; margin: 14px 0 0; min-width: 0; }
legend { font-size: 0.92rem; font-weight: 500; padding: 0; margin-bottom: 6px; }
/* Keep the Delete button in view while the RSVP table scrolls sideways on phones */
.col-actions { position: sticky; right: 0; background: var(--surface); box-shadow: -8px 0 8px -8px rgba(0, 0, 0, 0.15); }
