/* ============================================================
   The news sheet.

   Two documents are printed with these rules: the post written
   for an audience — a news item — and a version's release note.
   They don't come from the same table, but they say the same
   thing in the same order: a title, an intro, then what
   changes, section by section. Two stylesheets would have made
   them diverge at the first adjustment.

   This isn't an order form, and it shows: nothing to fill in,
   nothing to tick, no column of amounts. It's a document meant
   to be read — hence a 9.5-point body instead of 8, wide
   margins, and a single column. It can also run over several
   pages, which an order form never does: the page-break rules
   therefore matter as much as the design.

   The foundation — A4 format, preview frame, action bar, the
   @media print rule — lives in paper.css.
   ============================================================ */

.ns {
    --ns-ink: #14181d;
    --ns-muted: #5d646f;
    --ns-rule: #d9dde2;
    --ns-hair: #eceef1;
    --ns-accent: #0e6e63;

    padding: 16mm 18mm 14mm;
    font-size: 9.5pt;
    line-height: 1.45;
}

/* --- Sections ---

   One hue per section, used only for the badge and the heading: the text stays black,
   because the sheet goes out to a customer and eight lines in colour are no longer readable.
   The four values cover both documents — NewsKind and ReleaseItemCategory carry the same
   words, hence the same classes. */
.ns-feature {
    --ns-tone: #0e6e63;
}

.ns-improvement {
    --ns-tone: #2573c1;
}

.ns-fix {
    --ns-tone: #a8631a;
}

.ns-info,
.ns-other {
    --ns-tone: #5d646f;
}

/* A release note's sections are areas of the product (Peppol, Général…): no area is better
   or worse news than another, so they all take the document's accent. */
.ns-module {
    --ns-tone: var(--ns-accent);
}

/* --- Header ---

   The rule is thick and in the text's ink: that's what gives the document the look of a
   publication rather than an internal memo. */
.ns-head {
    display: flex;
    align-items: flex-start;
    gap: 10mm;
    padding-bottom: 3mm;
    border-bottom: 2px solid var(--ns-ink);
}

.ns-head-main {
    flex: 1 1 auto;
    min-width: 0;
}

/* The kicker: what the sheet is about before its title has been read — the product, its
   version, the announced section. */
.ns-eyebrow {
    margin: 0 0 1.5mm;
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2.5mm;
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 7pt;
    font-weight: 500;
    letter-spacing: .12em;
    text-transform: uppercase;
    color: var(--ns-accent);
}

.ns-eyebrow-sep {
    color: var(--ns-rule);
}

.ns-title {
    margin: 0;
    font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
    font-size: 21pt;
    font-weight: 700;
    letter-spacing: -.015em;
    line-height: 1.06;
    text-wrap: balance;
}

/* The date, top right with the logo. A release note is looked up by its date at least as
   much as by its number. */
.ns-stamp {
    flex: none;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 2mm;
    text-align: right;
}

.ns-stamp-logo {
    display: block;
    width: 30mm;
    height: auto;
}

.ns-stamp-date {
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 7.5pt;
    letter-spacing: .04em;
    color: var(--ns-muted);
}

/* --- The intro ---

   Two or three sentences, larger than the body: it's what gets read when only the beginning
   gets read. */
.ns-lead {
    margin: 6mm 0 0;
    max-width: 150mm;
    font-size: 11.5pt;
    line-height: 1.4;
    color: var(--ns-muted);
    text-wrap: pretty;
}

/* --- The written body ---

   What the author wrote in Markdown. Margins are tighter than on screen: on paper, a
   paragraph with too much breathing room pushes what follows onto the next page. */
.ns-body {
    margin-top: 5mm;
}

.ns-body > :first-child {
    margin-top: 0;
}

.ns-body p {
    margin: 0 0 2.5mm;
}

.ns-body h1,
.ns-body h2,
.ns-body h3 {
    margin: 5mm 0 1.5mm;
    font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
    font-size: 11pt;
    font-weight: 600;
    line-height: 1.2;
    break-after: avoid;
}

.ns-body ul,
.ns-body ol {
    margin: 0 0 2.5mm;
    padding-left: 5mm;
}

.ns-body li {
    margin-bottom: .8mm;
}

.ns-body a {
    color: var(--ns-accent);
    text-decoration: none;
}

.ns-body code {
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: .92em;
    background: var(--ns-hair);
    padding: 0 1mm;
    border-radius: .8mm;
}

.ns-body img {
    max-width: 100%;
    height: auto;
}

/* --- Sections ---

   The heading carries its badge and its rule. "break-after: avoid" keeps it with what it
   introduces: a section heading alone at the bottom of a page says nothing. */
.ns-section {
    margin-top: 8mm;
}

.ns-section-head {
    display: flex;
    align-items: center;
    gap: 2.5mm;
    padding-bottom: 1.2mm;
    border-bottom: 1.5px solid var(--ns-tone, var(--ns-accent));
    break-after: avoid;
}

.ns-section-dot {
    flex: none;
    width: 2.2mm;
    height: 2.2mm;
    border-radius: 50%;
    background: var(--ns-tone, var(--ns-accent));
}

.ns-section-title {
    font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
    font-size: 11pt;
    font-weight: 600;
    letter-spacing: .01em;
    color: var(--ns-tone, var(--ns-accent));
}

/* The section's count, to the right of the rule. Three fixes are seen before they are
   counted. */
