/*
 * "Opens separately" — the one marker for a control that leaves this page.
 *
 * A link or button that silently opens a new tab looks identical to one that
 * navigates in place. The reader clicks, the page they were reading does not
 * change, and either they think the control is broken or they lose track of
 * where they are. WCAG technique G201 is about WARNING somebody before a new
 * window opens, so the marker is a requirement rather than decoration.
 *
 * ONE definition, here, rather than a glyph hand-placed per call site. This
 * file is linked from all four base templates (admin, member, marketing,
 * public) so every tree can reach it, and it is deliberately tiny and
 * self-contained: the public marketing base carries none of the other shared
 * stylesheets, and pulling `styles.css` in for one rule would restyle pages
 * that never asked for it.
 *
 * It is a STATIC stylesheet linked from <head>, not a page-level <style>, so
 * HTMX swapping `#page-inner` never takes it away. The rule in CLAUDE.md about
 * putting page styles inside `{% block content %}` is about styles a PAGE
 * injects via `head_extra` — those never arrive after a boosted navigation.
 * A stylesheet linked once in the base template is always present.
 *
 * TWO classes, and they differ only in what a screen reader is told:
 *
 *   .opens-new-tab     — a new browser tab. The ordinary case.
 *   .opens-new-window  — a separate, sized popup window (the admin help
 *                        button opens one via window.open with dimensions).
 *
 * They share one glyph on purpose. The visual question a reader is asking is
 * "does this take me away from here?", and the answer is the same for both;
 * splitting the glyph would mean inventing a second symbol whose font
 * coverage nobody here has measured, to draw a distinction that only matters
 * once you are already leaving. The WORDS differ, because "tab" and "window"
 * are genuinely different destinations and the announcement is where that
 * belongs.
 */

/*
 * U+2197 NORTH EAST ARROW. Chosen over U+29C9 (two joined squares) because
 * this codebase already used it in five places before the convention existed
 * and because its font coverage is far better — U+29C9 falls back to tofu in
 * fonts that do not carry the miscellaneous-mathematical block.
 *
 * `display: inline-block` is load-bearing, not cosmetic: an inline
 * pseudo-element inherits the parent link's underline, so on a hovered
 * `.guide-link` the arrow would be underlined too. An inline-block breaks out
 * of the parent's decoration line.
 */
.opens-new-tab::after,
.opens-new-window::after {
    /*
     * Fallback for engines without the CSS alt-text syntax below: they get
     * the glyph, and a screen reader announces it as "north east arrow".
     * Noisy, but present — which is the safe direction for a warning.
     */
    content: '\2197';
    display: inline-block;
    margin-left: 0.25em;
    font-size: 0.85em;
    font-weight: 400;
    line-height: 1;
    vertical-align: baseline;
    text-decoration: none;
    opacity: 0.75;
}

/*
 * `content: <glyph> / <alt>` replaces the pseudo-element's text for assistive
 * technology. Sighted readers get the arrow; a screen reader hears the words.
 * This is what lets ONE rule serve both audiences without a visually-hidden
 * <span> at every one of the ~50 call sites — which is the hand-placement
 * this file exists to avoid.
 *
 * Guarded by @supports so an engine that does not implement the alt syntax
 * keeps the plain rule above rather than dropping the whole declaration and
 * rendering no marker at all.
 */
@supports (content: 'x' / 'y') {
    .opens-new-tab::after {
        content: '\2197' / ' (opens in a new tab)';
    }
    .opens-new-window::after {
        content: '\2197' / ' (opens in a separate window)';
    }
}

/*
 * Printed output has no tabs, so the marker is meaningless on paper.
 */
@media print {
    .opens-new-tab::after,
    .opens-new-window::after {
        content: '';
        margin-left: 0;
    }
}
