/* Events calendar. Shared tokens and components come from base.css. Prefix: ev- */

.ev-board [hidden], .ev-empty[hidden] { display: none !important; }

/* ------------------------------------------------------------------ hero */
.ev-hero { padding-bottom: clamp(40px, 5vw, 72px); }
.ev-hero__grid { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); gap: clamp(32px, 5vw, 96px); align-items: end; }
.ev-hero__text { display: grid; align-content: end; justify-items: start; }
.ev-hero .h1 { font-size: clamp(2.75rem, 1.2rem + 4.3vw, 6.25rem); }
.ev-hero__media { aspect-ratio: 4 / 5; max-height: min(640px, 76vh); width: 100%; justify-self: end; }
.ev-hero__media img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 40%; }

.ev-next {
  display: grid; grid-template-columns: 1fr auto; gap: 6px 24px; align-items: center;
  width: min(100%, 560px);
  margin-top: clamp(32px, 4vw, 56px); padding-top: 22px;
  border-top: 1.5px solid var(--ink);
}
.ev-next__label { grid-column: 1 / -1; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.ev-next__title { grid-column: 1; font-size: var(--step-2); font-weight: 800; font-stretch: 74%; text-transform: uppercase; line-height: 1; word-spacing: 0.14em; }
.ev-next__when { grid-column: 1; color: var(--ink-2); font-size: var(--step--1); }
.ev-next__go {
  grid-column: 2; grid-row: 2 / span 2;
  display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%;
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  transition: background 0.35s, color 0.35s, transform 0.5s var(--ease-out), box-shadow 0.35s;
}
.ev-next:hover .ev-next__go, .ev-next:focus-visible .ev-next__go { background: var(--accent); color: var(--accent-ink); box-shadow: none; transform: rotate(-45deg); }

@media (max-width: 899px) {
  .ev-hero__grid { grid-template-columns: 1fr; }
  .ev-hero__media { aspect-ratio: 4 / 3; max-height: none; order: -1; margin-top: 0; }
  .ev-hero { padding-top: calc(var(--header-h) + 24px); }
}
/* Short landscape screens (phones turned sideways): text and photo side by side so the heading is on the first screen. */
@media (max-width: 899px) and (max-height: 520px) {
  .ev-hero { padding-top: calc(var(--header-h) + 16px); }
  .ev-hero__grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: center; }
  .ev-hero__media { order: 0; aspect-ratio: 4 / 3; max-height: calc(100vh - var(--header-h) - 48px); }
  .ev-hero .h1 { font-size: clamp(2rem, 9vh, 3.25rem); }
  .ev-next { margin-top: 20px; padding-top: 14px; }
}

/* ------------------------------------------------------------------ toolbar */
.ev-board { padding-bottom: var(--section); }
.ev-toolbar { display: grid; gap: 20px; padding-block: 28px; margin-bottom: clamp(28px, 4vw, 56px); border-top: 1px solid var(--line); }
.ev-toolbar__row { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.ev-count { color: var(--muted); }
.ev-count span:first-child { color: var(--ink); font-weight: 600; }

/* Segmented switch: the thumb slides between List and Month. */
.ev-switch {
  --i: 0;
  position: relative; display: inline-grid; grid-template-columns: 1fr 1fr; padding: 4px; border-radius: var(--pill);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
  isolation: isolate;
}
.ev-switch::before {
  content: ""; position: absolute; z-index: -1; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px);
  border-radius: var(--pill); background: var(--ink);
  transform: translateX(calc(var(--i) * 100%));
  transition: transform 0.55s var(--ease-out);
}
.ev-switch .filter { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-width: 116px; box-shadow: none; background: transparent; }
.ev-switch .filter:hover { box-shadow: none; }
.ev-switch .filter[aria-pressed="true"] { background: transparent; color: var(--bg); }

.ev-filter { display: grid; grid-template-columns: 112px 1fr; align-items: center; gap: 12px 16px; }
.ev-filter__label { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.ev-n { margin-left: 6px; font-family: var(--font-mono); font-size: 0.75rem; opacity: 0.62; }

@media (max-width: 767px) {
  .ev-filter { grid-template-columns: 1fr; gap: 8px; }
  .ev-filter .filters { flex-wrap: nowrap; overflow-x: auto; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); }
  .ev-filter .filters::-webkit-scrollbar { display: none; }
  .ev-filter .filter { flex: none; scroll-snap-align: start; white-space: nowrap; }
  .ev-switch { flex: 1; min-width: 0; }
  .ev-switch .filter { min-width: 0; padding-inline: 14px; }
  .ev-toolbar__row { gap: 12px; }
  .ev-count { white-space: nowrap; }
}

