/* ============================================================
   TOUR
   Dates from Seated set in the site's Helvetica, images from Sanity on the
   same grid. Three layouts (tweak: Layout):
     index      list typography on the page grid: date | venue | location | Tickets,
                venue and location each with their own alignment; images offset on the grid
     justified  date | CITY / VENUE justified across the middle | TICKETS,
                poster offset on the grid above, second image below
     list       poster left, small list grouped by month, second image right
     poster     one running block of uppercase text, like the back of a tour poster
   Tweakable values live on .tour and are overridden inline on <body> by tweaks.js;
   on/off switches are attributes on <html>. The locked-in state (index layout,
   venue left / location right, 64px gap, underline hover) is written on <html>
   in tour.njk so the page is right before any script runs.
   ============================================================ */

.tour {
  --t-cols: 4;
  --t-gap: 64px;
  --t-text: var(--text-s);  /* base / list size */
  --t-track: 0.08em;        /* base / list tracking */
  --t-row-size: 18px;       /* justified rows */
  --t-row-track: 0.01em;
  --t-flow-size: 28px;      /* poster block */
  --t-flow-track: -0.01em;
  --t-flow-lh: 1.12;
  --t-muted: 1;             /* opacity of secondary bits (weekday, city in list mode) */
  --t-row-pad: 0.5em;       /* vertical padding per row */
  --t-month-gap: 2.4em;     /* space above each month group */
  --t-poster-col: 2;        /* justified / poster: poster grid column … */
  --t-poster-span: 2;       /* … and how many columns it spans */
  --t-stamp-col: 4;         /* justified / poster: second image column */
  --t-stamp-w: 33%;         /* list + bottom placement: second image width */
  --t-poster-scale: 0.8;    /* image heights: 1 = natural, lower crops the picture shorter */
  --t-stamp-scale: 0.85;
  --t-venue-span: 1;        /* index: columns the venue takes */
  --t-venue-w: 100%;        /* index: max width of the venue block within its column */
  --t-loc-w: 100%;          /* index: max width of the location block */
}

.t {
  padding: 0 var(--margin) 8rem;
  color: var(--primary);
  font-family: helvetica-neue-lt-pro, "Helvetica Neue", Helvetica, Arial, sans-serif;
  font-size: var(--t-text);
  letter-spacing: var(--t-track);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-variant-numeric: tabular-nums;
}
.t .caption {
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0;
}

/* ---- Grid ------------------------------------------------------------ */
.t-layout {
  display: grid;
  grid-template-columns: repeat(var(--t-cols), minmax(0, 1fr));
  gap: var(--t-gap);
  align-items: start;
}
.t-poster, .t-stamp { margin: 0; }
.t-poster img, .t-stamp img {
  display: block;
  width: 100%;
  height: auto;
  object-fit: cover;        /* --ar is the picture's natural ratio (set in the template) */
}
.t-poster img { aspect-ratio: calc(var(--ar, 1.5) / var(--t-poster-scale)); }
.t-stamp img  { aspect-ratio: calc(var(--ar, 1.1) / var(--t-stamp-scale)); }
.t-flow { display: none; }
.t-status { margin: 0; }
.t-status:empty { display: none; }

/* ---- Layout: justified and poster share the image placement (index too) -- */
.t-side  { grid-column: var(--t-poster-col) / span var(--t-poster-span); grid-row: 1; }
.t-dates { grid-column: 1 / -1; grid-row: 2; }
.t-stamp { grid-column: var(--t-stamp-col) / span 1; grid-row: 3; margin-top: 2em; }
html[data-stamp="none"] .t-stamp { display: none; }

