/* ══════════════════════════════════════════════════════════════════════
   ADS link — the single link treatment for every V2 surface
   ──────────────────────────────────────────────────────────────────────
   Figma "body/semibold/md" at #2D2F8C. Both already exist as tokens in
   assets/ads-theme.css, so this file consumes them rather than restating
   raw values:

     --ads-indigo-700  #2D2F8C   exactly the Figma link colour
     --ads-indigo-800  #282A7C   hover
     --ads-indigo-900  #1D1F5D   pressed
     --font-family     'Open Sans', …
     (--ads-font-body-md-sem is 600 14px/20px — the same ramp step, spelled
      out longhand here so style and letter-spacing are explicit.)

   ── Two layers, on purpose ────────────────────────────────────────────
   Colour and typography used to travel together, which is why the detail
   pages were left out: their links live inside a 13px field value and a 12px
   metadata row, and forcing the 14px table ramp onto them would have made a
   link bigger than the value beside it. Splitting the rule lets every link in
   V2 share one colour and one set of states — the part that must never
   diverge — while type size stays a property of where the link sits.

     LINKS  every registered link. Colour, decoration, states.
     TABLE  data-table links only. The body/semibold/md ramp on top.

   ── About the selector ────────────────────────────────────────────────
   ads-theme.css paints every anchor with `html[data-theme="ads"] a`, which
   outranks a plain `.order-link`, so a bare class list silently loses. The
   shape below clears it deliberately:

     html:not([data-theme="wireframe"])  keeps wireframe on its greyscale
                                         override, which must keep winning
     a…:any-link                         restricts this to real links and
                                         folds :visited in, so the UA purple
                                         can never appear
     :is(…)                              one rule for every link class
                                         instead of one rule each

   Deliberately not a bare `a`, so navigation, tabs, buttons and pagination
   are untouched. Each page keeps its own layout concerns (truncation,
   display, icon gap); colour lives here and only here.
   ══════════════════════════════════════════════════════════════════════ */

/* ── Layer 1: colour and state, every registered link ──────────────────── */
html:not([data-theme="wireframe"])
  a:is(.ads-table-link, .order-link, .owa-order-link, .cp-name, .gl-file-link,
       .detail-back-link, .detail-field-link, .detail-meta-value):any-link {
  color: var(--ads-indigo-700, #2d2f8c);
  text-decoration: none;
}

/* Hover — ADS darkens one step and underlines. */
html:not([data-theme="wireframe"])
  a:is(.ads-table-link, .order-link, .owa-order-link, .cp-name, .gl-file-link,
       .detail-back-link, .detail-field-link, .detail-meta-value):any-link:hover {
  color: var(--ads-indigo-800, #282a7c);
  text-decoration: underline;
}

/* Pressed. */
html:not([data-theme="wireframe"])
  a:is(.ads-table-link, .order-link, .owa-order-link, .cp-name, .gl-file-link,
       .detail-back-link, .detail-field-link, .detail-meta-value):any-link:active {
  color: var(--ads-indigo-900, #1d1f5d);
}

/* Keyboard focus is the ADS ring ads-theme.css already gives `a:focus-visible`.
   Restated with identical values so the indicator survives in themes that
   don't ship that rule. */
html:not([data-theme="wireframe"])
  a:is(.ads-table-link, .order-link, .owa-order-link, .cp-name, .gl-file-link,
       .detail-back-link, .detail-field-link, .detail-meta-value):any-link:focus-visible {
  outline: 2px solid var(--ads-brand, #4045c2);
  outline-offset: 2px;
}

/* Disabled — ADS drops the rest colour to 40% and removes interactivity. */
html:not([data-theme="wireframe"])
  a:is(.ads-table-link, .order-link, .owa-order-link, .cp-name, .gl-file-link,
       .detail-back-link, .detail-field-link, .detail-meta-value)[aria-disabled="true"] {
  opacity: 0.4;
  pointer-events: none;
  text-decoration: none;
}

/* ── Layer 2: the table ramp ───────────────────────────────────────────
   Data-table links only. Detail-page links are absent by design; they take
   their size from the field value or metadata row they sit in. */
html:not([data-theme="wireframe"])
    a:is(.ads-table-link, .order-link, .owa-order-link, .cp-name, .gl-file-link):any-link {
  font-family: var(--font-family, "Open Sans");
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0;
}

/* Row actions that are buttons (Finance Settings Edit, CP Settings Edit). */
html:not([data-theme="wireframe"]) button.ads-table-link {
  appearance: none;
  background: none;
  border: 0;
  padding: 0;
  margin: 0;
  color: var(--ads-indigo-700, #2d2f8c);
  font-family: var(--font-family, "Open Sans");
  font-size: 14px;
  font-style: normal;
  font-weight: 600;
  line-height: 20px;
  letter-spacing: 0;
  cursor: pointer;
  text-decoration: none;
}

html:not([data-theme="wireframe"]) button.ads-table-link:hover {
  color: var(--ads-indigo-800, #282a7c);
  text-decoration: underline;
}

html:not([data-theme="wireframe"]) button.ads-table-link:focus-visible {
  outline: 2px solid var(--ads-brand, #4045c2);
  outline-offset: 2px;
}
