/* Comedy Toronto public styles. Design reference: docs/design.md. */

/* Fonts: one fixed instance per face, Latin subset (licences beside the files). */
@font-face {
  font-family: "Bricolage Grotesque";
  src: url(/assets/fonts/bricolage-grotesque-800.cd7e89b300bb.woff2) format("woff2");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  src: url(/assets/fonts/source-serif-4-700.a17a67112c0c.woff2) format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* Tokens */
:root {
  color-scheme: light;
  --paper: #F5EEE7;
  --paper-strong: #FFF9F2;
  --ink: #1C2024;
  --muted-ink: #5F5956;
  --sky: #376D8C;
  --sky-deep: #28526D;
  --sky-light: #8BBFD3;
  --concrete: #D2B0A1;
  --concrete-light: #ECDBD3;
  --tower-red: #BE3545;
  --tower-red-deep: #9E2A38;
  --font-display: "Bricolage Grotesque", "Arial Narrow", sans-serif;
  --font-title: "Source Serif 4", Georgia, serif;
  --font-ui: ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --line: 2px solid var(--ink);
  --radius: 8px;
  --radius-small: 6px;
  --gutter: clamp(1rem, 4vw, 3.5rem);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  line-height: 1.45;
  -webkit-text-size-adjust: 100%;
}
body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
}
img { display: block; max-width: 100%; }
a { color: var(--sky-deep); }
a:hover { color: var(--ink); }
:focus-visible { outline: 3px solid var(--sky-deep); outline-offset: 3px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}
.skip-link {
  position: absolute;
  left: var(--gutter);
  top: -4rem;
  z-index: 1;
  padding: 0.5rem 0.75rem;
  background: var(--ink);
  color: var(--paper-strong);
  font-weight: 700;
}
.skip-link:focus { top: 0.75rem; color: var(--paper-strong); }
.icon {
  width: 1rem;
  height: 1rem;
  flex: none;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Masthead */
.masthead { display: grid; grid-template-columns: minmax(0, 1fr); }
.masthead-main {
  display: flex;
  flex-direction: column;
  gap: 0.875rem;
  padding: 1.25rem var(--gutter) 0;
}
.masthead-brand {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas: "wordmark mark" "tagline mark";
  align-items: end;
  column-gap: 0.625rem;
}
.wordmark {
  grid-area: wordmark;
  position: relative;
  justify-self: start;
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.125rem, 1rem + 6vw, 3.5rem);
  line-height: 0.88;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.wordmark:hover { color: var(--ink); }
.wordmark-city { color: var(--tower-red); }
.burst {
  display: none;
  position: absolute;
  left: -0.34em;
  top: -0.2em;
  width: 0.36em;
  height: 0.36em;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3.5;
  stroke-linecap: round;
}
.tagline {
  grid-area: tagline;
  margin: 0.45rem 0 0;
  color: var(--sky-deep);
  font-size: 0.75rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.tower-mark { grid-area: mark; width: 40px; height: 64px; }
.masthead-art { display: none; }

/* Night tabs: a boxed 4 × 2 grid on phones, one strip on the masthead rule from 40rem */
.night-tabs ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
  background: var(--ink);
  border: var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}
.night-tabs a {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  min-height: 3.25rem;
  height: 100%;
  background: var(--paper-strong);
  color: var(--ink);
  line-height: 1;
  text-decoration: none;
  text-transform: uppercase;
}
.night-tabs a:hover { background: var(--concrete-light); color: var(--ink); }
.night-tabs a:focus-visible { outline-offset: -6px; }
.night-tabs a[aria-current="page"] { background: var(--tower-red); color: var(--paper-strong); }
.night-tabs a[aria-current="page"]:focus-visible { outline-color: var(--paper-strong); }
.tab-tonight {
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.1875rem;
  letter-spacing: 0.02em;
}
.tab-day { font-size: 0.8125rem; font-weight: 800; letter-spacing: 0.08em; }
.tab-date { font-size: 0.75rem; font-weight: 600; letter-spacing: 0.03em; }

/* Page heading */
.page {
  flex: 1 0 auto;
  width: 100%;
  padding: 1.5rem var(--gutter) 2.5rem;
}
.page-heading {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
}
.page-heading h1 {
  display: flex;
  align-items: center;
  gap: 0.25em;
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  font-size: clamp(2.125rem, 1.2rem + 3.4vw, 3.75rem);
  line-height: 0.95;
  text-transform: uppercase;
}
.heading-marks {
  display: none;
  width: 0.5em;
  height: 0.5em;
  flex: none;
  fill: none;
  stroke: var(--ink);
  stroke-width: 3;
  stroke-linecap: round;
}
.page-meta {
  margin: 0;
  font-size: 0.8125rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

/* Listings and show panels */
.listings { display: grid; gap: 1rem; }
.panel {
  display: grid;
  grid-template-columns: 6.5rem minmax(0, 1fr);
  grid-template-rows: auto 1fr auto;
  grid-template-areas: "art title" "art desc" "foot foot";
  column-gap: 0.875rem;
  row-gap: 0.375rem;
  padding: 0.875rem;
  background: var(--paper-strong);
  border: var(--line);
  border-radius: var(--radius);
}
.panel-body { display: contents; }
.panel-art {
  grid-area: art;
  position: relative;
  align-self: start;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--concrete-light);
  border: var(--line);
  border-radius: var(--radius-small);
}
.panel-art img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}
.stamp {
  position: absolute;
  top: 0.5rem;
  left: -2px;
  padding: 0.25rem 0.45rem 0.2rem;
  background: var(--ink);
  color: var(--paper-strong);
  border: 2px solid var(--paper-strong);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 0.75rem;
  line-height: 1;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  transform: rotate(-5deg);
}
.panel-title {
  grid-area: title;
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.3125rem;
  line-height: 1.15;
  overflow-wrap: break-word;
}
.panel-description {
  grid-area: desc;
  align-self: start;
  margin: 0;
  color: var(--muted-ink);
  font-size: 0.875rem;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  line-clamp: 3;
  overflow: hidden;
}
.panel-foot {
  grid-area: foot;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  margin-top: 0.375rem;
}
.panel-facts {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem 1rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.875rem;
}
.panel-facts li { display: flex; align-items: center; gap: 0.375rem; min-width: 0; }
.fact-time { font-weight: 700; }

