/* Enhanced Blog Styles */
.blog-container {
    max-width: 1000px;
    margin: 0 auto;
    padding: 40px 20px;
}

.blog-section {
    margin-bottom: 60px;
}

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 30px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e5e5e5;
}

.section-title {
    font-family: 'Lora', serif;
    font-size: 28px;
    font-weight: 600;
    color: #111;
    margin: 0;
}

.section-lock {
    background: #f0f0f0;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    transition: all 0.2s ease;
}

.section-lock:hover {
    background: #e0e0e0;
}

.section-lock.unlocked {
    background: #e8f5e8;
    color: #2d5a2d;
}

.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 25px;
    width: 100%;
}

@media (min-width: 768px) {
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

.blog-card {
    background: white;
    border-radius: 12px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    border: 1px solid #f0f0f0;
    cursor: pointer;
}

.blog-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
}

.blog-card.coming-soon {
    text-align: center;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border: 2px dashed #dee2e6;
    cursor: default;
}

.card-title {
    font-family: 'Lora', serif;
    font-size: 20px;
    font-weight: 600;
    color: #111;
    margin-bottom: 12px;
}

.card-date {
    font-size: 13px;
    color: #888;
    margin-bottom: 15px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-bottom: 15px;
}

.tag {
    background: #f0f0f0;
    color: #666;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.read-more {
    color: #007acc;
    text-decoration: none;
    font-weight: 500;
    font-size: 14px;
    transition: color 0.2s ease;
}

.read-more:hover {
    color: #0056a3;
    text-decoration: underline;
}

/* Article View Styles */
.article-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
}

.article-header {
    margin-bottom: 16px;
}

.back-btn {
    background: #f0f0f0;
    border: none;
    padding: 8px 16px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
    color: #666;
    margin: 0 auto 20px auto;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    width: fit-content;
}

.back-btn:hover {
    background: #e0e0e0;
}

.article-title {
    font-family: 'Lora', serif;
    font-size: 36px;
    font-weight: 600;
    color: #111;
    margin-bottom: 15px;
    line-height: 1.3;
}

.article-date {
    font-size: 14px;
    color: #888;
    margin-bottom: 8px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 30px;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 40px;
}

.article-content {
    font-family: 'Lato', sans-serif;
    font-size: 16px;
    line-height: 1.7;
    color: #333;
}

.article-content h2 {
    font-family: 'Lora', serif;
    font-size: 24px;
    font-weight: 600;
    color: #111;
    margin: 15px 0 15px 0;
}

.article-content h3 {
    font-family: 'Lora', serif;
    font-size: 20px;
    font-weight: 600;
    color: #111;
    margin: 25px 0 12px 0;
}

.article-content p {
    margin-bottom: 20px;
}

.article-content blockquote {
    border-left: 4px solid #007acc;
    padding-left: 20px;
    margin: 25px 0;
    font-style: italic;
    color: #555;
}

/* Ensure images never exceed text column width and align with text */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    box-sizing: border-box;
    margin: 16px 0;
}

/* Text selection for commenting */
.selectable-text {
    position: relative;
}

.text-selected {
    background-color: #ffffcc;
    cursor: pointer;
}

.text-highlighted {
    background-color: #e6f3ff;
    border-bottom: 2px solid #007acc;
    cursor: pointer;
    position: relative;
}

/* Comments Sidebar */
.comments-sidebar {
    background: #f8f9fa;
    border-radius: 12px;
    padding: 20px;
    height: fit-content;
    position: sticky;
    top: 20px;
}

.user-controls {
    margin-bottom: 20px;
}

.comments-header {
    margin-bottom: 20px;
}

.comments-header h3 {
    font-family: 'Lora', serif;
    font-size: 18px;
    color: #111;
    margin-bottom: 15px;
}

.username-input, .password-input {
    width: 100%;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    margin-bottom: 8px;
    font-family: inherit;
}

.password-input {
    height: 36px;
}

.username-input:focus, .password-input:focus {
    outline: none;
    border-color: #007acc;
}

