/* escrowcalendar.org — neutral industry resource. Mobile-first. */

:root {
  --paper: #f7f5f0;
  --surface: #fffdf9;
  --surface-2: #f1eee6;
  --ink: #16191f;
  --muted: #5b6470;
  --faint: #8a8f99;
  --rule: rgba(20, 25, 31, 0.12);
  --rule-strong: rgba(20, 25, 31, 0.22);
  --accent: #1f6f5c;
  --accent-dark: #185847;
  --accent-tint: #e7f0ec;
  --warn: #9a5b12;
  --warn-tint: #f6ecdb;
  --max: 1180px;
  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  --radius: 14px;
  --shadow: 0 14px 40px rgba(30, 22, 10, 0.10);

  /* event-type accents — used only on dots and pills, never as fills */
  --t-conference: #1f6f5c;
  --t-webinar: #2563a8;
  --t-class: #2f7a3f;
  --t-dinner: #b06a1c;
  --t-mixer: #7a4b86;
  --t-meeting: #4a5568;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: var(--accent-dark); }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 20;
  background: #fff;
  padding: 0.6rem 1rem;
  border-radius: 8px;
}

.wrap {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

/* ---------- header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: rgba(247, 245, 240, 0.88);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  margin-right: auto;
}
.brand .mark {
  width: 34px;
  height: 34px;
  flex: none;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text strong { font-family: var(--serif); font-size: 1.12rem; font-weight: 600; letter-spacing: -0.01em; }
.brand-text small { font-size: 0.7rem; color: var(--muted); letter-spacing: 0.02em; }

.site-nav { display: flex; align-items: center; gap: 1.4rem; }
.site-nav a {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: none;
}
.site-nav a:hover { color: var(--accent-dark); }

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.62rem 1rem;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  text-decoration: none;
  font-weight: 700;
  font-size: 0.9rem;
  border: 1px solid var(--ink);
  cursor: pointer;
  transition: background 0.18s ease, color 0.18s ease;
}
.button:hover { background: #000; }
.button.accent { background: var(--accent); border-color: var(--accent); }
.button.accent:hover { background: var(--accent-dark); }
.button.ghost { background: transparent; color: var(--ink); border-color: var(--rule-strong); }
.button.ghost:hover { background: var(--surface-2); }

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 38px;
  padding: 9px;
  background: none;
  border: 0;
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s ease, opacity 0.2s ease;
}

/* ---------- hero ---------- */
.hero { padding: 3.2rem 0 1.6rem; }
.hero .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 0.74rem;
  font-weight: 800;
  color: var(--accent-dark);
  margin: 0 0 0.8rem;
}
.hero h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2.1rem, 5vw, 3.4rem);
  line-height: 1.04;
  letter-spacing: -0.025em;
  margin: 0 0 0.9rem;
  max-width: 18ch;
}
.hero .lede {
  font-size: clamp(1.02rem, 1.6vw, 1.2rem);
  color: var(--muted);
  max-width: 56ch;
  margin: 0 0 1.5rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.7rem; margin-bottom: 1.8rem; }

.stats { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.stat {
  display: flex;
  align-items: baseline;
  gap: 0.4rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.4rem 0.85rem;
}
.stat b { font-family: var(--serif); font-size: 1.05rem; font-weight: 600; }
.stat span { font-size: 0.82rem; color: var(--muted); }

/* ---------- toolbar ---------- */
.toolbar {
  position: sticky;
  top: 64px;
  z-index: 6;
  background: rgba(247, 245, 240, 0.92);
  backdrop-filter: blur(10px);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 0.7rem 0;
}
.toolbar .wrap {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  flex-wrap: wrap;
}
.search {
  position: relative;
  flex: 1 1 260px;
  min-width: 0;
}
.search svg {
  position: absolute;
  left: 0.7rem;
  top: 50%;
  transform: translateY(-50%);
  color: var(--faint);
  pointer-events: none;
}
.search input {
  width: 100%;
  font: inherit;
  font-size: 0.92rem;
  padding: 0.58rem 0.7rem 0.58rem 2.2rem;
  background: var(--surface);
  border: 1px solid var(--rule-strong);
  border-radius: 999px;
  color: var(--ink);
}
.search input:focus { outline: none; border-color: var(--accent); }

.view-toggle { display: inline-flex; background: var(--surface-2); border: 1px solid var(--rule); border-radius: 999px; padding: 3px; }
.view-toggle button {
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted);
  padding: 0.4rem 0.85rem;
  border-radius: 999px;
  cursor: pointer;
}
.view-toggle button[aria-pressed="true"] { background: var(--surface); color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.08); }

.filters-toggle { display: none; }

