@font-face {
    font-family: "Source Code Pro";
    src: url("./SourceCodePro-Regular.woff2") format("woff2");
    font-style: normal;
    font-weight: 400;
    font-display: swap;
}

.ibkv-header {
    background-color: #e4edf1;
}

.ibkv-logo {
    min-width: 0;
    max-width: 50%;
}

.ibkv-menu-top {
    min-height: 42px;
}

.ibkv-menu {
    font-family: "Source Code Pro", monospace;
    overflow-wrap: anywhere;
}

main h2.h3 {
    font-size: 1.25rem;
}

main h2.h4,
main h2.h5,
main h3.h4 {
    font-size: 1.125rem;
}

@media (min-width: 576px) {
    /* Keep centered containers aligned when only one page needs a vertical scrollbar. */
    .ibkv-header > .container,
    main#main-content {
        position: relative;
        inset-inline-start: calc((100vw - 100%) / 2);
    }
}

.ibkv-menu a {
    color: inherit;
    text-decoration: none;
}

.ibkv-menu a:hover,
.ibkv-menu a:focus-visible {
    color: var(--bs-link-hover-color);
}

.ibkv-menu [aria-current] {
    color: var(--bs-emphasis-color);
    text-decoration-line: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: .2em;
}

.ibkv-tabs > a {
    padding: 1rem 1rem .5rem;
    border-radius: 0 0 2px 2px;
    background-color: #3a73a6;
    color: #fff;
}

.ibkv-tabs > a:hover,
.ibkv-tabs > a:focus-visible {
    background-color: #4079ad;
    color: #fff;
}

/* The negative margin keeps the header height identical on pages without a selected tab. */
.ibkv-tabs > a[aria-current] {
    padding-bottom: 1.5rem;
    margin-bottom: -1rem;
    background-color: #0f2d4a;
    color: #fff;
    text-decoration-line: none;
}

/* Starts below the tab labels, which are inset by the tab padding. */
.ibkv-breadcrumbs {
    padding-inline-start: 1rem;
}

.ibkv-breadcrumb-marker {
    color: #2a5f8f;
    font-weight: 700;
}

.ibkv-results > #ibkv-result-map {
    display: flex;
    flex-direction: column;
    height: 70vh;
    height: 70dvh;
}
.ibkv-results > #ibkv-result-map > #ibkv-map-consent,
.ibkv-results > #ibkv-result-map > #ibkv-map-container {
    flex: 1 1 auto;
    min-height: 0;
}
.ibkv-view-toggle {
    position: sticky;
    bottom: 1rem;
    z-index: 5;
    margin-top: 1.5rem;
    text-align: center;
    pointer-events: none;
}
.ibkv-view-toggle > button {
    pointer-events: auto;
}

.ibkv-results:has(> #ibkv-result-map:not([hidden])) #directory-entries > * {
    width: 100%;
}

@media (max-width: 991.98px) {
    .ibkv-results:not([data-ibkv-view=map]) > #ibkv-result-map,
    .ibkv-results[data-ibkv-view=map] > .ibkv-results-list {
        display: none;
    }
}

@media (min-width: 992px) {
    .ibkv-results:has(> #ibkv-result-map:not([hidden])) {
        display: grid;
        grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
        column-gap: 1.5rem;
        align-items: start;
    }
    .ibkv-results > #ibkv-result-map {
        position: sticky;
        top: 1rem;
        height: calc(100vh - 2rem);
        height: calc(100dvh - 2rem);
    }
}

.ibkv-query-control {
    position: relative;
    flex: 1 1 0;
    min-width: 0;
}
.ibkv-query-control > input {
    padding-inline-end: 2.5rem;
}
.ibkv-history-toggle {
    position: absolute;
    inset: 1px 1px 1px auto;
    width: 2.25rem;
    border: 0;
    border-radius: 0 var(--bs-border-radius) var(--bs-border-radius) 0;
    background: var(--bs-body-bg);
    color: var(--bs-secondary-color);
}
.ibkv-history-toggle:hover, .ibkv-history-toggle:focus-visible {
    color: var(--bs-primary);
    background: var(--bs-tertiary-bg);
}
.ibkv-history-menu {
    top: calc(100% + .5rem);
    inset-inline-start: 0;
    width: 100%;
    min-width: min(20rem, calc(100vw - 3rem));
}
#ibkv-history-options {
    max-height: 15rem;
    overflow-y: auto;
}
#ibkv-history-options [role=option] { cursor: pointer; }
#ibkv-history-options .dropdown-item { white-space: normal; }

@media (min-width: 768px) {
    #main-content > .mx-auto {
        max-width: min(92%, 68rem);
    }
}
#main-content > .mx-auto.text-center {
    max-width: 42rem;
}
.directory-preview-pills {
    max-width: 52rem;
}
.directory-more-link-row > a {
    max-width: 22rem;
    text-align: center;
    text-wrap: balance;
}
.tag-description-card > p.text-body-secondary,
[data-ibkv-description] {
    white-space: pre-line;
}

