/* catalog.css — catalog.html */
.catalog-tools { display: grid; grid-template-columns: minmax(0, 1fr); gap: var(--s5); }
.catalog-tools > * + * { margin-top: 0; }
.search { display: grid; gap: var(--s2); max-width: 36rem; }
.search input { width: 100%; min-height: 52px; padding: var(--s3) var(--s5); border: 2px solid var(--line); border-radius: var(--pill); background: var(--bg); color: var(--ink); }
.search input:hover { border-color: var(--ink); }
.search input:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
.catalog-count { margin-block: var(--s6) var(--s5); }
.catalog .item__pic { aspect-ratio: 3 / 4; }
.catalog-empty { margin-top: var(--s6); }

/* Tools row: category filter + name sort */
.catalog-tools__row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s4) var(--s5); }
.sort { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s3); }
.sort__label { font-size: var(--t-xs); color: var(--ink-soft); }
.toggle--light { background: var(--surface); }
.toggle--light button { color: var(--ink); }
.toggle--light button:hover { background: var(--surface-2); }
.toggle--light button[aria-pressed="true"] { background: var(--ink); color: var(--card); }

/* Collection cards: cover links to the reader page; actions, then downloads */
a.item__pic { display: block; }
.item__actions { gap: var(--s2) var(--s4); }
.downloads { list-style: none; padding: 0; margin: var(--s4) var(--s2) var(--s2); display: grid; gap: var(--s1); }
.downloads li { max-width: none; }
.dl { display: flex; align-items: center; gap: var(--s3); min-height: 44px; padding: var(--s2) var(--s3); border-radius: var(--r-sm); background: var(--surface); color: var(--ink); text-decoration: none; font-size: var(--t-xs); transition: background var(--fast); }
.dl:hover { background: var(--surface-2); color: var(--ink); }
.dl__icon { flex-shrink: 0; width: 20px; height: 20px; fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.dl__label { flex: 1; font-weight: 500; }
.dl__meta { color: var(--ink-soft); white-space: nowrap; }
.dl__note { display: block; font-weight: 300; color: var(--ink-soft); }

/* Collection page */
.banner__actions { margin-top: var(--s6); }
.btn .dl__icon { stroke: currentColor; }
.btn__meta { font-weight: 300; }
.btn__meta::before { content: "·"; margin: 0 var(--s2); }
.downloads--panel { margin: 0; gap: var(--s3); max-width: 52rem; }
.downloads--panel .dl { padding: var(--s4) var(--s5); font-size: var(--t-sm); background: var(--card); }
.downloads--panel .dl:hover { background: var(--surface-2); }
.specs--page { margin-top: var(--s5); font-size: var(--t-sm); gap: var(--s3); }
.specs--page div { grid-template-columns: minmax(8rem, 40%) minmax(0, 1fr); padding-bottom: var(--s3); box-shadow: 0 1px 0 var(--surface-2); }
.detail-lists { display: grid; gap: var(--s7); }
.detail-lists h3 { font-size: var(--t-lg); }
.reader { list-style: none; padding: 0; display: grid; gap: var(--s7); max-width: 72rem; }
.reader li { max-width: none; }
.reader img { width: 100%; height: auto; border-radius: var(--r-md); background: var(--surface-2); }
.reader figcaption { margin-top: var(--s3); font-size: var(--t-xs); color: var(--ink-soft); }
.card__pic--cover { aspect-ratio: 3 / 4; }
@media (min-width: 900px) { .split-5-7 > :first-child { grid-column: 1 / span 5; } .split-5-7 > :last-child { grid-column: 7 / -1; } }
.ticks { list-style: none; padding: 0; margin-top: var(--s4); display: grid; gap: var(--s3); }
.ticks li { position: relative; padding-left: var(--s6); max-width: none; }
.ticks li::before { content: ""; position: absolute; left: 0; top: .45em; width: 16px; height: 9px; border-left: 2.5px solid var(--accent); border-bottom: 2.5px solid var(--accent); transform: rotate(-45deg); }
/* Phones: keep the category filter on one line and let it scroll sideways inside the panel */
.catalog-tools__row > [role="group"]:first-child { min-width: 0; max-width: 100%; }
@media (max-width: 899px) {
  .catalog-tools__row > [role="group"]:first-child { flex: 1 1 100%; }
  #catalog-filters { display: flex; flex-wrap: nowrap; justify-content: flex-start; width: 100%; overflow-x: auto; scrollbar-width: none; }
  #catalog-filters::-webkit-scrollbar { display: none; }
  #catalog-filters button { white-space: nowrap; }
}
/* Collection pages follow the centred page layout */
.reader, .downloads--panel { margin-inline: auto; }
.reader figcaption { text-align: center; }
/* Long download labels wrap on narrow phones instead of widening the page */
.banner__actions .btn { white-space: normal; text-align: center; max-width: 100%; }
