/*SECTION - Links */

/* THE CLASSED LINKS, converted 2026-10-28 off the legacy --clr-* ramp and onto
   the Codex roles, so they finally match the model css-reset.css:457 paints on
   every UNCLASSED link. The two had diverged completely: every value in this
   file came from --clr-* primitives, NONE of which has a dark tier, so the plum
   below measured 1.23:1 on the dark article card -- worse than anything else
   found in this theme, including the 1.81:1 table rows.

   THIS FILE IS ARTICLE-BODY SURFACE AND NOTHING ELSE, which is the fact that
   shapes every decision in it. A standalone `link` class token appears in ZERO
   templates, and so does every `link-*` variant; the footer rebuild took the
   last of them off the markup (css-page-footer.css:5-14, which left its own
   classes here for a separate cleanup). What still reaches these rules is
   article bodies, hand-authored in the Zendesk WYSIWYG against
   article-authoring-contract.md:37, which tells writers to type
   `class="link link-article"`. So this is a PUBLIC API: nothing here may require
   anyone to edit a published article, and `link` / `link-article` cannot be
   renamed or dropped.

   THE MODEL IS NOT RE-DERIVABLE FROM THIS FILE. css-reset.css:348-465 holds the
   reasoning and Joy's instructions in full; the short version is
     rest    the ink of the text it sits in, plus the 1px underline every `a`
             already gets -- so the underline carries the whole affordance
     hover   --brand-text, the colour and nothing else
     no background tint, in either state, anywhere
     no :visited -- --hyperlink-link-visited exists and is deliberately unused
     the underline does NOT thicken on hover; that was built and rejected
   Measured on the article card (#faffff light / #1e2a35 dark), where `inherit`
   resolves to the --neutral-icon that css-page-article.css:2767 gives the whole
   container: the rest ink is 9.72:1 and 8.09:1, both AAA, against the plum's
   11.75:1 and 1.23:1. The hover is 8.12:1 and 8.58:1 as of the step move on
   2026-10-28.

   `inherit` RATHER THAN --neutral-icon NAMED OUTRIGHT, Joy's call 2026-10-28,
   and the first thing shipped here was the other one. Her words were that she
   was "not sure about the darker link color in classes" and wanted it "the same
   color as in the articles" -- correctly, because --hyperlink-link is #050709 at
   20:1, DARKER than the body copy it sits inside, so a link was reading as the
   emphasised thing in its own paragraph. Scope was hers too: every link in an
   article body, classed and unclassed alike, which is why the unclassed half of
   this lives in css-page-article.css and not in the reset. Links elsewhere on
   the site keep --hyperlink-link, since their surroundings are not --neutral-icon.
   `inherit` is what makes the two halves provably identical, and it is doing
   more work than the token name would:
     - in a callout, it resolves to the SEVERITY ink, so css-components.css:1337
       keeps deciding callout links and this pass does not pre-empt the callout
       one. Naming the token instead would have overridden it.
     - in a table cell it resolves to --neutral-icon anyway, because the `th, td`
       block sets no colour of its own.
   Both are true without this file knowing anything about either context.

   `--fg` IS GONE FROM `.link`, and that removal is a bug fix rather than
   tidying. css-components.css:1337 paints callout links with
   `color: var(--fg, var(--neutral-text))`, reading the --fg the callout sets on
   itself and inherits down. A `.link` that declares its OWN --fg SHADOWS that:
   the callout rule still won on specificity, (0,1,1) over (0,1,0), but resolved
   to the link's value instead of the severity's. So a bare <a> in a callout took
   the severity ink while `class="link link-article"` beside it did not -- the
   exact classed/unclassed split Joy asked to close. Declaring `color` outright
   leaves --fg to mean one thing per element. This makes the `--fg` on
   `.link-footer` / `.link-footer-alt` inert, like their `--size` and `--weight`
   already are; all of it goes in the footer cleanup.

   SIZE AND WEIGHT ARE GONE FROM THE BASE, Joy's call 2026-10-28. `--size` was
   --step-1 and `--weight` --font-bold, and `.link-article` overrode only the
   weight -- so every link the authoring contract tells writers to type rendered
   about 12.5% larger than the --step-0 body copy around it. The settled model is
   "body text plus an underline", so a link now inherits both from its paragraph.
   This had already been noticed once and patched narrowly: the `font-size:
   var(--step-0)` on `.link-article` inside a table cell (css-page-article.css,
   the `th, td` block) is now redundant, as is the `display: inline` beside it.
   Both are left where they are rather than cleaned up from here, because that
   block was signed off on 2026-10-27 and this is not its pass.

   `.link-article-list` WAS CONVERTED TOO, by having all of its declarations
   deleted rather than rewritten. It carried the same plum, a hover tint and a
   `--decor: none`, plus `--hover-fg` / `--hover-bg` that nothing has ever read --
   `.link:hover` reads `--fg` / `--bg`, not `--hover-*`. It has no template use
   and no line in the authoring contract, so it is arguably as dead as the footer
   classes; it is converted anyway because it is an *article* class, and the one
   thing this repo cannot see is which classes old published bodies actually use.
   Falling through to the base ink is the safe failure mode. `--svg-size` on
   `.link-footer` is write-only in the same way and left for that cleanup.

   Two knock-on effects, recorded so nobody reads them as oversights. The `--size`
   on `.link-footer` / `.link-footer-alt` and the `--weight` on the latter are now
   INERT -- nothing reads those slots any more. They belong to dead classes and go
   with them in the footer cleanup. And `--decor` has collapsed: its only two
   setters were the `none`s this conversion deleted, so the indirection had
   nothing left to vary and `text-decoration` is declared outright below. */
