/* J. Woodward - Tour font */
:root {
    --font-primary: "Segoe UI", Arial, sans-serif;
}

/* ========================================
   SPLASH SCREEN
   ======================================== */

#splash_screen {
    background-color: rgba(0,0,0,0.5);
}

/* J. Woodward - Hide splash logo (Azbil uses text header instead) */
#splash_screen > div:not(.splash_overlay) img {
    display: none;
}

/* ========================================
   TOUR COLORS
   J. Woodward - Azbil brand blue
   ======================================== */

:root {
    --primary-color: #A80005;
    --primary-color-rgb: 168, 0, 5;

    --secondary-color: #6B0003;
    --secondary-color-rgb: 107, 0, 3;

    --logo-height: auto;
}

/* ========================================
   UI ELEMENT CUSTOMIZATIONS
   ======================================== */

/* J. Louis - The visible VN mark remains a credit, but Azbil does not link externally from it. */
#vn_logo {
    cursor: default;
}

/* J. Woodward - Hide audio button (no audio guide) */
section[btns] my-btn.audio {
    display: none !important;
}

/* J. Woodward - Hide info button (not used in Azbil) */
section[btns][nav] my-btn.info {
    display: none !important;
}

/* J. Louis - Keep Azbil's two-button offset on desktop; mobile uses the shared flex cluster. */
@media screen and (min-width: 501px) {
    section[nav_dots],
    #group-title {
        right: 10rem !important;
    }
}

/* ========================================
   ACCORDION MENU INDENTS
   ======================================== */

/* J. Woodward - Solid red behind logo, fills aside padding area */
aside section[logo] {
    box-sizing: border-box;
    background-color: #A80005;
    margin: -2rem 0 2rem -2rem;
    padding: 2rem;
    width: calc(100% + 2rem);
    border-radius: var(--border-radius) var(--border-radius) 0 0;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* J. Woodward - Menu: all groups always open, no accordion collapse */
aside acc-menu {
    background-color: transparent;
}

aside acc-menu acc-menu-group {
    height: auto !important;
    overflow: visible !important;
}

aside acc-menu acc-menu-group > acc-menu-item-children {
    display: block !important;
    max-height: none !important;
    overflow: visible !important;
    opacity: 1 !important;
    transform: scale(1) !important;
}

/* J. Woodward - Group headers: no collapse, no arrow, centered text, subtle dark bg */
aside acc-menu acc-menu-group > acc-menu-item-title {
    pointer-events: none;
    cursor: default;
    text-align: center;
    padding-left: 1rem !important;
    padding-right: 1rem !important;
    background-color: rgba(168, 0, 5, 0.4) !important;
}

aside acc-menu acc-menu-group > acc-menu-item-title::after {
    display: none !important;
}

/* J. Woodward - Menu items: centered text, even padding */
aside acc-menu acc-menu-group > acc-menu-item-children > acc-menu-item > acc-menu-item-title,
aside acc-menu acc-menu-group > acc-menu-item-children > acc-menu-group > acc-menu-item-title {
    padding: 1rem !important;
    justify-content: center !important;
    text-align: center !important;
}


/* ========================================
   LINK HOTSPOT CUSTOMIZATIONS
   J. Woodward - PDF links styled as multispot buttons
   ======================================== */

/* J. Woodward - PDF icon from media/icons/ms_pdf.png */
hs-link .spot {
    width: 40px; height: 40px;
    border-radius: 50%;
    background: url(media/icons/ms_pdf.png) center / contain no-repeat;
    background-color: transparent;
}

hs-link .ring-big {
    width: 40px; height: 40px;
    border: 2px solid rgba(255, 255, 255, 0.6);
    border-radius: 50%;
    animation: hs_multispot_pulse 1.5s infinite linear;
}

hs-link .ring-small {
    display: none;
}

hs-link .popup {
    bottom: 100%;
}

/* ========================================
   EXTLINK HOTSPOT CUSTOMIZATIONS
   ======================================== */

hs-extlink .spot {
    width: 55px; height: 55px;
    border-radius: 8px;
    background-color: transparent;
}

hs-extlink .ring-big {
    width: 55px; height: 55px;
    border: none;
}

hs-extlink .ring-big .pulse-svg {
    position: absolute;
    left: 50%; top: 50%;
    width: 100%; height: 100%;
    transform: translate(-50%, -50%);
    overflow: visible;
}

hs-extlink .ring-big .pulse-svg path {
    fill: none;
    stroke: rgba(255,255,255,1);
    stroke-width: 4;
}

@keyframes hs_link_ring_pulse {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(1); }
    50% { opacity: 0.5; transform: translate(-50%, -50%) scale(1.15); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(1.3); }
}

