/* List layout (2026-11-26, second round 2026-11-29; app.js "List layout"): the Tiles view drawn as rows, one heading per day.
   Row: time | title, place, performers, price | picture. The picture sits at the row's end and only when the event
   has one, so titles start on one line down the page and a row without a photo is simply shorter. The picture box is
   one size (16:9 on wide screens, 3:2 on phones); event-image.js decides cover vs the whole picture on a dim backdrop.
   Colours reuse the page's variables, so light and dark keep their checked contrast. */

/* Tiles and List are two of the view tabs (index.html); only the tile settings need hiding for a list. */
body.rows-layout #tile-controls > label { display: none; } /* tile size and order mean nothing to a list */
body.rows-layout .finder-box :is(.finder-options, #finder-display) { display: none; } /* paper layout: "Tile options" */

/* ---------- days ---------- */
.view-content.list-rows:not([hidden]) { display: block; container-type: inline-size; }
body.tiles-view .view-content.list-rows { padding-inline: 10px; }
.list-rows > .more-btn { display: block; margin: 1rem auto; }
.list-rows > .past-toggle { margin-inline: auto; }
/* One column, read straight down the clock (two side by side would zig-zag the times), kept to a readable width. */
.list-rows .ag-day { max-width: 60rem; margin-inline: auto; }
.ag-day + .ag-day { margin-top: .9rem; }
.ag-head {
  position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .75rem;
  padding: .5rem .5rem .4rem; background: var(--page); border-bottom: 1px solid var(--hairline);
}
.ag-date { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem; margin: 0; font-size: 1rem; font-weight: 700; line-height: 1.25; }
.ag-date-sub { font-size: .85rem; font-weight: 500; color: var(--ink-secondary); }
.ag-date-n { margin-inline-start: auto; font-size: .78rem; font-weight: 500; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
/* "Show N earlier": a quiet link in the first heading (it was a full-width button above the list). */
.ag-past {
  padding: .2rem 0; min-height: 24px; font: inherit; font-size: .78rem; color: var(--ink-secondary); background: none; border: 0; cursor: pointer;
  text-decoration: underline; text-decoration-color: var(--hairline); text-underline-offset: .2em;
}
.ag-past:hover { color: var(--ink); text-decoration-color: currentColor; }
/* In the phone's map sheet the drag handle owns the top edge. */
body.split-sheet .ag-head { position: static; }
/* Paper layout: each day is one sheet on the canvas, like the tiles and the calendar's day columns. */
.paper-calendar .list-rows .ag-day { background: var(--sheet); border: 1px solid var(--rule); border-radius: 6px; }
.paper-calendar .list-rows .ag-head { background: var(--sheet); border-radius: 6px 6px 0 0; border-bottom-color: var(--rule); font-family: "Paper Sans", "Segoe UI", sans-serif; }
.paper-calendar .list-rows .ag-date-main { font-family: Georgia, serif; font-weight: 400; font-size: 1.3rem; letter-spacing: -.02em; }
.paper-calendar .list-rows .ag-rows > .ag-row:last-child { border-bottom: 0; }

/* ---------- a row ---------- */
.list-rows .list-event.ag-row {
  position: relative; display: grid; grid-template-columns: 4.4rem minmax(0, 1fr) 9.5rem; grid-template-areas: "when body pic";
  align-items: start; gap: 0 1rem; margin: 0; padding: .7rem .6rem; min-width: 0;
  color: inherit; text-decoration: none; background: none; border: 0; border-bottom: 1px solid var(--hairline); border-radius: 0;
}
.list-rows .list-event.ag-row:is(.ag-no-pic, .ev-media-failed) { grid-template-columns: 4.4rem minmax(0, 1fr); grid-template-areas: "when body"; }
.list-rows .list-event.ag-row:hover { background: var(--hover); }
.list-rows .list-event.ag-row:focus-visible { outline-offset: -2px; border-radius: 6px; }
#all-list.list-rows .list-event.split-lit { border-radius: 8px; outline-offset: -2px; }

/* The time is a quiet lead-in; the title is the loudest thing in the row. */
.ag-when { grid-area: when; display: flex; flex-direction: column; padding-top: .2rem; line-height: 1.25; font-variant-numeric: tabular-nums; }
.ag-when .list-event-start { font-size: .85rem; font-weight: 600; color: var(--ink); }
.ag-when .list-event-end { font-size: .75rem; font-weight: 400; color: var(--ink-muted); }
.ag-when.ag-allday { font-size: .78rem; font-weight: 500; color: var(--ink-secondary); }

.ag-pic { grid-area: pic; position: relative; display: block; min-width: 0; }
/* A picture that failed to load leaves no placeholder: the row becomes a text row (event-image.js marks the row .ev-media-failed). */
/* Kept in the page at 1px (not display:none) so a replacement photo can still load and bring the box back. */
.ev-media-failed > .ag-pic { position: absolute; top: 0; inset-inline-end: 0; width: 1px; height: 1px; overflow: hidden; opacity: 0; pointer-events: none; }
.ag-pic > .ev-img { --ev-img-ar: 16 / 9; --ev-img-radius: 6px; width: 100%; max-width: none; }
/* Close to the box's shape: fill it. Otherwise (ev-fit-whole, set by event-image.js) the whole picture, never enlarged,
   on a dim, blurred copy of itself: a dark mat in the poster's own colours rather than a pale smear around it.
   The source's own reviewed-photo rule (scale-down) is overridden only for the fill case. */
.ag-pic > .ev-img:not(.ev-fit-whole) .ev-photo { object-fit: cover; max-width: none !important; max-height: none !important; margin: 0; }
.ag-pic > .ev-img.ev-fit-whole { background: #1d1f22; }
.ag-pic > .ev-img.ev-fit-whole .ev-photo { object-fit: scale-down; margin: auto; }
.ev-photo-fill {
  position: absolute; inset: -15%; width: 130%; height: 130%; object-fit: cover;
  filter: blur(16px) brightness(.5) saturate(1.2); pointer-events: none;
}
.ev-fit-whole .ev-art { visibility: hidden; }
.ag-pic .dup-super { font-size: .58rem; height: .8rem; min-width: .95rem; bottom: -.15rem; inset-inline-end: -.15rem; border-width: 2px; }
.ag-row .list-event-title .dup-super { position: static; vertical-align: .15em; margin-inline-start: .35rem; font-size: .58rem; height: .8rem; min-width: .95rem; }

.ag-row > .list-event-body { grid-area: body; display: flex; flex-direction: column; gap: .15rem; min-width: 0; overflow-wrap: anywhere; }
.ag-row .list-event-title {
  font-size: 1rem; font-weight: 600; line-height: 1.3;
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.ag-row .list-event-meta {
  font-size: .8rem; line-height: 1.35; color: var(--ink-muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.ag-row .list-event-meta .hood { font-weight: 600; color: var(--ink-secondary); }
.ag-row .list-event-with { font-size: .75rem; line-height: 1.3; }
.ag-foot { display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .6rem; min-width: 0; }
.ag-foot .list-event-price { padding: 0; font-size: .78rem; font-weight: 500; color: var(--ink-secondary); white-space: normal; }
.ag-foot .ev-credit { margin: 0; font-size: .65rem; line-height: 1.3; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; }
/* Add to calendar (hover / keyboard): over the picture's corner, on its own light chip like the tiles'. */
.ag-row .cal-btn { top: .85rem; inset-inline-end: .75rem; left: auto; color: #17251c; background: #fffffff0; border: 1px solid #677b6e; }

/* Paper layout: the editorial voice of the page's headings. Serif titles, the small sans for everything else. */
.paper-calendar .list-rows .ag-row { font-family: "Paper Sans", "Segoe UI", sans-serif; }
.paper-calendar .list-rows .ag-row .list-event-title { font-family: Georgia, "Times New Roman", serif; font-size: 1.12rem; font-weight: 400; line-height: 1.25; letter-spacing: -.01em; }

/* ---------- wide lists (the map closed on a desktop): the day becomes a side label, the rows run beside it ---------- */
@container (min-width: 62rem) {
  .list-rows .ag-day { display: grid; grid-template-columns: 11.5rem minmax(0, 1fr); max-width: 72rem; }
  .ag-head { align-self: start; flex-direction: column; align-items: flex-start; gap: .15rem; padding: 1rem 1rem 1rem 1.1rem; border-bottom: 0; background: none; }
  .paper-calendar .list-rows .ag-head { background: none; }
  .ag-date { flex-direction: column; gap: 0; }
  .paper-calendar .list-rows .ag-date-main { font-size: 1.7rem; line-height: 1.1; }
  .ag-date:not(:has(.ag-date-sub)) .ag-date-main { font-size: 1.15rem; }
  .paper-calendar .list-rows .ag-date:not(:has(.ag-date-sub)) .ag-date-main { font-size: 1.3rem; line-height: 1.2; }
  .ag-date-n { margin-inline-start: 0; }
  .list-rows .ag-rows { border-inline-start: 1px solid var(--hairline); }
  .paper-calendar .list-rows .ag-rows { border-inline-start-color: var(--rule); }
  .list-rows .list-event.ag-row { padding-inline: 1rem; }
}

/* ---------- phones: the time above the title, the picture at the end ---------- */
@media (max-width: 600px) {
  body.tiles-view .view-content.list-rows { padding-inline: 8px; }
  .ag-head { padding-inline: .5rem; }
  .list-rows .list-event.ag-row {
    grid-template-columns: minmax(0, 1fr) 6.5rem; grid-template-areas: "when pic" "body pic"; grid-template-rows: auto 1fr;
    gap: .1rem .75rem; padding: .65rem .5rem;
  }
  .list-rows .list-event.ag-row:is(.ag-no-pic, .ev-media-failed) { grid-template-columns: minmax(0, 1fr); grid-template-areas: "when" "body"; }
  .ag-pic > .ev-img { --ev-img-ar: 3 / 2; }
  .ag-pic { align-self: center; }
  .ag-when { flex-direction: row; flex-wrap: wrap; align-items: baseline; gap: 0; padding-top: 0; }
  .ag-when.ag-carried { gap: .3rem; }
  .ag-when .list-event-start, .ag-when .list-event-end, .ag-when.ag-allday { font-size: .78rem; font-weight: 550; color: var(--ink-secondary); }
  .ag-row .list-event-title { font-size: .95rem; }
  .paper-calendar .list-rows .ag-row .list-event-title { font-size: 1.05rem; }
  .ag-row .list-event-meta { -webkit-line-clamp: 1; font-size: .78rem; }
  .ag-row .list-event-with { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
}
@media (max-width: 360px) {
  .list-rows .list-event.ag-row { grid-template-columns: minmax(0, 1fr) 5.25rem; }
  .list-rows .list-event.ag-row:is(.ag-no-pic, .ev-media-failed) { grid-template-columns: minmax(0, 1fr); }
}
/* Very narrow (a 320 px screen at 200% zoom): the picture goes under the text. */
@media (max-width: 260px) {
  .list-rows .list-event.ag-row { grid-template-columns: minmax(0, 1fr); grid-template-areas: "when" "body" "pic"; grid-template-rows: none; row-gap: .3rem; }
  .ag-pic { max-width: 14rem; }
}

@media (forced-colors: active) {
  .ev-photo-fill { display: none; }
  .ag-head { border-bottom-color: CanvasText; }
}

/* Four view tabs (Days, Tiles, List, Map) on a narrow phone: tighter, and they may wrap in a long-worded language. */
@media (max-width: 420px) {
  .view-tabs { flex-wrap: wrap; }
  .finder-box .view-tabs .view-tab { padding-inline: .38rem; }
}
