/*
 * styles/newsletter-detail.css
 * Styles for the individual newsletter article page.
 */

.newsletter-detail-container {
    display: grid;
    grid-template-columns: 1fr;
    gap: 2.5rem;
    max-width: 1100px;
    margin: 2rem auto;
    padding: 1rem;
}

@media (min-width: 992px) {
    .newsletter-detail-container {
        grid-template-columns: 3fr 1fr;
    }
}

.newsletter-article {
    background: #fff;
    padding: 2rem 2.5rem;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.07);
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid #e9ecef;
}

.article-category {
    display: inline-block;
    background-color: #eef7ff;
    color: #007bff;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.article-header h1 {
    font-size: 2.8rem;
    font-weight: 700;
    color: #2d3e50;
    line-height: 1.2;
    margin: 0;
}

.article-meta {
    margin-top: 1rem;
    font-size: 0.95rem;
    color: #6c757d;
}

.article-image {
    margin-bottom: 2rem;
}

.article-image img {
    width: 100%;
    max-height: 500px;
    object-fit: cover;
    border-radius: 8px;
}

.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #343a40;
}

.article-content p {
    margin-bottom: 1.5rem;
}

.newsletter-sidebar {
    position: sticky;
    top: 2rem;
    align-self: start;
}

.sidebar-title {
    font-size: 1.5rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #e0e0e0;
}

.related-posts-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.related-posts-list a {
    display: block;
    padding: 1rem;
    background: #fff;
    border-radius: 8px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid #e9ecef;
}

.related-posts-list a:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    border-color: #007bff;
}

.related-title {
    display: block;
    font-weight: 600;
    color: #333;
    margin-bottom: 0.25rem;
}

.related-date {
    font-size: 0.85rem;
    color: #777;
}

/* === Comments Section === */
.newsletter-comments-section {
    background: #fff;
    border-radius: 12px;
    padding: 2rem;
    margin-top: 2rem;
    border: 1px solid #e9ecef;
}

.comments-title {
    margin-top: 0;
    font-size: 1.4rem;
    font-weight: 700;
    color: #333;
    margin-bottom: 1.5rem;
}

