/* Public event page - event/details/?eventId= and ?t= (one page, event.js). Same look as the events directory's
 * "event-detail-modal" (events/index.html): tokens, buttons, chips, facts and the two-column details + notes layout. */
:root {
  --navy: #10224f; --text: #10224f; --muted: #5b6b8c; --bg: #f4f8fd; --card: #fff; --border: #e2e8f4; --hover: #eef3fc;
  --primary: #2f6fed; --primary-h: #2358c8; --on-primary: #fff; --danger: #c8323c; --ok: #1f8a4c; --warn: #a86b00;
  --shadow: 0 1px 2px rgba(16,34,79,.06), 0 6px 18px rgba(16,34,79,.06); --radius: 14px;
}
@media (prefers-color-scheme: dark) { :root {
  --text: #eef2fb; --muted: #a7b2cc; --bg: #0b1226; --card: #131b36; --border: #24304f; --hover: #1a2444;
  --primary: #3f74ee; --primary-h: #5b8cf5; --ok: #4cc38a; --warn: #e0a94a; --danger: #ef6b73;
  --shadow: 0 1px 2px rgba(0,0,0,.4), 0 6px 18px rgba(0,0,0,.3);
} }
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 14px/1.45 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: var(--primary); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { margin: 0; }
:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
.small { font-size: 12px; }

/* page frame */
.ev { max-width: 1040px; margin: 0 auto; padding: 16px 16px 64px; }
.ev-top { display: flex; align-items: center; gap: 12px; margin-bottom: 14px; }
.ev-top img { border-radius: 10px; display: block; }
.ev-top .ev-sub { margin: 0; color: var(--muted); font-size: 14px; flex: 1; min-width: 0; overflow-wrap: anywhere; }
.ev-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 14px; }
.ev-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 20px 12px; border-bottom: 1px solid var(--border); }
.ev-head h1 { font-size: 20px; line-height: 1.25; overflow-wrap: anywhere; }
.ev-body { padding: 18px 20px; }
.ev-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: flex-end; gap: 8px; padding: 12px 20px; border-top: 1px solid var(--border); }
.ev-foot .muted { margin-right: auto; }
.ev-section { padding: 18px 20px; }
.ev-section h2 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 10px; }

