/* Eloro presentation, on top of habillage.css: full-screen image slides, round navigation buttons,
   and a collapsible panel listing the slides and the 3D views. */
:root {
    --el-panel: 264px;
    --el-fab: 52px;
    --el-ease: 0.25s ease;
}

/* the panel pushes the page to the right when open */
body {
    transition: padding-left var(--el-ease);
}
body.el-open {
    padding-left: var(--el-panel);
}

/* ── the full-screen image slides ── */
.el-cover {
    position: fixed;
    inset: 0;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #0b0e13;
    cursor: pointer;
    transition: left var(--el-ease);
}
body.el-open .el-cover {
    left: var(--el-panel);
}
body[data-stage="viewer"] .el-cover {
    display: none;
}
.el-cover img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    user-select: none;
}

/* the 3D slide card: no buttons of its own any more */
.hb-slide h2 {
    margin-bottom: 8px;
}

/* the viewer's legend moves up, out of the way of the arrows */
#viewer .gm-legends {
    bottom: 104px;
}

/* ── the round buttons ── */
.el-fab {
    position: relative;
    z-index: 200;
    display: grid;
    place-items: center;
    width: var(--el-fab);
    height: var(--el-fab);
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(70, 76, 84, 0.78);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    color: #fff;
    transition: background 0.15s, transform 0.15s, opacity 0.15s;
}
.el-fab:hover:not(:disabled) {
    background: var(--hb-accent);
    transform: scale(1.06);
}
.el-fab:disabled {
    opacity: 0.35;
    cursor: default;
}
.el-fab svg,
.el-tab svg {
    width: 26px;
    height: 26px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.el-arrows {
    position: fixed;
    right: 22px;
    bottom: 40px;
    z-index: 200;
    display: flex;
    gap: 14px;
}
.el-fullscreen {
    position: fixed;
    top: 12px;
    right: 12px;
    width: 48px;
    height: 48px;
}
body[data-stage="image"] .el-fullscreen {
    top: 22px;
    right: 22px;
}
.el-icon-exit,
:fullscreen .el-icon-enter {
    display: none;
}
:fullscreen .el-icon-exit {
    display: block;
}

/* ── the tab, middle left ── */
.el-tab {
    position: fixed;
    top: 50%;
    left: 0;
    z-index: 200;
    display: grid;
    place-items: center;
    width: 28px;
    height: 52px;
    padding: 0;
    border: 0;
    border-radius: 0 12px 12px 0;
    background: rgba(70, 76, 84, 0.78);
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.25);
    color: #fff;
    transform: translateY(-50%);
    transition: left var(--el-ease), background 0.15s;
}
.el-tab:hover {
    background: var(--hb-accent);
}
.el-tab svg {
    width: 20px;
    height: 20px;
    transition: transform var(--el-ease);
}
body.el-open .el-tab {
    left: var(--el-panel);
}
body.el-open .el-tab svg {
    transform: rotate(180deg);
}

/* ── the panel ── */
.el-panel {
    position: fixed;
    inset: 0 auto 0 0;
    z-index: 150;
    width: var(--el-panel);
    padding: 16px 14px 24px;
    overflow-y: auto;
    background: #1d2128;
    color: #e6ebee;
    transform: translateX(-100%);
    transition: transform var(--el-ease);
    scrollbar-color: #4a515b transparent;
}
body.el-open .el-panel {
    transform: none;
}
.el-panel-head {
    display: flex;
    flex-direction: column;
    gap: 4px;
    margin: 0 4px 10px;
}
.el-panel-head span {
    color: var(--hb-muted);
    font-size: 12px;
}
.el-panel-head b {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}
.el-panel h3 {
    margin: 18px 4px 8px;
    color: var(--hb-accent);
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}
.el-list {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin: 0;
    padding: 0;
    list-style: none;
}
.el-list button {
    display: grid;
    grid-template-columns: 18px 1fr;
    gap: 2px 8px;
    width: 100%;
    padding: 8px 8px 10px 6px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: inherit;
    text-align: left;
}
.el-list button:hover {
    background: rgba(255, 255, 255, 0.06);
}
.el-list button.is-current {
    background: rgba(130, 160, 200, 0.2);
    box-shadow: inset 0 0 0 1px rgba(150, 178, 215, 0.6);
}
.el-num {
    grid-row: span 2;
    color: var(--hb-muted);
    font-size: 12px;
}
.el-thumb {
    position: relative;
    display: block;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: linear-gradient(135deg, #2d3a44, #12232b);
    box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.12);
}
.el-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.el-thumb .el-badge {
    position: absolute;
    top: 5px;
    right: 5px;
    padding: 1px 5px;
    border-radius: 4px;
    background: rgba(16, 20, 27, 0.7);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
}
.el-caption {
    color: #c9d1d6;
    font-size: 12px;
    line-height: 1.3;
}

