/* Styles needed by the visualisations ported to Infusion 6 - see src/client/js/i6. Restricted to CSS of the
   Baseline "Widely available" profile */

/* The element of a tooltip placed by hortis.withTooltip - Popper supplies its position, replacing jQuery UI's tooltip */
.imerss-tooltip-holder {
    z-index: 1000;
    max-width: 360px;
    padding: 6px 8px;
    background: #fff;
    color: #222;
    border: 1px solid #aaa;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
    font-size: 14px;
    line-height: 1.35;
    /* The tooltip follows the pointer, so must not intercept the events which drive it */
    pointer-events: none;
}

/* The tooltip of an element's title, shown by hortis.titleTooltips - a title may be broken over lines */
.imerss-title-tooltip {
    white-space: pre-line;
}

.imerss-tooltip-holder[hidden] {
    display: none;
}

/* The marker of an individual observation, shown by hortis.libreMap.withObsGrid in place of the grid once few
   observations are in view. It fades in and out over hortis.libreMap.markerFadeDuration. The colours may be overridden
   on any element enclosing the map */
.imerss-obs-marker {
    cursor: pointer;
}

.imerss-obs-marker .imerss-obs-marker-pin {
    display: block;
    opacity: 0;
    transition: opacity 0.4s ease;
    filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.4));
}

.imerss-obs-marker.imerss-obs-marker-visible .imerss-obs-marker-pin {
    opacity: 1;
}

.imerss-obs-marker .imerss-obs-marker-pin path {
    fill: var(--imerss-obs-marker-colour, #74ac00);
    stroke: var(--imerss-obs-marker-stroke, #fff);
    stroke-width: 1.5px;
}

.imerss-obs-marker .imerss-obs-marker-pin circle {
    fill: var(--imerss-obs-marker-centre, #fff);
}

.imerss-obs-marker.imerss-obs-marker-selected .imerss-obs-marker-pin path {
    fill: var(--imerss-obs-marker-selected-colour, #d4380d);
}

/* A tooltip which stays put for the pointer to cross to, e.g. to follow a link within it */
.imerss-tooltip-holder.imerss-tooltip-interactive {
    pointer-events: auto;
}

.imerss-obs-tooltip .imerss-obs-tooltip-link {
    margin-top: 4px;
}

.imerss-obs-tooltip .imerss-obs-tooltip-link a {
    color: #0b6e99;
    text-decoration: underline;
}

.imerss-obs-tooltip .imerss-obs-tooltip-taxon {
    font-style: italic;
    font-weight: 600;
}

/* Formerly supplied by Infusion 4's fluid.css, on which the port no longer depends */
.fl-hidden {
    display: none !important;
}

/* Once loaded, the loading indicator fades and then ceases to intercept the pointer - it remains in the markup, since
   it is part of the template of hortis.beaVizLoader rather than removed by script */
.bee-loading-container-hidden {
    visibility: hidden;
    pointer-events: none;
    transition: opacity 1s ease-in, visibility 0s 1s;
}

/* A panel of hortis.pageTabs which is not selected - jQuery UI's own styles show every panel */
.ui-tabs .ui-tabs-panel[hidden] {
    display: none;
}

/* The dual range input of hortis-dualRangeInput.vue - its detents are marked on a scale above its track, whose spaces
   between them may be labelled, and the values chosen may be shown beneath its thumbs, following them as they are
   slid */
.dual-range-holder {
    position: relative;
    container: dual-range / inline-size;
    /* The width of a thumb, as the dual range input's stylesheet defines it on the input itself - defined here too, so
       that the scale and the thumbs' labels, which lie beside the input rather than within it, are laid out by it */
    --dri-thumb-width: 1.25rem;
}

/* The inputs are laid out to fill the track exactly - see DualRangeInput.update - rather than within the end padding
   allowed them by the dual range input's stylesheet. They may be separated by a gap less than a step wide, which lies
   between the thumbs, and so shows the filled track beneath them - which spans only the track between the centres of
   the thumbs at its ends, so that none shows beyond a thumb at either end, e.g. at the rounded ends of the tracks */
.dual-range-holder .dual-range-input {
    padding-inline-end: 0;
    background: linear-gradient(var(--dri-track-filled-color), var(--dri-track-filled-color)) center /
        calc(100% - var(--dri-thumb-width)) var(--dri-track-height) no-repeat;
}

/* The scale spans the track between the centres of the thumbs at its ends */
.dual-range-scale {
    position: relative;
    height: 6px;
    margin: 0 calc(var(--dri-thumb-width) / 2);
}

.dual-range-scale.dual-range-scale-labelled {
    height: 14px;
}

/* Each tick is drawn by its border, which is drawn a whole number of device pixels wide at any zoom, so that all are
   drawn alike - centred on its value, the first at the left end of the scale and the last at its right */
.dual-range-tick {
    position: absolute;
    bottom: 0;
    height: 6px;
    width: 0;
    margin-left: -0.5px;
    border-left: 1px solid var(--dri-tick-color, #999);
}

.dual-range-tick-label {
    position: absolute;
    bottom: 3px;
    transform: translateX(-50%);
    font-size: 9px;
    line-height: 1;
    color: var(--dri-tick-label-color, #666);
    white-space: nowrap;
    pointer-events: none;
}

/* The months' first three letters if the input is wide enough to hold them, otherwise their first letters */
.dual-range-tick-label-long {
    display: none;
}

@container dual-range (min-width: 300px) {
    .dual-range-tick-label-long {
        display: inline;
    }

    .dual-range-tick-label-short {
        display: none;
    }
}

.dual-range-disabled .dual-range-input input {
    cursor: not-allowed;
}

.dual-range-thumb-labels {
    display: none;
    position: relative;
    height: 1.4em;
    margin: 2px calc(var(--dri-thumb-width) / 2) 0;
    font-size: 12px;
    font-variant-numeric: tabular-nums;
}

.dual-range-thumb-labels.dual-range-thumb-labels-shown {
    display: block;
}

/* Each label is centred beneath its thumb, at --dri-thumb-pos, the percentage of the range at which its value lies.
   Every value lies, beneath the centre of a thumb set to it, at that percentage of the way along this row - which, as
   the scale is, is inset by half a thumb width at each end - see DualRangeInput.update */
.dual-range-thumb-label {
    position: absolute;
    white-space: nowrap;
    transform: translateX(-50%);
    left: calc(var(--dri-thumb-pos) * 1%);
}
