/* ================================================================
   Shout — Twin Cities Music Calendar
   Light by default, dark when the visitor's system asks for it.
   Bright accents (lime, pink, periwinkle) only ever sit behind dark
   text (--on-accent) or decorate; text colors meet WCAG AA in both.
   ================================================================ */

:root {
  --bg: #F5F3EE;
  --surface: #FFFFFF;
  --ink: #111111;
  --ink-soft: #444444;
  --line: #111111;
  --shadow: #111111;
  --header-bg: #111111;
  --header-ink: #F5F3EE;
  --blue: #1F3BFF;
  --on-blue: #FFFFFF;
  --link: #1F3BFF;
  --lime: #D7FF3D;
  --pink: #FF4FA3;
  --periwinkle: #8FA0FF;
  --yellow: #FFD23F;
  --on-accent: #111111;
  --burst: #FF4FA3;          /* hero decoration; text crosses it */
  --pressed-bg: #111111;
  --pressed-ink: #D7FF3D;
  --focus: #1F3BFF;
  --font: 'Inter Tight', system-ui, sans-serif;
  --font-display: 'Anton', 'Arial Narrow', sans-serif;
  --radius: 16px;
  --radius-sm: 10px;
  --transition: 150ms ease;
  --starburst: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Cpath d='M50 4 L62 38 L96 50 L62 62 L50 96 L38 62 L4 50 L38 38 Z' fill='%23111111'/%3E%3C/svg%3E");
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --surface: #1E1E1E;
    --ink: #F5F3EE;
    --ink-soft: #BDBAB3;
    --line: #F5F3EE;
    --shadow: #D7FF3D;
    --header-bg: #000000;
    --header-ink: #F5F3EE;
    --blue: #8496FF;
    --on-blue: #111111;
    --link: #9AAAFF;
    --burst: #A3125C;
    --pressed-bg: #D7FF3D;
    --pressed-ink: #111111;
    --focus: #D7FF3D;
  }
}

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

/* --header-h is the pinned header's height, kept current by base.html's script. */
html { font-size: 16px; scroll-padding-top: var(--header-h, 4.5rem); }
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.5;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--link); }
a:hover { color: var(--ink); }

img { max-width: 100%; display: block; }

:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 1rem;
  top: -10rem;
  z-index: 300;
  padding: .75rem 1rem;
  background: var(--lime);
  color: var(--on-accent);
  font-weight: 700;
  border: 2px solid var(--on-accent);
}
.skip-link:focus { top: 1rem; }

/* ---- Container ---- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---- Header ---- */
.site-header {
  background: var(--header-bg);
  color: var(--header-ink);
  position: sticky;
  top: 0;
  z-index: 100;
}
#top:focus { outline: none; }   /* empty back-to-top target */

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-top: .75rem;
  padding-bottom: .75rem;
}

.logo {
  font-family: var(--font-display);
  font-size: 2.125rem;
  line-height: 1;
  letter-spacing: .04em;
  color: var(--lime);
  text-decoration: none;
}
.logo:hover { color: var(--lime); }

.main-nav { display: flex; flex-wrap: wrap; gap: .25rem; }
.main-nav a {
  padding: .75rem .875rem;
  color: var(--header-ink);
  font-weight: 700;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
}
.main-nav a:hover { color: var(--lime); }
.main-nav a[aria-current="page"] {
  text-decoration: underline;
  text-decoration-color: var(--lime);
  text-decoration-thickness: 3px;
  text-underline-offset: 6px;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 48px;
  height: 48px;
  background: none;
  border: 2px solid var(--header-ink);
  cursor: pointer;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 3px;
  background: var(--header-ink);
  transition: transform .25s, opacity .25s;
}
.site-header.nav-open .nav-toggle span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.site-header.nav-open .nav-toggle span:nth-child(2) { opacity: 0; }
.site-header.nav-open .nav-toggle span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---- Footer ---- */
.site-footer {
  margin-top: auto;
  padding: 2rem 0;
  background: var(--header-bg);
  color: var(--header-ink);
  font-size: .9375rem;
}
.site-footer .container {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem 2rem;
}
.footer-logo {
  font-family: var(--font-display);
  font-size: 1.5rem;
  letter-spacing: .04em;
  color: var(--lime);
  margin-right: .75rem;
  vertical-align: -.15em;
}
.footer-links { display: flex; flex-wrap: wrap; gap: .25rem 1.25rem; }