hs-extlink .ring-small {
    width: 55px; height: 55px;
    border-radius: 8px;
    overflow: visible;
}

hs-extlink .ring-small .hs-bg {
    fill: #ffffff;
}

hs-extlink .ring-small .hs-icon {
    fill: var(--group-color, #000000);
}

hs-extlink .popup {
    bottom: calc(100% + 20px);
}

/* ========================================
   NAVIGATION HOTSPOT CUSTOMIZATIONS
   ======================================== */

hs-navigation {
    width: 55px !important;
    height: 55px !important;
}

hs-navigation .thumb {
    width: 55px; height: 55px;
    opacity: 0;
    border: none;
    box-shadow: none;
    background-color: transparent;
    transition: opacity var(--transition-duration), border var(--transition-duration), box-shadow var(--transition-duration), background-color var(--transition-duration);
}

hs-navigation:hover .thumb,
hs-navigation.open .thumb {
    opacity: 1;
    border: 2px solid rgba(255,255,255,1);
    box-shadow: 0 0 5px rgba(0,0,0,0.7);
    background-color: rgba(var(--group-color-rgb, 0,0,0), 0.3);
}

hs-navigation .thumb,
hs-navigation .thumb::after,
hs-navigation .thumb img {
    border-radius: 8px !important;
}

hs-navigation .thumb::after {
    box-shadow: none !important;
}

hs-navigation .ring-big {
    width: 55px; height: 55px;
    border-color: rgba(255,255,255,1);
    border-radius: 8px;
}

hs-navigation .icon {
    width: 55px; height: 55px;
}

hs-navigation .icon .hs-bg {
    fill: #ffffff;
}

hs-navigation .icon .hs-icon {
    fill: var(--group-color, #000000);
}

/* ========================================
   INFO HOTSPOT CUSTOMIZATIONS
   J. Woodward - Invisible info spots: hide icon + ring, tooltip only on hover
   ======================================== */

hs-info .spot {
    opacity: 0 !important;
}

hs-info .ring-big {
    display: none !important;
}

hs-info .ring-small {
    opacity: 0 !important;
}

/* J. Louis - Awards is the one Azbil info spot that keeps a visible pulsing control. */
hs-info[aria-label="Awards & Recognition"] .spot {
    opacity: 0 !important;
}

hs-info[aria-label="Awards & Recognition"] .ring-big {
    display: block !important;
}

hs-info[aria-label="Awards & Recognition"] .ring-small {
    opacity: 1 !important;
    background: url("media/icons/ms_pdf.png") center / contain no-repeat;
    color: transparent;
    font-size: 0 !important;
}

/* J. Louis - Give only the Awards press-release hotspot the client-selected link artwork. */
hs-link[aria-label="View Press Releases"] .spot {
    opacity: 0 !important;
}

hs-link[aria-label="View Press Releases"] .ring-small,
hs-info[aria-label="Awards & Recognition"] .ring-small {
    width: 40px;
    height: 40px;
}

hs-link[aria-label="View Press Releases"] .ring-small {
    display: block;
    background: url("media/icons/ms_link.png") center / contain no-repeat;
}

hs-link[aria-label="View Press Releases"] .ring-small svg {
    display: none !important;
}

/* J. Woodward - Lower tooltip + caret by 5px (closer to invisible hotspot) */
hs-info .popup {
    transform: translate(-50%, -5px) scale(0.5);
}

hs-info:hover .popup,
hs-info.open .popup {
    transform: translate(-50%, -5px) scale(1);
}

/* ========================================
   SPLASH SCREEN TEXT
   J. Woodward - Injected via custom.js
   ======================================== */

/* J. Woodward - Hide guided audio splash button (no audio guide for this tour)
   Selector must beat core splash_screen.css specificity (2,1,2) */
#splash_screen > div:not(.splash_overlay):not(#splash_spinner) button.audio_guided {
    display: none;
}

/* J. Woodward - Splash text scaled up to match 18px button (root font ~7.7px at typical viewport) */
.splash-header {
    color: #fff;
    font-family: var(--font-primary);
    font-size: 4.2rem;
    font-weight: 600;
    margin: 2.4rem 0 1.6rem;
    text-align: center;
}

.splash-text {
    color: rgba(255,255,255,0.85);
    font-family: var(--font-primary);
    font-size: 2.3rem;
    line-height: 1.6;
    max-width: 100rem;
    text-align: center;
    margin: 0 0 1.6rem;
    padding: 0 1.6rem;
}

.splash-disclaimer {
    color: rgba(255,255,255,0.5);
    font-family: var(--font-primary);
    font-size: 1.8rem;
    line-height: 1.4;
    max-width: 55rem;
    text-align: center;
    margin: 2.4rem 0 0;
    padding: 0 1.6rem;
}

/* J. Woodward - Entrance animations for splash text (match core splash timing) */
body.splash:not(.intro-zoom) #splash_screen:not(.exiting) > div:not(.splash_overlay) .splash-header,
body.splash:not(.intro-zoom) #splash_screen:not(.exiting) > div:not(.splash_overlay) .splash-text {
    opacity: 0;
    animation: splashFadeInUp 0.6s ease 0.7s forwards;
}

