/* Joni's Great Summer Gathering — shared styles */

:root {
  --red: #b0121a;
  --red-dark: #7d0c12;
  --red-soft: #d94a4a;
  --cream: #fdf6e3;
  --cream-deep: #f6e8c8;
  --gold: #f2b705;
  --green: #2f7d3a;
  --green-deep: #1f5c29;
  --sky: #8fd0ea;
  --ink: #2c1f14;
  --ink-soft: #6b5844;
  --line: rgba(176, 18, 26, 0.18);
  --shadow: 0 10px 30px rgba(60, 30, 10, 0.13);
  --radius: 18px;
  --serif: "Bitter", Georgia, "Times New Roman", serif;
  --sans: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background-color: var(--cream);
  background-image:
    repeating-linear-gradient(0deg, rgba(176,18,26,.055) 0 26px, transparent 26px 52px),
    repeating-linear-gradient(90deg, rgba(176,18,26,.055) 0 26px, transparent 26px 52px);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

a { color: var(--red); }

.wrap { width: min(1060px, 92vw); margin: 0 auto; }
.narrow { width: min(760px, 92vw); margin: 0 auto; }

/* ---------------------------------------------------------- top bar */

.topbar {
  background: var(--red);
  color: var(--cream);
  border-bottom: 5px solid var(--gold);
}
.topbar .wrap {
  display: flex; align-items: center; gap: 14px;
  padding: 10px 0; flex-wrap: wrap;
}
.topbar img { width: 44px; height: 44px; border-radius: 50%; background: var(--cream); }
.topbar .brand { font-family: var(--serif); font-weight: 700; letter-spacing: .3px; margin-right: auto; }
.topbar .brand small { display: block; font-family: var(--sans); font-weight: 600; font-size: .72rem; opacity: .8; letter-spacing: .12em; text-transform: uppercase; }
.topbar nav { display: flex; gap: 6px; flex-wrap: wrap; }
.topbar nav a {
  color: var(--cream); text-decoration: none; font-weight: 700; font-size: .92rem;
  padding: 7px 14px; border-radius: 999px; border: 2px solid transparent;
}
.topbar nav a:hover { background: rgba(255,255,255,.14); }
.topbar nav a[aria-current="page"] { background: var(--cream); color: var(--red); }

/* ---------------------------------------------------------- hero */

.hero {
  position: relative;
  padding: 46px 0 40px;
  text-align: center;
  background:
    radial-gradient(circle at 50% -10%, rgba(143,208,234,.55), transparent 62%),
    linear-gradient(180deg, rgba(255,255,255,.75), rgba(255,255,255,0));
  overflow: hidden;
}
.hero-logo {
  width: min(330px, 72vw); margin: 0 auto 18px;
  filter: drop-shadow(0 12px 24px rgba(60,30,10,.28));
  animation: rise .7s ease-out both;
}
@keyframes rise { from { opacity: 0; transform: translateY(14px) scale(.97); } }

.kicker {
  font-family: var(--sans); font-weight: 800; text-transform: uppercase;
  letter-spacing: .22em; font-size: .74rem; color: var(--green-deep);
}
.hero h1 {
  font-family: var(--serif); font-weight: 800;
  font-size: clamp(2.1rem, 6vw, 3.5rem); line-height: 1.06;
  margin: .18em 0 .12em; color: var(--red-dark);
  text-wrap: balance;
}
.hero .tagline {
  font-size: clamp(1.02rem, 2.3vw, 1.22rem); color: var(--ink-soft);
  max-width: 34ch; margin: 0 auto; font-weight: 600;
}

.gingham {
  height: 26px;
  background-color: #fff;
  background-image:
    linear-gradient(90deg, rgba(176,18,26,.55) 50%, transparent 50%),
    linear-gradient(180deg, rgba(176,18,26,.55) 50%, transparent 50%);
  background-size: 26px 26px;
  border-top: 3px solid var(--red);
  border-bottom: 3px solid var(--red);
}

/* ---------------------------------------------------------- buttons */

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--sans); font-weight: 800; font-size: 1.02rem;
  padding: 15px 30px; border-radius: 999px; border: 3px solid var(--red-dark);
  background: var(--red); color: var(--cream); text-decoration: none;
  cursor: pointer; box-shadow: 0 5px 0 var(--red-dark), var(--shadow);
  transition: transform .12s ease, box-shadow .12s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 7px 0 var(--red-dark), var(--shadow); }
