/* =========================================================================
   Events, the guest side.

   This is the only screen in the platform most of its users will ever see.
   Somebody scans a code in a church foyer or at a reception, and the page has
   about three seconds to be obvious. So: one enormous button, then photos.
   ========================================================================= */

.evwrap {
  max-width: 1100px;
  margin: 0 auto;
  padding: var(--s5) var(--s4) var(--s6);
  min-height: 100vh;
  min-height: 100dvh;
}

.evhead { text-align: center; margin-bottom: var(--s5); }
.evhead h1 {
  font-size: clamp(24px, 6vw, 36px);
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  text-wrap: balance;
}
.evsub {
  color: var(--ink-2);
  margin: 0 auto;
  max-width: 52ch;
  font-size: 16px;
  line-height: 1.55;
}

/* ------------------------------------------------------------- add photos */

.evadd {
  max-width: 520px;
  margin: 0 auto var(--s5);
  text-align: center;
}
.evpick {
  display: block;
  font-size: 18px;
  padding: 18px 24px;
  cursor: pointer;
}
.evhint {
  color: var(--ink-3);
  font-size: 14px;
  margin: var(--s2) 0 0;
}

.evclosed {
  max-width: 520px;
  margin: 0 auto var(--s5);
  text-align: center;
  background: var(--sunken);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: var(--s4);
  color: var(--ink-2);
  font-size: 15.5px;
}

/* One line per photo, so a failure is visible and singular rather than the
   whole batch dying quietly. */
.evqueue { margin-top: var(--s4); text-align: left; }
.evrow {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3px 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.evname {
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.evstate { color: var(--ink-3); font-size: 13px; white-space: nowrap; }
.evbar {
  grid-column: 1 / -1;
  height: 3px;
  background: var(--sunken);
  border-radius: 2px;
  overflow: hidden;
}
.evbar i {
  display: block; height: 100%; width: 0;
  background: var(--brand);
  transition: width .2s ease;
}
.evrow.done .evstate { color: var(--good); }
.evrow.done .evbar i { background: var(--good); }
.evrow.failed .evstate { color: var(--bad); }
.evrow.failed .evbar i { background: var(--bad); }
.evdone {
  margin: var(--s3) 0 0;
  font-size: 15px;
  color: var(--ink);
  text-align: center;
}

/* ------------------------------------------------------------- the days
   An ongoing collection turns into a list of Sundays without anybody having
   created a single one of them. */

.evdays {
  display: flex;
  gap: var(--s2);
  overflow-x: auto;
  padding-bottom: var(--s2);
  margin-bottom: var(--s4);
  -webkit-overflow-scrolling: touch;
}
.evday {
  flex: none;
  padding: 7px 13px;
  border-radius: 99px;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
  white-space: nowrap;
}
.evday span { color: var(--ink-3); font-size: 12.5px; margin-left: 4px; }
.evday:hover { border-color: var(--brand); text-decoration: none; }
.evday.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.evday.on span { color: rgba(255,255,255,.75); }

/* ------------------------------------------------------------- the grid
   Columns rather than a strict grid, so portrait and landscape photos sit
   together without being cropped into squares. People took these; showing
   them whole is the least we can do. */

.evgrid {
  columns: 4 220px;
  column-gap: var(--s3);
}
.evcell {
  display: block;
  position: relative;
  break-inside: avoid;
  margin-bottom: var(--s3);
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--sunken);
  line-height: 0;
}
.evcell img { width: 100%; height: auto; display: block; }
.evcell:hover { text-decoration: none; }
.evwho {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 18px 10px 7px;
  font-size: 12.5px;
  line-height: 1.3;
  color: #fff;
  background: linear-gradient(to top, rgba(0,0,0,.62), rgba(0,0,0,0));
  opacity: 0;
  transition: opacity .15s ease;
}
.evcell:hover .evwho, .evcell:focus-visible .evwho { opacity: 1; }

.evempty {
  text-align: center;
  color: var(--ink-3);
  padding: var(--s6) var(--s4);
}
.evempty p { margin: 0 0 4px; font-size: 16px; }

/* ------------------------------------------------------------- lightbox */

.evbox {
  position: fixed;
  inset: 0;
  background: rgba(8, 12, 11, .93);
  display: none;
  place-items: center;
  z-index: 60;
  padding: var(--s4);
}
.evbox.on { display: grid; }
.evbox img {
  max-width: 100%;
  max-height: 92vh;
  max-height: 92dvh;
  border-radius: var(--r-sm);
  display: block;
}
.evclose {
  position: absolute;
  top: 12px; right: 14px;
  width: 42px; height: 42px;
  border-radius: 50%;
  border: 0;
  background: rgba(255,255,255,.14);
  color: #fff;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}
.evclose:hover { background: rgba(255,255,255,.24); }

/* ------------------------------------------------------------- passcode */

.evlock {
  max-width: 420px;
  margin: 12vh auto 0;
  text-align: center;
}
.evlock h1 { font-size: 26px; margin: 0 0 6px; letter-spacing: -0.02em; }
.evlock form { margin-top: var(--s4); }
.evlock input {
  width: 100%;
  text-align: center;
  font-size: 18px;
  letter-spacing: .04em;
  margin-bottom: var(--s3);
}
.everr { color: var(--bad); font-size: 14.5px; margin: var(--s3) 0 0; }

.evfoot {
  text-align: center;
  margin: var(--s6) 0 0;
  font-size: 12.5px;
  color: var(--ink-3);
}

@media (max-width: 700px) {
  .evwrap { padding: var(--s4) var(--s3) var(--s5); }
  .evgrid { columns: 2 140px; column-gap: var(--s2); }
  .evcell { margin-bottom: var(--s2); }
  .evwho { opacity: 1; }
}

/* ------------------------------------------------------------- owner side */

.evstats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  border-radius: var(--r);
  overflow: hidden;
  margin-bottom: var(--s4);
}
.evstats div { background: var(--surface); padding: 14px 16px; }
.evstats .n {
  display: block;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}
.evstats .k {
  font-size: 11.5px;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--ink-3);
}

.modgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: var(--s3);
  margin-bottom: var(--s4);
}
.modcard {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  overflow: hidden;
}
.modcard img { width: 100%; height: 150px; object-fit: cover; display: block; background: var(--sunken); }
.modmeta { padding: 8px 10px; font-size: 12.5px; color: var(--ink-3); }
.modacts { display: flex; gap: 6px; padding: 0 10px 10px; }
.modacts form { flex: 1; }
.modacts button { width: 100%; }
