/* explore's own looks, in the application shell through layout.head.css:
 * the header search, which every page shows, and the explore page.
 * Bootstrap 5.2 draws the rest.
 */

/* ── Header search ──────────────────────────────────────────────────────── */

/* A box in view, its magnifier inside it, and the list of matches under
   it, as wide as the box at least. */
.header-search {
    position: relative;
    width: 100%;
    max-width: 26rem;
}

.header-search-field {
    position: relative;
}

.header-search-field .form-control {
    padding-left: 2.5rem;
    padding-right: 2.5rem;
}

.header-search-glyph {
    position: absolute;
    top: 50%;
    left: 0.85rem;
    transform: translateY(-50%);
    color: var(--bs-secondary-color, #6c757d);
    pointer-events: none;
}

.header-search-spinner {
    position: absolute;
    top: 50%;
    right: 0.85rem;
    margin-top: -0.5rem;
}

.header-search-menu {
    top: calc(100% + 0.35rem);
    left: 0;
    width: 100%;
    min-width: 20rem;
    max-width: calc(100vw - 2rem);
}

/* The results scroll on their own, under a box that stays in place. */
.header-search-results {
    max-height: 21rem;
    overflow-y: auto;
}

.header-search .dropdown-item {
    border-radius: 0.25rem;
    white-space: normal;
}

/* Lets the title and the subtitle of a row be cut short with an ellipsis. */
.header-search-text {
    min-width: 0;
}

.header-search-icon {
    display: inline-flex;
    flex-shrink: 0;
    align-items: center;
    justify-content: center;
    width: 2.25rem;
    height: 2.25rem;
    border-radius: 0.375rem;
    background: var(--bs-tertiary-bg, #f8f9fa);
    color: var(--bs-primary);
}

/* ── Explore page ───────────────────────────────────────────────────────── */

.filter-spacing {
    margin-bottom: 1.75rem !important;
}

/* On a wide screen the filters stay in view as the results scroll, and
   scroll on their own when they are longer than the window. */
@media (min-width: 992px) {
    .explore-filters {
        position: sticky;
        top: 85px;
        max-height: calc(100vh - 110px);
        overflow-y: auto;
    }
}

.explore fieldset legend {
    font-weight: 500;
}

.explore-sort {
    min-width: 10rem;
}

/* The filters in force, each a button that removes it. */
.explore-chip {
    display: inline-flex;
    align-items: baseline;
    gap: 0.35rem;
    border: 1px solid var(--bs-border-color, #dee2e6);
}

.explore-authors {
    font-size: 0.85rem;
}

.explore-authors li {
    line-height: 1.2;
}

.filter-sublabel {
    margin-bottom: 0.03rem !important;
}

.filter-main-label {
    margin-bottom: 0.05rem !important;
}

/* The icons of a result card, as small as its text. AdminKit sizes every
   feather icon at 18px, so the rule names both classes. */
.feather.explore-icon {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
}

.feather.explore-empty-icon {
    width: 3rem;
    height: 3rem;
}

.explore-result-button {
    font-size: 0.75rem;
}

/* Lets the DOI of a card be cut short instead of pushing its buttons out. */
.explore-doi {
    min-width: 0;
}

/* ORCID's iD in its own green, as ORCID's brand guidelines ask. */
.orcid-icon {
    color: #a6ce39;
}

/* ── The filters' groups ────────────────────────────────────────────────── */

/* Each group folds under its heading, a details element: the page opens
   the first and those with a choice made, the reader the others. */
.explore-group {
    border-top: 1px solid var(--hub-border-color, #f1f1f4);
    padding: 0.75rem 0;
}

.explore-group:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.explore-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: pointer;
    font-size: 0.8rem;
    font-weight: 600;
    letter-spacing: 0.04em;
    text-transform: uppercase;
    color: var(--hub-text-muted, #646c82);
    list-style: none;
}

.explore-group-title::-webkit-details-marker {
    display: none;
}

/* A chevron that turns as the group opens. */
.explore-group-title::after {
    content: "";
    width: 0.45rem;
    height: 0.45rem;
    border-right: 2px solid currentColor;
    border-bottom: 2px solid currentColor;
    transform: rotate(45deg);
    transition: transform 0.15s ease;
    margin-right: 0.2rem;
}

.explore-group[open] > .explore-group-title::after {
    transform: rotate(-135deg);
}

.explore-group-body {
    padding-top: 0.75rem;
}

/* The least and most there are, offered in a range's empty boxes: a hint
   in grey, never mistaken for a value typed. */
.explore-facet input::placeholder {
    color: var(--hub-gray-500, #99a1b7);
    opacity: 1;
}
