*,
*::before,
*::after {
    box-sizing: border-box;
}

.article-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
}

.article-content {
    flex: 1;
    margin-top: -1rem; /* Trækker teksten højere op i boksen */
}

.article-card {
    display: flex;
    gap: 1rem;
    align-items: flex-start;
    padding: 1rem;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    margin-bottom: 1rem;
    overflow: hidden; /* Sikrer at intet indhold flyder ud af boksen */
}

.article-thumbnail {
    flex-shrink: 0;
    /* height: 200px; */ /* Fjern fast højde her, lad billedet bestemme */
    box-sizing: border-box; /* Sikrer korrekt boksmodel */
}

.article-thumbnail img {
    width: 100%; /* Sørg for at billedet fylder hele bredden af sin container */
    height: auto; /* Bevar billedets aspektforhold */
    max-width: 100%; /* Sikrer at billedet ikke går ud over containeren */
    border-radius: 4px;
    object-fit: cover;
}

.article-title {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    font-weight: bold;
}

.article-title a {
    text-decoration: none;
    color: inherit;
}

.article-title a:hover {
    text-decoration: underline;
}

.article-tags {
    margin-bottom: 0.5rem;
}

.tag {
    display: inline-block;
    padding: 0.2rem 0.5rem;
    background-color: #f0f0f0;
    border-radius: 3px;
    text-decoration: none;
    font-size: 0.8rem;
    margin-right: 0.5rem;
    margin-bottom: 0.25rem;
}

.tag:hover {
    background-color: #e0e0e0;
}

.article-excerpt {
    margin: 0.5rem 0;
    color: #666;
    line-height: 1.4;
}

.article-meta {
    font-size: 0.9rem;
    color: #888;
    margin-top: 0.5rem;
}

.ai-badge {
    background: var(--success-color);
    color: white;
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.75rem;
    font-weight: 500;
}

.article-excerpt {
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 1rem;
}

.read-more {
    color: #007bff;
    text-decoration: none;
}

.read-more:hover {
    text-decoration: underline;
}

.pagination-wrapper {
    display: flex;
    justify-content: center;
    margin-top: 3rem;
}

.page-link {
    color: var(--text-secondary);
    border-color: var(--border-color);
    padding: 0.75rem 1rem;
}

.page-link:hover {
    color: var(--primary-color);
    background-color: var(--bg-secondary);
    border-color: var(--primary-color);
}

.page-item.active .page-link {
    background-color: var(--primary-color);
    border-color: var(--primary-color);
}

.article-view {
    background: var(--bg-primary);
    border-radius: 12px;
    padding: 3rem;
    max-width: 100%;
    margin: 0 auto;
    border: 1px solid var(--border-color);
}

.article-header {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-color);
}

.article-content {
    font-size: 1.125rem;
    line-height: 1.7;
    color: var(--text-primary);
}

.article-content h2 {
    margin-top: 2rem;
    margin-bottom: 1rem;
    font-weight: 600;
}

.article-content p {
    margin-bottom: 1.5rem;
}

/* Styling for images inside articles */
.article-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 2rem auto; /* Adds space above/below and centers the image */
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    border: 1px solid var(--border-color);
}


.tag.active {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
}

.filter-section {
    background: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 1.5rem;
    margin-bottom: 2rem;
}

.filter-title {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-primary);
}

.clear-filter {
    background: none;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.25rem 0.75rem;
    border-radius: 20px;
    font-size: 0.8rem;
    cursor: pointer;
    transition: all 0.2s ease;
}

.clear-filter:hover {
    background-color: var(--bg-secondary);
    border-color: var(--text-secondary);
}

.tag-view-header {
    text-align: center;
    margin-bottom: 2rem;
    padding: 2rem 0;
    background: var(--bg-primary);
    border-radius: 12px;
    border: 1px solid var(--border-color);
}

.tag-view-title {
    font-size: 1.75rem;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: 0.5rem;
}

.tag-view-subtitle {
    color: var(--text-secondary);
}

.related-articles {
    margin-top: 3rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.back-btn {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 0.5rem 1rem;
    border-radius: 8px;
    text-decoration: none;
    font-size: 0.9rem;
    transition: all 0.2s ease;
}

.back-btn:hover {
    background-color: var(--primary-color);
    color: white;
    border-color: var(--primary-color);
    text-decoration: none;
}

.hero-section {
    padding: 4rem 0;
    background-color: var(--bg-secondary);
    margin-bottom: 2rem;
    border-radius: 12px;
}

@media (max-width: 768px) {
    .hero-section {
        padding: 2.5rem 1rem;
    }

    .hero-title {
        font-size: 2rem;
    }
    
    .hero-subtitle {
        font-size: 1.125rem;
    }
    
    .article-card {
        flex-direction: column;
    }
    
    .article-thumbnail {
        width: 100%;
        order: -1; /* Vis billede først på mobile */
    }
    
    .article-view {
        padding: 2rem 1.5rem;
    }
    
    .article-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Table Styles */
.article-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 2rem 0;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.article-content th, .article-content td {
    padding: 1rem 1.25rem;
    text-align: left;
    border-bottom: 1px solid var(--border-color);
}

.article-content thead th {
    background-color: var(--bg-secondary);
    font-weight: 600;
    color: var(--text-primary);
    border-bottom: 2px solid var(--border-color);
}

.article-content tbody tr:last-child td {
    border-bottom: none;
}

.article-content tbody tr:hover {
    background-color: var(--bg-secondary);
}

.article-content td strong {
    font-weight: 600;
    color: var(--text-primary);
}

#progressBar {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 5px;
    background-color: #007bff;
    z-index: 1000;
}

.article-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
}

.share-section h4 {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 1rem;
}

.share-buttons-alt {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
}

.share-btn-alt {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 6px;
    border: none;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    text-decoration: none;
    color: white;
    transition: all 0.2s ease;
}

.share-btn-alt:hover {
    transform: translateY(-1px);
    opacity: 0.9;
}

.share-btn-alt svg {
    width: 16px;
    height: 16px;
    fill: white;
}

.share-btn-alt.facebook { background: #1877f2; }
.share-btn-alt.twitter { background: #1da1f2; }
.share-btn-alt.linkedin { background: #0077b5; }
.share-btn-alt.email { background: #34495e; }
.share-btn-alt.print { background: #666; }
.share-btn-alt.copy { background: #28a745; }
.share-btn-alt.copy.copied { background: #218838; }
