/* ==========================================================================
   E-deal 2025 Design System - Links
   Source: Figma "Design system | E-deal 2025" section 1013:34930
   Tokens: tokens-figma.css
   ========================================================================== */

/* ── Link / Link Base ──────────────────────────────────────────────────── */
/* Figma: Link / Link base (1061:81663)

   Deliberate divergence from that Figma frame, decided by design + product: links are Medium (500)
   at 14px at rest and gain an underline on hover. Figma keeps them Regular (400) at rest and turns
   them Medium on hover. Do not "restore" the Figma values from the frame alone. */

/* .ed-field-link: skin-agnostic marker emitted by GetPropertyTag on reference/FOB field-value
   links. Legacy skins define no rule for it (inert); design2027 styles it like .ed-link here. */
.ed-link,
.ed-field-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-3);                 /* 12px */
  font-family: var(--font-family-main);
  font-weight: var(--font-weight-medium); /* 500 - medium at rest, not only on hover */
  font-size: var(--text-size-p2);      /* 14px */
  line-height: var(--line-height-normal); /* 24px */
  color: #03569F;                      /* blue-750 */
  cursor: pointer;
  text-decoration: none;
}

/* A field-value link sits inside .ed-field__value and matches its leading, so a link value and a
   plain one render at the same box height. Scoped to .ed-field-link alone: .ed-link is worn by
   non-link controls too, including the field icon buttons in templates/inputButtons, whose
   vertical centring depends on the leading declared above. */
.ed-field-link {
  line-height: var(--line-height-snug);
}

/* Underline is the hover affordance, and only on anchor elements - Figma defines this component as
   a text hyperlink (a.ed-link). Non-anchor usages of .ed-link in legacy code are not text links and
   must not be underlined. */
a.ed-link:hover,
a.ed-field-link:hover {
  text-decoration: underline;
  text-decoration-skip-ink: none;
  color: var(--color-link);            /* hover is the underline alone; see below */
}

/* Hover repaints an anchor near-black through `html a:hover` in legacy-compat.css, which scores
   (0,1,2). A reference value escaped that only because `#content a[class*="trigger_"]` carries an
   !important colour, so the value links that come from an emitter adding neither class - a phone
   number, an e-mail address, a value in a multivalue list - changed colour on hover while their
   neighbours did not. Keyed on the value container instead, at (0,2,1), so every anchor a read
   field holds behaves the same whatever emitted it. */
.ed-field__value a:hover,
.ed-field__value-text a:hover {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-skip-ink: none;
}

.ed-link:focus-visible,
.ed-field-link:focus-visible {
  outline: 2px solid var(--color-blue-700);
  outline-offset: 2px;
  border-radius: 2px;
}

/* No visited state. A link here points at a record rather than a document, so a colour that
   depends on whether this browser has opened it before makes the same link look different from
   one screen to the next, and from one user to the next. */

.ed-link.is-disabled {
  color: var(--color-text-disabled);   /* #8799AB */
  cursor: not-allowed;
  pointer-events: none;
}

/* ── External link icon ────────────────────────────────────────────────── */

.ed-link__icon {
  font-family: var(--font-family-icon);
  font-size: var(--icon-size-md);      /* 16px */
  font-weight: 300;                    /* FA Light */
  line-height: var(--line-height-15);  /* 15px */
  color: inherit;
  flex-shrink: 0;
}
