:root {
  color-scheme: light;
  --ink: #17211c;
  --muted: #607067;
  --line: #dce5df;
  --paper: #fbf8f0;
  --surface: #ffffff;
  --field: #f6f9f7;
  --pine: #1e3a2f;
  --leaf: #4f8f5e;
  --sun: #f3c35b;
  --clay: #bc5b42;
  --sky: #d9ebef;
  --shadow: 0 18px 60px rgba(24, 45, 36, 0.12);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
}

a {
  color: inherit;
}

.site-header {
  align-items: center;
  background: rgba(251, 248, 240, 0.9);
  border-bottom: 1px solid rgba(30, 58, 47, 0.1);
  display: flex;
  justify-content: space-between;
  left: 0;
  padding: 14px clamp(18px, 4vw, 54px);
  position: sticky;
  right: 0;
  top: 0;
  z-index: 10;
}

.brand,
.nav-links {
  align-items: center;
  display: flex;
  gap: 12px;
}

.brand {
  font-weight: 800;
  text-decoration: none;
}

.brand-mark {
  align-items: center;
  background: var(--pine);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  height: 38px;
  justify-content: center;
  width: 38px;
}

.nav-links a {
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 700;
  text-decoration: none;
}

.hero {
  background:
    linear-gradient(90deg, rgba(17, 32, 26, 0.88), rgba(17, 32, 26, 0.5), rgba(17, 32, 26, 0.18)),
    url("https://images.pexels.com/photos/14307636/pexels-photo-14307636.jpeg?auto=compress&cs=tinysrgb&w=1920") center / cover;
  color: #fff;
  min-height: min(760px, calc(100vh - 68px));
  padding: clamp(64px, 12vw, 132px) clamp(18px, 5vw, 72px) clamp(90px, 14vw, 150px);
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  color: var(--sun);
  font-size: 0.78rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin: 0 0 12px;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: var(--clay);
}

h1,
h2,
p {
  margin-top: 0;
}

h1 {
  font-size: clamp(3rem, 7vw, 6.5rem);
  letter-spacing: 0;
  line-height: 0.95;
  margin-bottom: 24px;
}

h2 {
  font-size: clamp(2rem, 4vw, 3.8rem);
  letter-spacing: 0;
  line-height: 1;
  margin-bottom: 0;
}

.hero-copy {
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1.05rem, 2vw, 1.35rem);
  line-height: 1.6;
  max-width: 650px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.button,
.refresh-button {
  align-items: center;
  border: 0;
  border-radius: 8px;
  cursor: pointer;
  display: inline-flex;
  font: inherit;
  font-weight: 850;
  justify-content: center;
  min-height: 46px;
  padding: 0 18px;
  text-decoration: none;
}

.button.primary,
.refresh-button {
  background: var(--pine);
  color: #fff;
}

.button.secondary {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
  outline: 1px solid rgba(255, 255, 255, 0.35);
}

.button.compact {
  width: fit-content;
}

