/* ------------------------------------------------------------------
   the VISUALIST — typographic grid
   Two registers: architectural logotype, editorial content stream.
   ------------------------------------------------------------------ */

:root {
  --ink: #f2f2f2;
  --ink-muted: #8a8a8a;
  --paper: #1c1c1c;
  --hairline: 1px solid #3a3a3a;
  /* white content area */
  --content-paper: #ffffff;
  --content-ink: #1c1c1c;
  --content-ink-muted: #767676;
  --hairline-light: 1px solid #e3e3e3;
  --gutter: clamp(1rem, 2vw, 2rem);
  --edge: 0.75vw; /* tight margin: header top/left/right and main left/right */
  --measure: 56rem; /* one content-column width for every page */
  --band-gap: clamp(2rem, 4vw, 3.5rem); /* space between the nav band and content */
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

/* author display rules (grid/flex) must never resurrect [hidden] elements */
[hidden] {
  display: none !important;
}

/* during boot, override [hidden] to display only the view being booted */
html[data-boot-view="today"] #view-today,
html[data-boot-view="this-week"] #view-this-week,
html[data-boot-view="next-week"] #view-next-week,
html[data-boot-view="archive"] #view-archive {
  display: block !important;
}

body {
  /* subtle diagonal texture over near-black; viewport-fixed so the lines run
     continuously through every band that carries the same texture */
  background: repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 5px
    ),
    var(--paper);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ---- Header / logotype ------------------------------------------- */

.site-header {
  padding: var(--edge) var(--edge) clamp(1rem, 2vw, 2rem);
  text-align: center; /* the white content area below is the divider */
  cursor: pointer; /* the whole strip is a home link via .header-home-hit */
  /* scrolls off naturally, then JS reveals it over the content on scroll-up;
     carries its own copy of the body texture so it can overlay the white area */
  position: sticky;
  z-index: 30;
  background: repeating-linear-gradient(
      45deg,
      rgba(255, 255, 255, 0.025) 0px,
      rgba(255, 255, 255, 0.025) 1px,
      transparent 1px,
      transparent 5px
    ),
    var(--paper);
  background-attachment: fixed;
}

.tagline {
  margin: auto 0; /* vertically centered between logotype and bottom */
  /* scales gently with the viewport so it keeps proportion with the logotype */
  font-size: clamp(0.8rem, 1.1vw, 1.05rem);
  font-style: italic;
  letter-spacing: 0.08em;
  line-height: 1.7;
  min-height: 1.7em; /* reserve the line box so late text can't shift the header */
  color: #ffffff; /* matches the logotype */
  will-change: opacity;
  pointer-events: none; /* allow clicks to pass through to the home link behind it */
}

/* invisible full-bleed home link behind the masthead: catches clicks in the
   letter gaps and, once the header shrinks, in the strip around the scaled
   logotype (the logotype's own hit area scales down with its transform) */
.header-home-hit {
  position: absolute;
  inset: 0;
  z-index: 0;
}

.logotype {
  position: relative; /* stays above .header-home-hit for text selection */
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  color: #ffffff;
  text-decoration: none;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6);
  transform-origin: center center; /* accordion math assumes a centered scale */
  will-change: transform;
  /* fenwick = the as-is site's masthead face (Adobe Fonts kit orw0adz);
     its lowercase t carries the angled upward-right top stroke */
  font-family: fenwick, "Helvetica Neue", Helvetica, Arial, sans-serif;
}

.logotype-the {
  font-size: clamp(1.25rem, 5vw, 6rem);
  font-weight: 700;
  text-transform: lowercase;
  letter-spacing: 0.3em; /* original theme tracks near 0.1em; split the difference at display size */
  margin-right: -0.3em; /* cancel trailing tracking to keep it centered */
  line-height: 1;
  white-space: nowrap;
}

.logotype-name {
  /* Fenwick Bold glyph widths + 0.06em tracking ≈ 6.7 × font-size.
     ~98vw of usable width / 6.7 ≈ 14.5vw — fills the line, never wraps or clips. */
  font-size: clamp(2.5rem, 14.25vw, 17rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  margin-right: -0.06em;
  line-height: 1.05;
  white-space: nowrap;
}

/* ---- Navigation ---------------------------------------------------- */

.nav-block {
  max-width: var(--measure);
  margin-inline: auto;
}

.site-nav {
  display: flex;
  /* the row must fit a 320px phone on one line: the gap gives way first */
  gap: clamp(0.7rem, 3.5vw, 2rem);
  align-items: baseline; /* tab and button text share one baseline */
}

.site-nav a {
  color: var(--content-ink-muted);
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  white-space: nowrap; /* labels never two-line inside the 48px band */
  padding-bottom: 0.25em;
  border-bottom: 2px solid transparent; /* reserve space so .active doesn't shift the row */
}

/* tighter type before the row would overflow; the band keeps its 48px */
@media (max-width: 480px) {
  .site-nav a {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
  }
  .site-nav .nav-button {
    padding: 0.4em 0.85em;
  }
}

@media (max-width: 374px) {
  .site-nav a {
    font-size: 0.7rem;
    letter-spacing: 0.06em;
  }
}

/* the admin nav runs seven items deep; let it scroll rather than wrap */
[data-page="admin"] .site-nav {
  overflow-x: auto;
  max-width: 100%;
}

.site-nav a:hover {
  color: var(--content-ink);
}

.site-nav a.active {
  color: var(--content-ink);
  border-bottom-color: var(--content-ink);
}

.site-nav .nav-button {
  background: var(--content-ink);
  color: var(--content-paper);
  padding: 0.4em 1.2em;
  border-radius: 2px;
  border-bottom-color: transparent;
}

.site-nav .nav-button:hover {
  background: #3a3a3a;
  color: var(--content-paper);
}

.site-nav a.nav-button.active {
  color: var(--content-paper);
  border-bottom-color: transparent;
}

/* all-events controls: full-width utility bar that sticks beneath the pinned
   nav band (height measured by JS; 2px overlap hides rounding gaps) */
.controls-band {
  position: sticky;
  top: var(--nav-stack-bottom, calc(46px + var(--nav-band-h, 48px) - 2px));
  z-index: 19;
  /* sits flush beneath the tab bar (cancels the band gap), full bleed */
  margin: calc(-1 * var(--band-gap)) calc(-1 * var(--edge)) 1rem;
  padding: 0 var(--edge);
  height: 48px;
  display: flex;
  align-items: center;
  background: var(--content-paper);
  border-top: var(--hairline-light);
  border-bottom: var(--hairline-light);
}

.archive-controls {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  max-width: var(--measure);
  margin-inline: auto;
  height: 100%;
}

/* custom tag-picker trigger: tag-shaped icon + selection count */
.tag-invoke {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0 0.95em;
  border: 0;
  border-left: 1px solid transparent;
  border-right: 1px solid transparent;
  border-radius: 0;
  background: transparent;
  color: var(--content-ink-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.9rem;
  height: 100%;
}

.tag-invoke:hover,
.tag-invoke[aria-expanded="true"],
.tag-invoke.has-tags {
  color: var(--content-ink);
}

.tag-invoke[aria-expanded="true"] {
  /* a grey tab: open at the bottom to merge with panel */
  background: #eeeeee;
  /* above the absolutely-positioned panel (z 19) so the bridge below
     actually paints over its top border */
  z-index: 20;
}

.tag-invoke[aria-expanded="true"]::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  /* two rows sit between tab and panel — the band's bottom hairline and
     the panel's top border; bridge both so tab and panel read as one */
  bottom: -2px;
  height: 2px;
  background: #eeeeee;
}

.tag-invoke-icon {
  width: 1.05em;
  height: 1.05em;
}

.tag-invoke:last-child {
  margin-right: -0.95em;
}

@media (max-width: 600px) {
  .tag-invoke {
    width: auto;
    padding: 0 12px;
    justify-content: flex-end;
  }
  .tag-invoke:last-child {
    margin-right: -12px;
  }
  .tag-invoke > span {
    display: none;
  }
}

.tag-invoke-count {
  background: var(--content-ink);
  color: var(--content-paper);
  border-radius: 999px;
  padding: 0.1em 0.55em;
  font-size: 0.72em;
  font-style: normal;
  font-weight: 700;
}

/* selected tags echoed above the results */
.active-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  max-width: var(--measure);
  margin: 0 auto 0.85rem;
}