.ns-section-count {
    margin-left: auto;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 7.5pt;
    color: var(--ns-muted);
}

/* --- Entries ---

   A list without bullets: each entry carries its number — 1, 2, 3 across the note — in a
   column of its own, so the sentences line up under one another. The separating rule is a
   hairline.

   "break-inside: avoid" keeps an entry in one piece: a sentence split across two pages is
   what distinguishes a printed document from a typeset one. */
.ns-list {
    margin: 0;
    padding: 0;
    list-style: none;
}

.ns-entry {
    display: grid;
    grid-template-columns: 7mm 1fr;
    column-gap: 1.5mm;
    align-items: baseline;
    padding: 2.5mm 0;
    border-bottom: 1px solid var(--ns-hair);
    break-inside: avoid;
}

.ns-entry-num {
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 8pt;
    font-weight: 600;
    color: var(--ns-tone, var(--ns-accent));
}

.ns-entry-main {
    min-width: 0;
}

.ns-entry:last-child {
    border-bottom: 0;
}

.ns-entry-title {
    font-weight: 600;
}

/* The ticket reference, for whoever follows a specific number. It only appears on internal
   documents — see NoteSheet. */
.ns-entry-ref {
    margin-left: 2mm;
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 7.5pt;
    color: var(--ns-muted);
}

.ns-entry-body {
    margin-top: .8mm;
    color: var(--ns-muted);
}

.ns-entry-body p {
    margin: 0 0 1.5mm;
}

.ns-entry-body > :last-child {
    margin-bottom: 0;
}

/* An entry with no written sentence: only its title carries it. The body isn't shown, and
   the spacing tightens so that the list stays a list. */
.ns-entry-bare {
    padding: 1.6mm 0;
}

/* Without a body the title is the whole entry — every line of a release note: in bold, a
   column of sentences reads as one block. The bold only marks a title that has text under it. */
.ns-entry-bare .ns-entry-title {
    font-weight: 400;
}

/* --- The versions of a range ---

   A range sheet strings several notes together, the most recent first. Each version opens on
   its number, in the text's ink and above the sections' size: it is the level the reader scans
   for — "where does my version start?" — and the sections under it keep their own look. */
.ns-version {
    margin-top: 9mm;
}

.ns-version-head {
    display: flex;
    align-items: baseline;
    flex-wrap: wrap;
    gap: 2.5mm;
    padding-bottom: 1.5mm;
    border-bottom: 1px solid var(--ns-ink);
    break-after: avoid;
}

.ns-version-name {
    font-family: "IBM Plex Sans Condensed", "IBM Plex Sans", sans-serif;
    font-size: 14pt;
    font-weight: 700;
    letter-spacing: -.01em;
    font-variant-numeric: tabular-nums;
}

/* The channel of a Next, and the mark of a draft. Small and outlined: they qualify the number,
   they don't compete with it. */
.ns-version-tag {
    padding: .2mm 1.5mm;
    border: 1px solid var(--ns-accent);
    border-radius: .8mm;
    font-family: "IBM Plex Mono", ui-monospace, Consolas, monospace;
    font-size: 6.5pt;
    font-weight: 500;
    letter-spacing: .08em;
    text-transform: uppercase;
    color: var(--ns-accent);
}

.ns-version-draft {
    border-color: #d8a94b;
    background: #fdf6e7;
    color: #8a5610;
}

.ns-version-date {
    margin-left: auto;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 7.5pt;
    letter-spacing: .04em;
    color: var(--ns-muted);
}

.ns-version-title {
    margin: 2.5mm 0 0;
    font-size: 10.5pt;
    font-weight: 600;
    break-after: avoid;
}

.ns-version-lead {
    margin: 1.5mm 0 0;
    color: var(--ns-muted);
    text-wrap: pretty;
}

/* Sections sit closer under their version than under the sheet's header: they belong to it. */
.ns-version .ns-section {
    margin-top: 4.5mm;
}

.ns-version .ns-section-title {
    font-size: 10pt;
}

.ns-version-outro {
    margin-top: 3mm;
    font-size: 8.5pt;
    color: var(--ns-muted);
    break-inside: avoid;
}

/* --- What comes after the list --- */
.ns-outro {
    margin-top: 8mm;
    padding-top: 3mm;
    border-top: 1px solid var(--ns-rule);
    font-size: 9pt;
    color: var(--ns-muted);
    break-inside: avoid;
}

/* --- Footer ---

   It follows the content rather than sticking to the bottom of the sheet: on a three-page
   document, a footer stuck to the bottom of the first would make no sense. */
.ns-foot {
    margin-top: 10mm;
    padding-top: 2mm;
    border-top: 1px solid var(--ns-ink);
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 6mm;
    font-family: "IBM Plex Mono", ui-monospace, monospace;
    font-size: 6.8pt;
    letter-spacing: .05em;
    color: var(--ns-muted);
    break-inside: avoid;
}

/* A draft can be printed — it has to be proofread after all — but the sheet must say so
   itself: once lying on a desk, it no longer has the action bar to announce it. */
.ns-draft {
    margin-bottom: 4mm;
    padding: 1.5mm 3mm;
    border: 1px solid #d8a94b;
    border-radius: 1mm;
    background: #fdf6e7;
    color: #8a5610;
    font-size: 8pt;
    font-weight: 500;
}