/* ---- Back to top ---- */
.back-to-top {
  position: fixed;
  right: 1.25rem;
  bottom: 1.25rem;
  z-index: 90;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  background: var(--lime);
  border: 3px solid var(--on-accent);
  border-radius: 50%;
  box-shadow: 4px 4px 0 var(--on-accent);
  color: var(--on-accent);
  visibility: hidden;   /* also keeps it out of the tab order until shown */
  opacity: 0;
  transition: opacity var(--transition), visibility var(--transition);
}
.back-to-top.is-visible { visibility: visible; opacity: 1; }
.back-to-top:hover { color: var(--on-accent); background: var(--surface); }
@media (prefers-color-scheme: dark) {
  .back-to-top:hover { color: var(--ink); }
}
.footer-links a { display: inline-block; padding: .5rem 0; color: var(--header-ink); }
.footer-links a:hover { color: var(--lime); }

/* ---- Buttons ---- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-height: 48px;
  padding: 0 1.5rem;
  border: 2px solid transparent;
  border-radius: 0;
  font-family: inherit;
  font-weight: 700;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
  cursor: pointer;
  transition: background var(--transition), color var(--transition);
}
.btn-primary { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.btn-primary:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.btn-accent { background: var(--lime); border-color: var(--line); color: var(--on-accent); }
.btn-accent:hover { background: var(--ink); color: var(--bg); }
.btn-outline { background: var(--surface); border-color: var(--line); color: var(--ink); }
.btn-outline:hover { background: var(--ink); color: var(--bg); }
.btn-ghost { background: transparent; color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.btn-ghost:hover { color: var(--link); }
.btn-disabled { background: transparent; border-color: var(--ink-soft); color: var(--ink-soft); cursor: not-allowed; }
.btn-lg { min-height: 56px; padding: 0 1.75rem; font-size: 1rem; }

/* ---- Badges, tags, pills, chips ---- */
.badge {
  display: inline-block;
  align-self: flex-start;
  font-size: .75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  padding: .15rem .6rem;
  border: 2px solid var(--on-accent);
  border-radius: 999px;
  color: var(--on-accent);
  background: var(--surface);
}
.badge-featured { background: var(--lime); }
.badge-sold_out { background: var(--periwinkle); }
.badge-cancelled { background: var(--pink); }
.badge-postponed { background: var(--yellow); }
.badge-lg { font-size: .875rem; padding: .25rem .8rem; }

.tag {
  display: inline-block;
  padding: .05rem .5rem;
  background: var(--lime);
  color: var(--on-accent);
  font-weight: 700;
  font-size: .875rem;
}
.tag--plain { background: none; color: var(--ink); padding: 0; }

.pill {
  align-self: flex-start;
  display: inline-block;
  padding: .25rem .875rem;
  background: var(--lime);
  border: 2px solid var(--on-accent);
  border-radius: 999px;
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}
.pill:hover { background: var(--surface); color: var(--ink); border-color: var(--line); }

.chip {
  min-height: 48px;
  padding: 0 1.25rem;
  border: 2px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: .9375rem;
  cursor: pointer;
}
.chip:hover { border-width: 3px; padding: 0 calc(1.25rem - 1px); }
.chip[aria-pressed="true"] { background: var(--pressed-bg); border-color: var(--pressed-bg); color: var(--pressed-ink); }

.chip-static {
  align-self: flex-start;
  display: inline-block;
  padding: .1rem .625rem;
  background: var(--lime);
  border: 2px solid var(--on-accent);
  border-radius: 999px;
  color: var(--on-accent);
  font-weight: 700;
  font-size: .875rem;
}

/* ---- Headings ---- */
.page-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.02;
  margin: 2.5rem 0 1.5rem;
}
.section-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 2.25rem;
  line-height: 1.1;
}
.section-title--ruled { padding-bottom: .75rem; border-bottom: 6px solid var(--line); margin-bottom: 0; }
.section-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .75rem;
  padding-bottom: .75rem;
  border-bottom: 6px solid var(--line);
}
.section-heading a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); }

/* ---- Homepage hero ---- */
.hero {
  position: relative;
  overflow: hidden;
  border-bottom: 2px solid var(--line);
}
.hero::before {
  content: '';
  position: absolute;
  right: -60px;
  top: -50px;
  width: 260px;
  height: 260px;
  background: var(--burst);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'%3E%3Cpath d='M200 10 L235 140 L370 110 L265 200 L370 290 L235 260 L200 390 L165 260 L30 290 L135 200 L30 110 L165 140 Z'/%3E%3C/svg%3E") center / contain no-repeat;
          mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 400'%3E%3Cpath d='M200 10 L235 140 L370 110 L265 200 L370 290 L235 260 L200 390 L165 260 L30 290 L135 200 L30 110 L165 140 Z'/%3E%3C/svg%3E") center / contain no-repeat;
}
/* Kept short so the first shows are in view on arrival. */
.hero .container { position: relative; padding-top: 1.75rem; padding-bottom: 1.75rem; }
.hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 6vw, 4.5rem);   /* as .page-title */
  line-height: 1.02;
  letter-spacing: .01em;
}
.highlight {
  display: inline-block;
  line-height: 1;
  padding: .04em .1em 0;
  background: var(--lime);
  color: var(--on-accent);
  white-space: nowrap;
}
.hero-intro { margin-top: .625rem; max-width: 40rem; font-size: 1.0625rem; font-weight: 500; }