/* same building blocks as the modal */
.btn { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border: 1px solid var(--border); background: var(--card); border-radius: 9px; font-weight: 500; white-space: nowrap; text-decoration: none; color: var(--text); }
.btn:hover { background: var(--hover); text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn.primary { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.btn.primary:hover { background: var(--primary-h); }
.btn.ghost { border-color: transparent; background: transparent; }
.btn.sm { padding: 4px 9px; font-size: 12.5px; border-radius: 8px; }
.icon-btn { display: inline-grid; place-items: center; width: 32px; height: 32px; border: 0; background: transparent; border-radius: 8px; color: var(--muted); vertical-align: middle; }
.icon-btn:hover { background: var(--hover); color: var(--text); }
.icon-btn.xs { width: 24px; height: 24px; }
.chip { display: inline-flex; align-items: center; gap: 5px; padding: 4px 10px; border: 1px solid var(--border); background: var(--card); border-radius: 999px; font-size: 12.5px; }
.chip:hover { background: var(--hover); }
.chip.on { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; background: var(--hover); color: var(--muted); font-size: 11.5px; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; }
.dot { width: 10px; height: 10px; border-radius: 50%; flex: none; }
.avatar { display: inline-grid; place-items: center; border-radius: 50%; color: #fff; font-weight: 700; flex: none; letter-spacing: .02em; width: 48px; height: 48px; font-size: 18px; }
.stars { display: inline-flex; }
.stars button { border: 0; background: none; padding: 0 1px; color: var(--border); }
.stars button.on { color: #e8a300; }
.ico { width: 1em; height: 1em; display: inline-block; vertical-align: -.125em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ico.filled { fill: currentColor; }
.cols { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px; }
.cols h3 { font-size: 12px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); margin: 0 0 8px; }
.inline { display: flex; gap: 8px; align-items: center; }
.when { display: inline-flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.facts { display: grid; grid-template-columns: auto 1fr; gap: 6px 14px; margin: 0 0 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; overflow-wrap: anywhere; }
.hero-img { width: 100%; max-height: 260px; object-fit: cover; border-radius: 10px; margin-bottom: 12px; display: block; }
.field { display: grid; gap: 4px; margin-bottom: 12px; }
.field > label, .field > .lbl { font-size: 12.5px; font-weight: 600; }
.field .hint { font-size: 12px; color: var(--muted); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.input, textarea { width: 100%; padding: 7px 10px; border: 1px solid var(--border); border-radius: 9px; background: var(--card); }
textarea { resize: vertical; }
.callout { padding: 10px 12px; border-radius: 10px; background: var(--bg); border: 1px solid var(--border); margin-bottom: 12px; font-size: 13px; }
.about p { margin: 0 0 10px; }
.about ul { margin: 0 0 10px; padding-left: 20px; }

/* calendar menu */
.menu-wrap { position: relative; display: inline-block; }
.menu { position: absolute; z-index: 20; top: calc(100% + 4px); left: 0; min-width: 190px; background: var(--card); border: 1px solid var(--border); border-radius: 10px; box-shadow: var(--shadow); padding: 4px; display: grid; }
.menu.right { left: auto; right: 0; }
.menu a, .menu button { display: flex; align-items: center; gap: 8px; padding: 8px 10px; border: 0; background: none; border-radius: 7px; color: var(--text); text-align: left; font-size: 13px; }
.menu a:hover, .menu button:hover { background: var(--hover); text-decoration: none; }

/* shared-link extras (editor document) */
.banner { border-radius: 12px; padding: 10px 14px; margin-bottom: 14px; font-size: 14px; font-weight: 600; }
.banner.preview { background: rgba(168,107,0,.14); color: #8a5a00; }
.banner.has-action { display: flex; align-items: center; gap: 10px; }
.banner .banner-action { margin-left: auto; flex: none; display: flex; gap: 8px; }
@media (max-width: 520px) { .banner .banner-action { flex-direction: column; align-items: stretch; } .banner .banner-action .btn { justify-content: center; } }
.banner.private { background: rgba(47,111,237,.10); color: var(--primary); }
.dates { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.dates li { display: flex; gap: 10px; justify-content: space-between; flex-wrap: wrap; padding: 8px 10px; border-radius: 10px; background: var(--bg); }
.dates li.cancelled { text-decoration: line-through; opacity: .6; }
.tickets { display: grid; gap: 8px; }
.ticket { display: flex; justify-content: space-between; gap: 10px; padding: 10px 12px; border: 1px solid var(--border); border-radius: 12px; }
.ticket small, .person small, .links small { display: block; color: var(--muted); }
.ticket-end { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; text-align: right; }
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
.gallery img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: 10px; display: block; }
.people { display: flex; flex-wrap: wrap; gap: 10px; }
.person { border: 1px solid var(--border); border-radius: 12px; padding: 8px 12px; font-size: 14px; overflow-wrap: anywhere; }
.links { display: grid; gap: 6px; padding: 0; margin: 0; list-style: none; }
.links a { font-weight: 600; overflow-wrap: anywhere; }

/* states */
.center { text-align: center; padding: 36px 20px; }
.center h1 { font-size: 22px; margin: 0 0 8px; }
.center p { color: var(--muted); margin: 0 0 16px; }
.pw { display: flex; gap: 8px; justify-content: center; flex-wrap: wrap; }
.pw input { font: 700 24px/1 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; letter-spacing: .4em; text-transform: uppercase; text-align: center; width: 8.5em; padding: 10px 8px 10px 16px; border: 1.5px solid var(--border); border-radius: 12px; background: var(--card); color: var(--text); }
.err { color: var(--danger); font-weight: 600; margin-top: 12px; min-height: 1.2em; }
.skel { height: 320px; border-radius: var(--radius); background: linear-gradient(90deg, var(--border), var(--card), var(--border)); background-size: 200% 100%; animation: skel 1.2s infinite linear; }
@keyframes skel { to { background-position: -200% 0; } }
.foot { text-align: center; color: var(--muted); font-size: 13px; margin-top: 24px; }
.toasts { position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 99; display: grid; gap: 8px; }
.toast { padding: 10px 16px; border-radius: 10px; background: var(--navy); color: #fff; box-shadow: 0 8px 24px rgba(0,0,0,.3); }
.toast.error { background: var(--danger); }
@media (prefers-color-scheme: dark) { .banner.preview { color: #f0b54a; } }
@media (max-width: 860px) { .cols { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 520px) { #notes-form { display: none; } .row2 { grid-template-columns: 1fr; } .facts { grid-template-columns: 1fr; } .facts dt { margin-top: 6px; } .ev-body, .ev-section { padding: 16px; } }
