/* 1. Keep the keyboard cursor visible on the dark panel and multicoloured screenshot. */
@media screen and (forced-colors: none) {
  .hero :is(a, button):focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
    box-shadow: 0 0 0 7px #183326;
  }
}

/* 2. The current page in the site menu has a persistent shape cue. */
.site-head a[aria-current="page"] {
  text-decoration-line: underline;
  text-decoration-style: double;
  text-underline-offset: .26em;
}

/* 3. Mark the destination after following a topic link or a shared fragment. */
@media screen {
  .guide-body section:target > h2,
  .steps:target > .section-title > h2,
  .photo-section:target > .photo-copy > h2,
  .help-section:target h2 {
    border-inline-start: .2em solid currentColor;
    padding-inline-start: .35em;
  }
}

/* 4. In a narrow reading area the guide's topics go above the article,
   even when desktop browser text size leaves fewer em available. */
@media screen {
  main.wrap:has(> .guide-layout) { container: help-reading / inline-size; }
  @container help-reading (max-width: 52em) {
    .guide-layout { grid-template-columns: minmax(0, 1fr); gap: 1rem; }
    .guide-nav {
      grid-template-columns: repeat(auto-fit, minmax(min(100%, 13em), 1fr));
      column-gap: .6rem;
    }
  }
}

/* 5. Honour a request for greater contrast without replacing the user's colour scheme. */
@media screen and (prefers-contrast: more) {
  :root { --muted: var(--ink); --line: #54685a; }
  .hero :is(.platform, .lead, .release-line, .demo-caption) { color: white; }
  .photo-proof p { color: var(--ink); }
}

/* 6. Retain the shape of the actionable controls when background fills disappear. */
@media screen and (forced-colors: active) {
  .hero .button.bright, .site-head .head-download { border: 2px solid LinkText; }
  .switcher button { border: 1px solid ButtonText; }
  .switcher button[aria-pressed="true"] { border: 3px double Highlight; }
}

/* 7. A printed guide uses the page width for its instructions, omitting navigation. */
@media print {
  .site-head, .guide-nav, .footer-inner nav, .skip { display: none; }
  .guide-layout { display: block; padding-block: 0; }
  main.wrap:has(> .guide-layout), .guide-body { width: 100%; max-width: none; }
}

/* 8. Print every FAQ answer, including the ones the reader left collapsed. */
@media print {
  .faq details::details-content { content-visibility: visible; display: block; }
  .faq summary::after { content: none; }
  .faq details[hidden] { display: block; }
}

/* 9. Keep instruction headings with the next paragraph and each example with its caption. */
@media print {
  .guide-body :is(h2,h3), .faq summary { break-after: avoid-page; }
  .guide-body :is(p,li) { orphans: 3; widows: 3; }
  .support-shots { display: block; }
  .support-shots figure { break-inside: avoid-page; margin-block: 3mm; }
  .support-shots img, .guide-body .guide-photo {
    width: auto; height: auto; max-width: 100%; max-height: 65mm;
  }
}

/* 10. Stable destinations and download addresses remain readable on paper. */
@media print {
  .guide-body a[href^="https://"]::after, .faq p a[href^="https://"]::after {
    content: " (" attr(href) ")";
    font-size: .88em;
    font-weight: normal;
    overflow-wrap: anywhere;
  }
}
