/* shows.css: A show (上映回) block: shared look, horizontal-only layout under .row, ticket stub when picked, the ladder line. */
.show { position: absolute; overflow: clip; --show-pad: 5px 8px 5px 10px; scroll-margin: calc(var(--top-h, 0px) + 46px) 0 calc(var(--sheet-now) + 12px);
  border-radius: var(--radius-sm); border: 1px solid var(--block-border);
  background: color-mix(in srgb, var(--tc) var(--block-tint), var(--surface)); transition: background .12s ease, opacity .12s ease; }
/* Horizontal timetable: a show fills its row; vertical shows are placed by their inline top and height. */
.row .show { top: 7px; bottom: 7px; }
.show-main { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: flex-start; width: 100%; padding: var(--show-pad); margin: 0;
  border: 0; background: none; text-align: left; cursor: pointer; overflow: clip; }
/* The title gets the full width (two lines); ＋ sits at the bottom right, beside the times. */
.row .show.has-quick .show-main span { padding-right: 24px; }
.show-main:focus-visible { outline: 2px solid var(--ink); outline-offset: -2px; }
.quick { position: absolute; bottom: 5px; right: 5px; z-index: 1; width: 22px; height: 22px; padding: 0; display: grid; place-items: center;
  border: 1px solid var(--line-strong); border-radius: 50%; background: var(--surface); color: var(--ink); cursor: pointer;
  opacity: 0; transition: opacity .12s ease, background .12s ease, color .12s ease, transform .12s ease; }
.quick svg { width: 12px; height: 12px; }
.quick:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.quick:active { transform: scale(.92); }
.quick:focus-visible { opacity: 1; }
/* On a show that has started: an outline only, so it reads as "record it" rather than "book it". */
.show.past .quick { background: transparent; border-style: dashed; }
.show.past .quick:hover { background: var(--ink); color: var(--bg); border-color: var(--ink); border-style: solid; }
/* Keyboard focus shows ＋, but not the focus a closed sheet hands back to the show after a click.
   :focus-visible can't tell those apart in every browser, so the page tracks it (.kbd, js/sheets.js). */
@media (hover: hover) { .show:hover .quick, :root.kbd .show:focus-within .quick { opacity: 1; } }
@media (hover: none) {
  .quick { opacity: 1; width: 28px; height: 28px; }
  .quick svg { width: 14px; height: 14px; }
  .row .show.has-quick .show-main span { padding-right: 30px; }
}
.show.picked .quick { opacity: 1; background: #fff; color: #111; border-color: transparent; }
.show.picked .quick:hover { background: #111; color: #fff; }
.show::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: var(--block-rule); background: var(--tc); }
.show:hover { background: color-mix(in srgb, var(--tc) calc(var(--block-tint) + 7%), var(--surface)); }
.show b { display: -webkit-box; -webkit-box-orient: vertical;
  font-family: var(--font-title); font-size: 12.5px; font-weight: var(--title-weight); line-height: 1.3;
  overflow: hidden; overflow-wrap: anywhere; }
.row .show b { -webkit-line-clamp: 2; line-clamp: 2; }
.show span { display: block; font-size: 11px; color: var(--muted); }
.row .show span { white-space: nowrap; margin-top: auto; }
/* On touch screens (where ＋ is always shown) a narrow show gives only its start time, so the two never overlap. */
.show { container-type: inline-size; }
.show .end { font-style: normal; }
@media (hover: none) {
  @container (max-width: 124px) { .grid .row .show.has-quick .end { display: none; } }
  /* Short films (a narrow block): a smaller ＋, and the start time gives way so it still fits. */
  @container (max-width: 72px) {
    .grid .row .show.has-quick .quick { width: 20px; height: 20px; right: 3px; bottom: 4px; }
    .grid .row .show.has-quick .show-main span { padding-right: 0; visibility: hidden; }
  }
}
/* Very short films (a sliver of a block, e.g. 17 minutes): the title runs top to bottom, which fits a Japanese title
   in a few characters' width; the time gives way. The full details are a tap away. */
@container (max-width: 40px) {
  .grid .row .show .show-main { padding: 6px 2px; align-items: center; }
  .grid .row .show .show-main b { writing-mode: vertical-rl; display: block; -webkit-line-clamp: none; line-clamp: none; max-height: 100%;
    overflow: hidden; font-size: 12px; line-height: 1.15; letter-spacing: 0; white-space: nowrap; text-overflow: ellipsis; }
  .grid .row .show .show-main span { display: none; }
}
/* A show that starts off to the left keeps its title readable: the text slides along until the block ends.
   (overflow: clip, not hidden, so the timeline stays the scroll container these stick to.) */
.show b, .show span { max-width: 100%; }
.row .show b, .row .show span { position: sticky; left: calc(var(--label-w) + 8px); }
.show span.ca { display: inline; position: static; margin-top: 0; font-size: .82em; }
.show.picked { background: var(--tc); border-color: var(--tc); color: #fff; }
.show.picked span { color: rgba(255, 255, 255, .85); }
/* Faded but still readable (about 2:1 light, 3:1 dark), so a show that no longer fits can still be found by name. */
.show.blocked { opacity: .35; }
.show.past { opacity: .4; }
/* シネマテーク: a picked show becomes a ticket stub — perforation and notches on the left */
:root[data-design="a"] .show.picked { background: var(--ticket); border-color: transparent; color: var(--ticket-ink); }
:root[data-design="a"] .show.picked::before { background: none; }
/* Horizontal: the tear line runs down the left, the notches sit at its ends. (Vertical turns it; see .vcol below.) */
:root[data-design="a"] .row .show.picked {
  --show-pad: 5px 8px 5px 24px;
  background:
    radial-gradient(circle at 14px 0, var(--surface) 0 5px, transparent 5.5px),
    radial-gradient(circle at 14px 100%, var(--surface) 0 5px, transparent 5.5px),
    var(--ticket); }
:root[data-design="a"] .row .show.picked::before { left: 14px; top: 7px; bottom: 7px; width: 0;
  border-left: 1.5px dashed color-mix(in srgb, var(--ticket-ink) 45%, transparent); }
:root[data-design="a"] .show.picked span { color: var(--ticket-ink); opacity: .8; }
:root[data-design="a"] .show.picked .quick { background: var(--ticket-ink); color: var(--ticket); }
:root[data-design="a"] .show.picked .quick:hover { background: var(--ink); color: var(--bg); }

/* はしごの線: joins picked shows in time order across rows */
.ladder-wrap { position: absolute; left: 0; top: 0; z-index: 2; pointer-events: none; clip-path: inset(0 0 0 calc(var(--label-w) + var(--sx, 0px))); }
.ladder { position: absolute; left: 0; top: 0; pointer-events: none; overflow: visible; }
.ladder path { fill: none; stroke: var(--ladder); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.ladder path.ng { stroke: var(--ng); stroke-dasharray: 5 4; }
/* The ladder grows bolder as the plan gets longer: thicker from 3 shows, a soft glow from 4. */
.ladder-wrap.lv3 .ladder path { stroke-width: 2.6; }
.ladder-wrap.lv4 .ladder path, .ladder-wrap.lv5 .ladder path { stroke-width: 3; }
.ladder-wrap.lv4 .ladder, .ladder-wrap.lv5 .ladder { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ladder) 55%, transparent)); }
.ladder-wrap.lv5 .ladder circle { r: 4; }
.ladder circle { fill: var(--ladder); }
.ladder circle.ng { fill: var(--ng); }
.rung { position: absolute; z-index: 2; transform: translate(-50%, -50%); pointer-events: none; white-space: nowrap;
  padding: 1px 8px; border-radius: 3px; background: var(--ladder); color: var(--surface);
  font-family: var(--font-ja); font-size: 11px; font-weight: 500; line-height: 18px; box-shadow: 0 0 0 3px var(--surface); }
