/* layout.css: Row density (コンパクト) overrides, page layout, loading skeleton, day heading. */
/* ---------- compact rows (表示 → 行の高さ) ---------- */
:root[data-density="compact"] { --row-h: 54px; }
:root[data-density="compact"] .show { --show-pad: 3px 6px 3px 9px; }
:root[data-density="compact"] .row .show b { -webkit-line-clamp: 1; line-clamp: 1; font-size: 12px; }
:root[data-density="compact"] .show span { font-size: 10.5px; }
/* Compact rows: small type, and neither line may be squeezed. */
:root[data-density="compact"][data-design] .show b { font-size: 12px; line-height: 1.3; flex: none; }
:root[data-density="compact"][data-design] .show span { font-size: 11px; line-height: 1.3; letter-spacing: 0; flex: none; }
:root[data-density="compact"] .row.has-band { height: calc(var(--row-h) + 16px); }
:root[data-density="compact"] .row.has-band .show { top: 22px; }
:root[data-density="compact"] .band { top: 4px; }
:root[data-density="compact"] .quick { width: 22px; height: 22px; bottom: 4px; }
:root[data-density="compact"] .row.idle { height: 30px; }

/* ---------- layout ---------- */
.layout { max-width: 1400px; margin: 0 auto; }
main { min-width: 0; padding: 22px 0 calc(var(--sheet-now) + 24px); }
:root[data-panel="closed"] main { padding-bottom: 96px; }
@media (min-width: 1100px), (min-width: 700px) and (max-height: 520px) {
  .layout { display: grid; grid-template-columns: minmax(0, 1fr) var(--panel-w); gap: 0 20px; padding-right: 16px; }
  main, :root[data-panel="closed"] main { padding-bottom: 48px; }
}
/* Until data.json arrives the timeline keeps roughly its final height. */
.grid:empty, .grid:has(> .skeleton) { height: max(560px, 100vh); }
/* The real timeline fades in over the skeleton once the data is in (first render only). */
.grid.appear > .row, .grid.appear > .empty { animation: appear .28s var(--ease) both; }
@keyframes appear { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .grid.appear > .row, .grid.appear > .empty { animation: none; } }
/* Loading: grey rows in the timeline's shape, a gentle pulse; 半券ちゃん only if it takes over a second. */
.skeleton { position: relative; }
.sk-row { position: relative; height: var(--row-h); border-top: 1px solid var(--line); }
.sk-row i { position: absolute; display: block; border-radius: var(--radius); background: var(--surface-2); animation: sk 1.4s ease-in-out infinite; }
.sk-label { left: 14px; top: calc(50% - 7px); width: calc(var(--label-w) - 36px); height: 14px; }
.sk-show { top: 10px; bottom: 10px; margin-left: var(--label-w); max-width: calc(100% - var(--label-w)); }
@keyframes sk { 50% { opacity: .55; } }
/* While loading, the 開催中 / 上映なし line and the hour ruler show placeholder shapes too, so the space kept for them
   doesn't read as a blank gap that content later jumps into. */
:root:has(.grid > .skeleton) .idle-group:empty::before { content: ""; width: 240px; max-width: 60%; height: 26px; border-radius: 13px;
  background: var(--surface-2); animation: sk 1.4s ease-in-out infinite; }
:root:has(.grid > .skeleton) .dates:empty { background: repeating-linear-gradient(90deg, var(--surface-2) 0 52px, transparent 52px 60px) 16px 4px / calc(100% - 32px) 52px no-repeat;
  animation: sk 1.4s ease-in-out infinite; }
:root:has(.grid > .skeleton) .hours:empty { background: linear-gradient(var(--surface-2), var(--surface-2)) 0 50% / 100% 6px no-repeat;
  margin-right: 16px; border-radius: 3px; animation: sk 1.4s ease-in-out infinite; }
@media (prefers-reduced-motion: reduce) { .sk-row i { animation: none; } }
.loading { position: absolute; left: 50%; translate: -50% 0; top: 110px; width: max-content; max-width: calc(100% - 32px); display: none;
  flex-direction: column; align-items: center; gap: 8px; padding: 18px 22px; border-radius: 12px; background: var(--surface);
  box-shadow: 0 6px 24px rgba(0, 0, 0, .12); font-family: var(--font-ja); font-size: 13px; color: var(--muted); text-align: center; }
.loading p { margin: 0; }
.loading .btn { margin-top: 4px; }
:root[data-loading-slow] .loading, :root[data-loading-failed] .loading { display: flex; }
:root[data-loading-failed] .sk-row i { animation: none; opacity: .5; }
/* 半券ちゃん walks (chan-walk.svg) while loading is slow, as when another page is slow to come (css/overrides.css). */
.grid { position: relative; }
.grid.fading { animation: fade-in .18s var(--ease); }
@keyframes fade-in { from { opacity: 0; } }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .25s; animation-timing-function: var(--ease); }

/* ---------- day heading ---------- */
.dayhead { display: flex; align-items: flex-end; justify-content: space-between; flex-wrap: wrap; gap: 4px 16px;
  min-height: 66px; padding: 0 16px 14px; }
.dayhead h2 { margin: 0; display: flex; align-items: baseline; gap: 12px; font-weight: 400; }
.dayhead .big { font-family: var(--font-display); font-style: var(--display-style); font-weight: var(--display-weight);
  font-stretch: var(--display-stretch); font-size: 60px; line-height: .85; letter-spacing: -.02em; padding: 0 .06em; }
.dayhead .big { transition: opacity .3s var(--ease); }
:root[data-display-wait] .dayhead .big { opacity: 0; }
.dayhead .dow { display: grid; gap: 2px; }
.dayhead .hol { margin-left: 6px; color: var(--ng); font-size: .9em; }
.dayhead .en { display: none; font-family: var(--font-num); font-stretch: 100%; font-size: 11px; font-weight: 600; letter-spacing: .2em; text-transform: uppercase; }
.dayhead .ja { font-family: var(--font-ja); font-size: 13px; font-weight: var(--ja-light); color: var(--muted); }
.dayhead p { display: flex; flex-wrap: wrap; gap: 0 14px; margin: 0; color: var(--muted); font-family: var(--font-ja); font-weight: var(--ja-light); font-size: 12px; }
/* The data was read from the cache without a connection (js/boot.js): said once, in the brand colour, in place of 更新. */
.dayhead p .offline { color: var(--accent); }

