/* Opt-in catalogue enhancement. No snap rules apply to article pages. */
@media (max-width: 760px) and (prefers-reduced-motion: no-preference) {
  html.tw-catalogue-snap { scroll-snap-type: y proximity; scroll-padding-top: var(--tw-snap-inset, 72px); }
  .shape-grid > [data-snap-row] { scroll-snap-align: start; scroll-snap-stop: normal; }
}
/* Homepage experiment only; the current grid remains the default. */
.tw-strip-controls { display: none; }
@media (max-width: 760px) {
  html[data-home-layout="strip"] .lineup ul {
    display: grid; grid-template-columns: none; grid-auto-flow: column;
    grid-auto-columns: calc((100% - 40px) / 2); grid-template-rows: auto;
    gap: 12px; overflow-x: auto; overscroll-behavior-x: contain;
    scroll-snap-type: x proximity; scroll-padding-inline: 4px;
    padding: 4px 4px 12px; margin-inline: -4px;
    scrollbar-width: thin; scrollbar-color: var(--line-strong) transparent;
  }
  html[data-home-layout="strip"] .lineup ul > li { min-width: 0; scroll-snap-align: start; scroll-snap-stop: normal; }
  html[data-home-layout="strip"] .lineup a { height: 100%; align-content: start; }
  html[data-home-layout="strip"] .lineup :is(.lineup-name,.lineup-pinyin,.lineup-sub) {
    white-space: normal; overflow: visible; text-overflow: clip; overflow-wrap: anywhere;
  }
  html[data-home-layout="strip"] .lineup figcaption { margin-top: 8px; }
  html[data-home-layout="strip"] .tw-strip-controls { display: flex; justify-content: flex-end; gap: 4px; margin-top: 2px; }
  .tw-strip-controls button { display:grid; place-items:center; width:44px; height:44px; border:0; border-radius:4px; background:transparent; color:var(--muted); font:22px/1 var(--body); cursor:pointer; }
  .tw-strip-controls button:disabled { opacity:.3; cursor:default; }
  .tw-strip-controls button:focus-visible { outline:2px solid var(--accent); outline-offset:-2px; }
}
@media (max-width:760px) and (hover:hover) { .tw-strip-controls button:not(:disabled):hover { background:var(--wash); color:var(--ink); } }
@media (prefers-reduced-motion: reduce) {
  html[data-home-layout="strip"] .lineup ul { scroll-snap-type: none; scroll-behavior: auto; }
}
html.tw-zoomed[data-home-layout="strip"] .lineup ul { scroll-snap-type: none; }
