/* =========================================
   dancephl — home (the week, the listings, the footer)
   Two voices: Arial Bold for titles and counts, Fragment Mono for the rest.
   Values come from dancephl-brand/tokens.css. Built in js/supabase.js.
   ========================================= */

body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-mono);
}

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* tags: the only uppercase on the site — solid colour, ink text */
.tag {
  display: inline-block;
  font: 400 11px/16px var(--font-mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 3px 9px;
  border-radius: var(--radius-tag);
  color: var(--ink);
  white-space: nowrap;
}

.pink { background: var(--tag-pink); }
.mint { background: var(--tag-mint); }
.gold { background: var(--tag-gold); }
.blue { background: var(--tag-blue); }

.star { color: var(--star); font-family: var(--font-sans); font-weight: 700; }

/* ---- the week: seven days, each with its own stacked bar ---- */

.week {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  margin: 0 var(--side-pad);
  border-bottom: var(--stroke-rule) solid var(--ink);
}

/* hold the strip's space while the week loads, so nothing below jumps */
.week:empty { min-height: 100px; }

.dcol {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  padding: 14px 16px 16px;
  border-left: var(--stroke-hair) solid var(--hairline);
  color: var(--ink);
  text-decoration: none;
  min-width: 0;
}

.dcol:first-child { border-left: 0; padding-left: 0; }

a.dcol:hover .dn { color: var(--ink); }

.dcol .dn { font: 400 12px/16px var(--font-mono); color: var(--ink-muted); }
.dcol .dn-short { display: none; }

.dcol .ct {
  font: 700 28px/1 var(--font-sans);
  letter-spacing: -0.02em;
}

.dcol .ct small {
  font: 400 12px/16px var(--font-mono);
  color: var(--ink-muted);
  letter-spacing: 0;
}

.dcol.on { box-shadow: inset 0 -4px 0 var(--ink); }
.dcol.on .dn { color: var(--ink); }
.dcol.past, .dcol.past .dn { color: var(--ink-muted); }
.dcol.past .bar { opacity: 0.4; }

.bar { display: flex; height: 8px; gap: 2px; }
.bar i { display: block; height: 100%; transform-origin: left; animation: bar-grow 0.5s cubic-bezier(.42, 0, .58, 1); }

/* the one allowed move on the page: the day bars grow in once */
@keyframes bar-grow { from { transform: scaleX(0); } to { transform: scaleX(1); } }

.dcol:focus-visible,
.lg:focus-visible,
.row:focus-visible,
.site-foot a:focus-visible,
.site-foot button:focus-visible,
.site-foot input:focus-visible {
  outline: var(--stroke-rule) solid var(--focus);
  outline-offset: 2px;
}

/* ---- the legend: the week's totals per category, each also a filter ---- */

.legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 22px;
  margin: 0 var(--side-pad);
  border-bottom: var(--stroke-hair) solid var(--hairline);
  font: 400 12px/16px var(--font-mono);
  color: var(--ink-muted);
}

.legend-totals { display: flex; flex-wrap: wrap; gap: 0 22px; }

.lg {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  min-height: 48px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font: inherit;
  color: inherit;
}

.lg:hover { color: var(--ink); }
.lg b { color: var(--ink); font-weight: 400; }
.legend .sq { width: 10px; height: 10px; display: inline-block; }

.legend .count {
  margin: 0 0 0 auto;
  font: inherit;
  font-style: normal;
  color: var(--ink-muted);
}

/* ---- listings, day by day ---- */

.feed {
  min-height: 100vh;
  max-width: none;
  padding: 8px var(--side-pad) 56px;
}

/* while the feed loads, only "loading…" shows: the empty-state notes would
   otherwise sit in view and get pushed down as the rows arrive */
