/**
 * FSJ Ad Rotator Styles
 *
 * @package 3RNet_FSJ
 */

/* Main container */
.fsj-ad-rotator {
    position: relative;
    overflow: visible;
    background: transparent;
    margin-inline: auto;
}

/* Advertisement label below all ad types */
.fsj-ad-rotator::after {
    content: "Advertisement";
    display: block;
    text-align: center;
    font-size: 10px;
    color: #999;
    margin-top: 0.12em;
}

/* Container sizing by type */
.fsj-ad-rotator[data-type="1"] { width: 150px; height: 300px; }
.fsj-ad-rotator[data-type="2"] { width: 292px; height: 72px; }
.fsj-ad-rotator[data-type="3"] { width: 216px; height: 304px; }
.fsj-ad-rotator[data-type="0"] { width: 100%; max-width: 300px; height: auto; }

/* Layers */
.fsj-ad-container {
    position: relative;
    width: 100%;
    height: 100%;
    }

.fsj-ad-layer {
    position: absolute;
    top: 0;
    left: 0;
    border: 1px solid rgb(244, 244, 244);
    width: calc(100% - 8px);
    height: calc(100% - 8px);
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
    display: flex;
    flex-direction: column;
    padding: 0 0 .42em;
    box-sizing: border-box;
    /* background: var(--wp--preset--color--custom-fsj-light) !important; */
    background: white !important;
    pointer-events: none; /* Prevent clicks on invisible layers */
    margin: 4px;
    box-shadow: 0 0 3px rgba(0, 0, 0, 0.1);
}

.fsj-ad-layer.active {
    opacity: 1;
    pointer-events: auto; /* Allow clicks on visible layer */
    z-index: 1; /* Ensure active layer is on top */
}

/* Fit image within container without cropping */
.fsj-ad-layer img {
    width: 100%;
    flex: 1;
    object-fit: cover;
    display: block;
    min-height: 0;
}

/* Ad title styling */
.fsj-ad-title {
    padding: 8px 5px;
    text-align: center;
    font-size: 14px;
    line-height: 1.3;
    color: #333;
    background: transparent;
    font-weight: 500;
    flex-shrink: 0;
}

/* Link styling */
.fsj-ad-link {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Ensure title inherits link color */
.fsj-ad-link .fsj-ad-title {
    color: inherit;
}

/* No ads message */
.fsj-no-ads {
    padding: 20px;
    text-align: center;
    color: #999;
    font-style: italic;
}