/* === WORKS SECTION VISIBILITY FIX === */

/* Show the big "SOLUTIONS" intro title when works_intro or works section is active */
[data-current_section="works_intro"] .works-intro-title,
[data-current_section="works"] .works-intro-title {
    opacity: 1 !important;
}
[data-current_section="works_outro"] .works-intro-title {
    opacity: 0 !important;
}

/* Ensure Works items text is visible when section is active */
[data-current_section="works"] .Works__container,
[data-current_section="works_outro"] .Works__container {
    opacity: 1 !important;
    pointer-events: auto !important;
}



/* Ensure Works__content_inner is visible */
[data-current_section="works"] .Works__content_inner,
[data-current_section="works_outro"] .Works__content_inner {
    opacity: 1 !important;
    visibility: visible !important;
}

/* Fix for Works Detail Marquee */
.PageWorksDetail__bg_virtual,
.PageWorksDetail__bg_display {
    white-space: nowrap !important;
}

/* Hide dates and [Platform] labels from homepage Works and detail pages */
.Works__item_info,
.Works__item_date,
.PageWorksDetail__date,
.PageWorksDetail__category,
.PageWorksDetail__infoGroup,
.WorksListItem__date,
.WorksListItem__category,
.WorksListItem__group {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    height: 0 !important;
    overflow: hidden !important;
}

/* Floating Contact Button Global */
html[dir="rtl"] .floating-contact {
    left: 30px !important;
    right: auto !important;
}
html[dir="rtl"] .floating-book-demo {
    left: 170px !important;
    right: auto !important;
}

.floating-contact, .floating-book-demo {
    position: fixed;
    top: 30px;
    background-color: #fff;
    color: #000;
    padding: 12px 24px;
    border-radius: 9999px;
    text-decoration: none;
    font-family: 'Inter', sans-serif;
    font-weight: 500;
    font-size: 14px;
    z-index: 10000;
    transition: opacity 0.3s ease, transform 0.3s ease;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    height: 48px;
    width: max-content;
    box-sizing: border-box !important;
}

.floating-contact {
    right: 30px;
}

.floating-book-demo {
    right: 170px;
}

.floating-contact:hover, .floating-book-demo:hover {
    background-color: #f0f0f0;
    transform: translateY(-2px);
}

@media (max-width: 768px) {
    .floating-contact {
        top: 75px;
        right: 20px;
    }
    .floating-book-demo {
        top: 75px;
        right: 160px;
    }
    html[dir="rtl"] .floating-contact {
        left: 20px !important;
        right: auto !important;
    }
    html[dir="rtl"] .floating-book-demo {
        left: 160px !important;
        right: auto !important;
    }
}



/* Global Mobile View Overrides */
@media not screen and (min-width: 769px) {

    html,
    body {
        /* Prevent horizontal overflow on mobile devices */
        overflow-x: clip !important;
        width: 100vw;
    }

    /* Adjust floating contact button for smaller screens */
    .floating-contact {
        top: 75px !important;
        right: 20px !important;
        padding: 10px 16px !important;
        font-size: 13px !important;
        height: 40px !important;
    }

    /* Ensure text wraps nicely on mobile */
    h1,
    h2,
    h3,
    h4,
    h5,
    p,
    span {
        word-break: break-word;
    }

    /* Adjust padding for inner layout containers on mobile */
    .Layout__inner {
        padding-left: 15px !important;
        padding-right: 15px !important;
    }
}

/* Fix header and footer link colors across all pages */
.Header__nav_item a,
.Header__nav_item a span,
.Footer__pageLink,
.Footer__privacyLicense_link,
.Footer__contact_button_text {
    color: #ffffff !important;
    text-decoration: none !important;
}

.Header__nav_item a:hover,
.Header__nav_item a:hover span,
.Footer__pageLink:hover,
.Footer__privacyLicense_link:hover {
    color: #cccccc !important;
}
/* Fix colors for contact and team page titles and links */
.PageContact__head,
.PageAbout__head,
.PageContact__button,
.PageContact__button_en,
.PageContact__button_jp {
    color: #ffffff !important;
    background-color: transparent !important;
    text-decoration: none !important;
}

/* Ensure hover states are visible but still light */
.PageContact__button:hover .PageContact__button_en,
.PageContact__button:hover .PageContact__button_jp {
    color: #cccccc !important;
}

/* Fix text colors for contact and works pages */
.PageContact__textSection_jp,
.PageContact__textSection_en,
.PageWorks__head,
.WorksListItem__title,
.WorksListItem__date,
.WorksListItem__category,
.WorksListItem__info p,
.PageWorksDetail__head,
.PageWorksDetail__title,
.PageWorksDetail__date,
.PageWorksDetail__category,
.PageWorksDetail__body,
.PageWorksDetail__bg_virtual,
.PageWorksDetail__bg_display {
    color: #ffffff !important;
}

/* Force white text on all works detail elements */
.PageWorksDetail__body p,
.PageWorksDetail__body h1,
.PageWorksDetail__body h2,
.PageWorksDetail__body h3,
.PageWorksDetail__body li,
.PageWorksDetail__body span,
.PageWorksDetail__body div {
    color: #ffffff !important;
}