/* ------------------------------------------------------------------ list view */
.ev-block + .ev-block { margin-top: clamp(64px, 9vw, 136px); }
.ev-block__title { font-size: var(--step-4); font-weight: 860; font-stretch: 68%; text-transform: uppercase; line-height: 0.9; margin-bottom: clamp(24px, 4vw, 48px); word-spacing: 0.14em; }
.ev-group + .ev-group { margin-top: clamp(32px, 4vw, 56px); }
.ev-group__title { color: var(--muted); text-transform: uppercase; letter-spacing: 0.1em; font-weight: 500; padding-bottom: 14px; }
.ev-none { color: var(--ink-2); padding-block: 8px 0; }

.ev-row__tbc { margin-top: 8px; font-family: var(--font-mono); font-size: 0.6875rem; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); line-height: 1.3; max-width: 16ch; }

.ev-row__tbc--past { color: var(--muted); }

/* Past events are quieter: smaller type, grouped by year, older years closed. */
.ev-block--past .ev-block__title { font-size: var(--step-3); color: var(--ink-2); }
.ev-row--past { grid-template-columns: minmax(84px, 120px) 1fr auto; padding-block: clamp(16px, 2vw, 22px); }
.ev-row--past .event-row__title { font-size: var(--step-1); font-stretch: 78%; color: var(--ink-2); }
.ev-row--past .date-block__day { font-size: 1.75rem; color: var(--ink-2); }
.ev-row--past .event-row__go { width: 40px; height: 40px; }
.ev-row--past .event-row__meta { margin-top: 6px; }

.ev-year { border-top: 1px solid var(--line); }
.ev-year .event-list { border-top: 0; }
.ev-year:last-child { border-bottom: 1px solid var(--line); }
.ev-year__summary {
  display: flex; align-items: baseline; gap: 18px; padding-block: 20px; cursor: pointer; list-style: none;
}
.ev-year__summary::-webkit-details-marker { display: none; }
.ev-year__name { font-size: var(--step-3); font-weight: 860; font-stretch: 68%; line-height: 1; }
.ev-year__n { color: var(--muted); }
.ev-year__chevron { margin-left: auto; align-self: center; display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; box-shadow: inset 0 0 0 1.5px var(--line-strong); transition: transform 0.5s var(--ease-out), background 0.3s, color 0.3s; }
.ev-year[open] .ev-year__chevron { transform: rotate(180deg); background: var(--ink); color: var(--bg); box-shadow: none; }
.ev-year__summary:hover .ev-year__chevron { box-shadow: inset 0 0 0 1.5px var(--ink); }
.ev-year[open] .ev-year__summary:hover .ev-year__chevron { box-shadow: none; }

@media (max-width: 767px) {
  .ev-row--past { grid-template-columns: 1fr auto; }
}

/* ------------------------------------------------------------------ month view */
.ev-month__bar { display: flex; align-items: center; justify-content: space-between; gap: 16px 24px; flex-wrap: wrap; margin-bottom: 24px; }
.ev-month__title { font-size: var(--step-4); font-weight: 860; font-stretch: 68%; text-transform: uppercase; line-height: 0.9; word-spacing: 0.14em; }
.ev-month__year { color: var(--muted); }
.ev-month__nav { display: flex; align-items: center; gap: 8px; }
.ev-month__nav .icon-btn { width: 48px; height: 48px; }
.ev-month__nav .icon-btn:disabled, .ev-month__nav .filter:disabled { opacity: 0.35; pointer-events: none; }

.ev-ribbon { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); gap: 4px; margin: 0 0 24px; padding: 0; list-style: none; }
.ev-ribbon__m {
  width: 100%; display: grid; justify-items: center; align-content: center; gap: 2px; height: 56px;
  border-radius: var(--pill); font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.06em; text-transform: uppercase;
  color: var(--muted); transition: background 0.3s, color 0.3s;
}
.ev-ribbon__m:hover { background: var(--bg-2); color: var(--ink); }
.ev-ribbon__m[aria-pressed="true"] { background: var(--ink); color: var(--bg); }
.ev-ribbon__n { min-height: 1em; font-weight: 600; font-size: 0.8125rem; color: var(--ink); }
.ev-ribbon__m[aria-pressed="true"] .ev-ribbon__n { color: var(--accent); }
/* The pressed pill turns light in dark mode, so the count uses the page background colour there (yellow on near-white is 1.3:1). */
:root[data-theme="dark"] .ev-ribbon__m[aria-pressed="true"] .ev-ribbon__n { color: var(--bg); }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .ev-ribbon__m[aria-pressed="true"] .ev-ribbon__n { color: var(--bg); }
}

