/* Calcutta Club Newsletter Frontend Styles - Optimized for Performance */

.calcutta-newsletter {
    font-family: 'Belgrano', serif;
    background-color: #ffffff;
    margin: 0;
    padding: 0;
    contain: layout style;
    will-change: auto;
}

.calcutta-newsletter * {
    box-sizing: border-box;
}

/* Past Events Image Gallery Styles */
.past-event-images-collage {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 4px;
    margin: 15px 0;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    overflow: hidden;
}

.collage-image-wrapper {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
    cursor: pointer;
    transition: opacity 0.3s ease;
}

.collage-image-wrapper:hover {
    opacity: 0.9;
}

.past-event-collage-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: opacity 0.3s ease;
}

.collage-image-wrapper:hover .past-event-collage-img {
    opacity: 0.85;
}

.more-images-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff !important;
    font-size: 28px;
    font-weight: bold;
    pointer-events: none;
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.8);
}

.past-event-view-more-btn {
    background-color: #D94600;
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: background-color 0.3s ease;
    position: relative;
    z-index: 1;
    pointer-events: auto;
    display: inline-block;
}

.past-event-view-more-btn:hover {
    background-color: #b83800;
}

.past-event-view-more-btn:active {
    background-color: #a03000;
    transform: scale(0.98);
}

/* Past Events Popup Modal Styles */
.past-events-popup-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.95);
    overflow-y: auto;
    animation: fadeIn 0.3s ease;
}

.past-events-popup-modal.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.past-events-popup-content {
    position: relative;
    margin: 20px auto;
    padding: 20px;
    max-width: 1200px;
    width: 95%;
}

.past-events-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    color: white;
}

.past-events-popup-header .past-events-popup-title,
.past-events-popup-modal .past-events-popup-title,
.past-events-popup-title {
    font-size: 24px;
    font-weight: 900;
    color: #ffffff !important;
    text-shadow: none !important;
    opacity: 1 !important;
    filter: none !important;
}

.past-events-popup-close {
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.past-events-popup-close:hover {
    color: #bbb;
}

.past-events-popup-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin-top: 20px;
}

.past-events-popup-grid-item {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.3s ease;
    background: #333;
}

.past-events-popup-grid-item:hover {
    transform: scale(1.05);
}

.past-events-popup-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

/* Image Slider/Lightbox Styles */
.past-events-image-slider {
    display: none;
    position: fixed;
    z-index: 10001;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.98);
    overflow: hidden;
    animation: fadeIn 0.3s ease;
}

.past-events-image-slider.active {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.slider-header {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.8), transparent);
    z-index: 10;
}

.slider-header .slider-counter,
.past-events-image-slider .slider-header .slider-counter,
.slider-counter {
    color: #ffffff !important;
    font-size: 18px;
    font-weight: 900;
    background: rgba(0, 0, 0, 0.8);
    padding: 10px 16px;
    border-radius: 8px;
    text-shadow: none !important;
    display: inline-block;
    border: 1px solid rgba(255, 255, 255, 0.3);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
    opacity: 1 !important;
    filter: none !important;
}

.slider-header .slider-counter *,
.past-events-image-slider .slider-header .slider-counter *,
.slider-counter *,
.slider-counter span,
.slider-counter .current-slide,
.slider-counter .total-slides,
.slider-header .slider-counter span,
.slider-header .slider-counter .current-slide,
.slider-header .slider-counter .total-slides {
    color: #ffffff !important;
    text-shadow: none !important;
    font-weight: 900 !important;
    opacity: 1 !important;
    filter: none !important;
}

.slider-close {
    color: white;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    line-height: 1;
    transition: color 0.3s ease;
    background: none;
    border: none;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-close:hover {
    color: #bbb;
}

.slider-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 80px 20px 20px;
}

.slider-image-wrapper {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.slider-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
    border-radius: 8px;
    user-select: none;
    -webkit-user-drag: none;
    transition: transform 0.1s ease-out;
    touch-action: none;
    -webkit-touch-callout: none;
    -webkit-tap-highlight-color: transparent;
}

.slider-image.zoomed {
    cursor: zoom-out;
    transition: none;
}

/* Panning cursors */
.slider-image {
    cursor: zoom-in;
}
.slider-image.panning,
.slider-image.zoomed {
    cursor: grab;
}
.slider-image.panning {
    cursor: grabbing;
}

.slider-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 0;
    font-size: 24px;
    cursor: pointer;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
    z-index: 10;
    margin: 0;
    line-height: 50px;
    text-align: center;
    font-family: Arial, sans-serif;
}

.slider-nav * {
    line-height: 1;
    display: inline-block;
    vertical-align: middle;
}

.slider-nav:hover {
    background: rgba(255, 255, 255, 0.4);
}

.slider-nav.prev {
    left: 20px;
}

.slider-nav.next {
    right: 20px;
}

.slider-nav:disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.slider-footer {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    gap: 10px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8), transparent);
    z-index: 10;
}

.slider-zoom-btn {
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border: none;
    padding: 10px 15px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 16px;
    transition: background-color 0.3s ease;
}

.slider-zoom-btn:hover {
    background: rgba(255, 255, 255, 0.4);
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .past-event-images-collage {
        grid-template-columns: repeat(auto-fit, minmax(100px, 1fr));
        gap: 8px;
    }
    
    .past-events-popup-grid {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
    }
    
    .slider-nav {
        width: 40px;
        height: 40px;
        padding: 0;
        font-size: 20px;
        margin: 0;
        line-height: 1;
    }
    
    .slider-nav.prev {
        left: 10px;
    }
    
    .slider-nav.next {
        right: 10px;
    }
    
    .slider-image {
        max-height: 85vh;
    }
    
    .past-events-popup-content {
        padding: 15px;
        width: 98%;
    }
}

@media screen and (max-width: 500px) {
    .past-event-images-collage {
        grid-template-columns: repeat(2, 1fr);
        gap: 2px;
    }
    
    .past-events-popup-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .slider-nav {
        width: 35px;
        height: 35px;
        padding: 0;
        font-size: 18px;
        margin: 0;
        line-height: 1;
    }
    
    .slider-nav.prev {
        left: 5px;
    }
    
    .slider-nav.next {
        right: 5px;
    }
}
