/* Locus Skies — calm dark gallery theme. Generated by scripts/build_site.py. */

:root {
  color-scheme: dark;
  --bg: #0b0d10;
  --bg-elev: #14181e;
  --bg-hover: #1b212a;
  --line: #262d38;
  --line-soft: #1c222b;
  --text: #f2f5f9;
  --muted: #9aa5b4;
  --muted-dim: #77828f;
  --accent: #9dc2ff;
  --accent-ink: #0b0d10;
  --radius: 12px;
  --wrap: 1200px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.55;
  letter-spacing: 0.005em;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.muted { color: var(--muted-dim); }

/* Header ------------------------------------------------------------ */
.site-header { border-bottom: 1px solid var(--line-soft); padding: 56px 0 32px; }
.site-header.compact { padding: 26px 0 22px; }
.brand {
  margin: 0; font-size: 1.35rem; font-weight: 600; letter-spacing: 0.01em;
  color: var(--text); display: inline-block;
}
a.brand:hover { text-decoration: none; color: var(--accent); }
.tagline { margin: 10px 0 0; font-size: 1.05rem; color: var(--muted); max-width: 56ch; }
.license-line { margin: 14px 0 0; font-size: 0.85rem; color: var(--muted-dim); }
.site-header.compact .license-line { margin-top: 6px; }

/* Filters ------------------------------------------------------------ */
.filters { padding: 32px 0 6px; border-bottom: 1px solid var(--line-soft); }
.search-row { margin-bottom: 22px; }
#q {
  width: 100%; max-width: 420px; padding: 11px 14px;
  background: var(--bg-elev); color: var(--text);
  border: 1px solid var(--line); border-radius: var(--radius);
  font: inherit; font-size: 0.95rem;
}
#q::placeholder { color: var(--muted-dim); }

.axes { display: flex; flex-direction: column; gap: 14px; }
.axis { display: grid; grid-template-columns: 92px minmax(0, 1fr); gap: 10px 14px; align-items: baseline; }
.axis-label {
  margin: 0; font-size: 0.72rem; text-transform: uppercase;
  letter-spacing: 0.12em; color: var(--muted-dim);
}
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 0; padding: 0; list-style: none; min-width: 0; }
/* position:relative keeps the hidden checkbox's containing block inside the
   chip; otherwise it resolves to the page and widens the document when a
   chip sits past the right edge of a scrolling filter rail. */
.chip { display: inline-flex; position: relative; }
.chip input { position: absolute; inset: 0; width: 1px; height: 1px; opacity: 0; }
.chip span, .chip-link {
  display: inline-block; padding: 5px 12px; cursor: pointer;
  background: var(--bg-elev); border: 1px solid var(--line);
  border-radius: 999px; font-size: 0.85rem; color: var(--muted);
  transition: background 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.chip span:hover, .chip-link:hover { background: var(--bg-hover); color: var(--text); text-decoration: none; }
.chip input:checked + span { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 500; }
.chip input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 3px; }

.results-bar { display: flex; align-items: center; gap: 16px; padding: 22px 0 20px; }
.count { margin: 0; font-size: 0.9rem; color: var(--muted); }
.clear {
  background: none; border: 1px solid var(--line); color: var(--muted);
  border-radius: 999px; padding: 5px 12px; font: inherit; font-size: 0.82rem; cursor: pointer;
}
.clear:hover { background: var(--bg-hover); color: var(--text); }
.note { margin: 0 0 18px; font-size: 0.9rem; color: var(--muted-dim); }

/* Grid ---------------------------------------------------------------- */
.grid {
  list-style: none; margin: 34px 0 0; padding: 0;
  display: grid; gap: 22px; grid-template-columns: 1fr;
}
@media (min-width: 560px) { .grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 900px) { .grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1180px) { .grid { grid-template-columns: repeat(4, 1fr); } }

.card {
  background: var(--bg-elev); border: 1px solid var(--line-soft);
  border-radius: var(--radius); overflow: hidden;
  transition: border-color 0.18s ease, transform 0.18s ease;
}
.card:hover { border-color: var(--line); transform: translateY(-2px); }
/* Cards in a row stretch to a shared height; badges sit on the bottom edge. */
.card > a { display: flex; flex-direction: column; height: 100%; color: inherit; }
.card > a:hover { text-decoration: none; }
.card img {
  /* height:auto is required: the img's height="512" attribute is a
     presentational hint that would otherwise beat aspect-ratio. */
  display: block; width: 100%; height: auto; aspect-ratio: 2 / 1; object-fit: cover;
  background: #0f1318; border-bottom: 1px solid var(--line-soft);
}
.card-body { padding: 14px 16px 16px; display: flex; flex-direction: column; flex: 1; }
.card-title { margin: 0; font-size: 0.98rem; font-weight: 550; line-height: 1.35; }
.badges { display: flex; gap: 6px; margin: auto 0 0; padding-top: 12px; }
.badge {
  font-size: 0.68rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--muted-dim); border: 1px solid var(--line);
  border-radius: 5px; padding: 2px 7px;
}
.empty { margin: 60px 0; text-align: center; color: var(--muted); font-size: 0.95rem; }

