.translation-menu-item {
    color: black !important;
    font-weight: bolder !important;
    background-color: rgb(255, 230, 0);
}

.no-hover {
    pointer-events: none;
}

/* The rich table (TypedTableBlock) uses row 0 as its header, so the native column heading
   input is made non-editable and borderless — it reads as a plain "Column" label (see the
   placeholder set in the headings JS) while editors type the real header into row 0. */
.typed-table-block th input.column-heading {
    pointer-events: none;
    background: transparent;
    color: var(--w-color-text-placeholder);
    cursor: default;
    border: none;
    box-shadow: none;
}

/* Hide the native caption field entirely (label + input). It's a direct-child
   .w-field__wrapper of the block; the table lives in .typed-table-block__wrapper and cell
   fields are nested inside <td>, so this only matches the caption. Its value still submits
   (empty) while hidden. */
.typed-table-block > .w-field__wrapper {
    display: none;
}

/* Line the per-cell style_hint field up with the cell's rich text on both edges. Wagtail
   indents the Draftail field 2.25rem on the left; the plain char field also gets a 2rem
   right padding for its comment button, which the Draftail field (inline comments) does
   not — so match the left indent and drop the right padding + comment button so the two
   boxes are the same width. The .w-field compound selector outranks the vendor
   .w-field--commentable rule regardless of stylesheet order. */
.typed-table-block .w-field.rich-table-style-hint {
    padding-inline-start: 2.25rem;
    padding-inline-end: 0;
}

.typed-table-block .rich-table-style-hint .w-field__comment-button {
    display: none;
}

/* Hide the read-only translation-id field inside table cells — it's just a distraction and
   its value still submits while display:none. Client-rendered blocks key the field by
   data-contentpath rather than the block classname. */
.typed-table-block [data-contentpath="id"] {
    display: none;
}

/* Cap the rich table at the width of the surrounding fields: as soon as the table is
   wider than that, the wrapper's overflow-x:auto (from the base widget) shows a
   horizontal scrollbar within the block, instead of stretching it past the other inputs
   and pushing the row/column controls off-screen. min-width:0 stops the cells' intrinsic
   20rem min-width from forcing the block wider than its column. */
/* The resize bar and the field-width cap live on the block (the widget root), NOT on the
   inner __wrapper. The wrapper is the horizontal scroll container; anchoring the handle to
   it made the handle scroll away to the left when the table was scrolled. The block is not
   a scroll container, so the handle stays pinned to the right edge while the table scrolls
   inside. The wrapper simply follows the block's width. */
.typed-table-block {
    min-width: 0;
    position: relative;
    max-width: 100%;
}

/* A session-only resize bar on the right edge of the rich table. The editor can drag the
   table wider to see more columns while working; it always starts at the field-aligned
   width above and is NOT persisted, so a refresh reverts to that width (the JS never
   stores or restores a width — that stale-width behaviour previously hid the controls). */
.typed-table-resize-handle {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    z-index: 81;
    background: var(--w-color-border-furniture);
    opacity: 0.4;
}

.typed-table-resize-handle:hover,
.typed-table-resize-handle:active {
    opacity: 1;
}

/* Keep the rich-text toolbar unpinned within rich table cells. Wagtail's pin toggle is a
   single global preference, so when it's pinned every cell would dock a toolbar bar and
   clutter the grid. Here we scope tables back to an unpinned feel: reveal the pinned
   toolbar only for the cell currently being edited. (When the global preference is already
   unpinned there is no --pin toolbar, so these rules simply don't apply.) */
.typed-table-block td .Draftail-Toolbar--pin {
    display: none;
}

.typed-table-block td .Draftail-Editor--focus .Draftail-Toolbar--pin {
    display: flex;
}

.hidden {
    display: none;
}

.sidebar:has(form) form[role="search"]:not(.search-form) {
    display: none;
}

span.select2-dropdown {
    background-color: inherit !important;
}

span.select2-selection,
span.select2-selection--multiple {
    background-color: inherit !important;
}

li.select2-selection__choice {
    background-color: var(--w-color-surface-button-default) !important;
    color: var(--w-color-text-button) !important;
}

li.select2-results__option {
    background-color: var(--w-color-surface-page) !important;
}

li.select2-results__option--highlighted {
    background-color: var(--w-color-surface-button-hover) !important;
}

/* ── Languages checkbox grid ───────────────────────────────────── */

#id_requested_languages,
#id_languages {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 0.15rem 1.5rem;
}

#id_requested_languages > div,
#id_languages > div {
  min-width: 0;
}

#id_requested_languages label,
#id_languages label {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.25rem 0.35rem;
  border-radius: 4px;
  font-size: 0.85rem;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.1s ease;
}

#id_requested_languages label:hover,
#id_languages label:hover {
  background-color: #f1f5f9;
}

#id_requested_languages input[type="checkbox"],
#id_languages input[type="checkbox"] {
  flex-shrink: 0;
}

.w-theme-dark #id_requested_languages label:hover,
.w-theme-dark #id_languages label:hover {
  background-color: #efefef;
  color: #222;
}

@media (prefers-color-scheme: dark) {
  .w-theme-system #id_requested_languages label:hover,
  .w-theme-system #id_languages label:hover {
    background-color: #efefef;
    color: #222;
  }
}
