/* =================================================================
   Newsletter Page Styles
   ================================================================= */

.newsletter-intro {
    text-align: center;
    max-width: 800px;
    margin: 0 auto var(--spacing-xl);
    font-size: 1.1rem;
    color: var(--text-light);
}

/* Newsletter Grid */
.newsletter-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--spacing-lg);
    margin-top: var(--spacing-xl);
}

.newsletter-card {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    overflow: hidden;
    box-shadow: var(--box-shadow);
    transition: all var(--transition-speed);
    cursor: pointer;
}

.newsletter-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--box-shadow-lg);
}

.newsletter-thumbnail {
    position: relative;
    width: 100%;
    padding-top: 141%; /* A4 aspect ratio */
    background-color: var(--bg-light);
    overflow: hidden;
}

.newsletter-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.newsletter-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 102, 204, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity var(--transition-speed);
}

.newsletter-card:hover .newsletter-overlay {
    opacity: 1;
}

.view-btn {
    background-color: var(--bg-white);
    color: var(--primary-color);
    padding: var(--spacing-sm) var(--spacing-md);
    border-radius: var(--border-radius);
    font-weight: 600;
    font-size: 1rem;
}

.newsletter-info {
    padding: var(--spacing-md);
}

.newsletter-info h3 {
    color: var(--primary-color);
    margin-bottom: var(--spacing-xs);
    font-size: 1.25rem;
}

.newsletter-info p {
    color: var(--text-light);
    margin: 0;
    font-size: 0.95rem;
}

/* Newsletter Modal */
.newsletter-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.8);
    z-index: 10000;
    align-items: center;
    justify-content: center;
    padding: var(--spacing-md);
}

.newsletter-modal.active {
    display: flex;
}

.modal-content {
    background-color: var(--bg-white);
    border-radius: var(--border-radius);
    width: 100%;
    max-width: 1200px;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
}

.modal-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: var(--spacing-md) var(--spacing-lg);
    border-bottom: 1px solid var(--border-color);
}

.modal-header h2 {
    margin: 0;
    color: var(--primary-color);
    font-size: 1.5rem;
}

.modal-close {
    background: none;
    border: none;
    font-size: 2rem;
    color: var(--text-light);
    cursor: pointer;
    padding: 0;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: all var(--transition-speed);
}

.modal-close:hover {
    background-color: var(--bg-light);
    color: var(--text-dark);
}

.modal-body {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

#flipbook-container {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--bg-light);
    overflow: auto;
    padding: var(--spacing-md);
}

#pdf-viewer {
    width: 100%;
    height: 100%;
    min-height: 600px;
    border: none;
    border-radius: var(--border-radius);
}

/* Flipbook Controls */
.flipbook-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-lg);
    padding: var(--spacing-md);
    background-color: var(--bg-white);
    border-top: 1px solid var(--border-color);
}

.control-btn {
    padding: var(--spacing-sm) var(--spacing-md);
    background-color: var(--primary-color);
    color: var(--bg-white);
    border: none;
    border-radius: var(--border-radius);
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition-speed);
}

.control-btn:hover:not(:disabled) {
    background-color: var(--hover-color);
}

.control-btn:disabled {
    background-color: var(--border-color);
    cursor: not-allowed;
    opacity: 0.5;
}

#page-info {
    font-weight: 600;
    color: var(--text-dark);
}

/* Placeholder for missing images */
.newsletter-thumbnail:not(:has(img)) {
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--bg-light) 0%, var(--border-color) 100%);
}

.newsletter-thumbnail:not(:has(img))::after {
    content: 'Newsletter Cover';
    color: var(--text-light);
    font-size: 1.2rem;
    font-weight: 600;
}

/* Responsive */
@media (max-width: 768px) {
    .newsletter-grid {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: var(--spacing-md);
    }
    
    .modal-content {
        max-height: 95vh;
    }
    
    #pdf-viewer {
        min-height: 400px;
    }
    
    .flipbook-controls {
        flex-direction: column;
        gap: var(--spacing-sm);
    }
    
    .control-btn {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .newsletter-grid {
        grid-template-columns: 1fr;
    }
    
    .newsletter-modal {
        padding: 0;
    }
    
    .modal-content {
        max-height: 100vh;
        border-radius: 0;
    }
}