/* ---- Featured Event ---- */
.featured-event {
  display: flex;
  margin-top: 2rem;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  overflow: hidden;
}
.featured-image { flex: 0 0 420px; min-height: 280px; border-right: 3px solid var(--line); }
.featured-body {
  padding: 2rem 2.25rem;
  display: flex;
  flex-direction: column;
  gap: .875rem;
  justify-content: center;
}
.featured-title { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 2.25rem; line-height: 1.05; }
.featured-title a { color: var(--ink); text-decoration: none; }
.featured-title a:hover { text-decoration: underline; }
.featured-meta { font-weight: 500; }
.featured-body .btn { align-self: flex-start; }

/* ---- Events Section ---- */
.events-section { padding: 1.75rem 0 3.5rem; }

/* ---- Filter Form ---- */
.filter-form { display: flex; flex-direction: column; gap: 1.25rem; }
.filter-row { display: flex; flex-wrap: wrap; align-items: flex-end; gap: .75rem 1.25rem; }
.quick-dates { border: 0; min-width: 0; }
.quick-dates legend { padding: 0; margin-bottom: .375rem; }
.quick-dates-buttons { display: flex; flex-wrap: wrap; gap: .5rem; }
.field { display: flex; flex-direction: column; gap: .375rem; min-width: 0; }
.field--date { flex: 0 1 11rem; }
.field--search { flex: 1 1 18rem; }
.field-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; }
.filter-clear { display: inline-block; line-height: 1.5rem; /* 24px target */ font-size: .875rem; font-weight: 700; color: var(--ink); text-underline-offset: 3px; }
.filter-clear:hover { color: var(--link); }
.search-combo { display: flex; }
.search-combo .filter-input { flex: 1; min-width: 0; border-right: 0; }
.search-combo .btn-search { flex: none; padding: 0 1.125rem; }
.field-label {
  font-weight: 700;
  font-size: .8125rem;
  text-transform: uppercase;
  letter-spacing: .06em;
}
.filter-input,
.filter-select {
  width: 100%;
  height: 50px;
  padding: 0 .75rem;
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  font: inherit;
}
.filter-row .btn { min-height: 50px; }
.filter-toggle { display: none; }   /* phones only */

/* ---- View toggle ---- */
/* Labelled above, like the fields, at the right end of the row. */
.view-controls {
  display: flex;
  flex-direction: column;
  gap: .375rem;
  margin-left: auto;
}
.view-toggle { display: flex; border: 2px solid var(--line); }
.view-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 46px;   /* + the 2px group border = the 50px fields */
  padding: 0 1.25rem;
  border: 0;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-weight: 700;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  cursor: pointer;
}
.view-toggle-btn + .view-toggle-btn { border-left: 2px solid var(--line); }
.view-toggle-btn[aria-pressed="true"] { background: var(--pressed-bg); color: var(--pressed-ink); }

/* ---- Day Group ---- */
.day-group { margin-top: 1.5rem; }
.day-heading {
  position: sticky;
  top: var(--header-h, 4.5rem);
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding: .875rem 0 .75rem;
  background: var(--bg);
  border-bottom: 6px solid var(--line);
}
.day-heading h2 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 3rem;
  line-height: 1;
}
.day-note { font-weight: 700; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; }

.load-more { text-align: center; margin-top: 2.75rem; }
.load-more-btn { gap: .5rem; min-height: 56px; padding: 0 2rem; }
.load-more-dates::before { content: '·'; margin-right: .5rem; }
.load-more-btn:disabled { cursor: wait; }

