body {
    font-family: Arial, Helvetica, sans-serif;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100vh;
}

@import "https://fonts.googleapis.com/css?family=Open+Sans:300,300i,400,400i,700,700i&display=swap";

table {
    /* Override absolutely insane display:block in hextra core style */
    display: table !important;
}

/** Override another insane tailwind default */
img,
svg,
video,
canvas,
audio,
iframe,
embed,
object {
    display: inline-block;
    vertical-align: unset;
}

:root {
    --bs-body-font-family: "Open Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol";
    /** This only controls the bizarre height calculation for the page **/
    --navbar-height: 12rem;

    font-family: var(--bs-body-font-family)
}

body {
    background-color: #184E62;
    color: #FDF2CE;
}

/** Override absolutely ridiculous tailwind hardcoded content colour **/
main .content h3, main.content h2, main h1 {
    color: #FDF2CE !important;
}

.imerss-main {
    display: flex;
    height: 100%;
}

/** Defeat side matter which screws up layout when page is wide **/
.xl\:hx-block {
    display: none !important;
}

.imerss-page {
    width: 40%;
}

.imerss-navbar-title {
    color: #FDF2CE;
    font-weight: 700;
    font-size: 22px;
    text-transform: uppercase;
    letter-spacing: 0.2rem;
}

.imerss-bg-neutral-50 {
    background-color: #ffffff80;
}

/** Needs to be more specific to beat hextra's abominable theming **/

nav a span {
    color: #dff1f4;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 1px;
}

nav a {
    position: relative;
}

.imerss-navbar-background {
    background: url("../images/imerss-header-cropped.jpg") no-repeat;
    background-size: cover;
    height: 160px;
    width: 100%;
    position: fixed;
}

.imerss-navbar {
    justify-content: space-between;
    display: flex;
    height: 100px;
}

/* Weird trick inherited from docsy for filtering background image */

.imerss-navbar::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #184E6280;
}

.imerss-navbar a, .imerss-subnav a, .imerss-subnav .search-wrapper {
    position: relative;
    z-index: 2;
}

.imerss-navbar img {
    margin-right: 12px;
}

.imerss-navbar span {
    margin-left: 16px;
}

.imerss-subnav {
    color: #dff1f4;
    position: relative;
    font-size: 16px;
}

.imerss-subnav::after {
    content: "";
    position: absolute;
    inset: 0;
    background-color: #184E62b0;
}

/* Fix up wonky height of links inside subnav e.g. GitHub icon */
.imerss-subnav a {
    display: flex;
}

footer {
    color: black;
}

html[class~=dark] footer {
    color: #a8bec8;
}

.imerss-copyright {
    padding: 0.5rem 1rem;
}


h2 {
    margin-block-start: 0px;
}

.main-container h2 {
    margin-bottom: 1.1rem;
    text-align: center;
}

.mxcw-banner {
    font-size: 36px;
}

.mxcw-section-nav {
    display: flex;
    align-items: center;
    padding-bottom: 5px;

    top: 5px;
    width: 100%;
    margin: 0 10px;
    z-index: 200;

    overflow-x: scroll;
    overflow-y: clip;

    flex-shrink: 0;
}

.mxcw-section-nav .mxcw-hidden {
    display: none;
}

.section-left-desc, .section-right-desc {
    white-space: nowrap;
    padding: 0 0.8rem 0 0.8rem;
}

.section-nav-spacer {
    width: 100%
}

.mxcw-container {
    display: flex;
    flex-direction: column;
    height: calc(100vh - 14rem);
    padding: 0 1.5rem;
}

.mxcw-container ::-webkit-scrollbar {
    -webkit-appearance: none;
    width: var(--imerss-scrollbar-width);
    background-color: revert;
}

.mxcw-container ::-webkit-scrollbar-thumb {
    border-radius: 6px;
    background-color: #C1C1C1;
    -webkit-box-shadow: 0 0 1px rgba(255,255,255,.5);
}

.mxcw-container ::-webkit-scrollbar-thumb:hover {
    background-color: #A8A8A8;
}


.mxcw-content {
    overflow: hidden;
}