/* ---------- layout ---------- */
.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 2rem;
  padding: 1.8rem 0 3rem;
  align-items: start;
}

/* ---------- filters ---------- */
.filters {
  position: sticky;
  top: 124px;
  align-self: start;
}
.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.6rem;
}
.filters-head h2 { font-family: var(--serif); font-size: 1.1rem; font-weight: 600; margin: 0; }
.clear-filters {
  background: none;
  border: 0;
  color: var(--accent-dark);
  font: inherit;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  padding: 0;
}
.clear-filters[hidden] { display: none; }

.filter-group { border-top: 1px solid var(--rule); padding: 0.9rem 0; }
.filter-group > h3 {
  font-size: 0.74rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--muted);
  margin: 0 0 0.6rem;
  font-weight: 700;
}
.filter-opt {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.18rem 0;
  font-size: 0.9rem;
  cursor: pointer;
}
.filter-opt input { accent-color: var(--accent); width: 15px; height: 15px; }
.filter-opt .count { margin-left: auto; color: var(--faint); font-size: 0.78rem; font-variant-numeric: tabular-nums; }
.filter-opt.is-empty { opacity: 0.45; }

/* ---------- results / list ---------- */
.results-meta {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1rem;
  color: var(--muted);
  font-size: 0.9rem;
}
.results-meta .count-strong { color: var(--ink); font-weight: 700; }

.event-list { display: flex; flex-direction: column; gap: 0.9rem; }

.month-sep {
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--ink);
  margin: 1.4rem 0 0.2rem;
  padding-bottom: 0.4rem;
  border-bottom: 1px solid var(--rule);
}
.month-sep:first-child { margin-top: 0; }

.card {
  display: grid;
  grid-template-columns: 66px 1fr;
  gap: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.1rem 1.2rem;
  transition: border-color 0.18s ease, box-shadow 0.18s ease;
}
.card:hover { border-color: var(--rule-strong); box-shadow: var(--shadow); }
.card.tentative { border-style: dashed; }
.card.veto { box-shadow: inset 3px 0 0 var(--accent); }
.card.veto:hover { box-shadow: inset 3px 0 0 var(--accent), var(--shadow); }

.cal-chip {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 66px;
  height: 66px;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: var(--surface-2);
  text-align: center;
  line-height: 1;
}
.cal-chip .mo { font-size: 0.66rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; color: var(--accent-dark); }
.cal-chip .dy { font-family: var(--serif); font-size: 1.6rem; font-weight: 600; margin-top: 2px; }
.cal-chip .multi { font-size: 0.62rem; color: var(--muted); margin-top: 2px; }

.card-body { min-width: 0; }
.card h3 {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.18;
  margin: 0 0 0.35rem;
}
.card h3 a { color: inherit; text-decoration: none; }
.card h3 a:hover { color: var(--accent-dark); }

.pills { display: flex; flex-wrap: wrap; gap: 0.35rem; margin: 0 0 0.5rem; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 0.32rem;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  border: 1px solid var(--rule);
  background: var(--surface);
  color: var(--ink);
  white-space: nowrap;
}
.pill .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.pill.org { background: var(--surface-2); }

/* event-type accent (dots + month chips) — single source of color */
.pill.type[data-type="conference"] .dot, .cal-event[data-type="conference"] { border-left-color: var(--t-conference); }
.pill.type[data-type="conference"] .dot { background: var(--t-conference); }
.pill.type[data-type="webinar"] .dot { background: var(--t-webinar); }
.cal-event[data-type="webinar"] { border-left-color: var(--t-webinar); }
.pill.type[data-type="class"] .dot { background: var(--t-class); }
.cal-event[data-type="class"] { border-left-color: var(--t-class); }
.pill.type[data-type="dinner"] .dot { background: var(--t-dinner); }
.cal-event[data-type="dinner"] { border-left-color: var(--t-dinner); }
.pill.type[data-type="mixer"] .dot { background: var(--t-mixer); }
.cal-event[data-type="mixer"] { border-left-color: var(--t-mixer); }
.pill.type[data-type="meeting"] .dot { background: var(--t-meeting); }
.cal-event[data-type="meeting"] { border-left-color: var(--t-meeting); }
.pill.ce { color: var(--t-class); border-color: rgba(47, 122, 63, 0.3); background: rgba(47, 122, 63, 0.08); }
.pill.free { color: var(--accent-dark); border-color: rgba(31, 111, 92, 0.3); background: var(--accent-tint); }
.pill.virtual { color: var(--t-webinar); border-color: rgba(37, 99, 168, 0.3); background: rgba(37, 99, 168, 0.08); }
.pill.tentative-pill { color: var(--warn); border-color: rgba(154, 91, 18, 0.32); background: var(--warn-tint); }
.pill.veto-pill { color: #fff; border-color: var(--ink); background: var(--ink); }

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem 0.9rem;
  color: var(--muted);
  font-size: 0.86rem;
  margin: 0 0 0.5rem;
}
.card-meta span { display: inline-flex; align-items: center; gap: 0.32rem; }
.card-desc { color: var(--muted); font-size: 0.9rem; margin: 0 0 0.7rem; }
.card-note {
  font-size: 0.8rem;
  color: var(--warn);
  background: var(--warn-tint);
  border: 1px solid rgba(154, 91, 18, 0.22);
  border-radius: 8px;
  padding: 0.4rem 0.6rem;
  margin: 0 0 0.7rem;
}
.card-actions { display: flex; flex-wrap: wrap; gap: 0.5rem 1.1rem; align-items: center; }
.card-actions a, .card-actions button {
  font-size: 0.86rem;
  font-weight: 700;
  text-decoration: none;
  color: var(--accent-dark);
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  font-family: inherit;
}
.card-actions a:hover, .card-actions button:hover { text-decoration: underline; }
.card-actions .reg::after { content: " →"; }

