/* ═══════════════════════════════════════════════════════════════════
   projects.provire.com — base
   Layout primitives only. Every colour, face and texture comes from the
   theme, so a theme can look like anything without fighting this file.
   The contract a theme must satisfy is at the bottom.
   ═══════════════════════════════════════════════════════════════════ */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; }

img, svg, video { max-width: 100%; height: auto; }

/* ── identity band: constant across every theme ────────────────────── */
.band {
  display: flex; align-items: center; justify-content: space-between;
  gap: 1rem; flex-wrap: wrap;
  padding: .7rem var(--pad, 1.5rem);
}
.band__nav { display: flex; align-items: center; gap: 1.2rem; flex-wrap: wrap; }

/* ── page frame ────────────────────────────────────────────────────── */
.pr { max-width: var(--max, 60rem); margin: 0 auto; padding: 0 var(--pad, 1.5rem); }
.pr__head { padding: clamp(2.5rem, 8vw, 5rem) 0 clamp(1.6rem, 4vw, 2.6rem); }
.pr__name { margin: 0 0 .8rem; }
.pr__sum { margin: 0 0 1.4rem; max-width: 60ch; }
.pr__meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: .5rem 1.2rem;
  margin: 0; padding-top: 1.1rem;
}
.pr__links { display: flex; flex-wrap: wrap; gap: 1.1rem; margin-top: 1.1rem; }
.pr__links:empty { display: none; }

.pr > section { padding: clamp(2rem, 5vw, 3.2rem) 0; }
.pr > section > h2 { margin: 0 0 1.4rem; }

/* ── reference ─────────────────────────────────────────────────────── */
.pr__ref > p, .pr__ref > ul { max-width: 68ch; }
.tbl { overflow-x: auto; margin: 0 0 1.5rem; }
.tbl table { border-collapse: collapse; width: 100%; min-width: 34rem; }
.tbl th, .tbl td { text-align: left; padding: .55rem .7rem; vertical-align: top; }

/* ── files ─────────────────────────────────────────────────────────── */
.dl { list-style: none; margin: 0; padding: 0; }
.dl li { padding: .8rem 0; }
.dl a { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; text-decoration: none; }
.dl__desc { display: block; margin-top: .3rem; }

/* ── log ───────────────────────────────────────────────────────────── */
.ent {
  display: grid; gap: .5rem 2rem; grid-template-columns: 1fr;
  padding: clamp(1.4rem, 3vw, 2.2rem) 0;
  scroll-margin-top: 4.5rem;
}
@media (min-width: 860px) { .ent { grid-template-columns: 9rem 1fr; } }
.ent__body { max-width: 68ch; min-width: 0; }
.ent__body h3 { margin: 0 0 .8rem; }
.ent__body h3 a { text-decoration: none; color: inherit; }
.ent__body > p { margin: 0 0 1.05rem; }
.ent__body ul { margin: 0 0 1.15rem; padding-left: 1.15rem; }
.ent__body li { margin-bottom: .45rem; }
.ent__body pre { margin: 0 0 1.2rem; padding: .9rem 1rem; overflow-x: auto; }
.ent__body h4 { margin: 1.3rem 0 .6rem; }

/* ── project index ─────────────────────────────────────────────────── */
.all { list-style: none; margin: 0; padding: 0; }
.all a {
  display: grid; gap: .15rem 1.2rem; grid-template-columns: 1fr auto;
  align-items: baseline; padding: .85rem .2rem; text-decoration: none;
}
@media (min-width: 860px) { .all a { grid-template-columns: 15rem 1fr 2.5rem 7rem 8rem; } }

/* ── status pill ───────────────────────────────────────────────────── */
.st { display: inline-flex; align-items: center; gap: .42rem; white-space: nowrap; }
.st::before { content: ""; width: 6px; height: 6px; border-radius: 50%; flex: none; }

.pr__foot { padding: 2.5rem var(--pad, 1.5rem) 3.5rem; text-align: center; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    transition-duration: .01ms !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
  }
}

/* ═══════════════════════════════════════════════════════════════════
   Theme contract. A theme file must set:
     background + colour on  body
     type on                 .pr__name .pr__sum .pr__meta h2 h3 .band
     colour on               a, .st::before per state, .tbl th/td borders,
                             .dl borders, .ent separators, pre, code
     optionally              --pad, --max, any signature decoration
   A theme may look like anything. It must not change layout structure,
   because that lives here.
   ═══════════════════════════════════════════════════════════════════ */

/* ── figures ────────────────────────────────────────────────────────
   One element per digit, so a theme can turn each into a nixie tube, a
   HUD box, or leave it as a numeral. Layout only. */
.figs {
  list-style: none; display: flex; flex-wrap: wrap;
  gap: 1.2rem 2.4rem; margin: 0 0 2.4rem; padding: 0;
}
.figs li { display: flex; flex-direction: column; gap: .5rem; }
.figs b { display: flex; align-items: flex-end; gap: .2rem; }
.figs b i { font-style: normal; }

/* ── galleries ──────────────────────────────────────────────────────
   Consecutive markdown images group into one figure row. Layout only;
   a theme decides frames, captions and whether pixels are smoothed. */
.gal { display: grid; gap: 1rem; margin: 0 0 1.8rem; }
@media (min-width: 620px) { .gal[data-n="2"], .gal[data-n="4"] { grid-template-columns: 1fr 1fr; } }
@media (min-width: 620px) { .gal[data-n="3"], .gal[data-n="5"], .gal[data-n="6"] { grid-template-columns: 1fr 1fr; } }
@media (min-width: 940px) { .gal[data-n="3"], .gal[data-n="5"], .gal[data-n="6"] { grid-template-columns: 1fr 1fr 1fr; } }
.gal figure { margin: 0; display: flex; flex-direction: column; gap: .5rem; }
.gal img { display: block; width: 100%; height: auto; }
.gal figcaption { font-size: .88em; }
