/* Crush accessibility hardening — WCAG 2.2 AA / WAI-ARIA oriented
   Loaded last so contrast, focus, readability, and motion rules win. */

:root{
  --a11y-focus-dark:#5b1f2b;
  --a11y-focus-light:#ffffff;
  --a11y-gold-on-light:#745126;
  --a11y-muted-on-light:#686562;
  --a11y-muted-on-dark:#d8cbbd;
}

html{scroll-padding-top:7.5rem}
body{font-synthesis:none;-webkit-text-size-adjust:100%;text-size-adjust:100%}

/* A visible keyboard path is mandatory. Two-tone focus survives both light and dark surfaces. */
:where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{
  outline:3px solid var(--a11y-focus-light)!important;
  outline-offset:3px!important;
  box-shadow:0 0 0 6px var(--a11y-focus-dark)!important;
}

.skip-link{
  position:fixed!important;z-index:100000!important;left:1rem!important;top:1rem!important;
  width:auto!important;height:auto!important;overflow:visible!important;clip:auto!important;
  padding:.8rem 1rem!important;background:#fff!important;color:#2e1017!important;
  border:3px solid #2e1017!important;font:700 1rem/1.2 Arial,sans-serif!important;
  text-decoration:none!important;transform:translateY(-180%);transition:transform .15s ease;
}
.skip-link:focus{transform:none!important}

/* Do not use pale gold as body-sized text on cream. */
:where(main,footer) .a11y-gold-on-light{color:var(--a11y-gold-on-light)!important}

/* Form affordances: boundaries and labels remain legible. */
:where(input,select,textarea){
  min-height:44px;
  border-color:#756b66!important;
  color:#1d1a19;
}
:where(input,select,textarea)::placeholder{color:#686562;opacity:1}
:where(button,a){text-underline-offset:.18em}

/* Disabled concept controls should read as disabled, not broken. */
:where(button,[role="button"])[aria-disabled="true"],button:disabled{
  cursor:not-allowed!important;opacity:.72!important
}

/* Reduce motion without removing state changes. */
@media (prefers-reduced-motion:reduce){
  html{scroll-behavior:auto!important}
  *,*::before,*::after{animation-duration:.01ms!important;animation-iteration-count:1!important;transition-duration:.01ms!important;scroll-behavior:auto!important}
}

@media (forced-colors:active){
  :where(a,button,input,select,textarea,summary,[tabindex]):focus-visible{outline:3px solid Highlight!important;box-shadow:none!important}
  .button,.crush-nav__actions a,.menu-jump a,.menu-index__grid a{border:1px solid ButtonText!important}
}

/* Readability floor for interactive controls. */
button{min-height:44px}
:target{scroll-margin-top:9rem}

/* Dashboard: library records span the full component instead of becoming
   additional columns, and the shell may contract at narrow viewports. */
body:has(.side .site-link) .shell{grid-template-columns:minmax(0,280px) minmax(0,1fr)}
body:has(.side .site-link) .main,
body:has(.side .site-link) .grid,
body:has(.side .site-link) .panel,
body:has(.side .site-link) .lifecycle,
body:has(.side .site-link) .content-row{min-width:0}
body:has(.side .site-link) .lifecycle{grid-template-columns:repeat(4,minmax(0,1fr))}
body:has(.side .site-link) .lifecycle>.content-row{grid-column:1/-1}
@media(max-width:950px){body:has(.side .site-link) .lifecycle{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:600px){body:has(.side .site-link) .main{padding:24px 16px 48px}body:has(.side .site-link) .lifecycle{grid-template-columns:1fr}body:has(.side .site-link) .life{border-right:0;border-bottom:1px solid var(--line)}body:has(.side .site-link) .content-row{grid-template-columns:minmax(0,1fr);gap:8px}body:has(.side .site-link) .content-row>:not(:first-child){justify-self:start}body:has(.side .site-link) .site-link{margin:-10px 0 22px 70px}}
