/* Focused public-site accessibility fixes, November 2026. */

/* A focused skip link stays inside the viewport while the page is scrolled. */
.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 1100;
  max-width: calc(100vw - 24px);
  min-height: 44px;
  line-height: 1.4;
  white-space: normal;
  transform: translateY(calc(-100% - 24px));
  background: #fff;
  color: #07111f;
}
.skip-link:focus { top: 12px; left: 12px; transform: none; }
#content { scroll-margin-block-start: 6rem; }

/* The announcement can wrap freely without a stale sticky-header offset. */
.preview-mode-banner { position: static; }
.site-header,
.is-preview .site-header,
.page-home.is-preview .site-header { top: 0; }
html { scroll-padding-block-start: 6rem; scroll-padding-block-end: calc(var(--privacy-panel-height, 0px) + 16px); }
body { padding-bottom: var(--privacy-panel-height, 0px); }

/* Native links remain usable when JS is disabled or does not finish loading. */
@media (max-width: 1250px) {
  html:not(.public-nav-ready) .site-header { position: relative; }
  html:not(.public-nav-ready) .header-inner { flex-wrap: wrap; }
  html:not(.public-nav-ready) .site-header .menu-toggle { display: none; }
  html:not(.public-nav-ready) .site-header .site-nav {
    display: grid;
    position: static;
    flex-basis: 100%;
    max-height: none;
    overflow: visible;
    margin-bottom: 16px;
    box-shadow: none;
  }
  .public-nav-ready .site-header .site-nav { top: 100%; max-height: calc(100dvh - 100px); }
}
/* Small viewports need the vertical room for content and the open menu. */
@media (max-height: 600px) {
  .site-header { position: relative; }
  .public-nav-ready .site-header .site-nav { position: static; flex-basis: 100%; max-height: none; }
  .public-nav-ready .header-inner { flex-wrap: wrap; }
}

/* Keep the optional choice panel bounded; its measured space is reserved above. */
.privacy-consent__panel { max-height: 50vh; max-height: min(24rem, 50dvh); overflow: auto; overscroll-behavior: contain; }
.privacy-choice-button { min-height: 44px; padding: 8px 4px; line-height: 1.4; }
html:not(.public-consent-ready) .privacy-choice-button { display: none; }
.hospi-chat-fab[hidden] { display: none; }

/* The previous gold focus outline was 2.67:1 on this cream surface.
   This brown outline is 5.84:1 against the unchanged #f5f2eb background. */
body .discovery-reading :focus-visible,
body .capability-depth :focus-visible { outline: 3px solid #805500; outline-offset: 4px; }

/* Inner scroll regions are explicit keyboard stops with a visible focus ring. */
.public-assistant-log:focus-visible { outline: 3px solid #8fd3ff; outline-offset: 3px; }
.product-showcase figure { scroll-margin-block-start: 6rem; }

/* Keep route-specific links and nested dark cards readable in every state. */
.page-hardware-guide a.skip-link { color: #07111f; }
.page-hardware-guide .site-nav a.btn-primary {
  background: #f4b63d;
  color: #111827;
}
.page-hardware-guide .site-nav a.btn-primary:hover,
.page-hardware-guide .site-nav a.btn-primary:focus-visible { background: #ffd06a; }
.discovery-reading .software-gallery-card .btn-secondary { color: #fff; }
.discovery-reading .software-gallery-card .btn-secondary:focus-visible { outline-color: #8fd3ff; }

/* Distinguish text-entry controls from their surrounding dark surfaces. */
.contact-experience .contact-form-card .field > input,
.contact-experience .contact-form-card .field > select,
.contact-experience .contact-form-card .field > textarea,
.public-assistant-compose > input { border-color: #94a3b8; }

/* Two opaque bands remain inside screenshot links with mixed image edges. */
.software-gallery-card .software-capture-frame { position: relative; }
.software-gallery-card .software-capture-frame:focus-visible {
  outline: 3px solid transparent;
  outline-offset: -3px;
}
.software-gallery-card .software-capture-frame:focus-visible::after {
  content: "";
  position: absolute;
  inset: 3px;
  z-index: 1;
  border: 3px solid #fff;
  outline: 3px solid #07111f;
  outline-offset: 0;
  pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
  .skip-link { transition: none; }
  html { scroll-behavior: auto; }
}
@media (forced-colors: active) {
  .skip-link,
  .page-hardware-guide a.skip-link { background: Canvas; color: CanvasText; border: 2px solid ButtonText; }
  .contact-experience .contact-form-card .field > input,
  .contact-experience .contact-form-card .field > select,
  .contact-experience .contact-form-card .field > textarea,
  .public-assistant-compose > input { border-color: FieldText; }
  .software-gallery-card .software-capture-frame:focus-visible::after { display: none; }
  :where(a, button, input, select, textarea, summary, [tabindex]):focus-visible {
    outline: 3px solid Highlight !important;
  }
}
@media print {
  body { padding-bottom: 0; }
  .skip-link, .privacy-consent, .hospi-chat-fab { display: none; }
}
