/* site.css: parsec.ro, the micro-blog in next-parsec/public/ (tools/build.el).

   A white sheet on a grey ground, set on a character grid: 1ch wide,
   one --lh tall. One typeface, Berkeley Mono. Light only, no scripts.
   Ideas from The Monospace Web (the grid, the double rule) and the
   U.S. Graphics catalog (the sheet, hard shadows, dotted chips). */

@font-face {
  font-family: "Berkeley Mono";
  src: url("../fonts/BerkeleyMono-Regular.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Berkeley Mono";
  src: url("../fonts/BerkeleyMono-Bold.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "Berkeley Mono";
  src: url("../fonts/BerkeleyMono-Condensed.woff2") format("woff2");
  font-weight: 400;
  font-stretch: 75%;
  font-style: normal;
  font-display: swap;
}

:root {
  --ground: #e6e8ec;  /* around the sheet, a faintly blue grey */
  --paper: #fff;
  --ink: #000;
  --muted: #5b5f68;
  --edge: #8a8e96;    /* the sheet's border */
  --rule: #c2c6ce;    /* light borders, hard shadows */
  --mark: #fff5b1;    /* selected text */
  --brand: #a00000;   /* the name: parsec.ro's red (public/: --color-tufte-red) */
  --launch: #2f6a42;  /* launch IDs, under white: a green of the logo */
  --fail: #c62828;    /* failed launches (2026-F07), under white */
  --lh: 1.375rem;     /* one line of the grid */
  --font: "Berkeley Mono", ui-monospace, Menlo, Consolas, "DejaVu Sans Mono", monospace;
  color-scheme: light;
  font-size: 16px;
}

* { box-sizing: border-box; }

html {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font);
  line-height: var(--lh);
  font-variant-numeric: tabular-nums;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: min(80ch, 100% - 4ch);
  margin: calc(2 * var(--lh)) auto;
  padding: var(--lh) 3ch;
  background: var(--paper);
  border: 1px solid var(--edge);
  box-shadow: 2px 2px var(--rule);
}

/* Pages (Pagini, and those to come, with their tables): a wider sheet,
   their prose kept to the measure of the notes */
body.wide { width: min(125ch, 100% - 4ch); }
.wide main > :is(p, ul, ol, blockquote) { max-width: 74ch; }

::selection { background: var(--mark); color: var(--ink); }

/* Text */

p, ul, ol, blockquote, pre, figure, .scroll { margin: 0 0 var(--lh); }
ul, ol { padding-left: 2ch; }
ul { list-style: square; }
b, strong { font-weight: 700; }
i, em { font-style: italic; }
.nowrap { white-space: nowrap; }  /* Cluj-Napoca: U+2011, which the font lacks */

h1, h2, h3 {
  margin: 0 0 var(--lh);
  font-size: 1rem;
  line-height: var(--lh);
  font-weight: 700;
  text-transform: uppercase;
}

/* The page's heading stands on a band of dots, half a line high */
main > h1::after {
  content: "";
  display: block;
  height: calc(var(--lh) / 2);
  margin-top: calc(var(--lh) / 2);
  background: radial-gradient(var(--muted) 0.5px, transparent 1px) 0 0 / 3px 3px;
}

/* Links: in the colour of their text, underlined with a thin line in
   the name's red, red all over when hovered */
a {
  color: inherit;
  text-decoration-color: var(--brand);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}
a:hover { color: var(--brand); }
a:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

blockquote {
  margin-left: 0;
  margin-right: 0;
  padding-left: 2ch;
  border-left: 2px solid var(--ink);
}

code { padding: 0 0.5ch; background: var(--ground); }
pre { overflow-x: auto; }

img {
  display: block;
  max-width: 100%;
  height: auto;
  border: 1px solid var(--rule);
  box-shadow: 2px 2px var(--rule);
}

/* Photos of a note: as wide as the text, the caption set as footnotes */

figure img { width: 100%; }

figcaption {
  margin-top: calc(var(--lh) / 2);
  color: var(--muted);
  font-size: 0.875rem;
  line-height: 1.125rem;
}

/* Tables: inside .scroll, which scrolls them on a phone */

.scroll { overflow-x: auto; padding: 0 2px 2px 0; }
table { border-collapse: collapse; box-shadow: 2px 2px var(--rule); }
th, td {
  padding: 0 1ch;
  border: 1px solid var(--rule);
  text-align: left;
  vertical-align: top;
}
thead th { border-bottom-color: var(--ink); }
tfoot th, tfoot td { border-top-color: var(--ink); font-weight: 700; }
.n { text-align: right; }

/* Masthead: the logo, three lines high, and the name */

.masthead {
  display: flex;
  align-items: flex-start;
  gap: 2ch;
  margin-bottom: var(--lh);
}

.brand {
  display: flex;
  flex: 1;
  gap: 2ch;
  min-width: 0;
  color: var(--ink);
  text-decoration: none;
}

.brand img {
  width: calc(3 * var(--lh));
  height: calc(3 * var(--lh));
  border: 0;
  box-shadow: none;
  /* Centred on the text as it is seen, from the top of the name's small
     letters (it has no tall ones) to the tagline's baseline: a quarter
     of a line lower than its box. Drawn lower, not laid out lower, so
     the lines below keep their place. */
  position: relative;
  top: calc(var(--lh) / 4);
}

/* The name in red, two lines high, and the tagline under it, as long:
   in a monospace, the 16 characters of "știri din spațiu" are as long
   as the 9 of "parsec.ro" at 9/16 of its size */
.brand { --name-size: 2rem; }

.brand .name {
  display: block;
  font-size: var(--name-size);
  line-height: calc(2 * var(--lh));
  font-weight: 700;
  color: var(--brand);
}

.brand .tagline {
  display: block;
  font-size: calc(var(--name-size) * 9 / 16);
  color: var(--muted);
}
/* The menu, top right: plain links (the boxed tabs are the news'); the
   page's own in black, not underlined */
.masthead .links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0 2ch;
}