/* ---- Event images (cards, rows, featured, event page) ---- */
.event-image {
  display: block;
  position: relative;
  overflow: hidden;
  background: var(--surface);
}
.event-image img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;      /* crop from the bottom so heads stay in frame */
}
/* Black behind logos in both schemes: some are transparent with light artwork. */
.event-image img.is-logo { object-fit: contain; object-position: center; padding: 8%; background: #111111; }
.event-image--placeholder { background: var(--ph, var(--lime)) var(--starburst) center / 64px no-repeat; }

/* ---- Event listings: list view (the default) ---- */
.event-grid { display: block; }
.event-card {
  display: grid;
  grid-template-columns: 6.5rem 12.5rem minmax(0, 1fr) auto;
  align-items: center;
  gap: 1rem 1.75rem;
  padding: 1.25rem 0;
  border-bottom: 2px solid var(--line);
}
.event-card:nth-child(3n+2) { --ph: var(--pink); }
.event-card:nth-child(3n) { --ph: var(--periwinkle); }

.event-card-time { font-family: var(--font-display); font-size: 1.875rem; line-height: 1; text-transform: uppercase; }
.event-time-sub { display: block; margin-top: .3rem; font-family: var(--font); font-weight: 700; font-size: .875rem; }

.event-card .event-image { width: 12.5rem; height: 8.125rem; border: 2px solid var(--line); }

.event-card-body { min-width: 0; display: flex; flex-direction: column; gap: .3rem; }
.event-card-title,
.mini-card-title,
.featured-title,
.blog-card-title,
.post-title { overflow-wrap: anywhere; }   /* "Band/Band/Band" bills have no spaces */
.event-card-title { font-size: 1.5rem; font-weight: 700; line-height: 1.2; letter-spacing: -.01em; }
.event-card-title a { color: var(--ink); text-decoration: none; }
.event-card-title a:hover { text-decoration: underline; }
.event-card-meta { display: flex; flex-wrap: wrap; align-items: center; gap: .25rem .75rem; font-weight: 500; }
.event-card-venue { color: var(--ink); text-decoration: none; }
.event-card-venue:hover { color: var(--ink); text-decoration: underline; }

.event-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .5rem;
  min-width: 9.5rem;
  min-height: 48px;
  padding: 0 1.25rem;
  border: 2px solid var(--line);
  font-weight: 700;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  text-decoration: none;
}
.event-action--tickets { background: var(--blue); border-color: var(--blue); color: var(--on-blue); }
.event-action--free { background: var(--lime); border-color: var(--on-accent); color: var(--on-accent); }
.event-action--info { background: var(--surface); color: var(--ink); }
.event-action:hover { text-decoration: underline; text-underline-offset: 3px; }
.event-action--tickets:hover { color: var(--on-blue); }
.event-action--free:hover { color: var(--on-accent); }
.event-action--info:hover { color: var(--ink); }

/* ---- Event listings: card view ---- */
.events-section[data-view="card"] .event-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18.75rem, 1fr));
  gap: 1.75rem;
  padding-top: 1.75rem;
}
.events-section[data-view="card"] .event-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
  padding: 0;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  overflow: hidden;
}
.events-section[data-view="card"] .event-image {
  order: -1;
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  border: 0;
  border-bottom: 3px solid var(--line);
}
.events-section[data-view="card"] .event-card-time {
  position: absolute;
  z-index: 1;
  top: .75rem;
  left: .75rem;
  display: flex;
  gap: .3em;
  padding: .1rem .75rem;
  background: var(--lime);
  border: 2px solid var(--on-accent);
  border-radius: 999px;
  color: var(--on-accent);
  font-family: var(--font);
  font-weight: 700;
  font-size: .9375rem;
  line-height: 1.5;
}
.events-section[data-view="card"] .event-time-sub { display: inline; margin: 0; font-size: inherit; }
.events-section[data-view="card"] .event-card-body { flex: 1; padding: 1.125rem 1.25rem 0; }
.events-section[data-view="card"] .event-card-title { font-size: 1.375rem; }
.events-section[data-view="card"] .event-action { align-self: flex-start; min-width: 0; margin: 1rem 1.25rem 1.25rem; border-radius: var(--radius-sm); }

/* ---- Event Detail ---- */
.event-detail { padding: 1.5rem 0 4.5rem; }

.back-link {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  min-height: 44px;
  font-weight: 700;
  font-size: .875rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--ink);
  text-decoration: none;
}
.back-link:hover { text-decoration: underline; color: var(--ink); }

.past-event-banner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem 1.5rem;
  margin-top: 1rem;
  padding: 1.125rem 1.375rem;
  background: var(--pink);
  color: var(--on-accent);
  border: 3px solid var(--on-accent);
  border-radius: var(--radius);
  font-size: 1.125rem;
}

.event-detail-hero { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 2.5rem; margin-top: 1.25rem; }
.event-hero-image {
  flex: 1 1 26rem;
  max-width: 35rem;
  aspect-ratio: 1 / 1;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 8px 8px 0 var(--shadow);
}
.event-hero-body { flex: 1 1 26rem; min-width: 0; display: flex; flex-direction: column; gap: 1.25rem; }
.event-hero-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.75rem, 6vw, 4.75rem);
  line-height: 1.02;
  overflow-wrap: anywhere;
}

/* The 2px gaps show the line color through, drawing the rules between boxes;
   boxes grow to fill each row so no gap is left over. */
.event-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  background: var(--line);
  border: 2px solid var(--line);
}
.event-facts div { flex: 1 1 9.5rem; padding: .875rem 1rem; background: var(--surface); }
.event-facts dt { font-weight: 700; font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; }
.event-facts dd { margin-top: .25rem; font-family: var(--font-display); font-size: 1.625rem; line-height: 1.1; text-transform: uppercase; }