/* Hide old header contact button */
.Header__contact {
    display: none !important;
}


.Header__lang_btn {
    pointer-events: auto !important;
    position: relative !important;
    z-index: 99999 !important;
    display: inline-block !important;
}

/* RTL Layout support for Hebrew */
html[dir="rtl"] {
    text-align: right;
    direction: rtl;
}

html[dir="rtl"] .Header__nav {
    flex-direction: row-reverse;
}

html[dir="rtl"] .Header__right_controls {
    margin-right: auto;
    margin-left: 0;
}

html[dir="rtl"] .Faq__question {
    flex-direction: row-reverse;
}

html[dir="rtl"] .SlotButton__button {
    text-align: center;
}

/* Fix Header in RTL by letting flexbox do its job, but fixing the margin of the EN/HE button */
html[dir="rtl"] .Header__lang_btn {
    margin-right: 0 !important;
    margin-left: 15px !important;
}

/* Works Hover Tooltip */
#works-hover-tooltip {
    display: none !important;
}
@media (max-width: 768px) {
    #works-hover-tooltip {
        font-size: 16px;
        padding: 8px 16px;
    }
}

/* Language Toggle Visibility */
html[lang="en"] .he-text { display: none !important; }
html[lang="he"] .en-text { display: none !important; }

/* In case of no lang set, default to EN */
html:not([lang="he"]) .he-text { display: none !important; }

/* Fix Header layout and prevent overlap */
.Header__right_controls {
    display: flex;
    align-items: center;
    white-space: nowrap;
    flex-wrap: nowrap;
    z-index: 1000;
}
html[dir="rtl"] .Header__right_controls {
    margin-right: 0 !important;
    margin-left: 0 !important;
}
html[dir="rtl"] .Header__lang_btn {
    margin-right: 0px !important;
    margin-left: 20px !important;
}
.Header__lang_btn {
    margin-right: 20px !important;
    margin-left: 0px !important;
}

/* Robust Header Layout */
.Header__container {
    justify-content: space-between !important;
}
.Header__nav {
    position: static !important;
    transform: none !important;
    flex: 1;
    justify-content: center;
}
html[dir="rtl"] .Header__nav {
    flex-direction: row !important; /* Keep the items in logical order, or let RTL reverse them naturally */
}
.Header__right_controls {
    flex-shrink: 0;
}
.Header__logo {
    flex-shrink: 0;
}

/* Push the language button away from the floating contact button */
.Header__lang_btn {
    margin-right: 180px !important;
}
html[dir="rtl"] .Header__lang_btn {
    margin-left: 180px !important;
    margin-right: 0px !important;
}

@media (max-width: 768px) {
    .Header__lang_btn {
        margin-right: 140px !important;
    }
    html[dir="rtl"] .Header__lang_btn {
        margin-left: 140px !important;
        margin-right: 0px !important;
    }
}

/* ----------------------------------------- */
/* ABSOLUTE VISIBILITY OVERRIDES FOR HEADER */
/* ----------------------------------------- */
/* 
Because .Header__nav_item a has display: inline-block, 
it sometimes breaks out of its parent display: none 
depending on how the browser evaluates flex and inline boxes.
This forces the inner elements themselves to be fully hidden. 
*/

html[lang="en"] .he-text,
html[lang="en"] .he-text * {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

html[lang="he"] .en-text,
html[lang="he"] .en-text * {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

html:not([lang="he"]) .he-text,
html:not([lang="he"]) .he-text * {
    display: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
    position: absolute !important;
    width: 0 !important;
    height: 0 !important;
    pointer-events: none !important;
}

/* ----------------------------------------- */
/* NEW HEADER MENU ITEM VISIBILITY CONTROLS */
/* ----------------------------------------- */
html[lang="en"] .he-nav-item {
    display: none !important;
}

html[lang="he"] .en-nav-item {
    display: none !important;
}

html:not([lang="he"]) .he-nav-item {
    display: none !important;
}


/* Prevent slider from inverting in Hebrew */
.PageWorksDetail__thumbnailSliderWrapper,
.PageWorksDetail__thumbnailSlider,
.swiper {
    direction: ltr !important;
}

html[lang="he"] .PageWorksDetail__thumbnailItem {
    direction: rtl !important;
}

/* Hide Privacy Policy from footer */
.Footer__privacyLicense {
    display: none !important;
}

/* === PURPLE TINT OVERLAY FOR KV (HERO) & VISION SECTIONS === */
/* Adds a darker, purplish tone on top of the WebGL background
   when the user is on the hero ("kv") or "vision" section. */
.Layout__gl_inner::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background: rgba(59, 22, 110, 0); /* deep purple, starts transparent */
    mix-blend-mode: multiply;
    opacity: 0;
    transition: opacity 0.6s ease, background-color 0.6s ease;
}

body[data-current_section="mission"] .Layout__gl_inner::after,
body[data-current_section="vision"] .Layout__gl_inner::after {
    background: rgba(58, 22, 110, 0.55); /* adjust alpha for stronger/weaker tint */
    opacity: 1;
}