/* FF 5.2.11 — restrained refinement on top of the original v5.2.10.
 * DOES NOT change any column widths, grid order, background palette, display,
 * position, sticky behaviors, DOM placement, or JS-managed player controls.
 * Theme-level additions only. */

/* Consistent keyboard navigation, including language links and library tools. */
.ff-header a:focus-visible,
.ff-footer a:focus-visible,
.ff-shell a:focus-visible,
.ff-shell button:focus-visible,
.ff-shell input:focus-visible,
.ff-shell select:focus-visible,
.ff-languages--inline a:focus-visible,
.ff-v526-nav a:focus-visible,
.ff-v528-finder a:focus-visible,
.ff-v528-finder button:focus-visible {
  outline: 2px solid #f0cf83;
  outline-offset: 3px;
}

/* Protect navigation and source links against very long titles and URLs. */
.ff-article-main .wp-block-post-content a,
.ff-article-main .wp-block-post-content cite,
.ff-article-main .wp-block-post-content li,
.ff-archive-query .wp-block-post-title,
.ff-category .ff-category-main .wp-block-post-title {
  overflow-wrap: break-word;
}

/* Research text: give inline source links a discoverable underline without
 * touching cards, buttons, navigation, or interactive chapter headings. */
.ff-reading-surface .wp-block-post-content p a:not(.ff-button),
.ff-reading-surface .wp-block-post-content li a:not(.ff-button) {
  text-decoration-thickness: 1px;
  text-underline-offset: .18em;
}
.ff-reading-surface .wp-block-post-content p a:not(.ff-button):hover,
.ff-reading-surface .wp-block-post-content li a:not(.ff-button):hover {
  text-decoration-thickness: 2px;
}

/* Preserve original typefaces and sizes; improve readability for long articles. */
.ff-reading-surface .wp-block-post-content p,
.ff-reading-surface .wp-block-post-content li {
  text-wrap: pretty;
}
.ff-reading-surface .wp-block-post-content h2,
.ff-reading-surface .wp-block-post-content h3,
.ff-reading-surface .wp-block-post-content h4 {
  scroll-margin-top: 130px;
}

/* Tables and code must scroll inside the reader, never widen its column. */
.ff-reading-surface .wp-block-post-content figure.wp-block-table {
  max-width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
}
.ff-reading-surface .wp-block-post-content pre.wp-block-code,
.ff-reading-surface .wp-block-post-content pre:not([class]) {
  max-width: 100%;
  overflow-x: auto;
}

/* More legible category copy over photographic topic images. Keep original
 * photo assets and their gradients; no overlay or grid changes. */
.ff-topic-grid > a .ff-topic-copy strong {
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}
.ff-topic-grid > a .ff-topic-copy small {
  color: #f3eee2;
  text-shadow: 0 1px 5px rgba(0, 0, 0, .85);
}

/* Hover states: understated and on-brand, no element movement or resizing. */
.ff-archive-query .wp-block-post-title a:hover,
.ff-archive-query .wp-block-post-title a:focus-visible,
.ff-reading-rail .ff-toc a:hover,
.ff-reading-rail .ff-toc a:focus-visible {
  color: #f0cf83;
}

/* Better reading hint in tight portrait/mobile space. */
@media (max-width: 782px) {
  .ff-reading-surface .wp-block-post-content h2,
  .ff-reading-surface .wp-block-post-content h3,
  .ff-reading-surface .wp-block-post-content h4 { scroll-margin-top: 90px; }
}

@media (prefers-reduced-motion: reduce) {
  .ff-topic-grid > a,
  .ff-archive-query a { scroll-behavior: auto; }
}
