/**
 * Links in body copy look like links.
 *
 * Teamwork 49514577: "can we make it such that any hyperlinks have the default
 * styling with underlines?". Bryce's call on scope (10 Sep 2026): body copy
 * only. Navigation, buttons, card titles, breadcrumbs, chips and tags are
 * designed without an underline and keep it that way. His call on colour: the
 * underline alone, the text keeps the colour it has.
 *
 * WHAT A TYPED LINK LOOKS LIKE TODAY, WHICH IS NOTHING AT ALL. Measured on
 * /become-a-member, the one unclassed prose link on the site: `text-decoration:
 * none`, `border-bottom: 0`, colour `rgb(0, 48, 56)`. That is the same colour
 * as the paragraph around it, so the link is invisible: not merely
 * underline-less, but indistinguishable from ordinary text by anything at all.
 * As well as being the complaint, that fails WCAG 1.4.1, which wants a link
 * marked by something besides colour, and here there is not even colour.
 *
 * WHY, BECAUSE IT IS NOT WHERE IT LOOKS. The theme does have a treatment for
 * exactly this link. From skin-2020:
 *
 *   main#agendtheme-content .agendtheme-content-inner:not(…) a:not([class])
 *     { border-bottom: var(--at-text-body-link-border-bottom);
 *       color: var(--at-color-text-body-link);
 *       text-decoration: none }
 *
 * That rule matches and applies. Both custom properties have simply been
 * emptied out in the Customizer, which serves
 * `--at-text-body-link-border-bottom: none` and
 * `--at-color-text-body-link: #003038`, the body text colour. So the theme
 * draws its link treatment faithfully and the treatment is nothing. Elementor's
 * `.elementor a { text-decoration: none }` is a red herring: it would lose to
 * the rule above regardless, which sets `text-decoration: none` itself.
 *
 * THE ARITHMETIC. The rule to beat is 1 id, 3 classes (the wrapper, and the
 * argument of each `:not()`) and 2 elements, so 1,3,2 at rest. Its `:hover`,
 * `:focus`, `:active` and `:visited` twins each add one, so 1,4,2. The
 * selectors below carry the id, the wrapper, the widget class doubled onto
 * itself purely for the count, and `:not([class])`, reaching 1,4,2 at rest and
 * 1,5,2 on the states. Doubling a class for the count is what
 * ota-news-single.css already does against this same family of rules. Drop any
 * one of them and the theme silently wins again.
 *
 * THE BORDER IS ZEROED ON PURPOSE. `--at-text-body-link-border-bottom` is a
 * Customizer field the client can edit, currently `none`. If anyone ever turns
 * it back on, a link in body copy would carry an underline AND a 2px accent bar
 * under it. Zeroing it inside these selectors makes the treatment deterministic:
 * body copy links are underlined, once, whatever that field says. Everywhere
 * else on the site the field still does what it is set to.
 *
 * THE THEME'S RULE HAS A SECOND WRAPPER, and it is body copy too. Raised in
 * review on PR #34. The same skin-2020 block carries
 * `main#agendtheme-content + .agendtheme-post-singular-content a:not([class])`,
 * which is the `post-singular-content` and `post-singular-content-{post_type}`
 * widget areas. Those are not chrome: class-footer.php says they "carry real
 * page content on news and event singles", which is why the footer buffer puts
 * them back rather than swallowing them, and templates/footer/singular.php
 * copies the theme's own classes onto them so this styling keeps working. A
 * link typed in there is body copy and was still invisible without the last two
 * selectors in each block below.
 *
 * TWO SELECTORS FOR IT, NOT ONE, and neither is redundant.
 *
 * `~` rather than the theme's `+`, because Footer_Renderer::singular_sidebars()
 * loops and can print BOTH areas. Only the first is an adjacent sibling, so `+`
 * would style one wrapper and skip the other; the theme's own rule has that
 * bug and this does not inherit it.
 *
 * The bare `.agendtheme-post-singular-content` twin is the case where the
 * wrapper is not a sibling of `main` at all, since these are rendered through
 * the footer buffer rather than by the theme. It cannot carry the id, and
 * specificity compares id count before class count, so it could never beat the
 * theme's rule. It does not have to: if the wrapper is not that sibling then
 * the theme's rule has not matched either, and the only thing left to outrank
 * is Elementor's `.elementor a` at 0,1,1, which 0,3,1 clears comfortably.
 *
 * UNTESTED ON LOCAL, deliberately recorded as such. All eleven of these widget
 * areas are empty here, so no amount of measuring on this machine reaches them;
 * the selectors are derived from the theme's compiled CSS and the plugin's own
 * template rather than observed. They also mirror the theme's scope, meaning
 * every unclassed link in that wrapper, rather than the narrower widget list
 * used for the main content area above. That is the right call while the area
 * is defined as page content, but if a navigation-style widget is ever put
 * there its links would underline too.
 *
 * `text-underline-position: from-font` matches how every other underline in
 * this plugin is drawn, and keeps the line off the descenders.
 */

main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-text-editor a:not([class]),
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-theme-post-content a:not([class]),
main#agendtheme-content .agendtheme-content-inner .agendtheme-post-content.agendtheme-post-content a:not([class]),
main#agendtheme-content ~ .agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]),
.agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]) {
	border-bottom: 0;
	text-decoration: underline;
	text-underline-position: from-font;
}

/*
 * The states, one step higher again so each beats the theme's matching twin.
 * All four say the same thing: the underline does not go anywhere. The colour
 * change the theme makes on hover is left alone, since that is the theme's
 * design and the ticket only asks for the underline.
 */
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-text-editor a:not([class]):hover,
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-text-editor a:not([class]):focus,
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-text-editor a:not([class]):active,
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-text-editor a:not([class]):visited,
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-theme-post-content a:not([class]):hover,
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-theme-post-content a:not([class]):focus,
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-theme-post-content a:not([class]):active,
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-theme-post-content a:not([class]):visited,
main#agendtheme-content .agendtheme-content-inner .agendtheme-post-content.agendtheme-post-content a:not([class]):hover,
main#agendtheme-content .agendtheme-content-inner .agendtheme-post-content.agendtheme-post-content a:not([class]):focus,
main#agendtheme-content .agendtheme-content-inner .agendtheme-post-content.agendtheme-post-content a:not([class]):active,
main#agendtheme-content .agendtheme-content-inner .agendtheme-post-content.agendtheme-post-content a:not([class]):visited,
main#agendtheme-content ~ .agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):hover,
main#agendtheme-content ~ .agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):focus,
main#agendtheme-content ~ .agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):active,
main#agendtheme-content ~ .agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):visited,
.agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):hover,
.agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):focus,
.agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):active,
.agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):visited {
	border-bottom: 0;
	text-decoration: underline;
	text-underline-position: from-font;
}

/*
 * An image wrapped in a link is not body copy, whatever it is nested in, and an
 * underline under a picture is a bug rather than a treatment. The theme carries
 * the same exception for its own border. Kept to 1,5,2 so it clears the rest
 * state above and, being later, the states block too.
 */
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-text-editor a:not([class]):has(> img:only-child),
main#agendtheme-content .agendtheme-content-inner .elementor-widget.elementor-widget-theme-post-content a:not([class]):has(> img:only-child),
main#agendtheme-content .agendtheme-content-inner .agendtheme-post-content.agendtheme-post-content a:not([class]):has(> img:only-child),
main#agendtheme-content ~ .agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):has(> img:only-child),
.agendtheme-post-singular-content.agendtheme-post-singular-content a:not([class]):has(> img:only-child) {
	text-decoration: none;
}