.btn:active { transform: translateY(3px); box-shadow: 0 2px 0 var(--red-dark); }
.btn.green { background: var(--green); border-color: var(--green-deep); box-shadow: 0 5px 0 var(--green-deep), var(--shadow); }
.btn.green:hover { box-shadow: 0 7px 0 var(--green-deep), var(--shadow); }
.btn.green:active { box-shadow: 0 2px 0 var(--green-deep); }
.btn.tan {
  background: var(--cream); color: var(--red-dark);
  border-color: var(--red-dark); box-shadow: 0 5px 0 var(--red-dark), var(--shadow);
}
.btn.tan:hover { box-shadow: 0 7px 0 var(--red-dark), var(--shadow); }
.btn.tan:active { box-shadow: 0 2px 0 var(--red-dark); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }

.btn-sm {
  font: inherit; font-weight: 700; font-size: .85rem;
  padding: 7px 15px; border-radius: 999px; cursor: pointer;
  border: 2px solid var(--red); background: transparent; color: var(--red);
  transition: background .15s ease, color .15s ease;
}
.btn-sm:hover { background: var(--red); color: var(--cream); }
.btn-sm.solid { background: var(--green); border-color: var(--green-deep); color: #fff; }
.btn-sm.solid:hover { background: var(--green-deep); }
.btn-sm.ghost { border-color: var(--ink-soft); color: var(--ink-soft); }
.btn-sm.ghost:hover { background: var(--ink-soft); color: var(--cream); }

.cta-row { display: flex; gap: 16px; justify-content: center; flex-wrap: wrap; margin: 26px 0 6px; }

/* ---------------------------------------------------------- cards */

.card {
  background: #fffdf6; border: 2px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow);
  padding: 26px 28px; margin: 22px 0;
}
.card h2, .card h3 { font-family: var(--serif); color: var(--red-dark); margin-top: 0; }

section { padding: 34px 0; }
h2.section-title {
  font-family: var(--serif); color: var(--red-dark); text-align: center;
  font-size: clamp(1.5rem, 3.4vw, 2rem); margin: 0 0 6px;
}
.section-sub { text-align: center; color: var(--ink-soft); margin: 0 0 22px; font-weight: 600; }

/* details grid on the home page */
.details {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
}
.detail {
  background: #fffdf6; border: 2px dashed var(--line);
  border-radius: var(--radius); padding: 20px; text-align: center;
  display: flex; flex-direction: column;
}
.detail .icon { font-size: 1.9rem; line-height: 1; }
.detail .label {
  text-transform: uppercase; letter-spacing: .16em; font-size: .7rem;
  font-weight: 800; color: var(--green-deep); margin: 9px 0 3px;
}
.detail .value { font-family: var(--serif); font-weight: 700; font-size: 1.16rem; color: var(--red-dark); }
.detail .sub { font-size: .88rem; color: var(--ink-soft); }
.detail .map-link {
  display: block; margin-top: auto; padding-top: 13px;
  font-size: .8rem; font-weight: 800; text-decoration: none; line-height: 1.35;
  color: var(--cream);
}
.detail .map-link span {
  display: block; background: var(--green);
  border: 2px solid var(--green-deep); border-radius: 999px;
  padding: 8px 12px; transition: background .15s ease, transform .12s ease;
}
.detail .map-link:hover span { background: var(--green-deep); transform: translateY(-1px); }

/* the "bring what you like" note, styled like the handwritten card */
.note-card {
  background: #fffdf6;
  border-left: 8px solid var(--gold);
  border-radius: 4px var(--radius) var(--radius) 4px;
  padding: 22px 26px; box-shadow: var(--shadow);
}
.note-card p { margin: .4em 0; }
.signoff { font-family: var(--serif); font-size: 1.35rem; color: var(--red-dark); font-weight: 700; }
.note-card .ps {
  margin-top: 16px; padding-top: 14px; border-top: 2px dashed var(--line);
  font-size: .95rem; color: var(--ink-soft);
}
.note-card .ps strong { color: var(--red-dark); }

.fun-strip {
  display: grid; gap: 14px; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  text-align: center;
}
.fun {
  background: var(--green); color: #fff; border-radius: var(--radius);
  padding: 20px 16px; box-shadow: var(--shadow);
}
.fun .icon { font-size: 2rem; }
.fun strong { display: block; font-family: var(--serif); font-size: 1.12rem; margin-top: 6px; }
.fun span { font-size: .88rem; opacity: .9; }

/* ---------------------------------------------------------- forms */

label { display: block; font-weight: 800; font-size: .84rem; text-transform: uppercase; letter-spacing: .1em; color: var(--green-deep); margin-bottom: 5px; }
input[type="text"], input[type="number"], textarea, select {
  width: 100%; font: inherit; color: var(--ink);
  padding: 11px 14px; border: 2px solid var(--line); border-radius: 12px;
  background: #fff; transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
  outline: none; border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(176,18,26,.13);
}
textarea { min-height: 84px; resize: vertical; }
.field { margin-bottom: 16px; }
.row2 { display: grid; gap: 16px; grid-template-columns: 1fr 1fr; }
.hint { font-size: .84rem; color: var(--ink-soft); font-weight: 600; margin-top: 5px; }

/* ---------------------------------------------------------- sign-up list */

.progress-wrap { margin: 0 0 26px; }
.progress {
  height: 16px; background: var(--cream-deep); border-radius: 999px;
  overflow: hidden; border: 2px solid var(--line);
}
.progress > div {
  height: 100%; width: 0;
  background: repeating-linear-gradient(45deg, var(--green) 0 10px, var(--green-deep) 10px 20px);
  transition: width .5s ease;
}
.progress-label { text-align: center; font-weight: 700; color: var(--green-deep); margin-top: 8px; }

.cat { margin-bottom: 26px; }
.cat > h3 {
  font-family: var(--serif); color: var(--red-dark); font-size: 1.28rem;
  margin: 0 0 12px; padding-bottom: 8px; border-bottom: 3px solid var(--gold);
  display: flex; align-items: baseline; gap: 10px;
}
.cat > h3 .count { margin-left: auto; font-family: var(--sans); font-size: .78rem; font-weight: 800; color: var(--ink-soft); letter-spacing: .08em; text-transform: uppercase; }

.slot {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: #fffdf6; border: 2px solid var(--line); border-radius: 14px;
  padding: 13px 17px; margin-bottom: 9px;
  transition: border-color .15s ease, background .15s ease;
}
.slot:hover { border-color: rgba(176,18,26,.4); }
.slot.taken { background: #f4faf3; border-color: rgba(47,125,58,.35); }
.slot.mine { background: #fffbe8; border-color: var(--gold); box-shadow: inset 0 0 0 2px rgba(242,183,5,.35); }

.slot .what { font-weight: 800; font-size: 1.03rem; min-width: 190px; flex: 1 1 190px; }
.slot .what .spot {
  display: block; font-weight: 700; font-size: .74rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-soft);
}
.slot .who { flex: 1 1 190px; color: var(--green-deep); font-weight: 700; }
.slot .who .none { color: var(--ink-soft); font-weight: 600; font-style: italic; }
.slot .who .note { display: block; font-weight: 600; font-size: .86rem; color: var(--ink-soft); font-style: italic; }
.slot .actions { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  font-size: .68rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase;
  padding: 3px 9px; border-radius: 999px; background: var(--gold); color: var(--ink);
}

/* ---------------------------------------------------------- rsvp list */

.guest-list { display: grid; gap: 10px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.guest {
  background: #fffdf6; border: 2px solid var(--line); border-radius: 14px; padding: 13px 16px;
}
.guest.mine { background: #fffbe8; border-color: var(--gold); }
.guest strong { display: block; font-family: var(--serif); color: var(--red-dark); font-size: 1.06rem; }
.guest .meta { font-size: .87rem; color: var(--ink-soft); font-weight: 600; }
.guest .msg { font-size: .9rem; font-style: italic; margin-top: 5px; }
.guest .with { font-size: .9rem; margin-top: 4px; color: var(--green-deep); font-weight: 700; }
.guest .with .plus {
  display: inline-block; font-size: .74rem; font-weight: 800; letter-spacing: .05em;
  background: var(--cream-deep); color: var(--ink-soft);
  padding: 2px 8px; border-radius: 999px;
}

/* guest counter on the RSVP form */
.counter { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.counter input {
  width: 84px; text-align: center; font-size: 1.25rem; font-weight: 800;
  font-family: var(--serif);
}
.counter-btn {
  width: 44px; height: 44px; flex: 0 0 44px; border-radius: 50%;
  border: 2px solid var(--red); background: #fff; color: var(--red);
  font-size: 1.5rem; font-weight: 800; line-height: 1; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  transition: background .15s ease, color .15s ease;
}
.counter-btn:hover { background: var(--red); color: var(--cream); }
.counter-total { font-weight: 800; color: var(--green-deep); font-size: .95rem; }

.guest-field {
  background: #fffbe8; border: 2px dashed var(--gold);
  border-radius: 12px; padding: 12px 14px; margin-bottom: 10px;
  animation: slidein .22s ease-out both;
}
.guest-field label { color: var(--red-dark); margin-bottom: 4px; }
@keyframes slidein { from { opacity: 0; transform: translateY(-5px); } }

.stats { display: flex; gap: 18px; justify-content: center; flex-wrap: wrap; margin-bottom: 22px; }
.stat {
  background: var(--red); color: var(--cream); border-radius: 14px;
  padding: 14px 26px; text-align: center; min-width: 120px; box-shadow: var(--shadow);
}
.stat b { display: block; font-family: var(--serif); font-size: 1.9rem; line-height: 1; }
.stat span { font-size: .72rem; text-transform: uppercase; letter-spacing: .14em; font-weight: 800; opacity: .9; }

/* ---------------------------------------------------------- misc */

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translate(-50%, 130%);
  background: var(--ink); color: var(--cream); padding: 13px 24px; border-radius: 999px;
  font-weight: 700; box-shadow: var(--shadow); z-index: 90; max-width: 88vw; text-align: center;
  transition: transform .3s cubic-bezier(.2,.9,.3,1.2);
}
.toast.show { transform: translate(-50%, 0); }
.toast.bad { background: var(--red-dark); }

.modal-back {
  position: fixed; inset: 0; background: rgba(44,31,20,.55);
  display: none; align-items: center; justify-content: center; padding: 18px; z-index: 100;
}
.modal-back.open { display: flex; }
.modal {
  background: var(--cream); border-radius: var(--radius); border: 3px solid var(--red);
  padding: 26px; width: min(460px, 100%); box-shadow: 0 24px 60px rgba(0,0,0,.35);
  max-height: 90vh; overflow: auto;
}
.modal h3 { font-family: var(--serif); color: var(--red-dark); margin: 0 0 4px; }
.modal .sub { color: var(--ink-soft); font-weight: 600; margin: 0 0 18px; font-size: .93rem; }
.modal .modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; flex-wrap: wrap; }

.loading { text-align: center; color: var(--ink-soft); font-weight: 700; padding: 34px 0; }

footer {
  background: var(--red); color: var(--cream); text-align: center;
  padding: 28px 0; margin-top: 40px; border-top: 5px solid var(--gold);
}
footer .signature { font-family: var(--serif); font-size: 1.25rem; }
footer small { opacity: .82; }
footer a { color: var(--gold); }

@media (max-width: 560px) {
  .topbar .wrap { gap: 10px; padding: 8px 0; }
  .topbar img { width: 36px; height: 36px; }
  .topbar .brand { font-size: .95rem; line-height: 1.25; flex: 1 1 auto; }
  .topbar .brand small { font-size: .62rem; }
  .topbar nav { width: 100%; justify-content: space-between; }
  .topbar nav a { font-size: .86rem; padding: 6px 12px; }
  .hero { padding: 26px 0 24px; }
  .row2 { grid-template-columns: 1fr; }
  .slot { align-items: flex-start; }
  .slot .actions { width: 100%; }
  .card { padding: 20px 18px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}