/* Events with no confirmed day sit here, never on an invented date. */
.ev-tbc { border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: clamp(18px, 2.4vw, 28px); margin-bottom: 24px; display: grid; gap: 18px; }
.ev-tbc__head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 20px; }
.ev-tbc__title { font-family: var(--font-mono); font-size: 0.8125rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 600; }
.ev-tbc__note { color: var(--muted); font-size: var(--step--1); max-width: 62ch; }
.ev-tbc__list { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); gap: 12px; }
.ev-tbc__item {
  display: flex; align-items: center; gap: 14px; padding: 10px 14px 10px 10px; height: 100%;
  border-radius: var(--radius); background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  transition: box-shadow 0.3s, transform 0.4s var(--ease-out);
}
.ev-tbc__item:hover { box-shadow: inset 0 0 0 1.5px var(--ink); transform: translateY(-2px); }
.ev-tbc__thumb { flex: none; width: 76px; aspect-ratio: 4 / 3; }
.ev-tbc__text { display: grid; gap: 2px; line-height: 1.25; min-width: 0; }
.ev-tbc__text strong { font-weight: 700; font-stretch: 90%; }
.ev-tbc__text span { font-size: var(--step--1); color: var(--muted); }
.ev-tbc__item.is-past { opacity: 0.78; }

