/* Events pages v2 - docs/design/pages-h/W1_Events.html + W1_Events_m.html (list) and W1_Event.html + W1_Event_m.html
   (single event), visual system H. Depends on tokens.css + components.css (+ theme-velvet.css). Colours are tokens only.
   Phones (<= 900px): filters become a panel opened through #cg-evfilters (:target), rows lose the photo column. */

/* ---- Category tab bar (city pages) - the same bar as the category pages ------------------------------- */
.cg-cats { background: var(--ground); border-bottom: 1px solid var(--border); }
.cg-cats__in { display: flex; align-items: center; gap: 16px; }
.cg-cats__list { display: flex; gap: 4px; min-width: 0; overflow-x: auto; scrollbar-width: none; }
.cg-cats__list::-webkit-scrollbar { display: none; }
.cg-body a.cg-cat { flex: none; display: flex; flex-direction: column; align-items: center; gap: 5px; min-width: 76px; padding: 12px 14px 10px;
  border-bottom: 3px solid transparent; color: var(--ink-caption); font-size: 14px; font-weight: var(--w-strong); }
.cg-body a.cg-cat:hover { color: var(--ink); border-bottom-color: var(--border); }
.cg-body a.cg-cat[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.cg-body a.cg-evpost { flex: none; margin-left: auto; display: inline-flex; align-items: center; gap: 8px; height: 44px; padding: 0 18px; border-radius: var(--radius-pill);
  background: var(--surface-soft); color: var(--ink); font-size: 15px; font-weight: var(--w-strong); white-space: nowrap; }
.cg-body a.cg-evpost:hover { background: var(--surface-warm-strong); color: var(--ink); }

/* ---- Page grid: filters (3/12) | list (9/12) ---------------------------------------------------------- */
.cg-evpage { display: flex; flex-direction: column; gap: 22px; padding-block: 18px 64px; }
.cg-evgrid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 32px; align-items: start; }