.event-artists a { color: var(--ink); }

.event-venue-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: .75rem;
  padding-top: 1.25rem;
  border-top: 2px solid var(--line);
}
.event-venue-line a { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); text-decoration-thickness: 2px; text-underline-offset: 4px; }

.event-description { max-width: 47.5rem; margin-top: 3.5rem; }
.event-description .section-title { margin-bottom: .75rem; }
.prose { font-size: 1.1875rem; line-height: 1.6; max-width: 47.5rem; }
.prose p + p { margin-top: 1rem; }
.prose a { color: var(--link); }

.related-events { margin-top: 4rem; }

.mini-cards {
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.5rem;
  margin-top: 1.75rem;
}
.mini-card {
  display: flex;
  flex-direction: column;
  gap: .625rem;
  padding: 1.125rem 1.25rem;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 5px 5px 0 var(--shadow);
}
.mini-card:nth-child(3n+2) .chip-static { background: var(--pink); }
.mini-card:nth-child(3n) .chip-static { background: var(--periwinkle); }
.mini-card-title { font-size: 1.1875rem; font-weight: 700; line-height: 1.25; }
.mini-card-title a { color: var(--ink); text-decoration: none; }
.mini-card-title a:hover { text-decoration: underline; }

/* ---- Venue Grid ---- */
.venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(15rem, 1fr));
  gap: 1.75rem;
  padding-bottom: 4rem;
}

.venue-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  overflow: hidden;
  color: var(--ink);
  text-decoration: none;
}
.venue-card:hover { color: var(--ink); }
.venue-card:hover .venue-card-name { text-decoration: underline; }
.venue-card:nth-child(3n+2) { --ph: var(--pink); }
.venue-card:nth-child(3n) { --ph: var(--periwinkle); }

/* Venue logos fill their box (cropping if they must). Best upload: 1200x800, 3:2,
   artwork kept clear of the edges. Black shows behind transparent logos. */
.venue-card-image {
  aspect-ratio: 3 / 2;
  border-bottom: 3px solid var(--line);
  background-color: #111111;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.venue-card-image--placeholder { padding: 0; background: var(--ph, var(--lime)) var(--starburst) center / 56px no-repeat; }
.venue-card-body { padding: 1rem 1.125rem 1.125rem; }
.venue-card-name { font-size: 1.1875rem; font-weight: 700; line-height: 1.25; }
.venue-card-location { margin-top: .2rem; color: var(--ink-soft); font-weight: 500; }

/* ---- Venue Detail ---- */
.venue-detail { padding: 2rem 0 4.5rem; }
.venue-detail-header {
  display: flex;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  overflow: hidden;
  margin-bottom: 3rem;
}
.venue-hero-image {
  flex: 0 0 340px;
  min-height: 260px;
  border-right: 3px solid var(--line);
  background-color: #111111;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.venue-hero-body {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2rem;
  padding: 2rem 2.25rem;
}
.venue-hero-info { flex: 1 1 240px; display: flex; flex-direction: column; align-items: flex-start; gap: .75rem; }
.venue-hero-body h1 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 5vw, 3.5rem);
  line-height: 1.02;
}
.venue-meta { font-weight: 500; }
.venue-map-wrap { flex: 1 1 300px; display: flex; flex-direction: column; gap: .5rem; }
.venue-map {
  flex: 1;
  min-height: 220px;
  border: 2px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--bg);
  z-index: 0;
}
.venue-directions { align-self: flex-end; display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); }
.venue-map .leaflet-control-zoom a { background: var(--surface); color: var(--ink); border-color: var(--line); }
.venue-map .leaflet-control-attribution { background: var(--surface); color: var(--ink-soft); }
.venue-map .leaflet-control-attribution a { color: var(--ink-soft); }

.venue-events-section { margin-bottom: 3.5rem; padding: 0; }
.venue-events-section .open-mic-grid { margin-top: 1.75rem; }

.past-events-list { list-style: none; }
.past-events-list li {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: .25rem 1rem;
  padding: .875rem 0;
  border-bottom: 2px solid var(--line);
}
.past-events-list a { color: var(--ink); font-weight: 700; }
.past-date { font-weight: 500; }

/* ---- Content pages (privacy, terms, accessibility, sitemap) ---- */
.content-page {
  padding: 0 0 4.5rem;
  max-width: 47.5rem;
}
.content-meta { color: var(--ink-soft); margin-bottom: 2rem; }
.content-page h2 { font-size: 1.375rem; font-weight: 700; margin: 2rem 0 .5rem; }
.content-page p,
.content-page ul { line-height: 1.7; margin-bottom: .875rem; }
.content-page ul { padding-left: 1.5rem; }