body.splash:not(.intro-zoom) #splash_screen:not(.exiting) > div:not(.splash_overlay) .splash-disclaimer {
    opacity: 0;
    animation: splashFadeInUp 0.6s ease 1.2s forwards;
}

/* ========================================
   SPLASH SCREEN BUTTONS
   ======================================== */

#splash_screen div button {
    width: 27rem;
}

/* ========================================
   MOBILE HOTSPOT SIZE REDUCTION
   ======================================== */

/* J. Louis - Preserve Azbil's wide hover-description plate without overriding mobile cluster geometry. */
@media screen and (min-width: 501px) {
    #bottom-right-cluster { width: 65rem; }
    section[description] { width: 60rem; }
}

/* ========================================
   DESC ZONE HOVER MODE
   J. Woodward - In scenes with description zones (BA/AA),
   the description box is hidden by default and fades in
   only when hovering over a polygon zone. Matches original
   3DVista behavior where no default scene description shows.
   ======================================== */

/* J. Woodward - Hide entire description section in desc-zone scenes */
body.desc-zone-mode section[description] {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

/* J. Woodward - Also hide the title-stage pill so nothing peeks through */
body.desc-zone-mode my-description div.title-stage {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}

/* J. Woodward - Fade in when hovering a desc zone */
body.desc-zone-mode.desc-zone-active section[description] {
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.35s ease;
}

body.desc-zone-mode.desc-zone-active my-description div.title-stage {
    opacity: 1;
    pointer-events: all;
    transition: opacity 0.35s ease;
}

@media screen and (max-width: 500px) {
    /* J. Louis - Keep the shared mobile dots visible while Azbil waits for a hover-description zone. */
    body.desc-zone-mode:not(.desc-zone-active) section[nav_dots] {
        visibility: visible;
        pointer-events: all;
    }

    /* J. Louis - Recreate the shared closed-description state: show the scene title and collapse only its long copy. */
    body.desc-zone-mode:not(.desc-zone-active) section[description] {
        width: calc(100vw - 2rem);
        opacity: 1;
        pointer-events: none;
    }

    body.desc-zone-mode:not(.desc-zone-active) my-description {
        padding: 0;
        margin-bottom: 0;
        background-color: transparent !important;
    }

    body.desc-zone-mode:not(.desc-zone-active) my-description::before {
        opacity: 0;
    }

    body.desc-zone-mode:not(.desc-zone-active) my-description div.title-stage {
        width: auto;
        padding: 0 1rem 0.8rem 1.2rem;
        margin-left: auto;
        text-align: right;
        opacity: 1;
        pointer-events: none;
    }

    body.desc-zone-mode:not(.desc-zone-active) my-description div.title-stage my-description-title {
        width: 100%;
        font-size: 1.8rem;
        color: #ffffff !important;
        text-shadow: 0 0 8px rgba(0, 0, 0, 0.8);
    }

    body.desc-zone-mode:not(.desc-zone-active) my-description div.title-stage div.spacer,
    body.desc-zone-mode:not(.desc-zone-active) my-description div.sa,
    body.desc-zone-mode:not(.desc-zone-active) my-description scroll-bar,
    body.desc-zone-mode:not(.desc-zone-active) my-description .audio_timeline {
        display: none;
    }
}

/* J. Woodward - Hide caret in desc-zone mode (not needed for hover info) */
body.desc-zone-mode #description-caret {
    display: none;
}