.mxcw-content a {
    text-decoration: underline;
}

.mxcw-data a {
    text-decoration: underline;
    color: blue;
}

.section.level2 {
    height: 100%;
    flex-direction: column;
}

.mxcw-sectionInner {
    display: flex;
    flex-direction: row;
    width: 100%;
    overflow: hidden;
}

.imerss-region-pane {
    display: flex;
    flex-direction: column;
}

.mxcw-viz-pane {
    display: flex;
    flex-direction: row;
}

.mxcw-sectionColumn {
    width: 50%;
    overflow-y: auto;
    margin-right: 8px;
    padding-right: 8px;
}

.mxcw-sectionColumn.mxcw-vizColumn {
    overflow-y: visible;
    border: solid 1px black;
    padding: 8px 4px 8px 0;
}

@media screen and ( max-width: 620px ) {
    .mxcw-sectionInner {
        flex-direction: column;
        overflow-y: scroll;
    }

    .mxcw-content {
        flex-direction: column;
    }

    .mxcw-viz-pane .imerss-container {
        width: 100%;
        overflow-y: visible;
    }

    .mxcw-sectionColumn {
        width: 100%;
        overflow-y: visible;
    }
}


.mxcw-map-holder {
    display: flex;
    flex-direction: column;
    margin-bottom: 1rem;
    height: 50%;
    transition-property: height;
    transition-duration: 800ms;
    position: relative;
}

.mxcw-content-holder {
    display: flex;
    flex-direction: column;
    height: 40%;
    font-size: 18px;
    padding: 0.5rem 0.5rem 0.5rem 0.5rem;
    align-items: center;
    transition-property: height;
    transition-duration: 800ms;
    position: relative;
    /* TODO hoist this main text colour to a variable */
    color: #eefaff;
}



.chevron-nav {
    display: flex;
    align-items: stretch;
    width: 100%;
}

.chevron-tab {
    position: relative;
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.2rem 24px 0.2rem 18px;
    font-family: 'Barlow Condensed', sans-serif;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    background: #4b778f;
    border: none;
    outline: none;
    margin-right: -18px;
    z-index: 1;
    transition: background 0.15s, color 0.15s;
    clip-path: polygon(
            0 0,
            calc(100% - 18px) 0,
            100% 50%,
            calc(100% - 18px) 100%,
            0 100%,
            18px 50%
    );
}

.chevron-tab:first-child {
    clip-path: polygon(
            0 0,
            calc(100% - 18px) 0,
            100% 50%,
            calc(100% - 18px) 100%,
            0 100%
    );
    padding-left: 1.1rem;
    z-index: 5;
}



.chevron-tab:last-child {
    margin-right: 0;
    clip-path: polygon(
            0 0,
            100% 0,
            100% 100%,
            0 100%,
            18px 50%
    );
    z-index: 1;
}

.chevron-tab:hover {
    background: #6f96a8;
    z-index: 10;
}

.chevron-tab.active {
    background: #9aaeb8;
    z-index: 10;
}

.chevron-tab.active:hover {
    background: #a8bec8;
}


.mxcw-solow-legend .imerss-legend-title {
    font-size: smaller;
    margin-bottom: 4px;
}

.mxcw-taxa-filters-holder {
    background-color: #eefaff;
    padding: 2px 6px;
}

.mxcw-taxa-filters-holder .imerss-filter-body {
    flex-direction: column;
}

.mxcw-taxa-filters-holder .imerss-filters {
    display: flex;
    padding-top: 6px;
    overflow-x: scroll;
}

.mxcw-taxa-filters-holder .imerss-filter {
    display: flex;
    border-right: 1px #ddd solid;
    border-bottom: none;
    padding: 0 8px;
}

.mxcw-solow-taxa {
    height: 100%;
    background-color: #184E62;
    display: flex;
    flex-direction: column;
}

/** Stop the Solow data table having rounded corners since we want to bolt filters onto the top of it **/
.mxcw-solow-taxa .hortis-dataTable-wrap {
    border: none;
    border-radius: 0;
}

.mxcw-solow-radius {
    display: flex;
    height: 100%;
}