.comment-form-container textarea {
    width: 100%;
    min-height: 100px;
    padding: 1rem;
    border-radius: 8px;
    border: 2px solid #e9ecef;
    font-family: inherit;
    font-size: 1rem;
    margin-bottom: 0.75rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

.comment-form-container textarea:focus {
    outline: none;
    border-color: #27c5a1;
}

.comment-form-actions {
    display: flex;
    justify-content: flex-end;
}

.post-button {
    background: linear-gradient(135deg, #27c5a1 0%, #20a889 100%);
    color: white;
    border: none;
    padding: 0.75rem 1.75rem;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 1rem;
    transition: all 0.3s;
}

.post-button:hover {
    background: linear-gradient(135deg, #20a889 0%, #1a8f75 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(39, 197, 161, 0.3);
}

.post-button:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.login-prompt {
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-align: center;
    color: #495057;
}

.login-prompt a {
    color: #007bff;
    text-decoration: none;
}

.login-prompt a:hover {
    text-decoration: underline;
}

.comments-list {
    margin-top: 2rem;
}

.no-comments-message {
    padding: 2rem;
    text-align: center;
    color: #6c757d;
    background: #f8f9fa;
    border-radius: 8px;
}

.comment-item {
    padding: 1.25rem 0;
    border-bottom: 1px solid #e9ecef;
}

.comment-item:last-child {
    border-bottom: none;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    margin-bottom: 0.75rem;
    gap: 1rem;
}

.comment-author {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comment-author strong {
    color: #333;
    font-weight: 600;
}

.comment-date {
    font-size: 0.85rem;
    color: #6c757d;
}

.comment-body {
    margin: 0.75rem 0;
    line-height: 1.6;
    color: #495057;
    word-break: break-word;
}

.comment-actions {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.comment-reaction-btn {
    display: flex;
    align-items: center;
    gap: 0.35rem;
    background: none;
    border: 1px solid #e9ecef;
    border-radius: 6px;
    padding: 0.4rem 0.75rem;
    cursor: pointer;
    font-size: 0.875rem;
    color: #6c757d;
    transition: all 0.2s;
    min-width: 40px;
}

.comment-reaction-btn:hover {
    background: #f8f9fa;
    border-color: #dee2e6;
}

.comment-reaction-btn.active,
.comment-reaction-btn.like-btn.active {
    color: #e74c3c;
    border-color: #e74c3c;
    background: rgba(231, 76, 60, 0.05);
}

.comment-reaction-btn.dislike-btn.active {
    color: #6c757d;
    border-color: #6c757d;
}

.comment-reaction-btn svg {
    width: 14px;
    height: 14px;
    flex-shrink: 0;
}

.like-count,
.dislike-count {
    min-width: 16px;
    text-align: center;
}

.reply-btn {
    background: none;
    border: none;
    color: #007bff;
    cursor: pointer;
    font-size: 0.875rem;
    padding: 0.4rem 0.75rem;
    transition: color 0.2s;
    font-weight: 600;
}

.reply-btn:hover {
    color: #0056b3;
}

.reply-form {
    margin-top: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
}

.reply-textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    border-radius: 6px;
    border: 1px solid #ced4da;
    font-family: inherit;
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
    resize: vertical;
    box-sizing: border-box;
}

.reply-textarea:focus {
    outline: none;
    border-color: #27c5a1;
}

.reply-form-actions {
    display: flex;
    gap: 0.5rem;
    justify-content: flex-end;
}

.post-reply-btn,
.cancel-reply-btn {
    padding: 0.5rem 1.25rem;
    border-radius: 6px;
    font-size: 0.9rem;
    cursor: pointer;
    border: none;
    font-weight: 600;
    transition: all 0.2s;
}

.post-reply-btn {
    background: #27c5a1;
    color: white;
}

.post-reply-btn:hover {
    background: #20a889;
}

.cancel-reply-btn {
    background: #6c757d;
    color: white;
}

.cancel-reply-btn:hover {
    background: #5a6268;
}

.replies-container {
    margin-left: 2.5rem;
    margin-top: 1rem;
    padding-left: 1.25rem;
    border-left: 3px solid #e9ecef;
}

.reply-item {
    padding: 1rem 0;
    margin-bottom: 0.5rem;
}

.reply-item .comment-header {
    margin-bottom: 0.5rem;
}

.reply-item .comment-body {
    margin-top: 0.5rem;
}

.reply-item .comment-reaction-btn svg {
    width: 12px;
    height: 12px;
}

@media (max-width: 991px) {
    .newsletter-sidebar {
        position: static;
    }
    .article-header h1 {
        font-size: 2.2rem;
    }
    .replies-container {
        margin-left: 1.5rem;
        padding-left: 0.75rem;
    }
}

@media (max-width: 640px) {
    .newsletter-detail-container {
        padding: 0.5rem;
        gap: 1.5rem;
        margin: 1rem auto;
    }
    
    .newsletter-article {
        padding: 1.5rem 1rem;
    }
    
    .article-header h1 {
        font-size: 1.8rem;
    }
    
    .newsletter-comments-section {
        padding: 1.5rem 1rem;
        margin-top: 1.5rem;
    }
    
    .comment-header {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .comment-actions {
        width: 100%;
    }
    
    .comment-reaction-btn {
        flex: 1;
        min-width: 0;
    }
    
    .reply-btn {
        width: auto;
    }
    
    .replies-container {
        margin-left: 1rem;
        padding-left: 0.5rem;
    }
}

@media (max-width: 430px) {
    .newsletter-article {
        padding: 1rem;
        border-radius: 8px;
    }
    
    .article-header {
        margin-bottom: 1.5rem;
    }
    
    .article-header h1 {
        font-size: 1.5rem;
    }
    
    .newsletter-comments-section {
        padding: 1rem;
    }
    
    .comment-form-container textarea {
        min-height: 90px;
        padding: 0.75rem;
    }
    
    .comment-item {
        padding: 1rem 0;
    }
    
    .comment-header {
        margin-bottom: 0.5rem;
    }
    
    .comment-actions {
        gap: 0.25rem;
    }
    
    .comment-reaction-btn {
        padding: 0.35rem 0.5rem;
        font-size: 0.8rem;
    }
    
    .replies-container {
        margin-left: 0.75rem;
        margin-top: 0.75rem;
    }
}

@media (max-width: 991px) {