.ev-gridwrap { border-radius: var(--radius); overflow: hidden; box-shadow: inset 0 0 0 1px var(--line); }
.ev-grid { width: 100%; border-collapse: collapse; table-layout: fixed; }
.ev-grid th {
  padding: 12px 12px; text-align: left; font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 500;
  color: var(--muted); background: var(--bg-2); border-bottom: 1px solid var(--line);
}
.ev-day { height: 128px; vertical-align: top; padding: 10px; border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.ev-day:first-child { border-left: 0; }
tr:first-child > .ev-day { border-top: 0; }
.ev-day:nth-child(n + 6) { background: color-mix(in srgb, var(--bg-2) 50%, transparent); }
.ev-day.is-out { opacity: 0.4; }
.ev-day__num { display: inline-grid; place-items: center; min-width: 26px; height: 26px; padding: 0 4px; border-radius: 13px; font-family: var(--font-mono); font-size: 0.8125rem; font-variant-numeric: tabular-nums; }
.ev-day.is-today .ev-day__num { background: var(--accent); color: var(--accent-ink); font-weight: 700; }
.ev-chip {
  display: block; margin-top: 5px; height: 26px; padding: 0 10px; border-radius: var(--pill);
  background: var(--ink); color: var(--bg);
  font-size: 0.8125rem; font-weight: 620; font-stretch: 92%; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  transition: background 0.25s, color 0.25s;
}
.ev-chip:hover, .ev-chip:focus-visible { background: var(--accent); color: var(--accent-ink); }
.ev-chip.is-past { background: var(--bg-2); color: var(--ink-2); box-shadow: inset 0 0 0 1px var(--line-strong); }
.ev-chip.is-past:hover, .ev-chip.is-past:focus-visible { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.ev-none--month { margin: 0 0 14px; color: var(--muted); font-size: var(--step--1); }
.ev-grid.is-quiet .ev-day { height: 76px; }

/* Phones and tablets: the grid becomes an agenda of the days that have events (chips in a 7-column grid are too narrow below 1024px). */
.ev-agenda { display: none; }
@media (max-width: 1023px) {
  .ev-gridwrap { display: none; }
  .ev-agenda { display: block; }
  .ev-agenda__list { list-style: none; margin: 0; padding: 0; display: grid; }
  .ev-agenda__day { display: grid; grid-template-columns: 76px 1fr; gap: 12px; padding-block: 16px; border-top: 1px solid var(--line); }
  .ev-agenda__date { display: grid; justify-items: start; line-height: 1; }
  .ev-agenda__num { font-size: 2.25rem; font-weight: 860; font-stretch: 68%; }
  .ev-agenda__dow { margin-top: 6px; color: var(--muted); font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase; }
  .ev-agenda__day.is-today .ev-agenda__num { color: var(--accent-text); }
  .ev-agenda__events { display: grid; gap: 6px; align-content: start; }
  .ev-agenda .ev-chip { height: auto; line-height: 1.3; padding: 8px 14px; white-space: normal; margin-top: 0; }
}
@media (max-width: 767px) {
  .ev-ribbon { display: flex; overflow-x: auto; scrollbar-width: none; margin-inline: calc(var(--gutter) * -1); padding-inline: var(--gutter); gap: 2px; }
  .ev-ribbon::-webkit-scrollbar { display: none; }
  .ev-ribbon li { flex: none; }
  .ev-ribbon__m { width: 58px; }
  .ev-month__bar { align-items: flex-start; }
}

/* ------------------------------------------------------------------ nothing matches */
.ev-empty { display: grid; grid-template-columns: minmax(96px, 200px) 1fr; gap: clamp(20px, 4vw, 48px); align-items: center; border: 1.5px dashed var(--line-strong); border-radius: var(--radius); padding: clamp(16px, 3vw, 32px); }
.ev-empty__media { aspect-ratio: 3 / 4; }
.ev-empty__media img { width: 100%; height: 100%; object-fit: cover; }
.ev-empty__text { display: grid; gap: 14px; justify-items: start; }
@media (max-width: 767px) {
  .ev-empty { grid-template-columns: 1fr; }
  .ev-empty__media { aspect-ratio: 4 / 3; width: 100%; }
  .ev-empty__text { min-width: 0; }
}

/* ------------------------------------------------------------------ call to action */
.ev-cta .cta-band { display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: 28px clamp(24px, 6vw, 96px); }
.ev-cta .cta-band .h2 { grid-column: 1; max-width: 16ch; }
.ev-cta .cta-band p { grid-column: 1; margin-top: 0; }
.ev-cta .cta-band .btn { grid-column: 2; grid-row: 1 / span 2; align-self: end; margin-top: 0; }
@media (max-width: 767px) {
  .ev-cta .cta-band { grid-template-columns: 1fr; }
  .ev-cta .cta-band .btn { grid-column: 1; grid-row: auto; margin-top: 12px; justify-self: start; }
}

@media (prefers-reduced-motion: reduce) {
  .ev-switch::before { transition: none; }
}

/* ================================================================== event detail (prefix evd-) */
.evd-head { padding-bottom: clamp(24px, 3vw, 40px); }
.evd-title { max-width: 16ch; font-size: clamp(2.75rem, 1.4rem + 5vw, 6.75rem); }
.evd-head .page-hero__lead { max-width: 52ch; }

.evd-facts {
  display: grid; grid-template-columns: 1.5fr 1.3fr 1fr 1fr; gap: 24px clamp(20px, 3vw, 48px);
  margin: clamp(32px, 5vw, 64px) 0 0; padding-top: 22px; border-top: 1.5px solid var(--ink);
}
.evd-fact { min-width: 0; }
.evd-fact dt { font-family: var(--font-mono); font-size: 0.75rem; letter-spacing: 0.1em; text-transform: uppercase; color: var(--muted); }
.evd-fact dd { margin: 8px 0 0; font-size: var(--step-2); font-weight: 780; font-stretch: 80%; line-height: 1.1; }
.evd-directions { display: inline-flex; margin-top: 8px; font-family: var(--font-sans); font-size: 0.9375rem; font-weight: 650; font-stretch: 92%; color: var(--accent-text); text-decoration: underline; text-decoration-thickness: 1.5px; text-underline-offset: 3px; }
.evd-flag { display: block; margin-top: 10px; font-family: var(--font-mono); font-size: 0.75rem; font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; color: var(--accent-text); line-height: 1.3; }
@media (max-width: 899px) {
  .evd-facts { grid-template-columns: 1fr 1fr; }
  .evd-fact--when { grid-column: 1 / -1; }
}

.evd-photo { aspect-ratio: 21 / 9; margin-top: clamp(24px, 3vw, 40px); }
.evd-photo img { width: 100%; height: 100%; object-fit: cover; }
@media (max-width: 767px) { .evd-photo { aspect-ratio: 4 / 3; } }
/* Square and portrait photos: the whole frame at its own size, as wide as the text column. */
.evd-photo.evd-photo--sq { aspect-ratio: auto; max-width: 760px; }
.evd-photo--sq img { height: auto; }

.evd-main { display: grid; grid-template-columns: minmax(0, 7fr) minmax(0, 4fr); gap: clamp(32px, 6vw, 112px); align-items: start; padding-block: clamp(48px, 7vw, 104px); }
.evd-body { font-size: var(--step-1); }
.evd-body li { font-size: var(--step-0); }
.evd-aside { position: sticky; top: calc(var(--header-h) + 28px); display: grid; gap: 16px; justify-items: start; }
.evd-aside .btn { width: 100%; justify-content: space-between; }
@media (max-width: 899px) {
  .evd-main { grid-template-columns: 1fr; }
  .evd-aside { position: static; }
  .evd-aside .btn { width: auto; }
}

.evd-more { padding-top: 0; }
.evd-more__title { font-size: var(--step-3); font-weight: 860; font-stretch: 68%; text-transform: uppercase; line-height: 0.9; margin-bottom: clamp(20px, 3vw, 36px); word-spacing: 0.14em; }