/* ── hotspot slides: the card is wider and holds the hotspot's pictures ── */
.hb-slide {
    max-height: calc(100% - 48px);
    overflow-y: auto;
}
.hb-slide.is-wide {
    width: min(560px, calc(100% - 48px));
}
.hb-slide-body img {
    display: block;
    max-width: 100%;
    max-height: 38vh;
    margin: 4px 0;
    border-radius: 8px;
    cursor: zoom-in;
}
.el-lightbox {
    position: fixed;
    inset: 0;
    z-index: 300;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 4vh 4vw;
    background: rgba(11, 14, 19, 0.88);
    cursor: zoom-out;
}
.el-lightbox[hidden] {
    display: none;
}
.el-lightbox img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 8px;
    background: #fff;
}

/* ── the viewer fills the window: no banner, no footer, no margins ── */
body {
    grid-template-rows: 1fr;
}
.hb-stage,
body[data-mode="presentation"] .hb-stage {
    margin: 0;
    border-radius: 0;
    box-shadow: none;
}
/* the viewer's top bar leaves room for the full-screen button, top right */
#viewer .gm-bar {
    right: 72px;
}
/* the slide card sits above the attributions */
.hb-slide {
    bottom: 36px;
    max-height: calc(100% - 60px);
}

/* the attributions, along the bottom of the viewer */
.el-credits {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 5;
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 5px 12px;
    overflow: hidden;
    background: linear-gradient(transparent, rgba(11, 14, 19, 0.45));
    color: rgba(255, 255, 255, 0.85);
    font-size: 11px;
    white-space: nowrap;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
    pointer-events: none;
}

/* ── the 3D slide card, top left ── */
.hb-slide {
    top: 12px;
    bottom: auto;
    max-height: calc(100% - 96px);
}

/* the attributions, to the left */
.el-credits {
    justify-content: flex-start;
    padding-left: 14px;
}

/* the arrows sit in the bottom right corner */
.el-arrows {
    right: 16px;
    bottom: 16px;
}
#viewer .gm-legends {
    bottom: 84px;
}

/* ── the terrain transparency: the slider alone ── */
#viewer .gm-transparency .gm-pills,
#viewer .gm-transparency output,
#viewer .gm-transparency .gm-underground {
    display: none;
}
#viewer .gm-transparency {
    gap: 0;
}
#viewer .gm-transparency input[type="range"] {
    width: 170px;
}

/* ── the compass: one needle pointing north ── */
#viewer .gm-compass > svg:not(.el-north) {
    display: none;
}
#viewer .gm-compass .el-north {
    display: block;
    width: 100%;
    height: 100%;
}
.el-north-needle {
    fill: #c0392b;
}
.el-north-n {
    fill: #3a424b;
    font: 700 22px var(--hb-font, sans-serif);
}

/* the card keeps clear of the tab that opens the panel (28 px wide, middle left) */
.hb-slide {
    left: 36px;
    width: min(440px, calc(100% - 60px));
}
.hb-slide.is-wide {
    width: min(560px, calc(100% - 60px));
}

/* ── the slide title stands outside the card, as the title of the whole window ── */
.hb-slide {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}
.hb-slide h2 {
    margin: 0 0 14px;
    color: #fff;
    font-size: 38px;
    font-weight: 700;
    line-height: 1.12;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55), 0 0 22px rgba(0, 0, 0, 0.45);
}
.hb-slide-body {
    padding: 18px 22px;
    border-left: 5px solid var(--hb-accent);
    border-radius: var(--hb-radius);
    background: rgba(255, 255, 255, 0.96);
    box-shadow: var(--hb-shadow);
}