.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--muted);
  border: 1px dashed var(--rule-strong);
  border-radius: var(--radius);
}
.empty h3 { font-family: var(--serif); color: var(--ink); margin: 0 0 0.4rem; }

/* ---------- month view ---------- */
.month-view[hidden], .list-view[hidden] { display: none; }
.month-nav { display: flex; align-items: center; gap: 0.8rem; margin-bottom: 1rem; }
.month-nav h2 { font-family: var(--serif); font-size: 1.4rem; font-weight: 600; margin: 0; min-width: 11ch; }
.month-nav button {
  width: 38px; height: 38px;
  border: 1px solid var(--rule-strong);
  background: var(--surface);
  border-radius: 10px;
  cursor: pointer;
  font-size: 1rem;
  color: var(--ink);
}
.month-nav button:hover { background: var(--surface-2); }
.month-nav .today-btn { width: auto; padding: 0 0.9rem; font-weight: 600; font-size: 0.86rem; }

.calendar-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 1px; background: var(--rule); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.cal-dow { background: var(--surface-2); padding: 0.5rem; text-align: center; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
.cal-cell { background: var(--surface); min-height: 104px; padding: 0.4rem; display: flex; flex-direction: column; gap: 3px; }
.cal-cell.empty-cell { background: var(--surface-2); }
.cal-cell .date-num { font-size: 0.8rem; font-weight: 700; color: var(--muted); }
.cal-cell.is-today .date-num { background: var(--accent); color: #fff; border-radius: 50%; width: 22px; height: 22px; display: inline-flex; align-items: center; justify-content: center; }
.cal-event {
  font-size: 0.72rem;
  line-height: 1.2;
  text-align: left;
  border: 0;
  border-left: 3px solid var(--muted);
  background: var(--surface-2);
  border-radius: 4px;
  padding: 0.2rem 0.35rem;
  cursor: pointer;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  font-family: inherit;
  color: var(--ink);
  width: 100%;
}
.cal-event:hover { background: var(--accent-tint); }
.cal-more { font-size: 0.7rem; color: var(--accent-dark); font-weight: 600; cursor: pointer; background: none; border: 0; text-align: left; padding: 0 0.35rem; }

/* ---------- dialog ---------- */
dialog#event-dialog {
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  padding: 0;
  max-width: 540px;
  width: calc(100% - 32px);
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 30px 80px rgba(0,0,0,.3);
}
dialog#event-dialog::backdrop { background: rgba(16, 19, 25, 0.5); backdrop-filter: blur(2px); }
.dlg-body { padding: 1.6rem; }
.dlg-close { position: absolute; top: 0.7rem; right: 0.7rem; width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--rule); background: var(--surface); cursor: pointer; font-size: 1.1rem; line-height: 1; }
.dlg-body h2 { font-family: var(--serif); font-weight: 600; font-size: 1.5rem; margin: 0.2rem 0 0.6rem; }
.dlg-row { display: flex; gap: 0.5rem; font-size: 0.92rem; padding: 0.45rem 0; border-bottom: 1px solid var(--rule); }
.dlg-row .k { color: var(--muted); min-width: 96px; flex: none; }
.dlg-actions { display: flex; flex-wrap: wrap; gap: 0.6rem; margin-top: 1.2rem; }

/* ---------- digest / sections ---------- */
.band {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.band .wrap { padding: 3rem 0; }
.band h2 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.02em; margin: 0 0 0.6rem; }
.band p.sub { color: var(--muted); max-width: 56ch; margin: 0 0 1.4rem; }