.sitemap-list { list-style: none; padding: 0; display: flex; flex-direction: column; gap: .35rem; margin-bottom: 0; }
.sitemap-list li::before { content: '→'; margin-right: .5rem; font-weight: 700; }
.sitemap-list a { color: var(--ink); }
.sitemap-list a:hover { color: var(--link); }
.sitemap-venues { columns: 2; column-gap: 2rem; }

/* ---- Forms (contact) ---- */
.contact-section { padding: 0 0 4.5rem; }
.contact-form-wrap { max-width: 600px; }
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.25rem; }
.form-group { display: flex; flex-direction: column; gap: .375rem; }
.form-group label { font-size: .8125rem; font-weight: 700; text-transform: uppercase; letter-spacing: .06em; }
.form-group .required { color: var(--ink); }

.form-group input,
.form-group textarea,
.form-group select {
  background: var(--surface);
  border: 2px solid var(--line);
  border-radius: 0;
  color: var(--ink);
  min-height: 50px;
  padding: .75rem;
  font: inherit;
  resize: vertical;
}
.form-group select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%23767676' stroke-width='2' fill='none'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .85rem center;
  padding-right: 2.25rem;
}
.form-group.has-error input,
.form-group.has-error textarea,
.form-group.has-error select { border-width: 3px; }
.field-error { font-weight: 700; font-size: .9375rem; }
.field-error::before { content: '⚠ '; }
.contact-form .btn { align-self: flex-start; }

.contact-success,
.contact-error {
  max-width: 600px;
  padding: 1.25rem 1.5rem;
  border: 3px solid var(--on-accent);
  border-radius: var(--radius);
  color: var(--on-accent);
  font-weight: 500;
}
.contact-success { background: var(--lime); }
.contact-error { background: var(--pink); margin-bottom: 1.25rem; }

/* ---- Blog List ---- */
.blog-section { padding: 0 0 4.5rem; }
.blog-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(20rem, 1fr));
  gap: 1.75rem;
}
.blog-card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  overflow: hidden;
}
.blog-card-image {
  display: block;
  height: 200px;
  flex-shrink: 0;
  border-bottom: 3px solid var(--line);
  background-size: cover;
  background-position: top;
}
.blog-card-image--placeholder { background: var(--pink) var(--starburst) center / 64px no-repeat; }
.blog-card-body { padding: 1.25rem; display: flex; flex-direction: column; gap: .5rem; flex: 1; }
.blog-card-date { font-weight: 700; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; }
.blog-card-title { font-size: 1.375rem; font-weight: 700; line-height: 1.25; }
.blog-card-title a { color: var(--ink); text-decoration: none; }
.blog-card-title a:hover { text-decoration: underline; }
.blog-card-excerpt { color: var(--ink-soft); flex: 1; }
.blog-read-more { margin-top: auto; font-weight: 700; color: var(--ink); }

/* ---- Blog Detail ---- */
.post-detail { padding: 2.5rem 0 4.5rem; }
.post-detail .container { max-width: 780px; }
.post-header { margin-bottom: 2rem; }
.post-date { font-weight: 700; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; margin-bottom: .75rem; }
.post-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.04;
}
.post-excerpt { margin-top: 1rem; font-size: 1.1875rem; color: var(--ink-soft); }
.post-cover {
  margin-bottom: 2rem;
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  overflow: hidden;
}
.post-cover img { width: 100%; max-height: 480px; object-fit: cover; object-position: top; }

/* WYSIWYG body typography */
.post-body { font-size: 1.125rem; line-height: 1.75; }
.post-body h2 { font-size: 1.625rem; font-weight: 700; line-height: 1.25; margin: 2rem 0 .75rem; }
.post-body h3 { font-size: 1.3125rem; font-weight: 700; margin: 1.75rem 0 .6rem; }
.post-body h4 { font-size: 1.125rem; font-weight: 700; margin: 1.5rem 0 .5rem; }
.post-body p { margin-bottom: 1.1rem; }
.post-body ul,
.post-body ol { margin: 0 0 1.1rem 1.5rem; }
.post-body li { margin-bottom: .35rem; }
.post-body blockquote {
  margin: 1.5rem 0;
  padding: 1rem 1.25rem;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  font-style: italic;
}
.post-body a { color: var(--link); }
.post-body figure { margin: 1.5rem 0; }
.post-body img { max-width: 100%; border-radius: var(--radius-sm); }
.post-body figcaption { font-size: .9375rem; color: var(--ink-soft); margin-top: .4rem; text-align: center; }
.post-body table { width: 100%; border-collapse: collapse; margin-bottom: 1.1rem; font-size: 1rem; }
.post-body th,
.post-body td { border: 2px solid var(--line); padding: .5rem .75rem; text-align: left; }
.post-body th { background: var(--surface); font-weight: 700; }