.active-tag-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  border: 0;
  border-radius: 2px;
  padding: 0.45em 0.65em;
  background: var(--content-ink);
  color: var(--content-paper);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.active-tag-pill span {
  font-size: 1.15em;
  line-height: 1;
  opacity: 0.7;
}

.active-tag-pill:hover span {
  opacity: 1;
}

.tag-clear-all {
  border: 0;
  background: none;
  padding: 0;
  margin-left: 0.35rem;
  color: var(--content-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* panels hang off the bottom of the sticky utility bar, full bleed, so
   they stay in view (and usable) however deep the page is scrolled */
.filter-panel {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  z-index: 19;
  display: grid;
  gap: 1rem;
  margin: 0;
  padding: 1rem var(--edge);
  border: 0;
  border-top: 1px solid #d4d4d4;
  border-bottom: var(--hairline-light);
  background: #eeeeee;
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.14);
}

.date-presets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.preset-chip,
.tag-chip {
  border: 1px solid #d4d4d4;
  border-radius: 2px;
  padding: 0.45em 0.8em;
  background: none;
  color: var(--content-ink-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.1;
  text-transform: uppercase;
  white-space: nowrap;
}

.preset-chip:hover,
.tag-chip:hover {
  border-color: var(--content-ink);
  color: var(--content-ink);
}

.tag-chip.active {
  background: var(--content-ink);
  border-color: var(--content-ink);
  color: var(--content-paper);
}

.tag-chip span {
  opacity: 0.6;
  margin-left: 0.3em;
}

.date-range-inputs {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  gap: 0.75rem;
}

.date-range-field {
  display: grid;
  gap: 0.35rem;
  color: var(--content-ink-muted);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.date-range-field .date-input {
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  padding: 0.5em 0.7em;
}

.date-range-sep {
  padding-bottom: 0.6em;
  color: var(--content-ink-muted);
}

.tag-panel-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.tag-panel-filter {
  flex: 1;
  min-width: 0;
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  padding: 0.55em 0.8em;
  font: inherit;
  font-size: 0.9rem;
  color: var(--content-ink);
  outline: none;
}

.tag-panel-filter:focus {
  border-color: var(--content-ink);
}

.tag-clear {
  border: 0;
  background: none;
  padding: 0;
  color: var(--content-ink);
  cursor: pointer;
  font: inherit;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.tag-panel-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  max-height: 16rem;
  overflow-y: auto;
}

.site-search {
  position: relative; /* anchors the tag type-ahead panel */
  display: flex;
  align-items: center;
  gap: 0.6em;
  flex: 1;
  padding: 0 0.95em 0 0;
  border: none;
  background: transparent;
  color: var(--content-ink-muted);
}

/* tag type-ahead ----------------------------------------------------- */

.search-suggest {
  position: absolute;
  top: calc(100% + 0.35rem);
  left: -1px;
  right: -1px;
  z-index: 25;
  background: var(--content-paper);
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  box-shadow: 0 12px 28px rgba(0, 0, 0, 0.1);
  max-height: 19rem;
  overflow-y: auto;
}

.search-suggest-label {
  display: block;
  padding: 0.55rem 0.95rem 0.3rem;
  color: var(--content-ink-muted);
  font-size: 0.6rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.search-suggest-item {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  padding: 0.55rem 0.95rem;
  background: none;
  border: 0;
  font: inherit;
  font-size: 0.9rem;
  color: var(--content-ink);
  text-align: left;
  cursor: pointer;
}

.search-suggest-item.active,
.search-suggest-item:hover {
  background: #f4f4f4;
}

.search-suggest-item mark {
  background: none;
  color: inherit;
  font-weight: 700;
}

.search-suggest-count {
  flex: none;
  color: var(--content-ink-muted);
  font-size: 0.66rem;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.site-search:focus-within {
  color: var(--content-ink);
}

.site-search svg {
  width: 1em;
  height: 1em;
  flex-shrink: 0;
}

.site-search input {
  background: transparent;
  border: none;
  outline: none;
  color: var(--content-ink);
  font: inherit;
  font-size: 0.9rem;
  flex: 1;
}

.site-search input::placeholder {
  color: var(--content-ink-muted);
}

.date-input {
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 0.9rem;
  color: var(--content-ink);
}

/* ---- Content ------------------------------------------------------ */

.site-main {
  background: var(--content-paper);
  color: var(--content-ink);
  padding: 0 var(--edge) clamp(2rem, 4vw, 4rem);
  /* every view, however short, leaves room to reach full header collapse */
  min-height: 100vh;
}

[data-visualist-nav] {
  display: contents;
}

.tab-band,
.nav-band {
  /* the header's diagonal texture in the light register; same angle and
     viewport-fixed origin as the dark register so lines carry across seams */
  background: repeating-linear-gradient(
      45deg,
      rgba(0, 0, 0, 0.045) 0px,
      rgba(0, 0, 0, 0.045) 1px,
      transparent 1px,
      transparent 5px
    ),
    #efefef;
  background-attachment: fixed;
  margin: 0 calc(-1 * var(--edge)); /* full-bleed across the white area */
  text-align: center;
}

/* the label band stays in flow: it scrolls up behind the collapsed dark row */
.tab-band {
  padding: clamp(1.25rem, 2.5vw, 2rem) var(--edge) 0.5rem;
}

/* the tabs row alone pins beneath the collapsed dark row (JS COMPACT) */
.nav-band {
  height: 48px;
  padding: 0 var(--edge);
  margin-bottom: var(--band-gap);
  position: sticky;
  /* 2px shy of the 48px dark row: its fractional height rounds into the
     sticky offset, which can leave a hairline gap. The dark row sits on a
     higher z-index, so the overlap is hidden. */
  top: 46px;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: center;
}

.band-label {
  /* eyebrow over the tabs: a true kicker — a clear size step below the
     0.8rem tabs (≈ major third), bold like them, widest tracking on the page */
  font-size: 0.62rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.35em;
  margin-right: -0.35em; /* cancel trailing tracking to keep it centered */
  color: var(--content-ink-muted);
}

/* CHICAGO enters a full flag state twice per 31.2s cycle: 31.2 nods to the
   312 area code; the two on-windows nod to the flag's blue stripes. The first
   begins around 18.37% for the city's 1837 incorporation, the second around
   77.3% for the 773 area code. */
.band-label .flag-word {
  --flag-cycle: 31.2s;
  display: inline-block;
  transform-origin: center;
  animation: chicago-word-grow var(--flag-cycle) infinite;
}

.band-label .flag-letter {
  --flag-cycle: 31.2s;
  --flag-blue: #41b6e6;
  --flag-red: #e4002b;
  animation: chicago-flag-blue var(--flag-cycle) infinite;
}

@keyframes chicago-flag-blue {
  0%, 18.36%, 21.88%, 77.29%, 80.81%, 100% { color: var(--content-ink-muted); }
  18.37%, 21.87%, 77.3%, 80.8% { color: var(--flag-blue); }
}

@keyframes chicago-word-grow {
  0%, 18.36%, 21.88%, 77.29%, 80.81%, 100% { transform: scale(1); }
  18.37%, 21.87%, 77.3%, 80.8% { transform: scale(1.08); }
}

/* the red star is centered over the O's own measured box, so the replacement
   keeps the same center point while the surrounding word stays steady */
.flag-letter-o {
  position: relative;
  display: inline-block;
  letter-spacing: 0;
  /* the zeroed tracking would otherwise tighten the gap to the next word */
  margin-right: 0.35em;
  vertical-align: baseline;
}

.flag-letter-o .flag-o {
  display: inline-block;
  letter-spacing: 0;
  animation: chicago-o-out var(--flag-cycle) infinite;
}

.flag-letter-o .flag-star {
  position: absolute;
  left: 50%;
  top: 50%;
  color: var(--flag-red);
  font-size: 1.15em;
  line-height: 1;
  letter-spacing: 0;
  opacity: 0;
  transform: translate(-50%, -50%);
  animation: chicago-star-in var(--flag-cycle) infinite;
}

@keyframes chicago-o-out {
  0%, 18.36%,
  21.88%, 77.29%,
  80.81%, 100% { opacity: 1; }
  18.37%, 21.87%,
  77.3%, 80.8% { opacity: 0; }
}

@keyframes chicago-star-in {
  0%, 18.36%,
  21.88%, 77.29%,
  80.81%, 100% { opacity: 0; }
  18.37%, 21.87%,
  77.3%, 80.8% { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .band-label .flag-word,
  .band-label .flag-letter,
  .flag-letter-o .flag-o,
  .flag-letter-o .flag-star {
    animation: none;
  }
}

.editorial {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: clamp(2rem, 4vw, 4rem) var(--gutter);
  max-width: 80rem;
  margin-inline: auto;
}

.entry-title {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.entry-meta {
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--ink-muted);
  margin: 0.25rem 0 1rem;
}

.entry p:not(.entry-meta) {
  font-size: 1rem;
  max-width: 38ch;
}

/* ---- Footer -------------------------------------------------------- */

.site-footer {
  /* dark register of the masthead: body texture shows through */
  color: #ffffff;
  padding: clamp(2.5rem, 5vw, 4.5rem) var(--edge);
  text-align: left;
}

/* footer copy aligns with the content column, not the viewport edge */
.site-footer-inner {
  display: grid;
  gap: 1.5rem;
  max-width: var(--measure);
  margin-inline: auto;
}

@media (min-width: 768px) {
  .site-footer-inner {
    /* paragraph keeps the column; actions hug their content on the right */
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: start;
    row-gap: 2rem;
    column-gap: clamp(3rem, 6vw, 5rem);
  }
  .site-footer-inner > p:first-child {
    grid-column: 1;
    grid-row: 1;
  }
  /* donate sits under the text in the left column; the links form the
     right column, top-aligned with the paragraph */
  .site-footer .footer-actions {
    display: contents;
  }
  .site-footer .footer-donate {
    grid-column: 1;
    grid-row: 2;
    justify-self: start;
  }
  .site-footer .footer-links {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .site-footer .footer-copyright {
    grid-column: 1 / -1;
    grid-row: 3;
  }
}

.site-footer p {
  max-width: 64ch;
  font-size: 0.9rem;
  line-height: 1.7;
  letter-spacing: 0.04em;
  text-shadow: 0 2px 2px rgba(0, 0, 0, 0.6); /* matches the logotype */
}

.footer-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1.5rem;
}

.footer-donate {
  display: inline-flex;
  align-items: center;
  padding: 0.7em 1.5em;
  background: #41b6e6; /* Chicago-flag stripe blue, same as .top-pick */
  color: #ffffff;
  border-radius: 2px;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
}

.footer-donate:hover {
  background: #2da4d8;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.footer-links a {
  color: #ffffff;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding-bottom: 0.2em;
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
}

.footer-links a:hover {
  border-bottom-color: #ffffff;
}

.site-footer .footer-copyright {
  color: var(--ink-muted);
  font-size: 0.72rem;
  letter-spacing: 0.06em; /* no uppercase: "culture/Math" keeps its casing */
}

.site-footer .footer-copyright a {
  color: inherit;
  text-decoration: none;
}

.site-footer .footer-copyright a:hover {
  color: #ffffff;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---- Week listings ------------------------------------------------- */

.view {
  max-width: var(--measure);
  margin-inline: auto;
}

.tag-page > :not([data-visualist-nav]) {
  max-width: var(--measure);
  margin-inline: auto;
}

.tag-title {
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
  border-bottom: var(--hairline-light);
  color: var(--content-ink);
  font-family: fenwick, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: clamp(2rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1;
  padding-bottom: 0.2em;
  text-transform: uppercase;
}

.tag-count {
  color: var(--content-ink-muted);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.22em;
  letter-spacing: 0.12em;
  vertical-align: middle;
  white-space: nowrap;
}

.tag-count::before {
  content: "\00a0";
}

.view-heading {
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  margin: clamp(2rem, 4vw, 3rem) 0 1rem;
  padding-bottom: 0.5rem;
  border-bottom: var(--hairline-light);
}

.view-heading:first-child {
  margin-top: 0;
}

.listing {
  list-style: none;
}

.listing-item {
  display: grid;
  gap: 0.4rem;
  padding: 1.35rem 0;
  border-bottom: var(--hairline-light);
}

.listing-item:last-child {
  border-bottom: 0;
}

.listing-title {
  display: block;
  color: var(--content-ink);
  font-family: Georgia, serif;
  font-size: 1.2rem;
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: 0;
  text-decoration: none;
  text-transform: none;
}

.listing-title:hover {
  color: #000000;
  text-decoration: underline;
  text-underline-offset: 0.25em;
}

.listing-venue {
  color: var(--content-ink-muted);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  line-height: 1.5;
}

.listing-venue a {
  color: inherit;
  text-decoration: none;
}

.listing-venue a:hover {
  color: var(--content-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.listing-description {
  display: block;
  color: var(--content-ink-muted);
  font-size: 0.88rem;
  letter-spacing: 0;
  line-height: 1.5;
  max-width: 46rem;
  overflow-wrap: anywhere;
}

.listing-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.listing-tags a {
  border: 1px solid #d4d4d4;
  border-radius: 2px;
  color: var(--content-ink-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.1;
  padding: 0.25rem 0.4rem;
  text-decoration: none;
  text-transform: uppercase;
}

.listing-tags a:hover {
  border-color: var(--content-ink);
  color: var(--content-ink);
}

.listing-meta {
  font-size: 0.68rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.6;
  color: var(--content-ink-muted);
}

.view-empty {
  color: var(--content-ink-muted);
  font-size: 0.9rem;
  text-align: center;
  padding: clamp(2rem, 4vw, 3rem) 0;
}

.archive-summary {
  color: var(--content-ink-muted);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  margin-bottom: 0.75rem;
}

.archive-sentinel {
  height: 1px;
}

/* today with no openings: a gentle detour to the week or the archive */
.day-empty {
  display: grid;
  justify-items: center;
  gap: 1.5rem;
  padding: clamp(2.5rem, 7vw, 5rem) 1rem;
  text-align: center;
}

.day-empty-lede {
  margin: 0;
  color: var(--content-ink);
  font-family: Georgia, serif;
  font-size: clamp(1.25rem, 2.6vw, 1.6rem);
  font-style: italic;
}

.day-empty-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
}

.day-empty-actions a {
  display: inline-block;
  padding: 0.7em 1.4em;
  border: 1px solid var(--content-ink);
  border-radius: 2px;
  color: var(--content-ink);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-decoration: none;
  text-transform: uppercase;
}

.day-empty-actions a:hover {
  background: var(--content-ink);
  color: var(--content-paper);
}

/* the archive's default face: a list of month links */
.archive-month-list {
  list-style: none;
  display: grid;
  gap: 0.35rem;
  margin: 0;
  padding: 0;
}

/* month rows: "Month Year - n events" over a scrolling river of images */
.archive-month-item {
  min-width: 0; /* let the river scroll instead of widening the grid item */
  padding: 0.5rem 0 0.9rem;
}

.month-head {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  margin-bottom: 0.5rem;
  text-decoration: none;
}

.month-head a.event-date-day {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.month-head a.month-count {
  color: inherit;
  text-decoration: none;
}

/* a horizontally scrolling river of square images, one per event,
   each linking to its detail page */
.thumb-river-frame {
  --river-left-edge: max(var(--edge), calc((100vw - var(--measure)) / 2));
  --river-fade: clamp(1.5rem, 5vw, 4rem);
  position: relative;
  width: 100vw;
  max-width: 100vw;
  margin-left: calc(-1 * var(--river-left-edge));
}

.thumb-river-frame::before,
.thumb-river-frame::after {
  content: "";
  position: absolute;
  top: 0;
  bottom: 4px;
  z-index: 1;
  width: var(--river-fade);
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.16s ease;
}

.thumb-river-frame::before {
  left: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
}

.thumb-river-frame::after {
  right: 0;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 1) 100%);
}

.thumb-river-frame.has-left-overflow::before,
.thumb-river-frame.has-right-overflow::after {
  opacity: 1;
}

.thumb-river {
  display: flex;
  gap: 3px;
  overflow-x: auto;
  padding-left: var(--river-left-edge);
  padding-right: var(--edge);
  scrollbar-width: none;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-x: contain;
}

.thumb-river::-webkit-scrollbar {
  display: none;
}

#view-archive .thumb-river-frame,
.week-peek .thumb-river-frame {
  width: 100%;
  max-width: 100%;
  margin-left: 0;
}

#view-archive .thumb-river,
.week-peek .thumb-river {
  padding-left: 0;
  padding-right: 0;
}

.thumb-river a {
  flex: none;
}

.thumb-river img {
  display: block;
  width: clamp(5.1rem, 12vw, 6.9rem);
  height: clamp(5.1rem, 12vw, 6.9rem);
  object-fit: cover;
  border-radius: 2px;
  opacity: 0.85;
  transition: opacity 0.2s ease;
}

.thumb-river a:hover img {
  opacity: 1;
}

/* an unfetched month river holds one tile of height so rows keep their
   shape (and the lazy fetch fires row by row, not all at once) */
.thumb-river:empty {
  min-height: clamp(5.1rem, 12vw, 6.9rem);
}

/* compact On View listing under a day page's full cards */
.onview-section {
  margin-top: clamp(2rem, 4vw, 3rem);
}

.onview-section .listing-item {
  gap: 0.2rem;
}

.onview-section .event-when {
  margin: 0;
  font-size: 0.8rem;
  color: var(--content-ink-muted);
}

/* a peek at next week under the This Week stream */
.week-peek {
  margin-top: clamp(2.5rem, 5vw, 4rem);
}

.week-peek-top-v {
  margin-top: 0;
  margin-bottom: clamp(1.8rem, 4vw, 3rem);
}

.week-peek-title {
  margin: 0 0 0.5rem;
  color: var(--content-ink);
  font-family: Georgia, serif;
  font-size: clamp(1.35rem, 2.6vw, 1.75rem);
  font-weight: 400;
}

.week-peek-title a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* the Top V peek heading is the card pill scaled up: identical em padding,
   spacing, and radius — only the font size differs */
.top-pick-heading-link {
  color: #41b6e6; /* Chicago-flag stripe blue */
  text-decoration: none;
}

.top-pick-heading-link:hover {
  text-decoration: underline;
}

.week-peek-copy {
  max-width: 42rem;
  margin: -0.15rem 0 0.75rem;
  color: var(--content-ink-muted);
  font-size: 0.9rem;
  line-height: 1.55;
}

.week-peek-copy a {
  color: var(--content-ink);
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.archive-listing {
  margin-bottom: clamp(2rem, 4vw, 3rem);
  /* scroll position is compensated manually when earlier events are prepended */
  overflow-anchor: none;
}

/* events featured in badatsports.com TOP V. WEEKEND PICKS columns;
   the label links to the top-pick tag page */
.top-pick {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5em;
  padding: 0.4em 1.2em; /* same as add event button */
  background: #41b6e6; /* Chicago-flag stripe blue */
  color: #ffffff;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.55rem;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-radius: 0; /* hard corners */
  white-space: nowrap;
  text-decoration: none;
}

/* ---- Top V Popover ------------------------------------------- */
.top-pick-popover {
  position: absolute;
  background: var(--content-paper);
  border: 2px solid #41b6e6; /* Chicago blue */
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
  padding: 0.8rem 1rem;
  z-index: 2000;
  max-width: 290px;
  color: var(--content-ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.85rem;
  line-height: 1.45;
  border-radius: 0; /* hard corners */
}

.top-pick-popover .popover-text {
  margin: 0 0 0.5rem;
}

.top-pick-popover .popover-text a {
  color: #41b6e6;
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.top-pick-popover .popover-link {
  display: inline-block;
  color: #41b6e6;
  font-weight: 700;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 0.75rem;
  letter-spacing: 0.05em;
}

.top-pick-popover .popover-link:hover {
  text-decoration: underline;
}

/* inside card titles, .event-title a would otherwise paint the badge ink-on-ink */
.event-title a.top-pick {
  color: var(--content-paper);
}

/* opening/last event of a multi-date exhibition: a quiet chip beside the title */
.series-pill {
  display: inline-block;
  vertical-align: middle;
  margin-left: 0.5em;
  padding: 0.25em 0.55em;
  background: transparent;
  border: 1px solid var(--content-ink-muted);
  color: var(--content-ink-muted);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.55rem;
  font-style: normal;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  border-radius: 2px;
  white-space: nowrap;
}

a.top-pick:hover,
.event-title a.top-pick:hover {
  background: #b50023;
  color: #ffffff;
  text-decoration: none;
}

/* "Today" / "Tomorrow" markers on day/date headers */
.event-date-marker {
  display: block;
  width: fit-content;
  font-size: 0.6rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: #41b6e6;
  text-decoration: none;
}

.event-date-marker:hover {
  color: var(--content-ink);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* ---- Day-grouped event cards (as-is site This Week structure) ------ */

.event-date {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin: clamp(2rem, 4vw, 3rem) 0 0.25rem;
  padding-bottom: 0.35rem;
}

.event-date-is-relative {
  display: grid;
  grid-template-columns: max-content minmax(0, 1fr);
  column-gap: 0.6rem;
  row-gap: 0.12rem;
  align-items: baseline;
}

.event-date-is-relative .event-date-marker {
  grid-column: 1 / -1;
  justify-self: start;
}

.event-date:first-child {
  margin-top: 0;
}

.event-date-day {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  font-size: 1.1rem;
}

.event-date-num {
  font-family: Georgia, serif;
  font-style: italic;
  font-size: 0.85rem;
}

.event-card {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 1.5rem;
  padding: 1.5rem 0;
  border-bottom: var(--hairline-light);
}

.view > .event-card:last-child,
.archive-listing .event-card:last-child {
  border-bottom: 0;
}

.event-thumb {
  display: block;
  width: 200px;
  max-width: 100%;
  overflow: hidden;
}

.event-thumb img {
  display: block;
  width: 100%;
  height: auto;
}

/* Graceful fallback: a card with no usable image — either none was supplied or
   a broken/404 image was removed by the image-error handler in components.js —
   drops the thumb column and lets the text use the full width, instead of
   leaving an empty 200px gap or showing a broken-image icon. */
.event-card:not(:has(.event-thumb img)) {
  grid-template-columns: 1fr;
}

.event-card:not(:has(.event-thumb img)) .event-thumb {
  display: none;
}

.event-title {
  font-family: Georgia, serif;
  font-size: 1.6rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0;
  text-transform: none;
  margin-bottom: 0.6rem;
}

.event-title a {
  color: var(--content-ink);
  text-decoration: none;
}

.event-title a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.event-info p {
  font-family: Georgia, serif;
  font-size: 0.86rem;
  letter-spacing: 0;
  line-height: 1.5;
  margin-bottom: 0.3rem;
  color: var(--content-ink-muted);
}

/* when-lines read as one tight block; a clear step before the venue/address block */
.event-info .event-when {
  margin-bottom: 0.15rem;
}

.event-meta-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.28rem;
  align-items: start;
  margin: 0 0 0.95rem;
}

.event-schedule {
  display: block;
  margin: 0;
}

.event-location {
  display: block;
  margin: 0;
}

.event-location .event-venue,
.event-location .event-address,
.event-schedule .event-when {
  margin-bottom: 0;
}

.event-location .event-venue,
.event-detail-meta .event-venue {
  display: inline;
  margin-right: 0.5em;
}

.event-location .event-address,
.event-detail-meta .event-address {
  display: inline;
}

.event-location .event-address,
.event-detail-meta .event-address,
.event-schedule .event-when,
.event-detail-meta .event-when {
  color: var(--content-ink-muted);
  font-family: Georgia, serif;
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  text-transform: none;
}

.event-location .event-venue,
.event-detail-meta .event-venue,
.event-schedule .event-when strong,
.event-detail-meta .event-when strong {
  color: var(--content-ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.35;
  text-transform: uppercase;
}

.event-schedule .event-when strong,
.event-detail-meta .event-when strong {
  margin-right: 0.25em;
}

.event-location .event-venue a,
.event-detail-meta .event-venue a,
.event-location .event-address a,
.event-detail-meta .event-address a {
  color: inherit;
}

.event-location .event-address:not(:first-child),
.event-detail-meta .event-address:not(:first-child) {
  margin-left: 0;
}

.event-schedule .event-when {
  display: block;
  margin-right: 0;
}

.event-detail-meta .event-when {
  display: block;
  margin-right: 0;
}

.event-schedule .event-time-bounds,
.event-detail-meta .event-time-bounds {
  display: block;
  margin-bottom: 0.08rem;
}

.event-time-end {
  display: inline-block;
  margin-left: 0.85rem;
}

.event-info p a {
  color: inherit;
  text-decoration: none;
}

.event-info p a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.event-info .event-when a {
  text-decoration: none;
}

.event-info .event-when a:hover {
  text-decoration: none;
  border-bottom: 1px solid currentColor;
  padding-bottom: 1px;
}

.event-info .event-description {
  max-width: 42rem;
  margin: 0.75rem 0 0.5rem;
  color: var(--content-ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.94rem;
  letter-spacing: 0;
  line-height: 1.5;
  overflow-wrap: anywhere;
}

.event-description.clamp-lines {
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
  position: relative;
}

/* shortened excerpts dissolve at the end: the tail's glyphs fade out via a
   text-clipped gradient; it doubles as the link to the detail page */

/* clear air between the description and the tag chips — same 1.5rem gap the
   detail view gets from .event-detail-description's bottom margin */
.event-info .listing-tags {
  margin-top: 1.5rem;
}

.event-liner {
  display: none;
}

/* ---- Event detail pages ------------------------------------------- */

.event-main {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

/* origin crumb: sits in the body column, directly above the title */
.breadcrumb {
  display: flex;
  align-items: baseline;
  gap: 0.45rem;
  margin: 0 0 1rem;
  color: var(--content-ink);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.breadcrumb a {
  color: inherit;
  text-decoration: none;
}

/* every label/arrow pair hovers the same way: a color dim, never an underline */
.breadcrumb a:hover {
  color: var(--content-ink-muted);
}

.breadcrumb-arrow {
  position: relative;
  display: inline-block;
  padding-right: 2.2em; /* reserve space for the arrow line and calendar icon */
  margin-right: 0.25em; /* visual space before next item */
}



.breadcrumb-arrow::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -0.2em; /* position like an underline (matches offset 0.2em) */
  width: 100%;
  height: 1px;
  background-color: currentColor; /* the line itself */
}

.breadcrumb-arrow::before {
  content: "";
  position: absolute;
  right: 0;
  bottom: -0.2em;
  width: 5px;
  height: 5px;
  border-top: 1px solid currentColor;
  border-right: 1px solid currentColor;
  transform: translateY(calc(50% - 0.5px)) rotate(45deg); /* forms the > arrowhead, optically centered on 1px line */
}

.breadcrumb-arrow-date {
  padding-right: 4.45em;
}

.breadcrumb a.breadcrumb-arrow:hover {
  color: var(--content-ink-muted);
}

.event-detail {
  display: grid;
  grid-template-columns: minmax(12rem, 18rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.5rem);
  max-width: var(--measure);
  margin-inline: auto;
  align-items: start;
}

.event-detail-image {
  display: block;
  width: 100%;
  padding: 0;
  border: none;
  background: none;
}

.event-detail-image img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;
}

/* a detail page with no usable image collapses the image column so the body
   uses the full measure rather than sitting beside an empty gap */
.event-detail:not(:has(.event-detail-image img)) {
  grid-template-columns: 1fr;
}

.event-detail:not(:has(.event-detail-image img)) .event-detail-image {
  display: none;
}

.event-detail-body {
  min-width: 0;
}

.event-detail-title {
  margin-top: 0;
  margin-bottom: 1rem;
  color: var(--content-ink);
  font-family: Georgia, serif;
  font-size: clamp(2rem, 5vw, 4.75rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.08;
}

.event-detail-pick {
  margin: -0.35rem 0 1rem;
}

.event-detail-pick .top-pick {
  margin-left: 0;
  font-size: 0.62rem;
}

.event-detail-meta {
  margin-bottom: 1.5rem;
  color: var(--content-ink-muted);
  font-family: Georgia, serif;
  font-size: 0.86rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  text-transform: none;
}

.event-detail-meta a {
  color: inherit;
  text-decoration: none;
}

.event-detail-meta a:hover {
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.event-detail-description {
  display: grid;
  gap: 1rem;
  max-width: 48rem;
  margin: 1.5rem 0;
}

.event-detail-description p {
  color: var(--content-ink);
  font-size: 1rem;
  letter-spacing: 0;
  line-height: 1.65;
  overflow-wrap: anywhere; /* long pasted URLs must not widen the page */
}

.event-source-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem 1.75rem;
  margin-top: 1.25rem;
}

.event-source-link {
  display: inline-block;
  color: var(--content-ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* "+calendar" beside the breadcrumb date: icon button opening a small menu */
.breadcrumb-calendar {
  position: absolute;
  right: 2.2em; /* leave a full arrow-length run after the calendar icon */
  bottom: 0; /* sitting directly on top of the arrow line */
  flex: none;
  display: inline-flex;
}

.calendar-toggle {
  display: inline-flex;
  padding: 0.15em;
  border: 0;
  background: none;
  color: var(--content-ink);
  cursor: pointer;
}

.calendar-toggle:hover {
  color: var(--content-ink-muted);
}

.calendar-toggle[aria-expanded="true"] {
  color: var(--content-ink);
}

.calendar-toggle svg {
  display: block;
  width: 1.25em;
  height: 1.25em;
  /* optical centering against the all-caps date: the text box reserves
     descender room the capitals never use, so dead center reads low */
  transform: translateY(-0.1em);
}

.calendar-menu {
  position: absolute;
  top: calc(100% + 0.4rem);
  right: 0; /* expands leftward so it stays on-screen at narrow widths */
  z-index: 30;
  display: grid;
  gap: 0.55rem;
  min-width: 13rem;
  padding: 0.8rem 0.95rem;
  background: var(--content-paper);
  border: 1px solid #d4d4d4;
  border-radius: 2px;
  box-shadow: 0 6px 18px rgba(0, 0, 0, 0.12);
}

.calendar-menu-label {
  color: var(--content-ink-muted);
  font-size: 0.62rem;
  letter-spacing: 0.14em;
}

.calendar-menu a {
  color: var(--content-ink);
  text-decoration: none;
  white-space: nowrap;
}

.breadcrumb .calendar-menu a:hover {
  color: var(--content-ink-muted);
}

/* ---- Submit form --------------------------------------------------- */

.submit-main {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.submit-view {
  width: min(100%, 38rem);
}

.submit-title {
  margin: 0 0 1rem;
  font-size: 1rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.submit-form {
  display: grid;
  gap: 2.5rem;
  margin-top: 2rem;
  width: min(100%, 38rem); /* comfortable single-column field measure within the page column */
  max-width: 100%;
}

.submit-section {
  display: grid;
  gap: 1.6rem;
  padding: 0 0 2.5rem;
  border: 0;
  border-bottom: var(--hairline-light);
}

.submit-section legend {
  margin-bottom: 1.6rem;
  color: var(--content-ink);
  font-size: 0.78rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

.submit-row {
  display: grid;
  gap: 1rem;
}

.submit-row-3 {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.submit-row-2 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.listing-type-toggle {
  display: flex;
  width: fit-content;
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  overflow: hidden;
}

.listing-type-option input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.listing-type-option span {
  display: block;
  padding: 0.65em 1.2em;
  color: var(--content-ink-muted);
  font-size: 0.74rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}

.listing-type-option + .listing-type-option {
  border-left: 1px solid #d4d4d4;
}

.listing-type-option input:checked + span {
  background: var(--content-ink);
  color: var(--content-paper);
}

.listing-type-option input:focus-visible + span {
  outline: 2px solid var(--content-ink);
  outline-offset: -2px;
}

/* tags field: committed chips + type-ahead input in one box */
/* positioning context for a .search-suggest under a plain field input */
.typeahead {
  position: relative;
}

.submit-field.has-address-autocomplete {
  position: relative;
}

.tag-input {
  position: relative;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  padding: 0.45rem 0.6rem;
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  background: var(--content-paper);
  cursor: text;
}

.tag-input:focus-within {
  border-color: var(--content-ink);
}

.submit-field .tag-input input {
  flex: 1;
  width: auto;
  min-width: 9rem;
  border: none;
  outline: none;
  padding: 0.35rem 0.3rem;
  background: transparent;
  color: var(--content-ink);
  font: inherit;
  font-size: 0.95rem;
}

.tag-input input::placeholder {
  color: var(--content-ink-muted);
}

.tag-chip-locked {
  display: inline-flex;
  align-items: center;
  gap: 0.45em;
  padding: 0.45em 0.55em 0.45em 0.7em;
  background: #000000;
  color: #ffffff;
  border: 1px solid #000000;
  border-radius: 2px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: 1.15;
  text-transform: uppercase;
  white-space: nowrap;
}

.tag-chip-locked em {
  font-style: normal;
  font-size: 0.85em;
  opacity: 0.9;
}

.tag-chip-locked button {
  border: 0;
  border-left: 1px solid rgba(255, 255, 255, 0.42);
  padding: 0 0.1em 0 0.45em;
  background: transparent;
  color: #ffffff;
  cursor: pointer;
  font-size: 1.05em;
  line-height: 1;
  opacity: 1;
}

.tag-chip-locked button:hover {
  color: #d9d9d9;
}

.search-suggest-create span:first-child {
  font-style: italic;
}

.submit-field .submit-hint {
  color: var(--content-ink-muted);
  font-size: 0.78rem;
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.5;
  text-transform: none;
}

.submit-optional {
  margin-left: 0.4em;
  color: var(--content-ink-muted);
  font-size: 0.85em;
  font-style: normal;
  font-weight: 400;
  letter-spacing: 0.08em;
}

/* ---- Submission confirmation --------------------------------------- */

.submitted-copy {
  display: grid;
  gap: 1rem;
  max-width: 38rem;
  margin-bottom: 2.5rem;
}

.submitted-copy p {
  color: var(--content-ink);
  font-size: 1rem;
  line-height: 1.65;
}

.submitted-copy a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.submitted-copy a:hover {
  color: #000000;
}

.submitted-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  align-items: center;
}

/* ---- Admin queue --------------------------------------------------- */

.admin-main {
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.admin-view {
  max-width: var(--measure);
}

.admin-view-head {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}

.admin-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 0.5rem 0 1rem;
}

.admin-summary span,
.admin-status,
.admin-card-meta {
  color: var(--content-ink-muted);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}

.admin-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  margin: 0 0 1.5rem;
  border-bottom: 1px solid #d4d4d4;
}

.admin-tabs button {
  border: 1px solid transparent;
  border-bottom: 0;
  border-radius: 0;
  padding: 0.7rem 0.95rem;
  background: transparent;
  color: var(--content-ink-muted);
  cursor: pointer;
  font: inherit;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-tabs button.active {
  background: #eeeeee;
  border-left-color: #d4d4d4;
  border-right-color: #d4d4d4;
  border-top-color: #d4d4d4;
  color: var(--content-ink);
}

.admin-tabs button span {
  color: inherit;
  font: inherit;
  letter-spacing: inherit;
}

.admin-queue {
  display: grid;
  gap: 1.5rem;
}

.admin-card {
  border: 1px solid #d4d4d4;
  border-radius: 4px;
  padding: clamp(1rem, 2vw, 1.35rem);
  background: var(--content-paper);
}

.admin-card-head {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 7rem;
  gap: 1rem;
  align-items: start;
  margin-bottom: 1.25rem;
}

.admin-card-head h2 {
  margin: 0.15rem 0 0.35rem;
  color: var(--content-ink);
  font-family: Georgia, serif;
  font-size: clamp(1.35rem, 3vw, 2.25rem);
  font-weight: 400;
  letter-spacing: 0;
  line-height: 1.12;
}

.admin-card-head img,
.admin-thumb-empty {
  display: block;
  width: 7rem;
  aspect-ratio: 1;
  object-fit: cover;
  border: 1px solid #d4d4d4;
  background: #eeeeee;
}

.admin-fields {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.admin-wide {
  grid-column: 1 / -1;
}

.admin-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  align-items: center;
  margin-top: 1.25rem;
}

.admin-live-actions {
  margin-top: 0;
  margin-bottom: 1rem;
}

.admin-publish-controls {
  display: grid;
  grid-template-columns: minmax(12rem, 1fr) minmax(12rem, 1fr) auto;
  gap: 1rem;
  align-items: end;
  margin-top: 1rem;
}

.admin-preview {
  margin-top: 1rem;
  border-top: var(--hairline-light);
  padding-top: 1rem;
}

.admin-message {
  margin-top: 1rem;
  color: var(--content-ink-muted);
  font-size: 0.9rem;
  line-height: 1.5;
}

.admin-message[data-tone="success"] {
  color: #0b6b3a;
}

.admin-message[data-tone="error"] {
  color: #b42318;
}

.admin-create {
  margin-top: 2rem;
  border-top: 1px solid #d4d4d4;
  padding-top: 1rem;
}

.admin-create summary {
  width: fit-content;
  cursor: pointer;
  color: var(--content-ink);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  line-height: 1.35;
  text-transform: uppercase;
}

.admin-create form {
  margin-top: 1rem;
}

.admin-events {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.admin-event-filters {
  display: grid;
  grid-template-columns: minmax(12rem, 1.6fr) repeat(3, minmax(8rem, 1fr));
  gap: 1rem;
  margin: 1rem 0;
}

.admin-events-count {
  margin: 0 0 0.75rem;
  color: var(--content-ink-muted);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.admin-event-list {
  display: grid;
  gap: 0.45rem;
}

.admin-event-item {
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  background: var(--content-paper);
}

.admin-event-item summary {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1.5fr) minmax(0, 1fr) 6.5rem;
  gap: 0.75rem;
  align-items: baseline;
  cursor: pointer;
  padding: 0.75rem 0.9rem;
}

.admin-event-title {
  color: var(--content-ink);
  font-family: Georgia, serif;
  font-size: 1rem;
  line-height: 1.25;
}

.admin-event-date,
.admin-event-venue,
.admin-event-source {
  color: var(--content-ink-muted);
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  line-height: 1.3;
  text-transform: uppercase;
}

.admin-event-source {
  justify-self: end;
}

.admin-event-item form {
  padding: 0 0.9rem 1rem;
}

.admin-tagline-list {
  display: grid;
  gap: 1rem;
}

.admin-tagline-row {
  display: grid;
  grid-template-columns: minmax(14rem, 1fr) auto auto;
  gap: 1rem;
  align-items: end;
  border-bottom: var(--hairline-light);
  padding-bottom: 1rem;
}

.form-button-pass {
  background: transparent;
  color: var(--content-ink);
}

.form-button-pass:hover {
  background: #eeeeee;
}

.submit-field {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.submit-field span,
.metadata-preview span,
.submit-actions p {
  color: var(--content-ink-muted);
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.submit-field input,
.submit-field select,
.submit-field textarea {
  width: 100%;
  min-width: 0;
  border: 1px solid #d4d4d4;
  border-radius: 3px;
  background: var(--content-paper);
  color: var(--content-ink);
  font: inherit;
  font-size: 0.95rem;
  letter-spacing: 0;
  padding: 0.75rem 0.9rem;
}

.admin-check-field {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  align-self: end;
  min-height: 3.05rem;
}

.admin-check-field input[type="checkbox"] {
  width: 1.15rem;
  min-width: 1.15rem;
  height: 1.15rem;
  padding: 0;
  accent-color: var(--content-ink);
}

.submit-field .listing-type-option input {
  position: absolute;
  width: 1px;
  min-width: 1px;
  height: 1px;
  padding: 0;
  opacity: 0;
}

.admin-check-field span {
  color: var(--content-ink);
  line-height: 1.2;
}

.submit-field textarea {
  min-height: 13rem;
  resize: vertical;
}

.submit-field input:focus,
.submit-field select:focus,
.submit-field textarea:focus {
  outline: none;
  border-color: var(--content-ink);
}

.submit-field input::placeholder,
.submit-field textarea::placeholder {
  color: var(--content-ink-muted);
}

.form-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  min-height: 3.05rem;
  border: 1px solid var(--content-ink);
  border-radius: 2px;
  background: var(--content-ink);
  color: var(--content-paper);
  cursor: pointer;
  font: inherit;
  font-size: 0.76rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.75rem 1rem;
  white-space: nowrap;
}

.form-button:hover {
  background: #3a3a3a;
}

.form-button:disabled {
  cursor: wait;
  opacity: 0.6;
}

.metadata-spinner {
  display: inline-block;
  width: 0.85em;
  height: 0.85em;
  margin-left: 0.35em;
  border: 2px solid #c8c8c8;
  border-top-color: var(--content-ink);
  border-radius: 50%;
  vertical-align: -0.12em;
  animation: metadata-spin 0.75s linear infinite;
}

.metadata-spinner[hidden] {
  display: none;
}

@keyframes metadata-spin {
  to {
    transform: rotate(360deg);
  }
}

.submit-actions {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.form-button-primary {
  min-width: 10rem;
}

@media (max-width: 48rem) {
  :root {
    --edge: 1rem; /* 0.75vw collapses to almost nothing on phones */
  }

  .event-meta-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 40rem) {
  .event-card {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }

  .event-detail {
    grid-template-columns: 1fr;
  }

  /* hero bleeds to the screen edges and tucks up against the nav band */
  .event-detail-image {
    width: auto;
    margin: calc(-1 * var(--band-gap)) calc(-1 * var(--edge)) 0;
  }


  .submit-grid,
  .submit-url-row,
  .metadata-preview {
    grid-template-columns: 1fr;
  }

  .form-button,
  .form-button-primary {
    width: 100%;
  }

  .submit-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .admin-card-head,
  .admin-fields,
  .admin-publish-controls,
  .admin-tagline-row,
  .admin-event-filters,
  .admin-event-item summary {
    grid-template-columns: 1fr;
  }

  .admin-card-head img,
  .admin-thumb-empty {
    width: 100%;
    max-width: 12rem;
  }

  .admin-event-source {
    justify-self: start;
  }
}

@media (max-width: 40rem) {
  .admin-event-filters {
    grid-template-columns: 1fr;
  }
}


[data-page="admin"] .logotype-name {
  font-size: clamp(2.5rem, 13vw, 15.5rem);
}

/* User request: non-blue links with outline and darker color */
.event-description a,
.inline-link {
  color: var(--content-ink);
  text-decoration: underline;
}
.event-description a:hover,
.inline-link:hover {
  background: transparent;
  color: #666;
}

.event-description.clamp-lines::after {
  content: "";
  position: absolute;
  bottom: 0;
  right: 0;
  width: 35%;
  height: 1.5em; /* matching line-height */
  background: linear-gradient(to right, transparent, var(--content-paper) 70%);
  pointer-events: none;
}
.description-fade-link {
  position: absolute;
  bottom: 0;
  right: 0;
  width: 35%;
  height: 1.5em;
  z-index: 1;
  cursor: pointer;
  border: none !important;
  outline: none !important;
}
.description-fade-link:hover {
  background: transparent !important;
}

/* ---- Skeleton UI ------------------------------------------- */
.skeleton { pointer-events: none; }
.skeleton-image {
  background: #e0e0e0;
  animation: pulse 1.5s infinite ease-in-out;
}
.skeleton-title {
  background: #e0e0e0;
  height: 1.5rem;
  width: 60%;
  margin-bottom: 0.5rem;
  animation: pulse 1.5s infinite ease-in-out;
}
.skeleton-text {
  background: #e0e0e0;
  height: 1rem;
  width: 90%;
  margin-bottom: 0.5rem;
  animation: pulse 1.5s infinite ease-in-out;
}
@keyframes pulse {
  0% { opacity: 0.6; }
  50% { opacity: 0.3; }
  100% { opacity: 0.6; }
}

/* WordPress-style Admin Login */
body.logged-out {
  /* full shorthand: the site texture is a background-image and would
     otherwise keep painting over a background-color */
  background: #f1f1f1;
}
body.logged-out .site-header,
body.logged-out .site-footer {
  display: none !important;
}
body.logged-out .admin-main {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  margin: 0;
  padding: 0;
}
#view-login {
  width: 320px;
  max-width: 100%;
  margin: 8vh auto;
}
#view-login .login-logo {
  text-align: center;
  margin-bottom: 24px;
}
#view-login .login-logo .logotype {
  color: #3c434a;
  text-decoration: none;
  text-shadow: none;
  font-size: 2rem;
  display: inline-flex;
}
/* the masthead spans carry their own clamp() sizes (incl. the
   [data-page="admin"] override), so the login logo must re-size both */
#view-login .login-logo .logotype-the {
  font-style: italic;
  font-weight: 300;
  font-size: 0.7rem;
  margin-right: 0.1em;
}
#view-login .login-logo .logotype-name {
  font-weight: 800;
  letter-spacing: 0.05em;
  font-size: 2rem;
}
#login-title {
  display: none; /* Hide the day-heading */
}
.admin-login-form {
  background: #fff;
  border: 1px solid #c3c3c3;
  box-shadow: 0 1px 3px rgba(0,0,0,.04);
  padding: 24px;
}
.admin-login-form .submit-field {
  display: block;
  margin-bottom: 20px;
}
.admin-login-form .submit-field span {
  display: block;
  margin-bottom: 8px;
  color: #3c434a;
  font-size: 14px;
}
.admin-login-form .submit-field input {
  width: 100%;
  padding: 8px 12px;
  font-size: 16px;
  line-height: 1.33333333;
  border: 1px solid #8c8f94;
  border-radius: 4px;
  box-sizing: border-box;
  background-color: #f6f7f7;
  color: #2c3338;
}
.admin-login-form .submit-field input:focus {
  border-color: #3c434a;
  box-shadow: 0 0 0 1px #3c434a;
  outline: 2px solid transparent;
}
/* button carries the logotype's slate so the two read as one identity */
.admin-login-form .form-button-primary {
  background: #3c434a;
  color: #fff;
  border: 1px solid #3c434a;
  border-radius: 3px;
  padding: 4px 16px;
  font-size: 13px;
  line-height: 2.15384615;
  cursor: pointer;
  display: block;
  margin-left: auto;
}
.admin-login-form .form-button-primary:hover {
  background: #23282d;
  border-color: #23282d;
}
/* sending / sent / error notes share a reserved slot so the box never
   resizes as they come and go */
.admin-login-form .admin-message {
  min-height: 2.7em;
  margin: 12px 0 0;
}
.admin-login-form .admin-message[hidden] {
  display: block !important; /* outweigh the global [hidden] reset */
  visibility: hidden;
}

/* Fix inline-link to not look like a button */
.inline-link {
  background: transparent;
  padding: 0;
  border-radius: 0;
}

.admin-rich-text {
  min-height: 150px;
  background: #fff;
  color: #000;
}

.submit-rich-text {
  min-height: 200px;
  background: #fff;
  color: #000;
}

.submit-rich-text .ql-editor {
  min-height: 200px;
  font-size: 0.95rem;
  font-family: inherit;
}

/* Larger donate button for the about page */
.about-donate {
  font-size: 1.1rem;
  padding: 1em 2em;
}