/* J. Louis - Keep the desktop description plate while removing its integrated caret tail. */
@supports (clip-path: shape(from 0 8px, arc to 8px 0 of 8px cw, hline to calc(100% - 8px), line to 50% 100%, close)) {
    @media screen and (min-width: 501px) {
        body.desc-zone-mode #description-caret {
            display: block;
            inset: 0;
            clip-path: inset(0 round var(--border-radius));
        }
    }
}

/* ========================================
   VIDEO SCREEN HOVER TOOLTIP
   J. Woodward - Follows cursor over TV screens, "Click to play"
   ======================================== */

.vs-tooltip {
    position: fixed;
    pointer-events: none;
    background-color: rgba(0, 0, 0, 1);
    color: #fff;
    padding: 1rem;
    border-radius: var(--tooltip-border-radius);
    font-size: 1.4rem;
    font-family: var(--font-primary);
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 9999;
    transform: translate(-50%, -100%);
}

.vs-tooltip.visible {
    opacity: 1;
}

/* ========================================
   CONTACT PAGE
   J. Louis - Responsive tour-local version of the legacy map/contact overlay.
   ======================================== */

body.azbil-contact-open {
    overflow: hidden;
}

#azbil-contact-page {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: grid;
    place-items: center;
    box-sizing: border-box;
    padding: clamp(1.6rem, 4vw, 4rem);
    background: rgba(0, 0, 0, 0.68);
    opacity: 0;
    transition: opacity 0.25s ease;
}

#azbil-contact-page[hidden] {
    display: none;
}

#azbil-contact-page.open {
    opacity: 1;
}

.azbil-contact-card {
    display: grid;
    grid-template-columns: minmax(0, 700fr) minmax(320px, 490fr);
    gap: 10px;
    width: min(1200px, calc(100vw - 8rem));
    height: min(700px, calc(100dvh - 8rem));
    min-height: 480px;
    overflow: hidden;
    background: #fff;
    box-shadow: 0 0 25px rgba(0, 0, 0, 0.3);
    transform: translateY(1.5rem) scale(0.985);
    transition: transform 0.25s ease;
}

#azbil-contact-page.open .azbil-contact-card {
    transform: translateY(0) scale(1);
}

.azbil-contact-map {
    min-width: 0;
    padding: 10px;
    background: #fff;
}

.azbil-contact-map iframe {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
}

.azbil-contact-details {
    position: relative;
    display: flex;
    min-width: 0;
    align-items: center;
    box-sizing: border-box;
    padding: clamp(5rem, 6vw, 8rem) clamp(3rem, 5vw, 6rem);
    overflow: auto;
    background: #fff;
    color: #111;
    font-family: var(--font-primary);
}

