:root {
  --bg: #f8f2e3;
  --text: #423a0d;
  --accent: #686e61;
  --light: #f0eadb;
  --card: #fffaf0;
  --heading-font: "Great Vibes", cursive;
  --body-font: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 3.5rem; } /* anchors don't hide under the sticky bar */

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--body-font);
  font-size: 1.0625rem;
  line-height: 1.65;
}

a { color: inherit; }

h1, h2, h3 { font-family: var(--heading-font); font-weight: 400; line-height: 1.15; margin: 0; }

/* Top bar: stays at the top of the screen while scrolling */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: var(--accent); color: var(--light);
  box-shadow: 0 1px 6px rgba(66, 58, 13, .25);
}
.topbar-inner {
  display: flex; gap: 1.5rem; justify-content: flex-end;
  max-width: 64rem; margin: 0 auto; padding: .9rem 1.25rem;
}
.topbar a { text-decoration: none; opacity: .9; }
.topbar a:hover, .topbar a:focus-visible { text-decoration: underline; opacity: 1; }

/* Hero */
.hero { background: var(--accent); color: var(--light); padding: 1.5rem 1.25rem 3.5rem; }

.hero-inner {
  max-width: 64rem; margin: 0 auto;
  display: grid; gap: 2rem; align-items: center;
  grid-template-columns: minmax(0, 20rem) 1fr;
}
.hero-photo { width: 100%; height: auto; aspect-ratio: 1 / 1; object-fit: cover; border-radius: 1.25rem; }
.hero h1 { font-size: clamp(3.5rem, 9vw, 6.5rem); }
.tagline { margin: 1rem 0 0; font-size: 1.2rem; max-width: 28rem; }

/* Sections */
.section { max-width: 64rem; margin: 0 auto; padding: 4rem 1.25rem 1rem; }
.section h2 { font-size: 2.6rem; margin-bottom: 1.5rem; }

.about { display: grid; gap: 2.5rem; grid-template-columns: minmax(0, 18rem) 1fr; align-items: start; }
.about-photo { width: 100%; height: auto; border-radius: 1.25rem; }
.about-text p { margin: 0 0 1.1rem; max-width: 42rem; }

/* Events */
.events-lead { margin: -.75rem 0 1.5rem; opacity: .85; }
.events { list-style: none; margin: 0; padding: 0; display: grid; gap: 1.25rem; }
.event { background: var(--card); border: 1px solid rgba(66, 58, 13, .15); border-radius: 1rem; padding: 1.5rem; }
.event h3 { font-size: 2rem; margin: .25rem 0 .75rem; }
.event p { margin: 0 0 .6rem; max-width: 42rem; }
.event-date { font-weight: 600; color: var(--accent); }
.event span { font-weight: 600; }
.no-events { opacity: .85; }

.button {
  display: inline-block; margin-top: .5rem; padding: .7rem 1.4rem;
  background: var(--text); color: var(--bg); text-decoration: none; border-radius: 999px; font-weight: 600;
}
.button:hover, .button:focus-visible { background: var(--accent); }

