/* Accessibility layer: skip link, focus outlines, text size, high contrast,
   offline banner and the offline fallback page. Loaded by every shell. */

/* Skip link: off-screen until focused by keyboard. */
.skip-link {
  position: absolute;
  left: 1rem;
  top: -100px;
  z-index: 10000;
  padding: .6rem 1rem;
  border-radius: .5rem;
  background: #1a1a40;
  color: #fff !important;
  font-weight: 700;
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

/* Visible keyboard focus everywhere (mouse clicks keep the quiet look). */
:focus-visible {
  outline: 3px solid #ffbf47 !important;
  outline-offset: 2px !important;
  box-shadow: 0 0 0 5px rgba(26, 26, 64, .55) !important;
}
#main-content:focus, main:focus { outline: none; }

/* Text size: Bootstrap sizes in rem, so scaling the root scales the UI. */
html.ums-text-large { font-size: 112.5%; }
html.ums-text-xlarge { font-size: 125%; }

/* High contrast: dark text on white, black chrome, underlined links. */
html.ums-hc body { background: #fff !important; color: #000 !important; }
html.ums-hc {
  --primary: #1a0dab; --primary-dark: #000; --accent: #000;
  --sidebar: #000; --surface: #fff; --gradient: #000;
}
html.ums-hc .sidebar, html.ums-hc .sidebar * { background-image: none !important; }
html.ums-hc .sidebar { background: #000 !important; }
html.ums-hc .sidebar .item, html.ums-hc .sidebar .menu-label { color: #fff !important; }
html.ums-hc .sidebar .item.active { background: #ffbf47 !important; color: #000 !important; }
html.ums-hc .text-muted, html.ums-hc small, html.ums-hc .small { color: #1f1f1f !important; }
html.ums-hc .card, html.ums-hc .card-ums { border: 2px solid #000 !important; box-shadow: none !important; }
html.ums-hc .content a:not(.btn), html.ums-hc main a:not(.btn) { color: #1a0dab !important; text-decoration: underline !important; }
html.ums-hc .btn-primary { background: #000 !important; border-color: #000 !important; color: #fff !important; }
html.ums-hc .btn-outline-primary { color: #000 !important; border: 2px solid #000 !important; }
html.ums-hc .form-control, html.ums-hc .form-select { border: 2px solid #000 !important; }
html.ums-hc .badge { border: 1px solid #000; }

/* Accessibility / install controls inside the account menu. */
.acct-a11y { padding: .4rem .9rem .6rem; display: grid; gap: .4rem; }
.acct-a11y-row { display: flex; align-items: center; justify-content: space-between; gap: .5rem; font-size: .82rem; }
.acct-a11y-row select { font-size: .8rem; border-radius: .4rem; padding: .1rem .3rem; }
.lang-switch select { font-size: .8rem; border-radius: 999px; padding: .2rem .5rem; border: 1px solid rgba(0,0,0,.15); background: #fff; }

/* Offline banner shown on cached timetable / exam card. */
.ums-offline-banner {
  position: sticky; top: 0; z-index: 2000;
  background: #fff3cd; color: #533f03; border-bottom: 2px solid #b58900;
  padding: .55rem 1rem; font-weight: 600; text-align: center;
}

/* Offline fallback page. */
.ums-offline-page {
  margin: 0; min-height: 100vh; display: grid; place-items: center;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: linear-gradient(135deg, #6C5CE7 0%, #4834d4 100%); color: #1a1a40;
}
.ums-offline-card { background: #fff; border-radius: 1rem; padding: 2rem; max-width: 30rem; margin: 1rem; text-align: center; }
.ums-offline-card h1 { font-size: 1.5rem; }
.ums-offline-card ul { list-style: none; padding: 0; }
.ums-offline-card a { color: #4834d4; font-weight: 600; }
.ums-offline-retry { display: inline-block; margin-top: .5rem; }

/* Public / sign-in accessibility toggles (partials/public/_a11y_toggles.html). */
.pub-a11y { position: fixed; left: 16px; bottom: 16px; z-index: 1040; font-size: .875rem; }
.pub-a11y summary { list-style: none; cursor: pointer; display: inline-flex; align-items: center; gap: .4rem;
  background: #1a1a40; color: #fff; border-radius: 999px; padding: .5rem .85rem; box-shadow: 0 4px 14px rgba(0,0,0,.18); }
.pub-a11y summary::-webkit-details-marker { display: none; }
.pub-a11y summary:focus-visible { outline: 3px solid #ffbf47; outline-offset: 2px; }
.pub-a11y-panel { position: absolute; left: 0; bottom: calc(100% + 8px); min-width: 220px; background: #fff; color: #1a1a40;
  border-radius: .75rem; padding: .75rem; box-shadow: 0 8px 24px rgba(0,0,0,.18); display: grid; gap: .5rem; }
.pub-a11y-row { display: flex; align-items: center; justify-content: space-between; gap: .75rem; margin: 0; }
@media (max-width: 575px) { .pub-a11y-label { display: none; } }
html.ums-hc .pub-a11y summary { background: #000; color: #fff; border: 2px solid #fff; }
html.ums-hc .pub-a11y-panel { border: 2px solid #000; }
