/* Newsletter Section */
.newsletter-section {
    padding: 6rem 0;
    background-color: #f8f9fa;
}

.newsletter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

.newsletter-card {
    background: #000;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0,0,0,0.05);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    position: relative;
    height: 380px; /* Setting fixed height to allow images to expand fully */
    cursor: pointer;
}

.newsletter-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 15px 30px rgba(0,0,0,0.2);
}

.newsletter-card .img-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

/* Gradient overlay so white text is readable at the bottom */
.newsletter-card .img-wrapper::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 60%;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0) 100%);
    z-index: 2;
}

.newsletter-card img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0;
    transition: opacity 1s ease-in-out, transform 0.7s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.newsletter-card img.active {
    opacity: 1;
}

.newsletter-card:hover img.active {
    transform: scale(1.08); /* slight zoom in background */
}

/* Move text content on top of image, at the bottom */
.newsletter-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.5rem 1.5rem;
    display: flex;
    flex-direction: column;
    z-index: 3;
    pointer-events: none; /* Let hover pass through to image */
}

.newsletter-info h3 {
    font-family: 'Montserrat', sans-serif;
    color: #ffffff;
    font-weight: 700;
    font-size: 1.6rem;
    margin-bottom: 0.3rem;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

.newsletter-info p {
    color: #e0e0e0;
    font-size: 0.95rem;
    margin-bottom: 0;
    line-height: 1.4;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
    pointer-events: auto;
    display: -webkit-box;
    -webkit-line-clamp: 1; /* Limit to 1 line */
    line-clamp: 1;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.read-more {
    display: none; /* User doesn't want "Read edition" visible here per reference image, just title and date */
}

/* Calendar Wrapper (Background container) */
.calendar-wrapper {
    background: #ffffff;
    border-radius: 28px;
    padding: 3rem;
    box-shadow: 0 15px 50px rgba(0,0,0,0.04);
    border: 1px solid rgba(0,0,0,0.03);
    margin: 3rem auto 0;
}

.calendar-top-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #f0f0f0;
}

.calendar-year-title {
    font-family: 'Montserrat', sans-serif;
    font-weight: 700;
    color: #1a1a1a;
    font-size: 1.5rem;
    margin: 0;
}

@media (max-width: 768px) {
    .newsletter-grid {
        grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
    }
    .calendar-wrapper {
        padding: 1.5rem;
        border-radius: 20px;
    }
    .calendar-top-bar {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        align-items: center;
    }
}

/* Previous Years Button */
.btn-load-previous {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    padding: 16px 36px;
    background: #1a1a1a;
    color: #fff;
    border: none;
    border-radius: 50px;
    font-size: 1.05rem;
    font-weight: 700;
    font-family: 'Montserrat', sans-serif;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}

.btn-load-previous:hover {
    background: #ea1d24;
    transform: translateY(-4px);
    box-shadow: 0 10px 25px rgba(234, 29, 36, 0.3);
}

.btn-top-right {
    padding: 12px 24px;
    font-size: 0.9rem;
    gap: 10px;
}

/* Dropdown Menu Styles */
.year-dropdown-container {
    position: relative;
    display: inline-block;
}

.year-dropdown-menu {
    position: absolute;
    top: 115%;
    right: 0;
    background: white;
    box-shadow: 0 10px 30px rgba(0,0,0,0.1);
    border-radius: 12px;
    width: 160px;
    padding: 0.5rem;
    display: none;
    flex-direction: column;
    gap: 4px;
    z-index: 100;
    border: 1px solid #eee;
    animation: fadeInDropdown 0.2s ease;
}

.year-dropdown-menu.show {
    display: flex;
}

@keyframes fadeInDropdown {
    from { opacity: 0; transform: translateY(-10px); }
    to { opacity: 1; transform: translateY(0); }
}

.year-dropdown-menu button {
    background: transparent;
    border: none;
    padding: 10px 15px;
    font-family: 'Montserrat', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    color: #333;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: all 0.2s ease;
}

.year-dropdown-menu button:hover {
    background: #f8f9fa;
    color: #ea1d24;
}

/* Transition for loading grid */
#months-container {
    transition: opacity 0.3s ease;
}

/* =========================================
   Newsletter Modal Slider Styles
   ========================================= */
.newsletter-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    visibility: hidden;
    opacity: 0;
    transition: visibility 0.3s, opacity 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.newsletter-modal.show {
    visibility: visible;
    opacity: 1;
}

.newsletter-modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
}

.newsletter-modal-content {
    position: relative;
    width: 95%;
    max-width: 1200px;
    height: 95vh; /* Auto adjustable to viewport height */
    background: #0f1014; /* Deep liquid black */
    border-radius: 20px;
    border: 1px solid rgba(255, 255, 255, 0.05);
    overflow: hidden;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.25);
    transform: translateY(30px) scale(0.95);
    transition: transform 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.newsletter-modal.show .newsletter-modal-content {
    transform: translateY(0) scale(1);
}

