/* Accessibility utilities.
   The per-video pause button that used to live here was retired once the
   accessibility toolbar shipped: its "Stop animation" toggle pauses every
   video on the page and persists the choice, so a second control on each hero
   was redundant (2.2.2 is still met by the toolbar). */

/* 2.5.8 Target Size (Minimum).
   The header menu links render 27px tall, of which adjacent elements obscure
   about 5px, leaving 22px — just under the 24px floor. Three more pixels top
   and bottom clears it with room to spare.
   GenerateBlocks emits its own per-menu rule at the same specificity, so this
   needs the extra class to win regardless of stylesheet order. */
.gb-navigation .gb-menu .gb-menu-link,
.gb-navigation .gb-menu > li > .gb-menu-link {
  padding-top: 16px;
  padding-bottom: 16px;
}

/* Ktunaxa spans are language markup only — they must not restyle the copy. */
span[lang="kut"] {
  font: inherit;
  color: inherit;
}

/* Wide data tables scroll inside their own figure instead of widening the
   page. a11y.js marks the figure focusable when it actually scrolls, so the
   region is reachable by keyboard (2.1.1). */
.wp-block-table {
  max-width: 100%;
  overflow-x: auto;
}

.wp-block-table:focus-visible {
  outline: 3px solid var(--contrast);
  outline-offset: 2px;
}

/* 2.4.7 Focus Visible — a baseline ring for anything the theme or a plugin
   forgot. Deliberately a bare :focus-visible (specificity 0,1,0) so the
   purpose-built rings elsewhere in the theme still win. The white halo keeps
   the ring legible on the dark sections as well as the light ones. */
:focus-visible {
  outline: 3px solid var(--contrast, #016778);
  outline-offset: 2px;
  box-shadow: 0 0 0 5px rgba(255, 255, 255, 0.85);
}

/* 2.4.11 Focus Not Obscured — the notices bar is fixed to the bottom and the
   navigation sticks to the top, so scrolling a focused control into view can
   park it underneath one of them. Reserve room on both edges. */
:focus-visible,
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus,
[tabindex]:focus {
  scroll-margin-top: 190px;
  scroll-margin-bottom: 110px;
}

/* Maintain AA text contrast on these four existing filled-link hover states.
   The explicit selectors beat inherited section link colours as well as
   legacy block CSS. Default content, layout and focus rings stay intact. */
a.gb-text.gb-text-amen031:hover,
a.gb-text.gb-text-dev005:hover,
a.gb-text.gb-text-ktnx019:hover,
a.gb-text.gb-text-tmap017:hover {
  background-color: var(--darkblue);
  color: var(--base-3);
}

/* Named language choices remain readable and reachable in a narrow viewport. */
.genex-translation-panel.tool-container {
  background: var(--base-3);
  border: 2px solid var(--darkblue);
  border-radius: 4px;
  box-sizing: border-box;
  height: auto;
  max-height: calc(100dvh - 140px);
  max-width: calc(100vw - 40px);
  overflow-y: auto;
  padding: 8px;
  width: 480px;
}
.genex-translation-panel .tool-items {
  display: grid;
  grid-template-columns: repeat(3,minmax(0,1fr));
}
.genex-translation-panel.tool-container .tool-items a.tool-item {
  align-items: center;
  background-image: none !important;
  border-radius: 2px;
  box-sizing: border-box;
  color: var(--darkblue);
  display: flex;
  float: none;
  font-size: 14px;
  gap: 8px;
  height: auto !important;
  line-height: 1.4;
  min-height: 40px;
  padding: 8px !important;
  text-align: left;
  text-decoration: underline;
  width: auto !important;
  overflow-wrap: anywhere;
}
.genex-translation-panel a.tool-item:hover,
.genex-translation-panel a.tool-item:focus-visible {
  background-color: var(--base-2);
  color: var(--darkblue);
}
@media(max-width:480px) {
  .genex-translation-panel .tool-items {
    grid-template-columns: repeat(2,minmax(0,1fr));
  }
}

.genex-translation-panel .genex-language-flag {
  background-repeat: no-repeat;
  display: inline-block;
  flex-shrink: 0;
}