.azbil-contact-copy {
    width: 100%;
    font-size: clamp(1.8rem, 1.35vw, 2.2rem);
    line-height: 1.45;
}

/* J. Louis - Override the viewer-wide selection lock for readable contact information. */
.azbil-contact-copy,
.azbil-contact-copy * {
    user-select: text;
    touch-action: auto;
}

.azbil-contact-copy h2 {
    margin: 0 0 2.4rem;
    color: var(--primary-color);
    font-size: clamp(2.8rem, 2.4vw, 4rem);
    font-weight: 600;
    line-height: 1.15;
}

.azbil-contact-copy p,
.azbil-contact-copy address {
    margin: 0 0 2.4rem;
}

.azbil-contact-copy address {
    font-style: normal;
}

.azbil-contact-label,
.azbil-contact-organisation strong {
    font-weight: 600;
}

/* J. Louis - Clamp contact rows as single units so labels do not split from their values. */
.azbil-contact-channel {
    display: flex;
    flex-wrap: nowrap;
    align-items: baseline;
    gap: 0.45em;
    white-space: nowrap;
}

.azbil-contact-channel + .azbil-contact-channel {
    margin-top: 0.35rem;
}

.azbil-contact-copy a {
    color: #d97900;
    overflow-wrap: normal;
    word-break: normal;
    text-decoration: none;
}

.azbil-contact-copy a:hover,
.azbil-contact-copy a:focus-visible {
    text-decoration: underline;
}

.azbil-contact-close {
    position: absolute;
    top: 1.4rem;
    right: 1.4rem;
    display: grid;
    place-items: center;
    width: 4.8rem;
    height: 4.8rem;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #333;
    cursor: pointer;
    font-size: 0;
}

/* J. Louis - Draw the close mark geometrically so it stays centered inside its hover circle. */
.azbil-contact-close::before,
.azbil-contact-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 2.4rem;
    height: 2px;
    border-radius: 2px;
    background: currentColor;
    transform-origin: center;
}

.azbil-contact-close::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.azbil-contact-close::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}

.azbil-contact-close:hover,
.azbil-contact-close:focus-visible {
    background: rgba(var(--primary-color-rgb), 0.1);
    color: var(--primary-color);
    outline: none;
}

@media screen and (max-width: 760px) {
    #azbil-contact-page {
        align-items: center;
        padding: 1.6rem;
    }

    .azbil-contact-card {
        grid-template-columns: 1fr;
        grid-template-rows: minmax(240px, 42dvh) auto;
        gap: 0;
        width: calc(100vw - 3.2rem);
        height: min(900px, calc(100dvh - 3.2rem));
        min-height: 0;
        overflow: auto;
    }

    .azbil-contact-map {
        min-height: 240px;
        padding: 0;
    }

    .azbil-contact-details {
        align-items: flex-start;
        padding: 5.6rem 2.4rem 2.4rem;
        overflow: visible;
    }

    .azbil-contact-copy {
        font-size: clamp(1.45rem, 4vw, 1.8rem);
    }

    .azbil-contact-copy h2 {
        margin-bottom: 1.8rem;
        font-size: 3rem;
    }

    .azbil-contact-copy p,
    .azbil-contact-copy address {
        margin-bottom: 1.8rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    #azbil-contact-page,
    .azbil-contact-card {
        transition: none;
    }
}

@media screen and (max-width: 500px) {
    hs-navigation {
        width: 45px !important;
        height: 45px !important;
    }
    hs-navigation .thumb,
    hs-navigation .ring-big,
    hs-navigation .icon {
        width: 45px;
        height: 45px;
    }

    hs-link .spot,
    hs-link .ring-big,
    hs-link .ring-small,
    hs-extlink .spot,
    hs-extlink .ring-big,
    hs-extlink .ring-small {
        width: 45px;
        height: 45px;
    }

    hs-youtube .spot,
    hs-youtube .ring-big,
    hs-youtube .ring-small {
        width: 45px;
        height: 45px;
    }
}