/* Responsive video embeds (YouTube, Vimeo) */
.post-body iframe,
.post-body .media { width: 100%; }
.post-body .media { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; border-radius: var(--radius-sm); }
.post-body .media iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }
.post-body figure.media { margin: 1.5rem 0; }

.post-footer { margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--line); }

/* ---- Open Mics ---- */
.open-mics-section { padding: 0 1.5rem 4rem; }
.open-mics-section h1 {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 6vw, 4.5rem);
  line-height: 1.02;
  margin: 2.5rem 0 .75rem;
}
.open-mics-intro { max-width: 40rem; margin-bottom: 1rem; font-size: 1.1875rem; font-weight: 500; }

.open-mic-day-group { margin-top: 2rem; }
.open-mic-day-heading {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: 2.5rem;
  line-height: 1;
  padding-bottom: .75rem;
  border-bottom: 6px solid var(--line);
  margin-bottom: 1.75rem;
}

.open-mic-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(17.5rem, 1fr));
  gap: 1.75rem;
}
.open-mic-card {
  display: flex;
  flex-direction: column;
  gap: .3rem;
  padding: 1.25rem;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
  color: var(--ink);
  text-decoration: none;
}
.open-mic-card:hover { color: var(--ink); }
.open-mic-card:hover .open-mic-card-name { text-decoration: underline; }
.open-mic-card-name { font-weight: 700; font-size: 1.25rem; line-height: 1.25; }
.open-mic-card-venue { font-weight: 700; font-size: .875rem; text-transform: uppercase; letter-spacing: .06em; }
.open-mic-card-time {
  align-self: flex-start;
  margin-top: .375rem;
  padding: .05rem .6rem;
  background: var(--lime);
  border: 2px solid var(--on-accent);
  border-radius: 999px;
  color: var(--on-accent);
  font-weight: 700;
  font-size: .9375rem;
}
.open-mic-card-schedule { color: var(--ink-soft); font-style: italic; }

/* Open Mic Detail */
.open-mic-detail { padding: 2rem 0 4.5rem; }
.open-mic-detail-header {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 1rem;
  padding: 2rem 2.25rem;
  margin-bottom: 2rem;
  background: var(--surface);
  border: 3px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--shadow);
}
.open-mic-venue-link {
  display: inline-block;
  padding: .25rem .875rem;
  background: var(--lime);
  border: 2px solid var(--on-accent);
  border-radius: 999px;
  color: var(--on-accent);
  font-weight: 700;
  text-decoration: none;
}
.open-mic-venue-link:hover { color: var(--on-accent); text-decoration: underline; }
.open-mic-detail-title {
  font-family: var(--font-display);
  font-weight: 400;
  text-transform: uppercase;
  font-size: clamp(2.5rem, 5vw, 3.75rem);
  line-height: 1.02;
}
.open-mic-detail-meta { list-style: none; display: flex; flex-direction: column; gap: .4rem; }
.open-mic-detail-meta strong { display: inline-block; min-width: 6rem; font-size: .8125rem; text-transform: uppercase; letter-spacing: .06em; }
.open-mic-back { display: inline-flex; align-items: center; min-height: 44px; font-weight: 700; color: var(--ink); }

/* ---- Empty state ---- */
.empty-state { text-align: center; padding: 4rem 0; font-size: 1.1875rem; font-weight: 500; }

/* ---- Error pages ---- */
.error-section { text-align: center; padding: 4rem 0 5rem; }
.error-code {
  display: inline-block;
  padding: 0 .15em;
  margin-bottom: 1rem;
  background: var(--lime);
  color: var(--on-accent);
  font-family: var(--font-display);
  font-size: 8rem;
  line-height: 1.05;
}
.error-section .page-title { margin-top: 0; }
.error-message { margin-bottom: 2rem; font-size: 1.1875rem; }
.error-actions { display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }

/* ---- Site messages (e.g. sign-in confirmations) ---- */
.site-messages { list-style: none; margin-top: 1.5rem; }
.site-message {
  padding: .875rem 1.125rem;
  margin-bottom: .5rem;
  background: var(--lime);
  border: 2px solid var(--on-accent);
  border-radius: var(--radius-sm);
  color: var(--on-accent);
  font-weight: 500;
}