/* the title is not bound to the card's column: it stays on one line, the card keeps its own width */
.hb-slide,
.hb-slide.is-wide {
    width: calc(100% - 60px);
    pointer-events: none;
}
.hb-slide h2 {
    white-space: nowrap;
}
.hb-slide-body {
    width: min(440px, 100%);
    box-sizing: border-box;
    pointer-events: auto;
}
.hb-slide.is-wide .hb-slide-body {
    width: min(560px, 100%);
}

/* "Powered by GeoModels", first in the bottom-left strip */
.el-credits {
    align-items: center;
}
.el-powered {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding-right: 18px;
    border-right: 1px solid rgba(255, 255, 255, 0.35);
    font-weight: 500;
}
.el-powered img {
    display: block;
    height: 13px;
    width: auto;
}

/* "Powered by GeoModels": two lines, above the attributions, a link to geomodels.net */
.el-powered {
    position: absolute;
    bottom: 34px;
    left: 14px;
    z-index: 6;
    display: flex;
    flex-direction: column;
    gap: 5px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 12px;
    font-weight: 500;
    text-decoration: none;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}
.el-powered img {
    display: block;
    height: 26px;
    width: auto;
    filter: drop-shadow(0 1px 3px rgba(0, 0, 0, 0.55));
    transition: opacity 0.15s;
}
.el-powered:hover img {
    opacity: 0.8;
}
.el-credits .el-powered {
    display: none;
}

/* no attributions any more: "Powered by GeoModels" takes the bottom-left corner, level with the arrows */
.el-powered {
    bottom: 16px;
    left: 16px;
}

/* "Powered by GeoModels": no divider, text left-aligned with the logo, a smaller logo */
.el-powered {
    align-items: flex-start;
    padding-right: 0;
    border-right: 0;
}
.el-powered img {
    height: 18px;
}

/* ── the LEGEND panel: no "Layers" button; a Hide / Show button at the panel's top right ── */
#viewer .el-gone {
    display: none !important;
}
.el-legend-toggle {
    position: absolute;
    top: calc(var(--gm-gap, 12px) + var(--gm-bar-height, 48px) + 8px + 10px);
    right: calc(var(--gm-gap, 12px) + 12px);
    z-index: 41;
    padding: 4px 10px;
    border: 0;
    border-radius: 999px;
    background: transparent;
    color: var(--gm-muted, #6b7580);
    font: 600 12px var(--hb-font, sans-serif);
    cursor: pointer;
}
.el-legend-toggle:hover {
    background: rgba(0, 0, 0, 0.06);
    color: var(--gm-text, #1d2128);
}
/* when the panel is hidden, the button stays, as a small card in the panel's place */
.el-legend-toggle.is-floating {
    top: calc(var(--gm-gap, 12px) + var(--gm-bar-height, 48px) + 8px);
    right: var(--gm-gap, 12px);
    padding: 8px 16px;
    background: var(--gm-card, #fff);
    box-shadow: var(--gm-card-shadow, 0 4px 14px rgba(0, 0, 0, 0.25));
    color: var(--gm-text, #1d2128);
    font-size: 13px;
}

/* ── the controls, moved about ── */
/* terrain transparency: "Terrain", the slider, its value, in a card under the LEGEND panel */
#viewer .gm-transparency {
    position: fixed;
    top: 100px;
    right: var(--gm-gap, 12px);
    z-index: 40;
    width: var(--gm-right-width, 320px);
    box-sizing: border-box;
    gap: 12px;
    padding: 10px 14px;
}
#viewer .gm-transparency .gm-pills {
    display: flex;
}
#viewer .gm-transparency .gm-pill {
    padding: 0;
    border: 0;
    background: none;
    color: var(--gm-text, #1d2128);
    font-weight: 600;
    pointer-events: none;
}
#viewer .gm-transparency .gm-pill[hidden] {
    display: none;
}
#viewer .gm-transparency output {
    display: inline;
    min-width: 40px;
    text-align: right;
    font-weight: 600;
}
#viewer .gm-transparency input[type="range"] {
    flex: 1;
    width: auto;
    min-width: 0;
}

/* previous / next, to the left of the full-screen button */
.el-arrows {
    top: 10px;
    right: 74px;
    bottom: auto;
}
body[data-stage="image"] .el-arrows {
    top: 20px;
    right: 84px;
}

/* the compass, bottom right of the viewer; the legend boxes sit above it */
#viewer .gm-compass {
    position: fixed;
    right: 16px;
    bottom: 16px;
    z-index: 40;
    width: 64px;
    height: 64px;
}
#viewer .gm-legends {
    bottom: 96px;
}