/* Own column next to the text: seal on top, video below; the video moves up when there is no seal. */
.ibkv-result-aside {
    flex: 0 0 clamp(4rem, 25%, 7.5rem);
    display: flex;
    flex-direction: column;
    gap: .75rem;
    margin-top: -2rem;
}
.ibkv-result-seal img {
    display: block;
    width: 100%;
    height: auto;
    box-shadow: 0 0 2px #4d4d4d;
}

.ibkv-video-teaser {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    padding: 0;
    border: 0;
    border-radius: 2px;
    overflow: hidden;
    background: #1f4e79;
    cursor: pointer;
}
.ibkv-video-teaser img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.ibkv-video-play {
    position: absolute;
    inset: 50% auto auto 50%;
    width: 1.75rem;
    height: 1.75rem;
    translate: -50% -50%;
    border-radius: 50%;
    background: rgb(0 0 0 / .55);
}
.ibkv-video-play::before {
    content: "";
    position: absolute;
    inset: 0;
    margin: auto;
    width: .6rem;
    height: .7rem;
    translate: .08rem 0;
    background: #fff;
    clip-path: polygon(0 0, 100% 50%, 0 100%);
}
.ibkv-video-teaser:hover .ibkv-video-play,
.ibkv-video-teaser:focus-visible .ibkv-video-play {
    background: rgb(0 0 0 / .75);
}

.ibkv-player {
    width: min(100vw - 2rem, 64rem);
    max-width: none;
    max-height: calc(100dvh - 2rem);
    padding: 0;
    border: 0;
    border-radius: .5rem;
    background: #fff;
    overflow: auto;
}
.ibkv-player::backdrop {
    background: rgb(10 20 30 / .85);
}
.ibkv-player-description {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
}
.ibkv-player-video {
    display: block;
    width: 100%;
    max-height: calc(100dvh - 16rem);
    min-height: 12rem;
    background: #000;
}

/* Images keep their aspect ratio at a fixed height; whatever does not fit the card width is cut off.
   Until the client script loads an image, its sized placeholder shows the background. */
.ibkv-highlights {
    display: flex;
    gap: .5rem;
    height: 200px;
    overflow: hidden;
}
.ibkv-highlights img {
    flex: 0 0 auto;
    height: 100%;
    width: auto;
    border-radius: .375rem;
    background: var(--bs-secondary-bg);
}

/* Every page gets the same gap below the header, whatever element it starts with. */
#main-content {
    overflow-wrap: anywhere;
    padding-top: 1rem;
}
@media (min-width: 768px) {
    #main-content {
        padding-top: 2.5rem;
    }
}
#directory-search-options select {
    max-width: 100%;
}
#main-content .badge {
    max-width: 100%;
    white-space: normal;
}
/* A single thin keyboard focus ring replaces Bootstrap's glow, which also appears on mouse clicks. */
:is(.ibkv-header, #main-content) :is(.btn, .form-control, .form-select, .form-check-input, .page-link, .nav-link, .btn-close, .dropdown-item):focus {
    box-shadow: none;
}
:is(.ibkv-header, #main-content) :is(.form-control, .form-select):not(.is-valid, .is-invalid):focus {
    border-color: var(--bs-border-color);
}
.ibkv-header :focus-visible,
#main-content :focus-visible,
#app-footer-bar :focus-visible {
    outline: 2px solid #0a58ca;
    outline-offset: 2px;
}
#main-content .directory-map :focus-visible {
    outline-offset: -2px;
}
/* Headings only receive focus programmatically so screen readers announce them; they are not controls. */
#main-content [tabindex="-1"]:focus,
#main-content:focus {
    outline: 0;
}
.directory-card:focus-within {
    outline: 2px solid #0a58ca;
    outline-offset: 2px;
}
@supports selector(:has(*)) {
    .directory-card:focus-within {
        outline: 0;
    }
    .directory-card:has(.stretched-link:focus-visible) {
        outline: 2px solid #0a58ca;
        outline-offset: 2px;
    }
    #main-content .directory-card .stretched-link:focus-visible {
        outline: 0;
    }
}
#lemniscus-seal .footer-links a {
    display: inline-flex;
    align-items: center;
    min-height: 24px;
}
#directory-tag-cloud .tag-cloud-term--available {
    text-decoration: underline;
}
#directory-tag-cloud .tag-cloud-term--almost-available,
#tag-cloud-explanation .tag-cloud-legend-swatch--almost-available {
    border: 2px dashed currentColor;
}
#ibkv-history-options .dropdown-item.active {
    outline: 2px solid currentColor;
    outline-offset: -3px;
}
@media (forced-colors: active) {
    #ibkv-history-options .dropdown-item.active {
        outline-color: Highlight;
    }
}