/* Detail -------------------------------------------------------------- */
/* The detail wrap matches the index grid's own max-width so the panorama
   can run full-bleed; the text blocks below it get their own narrower
   reading-width cap (see the >=1024px block further down). */
.is-detail .wrap { max-width: var(--wrap); }
.detail { padding-bottom: 24px; }
.crumbs { padding: 26px 0 0; font-size: 0.88rem; }
.detail-title { margin: 20px 0 0; font-size: 1.9rem; line-height: 1.2; font-weight: 600; letter-spacing: -0.01em; }
.detail-zh { margin: 8px 0 0; font-size: 1rem; color: var(--muted); }
.detail-notes { margin: 10px 0 0; font-size: 0.9rem; color: var(--muted-dim); line-height: 1.55; max-width: 60ch; }
.detail .chips { margin: 20px 0 0; }

.pano { margin: 28px 0 0; }
.pano img {
  display: block; width: 100%; max-width: 100%; height: auto;
  border-radius: var(--radius); border: 1px solid var(--line-soft); background: #0f1318;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 22px 0 0; }
.btn {
  display: inline-block; padding: 9px 18px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--bg-elev); color: var(--text);
  font: inherit; font-size: 0.9rem; cursor: pointer;
}
.btn:hover { background: var(--bg-hover); text-decoration: none; }
.btn-primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 550; }
.btn-primary:hover { background: #b6d2ff; text-decoration: none; }
.hint { margin: 12px 0 0; font-size: 0.86rem; color: var(--muted-dim); }

.meta {
  margin: 34px 0 0; padding: 22px 24px; display: grid; gap: 10px 24px;
  grid-template-columns: 1fr; background: var(--bg-elev);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
  font-size: 0.9rem;
}
@media (min-width: 640px) { .meta { grid-template-columns: 168px 1fr; } }
.meta dt { color: var(--muted-dim); }
.meta dd { margin: 0; color: var(--text); }
/* stacked on narrow screens: keep each label glued to its own value */
@media (max-width: 639px) {
  .meta { gap: 0; padding: 18px 20px; }
  .meta dt { margin-top: 15px; }
  .meta dt:first-of-type { margin-top: 0; }
  .meta dd { margin-top: 3px; }
}

details.prose {
  margin: 16px 0 0; padding: 14px 18px; background: var(--bg-elev);
  border: 1px solid var(--line-soft); border-radius: var(--radius);
}
details.prose summary {
  cursor: pointer; font-size: 0.78rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--muted-dim);
}
details.prose p { margin: 12px 0 0; font-size: 0.9rem; color: var(--muted); line-height: 1.65; }
.back { margin: 40px 0 0; font-size: 0.9rem; }

/* At >=1024px the wrap is wide enough (matching the index grid) that a
   full-width panorama would leave the title/tags/actions/metadata/prompt
   text stretched past a comfortable reading measure. Cap just those blocks;
   .pano stays full width and left-aligned under it (no auto margins, since
   the wrap itself isn't centered against anything narrower). */
@media (min-width: 1024px) {
  .crumbs, .detail-title, .detail-zh, .detail-notes, .detail .chips, .actions, .hint,
  .meta, details.prose, .back {
    max-width: 760px;
  }
}

/* Footer -------------------------------------------------------------- */
.site-footer {
  margin-top: 72px; padding: 28px 0 44px;
  border-top: 1px solid var(--line-soft); font-size: 0.82rem; color: var(--muted-dim);
}
.site-footer p { margin: 0 0 4px; }

@media (max-width: 560px) {
  .wrap { padding: 0 18px; }
  .site-header { padding: 32px 0 22px; }
  .filters { padding: 24px 0 4px; }
  .grid { gap: 18px; margin-top: 26px; }
  .empty { margin: 44px 0; }
  .detail-title { font-size: 1.5rem; }
}

/* Filter density: five stacked chip rails plus a full-width search box and
   a standalone result-count block used to push the first grid card below
   the fold on phones (and small tablets, hence the wider-than-560 cutoff).
   The search box and the count/clear line become items in one wrapping flex
   row -- sharing a row when there's width for both, stacking with a tight
   gap when there isn't -- so that block collapses from three stacked pieces
   (search, axes, results) to two (search+count, axes). */
@media (max-width: 719px) {
  .filters {
    display: flex; flex-wrap: wrap; align-items: center;
    justify-content: space-between; row-gap: 8px; column-gap: 16px;
  }
  .search-row { order: 1; flex: 0 1 260px; margin: 0; }
  .results-bar { order: 2; flex: 0 0 auto; padding: 0; }
  .axes { order: 3; flex: 1 1 100%; gap: 10px; }
  .axis { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .axis-label { margin: 0 0 4px; }
  .chip span, .chip-link { padding: 6px 12px; font-size: 14px; }
  /* One scrollable rail per axis, so filters never push the gallery off screen.
     The right-edge fade only shows on rows that actually overflow. */
  .axes .chips {
    flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none;
    padding: 3px 0; margin: -3px 0; -webkit-overflow-scrolling: touch;
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
    mask-image: linear-gradient(to right, #000 calc(100% - 30px), transparent);
  }
  .axes .chips::-webkit-scrollbar { display: none; }
  .axes .chip { flex: 0 0 auto; }
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
  .card:hover { transform: none; }
}