/* the scale, left of the compass */
.el-scale {
    position: fixed;
    right: 92px;
    bottom: 16px;
    z-index: 40;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 3px;
    height: 64px;
    justify-content: flex-end;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.7);
    pointer-events: none;
}
.el-scale-bar {
    display: block;
    width: 80px;
    height: 7px;
    border: 2px solid #fff;
    border-top: 0;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
}
body[data-stage="image"] .el-scale {
    display: none;
}

/* ── second pass on the layout ── */
:root {
    --el-legend-top: 130px; /* the LEGEND panel starts here; the terrain slider sits above it */
}
#viewer aside[data-gm-panel="layers"] {
    top: var(--el-legend-top);
    max-height: calc(100% - var(--el-legend-top) - 16px);
}
#viewer .gm-transparency {
    top: 72px;
}
.el-legend-toggle {
    top: calc(var(--el-legend-top) + 10px);
}
.el-legend-toggle.is-floating {
    top: var(--el-legend-top);
}

/* full-screen button: same size as previous / next */
.el-fullscreen,
body[data-stage="image"] .el-fullscreen {
    width: var(--el-fab);
    height: var(--el-fab);
}
.el-fullscreen {
    top: 12px;
    right: 12px;
}
body[data-stage="image"] .el-fullscreen {
    top: 22px;
    right: 22px;
}
.el-arrows {
    top: 12px;
    right: 78px;
}
body[data-stage="image"] .el-arrows {
    top: 22px;
    right: 88px;
}

/* smaller compass, and the scale follows it */
#viewer .gm-compass {
    width: 48px;
    height: 48px;
}
.el-scale {
    right: 76px;
    height: 48px;
}
#viewer .gm-legends {
    bottom: 80px;
}

/* the drillholes' legend, inside the LEGEND panel, under its item */
#viewer .gm-card-body .gm-legend {
    min-width: 0;
    padding: 0 0 2px 26px;
    border: 0;
    background: none;
}
#viewer .gm-card-body .gm-legend .gm-legend-chevron,
#viewer .gm-card-body .gm-legend .gm-legend-note {
    display: none;
}
#viewer .gm-card-body .gm-legend .gm-legend-head {
    pointer-events: none;
    cursor: default;
}
#viewer .gm-card-body .gm-legend.gm-collapsed .gm-legend-items {
    display: flex;
}

/* the Drillholes menu, to the right of its item */
#viewer .gm-card-body > :has(> .el-drill-menu),
#viewer .gm-card-body > :has(label .el-drill-menu) {
    align-items: center;
}
.el-drill-menu {
    margin-left: auto;
    padding: 3px 22px 3px 8px;
    border: 1px solid var(--gm-line, #d5dbe0);
    border-radius: 8px;
    background-color: var(--gm-soft, #f3f5f6);
    color: var(--gm-text, #1d2128);
    font: 600 12px var(--hb-font, sans-serif);
    cursor: pointer;
}

/* the legend under Drillholes: no title of its own, the menu already says "Ag (g/t)" */
#viewer .gm-card-body .gm-legend .gm-legend-head {
    display: none;
}
#viewer .gm-card-body .gm-legend .gm-legend-items {
    margin-top: 0;
}

/* ── LEGEND items: icon on the left, eye on the right ── */
#viewer .gm-card-body label.gm-check > input.gm-box {
    display: none;
}
#viewer .gm-card-body label.gm-check {
    cursor: pointer; /* a click on the name or the icon toggles the element, like the eye */
}
.el-item-icon {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 22px;
    height: 22px;
}
.el-item-icon svg {
    width: 20px;
    height: 20px;
}
.el-eye {
    display: inline-grid;
    flex: none;
    place-items: center;
    width: 28px;
    height: 28px;
    margin-left: auto;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: none;
    color: var(--gm-text, #1d2128);
    cursor: pointer;
}
.el-eye:hover {
    background: rgba(0, 0, 0, 0.07);
}
.el-eye svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}
#viewer .gm-card-body label.gm-check.is-off > span:not(.el-item-icon),
#viewer .gm-card-body label.gm-check.is-off .el-eye {
    opacity: 0.45;
}
#viewer .gm-card-body label.gm-check.is-off .el-item-icon {
    opacity: 0.35;
    filter: grayscale(1);
}
/* the Drillholes menu comes before the eye */
.el-drill-menu {
    margin-right: 6px;
}
label.gm-check:has(.el-drill-menu) .el-eye {
    margin-left: 0;
}

