/* Eventero public pages (event, tickets, ticket) — served by the API Lambda,
   styled here. Mochi-Zen tokens (see app/styles.css); --accent is the
   organizer's color, set inline by the page. */
:root {
  --paper: #fff8f2;
  --paper-raised: #fffcf9;
  --grid-line: #f0e2d4;
  --ink: #1a1f3c;
  --ink-soft: #4d5374;
  --ink-faint: #8b90ab;
  --accent: #e8956d;
  --accent-deep: #b5623a;
  --accent-soft: #fdecd8;
  --danger: #c62f36;
  --danger-soft: #fbe9ea;
  --ok: #2f7d43;
  --ok-soft: #e6f4ea;
  --reply-soft: #fdf3dc;
  --shadow: 0 4px 24px rgba(26, 31, 60, 0.07);
  --shadow-float: 0 16px 48px rgba(26, 31, 60, 0.12);
  --mono: ui-monospace, 'SF Mono', 'Cascadia Mono', Menlo, Consolas, monospace;
  --sans: 'Nunito', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}
* { box-sizing: border-box; }
body.ev-body {
  margin: 0; font-family: var(--sans); color: var(--ink); line-height: 1.6; -webkit-font-smoothing: antialiased;
  background: linear-gradient(180deg, var(--paper) 0%, var(--paper-raised) 100%) fixed var(--paper);
  min-height: 100vh; display: flex; flex-direction: column;
}
body.ev-body > main { flex: 1; }
a { color: var(--accent-deep); font-weight: 700; }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); line-height: 1.08; font-weight: 900; letter-spacing: -0.02em; margin: 0 0 12px; text-wrap: balance; }
.ev-h1-sm { font-size: clamp(1.6rem, 3.5vw, 2.1rem); }
.ev-wrap { max-width: 68rem; margin: 0 auto; padding: 0 16px; }
@media (min-width: 700px) { .ev-wrap { padding: 0 24px; } }
.ev-narrow { max-width: 40rem; padding-top: 28px; padding-bottom: 40px; }

/* thin top bar with the organizer's name, and the accent under it */
.ev-top { background: linear-gradient(90deg, var(--ink) 0%, #232952 100%); border-bottom: 4px solid var(--accent); }
.ev-top .ev-wrap { padding-top: 12px; padding-bottom: 12px; }
.ev-org { color: #fff; font-weight: 900; text-decoration: none; letter-spacing: 0.01em; }
a.ev-org:hover { color: var(--accent-soft); }

.ev-hero { margin: 24px 0 0; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow-float); background: var(--grid-line); }
/* Exactly 2:1, like the widget's cover, so one recommended size fits both. */
.ev-hero img { display: block; width: 100%; aspect-ratio: 2 / 1; object-fit: cover; }

.ev-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 23rem); gap: 40px; align-items: start; padding: 32px 0 56px; }
@media (max-width: 880px) { .ev-grid { grid-template-columns: minmax(0, 1fr); gap: 8px; padding-top: 22px; } }
.ev-sticky { position: sticky; top: 20px; }
.ev-more { margin: -24px 0 0; padding: 18px 0 48px; border-top: 1px solid var(--grid-line); }
.ev-more a { text-decoration: none; }
.ev-more a:hover { text-decoration: underline; }
.ev-side [data-eventero] { margin: 0; }

.ev-kicker { font-size: 0.78rem; font-weight: 800; letter-spacing: 0.1em; text-transform: uppercase; color: var(--accent-deep); margin: 0 0 8px; }
.ev-summary { font-size: 1.15rem; color: var(--ink-soft); margin: 0 0 22px; max-width: 40rem; }

.ev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); gap: 12px; margin: 18px 0 26px; }
.ev-fact { background: #fff; border-radius: 16px; padding: 14px 16px; box-shadow: var(--shadow); font-size: 0.97rem; }
.ev-fact-k { display: block; font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--ink-faint); margin-bottom: 4px; }
.ev-fact a { font-size: 0.9rem; }