.newsletter-slider-wrapper {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.newsletter-single-container {
    width: 100%;
    height: 100%;
}

.newsletter-slide {
    min-width: 100%;
    height: 100%;
    display: block; /* Use block to allow natural stacking and scrolling */
    overflow-y: auto;
    overflow-x: hidden;
    background: #fff;
    scroll-behavior: smooth;
}

.newsletter-slide::-webkit-scrollbar {
    width: 0px;
    display: none;
}

.newsletter-slide::-webkit-scrollbar-track {
    background: transparent;
}

.newsletter-slide::-webkit-scrollbar-thumb {
    background: transparent;
}

.newsletter-slide::-webkit-scrollbar-thumb:hover {
    background: #ea1d24;
}

.newsletter-slide-img-container {
    width: 100%;
    height: 100%; /* Will depend on the parent wrapper size */
    min-height: 500px;
    position: relative;
    background: #f8f9fa;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    scroll-behavior: smooth;
    -ms-overflow-style: none; /* IE and Edge */
    scrollbar-width: none; /* Firefox */
}

.newsletter-slide-img-container::-webkit-scrollbar {
    display: none;
}

.newsletter-slide-img-container img {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    max-height: 100%;
    object-fit: contain;
    scroll-snap-align: center;
    pointer-events: none; /* Let the container handle dragging if implemented, cleanly snaps */
    display: block;
    margin: 0;
}

.img-swipe-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 45px;
    height: 45px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.9);
    color: #1a1a1a;
    border: none;
    font-size: 1.1rem;
    cursor: pointer;
    z-index: 10;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: background 0.3s, color 0.3s, transform 0.2s;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
}

.img-swipe-btn:hover {
    background: #ea1d24;
    color: #ffffff;
    transform: translateY(-50%) scale(1.05);
}

.img-swipe-btn.prev {
    left: 20px;
}

.img-swipe-btn.next {
    right: 20px;
}

.newsletter-slide-content-wrapper {
    background: #0f1014; /* Deep liquid black */
    position: relative;
    z-index: 5;
    padding-bottom: 3rem;
}

.newsletter-slide-title {
    font-family: 'Montserrat', sans-serif;
    font-size: 2.5rem;
    font-weight: 800;
    color: #ffffff;
    padding: 2.5rem 3rem 0.5rem;
    margin: 0;
}

.newsletter-slide-desc {
    font-size: 1.2rem;
    color: #ea1d24; /* Keep the red accent vibrant */
    font-weight: 600;
    padding: 0 3rem 1.5rem;
    margin: 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1); /* Subtle dark mode divider */
}

.newsletter-slide-text {
    padding: 2rem 3rem 3rem;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #cfd0d4; /* Soft readable white */
}

.newsletter-close-btn,
.newsletter-nav-btn {
    position: absolute;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #ffffff;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    z-index: 20; /* Keep above everything */
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.newsletter-close-btn {
    top: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    border-radius: 50%;
    font-size: 1.2rem;
}

.newsletter-close-btn:hover {
    background: #ea1d24;
    border-color: #ea1d24;
    color: white;
    transform: rotate(90deg);
}

.newsletter-nav-btn {
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    border-radius: 50%;
    font-size: 1.2rem;
}

.newsletter-nav-btn.prev {
    /* Adjusted pos for clear visibility */
    left: 20px;
}

.newsletter-nav-btn.next {
    right: 20px;
}

.newsletter-nav-btn:hover {
    background: #ea1d24;
    border-color: #ea1d24;
    color: white;
    transform: translateY(-50%) scale(1.1);
}

/* Let the user see that they can scroll down by showing a bouncing arrow initially */
.scroll-indicator {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    color: white;
    font-size: 2rem;
    animation: bounceDown 2s infinite;
    text-shadow: 0 2px 5px rgba(0,0,0,0.5);
    pointer-events: none;
    z-index: 5;
}

@keyframes bounceDown {
    0%, 20%, 50%, 80%, 100% { transform: translate(-50%, 0); }
    40% { transform: translate(-50%, -10px); }
    60% { transform: translate(-50%, -5px); }
}

@media (max-width: 768px) {
    .newsletter-modal-content {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        transform: translateY(100%);
    }

    .newsletter-modal.show .newsletter-modal-content {
        transform: translateY(0);
    }

    .newsletter-slide-title {
        font-size: 1.8rem;
        padding: 2rem 1.5rem 0.5rem;
    }

    .newsletter-slide-desc {
        font-size: 1rem;
        padding: 0 1.5rem 1.5rem;
    }

    .newsletter-slide-text {
        padding: 1.5rem;
        font-size: 1rem;
    }

    .newsletter-nav-btn {
        top: auto;
        bottom: 20px;
        transform: none;
    }
    
    .newsletter-nav-btn.prev {
        left: 20px;
    }
    
    .newsletter-nav-btn.next {
        right: 20px;
    }

    .newsletter-nav-btn:hover {
        transform: scale(1.1);
    }
    
    .newsletter-close-btn {
        top: 15px;
        right: 15px;
        background: rgba(0, 0, 0, 0.6);
        color: white;
    }
}