/* Category / Grade sub-lists (Indicated, Inferred; the AgEq classes): the rows are closer together */
#viewer .gm-subgroup {
    gap: 0;
}
#viewer .gm-subgroup .el-eye {
    width: 22px;
    height: 22px;
}
#viewer .gm-subgroup .el-eye svg {
    width: 17px;
    height: 17px;
}
#viewer .gm-subgroup .el-item-icon {
    width: 18px;
    height: 18px;
}
#viewer .gm-subgroup .el-item-icon svg {
    width: 16px;
    height: 16px;
}

/* the other items (zones, drillholes, geology...): a little closer too */
#viewer .gm-card-body {
    gap: 3px;
}
.el-eye {
    width: 24px;
    height: 24px;
}
.el-eye svg {
    width: 18px;
    height: 18px;
}

/* the Category / Grade switch, a little smaller (the terrain slider's own pills are not concerned) */
#viewer .gm-card .gm-pill {
    padding: 4px 9px;
    font-size: 11px;
}

.el-drill-menu:disabled {
    opacity: 0.45;
    cursor: default;
}

/* "Terrain" in the style of the "LEGEND" title (.gm-section-label) */
#viewer .gm-transparency .gm-pill {
    color: var(--gm-muted, #6b7580);
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* no grey frame around "Terrain" */
#viewer .gm-transparency .gm-pills,
#viewer .gm-transparency .gm-pill,
#viewer .gm-transparency .gm-pill.on {
    padding: 0;
    border: 0;
    background: none;
    box-shadow: none;
}

/* LEGEND folded: the panel keeps its width and its title, the rest of its content is hidden */
#viewer aside[data-gm-panel="layers"].el-folded .gm-scroll > :not(.gm-section-label) {
    display: none;
}
.el-legend-toggle.is-floating {
    /* no longer used: the panel stays in place */
    all: unset;
}

/* more room between the buttons (top right) and the terrain slider; the LEGEND panel follows */
:root {
    --el-legend-top: 144px;
}
#viewer .gm-transparency {
    top: 86px;
}

/* the compass, nicer: a big N above a dark grey arrow, a little smaller */
#viewer .gm-compass {
    width: 44px;
    height: 44px;
}
.el-scale {
    right: 72px;
    height: 44px;
}
.el-north-needle {
    fill: #3a4048;
}
/* the N is drawn, not written: it does not depend on a font */
.el-north-n {
    fill: none;
    stroke: #3a4048;
    stroke-width: 6;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* the scale: "0 ... 500 m" over a bar in four light and dark blocks, on a dark card */
.el-scale {
    height: auto;
    right: 70px;
    bottom: 16px;
    align-items: flex-end;
    justify-content: flex-end;
    text-shadow: none;
}
.el-scale-box {
    display: flex;
    flex-direction: column;
    gap: 4px;
    padding: 7px 11px 9px;
    border-radius: 9px;
    background: rgba(24, 29, 36, 0.62);
    backdrop-filter: blur(4px);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.25);
}
.el-scale-values {
    display: flex;
    justify-content: space-between;
    gap: 14px;
    font: 600 12px/1 var(--hb-font, sans-serif);
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.el-scale-bar {
    box-sizing: border-box;
    width: 80px;
    height: 8px;
    border: 1px solid rgba(255, 255, 255, 0.85);
    border-radius: 2px;
    background: linear-gradient(90deg, #e9edf0 0 25%, #3a4048 25% 50%, #e9edf0 50% 75%, #3a4048 75% 100%);
    box-shadow: none;
}

/* the navigation buttons never move: same place on the image slides as on the 3D slides */
body[data-stage="image"] .el-fullscreen {
    top: 12px;
    right: 12px;
}
body[data-stage="image"] .el-arrows {
    top: 12px;
    right: 78px;
}

/* the viewer's own root sets its accent (orange) closer to its controls than the page does: set it there too */
#viewer .gm-viewer {
    --gm-accent: var(--hb-accent);
    --gm-focus: #6f86a3; /* the focus ring too (was orange) */
}

/* no band on the left of the explanation card */
.hb-slide-body {
    border-left: 0;
}
