/* ==========================================================================
   Industrial Heritage Trail - StoryMap layout
   ========================================================================== */

.vco-layout-landscape .vco-map .leaflet-right,
.vco-layout-portrait .leaflet-bottom {
    display: none!important;
}

.vco-layout-portrait .leaflet-bottom.leaflet-left {
    display: block!important;
}

/* ==========================================================================
   Slide content - typography, links, CTA button
   ========================================================================== */

#storymap {
    font-family: 'Lato',-apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,sans-serif!important;
	color: #111;
    line-height: 160%;
}

.vco-slide .vco-slide-scrollable-container,
.vco-slide .vco-slide-content-container .vco-slide-content {
    width: 100%!important;
}

.vco-slide-content {
    box-sizing: border-box;
    padding: 5%!important;
    padding-bottom: 100px!important;
}

.vco-slide-content :is(p, span, ul, ol) {
    font-size: 16px;
    color: #111;
    margin: 1em 0;
}

.vco-slide-content ul {
    list-style: none;
    padding-left: 1.2em;
}

.vco-slide-content ul li::before {
    content: '';
    display: inline-block;
    width: 6px;
    height: 6px;
    background: var(--primary-color);
    margin-right: 0.6em;
    margin-left: -1.2em;
    vertical-align: middle;
}

.vco-slide-content :is(h1, h2, h3, h4, h5, h6) {
    font-weight: 700;
	margin: .67em auto;
	line-height: 1.2!important;
	position: relative;
	color: #111!important;
}

.satellite-view .vco-slide-content :is(h1, h2, h3, h4, h5, h6, p, span, ul, ol) {
    color: #fff!important;
}

.vco-storymap .vco-slide-content a,
.vco-storymap .vco-slide-content a:visited {
    color: var(--primary-color);
    text-decoration: underline;
    overflow-wrap: anywhere;
    transition: 0.3s ease-in-out;
}

.vco-storymap .vco-slide-content a:is(:hover,:active) {
    text-decoration: none;
    color: #111;
}

.vco-slide .vco-slide-calltoaction {
    cursor: default;
    pointer-events: none;
}

.vco-slide .vco-slide-calltoaction .vco-slide-calltoaction-button-text {
    font-weight: 700;
    padding: 1em;
    background: #111;
    pointer-events: auto;
    cursor: pointer;
    display: inline-block;
    position: relative;
    padding-right: calc(1em + 57px);
    transition: 0.3s ease-in-out;
    text-decoration: none;
    color: #fff;
    border: none;
    line-height: 160%;
    border-radius: 0;
    position: relative;
}

.vco-slide .vco-slide-calltoaction .vco-slide-calltoaction-button-text:is(:hover,:active) {
    background: #222;
}

.vco-slide .vco-slide-calltoaction .vco-slide-calltoaction-button-text:before {
    content: '';
    width: 57.6px;
    height: 57.6px;
    background-color: var(--primary-color);
    background-image: url('../img/svg/forward-arrow-white.svg');
    background-position: center center;
    background-repeat: no-repeat;
    background-size: 30px;
    position: absolute;
    top: 0;
    right: 0;
}

/* ==========================================================================
   Slide panel - overlays, background gradient, fade transition
   ========================================================================== */

/* Bottom fade overlay */
.vco-storyslider:before {
    content: '';
    width: 100%;
    height: 120px;
    background: linear-gradient(to bottom,  rgba(239,239,239,1) 0%,rgba(239,239,239,1) 100%);
    position: absolute;
    bottom: -70px;
    left: 0;
    z-index: 6;
    filter: blur(20px);
}

.satellite-view .vco-storyslider:before {
    background: linear-gradient(to bottom,  rgba(17,39,52,1) 0%,rgba(17,39,52,1) 100%);
}

/* Extends the gradient further left so the image-to-text fade
   is wider and softer */
.vco-layout-landscape .vco-storyslider .vco-slider-background {
    margin-left: -60%;
    width: 160%;
    background: linear-gradient(to right, rgba(239, 239, 239, 0) 0%, rgba(239, 239, 239, 1) 50%, rgba(239, 239, 239, 1) 100%);
    transition: 0.3s ease-in-out;
}

.satellite-view .vco-layout-landscape .vco-storyslider .vco-slider-background {
    background: linear-gradient(to right, rgba(239, 239, 239, 0) 0%, rgba(17,39,52, 1) 50%, rgba(17,39,52, 1) 100%);
}

