/* static/css/article-list.css - Properly balanced padding */

/* Base styles */
body {
    font-family: Georgia, "Times New Roman", Times, serif;
    margin: 0;
    padding: 0;
    background-color: #f9fafb;
    color: #374151;
    line-height: 1.5;
    overflow-x: hidden;
}

.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 1rem;
}

/* SMART GRID LAYOUT */
.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
    padding: 1rem 0;
    grid-auto-rows: minmax(350px, auto);
}

/* Base card styles */
.article-card {
    background-color: white;
    border-radius: 0.5rem;
    box-shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.1);
    border: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.3s;
    overflow: hidden;
    height: 100%;
}

.article-card:hover {
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.15);
}

/* Image section */
.article-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.article-image-link {
    display: block;
    line-height: 0;
    flex-shrink: 0;
}

.article-image-link.hidden {
    display: none;
}

/* Content area */
.article-card-content {
    display: flex;
    flex-direction: column;
    padding: 1rem;
    flex: 1;
    overflow: hidden;
    /* Subtle adjustment to padding for cards with less content */
    padding-bottom: 0.9rem;
}

/* Top content container */
.article-content-top {
    display: flex;
    flex-direction: column;
    flex: 1;
    overflow: hidden;
}

/* Title styling - consistent padding and height */
.article-card-title {
    font-size: 1.125rem;
    font-weight: 600;
    color: #1f2937;
    text-decoration: none;
    margin-bottom: 0.75rem;
    display: block;
    word-break: break-word;
    overflow: hidden;
    line-height: 1.4;
    max-height: 100.8px; /* 4 lines at 1.4 line height */
    padding-bottom: 2px; /* Prevent cutting off descenders */
}

.article-card-title:hover {
    color: #2563eb;
}

/* Summary styling - minimal padding to maximize space */
.article-card-summary {
    font-size: 0.9rem;
    color: #4b5563;
    line-height: 1.5;
    display: block;
    word-break: break-word;
    overflow: hidden;
    margin-bottom: 0.75rem;
    flex: 1;
    max-height: 105px; /* 5 lines at 1.5 line height */
    padding-bottom: 1px; /* Minimal padding to prevent cutoff */
    
    /* Better handling of German compound words */
    hyphens: auto;
    overflow-wrap: break-word;
}

/* Remove any fade effects */
.article-card-title::after,
.article-card-summary::after,
.fade-overlay {
    display: none !important;
    content: none !important;
}

/* Meta section - reduced margin-top to use more space for content */
.article-card-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 0.8rem;
    color: #6b7280;
    border-top: 1px solid #e5e7eb;
    padding-top: 0.7rem; /* Slightly reduced padding */
    font-family: system-ui, sans-serif;
    margin-top: auto;
    flex-shrink: 0;
    position: relative;
    background-color: white;
    z-index: 2;
}

.article-card-meta .source {
    font-weight: 500;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    margin-right: 1rem;
    max-width: 60%;
}

.date-spec-container {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    flex-shrink: 0;
}

.info-badge {
    font-weight: 500;
    background-color: #e5e7eb;
    padding: 0.1rem 0.4rem;
    border-radius: 0.25rem;
    cursor: help;
}

/* No image adjustments */
.article-card.no-image .article-card-content {
    height: 100%;
}

/* Media queries for responsive adjustments */
@media (max-width: 1200px) {
    .article-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    }
}

@media (max-width: 900px) {
    .article-grid {
        grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    }
}

@media (max-width: 640px) {
    .article-grid {
        grid-template-columns: 1fr; /* Single column on mobile */
    }
}