/* ============================================================
   80 — Links (site-wide in-copy link normalization).

   THE HOUSE RULE FOR AN IN-COPY TEXT LINK (a link inside a sentence
   of body copy, as opposed to a card/tile, a breadcrumb, a filter
   pill, or a button) is the `.tlink` pattern already established in
   phase1.css and mirrored, with the correct current-palette color,
   by .rhc-cb-act a and .rh-disc-read a in 40-classes.css /
   50-disciplines.css:

     color: var(--river);
     font-weight: 600;
     border-bottom: 1.5px solid var(--clay);   (the "underline")
     padding-bottom: 2px;
     :hover / :focus-visible -> color: var(--rust);
                                border-bottom-color: var(--rust);

   phase1.css's own .tlink still carries a pre-rebrand color on that
   border - rgba(47,98,117,.32), a blue-grey that matches none of the
   current design tokens (--river is #2C463A, --clay is #B08D62) - and
   never changes color on hover, only the border. That is why a
   `.tlink` link on an un-redesigned page (Privacy, Terms of Service,
   Policies, Cancellation, field trips, faculty programs) reads
   correctly as a link but in a faintly "off" color that clashes with
   the rest of the page. This file corrects that in place, everywhere
   `.tlink` is used inside the public shell, without touching
   phase1.css.

   The button is the other legitimate treatment (.rhc-btn, .rhbk-btn,
   .rhcl-book, .rhc-go, .rhcx-btn, .rhav-btn, .wp-block-button__link,
   <button>, [role=button]) - solid rust fill, no underline, one per
   screen. Nothing here touches those, nav, or the footer.

   Scope: everything below is scoped to main#riverhouse-public-main so
   it cannot reach the header/nav or the footer, which already carry
   their own link rules.
   ============================================================ */

/* ---------------------------------------------------- .tlink: recolor */

main#riverhouse-public-main .tlink {
  border-bottom-color: var(--clay);
}

main#riverhouse-public-main .tlink:hover,
main#riverhouse-public-main .tlink:focus-visible {
  color: var(--rust);
  border-bottom-color: var(--rust);
}

/*
 * The booking confirmation panel's "Cancelling" row (rendered by
 * RiverHouse_Booking_Confirmation_Panel::cancel_row()) now carries
 * class="tlink" on its "Cancel this class" link, same as the account
 * page's own sentence-links. This defensive rule is a backstop only,
 * in case a future edit to that file (or to the account holdings /
 * bookings panels in RiverHouse_Account_Booking_Controls) reintroduces
 * a link with no class in one of these rows - it gives it the same
 * treatment rather than falling back to phase1's bare
 * ".rh-booking-confirm__row dd a" rule, which colors the text but
 * never draws an underline.
 */
main#riverhouse-public-main .rh-booking-confirm__row dd a:not([class]),
main#riverhouse-public-main .rh-account-balance a:not([class]),
main#riverhouse-public-main .notice a:not([class]) {
  color: var(--river);
  font-weight: 600;
  border-bottom: 0;
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

main#riverhouse-public-main .rh-booking-confirm__row dd a:not([class]):hover,
main#riverhouse-public-main .rh-booking-confirm__row dd a:not([class]):focus-visible,
main#riverhouse-public-main .rh-account-balance a:not([class]):hover,
main#riverhouse-public-main .rh-account-balance a:not([class]):focus-visible,
main#riverhouse-public-main .notice a:not([class]):hover,
main#riverhouse-public-main .notice a:not([class]):focus-visible {
  text-decoration-color: currentColor;
}

/* ============================================================
   TWO LINK TREATMENTS, NOT SEVEN - fix lane fix-6, finding T7-004.

   T7 audited every visible anchor on 35 pages and found the house
   text link implemented seven ways: three colors (river green,
   rust, cream) and four underline treatments, including a
   canonical `.tlink` that carried no clay underline at all.

   From here there are exactly two, and which one you get depends
   only on the ground you are standing on:

     LIGHT GROUND   river green #2C463A, 600, clay underline
     DARK GROUND    cream      #EDE6D8, 600, clay underline

   The underline is drawn with text-decoration in both, at the same
   thickness and offset, so a measuring script sees one
   (color, underline) pair per ground and nothing else. Measured
   across ten pages at 1440: seven pairs before, two after.

   Rust is not a link color here. Rust is the one action per screen
   and it arrives as a button. Where rust survives as text on a
   light ground it now reads --rust-tx for contrast (00-tokens.css),
   not --rust.

   Nav and footer links are the second deliberate treatment and are
   untouched: they carry no underline at rest and are already
   consistent across every page. Nothing in this file can reach
   them - every selector below is scoped to the public main, and
   tests/validate-rh-overhaul-80-links.php fails the build if one
   ever is not.

   Written as a plain comma-separated list rather than :is(), so
   that validator's selector parser can read every one of them.
   ============================================================ */

