html {
    position: relative;
    min-height: 100%;
}
body { margin-bottom: 60px; }
header, footer { overflow: hidden; }

/* Font sizing */
html { font-size: 14px; }
@media (min-width: 768px) {
    html { font-size: 16px; }
}

/* Highlight focused form fields */
.btn:focus, .btn:active:focus,
.btn-link.nav-link:focus,
.form-control:focus, .form-check-input:focus {
    box-shadow: 0 0 0 0.1rem white, 0 0 0 0.25rem #258cfb;
}

/* Allow some elements in the footer to wrap */
.footer .wrappable {
    white-space: normal;
    line-height: var(--bs-body-line-height);
    align-content: center;
}

/* More compact form labels */
.form-label { margin-bottom: 0; }

/* Use muted color for placeholder options */
.option-placeholder { color: var(--bs-secondary-color); }

/* Fix pagination padding */
.row > .table-responsive {
    padding: 0;
    margin-right: calc(var(--bs-gutter-x) * 0.5);
    margin-left: calc(var(--bs-gutter-x) * 0.5);
    max-width: calc(100% - var(--bs-gutter-x));
}

/* Loading indicators styling */
.htmx-indicator {
    height: 2rem;
    width: 2rem;
    border-radius: 100%;
    border-style: solid;
    border-width: 4px;
    border-color: var(--bs-secondary);
    border-top-color: transparent;
    animation: spin 2s linear infinite;  
}
@keyframes spin {
    from { transform: rotate(0deg); }
    to { transform: rotate(360deg); }
}

/* Loading indicators positioning */
#search-container { position: relative; }
#search-results > .htmx-indicator {
    position: absolute;
    top: .75rem;
    right: 1rem;
}
#result-count > .col-auto { position: relative; }
#result-count .htmx-indicator {
    position: absolute;
    top: .125rem;
    left: -2rem;
}
#contact-form .htmx-indicator { display: inline-block; }

/* Heading sizing */
#search-container h1#result-count, h3.manual-subheading { font-size: 1.1rem; }
#search-container h2, #document-view h1, h2.manual-subheading { font-size: 1.2rem; }
h2.manual-subheading { margin-top: 3rem; }
h3.manual-subheading { margin-top: 2rem; }

/* Use darker borders when a light card is nested in a dark card */
.bg-body-secondary .card,
.bg-body-secondary .pagination .page-link,
.bg-body-secondary .input-group-text,
.bg-body-secondary .form-control {
    border-color: #9EAABC;
}

/* Use a different color than the background it sits on */
.pagination { --bs-pagination-disabled-bg: var(--bs-tertiary-bg); }

/* Fix "Clear Filters" button always appearing activated */
.btn.show:not(:hover) {
    color: var(--bs-btn-color);
    background-color: var(--bs-btn-bg);
    border-color: var(--bs-btn-border-color);
}

/* PDF thumbnails */
.pdf-thumbnail { height: fit-content; }
.pdf-thumbnail > img {
    max-height: 175px;
    max-width: 175px;
}

/* Figure (image) styling */
figure { text-align: end; }
figcaption {
    color: var(--bs-secondary-color) !important;
    font-size: .95rem;
    margin-top: .25rem;
}