/* Buttons: filled buttons take their fill as border colour, so every button is the same size */
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  min-height: 2.875rem;
  padding: 0 1rem;
  border: 2px solid transparent;
  border-radius: var(--radius-small);
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-decoration: none;
  text-transform: uppercase;
  white-space: nowrap;
}
.button .icon { stroke-width: 2.5; }
.button-ticket { background: var(--tower-red); border-color: var(--tower-red); color: var(--paper-strong); }
.button-ticket:hover { background: var(--tower-red-deep); border-color: var(--tower-red-deep); color: var(--paper-strong); }
.button-ticket:focus-visible { outline-color: var(--ink); }
.button-quiet { background: transparent; border-color: var(--ink); color: var(--ink); }
.button-quiet:hover { background: var(--concrete-light); color: var(--ink); }
.button-nav { background: var(--sky-deep); border-color: var(--sky-deep); color: var(--paper-strong); }
.button-nav:hover { background: var(--ink); border-color: var(--ink); color: var(--paper-strong); }
.panel-foot .button { width: 100%; }

/* Empty state and 404 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.875rem;
  max-width: 40rem;
  padding: 1.5rem 1.25rem;
  background: var(--paper-strong);
  border: var(--line);
  border-radius: var(--radius);
}
.empty-art { width: 8.25rem; height: auto; }
.empty-state h2 {
  margin: 0;
  font-family: var(--font-title);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.15;
}
.empty-state p { margin: 0; color: var(--muted-ink); }

/* Footer */
.site-footer {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 1.25rem var(--gutter) 1.75rem;
  border-top: var(--line);
}
.site-footer p { margin: 0; color: var(--muted-ink); font-size: 0.8125rem; }
.site-footer .footer-mark {
  color: var(--ink);
  font-family: var(--font-display);
  font-weight: 800;
  font-size: 1.375rem;
  line-height: 1;
  text-transform: uppercase;
}
.footer-mark span { color: var(--tower-red); }

/* Development gallery */
.gallery-heading {
  margin: 2.5rem 0 1rem;
  font-size: 0.875rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--sky-deep);
}
.gallery-art { display: flex; flex-wrap: wrap; gap: 1rem; }
.gallery-art .panel-art { width: 10.5rem; }