/* Fade transition for slide content (replaces horizontal scroll) */
.storymap-container .vco-storyslider {
    transition: opacity 0.3s ease;
}

.vco-layout-portrait .vco-storyslider {
    padding-top: 0;
    box-shadow: none;
    background: #efefef;
    z-index: 5;
    position: relative;
}

.satellite-view .vco-layout-portrait .vco-storyslider {
    background: #112734;
}

.vco-layout-portrait .vco-map {
    position: relative;
    overflow: visible;
}

.vco-layout-portrait .vco-map:before {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 150px;
    background: linear-gradient(to bottom, rgba(239, 239, 239, 0) 0%, rgba(239, 239, 239, 1) 100%, rgba(239, 239, 239, 1) 100%);
    z-index: 1;
}

.satellite-view .vco-layout-portrait .vco-map:before {
    background: linear-gradient(to bottom, rgba(17,39,52, 0) 0%, rgba(17,39,52, 1) 100%, rgba(17,39,52, 1) 100%);
}

@media only screen and (max-width: 767px) {
    .vco-storyslider:before {
        display: none;
    }
}

/* ==========================================================================
   First slide
   ========================================================================== */

.vco-slide:first-child .vco-slide-scrollable-container {
    margin-inline: auto;
}

.vco-slide:first-child .vco-slide-content {
    padding-inline: 36px!important;
}

.vco-slide:first-child .vco-slide-content,
.vco-slide:first-child .vco-slide-calltoaction {
    padding-top: 0!important;
    padding-bottom: 0!important;
    margin: 0!important;
}

.vco-slide:first-child .vco-slide-calltoaction {
    max-width: 500px;
    width: 100%;
    padding: 0 36px!important;
    text-align: right;
    box-sizing: border-box;
    margin-inline: auto!important;
}

.vco-slide:first-child .vco-text {
    background: #111;
    padding: 30px!important;
    max-width: 500px!important;
    width: 100%;
    color: #fff!important;
    box-sizing: border-box;
}

.vco-slide:first-child .vco-text h2 {
    color: #fff!important;
    font-size: 2em!important;
    position: relative;
    padding-bottom: 1em;
    margin: 0!important;
}

.vco-slide:first-child .vco-text h2:after {
    content: '';
    width: 50%;
    height: 3px;
    background: var(--primary-color);
    bottom: 0.2em;
    left: 0;
    position: absolute;
}

.vco-slide:first-child .vco-text p {
    color: #fff!important;
}

.vco-layout-portrait .vco-slide:first-child .vco-slide-calltoaction {
    padding-bottom: 100px!important;
}

/* ==========================================================================
   Media - images, captions, credits
   ========================================================================== */

.vco-media-content-container {
    position: relative;
}

.vco-media-shadow {
    box-shadow: none;
}

.vco-storymap :is(.vco-caption,.vco-credit) {
    width: auto!important;
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    font-size: 0.7em;
    line-height: 1.2;
    opacity: 0.7;
    font-weight: 700;
    z-index: 2;
    color: #fff;
    background: linear-gradient(to bottom, rgba(0, 1, 17, 0) 0%, rgba(0, 1, 17, 1) 100%);
    border-radius: 0 0 8px 8px;
}

.vco-media .vco-media-content-container .vco-media-content img {
    aspect-ratio: 4 / 3;
    object-fit: cover;
    object-position: center center;
    border-radius: 8px;
    max-height: unset!important;
    width: 100%!important;
    background-color: #d0cfd4;
    pointer-events: none;
}

/* ==========================================================================
   Page layout - container, map panel, sidebar
   ========================================================================== */

/* Desktop default: hide mobile dropdown, show sidebar */
#storymap-mobile-menu {
    display: none !important;
}

.mobile-menu-wrapper {
    display: none !important;
}

/* Map + sidebar container */
.storymap-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: calc(100vh - 115px);
    min-height: 500px;
    overflow: hidden;
    background: #efefef!important;
}

.satellite-view .storymap-container {
    background: #112734!important;
}

/* Map panel - full width, sidebar overlays it */
.storymap-container #storymap {
    width: 100%;
    height: 100%;
    overflow: hidden;
}

/* Sidebar - overlay panel, hidden by default, slides in from right */
.storymap-container #storymap-menu {
    position: absolute;
    top: 1em;
    right: 1em;
    bottom: calc(2em + 42px);
    width: 320px;
    max-width: 400px;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    padding: 1em 1em 3em;
    box-sizing: border-box;
    overflow-y: auto;
    background: #111 url('../img/WHUK-circle-grid-white-translucent.svg') no-repeat right -150px bottom -150px / 400px;
    margin: 0;
    visibility: hidden;
    transform: translateX(calc(100% + 2em));
    transition: transform 0.3s ease, visibility 0.3s;
}

