/**
 * Takeover Modal Styles
 */

.takeover-modal {
    position: fixed;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 999999;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.takeover-modal.is-visible {
    opacity: 1;
}

/* Backdrop variants */
.takeover-modal--backdrop-dark {
    background: rgba(0, 0, 0, 0.75);
}

.takeover-modal--backdrop-light {
    background: rgba(255, 255, 255, 0.55);
}

.takeover-modal--backdrop-none {
    background: transparent;
    pointer-events: none;
}

.takeover-modal--backdrop-none .takeover-modal__container {
    pointer-events: auto;
}

/* Modal container — full width so background fills sides where image doesn't reach */
.takeover-modal__container {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    max-height: 90vh;
    border-radius: 4px;
    box-shadow: 0 12px 60px rgba(0, 0, 0, 0.35);
}

.takeover-modal__container--no-bg {
    box-shadow: none;
    overflow: hidden;
    transform: scale(0.96);
    transition: transform 0.3s ease;
}

.takeover-modal.is-visible .takeover-modal__container {
    transform: scale(1);
}

/* Image — contained so full image always visible; background fills the rest */
.takeover-modal__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

/* Clickable image link — fills container so background shows around image */
.takeover-modal__image-link {
    display: block;
    width: 100%;
    height: 100%;
    line-height: 0;
}

/* Dynamic height */
.takeover-modal--dynamic-height .takeover-modal__container {
    width: auto;
    height: auto;
    max-height: none;
}

.takeover-modal--dynamic-height .takeover-modal__image {
    width: auto;
    height: auto;
    max-width: calc(100vw - 40px);
    max-height: 90vh;
    object-fit: unset;
}

.takeover-modal--dynamic-height .takeover-modal__image-link {
    width: auto;
    height: auto;
}

.takeover-modal__image-link:hover .takeover-modal__image {
    opacity: 0.92;
    transition: opacity 0.2s ease;
}

/* Close button — beats body:not(.wp-admin) button:not(.cabb-btn-primary) (0,2,1) with (0,3,1) */
body:not(.wp-admin) .takeover-modal button.takeover-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    z-index: 1;
    transition: background 0.2s ease;
}

body:not(.wp-admin) .takeover-modal button.takeover-modal__close:hover {
    background: rgba(0, 0, 0, 0.8);
}

.takeover-modal__close svg {
    display: block;
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

/* Body scroll lock */
body.takeover-modal-open {
    overflow: hidden;
}

/* Responsive */
@media (max-width: 960px) {
    .takeover-modal {
        padding: 12px;
    }
}