.rung.ng { background: var(--ng); }
.ladder path.draw { stroke-dasharray: var(--len); stroke-dashoffset: var(--len); animation: draw .5s var(--ease) .05s forwards; }
@keyframes draw { to { stroke-dashoffset: 0; } }
.rung.draw { animation: fade-in .25s var(--ease) .35s both; }
.item.added { animation: ticket-in .3s var(--ease); }
@keyframes ticket-in { from { opacity: 0; translate: 0 -6px; } }

/* フィルム上映 (core.js gaugeOf): the gauge before the title, and with 表示 → 上映 → フィルムだけ the rest fade back
   (shows in マイ時間割 stay as they are). */
.show .gauge { display: inline-block; margin-right: 5px; padding: 0 4px; border: 1px solid currentColor; border-radius: 3px;
  font: 600 9.5px/1.45 var(--font-num); font-style: normal; letter-spacing: .02em; vertical-align: 1px; opacity: .85; }
:root[data-film="only"] .show:not(.film):not(.picked) { opacity: .22; }
/* 最終回 (core.js finalIds): the film's last showing at this theater, before the title like the gauge, said plainly; a tint,
   not an alarm. Just 終 where a block is narrow (phones, コンパクト, the vertical columns); 最終回 on wide screens. */
.show .last { display: inline-block; margin-right: 4px; padding: 0 3px; border-radius: 3px; background: color-mix(in srgb, currentColor 16%, transparent);
  font: 700 0/1.45 var(--font-ja); font-style: normal; vertical-align: 1px; }
.show .last::before { content: attr(data-n); font-size: 9.5px; }
/* コンパクト (horizontal): no room for even 終 before the title, so a folded corner on the block's top right instead. */
:root[data-density="compact"] .row .show .last { display: none; }
:root[data-density="compact"] .row .show.final::after { content: ""; position: absolute; top: 0; right: 0; border-style: solid;
  border-width: 0 10px 10px 0; border-color: transparent color-mix(in srgb, var(--ink) 55%, transparent) transparent transparent; pointer-events: none; }
@media (min-width: 900px) {
  :root:not([data-density="compact"]) .row .show .last { margin-right: 5px; padding: 0 4px; font-size: 9.5px; }
  :root:not([data-density="compact"]) .row .show .last::before { content: none; }
}
/* コンパクト and the narrow vertical columns: only the number ("35"), so the title keeps its room. */
:root[data-density="compact"] .show .gauge, .vgrid .show .gauge { margin-right: 3px; padding: 0 3px; border: 0; background: color-mix(in srgb, currentColor 16%, transparent); font-size: 0; }
:root[data-density="compact"] .show .gauge::before, .vgrid .show .gauge::before { content: attr(data-n); font-size: 9px; }