.storymap-container #storymap-menu.open {
    visibility: visible;
    transform: translateX(0);
}

/* Bottom fade overlay - sits on top of menu content, doesn't scroll */
.storymap-container::after {
    content: '';
    position: absolute;
    right: 1em;
    bottom: calc(2em + 42px);
    width: 320px;
    max-width: 400px;
    height: 100px;
    background: linear-gradient(to bottom, rgba(17,17,17,0) 0%, rgba(17,17,17,0.9) 100%);
    pointer-events: none;
    z-index: 1001;
    opacity: 0;
    transition: none;
}

.storymap-container:has(#storymap-menu.open)::after {
    opacity: 1;
    transition: opacity 1s ease 0.25s;
}

/* Menu toggle button */
.iht-menu-toggle {
    position: absolute !important;
    bottom: 16px;
    right: 16px;
    z-index: 1001;
    width: 42px !important;
    height: 37px !important;
    background: #111 !important;
    color: #fff !important;
    cursor: pointer;
    font-size: 25px;
    line-height: 1 !important;
    padding: 0 0 5px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease-in-out;
}

/* Hide StoryMapJS default prev/next nav - replaced by custom buttons */
.storymap-container .vco-slidenav-next,
.storymap-container .vco-slidenav-previous {
    display: none !important;
}

/* Custom prev/next buttons */
.iht-nav-prev,
.iht-nav-next {
    position: absolute !important;
    bottom: 16px;
    z-index: 1001;
    width: 42px !important;
    height: 34px !important;
    background: #111 !important;
    color: #fff !important;
    cursor: pointer;
    font-size: 35px;
    line-height: 1 !important;
    padding: 0 0 8px !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    transition: 0.3s ease-in-out;
}

.iht-nav-prev {
    right: 111px;
}

.iht-nav-next {
    right: 68px;
}

:is(.iht-nav-prev,.iht-nav-next,.iht-menu-toggle):hover {
    transform: scale(0.95);
    background-color: #222!important;
}

:is(.iht-nav-prev,.iht-nav-next,.iht-menu-toggle):hover:active {
    transform: scale(0.9);
}

@media only screen and (max-width: 767px) {
    .storymap-container {
        height: calc(100vh - 57px);
    }
}

@media only screen and (max-width: 620px) {
    .storymap-container {
        height: calc(100vh - 113.8px);
    }
}

/* ==========================================================================
   Sidebar buttons
   ========================================================================== */

/* !important needed to override theme's global button rule
   (style.css:1116) which has high specificity from stacked :not() selectors */
.storymap-container #storymap-menu button {
    flex-shrink: 0;
    width: 100%;
    color: #fff!important;
    text-align: left;
    font-weight: normal !important;
    cursor: pointer;
    transition: background 0.2s, border-color 0.2s;
    padding: 0.5em!important;
    padding-right: 0.5em!important;
    overflow: visible;
    line-height: normal!important;
    background: transparent!important;
    position: relative;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.storymap-container #storymap-menu button.active {
    background: var(--primary-color)!important;
    border-color: var(--primary-color)!important;
}

.storymap-container #storymap-menu button:hover {
    background: #222 !important;
    border-color: #222 !important;
}

.storymap-container #storymap-menu button:has(~ button.active) {
    color: #666!important;
}

.storymap-container #storymap-menu button:has(~ button.active):before {
    background-color: #444;
    border-color: #444;
}

/* ==========================================================================
   Map controls - layer toggle, zoom, minimap
   ========================================================================== */

/* Menubar — restyled as compact icon buttons next to layer toggle */
.vco-menubar {
    position: absolute !important;
    bottom: 10px;
    left: 94px;
    z-index: 1000;
    display: flex !important;
    background: none !important;
    border: none !important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3) !important;
    border-radius: 4px;
    padding: 0 !important;
    margin: 0 !important;
    width: auto !important;
    height: auto !important;
}

.vco-menubar .vco-menubar-button {
    display: flex !important;
    align-items: center;
    justify-content: center;
    width: 26px !important;
    height: 26px !important;
    background: #fff !important;
    border: none !important;
    border-radius: 0;
    box-shadow: none;
    cursor: pointer;
    padding: 0 !important;
    margin: 0 !important;
    font-size: 0 !important;
    color: #333 !important;
    transition: background 0.2s;
    line-height: 1 !important;
}