.corwin-auth {
    display: flex;
    gap: 8px;
    align-items: center;
    margin-top: 8px;
    height: 36px;
}

.corwin-auth .password-input {
    flex: 1;
    margin-bottom: 0;
}

.auth-btn {
    background: #007acc;
    color: white;
    border: none;
    padding: 8px 12px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    white-space: nowrap;
    height: 36px;
}

.auth-btn:hover {
    background: #0056a3;
}

.comments-list {
    max-height: 600px;
    overflow-y: auto;
}

.comment {
    background: white;
    border-radius: 8px;
    padding: 15px;
    margin-bottom: 15px;
    border-left: 4px solid #007acc;
    position: relative;
}

.comment.corwin {
    border-left-color: #28a745;
}

.comment-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.comment-author {
    font-weight: 600;
    font-size: 14px;
    color: #111;
}

.comment-author.corwin {
    color: #28a745;
}

.comment-date {
    font-size: 12px;
    color: #888;
}

.comment-selected-text {
    background: #f0f0f0;
    padding: 8px;
    border-radius: 4px;
    font-size: 13px;
    margin-bottom: 8px;
    font-style: italic;
    border-left: 2px solid #007acc;
}

.comment-text {
    font-size: 14px;
    line-height: 1.5;
    color: #333;
}

.comment-actions {
    margin-top: 10px;
    display: flex;
    gap: 8px;
}

.resolve-btn {
    background: #28a745;
    color: white;
    border: none;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    font-size: 12px;
}

.resolve-btn:hover {
    background: #1e7e34;
}

.comment.resolved {
    opacity: 0.6;
    background: #f8f9fa;
}

.comment.resolved .comment-selected-text {
    background: #e9ecef;
}

/* Modal Styles */
.password-modal, .comment-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 500px;
    width: 90%;
    text-align: center;
}

.modal-title {
    font-family: 'Lora', serif;
    font-size: 22px;
    color: #111;
    margin-bottom: 15px;
}

.modal-description {
    font-family: 'Lato', sans-serif;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.5;
}

.password-input {
    width: 100%;
    padding: 12px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    font-size: 16px;
    margin-bottom: 15px;
    font-family: inherit;
}

.password-input:focus {
    outline: none;
    border-color: #007acc;
}

.selected-text {
    background: #f0f0f0;
    padding: 15px;
    border-radius: 8px;
    margin-bottom: 15px;
    font-style: italic;
    text-align: left;
    border-left: 4px solid #007acc;
}

.comment-input {
    width: 100%;
    min-height: 100px;
    padding: 12px;
    border: 2px solid #e5e5e5;
    border-radius: 6px;
    font-size: 14px;
    font-family: inherit;
    resize: vertical;
    margin-bottom: 15px;
}

.comment-input:focus {
    outline: none;
    border-color: #007acc;
}

.modal-buttons {
    display: flex;
    gap: 10px;
    justify-content: center;
}

.modal-btn {
    padding: 10px 20px;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-family: inherit;
    font-weight: 500;
    transition: all 0.2s ease;
}

.modal-btn.primary {
    background: #007acc;
    color: white;
}

.modal-btn.primary:hover {
    background: #0056a3;
}

.modal-btn.secondary {
    background: #f0f0f0;
    color: #666;
}

.modal-btn.secondary:hover {
    background: #e0e0e0;
}

.hidden-section {
    display: none;
}

.error-message {
    color: #d73527;
    font-size: 14px;
    margin-top: 10px;
    display: none;
}

/* Responsive Design */
@media (max-width: 968px) {
    .article-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }
    
    .comments-sidebar {
        position: static;
        order: 2;
    }
    
    .article-content {
        order: 1;
    }
}

@media (max-width: 768px) {
    .blog-container, .article-container {
        padding: 25px 15px;
    }
    
    .article-title {
        font-size: 28px;
    }
    
    .section-title {
        font-size: 24px;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 15px;
    }
    
    .blog-grid {
        grid-template-columns: 1fr;
    }
    
    .modal-content {
        padding: 20px;
    }
}
