/* Catalog page styles. No external fonts or CDNs: the CSP allows only self-hosted css. */
:root {
  --bg: #f6f7f9;
  --panel: #ffffff;
  --ink: #1b1f24;
  --muted: #5b6470;
  --line: #dfe3e8;
  --accent: #1f6feb;
  --accent-ink: #ffffff;
  --note-bg: #eef2f7;
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #14171c;
    --panel: #1c2027;
    --ink: #e8ecf1;
    --muted: #9aa4b2;
    --line: #2d333d;
    --accent: #4d8dfb;
    --accent-ink: #0d1117;
    --note-bg: #232833;
  }
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.65 system-ui, "Segoe UI", "Malgun Gothic", sans-serif;
  word-break: keep-all;
  overflow-wrap: anywhere;
}

.wrap {
  width: 100%;
  max-width: 940px;
  margin: 0 auto;
  padding: 0 16px;
}

a { color: var(--accent); }

.skip {
  position: absolute;
  left: -9999px;
}
.skip:focus {
  left: 16px;
  top: 16px;
  z-index: 2;
  padding: 8px 12px;
  background: var(--panel);
  border-radius: 8px;
}

.hero {
  padding: 48px 0 32px;
  border-bottom: 1px solid var(--line);
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 5vw, 2.5rem);
  line-height: 1.25;
}

.lead {
  margin: 10px 0 4px;
  font-size: 1.15rem;
  font-weight: 600;
}

.sub {
  margin: 0;
  color: var(--muted);
  max-width: 44em;
}

main { padding: 8px 0 24px; }

section { padding: 32px 0; }

h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
}

h3 {
  margin: 0;
  font-size: 1.25rem;
}

.cards {
  display: grid;
  gap: 20px;
}

.card {
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  scroll-margin-top: 16px;
}

/* The button sits at the bottom right of every card, however tall the text above it is. */
.card .actions {
  margin: 0;
  padding-top: 16px;
  margin-top: auto;
  justify-content: flex-end;
}

.cover {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 1;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--note-bg);
}

.cover-link {
  display: block;
  margin-bottom: 16px;
}

#detail .cover {
  margin: 16px 0 20px;
}

.card h3 a {
  text-decoration: none;
  color: var(--ink);
}

.card h3 a:hover { text-decoration: underline; }

/* Detail pages: a slim bar with the trail back to the index. */
.topbar {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}

.topbar nav span { color: var(--muted); }

#detail { max-width: 46rem; }

#detail h1 { margin-bottom: 4px; }

#detail h2 {
  margin: 32px 0 12px;
  padding-top: 20px;
  border-top: 1px solid var(--line);
  font-size: 1.1rem;
}

.back { margin-top: 36px; }

.ver {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}

.tagline {
  margin: 4px 0 0;
  color: var(--muted);
  font-weight: 600;
}

.desc { margin: 0 0 12px; }

.features,
.notes,
.links,
.plain {
  margin: 0 0 14px;
  padding-left: 1.2em;
}

.features li,
.plain li { margin: 2px 0; }

.notes {
  list-style: none;
  padding: 12px 14px;
  background: var(--note-bg);
  border-radius: 10px;
  font-size: 0.92rem;
}

.notes li + li { margin-top: 6px; }

.spec {
  display: grid;
  grid-template-columns: max-content 1fr;
  gap: 2px 14px;
  margin: 0 0 14px;
  font-size: 0.94rem;
}

.spec dt {
  color: var(--muted);
  white-space: nowrap;
}

.spec dd { margin: 0; }

.links {
  list-style: none;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
  font-size: 0.94rem;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 8px;
}

.btn {
  display: inline-block;
  padding: 10px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  border: 1px solid transparent;
  font-weight: 600;
  text-decoration: none;
}

.btn:hover { filter: brightness(1.08); }

.btn.ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line);
}

.btn.is-pending {
  background: var(--note-bg);
  color: var(--muted);
  border-color: var(--line);
}

.small {
  font-size: 0.88rem;
  color: var(--muted);
}

.note { margin: 0 0 10px; min-height: 1.2em; }

.callout {
  padding: 12px 14px;
  background: var(--note-bg);
  border-radius: 10px;
}

footer {
  padding: 24px 0 40px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.94rem;
}

footer p { margin: 4px 0; }

@media (min-width: 720px) {
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
