/* =====================================================
   TextHeadingOverlay block
   ===================================================== */

.block-tho {
    overflow: hidden;
    position: relative;
}

.block-tho .padih {
    padding: 60px 0;
}

.block-tho.whitebgth {
    background-color: var(--white);
}

.block-tho.graybgth {
    background-color: var(--light-gray);
}

.block-tho.dark {
    background-color: var(--dark-gray);
}

@media (max-width: 921.96px) {
    .block-tho .padih {
        padding: 60px 10px;
    }
}

@media (max-width: 575.96px) {
    .block-tho .padih {
        padding-left: 11px;
        padding-right: 11px;
    }
}

/* =====================================================
   Content overlay
   ===================================================== */
.tho-overlay {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 99999;
    background: rgba(25, 25, 25, .96);
    padding: 60px 20px;
    cursor: pointer;
}

.tho-overlay.is-open {
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Close button — matches search overlay style */
.tho-close {
    position: fixed;
    top: 28px;
    right: 40px;
    background: transparent;
    border: none;
    color: var(--white);
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    font-family: "Montserrat", sans-serif;
    font-weight: 700;
    font-size: 0.813rem;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    z-index: 100000;
    padding: 4px 0;
    transition: opacity 0.2s ease;
}

.tho-close:hover,
.tho-close:focus,
.tho-close:focus-visible,
.tho-close:active {
    opacity: 0.75;
    background: transparent !important;
    color: var(--white) !important;
    outline: none;
}

.tho-close svg {
    flex-shrink: 0;
}

/* Scrollable content box */
.tho-overlay-box {
    background: #fff;
    max-width: 820px;
    width: 100%;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
    padding: 50px 60px;
    cursor: default;
    position: relative;
    flex-shrink: 0;
}

.tho-overlay-content {
    font-family: "Montserrat", sans-serif;
    font-size: 1rem;
    line-height: 1.7;
    color: var(--dark-gray);
}

.tho-overlay-content h2,
.tho-overlay-content h3,
.tho-overlay-content h4,
.tho-overlay-content h5 {
    font-weight: 700 !important;
    margin-top: 1.5em;
    margin-bottom: 0.5em;
}

.tho-overlay-content h3 {
    font-size: 1.625rem !important;
}

.tho-overlay-content p {
    margin-bottom: 1em;
}

.tho-overlay-content a {
    color: var(--dark-gray);
    text-decoration: underline;
}

.tho-overlay-content ul,
.tho-overlay-content ol {
    padding-left: 1.5em;
    margin-bottom: 1em;
}

@media (max-width: 767px) {
    .tho-overlay {
        padding: 60px 12px;
    }

    .tho-close {
        right: 20px;
        top: 22px;
    }

    .tho-overlay-box {
        padding: 30px 24px;
        max-height: calc(100vh - 120px);
    }
}