/* ---- Sign-in & two-factor pages (django-allauth) ---- */
.account-page { max-width: 480px; margin: 0 auto; padding: 2.5rem 1rem 4rem; }
.account-page h1 { font-family: var(--font-display); font-weight: 400; text-transform: uppercase; font-size: 2.5rem; line-height: 1.05; margin-bottom: 1.25rem; }
.account-page h2 { font-size: 1.25rem; font-weight: 700; margin: 1.75rem 0 .75rem; }
.account-page p { margin-bottom: 1rem; }
.account-page form { display: flex; flex-direction: column; gap: 1rem; margin-bottom: 1.25rem; }
.account-page label { display: block; font-size: .875rem; font-weight: 700; margin-bottom: .35rem; }
.account-page input[type="text"],
.account-page input[type="password"],
.account-page input[type="email"],
.account-page input[type="number"] {
  width: 100%;
  min-height: 48px;
  padding: .6rem .85rem;
  background: var(--surface);
  border: 2px solid var(--line);
  color: var(--ink);
  font: inherit;
}
.account-page button,
.account-page input[type="submit"] {
  align-self: flex-start;
  min-height: 48px;
  padding: 0 1.5rem;
  background: var(--blue);
  border: 2px solid var(--blue);
  color: var(--on-blue);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}
.account-page button:hover { background: var(--ink); border-color: var(--ink); color: var(--bg); }
.account-page ul { margin: 0 0 1rem 1.25rem; }
.account-page img { background: #fff; padding: .5rem; border-radius: var(--radius-sm); }  /* QR code */
.account-page .errorlist { list-style: none; margin: 0; font-weight: 700; }

/* ---- Responsive ---- */
/* No room for one row of filters: search drops to its own line below. */
@media (max-width: 1100px) {
  .view-controls { order: 2; }
  .field--search { order: 3; flex-basis: 100%; }
}

@media (max-width: 1000px) {
  .event-card { grid-template-columns: 5.5rem 9rem minmax(0, 1fr) auto; gap: 1rem 1.25rem; }
  .event-card .event-image { width: 9rem; height: 6.25rem; }
  .featured-image { flex-basis: 320px; }
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    background: var(--header-bg);
    padding: .25rem 1.5rem 1.25rem;
    gap: 0;
    border-bottom: 3px solid var(--lime);
  }
  .main-nav a { padding: .875rem 0; font-size: 1rem; border-bottom: 1px solid #444444; }
  .main-nav a:last-child { border-bottom: none; }
  .site-header.nav-open .main-nav { display: flex; }

  .hero::before { width: 150px; height: 150px; right: -50px; top: -40px; }
  .hero .container { padding-top: 1.25rem; padding-bottom: 1.25rem; }

  .featured-event { flex-direction: column; }
  .featured-image { flex: none; min-height: 0; aspect-ratio: 3 / 2; border-right: 0; border-bottom: 3px solid var(--line); }
  .featured-body { padding: 1.25rem; }

  .field--date, .field--search { flex: 1 1 100%; }

  /* Phones: quick dates, then Filters + view on one row; the rest folds away. */
  .filter-form { gap: .75rem; }
  .quick-dates { flex: 1 1 100%; }
  .quick-dates-buttons { flex-wrap: nowrap; gap: .375rem; }
  .quick-dates-buttons .chip { flex: 1 1 auto; padding: 0 .5rem; font-size: .875rem; }
  .quick-dates-buttons .chip:hover { padding: 0 calc(.5rem - 1px); }
  .filter-toggle:not([hidden]) { display: inline-flex; padding: 0 .875rem; }
  .filter-toggle[aria-expanded="true"] { background: var(--pressed-bg); border-color: var(--pressed-bg); color: var(--pressed-ink); }
  .field--date, .field--search { order: 3; }
  .filter-form.is-collapsed .filter-extra { display: none; }
  .view-controls #view-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .view-toggle-btn { padding: 0 .875rem; }

  .day-heading h2 { font-size: 2.25rem; }

  /* Phones, list view: time beside the title, no thumbnail, button underneath. */
  .event-card {
    grid-template-columns: 4.25rem minmax(0, 1fr);
    grid-template-areas: "time body" ". action";
    align-items: start;
    gap: .75rem 1rem;
  }
  .event-card-time { grid-area: time; font-size: 1.5rem; }
  .event-card .event-image { display: none; }
  .event-card-body { grid-area: body; }
  .event-card-title { font-size: 1.25rem; }
  .event-action { grid-area: action; justify-self: start; min-width: 0; }
  .events-section[data-view="card"] .event-card .event-image { display: block; }

  .event-detail-hero { gap: 1.75rem; }
  .event-hero-image { box-shadow: 5px 5px 0 var(--shadow); }
  .section-title { font-size: 1.875rem; }

  .venue-detail-header { flex-direction: column; }
  .venue-hero-image { flex: none; min-height: 0; aspect-ratio: 3 / 2; border-right: 0; border-bottom: 3px solid var(--line); }
  .venue-hero-body { flex-direction: column; padding: 1.25rem; }
  .venue-hero-info, .venue-map-wrap { flex: none; }

  .form-row { grid-template-columns: 1fr; }
  .sitemap-venues { columns: 1; }
  .site-footer .container { flex-direction: column; align-items: flex-start; }
}