/* Tablet: panels put the art beside every fact */
@media (min-width: 36rem) {
  .panel {
    grid-template-columns: 9rem minmax(0, 1fr);
    grid-template-rows: auto auto 1fr;
    grid-template-areas: "art title" "art desc" "art foot";
    column-gap: 1.25rem;
    row-gap: 0.5rem;
    padding: 1rem;
  }
  .panel-title { font-size: 1.625rem; line-height: 1.12; }
  .panel-description { font-size: 0.9375rem; line-height: 1.45; }
  .panel-foot {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: flex-end;
    align-self: end;
    justify-content: space-between;
    margin-top: 0.25rem;
  }
  .panel-facts { flex-direction: column; gap: 0.375rem; font-size: 0.9375rem; }
  .panel-foot .button { width: auto; min-height: 2.75rem; }
  .icon { width: 1.125rem; height: 1.125rem; }
  .stamp { top: 0.75rem; padding: 0.3rem 0.6rem 0.25rem; font-size: 1rem; }
  .empty-state { padding: 1.75rem; }
  .listings { max-width: 52rem; }
}

/* Tabs join the masthead rule as one strip */
@media (min-width: 40rem) {
  .masthead { border-bottom: var(--line); }
  .night-tabs ul {
    display: flex;
    max-width: 58.75rem;
    border-bottom: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    overflow: visible;
  }
  .night-tabs li { flex: 1 1 0; min-width: 0; }
  .night-tabs li:first-child a { border-top-left-radius: var(--radius-small); }
  .night-tabs li:last-child a { border-top-right-radius: var(--radius-small); }
  .night-tabs a { min-height: 4rem; gap: 4px; }
  .night-tabs a[aria-current="page"]::before,
  .night-tabs a[aria-current="page"]::after {
    content: "";
    position: absolute;
    left: 50%;
    clip-path: polygon(0 0, 100% 0, 50% 100%);
  }
  .night-tabs a[aria-current="page"]::before {
    bottom: -14px;
    width: 24px;
    height: 14px;
    margin-left: -12px;
    background: var(--ink);
  }
  .night-tabs a[aria-current="page"]::after {
    bottom: -10px;
    width: 18px;
    height: 10px;
    margin-left: -9px;
    background: var(--tower-red);
  }
  .tab-tonight { font-size: clamp(1.1875rem, 0.6rem + 1.2vw, 1.5rem); }
  .tab-day { font-size: 0.9375rem; }
  .tab-date { font-size: 0.8125rem; }
  .site-footer { flex-direction: row; align-items: center; justify-content: space-between; }
  .site-footer .footer-mark { font-size: 1.625rem; }
  .site-footer p { font-size: 0.875rem; }
}

/* Desktop: the skyline panel joins the masthead */
@media (min-width: 64rem) {
  .masthead { --art-width: clamp(17rem, 30vw, 27.5rem); grid-template-columns: minmax(0, 1fr) var(--art-width); }
  .masthead-main { justify-content: space-between; gap: 1.375rem; padding: 1.875rem 2.25rem 0 var(--gutter); }
  .masthead-brand { display: flex; align-items: center; gap: 1.875rem; padding-top: 0.375rem; }
  .wordmark { font-size: clamp(3.5rem, 0.6rem + 5.2vw, 6rem); }
  .burst { display: block; }
  .tagline {
    margin: 0;
    color: var(--ink);
    font-family: var(--font-display);
    font-size: clamp(1rem, 0.4rem + 1vw, 1.375rem);
    letter-spacing: 0;
    line-height: 1.02;
    transform: rotate(-6deg);
  }
  .tagline span { display: block; }
  .tower-mark { display: none; }
  /* A background, not an <img>, so phones that hide the panel never download it.
     The minimum height keeps the drawing's 440:236 ratio so the tower is never cropped. */
  .masthead-art {
    display: block;
    min-height: calc(var(--art-width) * 236 / 440);
    border-left: var(--line);
    background: var(--sky-light) url(/assets/art/skyline.3a95c4ccd6a9.svg) center bottom / cover no-repeat;
  }
  .page { padding-top: 2.875rem; }
  .page-heading { flex-direction: row; align-items: flex-end; justify-content: space-between; margin-bottom: 1.5rem; }
  .heading-marks { display: block; }
  .page-meta { margin-bottom: 0.25rem; font-size: 0.9375rem; }
}

/* Wide desktop: two columns of panels */
@media (min-width: 75rem) {
  .listings { max-width: none; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem; align-items: start; }
  .panel { grid-template-columns: 10.5rem minmax(0, 1fr); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
}
