/* Articles Styles */

/* Article Content Styling */
.article-content {
    font-size: 1.1rem;
    line-height: 1.8;
}

.article-content h1,
.article-content h2,
.article-content h3,
.article-content h4,
.article-content h5,
.article-content h6 {
    margin-top: 2rem;
    margin-bottom: 1rem;
}

/* Fix alert headings to be larger than paragraph text */
.article-content .alert-heading {
    font-size: 1.15rem;
    margin-top: 0;
}

.article-content h1 {
    margin-top: 0; /* No top margin for first title */
}

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

.article-content img {
    max-width: 100%;
    height: auto;
    border-radius: 0.5rem;
    margin: 1.5rem 0;
}

.article-content blockquote {
    border-left: 4px solid var(--bs-primary);
    padding-left: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
    color: var(--bs-gray-600);
}

.article-content pre {
    background-color: var(--bs-gray-100);
    border-radius: 0.5rem;
    padding: 1rem;
    overflow-x: auto;
}

.article-content table {
    width: 100%;
    margin: 1.5rem 0;
    border-collapse: collapse;
}

.article-content table th,
.article-content table td {
    padding: 0.75rem 1.25rem;
    text-align: left;
    border: 1px solid var(--bs-border-color);
}

.article-content table th {
    background-color: var(--bs-gray-100);
    font-weight: 600;
    white-space: nowrap;
}

.article-content table tbody tr:nth-child(even) {
    background-color: var(--bs-gray-50);
}

.article-content table tbody tr:hover {
    background-color: var(--bs-gray-100);
}

/* Dark mode adjustments */
[data-bs-theme=dark] .article-content blockquote {
    color: var(--bs-gray-400);
}

[data-bs-theme=dark] .article-content pre {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme=dark] .article-content table th {
    background-color: rgba(255, 255, 255, 0.05);
}

[data-bs-theme=dark] .article-content table tbody tr:nth-child(even) {
    background-color: rgba(255, 255, 255, 0.02);
}

[data-bs-theme=dark] .article-content table tbody tr:hover {
    background-color: rgba(255, 255, 255, 0.08);
}

/* Article Card Hover Effects */
.card:hover {
    transform: translateY(-2px);
    transition: transform 0.2s ease-in-out;
}

/* Favorite Button Styles */
.favorite-btn {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 10;
    background: rgba(255, 255, 255, 0.9);
    border-radius: 50%;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    cursor: pointer;
    transition: all 0.3s ease;
}

.favorite-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: scale(1.1);
}

.favorite-btn.is-favorited {
    color: #ffc107;
}

.favorite-btn.is-favorited:hover {
    color: #ff9800;
}

.favorite-btn i {
    font-size: 20px;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.favorite-btn.pulse {
    animation: pulse 0.3s ease;
}

/* Dark mode adjustments for favorite button */
[data-bs-theme=dark] .favorite-btn {
    background: rgba(40, 40, 40, 0.95);
    color: #ccc;
}

[data-bs-theme=dark] .favorite-btn:hover {
    background: rgba(50, 50, 50, 1);
    color: #fff;
}

/* Gallery Styles */
.article-gallery img {
    cursor: pointer;
    transition: transform 0.2s;
}

.article-gallery img:hover {
    transform: scale(1.05);
}

/* Share Buttons */
.share-buttons .btn {
    min-width: 100px;
}

/* Sidebar Widgets */
.sidebar .card {
    position: sticky;
    top: 20px;
}

/* Tag Cloud */
.badge {
    font-weight: normal;
    text-decoration: none;
}

.badge:hover {
    filter: brightness(1.1);
}

/* Pagination */
.pagination .page-link {
    border-radius: 0.375rem;
    margin: 0 0.25rem;
}

/* Print Styles */
@media print {
    .article-content {
        font-size: 12pt;
        line-height: 1.5;
    }

    .article-content h1 {
        font-size: 21.6pt;
    }

    .article-content h2 {
        font-size: 16.2pt;
    }

    .article-content h3 {
        font-size: 12.6pt;
    }

    .article-content img {
        max-width: 100%;
        page-break-inside: avoid;
    }

    .card {
        border: none;
        box-shadow: none;
    }
}

/* Responsive Adjustments */
@media (max-width: 768px) {
    .article-content {
        font-size: 1rem;
    }

    .sidebar {
        margin-top: 2rem;
    }

    .share-buttons .btn {
        min-width: auto;
        padding: 0.25rem 0.5rem;
        font-size: 0.875rem;
    }
}