.digest-form { display: flex; flex-wrap: wrap; gap: 0.6rem; max-width: 560px; }
.digest-form input[type="email"] {
  flex: 1 1 220px;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.7rem 0.9rem;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  color: var(--ink);
}
.digest-form input:focus { outline: none; border-color: var(--accent); }
.digest-states { display: flex; flex-wrap: wrap; gap: 0.4rem; margin: 0.9rem 0 0; }
.digest-states label {
  font-size: 0.82rem;
  border: 1px solid var(--rule);
  border-radius: 999px;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--paper);
}
.digest-states input { accent-color: var(--accent); }
.hp { position: absolute !important; left: -9999px; width: 1px; height: 1px; opacity: 0; }
.form-status { font-size: 0.86rem; margin: 0.8rem 0 0; min-height: 1.1em; color: var(--muted); }
.form-status.ok { color: var(--accent-dark); }
.form-status.err { color: #a8442c; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding: 2.4rem 0; }
.site-footer .wrap { display: grid; grid-template-columns: 1.3fr 1fr; gap: 2rem; }
.foot-brand strong { font-family: var(--serif); font-size: 1.05rem; }
.foot-brand p { color: var(--muted); font-size: 0.88rem; margin: 0.5rem 0 0; max-width: 46ch; }
.powered { margin-top: 1rem; font-size: 0.85rem; }
.powered a { font-weight: 700; color: var(--ink); text-decoration: none; }
.powered a:hover { text-decoration: underline; }
.foot-links { display: flex; flex-direction: column; gap: 0.4rem; }
.foot-links a { color: var(--muted); text-decoration: none; font-size: 0.9rem; }
.foot-links a:hover { color: var(--ink); }
.disclaimer { color: var(--faint); font-size: 0.78rem; margin-top: 1.6rem; max-width: 70ch; line-height: 1.5; }

/* ---------- generic content pages (submit) ---------- */
.page { padding: 2.6rem 0 3.5rem; }
.page h1 { font-family: var(--serif); font-weight: 600; font-size: clamp(1.9rem, 4vw, 2.7rem); letter-spacing: -0.02em; margin: 0 0 0.7rem; }
.page .lede { color: var(--muted); font-size: 1.05rem; max-width: 60ch; margin: 0 0 2rem; }
.form-card {
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
  padding: 1.6rem;
  max-width: 640px;
}
.field { margin-bottom: 1rem; }
.field label { display: block; font-size: 0.86rem; font-weight: 600; margin-bottom: 0.35rem; }
.field .hint { font-weight: 400; color: var(--muted); }
.field input, .field select, .field textarea {
  width: 100%;
  font: inherit;
  font-size: 0.95rem;
  padding: 0.65rem 0.8rem;
  background: var(--paper);
  border: 1px solid var(--rule-strong);
  border-radius: 10px;
  color: var(--ink);
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--accent); }
.field textarea { resize: vertical; min-height: 96px; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.checkline { display: flex; align-items: center; gap: 0.5rem; font-size: 0.92rem; }
.checkline input { width: auto; }

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .filters {
    position: fixed;
    inset: 0;
    z-index: 30;
    background: var(--paper);
    padding: 1.2rem;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.25s ease;
    box-shadow: var(--shadow);
  }
  .filters.open { transform: translateX(0); }
  .filters-toggle {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: var(--surface);
    border: 1px solid var(--rule-strong);
    border-radius: 999px;
    padding: 0.5rem 0.9rem;
    font: inherit;
    font-size: 0.86rem;
    font-weight: 600;
    cursor: pointer;
  }
  .filters .filters-head { position: sticky; top: 0; }
  .filters-done {
    display: block;
    width: 100%;
    margin-top: 1.2rem;
  }
}
@media (min-width: 901px) {
  .filters-done, .filters .filters-close { display: none; }
}

@media (max-width: 720px) {
  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--rule);
    padding: 0.5rem 16px 1rem;
  }
  .site-header.open .site-nav { display: flex; }
  .site-nav a { padding: 0.7rem 0; border-bottom: 1px solid var(--rule); }
  .site-header.open .nav-toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  .site-header.open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.open .nav-toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
  .nav-toggle { display: flex; }
  .header-cta { display: none; }
  .site-footer .wrap { grid-template-columns: 1fr; }
  .field-row { grid-template-columns: 1fr; }
  .calendar-grid { font-size: 0.8rem; }
  .cal-cell { min-height: 78px; }
  .cal-event { font-size: 0.62rem; }
  .card { grid-template-columns: 54px 1fr; gap: 0.85rem; padding: 1rem; }
  .cal-chip { width: 54px; height: 54px; }
  .cal-chip .dy { font-size: 1.3rem; }
}

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