/* ===========================================================================
   ACCESSIBILITY
   ---------------------------------------------------------------------------
   This system registers PWD-Owned enterprises as a GAD sector it reports on.
   A procurement portal that counts disabled-owned businesses and is then hard
   for a disabled person to use is not a small irony; it is the thing the study
   says it is fixing.

   WHAT IT OFFERS (30 November 2026)

   Two things people actually use: a bigger text size, and (on the public pages) Filipino or Bikol. The contrast
   modes, link underlining, line spacing, bigger buttons and stop-movement switches were taken out at the
   Procurement Unit's request: they added clutter for little use. Windows and the browser keep their own versions of
   all of these (high contrast, zoom, reduced motion), and the portal follows them.

   Everything here is opt-in, remembered per browser, and additive to whatever
   the person has already set in Windows or in their browser.
   =========================================================================== */

/* ---------------------------------------------------------------------------
   1. SKIP TO CONTENT
   The single most useful thing for anyone navigating by keyboard. Without it,
   reaching the first bid on the page means tabbing through the whole sidebar
   on every single page load.
   --------------------------------------------------------------------------- */
.a11y-skip {
    position: absolute;
    left: 8px;
    top: -100px;                 /* off-screen until focused, never display:none
                                    — a display:none link is not focusable */
    z-index: 100000;
    background: var(--primary-navy, #1b2a4a);
    color: #fff;
    padding: 12px 20px;
    border-radius: 0 0 8px 8px;
    font-weight: 700;
    font-size: .95rem;
    text-decoration: none;
    transition: top .15s ease;
}
.a11y-skip:focus { top: 0; outline: 3px solid var(--accent-gold, #c9a227); outline-offset: 2px; }

/* The target must be focusable for the jump to actually move the caret. */
[data-a11y-main]:focus { outline: 3px solid var(--accent-gold, #c9a227); outline-offset: 4px; }

/* ---------------------------------------------------------------------------
   2. THE LAUNCHER, THE HINT AND THE PANEL

   The launcher used to be a bare 56px icon: easy to miss, and meaningless to
   anyone who does not already know what a wheelchair symbol means here. It is
   now a labelled pill - the words are the point - fixed bottom-right, with a
   second entry in the public header. On a person's first visit a short note
   points at it. The panel opens as a side sheet on a desktop and a bottom
   sheet on a phone, so it never depends on where the person happened to press.
   --------------------------------------------------------------------------- */
.a11y-widget {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 9999;
    font-family: inherit;
}

.a11y-toggle {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 54px;
    padding: 8px 20px 8px 14px;
    border-radius: 999px;
    background: var(--primary-navy, #0a192f);
    color: #fff;
    border: 3px solid var(--accent-gold, #e5a823);
    box-shadow: 0 8px 26px rgba(0, 0, 0, .38);
    font: inherit;
    text-align: left;
    cursor: pointer;
    transition: background-color .18s ease, color .18s ease, transform .18s ease;
}
.a11y-toggle svg { flex: none; }
.a11y-toggle-text strong { display: block; font-size: .92rem; line-height: 1.15; font-weight: 800; }
.a11y-toggle-text small  { display: block; font-size: .68rem; line-height: 1.2; opacity: .85; letter-spacing: .02em; }
.a11y-toggle:hover { background: var(--accent-gold, #e5a823); color: var(--primary-navy, #0a192f); }
.a11y-toggle:focus-visible { outline: 3px solid #fff; outline-offset: 3px; }
.a11y-toggle.is-attention { animation: a11yPulse 1.8s ease-in-out 3; }
@keyframes a11yPulse {
    0%, 100% { box-shadow: 0 8px 26px rgba(0, 0, 0, .38), 0 0 0 0 rgba(229, 168, 35, .7); }
    50%      { box-shadow: 0 8px 26px rgba(0, 0, 0, .38), 0 0 0 14px rgba(229, 168, 35, 0); }
}

/* A dot when any setting is active, so it is obvious the page is not in its
   default state - otherwise "why does this look different" has no answer. */
.a11y-toggle[data-active="1"]::after {
    content: '';
    position: absolute;
    top: -3px; right: -3px;
    width: 15px; height: 15px;
    border-radius: 50%;
    background: #16a34a;
    border: 2px solid #fff;
}

.a11y-hint {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 270px;
    max-width: calc(100vw - 32px);
    padding: 12px 14px;
    background: #fff;
    color: #1e293b;
    border: 2px solid var(--accent-gold, #e5a823);
    border-radius: 12px;
    box-shadow: 0 14px 34px rgba(15, 23, 42, .3);
    font-size: .92rem;
    line-height: 1.45;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.a11y-hint[hidden] { display: none; }
.a11y-hint::after {
    content: '';
    position: absolute;
    right: 34px; bottom: -9px;
    width: 14px; height: 14px;
    background: #fff;
    border-right: 2px solid var(--accent-gold, #e5a823);
    border-bottom: 2px solid var(--accent-gold, #e5a823);
    transform: rotate(45deg);
}
.a11y-hint-ok {
    align-self: flex-end;
    min-height: 40px;
    padding: 6px 16px;
    background: var(--primary-navy, #0a192f);
    color: #fff;
    border: 0;
    border-radius: 8px;
    font-weight: 700;
    cursor: pointer;
}

/* While the panel is open the launcher steps aside. It sits at the same corner as the
   bottom of the panel, and would otherwise cover the "Reset" button under it. */
.a11y-panel:not([hidden]) ~ .a11y-toggle,
.a11y-panel:not([hidden]) ~ .a11y-hint { visibility: hidden; }

.a11y-scrim { position: fixed; inset: 0; background: rgba(6, 14, 26, .45); z-index: -1; }
.a11y-scrim[hidden] { display: none; }

.a11y-panel {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(410px, 100vw);
    display: flex;
    flex-direction: column;
    background: #fff;
    color: #1e293b;
    border-left: 1px solid #cbd5e1;
    box-shadow: -20px 0 50px rgba(15, 23, 42, .3);
    text-align: left;
}
.a11y-panel[hidden] { display: none; }

.a11y-head {
    flex: none;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 12px;
    padding: 18px 18px 14px;
    background: var(--primary-navy, #0a192f);
    color: #fff;
}
.a11y-head h4 { margin: 0; font-size: 1.15rem; font-weight: 800; color: #fff; }
.a11y-sub { margin: 4px 0 0; font-size: .78rem; line-height: 1.45; color: #cbd5e1; }
.a11y-close {
    flex: none;
    width: 44px; height: 44px;
    display: inline-flex; align-items: center; justify-content: center;
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255, 255, 255, .4);
    border-radius: 10px;
    cursor: pointer;
}
.a11y-close:hover { background: rgba(255, 255, 255, .14); }
.a11y-close:focus-visible { outline: 3px solid var(--accent-gold, #e5a823); outline-offset: 2px; }
.a11y-scroll { flex: 1 1 auto; overflow-y: auto; padding-bottom: 20px; -webkit-overflow-scrolling: touch; }

/* language: three big, named choices; the chosen one also carries a tick,
   so it is not told apart by colour alone */
.a11y-langs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 8px; }
.a11y-lang {
    min-height: 52px;
    padding: 8px 6px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 10px;
    font: inherit;
    font-size: .98rem;
    font-weight: 700;
    color: #334155;
    cursor: pointer;
}
.a11y-lang:hover { border-color: var(--accent-gold, #e5a823); }
.a11y-lang:focus-visible { outline: 3px solid var(--primary-navy, #0a192f); outline-offset: 2px; }
.a11y-lang[aria-checked="true"] { background: var(--primary-navy, #0a192f); border-color: var(--primary-navy, #0a192f); color: #fff; }
.a11y-lang[aria-checked="true"]::before { content: ''; display: inline-block; width: .32em; height: .62em; border: solid currentColor; border-width: 0 .15em .15em 0; transform: rotate(45deg) translateY(-.12em); margin-right: .6em; }

/* text size: four steps, each showing its own size and its name */
.a11y-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.a11y-size {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
    min-height: 68px;
    padding: 6px 2px;
    border: 2px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 10px;
    color: #334155;
    line-height: 1;
    cursor: pointer;
}
.a11y-size-a { font-weight: 800; }
.a11y-size:nth-child(1) .a11y-size-a { font-size: 1rem; }
.a11y-size:nth-child(2) .a11y-size-a { font-size: 1.25rem; }
.a11y-size:nth-child(3) .a11y-size-a { font-size: 1.55rem; }
.a11y-size:nth-child(4) .a11y-size-a { font-size: 1.9rem; }
.a11y-size-cap { font-size: .66rem; font-weight: 700; letter-spacing: .02em; }
.a11y-size:hover { border-color: var(--accent-gold, #e5a823); }
.a11y-size:focus-visible { outline: 3px solid var(--primary-navy, #0a192f); outline-offset: 2px; }
.a11y-size[aria-checked="true"] { background: var(--primary-navy, #0a192f); color: #fff; border-color: var(--primary-navy, #0a192f); }

@media (max-width: 560px) {
    .a11y-widget { right: 12px; bottom: 12px; }
    .a11y-toggle { min-height: 50px; padding: 6px 16px 6px 11px; }
    .a11y-toggle-text small { display: none; }
    /* a bottom sheet on a phone: reachable with a thumb, never off the edge */
    .a11y-panel {
        top: auto; left: 0; right: 0; bottom: 0;
        width: 100%;
        max-height: 88vh; max-height: 88dvh;
        border-left: 0;
        border-radius: 18px 18px 0 0;
        box-shadow: 0 -18px 50px rgba(15, 23, 42, .35);
    }
    .a11y-head { border-radius: 18px 18px 0 0; }
}

.a11y-group { padding: 12px 16px 4px; border-bottom: 1px solid #f1f5f9; }
.a11y-group:last-of-type { border-bottom: 0; }
.a11y-group > p {
    margin: 0 0 8px;
    font-size: .7rem;
    font-weight: 700;
    letter-spacing: .06em;
    text-transform: uppercase;
    color: #64748b;
}

/* text size: four steps, shown as one row */
.a11y-sizes { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.a11y-size {
    padding: 9px 0;
    min-height: 44px;
    border: 1px solid #cbd5e1;
    background: #f8fafc;
    border-radius: 7px;
    cursor: pointer;
    font-weight: 700;
    color: #334155;
    line-height: 1;
}
.a11y-size:nth-child(1) { font-size: .72rem; }
.a11y-size:nth-child(2) { font-size: .84rem; }
.a11y-size:nth-child(3) { font-size: .96rem; }
.a11y-size:nth-child(4) { font-size: 1.1rem; }
.a11y-size[aria-checked="true"] {
    background: var(--primary-navy, #1b2a4a);
    color: #fff;
    border-color: var(--primary-navy, #1b2a4a);
}

.a11y-reset {
    display: block;
    width: calc(100% - 32px);
    margin: 10px 16px 4px;
    min-height: 44px;
    padding: 10px;
    border: 1px solid #cbd5e1;
    background: #fff;
    border-radius: 8px;
    font-size: .8rem;
    font-weight: 700;
    color: #64748b;
    cursor: pointer;
}
.a11y-reset:hover { background: #f1f5f9; color: #1e293b; }

/* Announcements for screen readers. Visually hidden, never display:none —
   a display:none live region is not announced. */
.a11y-sr {
    position: absolute !important;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
    border: 0;
}

/* ===========================================================================
   3. TEXT SIZE
   Every font-size in this project is in rem and nothing sets a base, so moving
   the root percentage scales the whole interface AND lets it reflow. The old
   `zoom: 1.15` scaled the picture instead — one fixed step, and at larger
   values it pushes content off the side rather than rewrapping it.
   =========================================================================== */
html[data-a11y-text="1"] { font-size: 115%; }
html[data-a11y-text="2"] { font-size: 130%; }
html[data-a11y-text="3"] { font-size: 150%; }


/* A status badge is one word-picture, not a sentence. With larger text, letting it wrap splits its
   coloured background into two pieces and it stops reading as a badge. */
html[data-a11y-text] .pill,
html[data-a11y-text] .status-pill { white-space: nowrap; }

/* Focus must always be visible once someone is navigating by keyboard. This is
   not behind a toggle: an invisible focus ring is a defect, not a preference. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
    outline: 3px solid var(--accent-gold, #c9a227);
    outline-offset: 2px;
}

@media print {
    .a11y-widget, .a11y-skip { display: none !important; }

    /* Text scaling is a reading aid on screen. The printed documents set their
       own sizes in points for A4, and scaling the root would repaginate them. */
    html[data-a11y-text] { font-size: 100% !important; }

}

/* ---------------------------------------------------------------------------
   COMPACT BY DEFAULT.
   The labelled pill was about 200px wide and sat over the bottom-right of every
   table - on Awards & Approvals it hid the second row's "Confirm & Approve".
   It is now a round button; the label slides out on hover, on keyboard focus
   and while the first-visit note is showing, so nothing is lost for someone
   looking for it. The name is still announced from aria-label.
   --------------------------------------------------------------------------- */
.a11y-toggle {
    gap: 0;
    padding: 8px 12px;
    min-width: 54px;
    justify-content: center;
}
.a11y-toggle-text {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    transition: max-width .22s ease, opacity .18s ease, margin .22s ease;
}
.a11y-toggle:hover .a11y-toggle-text,
.a11y-toggle:focus-visible .a11y-toggle-text,
.a11y-toggle.is-attention .a11y-toggle-text,
.a11y-toggle[aria-expanded="true"] .a11y-toggle-text {
    max-width: 220px;
    opacity: 1;
    margin-left: 10px;
}
/* Room at the end of the content, so the last row is never under the button.
   On the content column, not <body>: padding the body cut the dark sidebar
   short of the bottom of the window on every staff screen. */
main#a11y-main { padding-bottom: 76px; }
@media (prefers-reduced-motion: reduce) {
    .a11y-toggle-text { transition: none; }
}
