/* ============================================================
   Accessibility fixes (Showcase accessibility plan, 2026)
   Keeps the look of the published issue while the markup
   underneath uses correct headings, buttons and labels.
   Same file in every year; written by patch_template.py.
   ============================================================ */

/* ---- Skip link: hidden until focused ---- */
a.showcase-skip-link,
a.showcase-skip-link:focus {
    position: fixed;
    left: -9999px;
    top: 0;
    z-index: 2147483647;
    padding: 0.75rem 1rem;
    background: #ffffff !important;
    color: var(--showcase-pri, #242374) !important;
    border: 3px solid var(--showcase-pri, #242374);
    font-family: 'Fira Sans', sans-serif;
    font-weight: 700;
    text-decoration: underline;
}

a.showcase-skip-link:focus {
    left: 0.5rem;
    top: 0.5rem;
}

/* ---- Visible keyboard focus everywhere ---- */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible,
iframe:focus-visible {
    outline: 3px solid #1a73e8 !important;
    outline-offset: 2px;
}

/* Targets that receive focus from script, not from Tab: no ring needed */
#main-content:focus,
#main-content:focus-visible,
#resourceTitle:focus,
#resourceTitle:focus-visible {
    outline: none !important;
}

/* ---- Banner title is a <p> on inner pages (only the home page keeps it as h1) ----
   These stand in for what WWU's base CSS gives every h1. The selector is kept
   weak (p.title) so each year's own ".showcase-banner .title" rule still wins
   wherever it sets these (2003, for one, sets margin 0 and its own line-height). */
p.title {
    margin: 2rem 0 0.5rem;
    line-height: 1.2;
    position: relative;  /* without it the banner image covers the title */
    font-weight: 900;    /* WWU's h1 weight; 2007's title rule relies on it */
}

/* WWU's base CSS also lets h1 break long words on small phones */
@media (max-width: 580px) {
    p.title {
        overflow-wrap: anywhere;
    }
}

/* ---- Headings promoted/demoted for structure keep their old size ---- */
.main-wrapper .as-h3 {
    font-size: var(--h3-size);
}

.main-wrapper .as-h4 {
    font-size: var(--h4-size);
}

/* WWU's base CSS drops the top margin of an h3 right after an h2; the old h4
   kept it (Colophon "Designers" right under the year) */
h2 + h3.as-h4 {
    margin-top: 2rem;
}

/* ---- Aside menu headings ---- */
.aside h2.aside-heading {
    margin: 0 0 10px;
}

/* Mobile copy: the button inside the heading looks like the old heading */
.aside-heading .aside-toggle {
    font: inherit;
    color: inherit;
    text-align: left;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    width: 100%;
    justify-content: flex-start;
    gap: 0;  /* WWU's base CSS adds a 4px gap to buttons */
    align-items: center;
}

/* Arrow sits right after the text, as on the live site (nav.css gives it
   margin-left: auto on phones, which would push it to the edge of the button) */
.aside-heading .aside-toggle .arrow-icon {
    margin-left: 0;
}

/* ---- Goals tables: first column is a row header now ---- */
.goals-table th.first-col {
    font-weight: 400;
    text-align: left;
    line-height: 1.45;
    background-color: transparent;  /* WWU's base CSS gives every th a grey background */
}

/* showcase-style.css caps "table td" at 120px on small phones; keep that for the row header */
@media (max-width: 468px) {
    .goals-table th.first-col {
        max-width: 120px;
    }
}

/* ---- Browse Issues control is a real <button> now ---- */
.browse-issues-container .browse-issues-button {
    font: inherit;
    color: inherit;
    background: none;
    border: none;
    padding: 0;
    margin: 0;
    cursor: pointer;
    /* Lay out the text like the old <div>: as a flex box the button dropped the
       space after &nbsp; and got WWU's 4px button gap (6px off the live width) */
    display: block;
}

@media (max-width: 840px) {
    /* Collapsed mobile nav: also take its links out of the tab order */
    .main-nav:not(.visible) {
        visibility: hidden;
    }
}

/* ---- Main nav submenus: links become focusable the moment the menu opens
   (the fade-in on visibility made a quick Tab skip past them) ---- */
.sub-menu.show {
    transition-property: max-height, opacity, padding, transform, background-color;
}

/* .nav-list prefix: nav.css loads after this file and sets .nav-list li { transition: all } */
.nav-list .sub-menu li {
    transition-property: background-color, color;
}

/* ---- Browse menus: visible (and focusable) the moment they open, so focus
   can move into them; they still fade out when closed ---- */
.issues-menu.active,
.menu-overlay.active {
    transition-property: opacity, transform;
}