.button:disabled,
.refresh-button:disabled,
.rsvp-button:disabled,
.text-button:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.status-band {
  background: var(--pine);
  color: #fff;
  display: grid;
  gap: 1px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.status-band > div {
  background: rgba(255, 255, 255, 0.06);
  padding: 24px clamp(18px, 4vw, 54px);
}

.stat-value,
.stat-label {
  display: block;
}

.stat-value {
  color: var(--sun);
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 900;
  line-height: 1;
}

.stat-label {
  color: rgba(255, 255, 255, 0.74);
  margin-top: 8px;
}

.account-band {
  align-items: end;
  background: #eef6f2;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 24px clamp(18px, 4vw, 54px);
}

.account-form {
  max-width: 760px;
}

.account-controls {
  display: grid;
  gap: 10px;
  grid-template-columns: minmax(220px, 1fr) auto auto;
}

.account-status {
  color: var(--muted);
  font-weight: 800;
  line-height: 1.4;
  margin: 0;
}

.account-status[data-tone="success"] {
  color: #2f7944;
}

.account-status[data-tone="error"] {
  color: #a13d2b;
}

.toolbar,
.events-section,
.submit-section {
  margin: 0 auto;
  max-width: 1180px;
  padding-inline: clamp(18px, 4vw, 32px);
}

.toolbar {
  align-items: end;
  display: grid;
  gap: 16px;
  grid-template-columns: minmax(0, 1fr) minmax(220px, 320px);
  padding-top: 42px;
}

label {
  color: var(--muted);
  display: block;
  font-size: 0.85rem;
  font-weight: 800;
  margin-bottom: 8px;
}

input,
select,
textarea {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  font: inherit;
  padding: 0 14px;
  width: 100%;
}

input,
select {
  height: 50px;
}

textarea {
  line-height: 1.45;
  min-height: 112px;
  padding-block: 12px;
  resize: vertical;
}

input:focus,
select:focus,
textarea:focus,
.button:focus-visible,
.refresh-button:focus-visible,
.text-button:focus-visible {
  outline: 3px solid rgba(79, 143, 94, 0.35);
  outline-offset: 2px;
}

.events-section {
  padding-bottom: 72px;
  padding-top: 48px;
}

.section-heading {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 26px;
}

.message {
  color: var(--muted);
  margin-bottom: 18px;
  min-height: 24px;
}

.message:empty {
  display: none;
}

.event-grid {
  display: grid;
  gap: 30px;
}

.category-section {
  display: grid;
  gap: 16px;
}

.category-heading {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.category-heading h2,
.category-heading h3 {
  font-size: clamp(1.45rem, 2vw, 2rem);
  line-height: 1.1;
  margin: 0;
}

.category-heading span {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 850;
}

.category-event-grid {
  display: grid;
  gap: 18px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.map-shell {
  display: grid;
  gap: 18px;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 360px);
  margin-bottom: 30px;
}

.map-panel,
.map-list {
  background: rgba(255, 255, 255, 0.86);
  border: 1px solid rgba(158, 178, 166, 0.55);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.map-panel {
  min-width: 0;
}

.map-topbar {
  align-items: center;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(158, 178, 166, 0.45);
  display: flex;
  gap: 18px;
  justify-content: space-between;
  padding: 16px 18px;
}

.map-label {
  color: #687871;
  font-size: 0.72rem;
  font-weight: 900;
  letter-spacing: 0.12em;
  margin-bottom: 5px;
  text-transform: uppercase;
}

.map-topbar h3,
.map-list h3 {
  font-size: 1.05rem;
  line-height: 1.2;
  margin: 0;
}

.map-count {
  background: #edf4f1;
  border: 1px solid #d7e4dd;
  border-radius: 999px;
  color: #315144;
  flex: 0 0 auto;
  font-size: 0.84rem;
  font-weight: 850;
  padding: 7px 10px;
}

.event-map {
  background: #e8efea;
  height: clamp(420px, 52vw, 620px);
  width: 100%;
}

.event-map.is-picking-pin {
  cursor: crosshair;
}

.map-list {
  max-height: clamp(420px, 52vw, 620px);
  overflow: auto;
  padding: 16px;
}

.map-list h3 {
  margin-bottom: 12px;
}

.map-list-item {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line);
  color: inherit;
  cursor: pointer;
  display: block;
  font: inherit;
  padding: 13px 2px;
  text-align: left;
  width: 100%;
}

.map-list-item:first-of-type {
  padding-top: 0;
}

.map-list-item:last-child {
  border-bottom: 0;
}

.map-list-item:hover strong,
.map-list-item:focus-visible strong {
  color: var(--clay);
}

.map-list-item:focus-visible {
  outline: 3px solid rgba(79, 143, 94, 0.35);
  outline-offset: 2px;
}

.map-list-item span,
.map-list-item small {
  color: var(--muted);
  display: block;
  font-size: 0.78rem;
  line-height: 1.35;
}

.map-list-item span {
  font-weight: 850;
  margin-bottom: 5px;
}

.map-list-item strong {
  display: block;
  line-height: 1.25;
  margin-bottom: 6px;
}

.empty-map {
  color: var(--muted);
  line-height: 1.45;
  margin: 0;
}

.event-pin {
  background: transparent;
  border: 0;
  position: relative;
}

.event-pin::before {
  background: #f04f3e;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 0;
  box-shadow: 0 8px 20px rgba(36, 54, 45, 0.28);
  content: "";
  height: 25px;
  left: 1px;
  position: absolute;
  top: 1px;
  transform: rotate(-45deg);
  width: 25px;
}

.event-pin span {
  align-items: center;
  color: #fff;
  display: flex;
  font-size: 0.74rem;
  font-weight: 900;
  height: 25px;
  justify-content: center;
  left: 4px;
  position: absolute;
  top: 4px;
  width: 25px;
  z-index: 1;
}

.draft-pin::before {
  background: #1677c8;
}

.popup-card {
  color: var(--ink);
  display: grid;
  gap: 5px;
  min-width: 190px;
}

.popup-card strong {
  line-height: 1.25;
}

.popup-card span {
  color: var(--clay);
  font-size: 0.78rem;
  font-weight: 850;
}

.popup-card p {
  color: var(--muted);
  line-height: 1.35;
  margin: 0;
}

.popup-card a,
.maps-link {
  color: #1677c8;
  font-weight: 850;
  text-decoration: none;
}

.event-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-height: 275px;
  padding: 22px;
}

.card-topline {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.event-card h3 {
  font-size: 1.3rem;
  letter-spacing: 0;
  line-height: 1.18;
  margin: 0;
}

.event-time {
  color: var(--clay);
  font-weight: 850;
  line-height: 1.35;
}

.text-button {
  background: transparent;
  border: 0;
  border-radius: 8px;
  color: #1677c8;
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  padding: 7px 8px;
}

.event-card.editing {
  min-height: unset;
}

.edit-form {
  display: grid;
  gap: 12px;
}

.edit-form label {
  margin-bottom: 0;
}

.edit-form input,
.edit-form textarea {
  margin-top: 8px;
}

.coord-row,
.card-actions {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.card-actions {
  align-items: center;
  grid-template-columns: auto auto;
  justify-content: start;
}

.event-meta {
  align-items: center;
  color: var(--muted);
  display: flex;
  gap: 8px;
  line-height: 1.4;
}

.category-pill {
  align-self: start;
  background: var(--sky);
  border-radius: 999px;
  color: #16414a;
  font-size: 0.78rem;
  font-weight: 850;
  padding: 7px 10px;
}

.event-description {
  color: #3e4b44;
  line-height: 1.55;
  margin-bottom: 0;
}

.event-actions {
  display: grid;
  gap: 10px;
}

.rsvp-control {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.rsvp-button,
.tab-button {
  background: #edf4f1;
  border: 1px solid #d7e4dd;
  border-radius: 8px;
  color: var(--pine);
  cursor: pointer;
  font: inherit;
  font-weight: 850;
  min-height: 38px;
  padding: 0 12px;
}

.rsvp-button.selected,
.tab-button.selected {
  background: var(--pine);
  color: #fff;
}

.event-counts {
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  font-size: 0.9rem;
  font-weight: 800;
  gap: 10px;
}

.maps-link {
  margin-top: auto;
}

.submit-section {
  align-items: start;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 22px;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  padding-bottom: 70px;
  padding-top: 46px;
}

.event-form {
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 22px;
}

.event-form .button.secondary {
  background: #eef6f2;
  color: var(--pine);
  outline: 1px solid #cdded5;
}

.form-grid {
  display: grid;
  gap: 16px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field.wide {
  grid-column: 1 / -1;
}

.pin-picker {
  align-items: center;
  background: var(--field);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 12px;
}

.pin-status {
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 750;
}

.form-actions {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 18px;
}

.form-message {
  color: var(--muted);
  font-weight: 750;
}

.form-message[data-tone="success"] {
  color: #2f7944;
}

.form-message[data-tone="error"] {
  color: #a13d2b;
}

footer {
  background: var(--pine);
  color: #bde7c6;
  padding: 28px clamp(18px, 4vw, 54px);
  text-align: center;
}

footer p {
  margin: 0;
}

.calendar-page {
  background: #f7faf8;
}

.calendar-main {
  margin: 0 auto;
  max-width: 1180px;
  padding: 42px clamp(18px, 4vw, 32px) 70px;
}

.calendar-head {
  align-items: end;
  display: flex;
  gap: 18px;
  justify-content: space-between;
  margin-bottom: 24px;
}

.calendar-head h1 {
  color: var(--ink);
  font-size: clamp(2.4rem, 5vw, 4.5rem);
  line-height: 0.95;
  margin-bottom: 12px;
}

.print-owner {
  color: var(--muted);
  font-weight: 850;
  margin: 0;
}

.calendar-actions,
.calendar-toolbar,
.month-controls,
.view-tabs {
  align-items: center;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.calendar-actions .button.secondary {
  background: #eef6f2;
  color: var(--pine);
  outline: 1px solid #cdded5;
}

.calendar-toolbar {
  justify-content: space-between;
  margin: 30px 0 18px;
}

.month-controls strong {
  min-width: 180px;
  text-align: center;
}

.hidden {
  display: none !important;
}

.month-grid {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  overflow: hidden;
}

.weekday,
.calendar-day {
  border-bottom: 1px solid var(--line);
  border-right: 1px solid var(--line);
  min-height: 128px;
  padding: 10px;
}

.weekday {
  background: #eef6f2;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 900;
  min-height: auto;
  text-align: center;
}

.calendar-day.blank {
  background: #f6f9f7;
}

.day-number {
  color: var(--muted);
  display: block;
  font-size: 0.84rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.day-events {
  display: grid;
  gap: 6px;
}

.mini-event {
  background: #edf4f1;
  border-left: 3px solid var(--leaf);
  border-radius: 6px;
  padding: 7px;
}

.mini-event strong,
.mini-event span {
  display: block;
  font-size: 0.78rem;
  line-height: 1.25;
}

.mini-event span {
  color: var(--muted);
  margin-top: 3px;
}

.calendar-category-list,
.calendar-event-list {
  display: grid;
  gap: 18px;
}

.calendar-category {
  display: grid;
  gap: 14px;
}

.calendar-event {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 12px;
  padding: 20px;
}

.calendar-event h3 {
  font-size: 1.25rem;
  line-height: 1.2;
  margin: 10px 0 0;
}

.calendar-event p {
  color: #3e4b44;
  line-height: 1.5;
  margin: 0;
}

.event-meta-line {
  color: var(--muted) !important;
  font-weight: 800;
}

@media (max-width: 900px) {
  .account-band,
  .account-controls,
  .category-event-grid,
  .form-grid,
  .map-shell,
  .status-band,
  .submit-section,
  .toolbar {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: start;
    flex-direction: column;
  }

  .calendar-head,
  .calendar-toolbar {
    align-items: start;
    flex-direction: column;
  }

  .month-grid {
    display: block;
  }

  .weekday {
    display: none;
  }

  .calendar-day {
    border-right: 0;
    min-height: 96px;
  }

  .calendar-day.blank {
    display: none;
  }
}

@media (max-width: 640px) {
  .site-header {
    align-items: flex-start;
    flex-direction: column;
    gap: 12px;
  }

  .hero {
    min-height: 680px;
  }

  h1 {
    font-size: 3.4rem;
  }

  .coord-row,
  .card-actions {
    grid-template-columns: 1fr;
  }
}

@media print {
  body {
    background: #fff;
    color: #000;
  }

  .no-print,
  .site-header,
  .account-band,
  .calendar-toolbar,
  .event-actions,
  .message:empty {
    display: none !important;
  }

  .calendar-main {
    max-width: none;
    padding: 0;
  }

  .calendar-head {
    border-bottom: 2px solid #000;
    margin-bottom: 18px;
    padding-bottom: 12px;
  }

  .calendar-head h1 {
    color: #000;
    font-size: 28pt;
  }

  .month-grid,
  .calendar-event {
    border-color: #000;
    box-shadow: none;
  }

  .weekday,
  .calendar-day {
    border-color: #999;
  }

  .calendar-day {
    min-height: 92px;
    page-break-inside: avoid;
  }

  .calendar-category,
  .calendar-event {
    page-break-inside: avoid;
  }

  .category-pill,
  .mini-event {
    background: #fff;
    border: 1px solid #999;
    color: #000;
  }
}