.feed:has(> #feedLoading:not([style*="none"])) > :not(#feedLoading) { display: none; }

.feed-loading {
  padding: 40px 0;
  font: 400 13px/18px var(--font-mono);
  color: var(--ink-muted);
  text-align: left;
}

.dh {
  display: flex;
  align-items: baseline;
  gap: var(--space-4);
  margin: 0;
  padding: 40px 0 12px;
  border-bottom: var(--stroke-rule) solid var(--ink);
  scroll-margin-top: 72px;
}

.dh .d {
  font: 700 44px/1 var(--font-sans);
  letter-spacing: -0.035em;
  color: var(--ink);
}

.dh .lab {
  margin-left: auto;
  font: 400 13px/18px var(--font-mono);
  color: var(--ink-muted);
}

/* the old feed's section labels give way to day-style headings */
.section-label.dh { font-size: inherit; text-transform: none; letter-spacing: 0; color: inherit; }
.section-label.dh::before, .section-label.dh::after { display: none; }

.section-desc {
  font: 400 13px/20px var(--font-mono);
  color: var(--ink-muted);
  margin: 12px 0 0;
}

.row {
  display: grid;
  grid-template-columns: 150px minmax(0, 1.5fr) minmax(0, 1fr) 160px 200px;
  gap: 24px;
  align-items: baseline;
  padding: 13px 0;
  border-bottom: var(--stroke-hair) solid var(--hairline);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

.row:hover .item-title { text-decoration: underline; text-underline-offset: 3px; }
a.row:visited, a.dcol:visited { color: var(--ink); }   /* rows are links; no visited purple */

/* the old calendar's item styles share these class names; keep them out
   (its hover nudged rows sideways, and type never moves) */
.row.item, .row.item-dir { display: grid; }
.row.item:hover, .row.item-dir:hover { margin: 0; padding-left: 0; padding-right: 0; background: none; }
.row .item-title { font: inherit; margin: 0; color: inherit; line-height: inherit; letter-spacing: inherit; }
.dh, .section-label.dh { border-top: 0; margin-top: 0; }

.row .t { font: 400 13px/20px var(--font-mono); }
.row .t small { font-size: 13px; color: var(--ink-muted); margin-left: 6px; }

.row .ti {
  font: 700 19px/1.2 var(--font-sans);
  letter-spacing: -0.015em;
  min-width: 0;
}

.row .note {
  display: block;
  font: 400 13px/18px var(--font-mono);
  letter-spacing: 0;
  color: var(--ink);
  margin-top: 4px;
}

.row .note::before { content: '— '; }

.row .who { font: 400 13px/20px var(--font-mono); color: var(--ink-muted); min-width: 0; }
.row .who b { font-weight: 400; color: var(--ink); }
.row .mp { display: none; }

.row .price {
  font: 400 13px/20px var(--font-mono);
  min-width: 0;
  overflow-wrap: anywhere;
  display: -webkit-box;            /* long prices wrap to two lines at most */
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.row .tg { text-align: right; }

.empty-state {
  font: 400 13px/20px var(--font-mono);
  color: var(--ink-muted);
  padding: 16px 0;
}

/* ---- footer: the weekly · new to philly dance? · listing is free ---- */

.site-foot { border-top: var(--stroke-rule) solid var(--ink); }

.foot {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 48px;
  padding: 36px var(--side-pad) 48px;
}

.foot h2 {
  font: 700 20px/1.1 var(--font-sans);
  letter-spacing: -0.015em;
  margin: 0 0 var(--space-2);
}

.foot p { font: 400 13px/20px var(--font-mono); color: var(--ink-muted); margin: 0; }

.foot .nl-form { display: flex; flex-direction: row; flex-wrap: nowrap; gap: 0; margin-top: 14px; max-width: 420px; }

.foot .nl-input {
  flex: 1;
  width: auto;
  margin: 0;
  min-width: 0;
  min-height: 48px;
  border: var(--stroke-hair) solid var(--hairline);
  border-right: 0;
  border-radius: var(--radius-0);
  padding: 10px 12px;
  font: 400 13px/18px var(--font-mono);
  color: var(--ink);
  background: var(--paper);
}

.foot .nl-input::placeholder { color: var(--ink-muted); }

.foot .nl-btn {
  flex: none;
  width: auto;
  margin: 0;
  min-height: 48px;
  border: 0;
  border-radius: var(--radius-0);
  background: var(--ink);
  color: var(--paper);
  padding: 10px 14px;
  font: 400 13px/18px var(--font-mono);
  cursor: pointer;
}

.foot .nl-ok { margin-top: var(--space-2); color: var(--ink); }

.foot .lk {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  font: 400 13px/18px var(--font-mono);
  color: var(--link);
  text-decoration: none;
}

.foot .lk:hover { text-decoration: underline; }

.base {
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: var(--space-2) var(--space-6);
  padding: 16px var(--side-pad);
  border-top: var(--stroke-hair) solid var(--hairline);
  font: 400 12px/16px var(--font-mono);
  color: var(--ink-muted);
}

.base a { color: inherit; text-decoration: none; display: inline-block; padding: 16px 0; margin: -16px 0; }
.base a:hover { color: var(--ink); text-decoration: underline; }

/* ---- phone ---- */

@media (max-width: 899px) {
  .week { margin: 0 var(--side-pad); }
  .week:empty { min-height: 76px; }
  .dcol { padding: 10px 6px 12px; gap: 6px; }
  .dcol .dn { font-size: 10px; }
  .dcol .dn-full, .dcol .ct small { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  .dcol .dn-short { display: inline; }
  .dcol .ct { font-size: 18px; }
  .bar { height: 6px; gap: 1px; }

  .legend { padding: 0; gap: 0 14px; }
  .legend-totals { gap: 0 14px; }
  .legend .count { display: none; }

  .feed { padding: 0 var(--side-pad) 24px; }
  .dh { padding-top: 24px; }
  .dh .d { font-size: 30px; }

  /* time and tag, then the title, then who · where · price */
  .row { grid-template-columns: 1fr auto; gap: 4px 12px; padding: 12px 0; }
  .row .t { grid-column: 1; grid-row: 1; }
  .row .tg { grid-column: 2; grid-row: 1; }
  .row .ti { grid-column: 1 / -1; font-size: 18px; }
  .row:not(.once) .ti { font-weight: 400; }     /* weekly classes in regular, one-offs bold */
  .row .who { grid-column: 1 / -1; }
  .row .price { display: none; }
  .row .mp { display: inline; }

  .foot { grid-template-columns: 1fr; gap: 28px; padding: 28px var(--side-pad); }
}
