/* Overrides on top of simple.css, loaded after it.
   Sibling of extra.css: the same plain-text specification design, for the
   pages that hang off the index.

   build-site.el attaches this via :html-head-extra on the `projects` and
   `publications` projects, so it reaches projects/*.html (including the
   generated projects/index.html) and publications/*.html — confs, journals,
   pubs and publications/index.html.

   Three things differ from extra.css and account for every rule below:

   - These projects set :html-preamble, so `header#top` *is* emitted here —
     unlike the `pages` project, where it is declared but never rendered.
     It holds the whole navigation: one link back home.
   - No contact record, so no rail: `main` stays in normal flow as a single
     text column.
   - No table of contents. :with-toc is only set on `pages`, and
     org-export-with-toc is nil, so nothing here emits #table-of-contents.

   The shared base is repeated rather than @import-ed: an import would make
   every index.html tweak land on the project pages too. */


/* ========================================================================
   Shared: the plain-text base, identical to extra.css.
   ======================================================================== */

/* The whole retheme is one variable: simple.css sets
   html { font-family: var(--sans-font) }. */
:root { --sans-font: var(--mono-font); }

body { font-size: 0.93rem; line-height: 1.55; }

h1.title {
  font-size: 0.93rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  margin-block: 1rem 0.8rem;
  padding-block-end: 0.4rem;
  border-block-end: 3px double var(--border);
}

/* simple.css boxes every section; a spec draws no boxes. */
section { border: 0; padding: 0; margin-block: 0 1.5rem; }

/* One paragraph rhythm for the whole page. simple.css's 1.5rem is tuned for
   its 1.15rem body; at 0.93rem mono it reads as a gap. Covers the lead prose
   sitting straight in <main>, the section bodies, and the footer lines. */
p { margin-block: 0 0.55rem; }

.org-ul { list-style: none; padding-inline-start: 3ch; }
.org-ul > li::before { content: "— "; margin-inline-start: -3ch; color: var(--text-light); }

.timestamp { font-variant: tabular-nums; color: var(--text-light); }

footer.status {
  border-top: 3px double var(--border);
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: start;
}


/* ========================================================================
   The way back: one link, not a banner.

   simple.css makes `body > header` a full-bleed centred band in --accent-bg
   and its nav link a rounded button — two boxes, where the design wants a
   line of type. Everything here is anchored on #top rather than
   `body > header` to clear simple.css's own specificity: `body > header >
   *:only-child` and `header nav a:visited` both carry a class-column point,
   which a plain descendant selector cannot outrank.
   ======================================================================== */

header#top {
  grid-column: 2;
  background: none;
  border-block-end: 0;
  text-align: start;
  padding: 1.4rem 0 0;
}

/* Undoes both simple.css's nav padding and the 2rem that
   `body > header > *:only-child` grants the lone nav. */
header#top nav {
  margin: 0;
  padding: 0;
  font-size: 0.78rem;
  line-height: 1.6;
}

/* Same treatment as extra.css's table of contents, which is the nav slot of
   this design: uppercase, letterspaced, quiet until hovered. */
header#top nav a,
header#top nav a:visited {
  margin: 0;
  padding: 0;
  border: 0;
  text-transform: uppercase;
  letter-spacing: 0.09em;
  color: var(--text-light);
  text-decoration: none;
}

header#top nav a::before { content: "← "; }

header#top nav a:hover { color: var(--accent); text-decoration: underline; }

/* The nav already spaces the title; simple.css's 1.5rem assumed a banner. */
main { padding-block-start: 0.2rem; }


/* ========================================================================
   The sections.

   Headings carry no numbers. build-site.el sets
   `org-export-with-section-numbers nil`, so nothing here reintroduces them
   with counters — the hierarchy is carried by type alone, matching extra.css.
   ======================================================================== */

/* `section.outline-2` rather than `section >`: simple.css's
   `section h2:first-child { margin-top: 1rem }` outranks a bare type
   selector, and every section heading is a first child. */
section.outline-2 > h2 {
  font-size: 0.93rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  margin-block: 0 0.45rem;
}


/* ========================================================================
   Source blocks. Only projects/modelica.html has any; simple.css gives them
   a filled, rounded, bordered box, which is three boxes too many.
   ======================================================================== */

pre.src {
  background: none;
  border: 0;
  border-inline-start: var(--border-width) solid var(--border);
  border-radius: 0;
  margin-block: 0 0.8rem;
  padding: 0.1rem 0 0.1rem 2ch;
  font-size: 0.86rem;
}


/* ========================================================================
   The lists: the projects index, and the publication bibliographies.

   Both are `ul.org-ul`, so the dash marker above already fits them. The
   bibliography entries run to three lines each and need to be told apart;
   the hanging dash keeps the wrapped lines aligned.
   ======================================================================== */

.org-ul > li + li { margin-block-start: 0.5rem; }