.links a[aria-current] { color: var(--ink); font-weight: 700; text-decoration: none; }

/* Tabs: one per category, boxed, inverted for the current one */

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: calc(var(--lh) / 2) 1ch;
  margin-bottom: calc(2 * var(--lh));
}

.tabs a {
  padding: 0 0.75ch;
  border: 1px solid var(--ink);
  box-shadow: 2px 2px var(--rule);
  color: var(--ink);
  text-decoration: none;
}

.tabs a:hover, .tabs a[aria-current] { background: var(--ink); color: var(--paper); }

/* Notes: the text, ending with "— time"; a dashed rule between two */

article + article {
  margin-top: var(--lh);
  padding-top: var(--lh);
  border-top: 1px dashed var(--ink);
}

article > :last-child { margin-bottom: 0; }
.dateline { white-space: nowrap; color: var(--muted); }
.stamp { text-decoration: none; }
.stamp:hover { text-decoration: underline; }

/* A footnote mark doesn't open up its line */
sup { line-height: 0; }

/* Footnotes: smaller and closer set, under a short rule */
.footnotes {
  padding-top: calc(var(--lh) / 2);
  background: linear-gradient(var(--ink), var(--ink)) 0 0 / 16ch 1px no-repeat;
  font-size: 0.875rem;
  line-height: 1.125rem;
  overflow-wrap: break-word;
}

.footdef { display: flex; gap: 1ch; }
.footdef + .footdef { margin-top: 0.25rem; }
.footdef > sup { font-size: inherit; line-height: inherit; }
.footpara { min-width: 0; margin: 0; }

.cospar {
  display: inline-block;
  padding: 0 0.5ch;
  border: 1px dotted var(--ink);
  line-height: calc(var(--lh) - 4px);
  color: var(--ink);
  text-decoration: none;
}

.cospar { background: var(--launch); color: var(--paper); font-weight: 700; }
.cospar.fail { background: var(--fail); }

/* After the notes, the way on (the archive, the years): under the same
   dashed rule as between two notes */
.more {
  margin: var(--lh) 0 0;
  padding-top: var(--lh);
  border-top: 1px dashed var(--ink);
}

/* Pagini: a group a row, its name in the first column; the dashed rule
   of the notes between two */

.group {
  display: grid;
  grid-template-columns: 14ch minmax(0, 1fr);
  gap: 0 2ch;
}

.group + .group {
  margin-top: var(--lh);
  padding-top: var(--lh);
  border-top: 1px dashed var(--ink);
}

.group h2 { margin: 0; }
.group ul { margin: 0; padding: 0; list-style: none; }
.group .what { color: var(--muted); }

/* A page written in Org (micro/, Despre): each top heading opens a
   section, under the dashed rule of the notes */

.outline-2 {
  margin-top: var(--lh);
  padding-top: var(--lh);
  border-top: 1px dashed var(--ink);
}

/* Footer: small print, condensed, under a double rule; its words as
   the current site's (parsec.ro, Org mode), so not in capitals */

footer {
  margin-top: calc(2 * var(--lh));
  padding-top: var(--lh);
  border-top: 3px double var(--ink);
  color: var(--muted);
  font-size: 0.875rem;
  font-stretch: 75%;
}

footer p { margin-bottom: 0; }

/* Phones: no sheet, the page is the paper */

@media (max-width: 40rem) {
  :root { font-size: 14px; }
  html { background: var(--paper); }
  body {
    width: auto;
    margin: 0;
    padding: var(--lh) 2ch;
    border: 0;
    box-shadow: none;
  }
  .masthead { flex-wrap: wrap; }
  .masthead .links { flex-basis: 100%; justify-content: flex-start; }
  .group { grid-template-columns: minmax(0, 1fr); }
  .group h2 { margin-bottom: calc(var(--lh) / 2); }
  .group li + li { margin-top: calc(var(--lh) / 4); }
}