.mxcw-solow-widgets-holder {
    display: flex;
    height: 100%;
    width: 100%;
}

.mxcw-solow-taxon-holder {
    width: 60%;
}

.mxcw-solow-radius-holder {
    display: flex;
    width: 40%;
    height: 100%;
}

.mxcw-solow-taxon-pane {
    /** Shared with hortis-dataTable-wrap */
    border: 1px solid var(--data-table-border);
    border-radius: var(--data-table-radius);
    background: var(--data-table-surface);
    padding: 4px 1rem;
    display: flex;
    height: 100%;
    margin-right: 1rem;
}

.mxcw-solow-taxon-pane .mxcw-taxon-image {
    width: 40%;
}

.mxcw-solow-taxon-pane .mxcw-taxon-info {
    width: 60%;
}

.mxcw-solow-taxon-pane .taxonDisplay-image-holder {
    height: 100%;
    font-size: smaller;
    padding: 8px 16px 8px 0;
}

.mxcw-solow-taxon-pane .imerss-photo {
    max-height: 100%;
    border-radius: 8px;
}


/* ============================================================
   solowRadius.css
   All rules are scoped to .mxcw-solow-radius so nothing leaks
   outside the component container.
   ============================================================ */

.mxcw-solow-radius {
    display: flex;
    flex-direction: column;
    background: #0d3040;
    border: 2px solid #4a9aaa;
    border-radius: 18px;
    padding: 20px 30px;
    width: 460px;
    box-sizing: border-box;
    font-family: Arial, sans-serif;
}

/* ── Title ─────────────────────────────────────────────────── */

.mxcw-solow-radius .mxcw-solow-radius-title {
    color: #ffffff;
    font-size: 1.5rem;
    font-weight: 400;
}

/* ── Slider wrapper ─────────────────────────────────────────── */

.mxcw-solow-radius .mxcw-solow-radius-slider-wrap {
    position: relative;
}

.mxcw-solow-radius .mxcw-solow-radius-track {
    position: relative;
    height: 6px;
    background: #4a9aaa;
    border-radius: 3px;
    margin: 18px 0;
}

.mxcw-solow-radius .mxcw-solow-radius-fill {
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    background: #4a9aaa;
    border-radius: 3px;
    pointer-events: none;
}

/* ── Range input ────────────────────────────────────────────── */

.mxcw-solow-radius .mxcw-solow-radius-input {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    width: 100%;
    height: 6px;
    background: transparent;
    margin: 0;
    cursor: pointer;
    outline: none;
}

.mxcw-solow-radius .mxcw-solow-radius-input::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #7a8fa0;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: background 0.15s;
}

.mxcw-solow-radius .mxcw-solow-radius-input::-moz-range-thumb {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #7a8fa0;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    transition: background 0.15s;
}

.mxcw-solow-radius .mxcw-solow-radius-input:hover::-webkit-slider-thumb {
    background: #99b0be;
}

.mxcw-solow-radius .mxcw-solow-radius-input:hover::-moz-range-thumb {
    background: #99b0be;
}

/* ── Scale labels (0 … 10,000) ──────────────────────────────── */

.mxcw-solow-radius .mxcw-solow-radius-scale-labels {
    display: flex;
    justify-content: space-between;
    color: #ffffff;
    font-size: 1.25rem;
    margin-top: 4px;
}

/* ── Snap markers row ───────────────────────────────────────── */

.mxcw-solow-radius .mxcw-solow-radius-snap-markers {
    display: flex;
    justify-content: space-between;
    padding: 0 14px; /* Half the 28px slider thumb size */
    margin-top: 6px;
}

.mxcw-solow-radius .mxcw-solow-radius-snap-marker {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 0;
    gap: 4px;
}

.mxcw-solow-radius .mxcw-solow-radius-snap-tick {
    width: 2px;
    height: 8px;
    background: #4a9aaa;
    opacity: 0.6;
    border-radius: 1px;
}

.mxcw-solow-radius .mxcw-solow-radius-snap-label {
    color: #7ab8c4;
    font-size: 14px;
    white-space: nowrap;
}

/* ── Current selected value ─────────────────────────────────── */

