/* Shared, additive navigation/readability enhancement. No contact-form behaviour. */
.bk-menu-toggle { display: none; }
.bk-page-top { position: absolute; top: 0; left: 0; width: 1px; height: 1px; }
.bk-footer-top { display: flex; justify-content: center; margin: 0 auto 24px; }
.bk-back-top {
  position: static; display: inline-flex; align-items: center; justify-content: center;
  gap: 10px; min-height: 48px; max-width: 100%; padding: 10px 20px;
  border: 1px solid #ffc247; border-radius: 999px;
  background: transparent; color: #ffc247; text-decoration: none;
  font: 700 16px/1.5 Arial, sans-serif; text-align: center;
}
.bk-back-top-arrow { font-size: 26px; line-height: 1; }
.bk-back-top-label { overflow-wrap: anywhere; }
.bk-back-top:hover { background: #243d61; }
.bk-back-top:focus-visible, .bk-menu-toggle:focus-visible {
  outline: 3px solid #ffc247; outline-offset: 4px;
}
@media (max-width: 1240px) {
  html.bk-mobile-nav { scroll-padding-top: calc(var(--bk-header-height, 76px) + 16px) !important; }
  .bk-mobile-nav main [id], .bk-mobile-nav main[id], .bk-mobile-nav header[id] {
    scroll-margin-top: 0 !important;
  }
  .bk-mobile-nav .top-nav {
    position: sticky; top: 0; z-index: 100;
    display: flex !important; align-items: center; justify-content: space-between;
    gap: 12px; min-height: 76px; padding: 12px 16px !important;
    background: #10223e;
  }
  .bk-mobile-nav .top-nav .name {
    flex: 1 1 auto; min-width: 0; max-width: none; padding: 6px 0;
    font-size: 16px !important; line-height: 1.35;
    white-space: normal; overflow: visible; text-overflow: clip; text-align: right;
  }
  .bk-mobile-nav .bk-menu-toggle {
    display: inline-flex; flex: 0 0 auto; align-items: center; justify-content: center;
    gap: 9px; min-width: 104px; min-height: 48px; padding: 10px 13px;
    border: 1px solid #ffc247; border-radius: 6px; background: transparent;
    color: #fff; font: 700 17px/1.3 Arial, sans-serif; cursor: pointer;
  }
  .bk-mobile-nav .bk-menu-toggle[aria-expanded="true"] { background: #ffc247; color: #10223e; }
  .bk-menu-icon { font-size: 23px; line-height: 1; width: 23px; text-align: center; }
  .bk-mobile-nav .top-nav .nav-right {
    display: none !important; position: absolute; top: 100%; left: 0; right: 0;
    width: 100%; max-height: calc(100vh - var(--bk-header-height, 76px) - 8px);
    max-height: calc(100dvh - var(--bk-header-height, 76px) - 8px);
    overflow-y: auto; overflow-x: hidden; overscroll-behavior: contain;
    padding: 12px 16px max(16px, env(safe-area-inset-bottom));
    background: #10223e; border-top: 1px solid #ffffff2b;
    border-bottom: 3px solid #ffc247; box-shadow: 0 12px 22px #08162b33;
  }
  .bk-mobile-nav .top-nav.bk-menu-open .nav-right { display: block !important; }
  .bk-mobile-nav .top-nav .links {
    display: flex !important; flex-direction: column !important; align-items: stretch !important;
    gap: 4px !important; width: 100%; overflow: visible; padding: 0;
  }
  .bk-mobile-nav .top-nav .links a {
    display: flex; align-items: center; width: 100%; min-height: 48px;
    padding: 11px 14px !important; margin: 0;
    border: 1px solid transparent; border-radius: 5px;
    color: #fff; font-size: 18px !important; font-weight: 600;
    line-height: 1.4; letter-spacing: normal; white-space: normal;
    text-transform: none; text-decoration: none;
  }
  .bk-mobile-nav .top-nav .links a:hover { background: #ffffff16; }
  .bk-mobile-nav .top-nav .links a.active,
  .bk-mobile-nav .top-nav .links a[aria-current="page"] {
    background: #ffc247; border-color: #ffc247; color: #10223e; font-weight: 700;
  }
  .bk-mobile-nav .top-nav .links a:focus-visible,
  .bk-mobile-nav .top-nav .languages a:focus-visible { outline: 3px solid #ffc247; outline-offset: 1px; }
  .bk-mobile-nav .top-nav .languages {
    display: flex !important; flex-wrap: wrap; justify-content: flex-start;
    gap: 10px !important; width: 100%; margin: 14px 0 0; padding: 14px 0 0;
    border: 0; border-top: 1px solid #ffffff40;
  }
  .bk-mobile-nav .top-nav .languages span { min-width: 58px; font-size: 16px; }
  .bk-mobile-nav .top-nav .languages a {
    display: flex; align-items: center; justify-content: center;
    min-width: 58px; min-height: 48px; padding: 10px 14px;
    font-size: 16px; line-height: 1.4; border: 1px solid #ffffff70; border-radius: 5px;
  }
  .bk-mobile-nav .top-nav .languages .active a { background: #ffc247; color: #10223e; border-color: #ffc247; }
  .hero-actions { margin-top: 28px !important; gap: 16px !important; }
  .hero-actions .button, .button {
    min-height: 50px; padding-top: 13px; padding-bottom: 13px;
    font-size: 16px !important; line-height: 1.5; white-space: normal;
  }
  .hero h1 { line-height: 1.06; }
  .card-copy p, .reason-card p, .catalog-record p, .ifimes-card p { font-size: 17px; line-height: 1.65; }
  .card-meta, .metadata span { font-size: 14px; line-height: 1.5; }
  .source-note { font-size: 15px !important; line-height: 1.6; }
  .catalog-record details, .ifimes-card details { font-size: 15px; line-height: 1.6; }
  .guide-row strong { font-size: 16px; line-height: 1.5; }
  .catalog-original-title { margin-top: 6px !important; }
  .catalog-actions, .book-download-actions { gap: 14px !important; }
  .catalog-actions a, .book-download-actions a, .ifimes-open {
    display: inline-flex; align-items: center; justify-content: center;
    min-height: 48px; padding: 12px 14px; font-size: 16px; line-height: 1.5;
    white-space: normal; overflow-wrap: anywhere; text-align: center;
  }
  footer.footer { padding-bottom: 32px !important; }
  .bk-footer-top { margin: 32px auto 0; }
}
@media (max-width: 600px) {
  .catalog-actions, .book-download-actions { display: grid !important; grid-template-columns: minmax(0, 1fr); }
  .catalog-actions a, .book-download-actions a { width: 100%; }
}
@media (max-width: 360px) {
  .chapter-nav { grid-template-columns: minmax(0, 1fr) !important; }
  .bk-mobile-nav .top-nav { padding-left: 12px !important; padding-right: 12px !important; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto !important; }
  .bk-back-top, .bk-menu-toggle, .top-nav .links a { transition: none !important; }
}

/* Normal-flow test notice; cannot cover the menu, content, or CAPTCHA. */
.bk-test-site-notice {
  position: static; box-sizing: border-box; margin: 0; padding: 10px 16px;
  border-bottom: 1px solid #d2a14c; background: #fff4d4; color: #10223e;
  font: 700 16px/1.5 Arial, sans-serif; text-align: center; overflow-wrap: anywhere;
}

/* On a single column, every story starts with its number and heading.
   Match the reverse-story selectors so their old order: initial cannot win. */
@media (max-width: 780px) {
  .story .story-copy { order: 1; }
  .story .story-visual { order: 2; }
}

