/* Page-specific tweaks not covered by Bootstrap utility classes. */

.sidebar {
    height: 100vh;
    overflow-y: auto;
    position: sticky;
    top: 0;
    border-right: 1px solid var(--bs-border-color);
}

.sidebar h6 {
    letter-spacing: .05em;
}

/* Bootstrap's default nav-pills active state is bg-primary (this theme's
   dark red/orange) -- reads as jarring on a selected sidebar entry against
   the same reddish-brown page background. subtle-warning (gold/amber) is
   the "selected" accent used elsewhere for Warhammer-flavor gold, so pills
   pick that up instead, for both the Units/Gear/Magic sidebar accordion
   and the plain nav-pills sidebar on the read-only unit browser. */
.nav-pills .nav-link.active,
.nav-pills .show > .nav-link {
    background-color: var(--bs-warning-bg-subtle);
    color: var(--bs-warning-text-emphasis);
}

.list-group-item.list-group-item-action {
    background-color: var(--bs-secondary-bg);
    border-color: var(--bs-border-color);
    color: var(--bs-body-color);
}

.list-group-item.list-group-item-action:hover,
.list-group-item.list-group-item-action:focus {
    background-color: var(--bs-tertiary-bg);
    color: var(--bs-emphasis-color);
}

.modal-content {
    background-color: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

table.stat-block th,
table.stat-block td {
    vertical-align: middle;
}

/* render_roster_stat_table()'s <table> deliberately skips Bootstrap's
   table-bordered class -- its trailing action column needs to have no
   vertical border at all, and table-bordered's grid can't be selectively
   stripped from just one column after the fact (border-collapse conflict
   resolution always keeps the WIDER of two conflicting borders, so a
   cell-level override, even !important, can never beat a border the row/
   table already put there). Plain .table already gives exactly what's
   wanted here without a fight: a horizontal rule under each row and no
   vertical lines at all, like a stack of <hr>s. The stat columns (M/WS/
   BS/S/T/W/I/A/Ld) and the trailing action column are fixed to the same
   width so they still read as a lined-up grid despite having no vertical
   borders to anchor them. */
table.roster-stat-table th:not(:first-child),
table.roster-stat-table td:not(:first-child) {
    width: 2.25em;
}

/* Ogre Kingdoms' Maneaters "Been There, Done That" per-model Rule dropdown
   (render_roster_stat_table()'s own $renderBttdtDropdown closure) needs
   room for text like "Multiple Wounds (D3)" -- the blanket 2.25em rule
   above (correct for the single-letter stat columns) squeezed it down to
   just its own chevron, with the selected option's text clipped to
   invisible. Same specificity as that rule (0,2,2 either way -- one
   element + one class swapped for another), so source order alone is what
   makes this win; placed immediately after on purpose. */
table.roster-stat-table th.roster-bttdt-rule-col,
table.roster-stat-table td.roster-bttdt-rule-col {
    width: auto;
    min-width: 11em;
}

/* Reset a <button> back to looking like the .card it's styled as, so the
   whole unit-summary/gear-summary card can be the click target instead of
   just its title. */
button.unit-summary-card,
button.gear-summary-card {
    display: block;
    width: 100%;
    text-align: left;
    color: inherit;
    background-color: var(--bs-secondary-bg);
    cursor: pointer;
}

button.unit-summary-card:hover,
button.unit-summary-card:focus-visible,
button.gear-summary-card:hover,
button.gear-summary-card:focus-visible {
    border-color: var(--bs-primary);
}