.mxcw-solow-radius .mxcw-solow-radius-current-value {
    text-align: center;
    color: #ffffff;
    font-size: 1.6rem;
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* ── Footnote ───────────────────────────────────────────────── */

.mxcw-solow-radius .mxcw-solow-radius-note {
    color: #a8c8d0;
    font-style: italic;
    font-size: 15px;
    line-height: 1.5;
    margin-top: 4px;
}


.mxcw-taxon-fields {
    display: grid;
    grid-template-columns: max-content 1fr;
    column-gap: 1.5rem;
    row-gap: 3px;
    margin: 0;
}

.mxcw-taxon-name {
    font-size: larger;
    padding-bottom: 10px;
    padding-top: 5px;
    line-height: normal;
}

.mxcw-leftPane {
    display: flex;
    flex-direction: column;
    width: 60%;
    /* For God's sake I really mean it! */
    min-width: 60%;
}

.mxcw-map {
    height: 80%;
    min-height: 0;
    width: 100%;
    min-width: auto;
    transition-property: height;
    margin: 0px auto;
    overflow: hidden;
    z-index: 5;
    color: black;

    /** Somehow this works when hiding but not when showing */
    /*
    transition-duration: 800ms;
     */
}

.mxcw-hideMap .mxcw-map {
    height: 0;
    min-height: 0;
}

.mxcw-data {
    z-index: 5;
    opacity: 1;
    color: black;
    margin-bottom: 8px;
    margin-left: 8px;
    height: 20%;
    min-height: 230px;
    display: flex;
    width: calc(100% - 16px);
}


.mxcw-hideMap ~ .mxcw-data {
    height: 100%;
}

.mxcw-hideMap {
    height: 0;
}

.mxcw-content {
    overflow-y: auto;
    width: 100%;
}

.mxcw-content .section {
    /* We've got the scrollbar at the right, eat into it a bit */
    padding: 8px 0 8px 12px;
}

.mxcw-content img {
    max-height: 35vh;
    max-width: 100%;
    display: block;
    margin: auto;
}

.mxcw-content h2 {
    font-size: larger;
    font-weight: 700;
}

.mxcw-mapPane {
    opacity: 0;
    visibility: hidden;
    transition-property: opacity, visibility;
    transition-duration: 800ms;
}

.mxcw-mapPane.mxcw-activeMapPane {
    opacity: 1;
    visibility: visible;
}

.mxcw-mapSubPane.mxcw-mapPane {
    transition-duration: 0ms;
}

.mxcw-widgetPane {
    display: none;
    padding: 2em;
}

.mxcw-widgetPane.mxcw-activeWidgetPane {
    display: flex;
}

.mxcw-content .section {
    display: none;
}

.mxcw-content .mxcw-activeSection {
    display: flex;
}

body .mx-header ::-webkit-scrollbar {
    width: 8px;
}

body .mx-header ::-webkit-scrollbar-thumb {
    border-radius: 4px;
}

.imerss-container {
    margin: 0px;
    height: 60%;
}

/* Styling for native legends */

.legend {
    line-height: 18px;
    color: #555;
}

.legend i {
    width: 18px;
    height: 18px;
    margin-right: 4px;
    opacity: 0.7;
    display: inline-block;
    vertical-align: top;
    zoom: 1;
}

.info {
    padding: 6px 8px;
    font: 14px/16px Arial, Helvetica, sans-serif;
    background: white;
    background: rgba(255,255,255,0.8);
    box-shadow: 0 0 15px rgb(0 0 0 / 20%);
    border-radius: 5px;
}

.mxcw-hidden.legend {
    opacity: 0;
    visibility: hidden;
    display: none;
}

.imerss-panel-dataPanel {
    padding: 0 1rem 1rem 1rem;
}

/* Technique from https://www.w3schools.com/howto/howto_css_responsive_iframes.asp */

.iframe-container {
    position: relative;
    overflow: hidden;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio (divide 9 by 16 = 0.5625) */
}

.data-pane iframe {
    position: absolute;
    top: 0;
    left: 0;
    bottom: 0;
    right: 0;
    width: 100%;
    height: 100%;
}
