/* List layout (2026-11-26; app.js "List layout"): the Tiles view drawn as rows, one heading per day.
   Row: time | picture | title, place, performers, price. The picture box is one size on every row (16:9 on wide
   screens, 3:2 on phones) so times and titles line up; event-image.js decides cover vs the whole picture on a blur.
   Colours reuse the page's variables, so light and dark keep their checked contrast. */

/* ---------- the Tiles | List switch (tile settings row) and the view tab's label ---------- */
.tile-layout { display: inline-flex; padding: 2px; border: 1px solid var(--field); border-radius: 10px; background: var(--surface); }
/* The universal grid / list icon pair; the words stay for screen readers and as the hover tip (title). */
.tile-layout .tl-label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.tile-layout button {
  display: inline-flex; align-items: center; justify-content: center; min-width: 32px; min-height: 32px; padding: .25rem .45rem;
  font: inherit; font-size: .8rem; color: var(--ink); background: transparent; border: 0; border-radius: 8px; cursor: pointer;
}
.tile-layout button:hover:not(.active) { background: var(--hover); }
.tile-layout button.active { background: var(--ink); color: var(--page); font-weight: 600; }
.tile-layout svg { width: 1rem; height: 1rem; flex: none; }
body.rows-layout #tile-controls > label { display: none; } /* tile size and order mean nothing to a list */
/* Paper layout (launched cities, paper-calendar.js): the switch sits after the view buttons, in their quieter style,
   only while the Tiles view shows; "Tile options" has nothing for a list, so it goes away there. */