/* ---- Layout: list ------------------------------------------------------ */
html[data-layout="list"] .t-side  { grid-column: 1 / 2; grid-row: 1; position: sticky; top: var(--margin); }
html[data-layout="list"] .t-dates { grid-column: 2 / -1; grid-row: 1; }
html[data-layout="list"] .t-stamp { grid-column: 2 / -1; grid-row: 2; justify-self: end; width: var(--t-stamp-w); margin: 1em 0 0; }
html[data-layout="list"][data-stamp="right"] .t-dates { grid-column: 2 / -2; }
html[data-layout="list"][data-stamp="right"] .t-stamp { grid-column: -2 / -1; grid-row: 1; justify-self: stretch; width: auto; margin: 0; position: sticky; top: var(--margin); }
html[data-layout="list"][data-side="right"] .t-side  { grid-column: -2 / -1; }
html[data-layout="list"][data-side="right"] .t-dates { grid-column: 1 / -2; }
html[data-layout="list"][data-side="right"] .t-stamp { grid-column: 1 / -2; }
html[data-layout="list"][data-side="right"][data-stamp="right"] .t-dates { grid-column: 2 / -2; }
html[data-layout="list"][data-side="right"][data-stamp="right"] .t-stamp { grid-column: 1 / 2; }
html[data-layout="list"][data-side="none"] .t-side  { display: none; }
html[data-layout="list"][data-side="none"] .t-dates { grid-column: 1 / -1; }
html[data-layout="list"][data-side="none"] .t-stamp { grid-column: 1 / -1; }
html[data-layout="list"][data-side="none"][data-stamp="right"] .t-dates { grid-column: 1 / -2; }
html[data-layout="list"][data-side="none"][data-stamp="right"] .t-stamp { grid-column: -2 / -1; }

/* ---- Months ---------------------------------------------------------- */
.t-month {
  display: flex;
  align-items: baseline;
  gap: 0.6em;
  margin-top: var(--t-month-gap);
  padding-bottom: 0.5em;
}
.t-month:first-child { margin-top: 0; }
/* auto: shown in list and index modes, hidden in the others */
html:not([data-layout="list"]):not([data-layout="index"]):not([data-months="show"]) .t-month,
html[data-months="hide"] .t-month { display: none; }

