
/* KYMJOJOBS Ad System - Everywhere Header & Footer Styles V3 - Full Width & Improved */

/* --- Global Reset for Ad Bars --- */
.everywhere-ad-header,
.everywhere-ad-footer {
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
}

/* --- Header Ad Bar --- */
.everywhere-ad-header {
    position: sticky;
    top: 0;
    z-index: 999;
    background-color: #f1f1f1; /* A lighter background */
    border-bottom: 1px solid #ddd;
    display: flex;
    transition: transform 0.4s ease;
    overflow: hidden; /* To contain potential overflowing content */
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);

}
.everywhere-ad-header.collapsed {
    transform: translateY(-100%);
}
.ad-carousel-container {
    flex-grow: 1;
    overflow: hidden;
    height: 90px; /* Standard leaderboard ad height */
    position: relative; /* Needed for slide positioning */
}
.ad-carousel-track {
    display: flex;
    height: 100%;
}
/* --- Replace with these new rules --- */
.ad-slide {
    flex-shrink: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.8s ease-in-out;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 5; /* Default state is in the back */
    pointer-events: none; /* Make non-visible slides unclickable */
}
.ad-slide.active {
    opacity: 1;
    z-index: 10; /* Bring the active slide to the very front */
    pointer-events: auto; /* Make ONLY the active slide clickable */
}



.ad-slide a {
    display: block;
    width: 100%;
    height: 100%;
}
.ad-slide a img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover; /* This makes the image fill the space */ 
}



/* --- Toggle Button --- */
.toggle-ad-header {
    background-color: #e9e9e9;
    border: none;
    border-left: 1px solid #ddd;
    color: #555;
    cursor: pointer;
    padding: 0 15px;
    height: 90px;
    align-self: stretch;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.5em; /* Larger arrow */
}
.toggle-ad-header:hover {
    background-color: #e1e1e1;
}
.toggle-ad-header .arrow-up {
    border: solid #555;
    border-width: 0 2px 2px 0;
    display: inline-block;
    padding: 6px; /* Larger arrow */
    transform: rotate(45deg);
    transition: transform 0.3s ease;
}
.everywhere-ad-header.collapsed .toggle-ad-header .arrow-up {
    transform: rotate(-135deg); /* Point down when collapsed */
}

/* --- Footer Ad Bar --- */
.site-footer-everywhere {
    background-color: #212529; /* A professional dark footer color */
    color: #adb5bd;
    overflow: hidden; /* To contain potential overflowing content */
    margin-left: calc(50% - 50vw);
    margin-right: calc(50% - 50vw);
    width: 100vw;
    box-shadow: 0 -2px 8px rgba(0, 0, 0, 0.1);

}
.everywhere-ad-footer {
    border-top: 1px solid #495057; /* Added top border for better separation */
    border-bottom: 1px solid #495057;
}
.site-info-everywhere {
    text-align: center;
    padding: 25px 20px;
    font-size: 0.9em;
}
.site-info-everywhere a {
    color: #ffffff;
    text-decoration: none;
    font-weight: bold;
}
.site-info-everywhere a:hover {
    text-decoration: underline;
}

/* --- Responsive Rule to Hide Footer Ads on Mobile --- */
@media (max-width: 768px) {
    .everywhere-ad-footer {
        display: none;
    }
}


/* --- NEW: Header Ad Label & Controls --- */
.ad-header-controls {
    display: flex;
    flex-direction: column; /* Stacks the text on top of the button */
    align-items: center;
    justify-content: center;
    background-color: #ffffff;
    border-left: 1px solid #ddd;
    height: 90px;
    flex-shrink: 0; /* Prevents the container from shrinking */
}

.ad-header-label {
    color: #888;
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0 10px;
}

.toggle-ad-header {
    /* Remove properties now handled by the parent */
    height: auto;
    align-self: auto;
    border-left: none;
    background-color: transparent;
    padding: 10px 15px 5px 15px; /* Adjust padding around arrow */
}
.toggle-ad-header:hover {
    background-color: transparent;
}


/* --- Prevent Image Download --- */
.kymjojobs-ad-wrapper a img.no-download {
    pointer-events: none;
}

/* --- In-Content Ad Grid Styles (V3 - Large Size & Single Ad on Mobile) --- */
.kymjo-in-content-ad-grid {
    display: grid;
    grid-template-columns: 1fr 1fr; /* Two columns on desktop */
    gap: 25px; /* A little more space for larger ads */
    margin: 40px 0;
}

.kymjo-in-content-ad-card {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.1);
    /* NEW: Set the aspect ratio to match your 800x600 request */
    aspect-ratio: 800 / 400; 
}

/* This targets the carousel container we added inside our card */
.kymjo-in-content-ad-card .ad-carousel-container {
    height: 100%;
    width: 100%;
}

.kymjo-ad-label {
    position: absolute;
    top: 15px;
    right: 15px;
    background-color: rgba(0, 0, 0, 0.6);
    color: #fff;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: bold;
    border-radius: 5px;
    z-index: 15;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

/* --- Responsive Rule for Mobile --- */
@media (max-width: 768px) {
    .kymjo-in-content-ad-grid {
        /* Change to a single column layout */
        grid-template-columns: 1fr; 
    }

    /* NEW: This rule hides the second ad (and any others) on mobile */
    .kymjo-in-content-ad-grid .kymjo-in-content-ad-card:nth-child(n+2) {
        display: none;
    }
}


.kymjo-in-content-ad-card video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}











/* --- Click-to-Play Video Ad Styles --- */

/* The main container for the ad (this is a new element from the PHP change) */
.kymjo-ad-wrapper {
    position: relative; /* Needed for the overlay */
    cursor: pointer;
    display: block;
    line-height: 0; /* Removes extra space below image/video */
}

/* Style the video element itself inside the new wrapper */
.kymjo-ad-wrapper video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Hide the default video controls until the user interacts */
.kymjo-ad-wrapper video::-webkit-media-controls {
    display: none !important;
}

/* The play button overlay */
.kymjo-ad-wrapper .play-button-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.3); /* Darkens the image slightly */
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* The triangle play icon shape */
.kymjo-ad-wrapper .play-button-overlay::after {
    content: '';
    display: block;
    width: 0;
    height: 0;
    border-top: 20px solid transparent;
    border-bottom: 20px solid transparent;
    border-left: 35px solid rgba(255, 255, 255, 0.9);
    border-radius: 5px;
}

/* When the video is playing, hide the overlay */
.kymjo-ad-wrapper.is-playing .play-button-overlay {
    opacity: 0;
    pointer-events: none; /* Make it unclickable when hidden */
}

/* When playing, show the native controls if user hovers */
.kymjo-ad-wrapper.is-playing:hover video::-webkit-media-controls {
    display: block !important;
}