.finder-views .tile-layout { order: 0; padding: 1px; border-color: var(--rule); border-radius: 4px; background: transparent; }
.finder-views .tile-layout button { min-width: 30px; min-height: 30px; padding: .2rem .4rem; color: var(--ink-secondary); border-radius: 3px; }
.finder-views .tile-layout button.active { background: var(--tint); color: var(--ink); font-weight: 650; box-shadow: inset 0 -2px var(--accent); }
.finder-views .tile-layout svg { width: .9rem; height: .9rem; }
body:not(.tiles-view) .finder-views .tile-layout { display: none; }
body.rows-layout .finder-box :is(.finder-options, #finder-display) { display: none; }
.view-tab .vt-rows { display: none; }
.view-tab .vt-tiles { display: contents; }
body.rows-layout .view-tab .vt-rows { display: contents; }
body.rows-layout .view-tab .vt-tiles { display: none; }

/* ---------- days ---------- */
.view-content.list-rows:not([hidden]) { display: block; }
body.tiles-view .view-content.list-rows { padding-inline: 10px; }
.list-rows > :is(.more-btn, .past-toggle) { margin-inline: auto; }
.list-rows > .more-btn { display: block; margin-block: 1rem; }
.ag-day + .ag-day { margin-top: .9rem; }
.ag-date {
  position: sticky; top: 0; z-index: 3; display: flex; flex-wrap: wrap; align-items: baseline; gap: .1rem .5rem;
  margin: 0; padding: .5rem .5rem .4rem; font-size: 1rem; font-weight: 700; line-height: 1.25;
  background: var(--page); border-bottom: 1px solid var(--hairline);
}
.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; }
/* In the phone's map sheet the drag handle owns the top edge. */
body.split-sheet .ag-date { 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-date { background: var(--sheet); border-radius: 6px 6px 0 0; font-family: Georgia, serif; font-weight: 400; font-size: 1.15rem; letter-spacing: -.02em; }
.paper-calendar .list-rows .ag-date :is(.ag-date-sub, .ag-date-n) { font-family: "Paper Sans", "Segoe UI", sans-serif; letter-spacing: 0; }
.paper-calendar .list-rows .ag-rows > .ag-row:last-child { border-bottom: 0; }
/* One column, read straight down the clock (two side by side would zig-zag the times); on a wide screen with the map
   closed it stays a readable width rather than stretching rows across the page. */
.list-rows .ag-day { max-width: 60rem; margin-inline: auto; }

/* ---------- a row ---------- */
.list-rows .list-event.ag-row {
  position: relative; display: grid; grid-template-columns: 4.6rem 9.5rem minmax(0, 1fr); grid-template-areas: "when pic body";
  align-items: start; gap: 0 .9rem; margin: 0; padding: .65rem .5rem; 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: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; }

.ag-when { grid-area: when; display: flex; flex-direction: column; padding-top: .1rem; line-height: 1.2; }
.ag-when .list-event-start { font-size: .95rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.ag-when .list-event-end { font-size: .75rem; color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.ag-when.ag-allday { font-size: .8rem; font-weight: 600; color: var(--ink-secondary); }

.ag-pic { grid-area: pic; position: relative; display: block; min-width: 0; }
.ag-pic > .ev-img { --ev-img-ar: 16 / 9; --ev-img-radius: 8px; width: 100%; max-width: none; }
.ag-pic > .ev-img .ev-art { stroke-width: 3; }
/* Close to the box's shape: fill it. Otherwise (ev-fit-whole, set by event-image.js) the whole picture, never enlarged,
   over a blurred copy of itself. 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 .ev-photo { object-fit: scale-down; margin: auto; }
.ev-photo-fill {
  position: absolute; inset: -12%; width: 124%; height: 124%; object-fit: cover;
  filter: blur(12px) saturate(1.15); opacity: .65; 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-icon { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; font-size: 1.3rem; line-height: 1;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif; }

.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: 650; 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.3; color: var(--ink-muted);
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; overflow: hidden;
}
.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: .8rem; font-weight: 600; 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%; }
.ag-row .cal-btn { top: .55rem; inset-inline-end: .5rem; left: auto; }

/* Sites without event pictures: a small topic mark instead of the picture column. */
.list-rows .list-event.ag-row.ag-no-media { grid-template-columns: 4.6rem 2rem minmax(0, 1fr); }
.ag-no-media .ag-pic { height: 2rem; border-radius: 6px; background: var(--hover); }

/* ---------- phones: picture first, the time above the title ---------- */
@media (max-width: 600px) {
  .tile-layout button { min-width: 44px; min-height: 44px; }
  .finder-views .tile-layout button { min-width: 44px; min-height: 36px; } /* the height of the view buttons beside it */
  body.tiles-view .view-content.list-rows { padding-inline: 8px; }
  .ag-date { padding-inline: .25rem; }
  .list-rows .list-event.ag-row {
    grid-template-columns: 7rem minmax(0, 1fr); grid-template-areas: "pic when" "pic body"; grid-template-rows: auto 1fr;
    gap: .1rem .75rem; padding: .6rem .25rem;
  }
  .list-rows .list-event.ag-row.ag-no-media { grid-template-columns: 2rem minmax(0, 1fr); }
  .ag-pic > .ev-img { --ev-img-ar: 3 / 2; }
  .ag-when { flex-direction: row; flex-wrap: wrap; gap: .25rem; padding-top: 0; }
  .ag-when .list-event-start { font-size: .82rem; }
  .ag-when .list-event-end, .ag-when.ag-allday { font-size: .78rem; }
  .ag-row .list-event-title { font-size: .95rem; }
  .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: 5.5rem minmax(0, 1fr); }
}
/* Very narrow (a 320 px screen at 200% zoom): the picture goes on top. */
@media (max-width: 260px) {
  .list-rows .list-event.ag-row, .list-rows .list-event.ag-row.ag-no-media { grid-template-columns: minmax(0, 1fr); grid-template-areas: "pic" "when" "body"; grid-template-rows: none; row-gap: .3rem; }
  .ag-pic { max-width: 14rem; }
}

@media (forced-colors: active) {
  .ev-photo-fill { display: none; }
  .tile-layout button.active { border: 2px solid ButtonText; }
  .ag-date { border-bottom-color: CanvasText; }
}