/* Sign-up form */
/* Compact enough to fit a laptop screen: two columns, tight spacing. */
.section.signup { max-width: 44rem; padding-top: 1.5rem; }
.page-title { font-size: clamp(1.9rem, 5vw, 2.4rem); margin-bottom: .75rem; }
.signup-event { margin-bottom: 1rem; padding: .9rem 1.25rem; }
.signup-event .event-date { font-size: .95rem; }
.event-title { font-size: 1.6rem; margin: .1rem 0 .3rem; }
.event-meta { margin: 0; font-size: .95rem; }
.event-meta span { font-weight: 600; }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem 1.25rem; }
.field { border: 0; padding: 0; margin: 0; min-width: 0; }
.field label, .field legend { display: block; font-weight: 600; font-size: .95rem; margin-bottom: .25rem; padding: 0; }
.field input[type="text"], .field input[type="email"], .field input[type="number"] {
  width: 100%; padding: .55rem .8rem; font: inherit; color: var(--text);
  background: var(--card); border: 1px solid rgba(66, 58, 13, .35); border-radius: .6rem;
}
.field input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.choices { display: flex; gap: 1.25rem; padding-top: .45rem; }
.choice { display: flex; align-items: center; gap: .45rem; font-weight: 400 !important; margin: 0 !important; }
.choice input { width: 1.05rem; height: 1.05rem; accent-color: var(--text); }
.has-error input[type="text"], .has-error input[type="email"], .has-error input[type="number"] { border-color: #9b2c1f; }
.field-error { color: #9b2c1f; margin: .25rem 0 0; font-size: .9rem; }
.form-alert { background: #f6e1dc; color: #6f1d12; border-radius: .6rem; padding: .55rem .9rem; margin: 0 0 .75rem; font-size: .95rem; }
.form-actions { grid-column: 1 / -1; display: flex; align-items: center; gap: 1.25rem; margin-top: .25rem; }
.form-actions .button { margin: 0; border: 0; font: inherit; font-weight: 600; cursor: pointer; white-space: nowrap; }
.privacy { margin: 0; font-size: .85rem; opacity: .75; line-height: 1.4; }
.hp { position: absolute; left: -10000px; width: 1px; height: 1px; overflow: hidden; }

/* Management pages */
.form.single { grid-template-columns: 1fr; max-width: 22rem; }
.field.wide { grid-column: 1 / -1; }
.field textarea {
  width: 100%; padding: .55rem .8rem; font: inherit; color: var(--text); resize: vertical;
  background: var(--card); border: 1px solid rgba(66, 58, 13, .35); border-radius: .6rem;
}
.field textarea:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.field input[type="datetime-local"], .field input[type="password"] {
  width: 100%; padding: .55rem .8rem; font: inherit; color: var(--text);
  background: var(--card); border: 1px solid rgba(66, 58, 13, .35); border-radius: .6rem;
}
.has-error textarea, .has-error input[type="datetime-local"] { border-color: #9b2c1f; }
.cancel-link { font-weight: 600; }
.form-ok { background: #e3eed8; color: #2f4a1b; border-radius: .6rem; padding: .55rem .9rem; margin: 0 0 1rem; font-size: .95rem; }
.section.manage { max-width: 64rem; padding-top: 1.5rem; }
.manage-subtitle { font-size: 2rem; margin: 1.5rem 0 .75rem; }
.table-wrap { overflow-x: auto; }
.events-table { border-collapse: collapse; width: 100%; background: var(--card); border-radius: .6rem; overflow: hidden; }
.events-table th, .events-table td { text-align: left; padding: .6rem .8rem; border-bottom: 1px solid rgba(66, 58, 13, .12); vertical-align: top; }
.events-table th { background: rgba(66, 58, 13, .07); font-size: .9rem; }
.event-line { margin: -.25rem 0 1rem; }
.totals { margin: 0 0 .75rem; }
.check-col { width: 2.5rem; text-align: center !important; }
.check-col input { width: 1.1rem; height: 1.1rem; accent-color: var(--text); cursor: pointer; }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
/* Add, change and delete sit side by side on one line (and wrap on a narrow screen). */
.toolbar { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; margin: 0 0 1rem; }
.toolbar .button { margin: 0; border: 0; font: inherit; font-weight: 600; line-height: 1.4; cursor: pointer; }
.button.danger { background: #9b2c1f; }
.button.danger:hover, .button.danger:focus-visible { background: #7a2118; }
.confirm-form { display: flex; align-items: center; gap: 1.25rem; margin-top: 1rem; }
.confirm-form .button { margin: 0; }
.inline-form { display: inline; margin: 0; }
.link-button { background: none; border: 0; padding: 0; font: inherit; color: inherit; opacity: .9; cursor: pointer; text-decoration: none; }
.link-button:hover, .link-button:focus-visible { text-decoration: underline; opacity: 1; }

/* Footer */
.footer { margin-top: 4rem; background: var(--text); color: var(--bg); padding: 3rem 1.25rem 2rem; text-align: center; }
.footer h3 { font-size: 2.2rem; margin-bottom: 1rem; }
.footer ul { list-style: none; margin: 0 0 2rem; padding: 0; }
.footer li { margin: .35rem 0; }
.footer span { opacity: .75; }
.copyright { margin: 0; opacity: .7; font-size: .9rem; }

:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }

@media (max-width: 640px) {
  .form { grid-template-columns: 1fr; }
  .form-actions { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 720px) {
  .hero-inner, .about { grid-template-columns: 1fr; }
  .topbar-inner { justify-content: center; }
  .hero-photo { max-width: 22rem; margin: 0 auto; }
  .hero-text { text-align: center; }
  .tagline { margin-left: auto; margin-right: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}