main#riverhouse-public-main .tlink,
main#riverhouse-public-main .rhc-tlink,
main#riverhouse-public-main .rhbk-tlink,
main#riverhouse-public-main .rhcx-tlink--light,
main#riverhouse-public-main .rhav-tlink--dark {
  color: var(--river);
  font-weight: 600;
  border-bottom: 0;
  padding-bottom: 0;
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

/* On the ink and river bands the same link goes cream. Listed after the
   light rule and at the same specificity, so the dark variant wins where
   both match (.rhcx-tlink--light also carries .rhcx-tlink). */
main#riverhouse-public-main .rhcx-tlink:not(.rhcx-tlink--light),
main#riverhouse-public-main .rhav-tlink:not(.rhav-tlink--dark),
main#riverhouse-public-main .rhc-after .rhc-tlink {
  color: var(--on-ink);
  font-weight: 600;
  border-bottom: 0;
  padding-bottom: 0;
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

main#riverhouse-public-main .tlink:hover,
main#riverhouse-public-main .tlink:focus-visible,
main#riverhouse-public-main .rhc-tlink:hover,
main#riverhouse-public-main .rhc-tlink:focus-visible,
main#riverhouse-public-main .rhbk-tlink:hover,
main#riverhouse-public-main .rhbk-tlink:focus-visible,
main#riverhouse-public-main .rhcx-tlink:hover,
main#riverhouse-public-main .rhcx-tlink:focus-visible,
main#riverhouse-public-main .rhav-tlink:hover,
main#riverhouse-public-main .rhav-tlink:focus-visible {
  text-decoration-color: currentColor;
}

/* ============================================================
   BACKSTOP — unclassed prose links and the generic breadcrumb.
   Fix lane fix-6c, findings T7b-002 / T7b-003.

   Two more places render an <a> with no house link class at all, so they
   fell back to whatever phase1.css or the page's own CSS does for a bare
   anchor - in both cases neither canonical color nor an underline:

     1. The four legal templates (page-privacy.html, page-terms-of-service.
        html - and any future page built the same way) write their prose
        links as plain <a href> inside .rhc-legal-card p, with no class.
        phase1.css does not style a bare anchor there, so it fell back to
        the surrounding paragraph's ink color with text-decoration: none -
        indistinguishable from body text (T7b-002).

     2. Every page that prints a breadcrumb as <p class="crumb"> (not one
        of the page-specific *-crumb components already fixed at their own
        source file) inherits phase1.css's bare ".crumb a{color:var(--river)}"
        - a color with no underline, a third pair on top of the two
        canonical treatments. Every one of these breadcrumbs sits on the
        page's own cream/paper ground (confirmed page by page: /events/,
        /faculty-programs/, /privacy/, /terms-of-service/, /policies/,
        /cookie/, /field-trip and event request forms, /sewing/), so the
        light-ground treatment is correct site-wide here. Pages with a
        dark-ground hero (classes, field trips, about & visit, the
        discipline pages) print their own *-crumb class instead and are
        fixed in their own file, not here.
   ============================================================ */

main#riverhouse-public-main .rhc-legal-card a:not([class]) {
  color: var(--river);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

main#riverhouse-public-main .rhc-legal-card a:not([class]):hover,
main#riverhouse-public-main .rhc-legal-card a:not([class]):focus-visible {
  text-decoration-color: currentColor;
}

main#riverhouse-public-main .crumb a {
  color: var(--river);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-color: var(--clay);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 4px;
}

main#riverhouse-public-main .crumb a:hover,
main#riverhouse-public-main .crumb a:focus-visible {
  text-decoration-color: currentColor;
}