.ev-desc { font-size: 1.05rem; max-width: 42rem; overflow-wrap: anywhere; }
.ev-desc img { max-width: 100%; height: auto; border-radius: 14px; }
.ev-desc h2 { font-size: 1.4rem; font-weight: 800; margin: 28px 0 8px; }
.ev-desc h3 { font-size: 1.15rem; font-weight: 800; margin: 22px 0 6px; }

/* One row of pictures, all the same height and each its own shape: nothing
   is cropped, so a flyer or poster shows whole. */
.ev-pics { display: flex; flex-wrap: wrap; gap: 10px; margin: 26px 0; }
.ev-pics a { display: block; border-radius: 12px; overflow: hidden; background: var(--grid-line); box-shadow: var(--shadow); cursor: zoom-in; }
.ev-pics img { display: block; height: 200px; width: auto; max-width: 100%; object-fit: contain; transition: transform 0.25s; }
.ev-pics a:hover img { transform: scale(1.03); }
@media (max-width: 600px) { .ev-pics img { height: 140px; } }

.ev-lightbox { border: 0; padding: 0; margin: 0; width: 100vw; height: 100vh; max-width: none; max-height: none; background: rgba(12, 14, 28, 0.94); color: #fff; }
.ev-lightbox::backdrop { background: rgba(12, 14, 28, 0.9); }
.ev-lightbox[open] { display: grid; place-items: center; }
.ev-lightbox img { max-width: calc(100vw - 32px); max-height: calc(100vh - 96px); object-fit: contain; border-radius: 8px; user-select: none; }
.ev-lb-btn { position: absolute; border: 0; background: rgba(255, 255, 255, 0.12); color: #fff; width: 48px; height: 48px; border-radius: 50%; font-size: 26px; line-height: 1; cursor: pointer; }
.ev-lb-btn:hover, .ev-lb-btn:focus-visible { background: rgba(255, 255, 255, 0.24); }
.ev-lb-close { top: 16px; right: 16px; }
.ev-lb-prev { left: 16px; top: 50%; transform: translateY(-50%); }
.ev-lb-next { right: 16px; top: 50%; transform: translateY(-50%); }
.ev-lb-count { position: absolute; bottom: 18px; left: 0; right: 0; text-align: center; font-size: 0.85rem; opacity: 0.75; }
@media (max-width: 600px) { .ev-lb-prev, .ev-lb-next { top: auto; bottom: 8px; transform: none; } }

.ev-policy { margin-top: 26px; padding-top: 18px; border-top: 1px solid var(--grid-line); color: var(--ink-soft); font-size: 0.95rem; }
.ev-policy p { margin: 0; }

.ev-banner { background: var(--reply-soft); color: #8a6100; border-radius: 14px; padding: 12px 16px; margin: 20px 0 0; font-weight: 700; }
.ev-banner-bad { background: var(--danger-soft); color: var(--danger); }

.ev-card { background: #fff; border-radius: 20px; padding: 22px; box-shadow: var(--shadow); margin-bottom: 16px; }
.ev-card .ev-facts { margin-bottom: 4px; }
.ev-card .ev-fact { box-shadow: none; border: 1px solid var(--grid-line); }
.ev-message { text-align: center; padding: 36px 26px; }
.ev-message h1 { font-size: 1.7rem; }
.ev-message p { color: var(--ink-soft); margin: 0; }
.ev-note { background: var(--accent-soft); border-radius: 14px; padding: 12px 14px; margin-top: 12px; overflow-wrap: anywhere; }

.ev-hint { color: var(--ink-soft); font-weight: 700; text-align: center; margin: 22px 0 12px; }
.ev-tickets { display: grid; gap: 14px; }
.ev-ticket {
  display: flex; gap: 18px; align-items: center; background: #fff; border-radius: 20px; padding: 16px; box-shadow: var(--shadow);
  border-left: 6px solid var(--accent);
}
.ev-ticket.is-void { opacity: 0.6; border-left-color: var(--ink-faint); }
.ev-qr { flex: none; display: block; width: 190px; max-width: 46vw; }
.ev-qr svg { display: block; width: 100%; height: auto; }
.ev-ticket-info { min-width: 0; }
.ev-ticket-n { font-size: 0.72rem; font-weight: 800; letter-spacing: 0.09em; text-transform: uppercase; color: var(--accent-deep); }
.ev-ticket-type { font-size: 1.25rem; font-weight: 900; line-height: 1.2; margin: 2px 0; }
.ev-ticket-name { color: var(--ink-soft); }
.ev-ticket-id { font-family: var(--mono); font-size: 0.78rem; color: var(--ink-faint); margin-top: 6px; overflow-wrap: anywhere; }
.ev-pill { display: inline-block; margin-top: 8px; font-size: 0.75rem; font-weight: 800; border-radius: 999px; padding: 3px 10px; }
.ev-pill-used { background: var(--ok-soft); color: var(--ok); }
.ev-pill-void { background: var(--danger-soft); color: var(--danger); }
@media (max-width: 480px) { .ev-ticket { flex-direction: column; text-align: center; } .ev-qr { width: 230px; max-width: 80vw; } }

/* /e/<account>: every public event */
.ev-list-wrap { padding-top: 32px; padding-bottom: 56px; }
.ev-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); gap: 18px; margin-top: 22px; }
.ev-item {
  display: flex; flex-direction: column; background: #fff; border-radius: 20px; overflow: hidden; box-shadow: var(--shadow);
  color: inherit; font-weight: inherit; text-decoration: none; transition: transform 0.2s, box-shadow 0.2s;
}
.ev-item:hover { transform: translateY(-2px); box-shadow: var(--shadow-float); }
/* overflow lets aspect-ratio win over a tall poster's own height. */
.ev-item-img { aspect-ratio: 1 / 1; overflow: hidden; min-height: 0; background: linear-gradient(135deg, var(--accent-soft) 0%, var(--accent) 100%); }
.ev-item-img img { display: block; width: 100%; height: 100%; object-fit: cover; }
/* The featured image (often a poster) is the thumbnail, shown whole. */
.ev-item-img img.whole { object-fit: contain; background: var(--accent-soft); }
.ev-item-body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.ev-item-body .ev-kicker { margin-bottom: 4px; }
.ev-item h2 { font-size: 1.3rem; font-weight: 900; line-height: 1.2; margin: 0 0 6px; overflow-wrap: anywhere; }
.ev-item-sum { color: var(--ink-soft); margin: 0 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ev-item-meta { margin-top: auto; color: var(--ink-soft); font-size: 0.92rem; font-weight: 700; }
.ev-item-meta .ev-pill { margin: 0 0 0 4px; vertical-align: 1px; }
.ev-pill-muted { background: var(--grid-line); color: var(--ink-soft); }
.ev-list-h { font-size: 1.4rem; font-weight: 900; margin: 48px 0 0; }
.ev-list-past { grid-template-columns: repeat(auto-fill, minmax(min(100%, 15rem), 1fr)); gap: 14px; }
.ev-item.is-past { opacity: 0.8; }
.ev-item.is-past .ev-item-img { aspect-ratio: 3 / 1; }
.ev-item.is-past h2 { font-size: 1.05rem; margin: 0; }

.ev-small { color: var(--ink-faint); font-size: 0.85rem; text-align: center; margin: 22px 0 0; }
.ev-spinner { width: 36px; height: 36px; margin: 0 auto 14px; border-radius: 50%; border: 4px solid var(--grid-line); border-top-color: var(--accent); animation: ev-spin 0.9s linear infinite; }
@keyframes ev-spin { to { transform: rotate(360deg); } }

.ev-foot { padding: 22px 0 28px; color: var(--ink-faint); font-size: 0.85rem; border-top: 1px solid var(--grid-line); }
.ev-foot a { color: var(--ink-soft); }

@media print {
  .ev-top, .ev-foot, .ev-hint { display: none; }
  body.ev-body { background: #fff; }
  .ev-ticket, .ev-card { box-shadow: none; border: 1px solid #ccc; break-inside: avoid; }
}

/* A plain action on a message page (the newsletter's unsubscribe). */
.ev-btn { display: inline-block; margin-top: 8px; border: 0; border-radius: 12px; padding: 12px 22px; font: inherit; font-weight: 800; cursor: pointer; background: var(--accent); color: #fff; }
.ev-btn:hover { filter: brightness(0.95); }
