/* ==========================================================================
   Text link standard — AUTHORITATIVE OVERRIDE LAYER

   Single source of truth for how text links look. It must reliably override
   the parent theme (ucla-wordpress), which we don't control and which imposes
   its own global `a:not([class])` link rules. We can't out-specify an external
   theme without a fragile specificity arms race, so the DEFINING declarations
   here use `!important` on purpose — color, text-decoration, font-weight.

   This is an intentional, centralized, documented override layer — NOT the
   scattered per-component !important that was cleaned up. To change link
   appearance, change the tokens (--color-link / -hover / -visited). A component
   that legitimately needs a different link style overrides with its own
   !important.

   Coverage, by who controls the markup:
     1. .csrc-rich-text          — component prose we render (opt-in class)
     2. .entry-content / …       — editor/Gutenberg content we don't control
     3. named text-link classes  — CTAs / awards / email that read inline

   Underline is the WCAG 1.4.1 cue and persists in every state; weight is normal
   (explicit, to beat authored <strong>). outline/offset are not !important —
   nothing contests them. Structural links (nav, buttons, cards, CTAs) are
   intentionally out of scope.
   ========================================================================== */

/* 1. Component prose (opt-in). The :not() excludes button blocks dropped into a
      rich-text field so they keep their button styling; everything else — incl.
      classed prose links like .externalLink — gets the standard. */
.csrc-rich-text a:not(.wp-block-button__link):not(.button) {
  color: var(--color-link) !important;
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
  font-weight: var(--font-weight-normal) !important;
}

.csrc-rich-text a:not(.wp-block-button__link):not(.button):visited {
  color: var(--color-link-visited) !important;
}

.csrc-rich-text a:not(.wp-block-button__link):not(.button):hover,
.csrc-rich-text a:not(.wp-block-button__link):not(.button):focus,
.csrc-rich-text a:not(.wp-block-button__link):not(.button):active {
  color: var(--color-link-hover) !important;
  text-decoration: underline !important;
}

.csrc-rich-text a:not(.wp-block-button__link):not(.button):focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

/* 2. Body / editor content (the_content). :not([class]) skips buttons/blocks
      (which carry classes); classless prose links get the standard. */
:is(.entry-content, .csrc-article-page__body, .csrc-article-page-left__body) a:not([class]) {
  color: var(--color-link) !important;
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
  font-weight: var(--font-weight-normal) !important;
}

:is(.entry-content, .csrc-article-page__body, .csrc-article-page-left__body) a:not([class]):visited {
  color: var(--color-link-visited) !important;
}

:is(.entry-content, .csrc-article-page__body, .csrc-article-page-left__body) a:not([class]):hover,
:is(.entry-content, .csrc-article-page__body, .csrc-article-page-left__body) a:not([class]):focus,
:is(.entry-content, .csrc-article-page__body, .csrc-article-page-left__body) a:not([class]):active {
  color: var(--color-link-hover) !important;
  text-decoration: underline !important;
}

:is(.entry-content, .csrc-article-page__body, .csrc-article-page-left__body) a:not([class]):focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}

/* 3. Named text links (action / standalone roles) — subscribe CTAs, award
      citations, resource lists, contact email/phone. Rendered as text links,
      so they follow the same standard. (.csrc-section-title__cta and PDF
      download links are intentionally excluded — distinct roles.) */
:is(.overview__link, .aztlan-current-issue__link, .aztlan-awards__link,
    .link-list__link, .csrc-contact-cards__text a[href^="mailto:"],
    .csrc-additional-info__meta a) {
  color: var(--color-link) !important;
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
  font-weight: var(--font-weight-normal) !important;
}

:is(.overview__link, .aztlan-current-issue__link, .aztlan-awards__link,
    .link-list__link, .csrc-contact-cards__text a[href^="mailto:"],
    .csrc-additional-info__meta a):visited {
  color: var(--color-link-visited) !important;
}

:is(.overview__link, .aztlan-current-issue__link, .aztlan-awards__link,
    .link-list__link, .csrc-contact-cards__text a[href^="mailto:"],
    .csrc-additional-info__meta a):hover,
:is(.overview__link, .aztlan-current-issue__link, .aztlan-awards__link,
    .link-list__link, .csrc-contact-cards__text a[href^="mailto:"],
    .csrc-additional-info__meta a):focus,
:is(.overview__link, .aztlan-current-issue__link, .aztlan-awards__link,
    .link-list__link, .csrc-contact-cards__text a[href^="mailto:"],
    .csrc-additional-info__meta a):active {
  color: var(--color-link-hover) !important;
  text-decoration: underline !important;
}

:is(.overview__link, .aztlan-current-issue__link, .aztlan-awards__link,
    .link-list__link, .csrc-contact-cards__text a[href^="mailto:"],
    .csrc-additional-info__meta a):focus-visible {
  outline: 2px solid var(--color-link);
  outline-offset: 2px;
}
