/* =============================================================================
   Freshness.css — "NEU" / "Geändert" badges (GitLabWikiFreshness.php).

   The same badge appears on two very different grounds: the article's white
   background and the sidebar's dark brand gradient. NEW therefore carries its
   own contrast as a solid fill, while CHANGED is drawn in `currentColor` and
   adapts to whatever it sits on. That split also gets the emphasis right —
   a new page should read louder than an edited one.
   ============================================================================= */

.wiki-fresh {
    display: inline-flex;
    align-items: center;
    flex-shrink: 0;
    padding: 0.05em 0.5em;
    border-radius: 999px;
    font-size: 0.62rem;
    font-weight: 700;
    line-height: 1.7;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    white-space: nowrap;
    vertical-align: middle;
    /* Never inherit the italics or underline of the text it annotates. */
    font-style: normal;
    text-decoration: none;
}

/* Visually hidden, but read out: "NEU" alone tells a screen reader very little,
   so the badge carries the full sentence and hides the short label from AT. */
.wiki-fresh-sr {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
    border: 0;
}

/* Both badges are solid fills so they carry their own contrast onto white, onto
   the dark gradient and onto the brand-blue active menu node alike. The two
   shades are the darkest ones that still read clearly as green and orange:
   white label text needs 4.5:1, which the brighter tints of both hues miss
   (#16a34a manages only 3.30:1, #ea580c 3.56:1). */
.wiki-fresh--new {
    background: #15803d;    /* 5.02:1 */
    color: #ffffff;
}

.wiki-fresh--changed {
    background: #c2410c;    /* 5.18:1 */
    color: #ffffff;
}

/* ── Placement ───────────────────────────────────────────────────────────── */

/* In the sidebar the badge sits directly against the expand arrow at the right
   edge. `.menu-node-caret` carries its own `margin-left: auto`; with a second
   one here the flex row would split the free space between the two and leave a
   gap. So the badge takes over the push and the caret that follows it drops
   its own — only when a badge actually precedes it. */
.wiki-fresh--nav {
    margin-left: auto;
    padding-left: 0.4em;
    padding-right: 0.4em;
    font-size: 0.58rem;
}

.wiki-fresh--nav + .menu-node-caret {
    margin-left: 0.45em;
}

/* The nav label is a flex row; keep the badge from being squeezed by a long
   page title and let the title truncate instead. */
.menu-node-label > p {
    min-width: 0;
}

/* Inline in running text: a thin space before it, and never underlined along
   with its link. */
.wiki-fresh--inline {
    margin-left: 0.35em;
}

/* On the page's own H1. Sized in `em` so it scales with the heading and sits
   on the cap height rather than the baseline of a much larger line. */
.wiki-fresh--title {
    margin-left: 0.5em;
    padding: 0.1em 0.55em;
    font-size: 0.34em;
    vertical-align: middle;
    /* The heading is brand-coloured and semi-bold; the badge keeps its own. */
    letter-spacing: 0.08em;
}

/* A printed page has no "recently" — the badge would be a lie on paper. */
@media print {
    .wiki-fresh { display: none; }
}
