/* 
 * Event & Festival Mode CSS
 * Handles Grayscale mourning mode, ribbons, banners, and popups.
 */

/* 1. Black Ribbon at Logo */
.mourning-ribbon {
    position: absolute;
    top: -5%;
    left: -5%;
    width: 25%;
    max-width: 50px;
    min-width: 20px;
    z-index: 50;
    pointer-events: none;
}

/* 2. Event Banner */
.event-banner {
    display: block;
    width: 100%;
    text-align: center;
    background: #111; /* Dark background behind image */
    overflow: hidden;
}
.event-banner img {
    max-width: 100%;
    height: auto;
    display: inline-block;
    vertical-align: middle;
}

/* 3. Event Popup Modal */
.event-popup-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.8);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.4s ease;
}
.event-popup-overlay.show {
    opacity: 1;
    pointer-events: auto;
}
.event-popup-content {
    position: relative;
    max-width: 90%;
    max-height: 90vh;
    animation: popupFadeIn 0.5s ease forwards;
    transform: scale(0.9);
}
.event-popup-overlay.show .event-popup-content {
    transform: scale(1);
}
.event-popup-content img {
    max-width: 100%;
    max-height: 90vh;
    border-radius: 8px;
    display: block;
    box-shadow: 0 10px 30px rgba(0,0,0,0.5);
}
.event-popup-close {
    position: absolute;
    top: -15px;
    right: -15px;
    background: #fff;
    color: #333;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    font-size: 24px;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 4px 10px rgba(0,0,0,0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.event-popup-close:hover {
    background: #f1f1f1;
}

@keyframes popupFadeIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 4. Grayscale Logic (Mourning Mode) */
/* We apply grayscale selectively to avoid graying out WooCommerce product images */
body.event-color-mourning .site-header,
body.event-color-mourning .site-footer,
body.event-color-mourning img:not(.woocommerce img):not(.product-image):not(.attachment-woocommerce_thumbnail),
body.event-color-mourning .elementor-background-overlay {
    filter: grayscale(100%);
}

body.event-color-soft_mourning .site-header,
body.event-color-soft_mourning .site-footer,
body.event-color-soft_mourning img:not(.woocommerce img):not(.product-image):not(.attachment-woocommerce_thumbnail),
body.event-color-soft_mourning .elementor-background-overlay {
    filter: grayscale(50%);
}

/* 5. Footer Logo Size Constraint (For Ribbon Alignment) */
.footer-logo .relative,
.mobile-logo .relative,
.footer-logo .custom-logo-link,
.mobile-logo .custom-logo-link {
    display: inline-block !important;
    max-width: 100%;
}

.footer-logo img.custom-logo {
    max-width: 200px !important;
    width: 100%;
    height: auto;
}

.mobile-logo img.custom-logo {
    max-width: 160px !important;
    width: 100%;
    height: auto;
}
