/* no overrides defined */

/* ---------------------------------------------------------------------------
 * Sitemap footer (WCAG 2.4.5 Multiple Ways)
 *
 * Rendered by the @SitemapFooter Tapestry component inside the admin footer.
 * Collapsed state: a "▸ Sitemap" disclosure-link anchored to the right edge
 * of the footer, vertically centred against the copyright.
 * Expanded state: a popover above the summary with a 2-column list of every
 * admin section the current user can access. Anchored to the right so it
 * never clips the viewport or overlaps the existing footer content.
 *
 * Uses the native <details>/<summary> disclosure so it needs no JavaScript
 * and inherits full keyboard + screen-reader support for free.
 * ------------------------------------------------------------------------ */
#footer {
    position: relative;
}

/* Anchored to the bottom-right of #footer rather than vertically-centred so it
   sits below #footer .licensed-to (also absolute, top: 20px right: 20px) instead
   of crossing it. Avoiding `transform` here also drops the containing-block
   gotcha that user-override.css explicitly works around. */
.sitemap-footer {
    position: absolute;
    bottom: 0.75em;
    right: 1.5em;
    font-size: 12px;
}

.sitemap-footer summary {
    cursor: pointer;
    color: #0D7621;
    list-style: none;
}

.sitemap-footer summary::-webkit-details-marker {
    display: none;
}

/* Visual open/closed marker. Drawn via a <span aria-hidden="true"> in the
   template (not ::before) so screen readers don't announce the glyph as part
   of the accessible name. */
.sitemap-footer .sitemap-marker {
    display: inline-block;
    width: 1em;
}

.sitemap-footer .sitemap-marker::before {
    content: "\25B8";  /* ▸ */
}

.sitemap-footer[open] .sitemap-marker::before {
    content: "\25BE";  /* ▾ */
}

.sitemap-footer summary:hover,
.sitemap-footer summary:focus-visible {
    text-decoration: underline;
}

/* Explicit focus indicator for WCAG 2.4.7 Focus Visible (AA) and 2.4.11 Focus
   Appearance (AAA). Underline alone may be lost on a coloured link, so pair it
   with a visible outline that matches the brand accent. */
.sitemap-footer summary:focus-visible {
    outline: 2px solid #0D7621;
    outline-offset: 2px;
}

.sitemap-footer[open] > nav {
    position: absolute;
    bottom: calc(100% + 0.5em);
    right: 0;
    background: #ffffff;
    border: 1px solid #cccccc;
    border-radius: 6px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    padding: 1em 1.25em;
    width: 520px;
    max-width: 90vw;
    max-height: 70vh;
    overflow-y: auto;
    z-index: 50;
    line-height: 1.5;
}

/* Top-level sections use CSS columns so each section+children group packs
   tightly into the available space (grid would leave short items stranded
   in oversized rows). break-inside:avoid keeps a parent with its children.
   column-fill: auto + an explicit height fills column 1 first, then column 2
   starts at the top. Without this, Safari's default balanced fill leaves an
   orphan gap at the top of column 2. The height is sized to fit the current
   admin section list (6 sections plus the Options children); raise if the
   admin nav grows. */
.sitemap-footer[open] .sitemap-sections {
    columns: 2;
    column-gap: 2em;
    column-fill: auto;
    height: 290px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.sitemap-footer[open] .sitemap-sections > li {
    break-inside: avoid;
    padding: 0;
    margin: 0 0 0.6em 0;
}

/* Scoped under #footer because admin's refresh.css ships a rule
   `#footer a:link { color: var(--color-brand-accessible) }` with an ID in the
   selector — the ID outranks a class-only selector, so we match it to regain
   control of the link colour + ensure adequate contrast on white. */
#footer .sitemap-footer[open] .sitemap-section-link {
    display: block;
    padding: 1px 0;
    color: #222222;
    font-weight: 700;
    text-decoration: none;
}

#footer .sitemap-footer[open] .sitemap-section-link:hover,
#footer .sitemap-footer[open] .sitemap-section-link:focus-visible {
    text-decoration: underline;
    color: #0D7621;
}

/* Current-page cue works on both section and child links: a 2px accent bar
   plus a bold weight. aria-current="page" is WCAG's standard "you are here"
   signal and is already set by SitemapLink.getAriaCurrent(). */
#footer .sitemap-footer[open] > nav a[aria-current="page"] {
    font-weight: 700;
    border-left: 2px solid #0D7621;
    padding-left: 0.5em;
    margin-left: -0.65em;
}

/* Inset (negative offset) keeps the focus ring inside the link's box, so it
   doesn't get clipped by the popover's overflow:auto edges or extend past
   the right border on column-2 links. */
#footer .sitemap-footer[open] > nav a:focus-visible {
    outline: 2px solid #0D7621;
    outline-offset: -2px;
    border-radius: 2px;
}

/* Nested child pages sit indented under their section link with a subtle
   left guide so hierarchy is visually obvious even without the bullet markers. */
.sitemap-footer[open] .sitemap-children {
    list-style: none;
    margin: 0.15em 0 0 0.9em;
    padding: 0 0 0 0.75em;
    border-left: 1px solid #e2e2e2;
}

.sitemap-footer[open] .sitemap-children li {
    padding: 1px 0;
}

#footer .sitemap-footer[open] .sitemap-children a {
    color: #0D7621;
    text-decoration: none;
    font-weight: 400;
}

#footer .sitemap-footer[open] .sitemap-children a:hover,
#footer .sitemap-footer[open] .sitemap-children a:focus-visible {
    text-decoration: underline;
}