/* ---- Filters -------------------------------------------------------------------------------------------- */
.cg-evfilters { grid-column: span 3; position: sticky; top: 20px; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.cg-evfilters__head { display: none; }
.cg-evfgroup { display: flex; flex-direction: column; gap: 8px; margin: 0; min-width: 0; }
.cg-evflabel { margin: 0; font-size: 15px; font-weight: var(--w-strong); color: var(--ink); }
.cg-evwhen { display: flex; flex-direction: column; gap: 2px; }
.cg-body .cg-evwhen a { display: flex; justify-content: space-between; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px; border-radius: var(--radius-pill); color: var(--ink); font-size: 15px; }
.cg-evwhen a span { color: var(--ink-caption); font-size: 14px; font-weight: var(--w-strong); }
.cg-body .cg-evwhen a:hover { background: var(--surface-soft); color: var(--ink); }
.cg-body .cg-evwhen a[aria-current] { background: var(--surface-warm-strong); font-weight: var(--w-strong); }
.cg-evwhen a[aria-current] span { color: var(--ink); }
.cg-evcheck { display: flex; align-items: center; gap: 12px; min-height: 34px; font-size: 15px; color: var(--ink); cursor: pointer; }
.cg-evcheck input { flex: none; width: 18px; height: 18px; margin: 0; accent-color: var(--accent); }
.cg-evcheck span { margin-left: auto; color: var(--ink-caption); font-size: 13px; font-weight: var(--w-strong); }
.cg-evapply { height: 44px; font-size: 15px; margin-top: 6px; }
body.cg-js .cg-evapply { display: none; }

/* ---- List head ---------------------------------------------------------------------------------------- */
.cg-evlist { grid-column: span 9; display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cg-evhead { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 12px; }
.cg-evpage h1 { font: italic var(--w-regular) 50px/1 var(--font-display); letter-spacing: -.015em; overflow-wrap: anywhere; min-width: 0; }
.cg-evcount { font: var(--w-strong) 18px/1 var(--font-sans); color: var(--ink-caption); white-space: nowrap; }
.cg-evlede { margin: 0; font-size: 16px; line-height: 1.6; color: var(--ink-muted); max-width: 760px; }
.cg-evbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; border-bottom: 1px solid var(--border); }
.cg-evtabs { display: flex; gap: 4px; }
.cg-body .cg-evtabs a { display: inline-flex; align-items: center; min-height: 48px; padding: 0 16px; border-bottom: 3px solid transparent; margin-bottom: -1px; color: var(--ink-caption); font-size: 16px; font-weight: var(--w-strong); }
.cg-body .cg-evtabs a:hover { color: var(--ink); border-bottom-color: var(--border); }
.cg-body .cg-evtabs a[aria-current] { color: var(--ink); border-bottom-color: var(--accent); }
.cg-body .cg-evfilterbtn { display: none; height: 40px; padding: 0 16px; font-size: 14px; margin-bottom: 4px; }
.cg-evshowing { margin: 0; font-size: 14px; color: var(--ink-caption); }
.cg-body .cg-evshowing a { font-weight: var(--w-strong); }

.cg-evgroup { margin: 14px 0 -2px; display: flex; align-items: baseline; flex-wrap: wrap; gap: 2px 14px; }
.cg-evgroup__t { font: italic var(--w-regular) 32px/1 var(--font-display); color: var(--ink); }
[data-theme="velvet"] .cg-evgroup__t, [data-theme="velvet"] .cg-evpage h1, [data-theme="velvet"] .cg-evcity h2 { color: var(--heading); }
.cg-evgroup__m { font-size: 15px; font-weight: var(--w-strong); color: var(--ink-caption); }

/* ---- Rows ----------------------------------------------------------------------------------------------- */
.cg-evrows { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 12px; }
.cg-ev { position: relative; display: flex; gap: 18px; align-items: stretch; padding: 14px; border-radius: var(--radius-l); background: var(--surface); color: var(--ink); transition: box-shadow .15s; }
.cg-ev:hover { box-shadow: var(--shadow-card); }
.cg-ev:hover .cg-ev__t span { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 3px; }
.cg-dblock { flex: none; width: 72px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; border-radius: var(--radius-m); background: var(--surface-warm); padding: 8px 0; }
.cg-dblock__w { font-size: 12px; font-weight: var(--w-strong); letter-spacing: .06em; color: var(--ink-muted); line-height: 1; }
.cg-dblock__d { font: italic var(--w-regular) 34px/1 var(--font-display); color: var(--ink); }
[data-theme="velvet"] .cg-dblock__d { color: var(--heading); }
.cg-dblock__m { font-size: 12px; font-weight: var(--w-strong); letter-spacing: .06em; color: var(--ink); line-height: 1; }
.cg-ev__ph { flex: none; width: 150px; border-radius: var(--radius-s); overflow: hidden; background: var(--surface-warm); }
.cg-ev__ph img { display: block; width: 100%; height: 100%; min-height: 104px; object-fit: cover; }
.cg-ev__body { flex: 1; display: flex; flex-direction: column; gap: 5px; min-width: 0; justify-content: center; }
.cg-ev__trow { display: flex; align-items: center; gap: 6px 8px; flex-wrap: wrap; }
.cg-ev__t { margin: 0; font-size: 18px; font-weight: var(--w-strong); line-height: 1.3; overflow-wrap: anywhere; }
.cg-body a.cg-ev__link { color: var(--ink); }
/* The whole row is the click target (one link per row, no nested anchors). */
.cg-body a.cg-ev__link::after { content: ""; position: absolute; inset: 0; border-radius: var(--radius-l); }
.cg-ev__tag { display: inline-flex; align-items: center; padding: 2px 10px; border-radius: var(--radius-pill); background: var(--surface-warm); color: var(--ink-muted); font-size: 13px; font-weight: var(--w-strong); white-space: nowrap; }
.cg-ev__tag--now { background: var(--live-tint); color: var(--on-live); }
.cg-ev__tag--past { background: var(--surface-soft); color: var(--ink-caption); }
.cg-ev__where { margin: 0; font-size: 14px; color: var(--ink-caption); overflow-wrap: anywhere; }
.cg-ev__where time { color: var(--ink-muted); font-weight: var(--w-strong); }
.cg-body a.cg-ev__city { position: relative; z-index: 1; color: var(--link); font-weight: var(--w-strong); }
.cg-ev__desc { margin: 0; font-size: 15px; line-height: 1.45; color: var(--ink-muted); overflow-wrap: anywhere; }
.cg-ev__go { flex: none; align-self: center; font-size: 28px; line-height: 1; color: var(--ink-caption); padding-right: 4px; }
.cg-ev--past { background: var(--surface); }
.cg-ev--past .cg-dblock { background: var(--surface-soft); }
.cg-ev--past .cg-ev__t span, .cg-ev--past .cg-dblock__d { color: var(--ink-muted); }
.cg-ev--past .cg-ev__ph img { filter: grayscale(.6); opacity: .85; }
.cg-ev-ad { list-style: none; }
.cg-ev-ad .cg-sponsored { margin: 0; }

/* ---- Empty state ---------------------------------------------------------------------------------------- */
.cg-evempty { display: flex; flex-direction: column; align-items: flex-start; gap: 12px; padding: 24px; border-radius: var(--radius-l); background: var(--surface); }
.cg-evempty p { margin: 0; font-size: 16px; line-height: 1.5; color: var(--ink-muted); }
.cg-evempty p strong { color: var(--ink); font-size: 18px; }
.cg-evempty__btns { display: flex; flex-wrap: wrap; gap: 8px; }
.cg-evempty__alt { margin-top: 8px !important; }
.cg-evcities { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 20px; font-size: 15px; }
.cg-evcities a { display: inline-flex; align-items: center; min-height: 44px; font-weight: var(--w-strong); }
.cg-evcities .cg-num { color: var(--ink-caption); font-weight: var(--w-regular); margin-left: 4px; }

/* ---- Sections shared by the single event page (event rows of "More events") ----------------------------- */
.cg-events { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.cg-event, .cg-body a.cg-event { display: flex; align-items: center; gap: 16px; padding: 12px 14px; border-radius: var(--radius-l); background: var(--surface); color: var(--ink); }
.cg-body a.cg-event:hover { box-shadow: var(--shadow-card); color: var(--ink); }
.cg-event__name { display: block; font-size: 16px; font-weight: var(--w-strong); overflow-wrap: anywhere; }
.cg-event__meta { display: block; font-size: 14px; color: var(--ink-caption); }
.cg-events-s { display: flex; flex-direction: column; gap: 14px; }
.cg-events-s .cg-dblock { width: 64px; }

/* ---- Single event --------------------------------------------------------------------------------------- */
.cg-evhero { display: grid; grid-template-columns: minmax(0, 1fr); gap: 18px; align-items: stretch; }
.cg-evhero--art { grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); }
.cg-evhero__copy { display: flex; flex-direction: column; gap: 16px; padding: 28px 28px 24px; border-radius: var(--radius-xxl); background: var(--surface); min-width: 0; }
.cg-evhero__art { border-radius: var(--radius-xxl); overflow: hidden; background: var(--surface-warm); min-height: 260px; }
.cg-evhero__art img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cg-evtags { display: flex; flex-wrap: wrap; gap: 8px; }
.cg-evdetail h1 { font-size: 56px; line-height: .98; }
.cg-evnote { display: flex; align-items: center; justify-content: space-between; gap: 12px 16px; flex-wrap: wrap; padding: 14px 16px 14px 20px; border-radius: var(--radius-l); background: var(--warn-tint); color: var(--on-warn); font-size: 15px; }
.cg-evnote b { font-weight: var(--w-strong); }
.cg-evfacts { margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px 24px; }
.cg-evfacts > div { display: flex; align-items: center; gap: 14px; min-width: 0; }
.cg-evfacts__ic { flex: none; width: 48px; height: 48px; border-radius: var(--radius-m); background: var(--surface-warm); color: var(--ink); display: inline-flex; align-items: center; justify-content: center; }
.cg-evfacts__tx { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.cg-evfacts dt { font-size: 13px; font-weight: var(--w-strong); color: var(--ink-caption); }
.cg-evfacts dd { margin: 0; font-size: 16px; color: var(--ink); overflow-wrap: anywhere; }
.cg-body .cg-evfacts__map { display: inline-block; margin-left: 8px; font-size: 14px; font-weight: var(--w-strong); white-space: nowrap; }
.cg-evactions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.cg-evfine { margin: 0; font-size: 13px; line-height: 1.5; color: var(--ink-caption); }
.cg-evcols { display: grid; grid-template-columns: minmax(0, 1fr) 340px; gap: 32px; align-items: start; }
.cg-evmain { display: flex; flex-direction: column; gap: 36px; min-width: 0; }
.cg-evsec { display: flex; flex-direction: column; gap: 14px; }
.cg-evprose { margin: 0; font-size: 17px; line-height: 1.6; color: var(--ink-muted); white-space: pre-line; overflow-wrap: anywhere; max-width: 760px; }
.cg-evprose--quiet { color: var(--ink-caption); font-size: 16px; }
.cg-evnear { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.cg-evnear li { display: flex; flex-direction: column; gap: 2px; padding: 14px 18px; border-radius: var(--radius-l); background: var(--surface); min-width: 0; }
.cg-evnear strong { font-size: 16px; overflow-wrap: anywhere; }
.cg-evnear span { font-size: 14px; color: var(--ink-caption); overflow-wrap: anywhere; }
.cg-evside { display: flex; flex-direction: column; gap: 18px; position: sticky; top: 20px; min-width: 0; }
.cg-evcity { display: flex; flex-direction: column; gap: 10px; padding: 20px; border-radius: var(--radius-l); background: var(--surface-warm); }
.cg-evcity h2 { font: italic var(--w-regular) 30px/1.05 var(--font-display); }
.cg-evcity .cg-btn { height: 46px; font-size: 15px; background: var(--surface); }
.cg-evcity .cg-btn:hover { background: var(--surface-warm-strong); }

/* ---- Phones --------------------------------------------------------------------------------------------- */
@media (max-width: 900px) {
  .cg-cats__in { gap: 8px; }
  .cg-body a.cg-evpost { display: none; }
  .cg-evpage { padding-block: 14px 48px; gap: 16px; }
  .cg-evgrid { display: flex; flex-direction: column; gap: 16px; }
  .cg-evlist { grid-column: auto; width: 100%; }
  .cg-evpage h1 { font-size: 38px; }
  .cg-evcount { font-size: 16px; }
  .cg-evlede { font-size: 15px; }
  .cg-body .cg-evfilterbtn { display: inline-flex; }
  .cg-evgroup__t { font-size: 28px; }

  /* Filters: hidden until #cg-evfilters is the target (the "Filters" link), then a panel above the list. */
  .cg-evfilters { display: none; position: fixed; inset: 0; z-index: 2000; overflow-y: auto; padding: 20px 16px calc(32px + env(safe-area-inset-bottom, 0px));
    background: var(--ground); gap: 20px; grid-column: auto; top: 0; }
  .cg-evfilters:target { display: flex; }
  .cg-evfilters__head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
  .cg-evfilters__head h2 { font: italic var(--w-regular) 32px/1 var(--font-display); }
  [data-theme="velvet"] .cg-evfilters__head h2 { color: var(--heading); }
  .cg-body a.cg-evfilters__done { display: inline-flex; align-items: center; min-height: 44px; padding: 0 20px; border-radius: var(--radius-pill); background: var(--accent); color: var(--on-accent); font-weight: var(--w-strong); }

  .cg-ev { gap: 12px; padding: 12px; align-items: flex-start; }
  .cg-dblock { width: 58px; padding: 7px 0; }
  .cg-dblock__d { font-size: 28px; }
  .cg-ev__ph { display: none; }
  .cg-ev__t { font-size: 17px; }
  .cg-ev__go { display: none; }
  .cg-ev__desc { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

  .cg-evhero--art { grid-template-columns: minmax(0, 1fr); }
  .cg-evhero__art { order: -1; min-height: 0; aspect-ratio: 16 / 10; border-radius: var(--radius-xl); }
  .cg-evhero__copy { padding: 20px 18px; border-radius: var(--radius-xl); gap: 14px; }
  .cg-evdetail h1 { font-size: 42px; }
  .cg-evfacts { grid-template-columns: minmax(0, 1fr); gap: 12px; }
  .cg-evcols { display: flex; flex-direction: column; gap: 28px; }
  .cg-evside { position: static; }
  .cg-evnear { grid-template-columns: minmax(0, 1fr); }
  .cg-evactions .cg-btn--primary, .cg-evactions .cg-btn--soft { flex: 1 1 auto; }
}

/* ---- Phones: bottom tab bar (same as City/Category) ------------------------------------------------- */
.cg-tabs { display: none; }
@media (max-width: 900px) {
  .cg-tabs { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); position: fixed; left: 0; right: 0; bottom: 0; z-index: 1000;
    padding: 6px 8px calc(10px + env(safe-area-inset-bottom, 0px)); background: var(--surface); border-radius: var(--radius-l) var(--radius-l) 0 0; box-shadow: var(--shadow-sheet); }
  .cg-body .cg-tabs a { position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; min-height: 54px;
    color: var(--ink-caption); font-size: 13px; font-weight: var(--w-strong); }
  .cg-body .cg-tabs a[aria-current] { color: var(--accent); }
  body.cg-page-events .cg-footer .cg-wrap, body.cg-page-event .cg-footer .cg-wrap { padding-bottom: calc(24px + 76px + env(safe-area-inset-bottom, 0px)); }
}