.link {
  color: inherit;
  text-decoration: underline;
  text-decoration-skip-ink: auto;
  cursor: pointer;
  /* Matches `a:not([class])` exactly, so a classed and an unclassed link in the
     same paragraph move together on hover rather than at two speeds. The old
     `transition-duration` sat inside :hover, which only ever animated the way
     in and snapped on the way out. */
  transition: color var(--motion-duration-control) var(--ease-in-out);
}
.link:where(:has(.svg-inline--fa)) {
  --gap: 0.25rem;
  display: inline-flex;
  gap: var(--gap);
  align-items: center;
}

/* `:active` is grouped with `:hover` and listed in this order for the reason
   css-reset.css gives: releasing the mouse inside the link lands back on :hover
   rather than on rest. The tint that used to be here (--clr-neutral-20) and the
   `--decor: none` beside it were both killed sitewide on 2026-10-25 -- a fill
   behind a wrapping inline link draws a ragged rectangle broken across the line,
   and the underline is part of the REST state here and stays put through the
   hover. Only the ink moves. */
.link:hover,
.link:active {
  color: var(--brand-text);
}

/* `display: unset` is the whole rule, and it is load-bearing: it puts an article
   link back to `inline` against the `inline-flex` that the `:has(.svg-inline--fa)`
   rule above gives any link carrying an icon, so a long link inside a paragraph
   still wraps across lines. The `--fg: var(--clr-secondary-140)` that used to be
   here with it was the #56215d plum -- literally the "purple links everywhere we
   go" Joy asked to be rid of on 2026-10-24, still alive on the two classes the
   authoring contract hands to writers. Both classes now take the base ink. */
.link-theme,
.link-article {
  display: unset;
}

/* THE EXTERNAL-LINK CUE USED TO BE ATTEMPTED HERE and is now built, for real,
   at css-page-article.css -- search `[target='_blank']`. Three rules are gone:
   `.link-theme::after, .link-article::after` with `content: '\f08e'`, and
   `.link-article-list::after` with `content: ''`.

   NONE OF THEM COULD EVER HAVE DRAWN ANYTHING, on two independent counts. They
   were all `display: none`. And `\f08e` is a Font Awesome codepoint with no font
   to come from: this theme loads a SVG+JS kit, which replaces each <i>/<span>
   with an inline <svg> and ships no webfont at all, so a codepoint in `content`
   renders nothing in any state. `var(--fa-font-regular)` was equally empty --
   that variable is part of the webfont API too.

   AND THE HOOK WAS WRONG INDEPENDENTLY OF THAT. `.link-theme` and
   `.link-article` are not external-specific -- `link-article` is what
   article-authoring-contract.md:37 tells writers to put on EVERY article link --
   so had the rules rendered, every internal link in every article body would
   have carried an external-link arrow. The replacement hangs off
   `[target='_blank']`, which is the only thing in the markup that identifies the
   condition, and is in the contract's section 10 pattern already.

   `.link-footer::after` and `.link-card::after` are left below with the same
   dead `content` for the same reason the rest of those classes are: the footer
   cleanup pass owns them. `.link-card`'s is a chevron rather than an external
   cue, so it is not this pass's business either way. */

.link-footer {
  --fg: var(--clr-neutral-100);
  --size: var(--step-0);
  --gap: 0.5rem;
  --hover-bg: var(--clr-neutral-5);
  --svg-size: var(--step--1);
}

.link-footer-alt {
  --fg: var(--clr-neutral-100);
  --weight: var(--font-regular);
  --size: var(--step--1);
}

/* `.link-article-list::after` has come off this group with the rules above, so
   what is left is two footer-pass classes. `--content` is a custom property no
   rule in the theme reads, i.e. this whole block is inert; it goes with them. */
.link-social::after,
.link-footer-alt::after {
  --content: '';
}

.link-footer::after {
  display: none;
  font: var(--fa-font-regular);
  content: '\f08e';
}

.link-card::after {
  display: none;
  font: var(--fa-font-solid);
  content: '\f054';
}
