:root {
  --ink: #111318;
  --muted: #5d6675;
  --paper: #ffffff;
  --soft: #f4f5f7;
  --line: #dde1e7;
  --red: #b20f1d;
  --red-dark: #7f0712;
  --gold: #d7a84f;
  --navy: #1f2a44;
  --radius: 8px;
  color-scheme: light;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--ink);
  background: var(--soft);
  line-height: 1.55;
}
a { color: var(--red-dark); }
img { max-width: 100%; height: auto; display: block; }
.skip-link {
  position: absolute;
  left: -999px;
  top: 0;
  background: var(--paper);
  padding: .75rem;
}
.skip-link:focus { left: 1rem; z-index: 5; }
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(17, 19, 24, .96);
  color: #fff;
  border-bottom: 3px solid var(--red);
}
.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  max-width: 1180px;
  margin: 0 auto;
  padding: .8rem 1rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: .7rem;
  color: #fff;
  text-decoration: none;
  font-weight: 800;
}
.brand-mark {
  display: grid;
  place-items: center;
  width: 68px;
  height: 32px;
  border: 2px solid #fff;
  border-radius: 4px;
  background: linear-gradient(135deg, var(--red), #111);
  font-size: .8rem;
  letter-spacing: 0;
}
.nav-toggle {
  display: none;
  border: 1px solid rgba(255,255,255,.5);
  background: transparent;
  color: #fff;
  border-radius: 4px;
  padding: .45rem .65rem;
}
.nav-menu {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .25rem;
}
.nav-menu a {
  color: #fff;
  text-decoration: none;
  padding: .55rem .7rem;
  border-radius: 4px;
  font-size: .95rem;
}
.nav-menu a:hover,
.nav-menu a.active { background: rgba(255,255,255,.14); }

.hero {
  min-height: auto;
  display: block;
  color: #fff;
  background:
    linear-gradient(90deg, rgba(12,14,18,.92), rgba(12,14,18,.56), rgba(12,14,18,.2)),
    linear-gradient(135deg, #161b25, #9b101a 55%, #262b35);
}
.hero-inner {
  width: min(1180px, 100%);
  margin: 0 auto;
  padding: 2.25rem 1rem 2.5rem;
}
.hero h1 {
  max-width: 900px;
  margin: 0;
  font-size: clamp(2.3rem, 6vw, 5rem);
  line-height: .98;
  letter-spacing: 0;
}
.hero p {
  max-width: 710px;
  font-size: clamp(1rem, 2vw, 1.28rem);
  color: rgba(255,255,255,.88);
}
.hero-actions, .actions {
  display: flex;
  flex-wrap: wrap;
  gap: .75rem;
  margin-top: 1.2rem;
}
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  border: 1px solid var(--red);
  border-radius: 5px;
  background: var(--red);
  color: #fff;
  text-decoration: none;
  padding: .75rem 1rem;
  min-height: 44px;
  font-weight: 700;
}
.button.secondary {
  background: #fff;
  border-color: #fff;
  color: var(--ink);
}
.button.ghost {
  background: transparent;
  border-color: var(--line);
  color: var(--ink);
}
.button.small { padding: .48rem .7rem; min-height: 36px; font-size: .9rem; }

.section {
  padding: 3rem 1rem;
}
.section.alt { background: #fff; }
.container {
  width: min(1180px, 100%);
  margin: 0 auto;
}
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}
.section-title h2,
.page-title h1 {
  margin: 0;
  font-size: clamp(1.7rem, 4vw, 3rem);
  line-height: 1.05;
}
.kicker {
  color: var(--red-dark);
  font-weight: 800;
  text-transform: uppercase;
  font-size: .78rem;
  letter-spacing: .08em;
}
.grid {
  display: grid;
  gap: 1rem;
}
.grid.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid.four { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.card-body { padding: 1rem; }
.event-card {
  display: grid;
  grid-template-columns: minmax(100px, 140px) 1fr;
  gap: 1rem;
  padding: 1rem;
}
.date-block {
  border-left: 5px solid var(--red);
  background: var(--soft);
  padding: .75rem;
  border-radius: 6px;
  font-weight: 800;
}
.date-block span { display: block; color: var(--muted); font-size: .9rem; }
.badge {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  padding: .25rem .55rem;
  font-size: .8rem;
  font-weight: 700;
}
.badge.canceled {
  background: #ffe8e8;
  border-color: #ffc9c9;
  color: #8f0712;
}
.meta {
  color: var(--muted);
  font-size: .95rem;
}
.page-title {
  padding: 3rem 1rem 2rem;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.form-panel {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1rem;
}
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}
label { display: grid; gap: .35rem; font-weight: 700; }
.display-field {
  display: grid;
  gap: .35rem;
  align-content: start;
  font-weight: 700;
}
.display-field strong {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 5px;
  background: var(--soft);
  padding: .72rem .8rem;
  font-weight: 700;
}
input, select, textarea {
  width: 100%;
  border: 1px solid #cbd1da;
  border-radius: 5px;
  padding: .72rem .8rem;
  font: inherit;
  background: #fff;
}
textarea { min-height: 120px; resize: vertical; }
.hidden-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.notice {
  border-left: 5px solid var(--gold);
  background: #fff8e8;
  padding: 1rem;
  border-radius: 6px;
}
.success {
  border-left-color: #1f7a3a;
  background: #eefaf1;
}
.error {
  border-left-color: var(--red);
  background: #fff0f0;
}
.rsvp-list {
  list-style: none;
  padding: 0;
  display: grid;
  gap: .45rem;
}
.rsvp-list li {
  display: flex;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  padding: .35rem 0;
}
.gallery-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: linear-gradient(135deg, #222, #aaa);
}
.image-placeholder {
  display: grid;
  place-items: center;
  min-height: 220px;
  aspect-ratio: 4 / 3;
  background: linear-gradient(135deg, #14171f, #b20f1d);
  color: #fff;
  padding: 1rem;
  text-align: center;
  font-weight: 800;
}
.generation-link {
  display: grid;
  place-items: center;
  min-height: 115px;
  border-radius: 8px;
  background: linear-gradient(135deg, #111, #202838);
  color: #fff;
  text-decoration: none;
  border-bottom: 5px solid var(--red);
}
.generation-link strong { font-size: 2.1rem; }
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  background: #fff;
}
th, td {
  text-align: left;
  border-bottom: 1px solid var(--line);
  padding: .7rem;
  vertical-align: top;
}
th { background: #f0f2f5; }
.sort-link {
  display: inline-flex;
  align-items: center;
  gap: .25rem;
  color: var(--ink);
  text-decoration: none;
}
.sort-link:hover { color: var(--red-dark); }
.sort-triangle {
  color: var(--red-dark);
  font-size: .72rem;
  line-height: 1;
}
.sort-triangle.muted { color: #9aa3b1; }
.inline-form {
  display: inline;
  margin: 0;
}
.link-button {
  border: 0;
  background: transparent;
  color: var(--red-dark);
  cursor: pointer;
  font: inherit;
  padding: 0;
  text-decoration: underline;
}
.link-button.danger { color: #8f0712; }
.com-preview {
  display: grid;
  gap: .35rem;
  max-width: 520px;
  margin: 1rem 0;
}
.com-preview-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--soft);
}
.upload-grid {
  align-items: start;
  margin-bottom: 1rem;
}
.com-picker {
  display: grid;
  gap: 1rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  margin: 1rem 0;
  padding: 1rem;
}
.com-picker legend {
  padding: 0 .35rem;
  font-weight: 800;
}
.com-picker-group {
  display: grid;
  gap: .65rem;
}
.com-picker-group h2 {
  margin: 0;
  font-size: 1rem;
}
.com-image-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: .75rem;
}
.com-image-choice {
  display: grid;
  grid-template-rows: auto auto auto;
  gap: .35rem;
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: .55rem;
  background: #fff;
  cursor: pointer;
}
.com-image-choice:has(input:checked) {
  border-color: var(--red);
  box-shadow: 0 0 0 2px rgba(178, 15, 29, .14);
}
.com-image-choice input {
  width: auto;
  justify-self: start;
}
.com-choice-image {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  border-radius: 4px;
  background: var(--soft);
}
.com-image-choice span,
.com-image-choice small {
  overflow-wrap: anywhere;
}
.com-image-choice small {
  color: var(--muted);
  font-weight: 400;
}
.admin-shell {
  display: grid;
  grid-template-columns: 220px 1fr;
  min-height: 100vh;
}
.admin-nav {
  background: #111318;
  color: #fff;
  padding: 1rem;
}
.admin-nav a { display: block; color: #fff; padding: .5rem 0; }
.admin-main { padding: 1rem; }
.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 1rem;
  padding: 2rem 1rem;
  background: #111318;
  color: #fff;
}
.site-footer > * { width: min(560px, 100%); }
.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: .8rem;
}
.footer-links a { color: #fff; }

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-menu {
    display: none;
    width: 100%;
    flex-direction: column;
  }
  .nav-menu.open { display: flex; }
  .topbar { flex-wrap: wrap; }
  .grid.two, .grid.three, .grid.four, .form-grid { grid-template-columns: 1fr; }
  .event-card { grid-template-columns: 1fr; }
  .section-title, .site-footer { flex-direction: column; align-items: flex-start; }
  .footer-links { justify-content: flex-start; }
  .admin-shell { grid-template-columns: 1fr; }
}
