/*
 * Front page news grid.
 *
 * Every selector here is produced by inc/front-page-parts.php and appears
 * nowhere else, so this file is enqueued only on the front page.
 */

/* ===== Category Header ===== */
.category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-left: 4px solid var(--accent, #1e73be);
    padding-left: 15px;
    margin: 30px auto 20px;
}

.category-name {
    font-size: 20px;
    font-weight: 600;
    text-transform: uppercase;
    margin: 0;
}

.category-more {
    font-size: 14px;
    text-decoration: none;
    color: #222;
    font-weight: 500;
    transition: color 0.3s ease;
    border-bottom: solid 2px #eee;
    display: inline-flex;
    align-items: center;
}

.category-more::after {
    content: " \2192";
    margin-left: 6px;
    transition: transform 0.2s ease;
}

.category-more:hover {
    color: #222;
    border-bottom: solid 2px var(--accent, #1e73be);
}

.category-more:hover::after {
    transform: translateX(4px);
}

/* ===== News List ===== */
.news-container {
    padding: 0 20px;
}

.news-content {
    flex: 1;
    padding-top: 5px;
}

.news-title {
    font-size: 16px;
    margin: 10px 0;
}

.news-title a {
    color: #222;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-title a:hover {
    color: var(--accent, #1e73be);
}

.news-category,
.news-meta {
    font-size: 13px;
    color: #475569; /* Darker gray for accessibility */
}

.news-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.article-timestamp time {
    display: block;
}

/* ===== Main Article (Featured) ===== */
.main-article {
    padding-bottom: 24px;
    margin-bottom: 24px;
    border-bottom: 1px solid #eee;
}

.main-article .news-title {
    font-size: 24px;
    line-height: 1.35;
    margin: 16px 0 12px;
}

.main-article img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
    border: 1px solid #eee;
    border-radius: 8px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.main-article:hover img {
    transform: scale(1.02);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ===== Regular News Item (List) ===== */
.news-item {
    display: flex;
    margin: 20px 0;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
    gap: 20px;
}

.news-item .news-title {
    font-size: 16px;
    margin-top: 0;
    line-height: 1.4;
}

.news-item img {
    width: 140px;
    height: 96px;
    object-fit: cover;
    border: 1px solid #eee;
    border-radius: 6px;
    flex-shrink: 0;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.news-item:hover img {
    transform: scale(1.03);
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
}

/* ===== Thumbnail & Placeholder ===== */
.article-thumbnail {
    display: block;
    overflow: hidden;
    border-radius: 8px;
}

.news-item .article-thumbnail {
    border-radius: 6px;
    flex-shrink: 0;
}

.article-thumbnail__placeholder {
    display: block;
    background: #f1f3f4;
    border: 1px solid #eee;
    border-radius: 8px;
}

.main-article .article-thumbnail__placeholder {
    width: 100%;
    aspect-ratio: 16 / 9;
}

.news-item .article-thumbnail__placeholder {
    width: 140px;
    height: 96px;
    border-radius: 6px;
}

@media (min-width: 768px) {
    .main-article-wrapper {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 24px;
        margin-bottom: 24px;
    }

    .main-article {
        display: flex;
        flex-direction: column;
        height: 100%;
        margin-bottom: 0;
        border-bottom: none;
    }

    .main-article .news-content {
        flex-grow: 1;
        display: flex;
        flex-direction: column;
        justify-content: space-between;
    }

    .main-article .news-title {
        flex-grow: 1;
    }

    .news-item {
        margin: 24px 0;
    }
}