.vco-menubar .vco-menubar-button:first-child {
    border-radius: 4px 0 0 4px;
}

.vco-menubar .vco-menubar-button:nth-child(2) {
    border-radius: 0 4px 4px 0;
    border-left: 1px solid #ccc !important;
}

.vco-menubar .vco-menubar-button:hover {
    background: #f0f0f0 !important;
}

/* Hide the third button (Hide Map) */
.vco-menubar .vco-menubar-button:nth-child(3) {
    display: none !important;
}

/* Hide the default icon spans */
.vco-menubar .vco-menubar-button .vco-icon-goback,
.vco-menubar .vco-menubar-button .vco-icon-arrow-up {
    display: none !important;
}

/* Layer toggle (Google Maps style) */
.iht-layer-toggle {
    position: absolute;
    bottom: 10px;
    left: 10px;
    z-index: 1000;
    width: 70px;
    height: 70px;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    cursor: pointer;
    background-size: cover;
    background-position: center;
    border: 2px solid #fff;
    overflow: hidden;
    transition: box-shadow 0.2s;
}

.iht-layer-toggle:hover {
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
}

.iht-layer-toggle-label {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 4px 0;
    text-align: center;
    font-size: 10px;
    font-weight: 600;
    line-height: 1.5;
    color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8);
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.5));
}

/* Zoom controls - sit above the layer toggle */
.storymap-container .leaflet-bottom.leaflet-left {
    bottom: 85px;
    left: 2px;
}

.leaflet-control-zoom, .leaflet-control-layers {
    border: none!important;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3)!important;
}

/* Minimap */
.vco-map .leaflet-container .leaflet-control-minimap{
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
    border-radius: 8px;
    border: 2px solid #fff!important;
}

/* ==========================================================================
   Map markers - sharp-edged diamond pin, 3 colour states
   ========================================================================== */

/* Anchor fix - StoryMapJS sets a 12×12 icon with anchor (10,10).
   Our pin shape is 38×43 with the tip at bottom-centre.
   Shift the div so the tip lands on the geographic coordinate. */
.vco-map .leaflet-marker-icon.vco-mapmarker,
.vco-map .leaflet-marker-icon.vco-mapmarker-active {
    margin-top: 3px !important;
    margin-left: -6px !important;
}

/* Replace the icon-font pin with the squared marker (whuk-map-marker.svg) */
.vco-map .vco-mapmarker:before,
.vco-map .vco-mapmarker-active:before {
    content: '' !important;
    display: block;
    width: 38px;
    height: 43px;
    font-size: 0;
    background-color: currentColor;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 103.46 118.61'%3E%3Cpolygon points='0.5 0.5 0.5 102.96 36.78 102.96 51.73 117.91 66.68 102.96 102.96 102.96 102.96 0.5 0.5 0.5'/%3E%3C/svg%3E");
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 103.46 118.61'%3E%3Cpolygon points='0.5 0.5 0.5 102.96 36.78 102.96 51.73 117.91 66.68 102.96 102.96 102.96 102.96 0.5 0.5 0.5'/%3E%3C/svg%3E");
    mask-size: contain;
    mask-repeat: no-repeat;
}

/* White icon inside the marker - reposition for squared shape */
.vco-map .vco-mapmarker-icon:after,
.vco-map .vco-mapmarker-active.vco-mapmarker-icon:after {
    display: block !important;
    font-size: 22px;
    color: #fff;
    width: 38px;
    height: 38px;
    line-height: 34px;
    text-align: center;
    position: absolute;
    top: 0;
    left: 0;
}

/* Not visited (default) */
.vco-map .vco-mapmarker {
    color: #111 !important;
}

/* Active */
.vco-map .vco-mapmarker-active {
    color: #009690 !important;
}

/* Visited - uses data attribute so StoryMapJS can't overwrite it */
.vco-map .vco-mapmarker[data-iht-visited] {
    color: #acabaf !important;
}

/* ==========================================================================
   Mobile layout: stack map over dropdown (≤ 800px)
   ========================================================================== */

@media (max-width: 767px) {

    .storymap-container {
        flex-direction: column;
    }

    #storymap {
        width: 100%;
        max-width: 100%;
        min-height: 400px;
        height: auto;
        flex: none;
        display: block;
    }
}

/* ==========================================================================
   Saltaire iframe
   ========================================================================== */

.iht-saltaire-section iframe {
    display: block;
    width: 100%;
    min-height: 800px;
    border: 0;
}