/* ---- Rows: shared ------------------------------------------------------ */
.t-row {
  display: grid;
  align-items: baseline;
  padding: var(--t-row-pad) 0;
  cursor: pointer;
}
html[data-hairlines] .t-row {
  box-shadow: 0 1px 0 color-mix(in srgb, var(--primary) 25%, transparent);
}
.t-date { white-space: nowrap; }
.t-wd { margin-left: 0.6em; opacity: var(--t-muted); }
html[data-date="caption"] .t-day {
  font-family: dm, Arial, sans-serif;
  font-size: 10px;
  line-height: 1;
  letter-spacing: 0;
}
.t-act {
  display: flex;
  justify-content: flex-end;
  align-items: baseline;
  gap: 1.1em;
  white-space: nowrap;
}
.t-act a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: transparent;
  transition: text-decoration-color 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.t-act a::after {
  content: "\2192";                /* → */
  display: inline-block;
  margin-left: 0.45em;
  opacity: 0;
  transform: translateX(-4px);
  transition:
    opacity 160ms cubic-bezier(0.2, 0.7, 0.2, 1),
    transform 220ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.t-row:hover .t-act a::after,
.t-act a:focus-visible::after {
  opacity: 1;
  transform: none;
}
.t-act .t-soldout {
  opacity: 0.5;
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}
/* square end-mark, lights up with the row (same motif as the store index) */
.t-mark {
  width: 4px;
  height: 4px;
  align-self: center;
  background: currentColor;
  opacity: 0;
  transition: opacity 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
.t-row:hover .t-mark,
.t-row:focus-within .t-mark { opacity: 1; }

/* ---- Row hover (tweak: Hover) ------------------------------------------
   underline  every bit of text in the row gets its underline (default)
   dark       the row's text goes darker
   both       underline + darker
   mark       just the arrow and the square                                    */
.t-row { transition: color 160ms cubic-bezier(0.2, 0.7, 0.2, 1); }
.t-day, .t-wd, .t-venue, .t-city {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.22em;
  text-decoration-color: transparent;
  transition: text-decoration-color 160ms cubic-bezier(0.2, 0.7, 0.2, 1);
}
html:not([data-hover="dark"]):not([data-hover="mark"]) .t-row:is(:hover, :focus-within) :is(.t-day, .t-wd, .t-venue, .t-city),
html:not([data-hover="dark"]):not([data-hover="mark"]) .t-row:is(:hover, :focus-within) .t-act a {
  text-decoration-color: currentColor;
}
html:is([data-hover="dark"], [data-hover="both"]) .t-row:is(:hover, :focus-within) {
  color: color-mix(in srgb, var(--primary), #000 30%);
}
html:is([data-hover="dark"], [data-hover="both"]) .t-row:is(:hover, :focus-within) :is(.t-wd, .t-city, .t-slash) {
  opacity: 1;
}

.t-where--vc, .t-leader { display: none; }

/* ---- Rows: justified --------------------------------------------------- */
/* date | CITY / VENUE spread across the middle columns | TICKETS, on the page grid */
.t-row {
  grid-template-columns: repeat(var(--t-cols), minmax(0, 1fr));
  column-gap: var(--t-gap);
  font-size: var(--t-row-size);
  letter-spacing: var(--t-row-track);
  padding: calc(var(--t-row-pad) * 1.6) 0;
}
.t-date  { grid-column: 1 / 2; }
.t-where { grid-column: 2 / -2; }
.t-act   { grid-column: -2 / -1; }
.t-where {
  display: block;
  text-align: justify;
  text-align-last: justify;
  line-height: 1.15;
}
.t-where .t-city,
.t-where .t-venue,
.t-where .t-slash { display: inline; }
.t-slash { opacity: 0.6; }
.t-city { font-weight: 700; }
html[data-city-weight="500"] .t-city { font-weight: 500; }
html[data-city-weight="400"] .t-city { font-weight: 400; }
/* uppercase by default here (tweak: Case) */
html:not([data-case="sentence"]) .t-where,
html:not([data-case="sentence"]) .t-act { text-transform: uppercase; }
.t-act a { text-decoration-color: currentColor; }
html[data-no-underline] .t-act a { text-decoration-color: transparent; }

/* ---- Rows: index (list typography on the page grid, venue and location
        in their own columns, each with its own alignment and max width) ------- */
html[data-layout="index"] .t-row {
  font-size: var(--t-text);
  letter-spacing: var(--t-track);
  padding: var(--t-row-pad) 0;
}
html[data-layout="index"] .t-where--cv { display: none; }
html[data-layout="index"] .t-where--vc { display: contents; }
html[data-layout="index"] .t-where--vc .t-slash,
html[data-layout="index"] .t-leader { display: none; }
html[data-layout="index"] .t-where--vc .t-venue {
  display: block;
  grid-column: 2 / span var(--t-venue-span);
  max-width: var(--t-venue-w);
  overflow-wrap: anywhere;
}
html[data-layout="index"] .t-where--vc .t-city {
  display: block;
  grid-column: calc(2 + var(--t-venue-span)) / -2;
  max-width: var(--t-loc-w);
  font-weight: 400;
  opacity: var(--t-muted);
  white-space: normal;
}
/* alignment per column (tweak: Venue align / Location align) */
html[data-layout="index"][data-venue-align="justify"] .t-where--vc .t-venue { text-align: justify; text-align-last: justify; }
html[data-layout="index"][data-venue-align="left"]    .t-where--vc .t-venue { text-align: left; text-align-last: auto; }
html[data-layout="index"][data-venue-align="right"]   .t-where--vc .t-venue { text-align: right; text-align-last: auto; margin-left: auto; }
html[data-layout="index"][data-venue-align="center"]  .t-where--vc .t-venue { text-align: center; text-align-last: auto; margin: 0 auto; }
html[data-layout="index"][data-loc-align="justify"] .t-where--vc .t-city { text-align: justify; text-align-last: justify; }
html[data-layout="index"][data-loc-align="left"]    .t-where--vc .t-city { text-align: left; text-align-last: auto; }
html[data-layout="index"][data-loc-align="right"]   .t-where--vc .t-city { text-align: right; text-align-last: auto; margin-left: auto; }
html[data-layout="index"][data-loc-align="center"]  .t-where--vc .t-city { text-align: center; text-align-last: auto; margin: 0 auto; }
html[data-layout="index"] .t-act a { text-decoration-color: transparent; }
html[data-layout="index"]:not([data-case="upper"]) .t-where,
html[data-layout="index"]:not([data-case="upper"]) .t-act { text-transform: none; }
html[data-layout="index"] .t-month { margin-top: var(--t-month-gap); padding-bottom: 0.6em; }

/* ---- Rows: list (small, left-aligned, grouped by month) ---------------- */
html[data-layout="list"] .t-row {
  grid-template-columns: max-content minmax(0, 1.25fr) minmax(0, 1fr) auto;
  grid-template-areas: "date venue city act";
  column-gap: 1.2em;
  font-size: var(--t-text);
  letter-spacing: var(--t-track);
  padding: var(--t-row-pad) 0;
}
html[data-layout="list"] .t-date  { grid-area: date; grid-column: auto; }
html[data-layout="list"] .t-act   { grid-area: act; grid-column: auto; }
html[data-layout="list"] .t-where--cv { display: contents; }
html[data-layout="list"] .t-venue { grid-area: venue; overflow-wrap: anywhere; text-align: left; text-align-last: auto; }
html[data-layout="list"] .t-city  { grid-area: city; opacity: var(--t-muted); font-weight: inherit; text-align: left; text-align-last: auto; }
html[data-layout="list"] .t-slash { display: none; }
html[data-layout="list"]:not([data-case="upper"]) .t-where,
html[data-layout="list"]:not([data-case="upper"]) .t-act { text-transform: none; }
html[data-layout="list"] .t-act a { text-decoration-color: transparent; }

/* ---- Poster: one justified block of running text ----------------------- */
html[data-layout="poster"] .t-list { display: none; }
html[data-layout="poster"] .t-flow {
  display: block;
  margin: 0;
  font-size: var(--t-flow-size);
  letter-spacing: var(--t-flow-track);
  line-height: var(--t-flow-lh);
  text-align: justify;
  text-transform: uppercase;
}
html[data-layout="poster"][data-case="sentence"] .t-flow { text-transform: none; }
.t-flow-item {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}
.t-flow-item:hover,
.t-flow-item:focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.14em;
}
.t-flow-date {
  font-variant-numeric: tabular-nums;
}
html[data-date="caption"] .t-flow-date {
  font-family: dm, Arial, sans-serif;
  font-size: 0.42em;
  letter-spacing: 0;
  vertical-align: 0.28em;
  margin-right: 0.3em;
}
.t-flow-venue { font-weight: 400; }
.t-flow-city { font-weight: 700; }
html[data-city-weight="500"] .t-flow-city { font-weight: 500; }
html[data-city-weight="400"] .t-flow-city { font-weight: 400; }
.t-flow .t-soldout { opacity: 0.5; text-decoration: line-through; }
/* the square between entries */
.t-sq {
  display: inline-block;
  width: 0.22em;
  height: 0.22em;
  margin: 0 0.45em;
  vertical-align: 0.28em;
  background: currentColor;
}

/* ---- Status / follow / credit ------------------------------------------ */
.t-follow { margin: 3em 0 0; }
.t-follow a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.t-powered {
  margin: 2.5em 0 0;
  opacity: 0.5;
}
.t-powered a { color: inherit; }

/* ---- Responsive ------------------------------------------------------ */
/* Values here sit on .t (not body) so they beat the panel's inline values on phones. */
@media (max-width: 900px) {
  .t { --t-gap: 24px; --t-row-size: 13px; --t-flow-size: 20px; --t-row-pad: 0.75em; }
  .t-layout { grid-template-columns: 1fr; }
  .t-side, .t-dates, .t-stamp,
  html[data-layout="list"] .t-side,
  html[data-layout="list"] .t-dates,
  html[data-layout="list"] .t-stamp,
  html[data-layout="list"][data-stamp="right"] .t-dates,
  html[data-layout="list"][data-stamp="right"] .t-stamp,
  html[data-layout="list"][data-side="right"] .t-side,
  html[data-layout="list"][data-side="right"] .t-dates,
  html[data-layout="list"][data-side="right"] .t-stamp {
    grid-column: 1 / -1;
    grid-row: auto;
    position: static;
    width: auto;
    justify-self: stretch;
    margin: 0;
  }
  .t-poster { max-width: 100%; }
  .t-stamp { max-width: 50%; margin-left: auto; margin-top: 1em; }

  /* rows: date | venue | location | Tickets stay on one line; long text wraps inside its own column */
  .t { --t-row-pad: 1.2em; }
  .t-row,
  html[data-layout="list"] .t-row,
  html[data-layout="index"] .t-row {
    grid-template-columns: max-content minmax(0, 1.15fr) minmax(0, 1fr) auto;
    grid-template-areas: "date venue city act";
    column-gap: 0.9em;
    align-items: start;
    padding: var(--t-row-pad) 0;
    line-height: 1.45;
  }
  html[data-layout="justified"] .t-row {
    grid-template-columns: max-content minmax(0, 1fr) auto;
    grid-template-areas: "date where act";
  }
  .t-date  { grid-area: date; grid-column: auto; }
  .t-wd    { display: none; }                      /* no weekday on phones */
  .t-act   { grid-area: act; grid-column: auto; align-self: start; }
  .t-act a::after { opacity: 1; transform: none; }
  .t-mark { display: none; }

  /* index + list: venue and location are grid items in their own columns */
  html[data-layout="index"] .t-where--cv,
  html[data-layout="index"] .t-where--vc .t-slash,
  html[data-layout="index"] .t-leader,
  html[data-layout="list"] .t-slash { display: none; }
  html[data-layout="index"] .t-where--vc,
  html[data-layout="list"] .t-where--cv { display: contents; }
  html[data-layout="index"] .t-where--vc .t-venue,
  html[data-layout="index"][data-venue-align] .t-where--vc .t-venue,
  html[data-layout="list"] .t-where--cv .t-venue {
    grid-area: venue;
    display: block;
    max-width: none;
    margin: 0;
    text-align: left;
    text-align-last: auto;
    overflow-wrap: anywhere;
  }
  html[data-layout="index"] .t-where--vc .t-city,
  html[data-layout="index"][data-loc-align] .t-where--vc .t-city,
  html[data-layout="list"] .t-where--cv .t-city {
    grid-area: city;
    display: block;
    max-width: none;
    margin: 0;
    text-align: left;
    text-align-last: auto;
    overflow-wrap: anywhere;
  }

  /* justified keeps its CITY / venue block, left-aligned in one column */
  html[data-layout="justified"] .t-where--vc { display: none; }
  html[data-layout="justified"] .t-where--cv {
    grid-area: where;
    display: block;
    text-align: left;
    text-align-last: auto;
  }

  /* poster block: left-aligned, roomier lines so each entry is easy to tap */
  html[data-layout="poster"] .t-flow { text-align: left; line-height: 1.35; }
  .t-flow-item { padding: 0.12em 0; }
}
@media (hover: none) {
  .t-act a::after { opacity: 1; transform: none; }
}
