/*
 * New homepage category row (template-parts/category-row.php), stacked
 * inside the same column as "Latest News" (span9), below it - so it stays
 * to the left of "Trending This Week" (the sibling span3 column) rather
 * than spanning full page width below the whole row. See
 * newspaper_artistheat_child_insert_category_row() (functions.php) for the
 * insertion point. Entirely custom classes - no TDC/plugin classes reused
 * here, so (unlike latest-articles-refine.css) there's no competing base
 * CSS to out-specificity; every rule below is simple and uncontested.
 *
 * Palette/spacing intentionally matches the Latest News section above it
 * (white cards, black type, red accents, same heading treatment) for
 * visual consistency between the two rows.
 *
 * No max-width/horizontal padding/auto-centering here (unlike the earlier,
 * full-width-row version of this file) - the column itself already sets
 * the available width and its own gutter, and Latest News's own cards fill
 * it edge-to-edge with no extra inset, so this row does the same to stay
 * flush/aligned with them instead of appearing indented.
 */

.ah-category-row {
    margin-top: 40px;
    box-sizing: border-box;
}

.ah-category-row-heading {
    margin-bottom: 20px;
}

.ah-category-row-title {
    display: inline-block;
    position: relative;
    margin: 0;
    padding-bottom: 10px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    border-bottom: 2px solid #111111;
}

.ah-category-row-title a {
    color: #111111;
    text-decoration: none;
}

.ah-category-row-title:after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -2px;
    width: 56px;
    height: 2px;
    background-color: #dd0000;
}

.ah-category-cards {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
}

.ah-category-card {
    display: flex;
    flex-direction: column;
    min-height: 0;
    background-color: #ffffff;
    border: 1px solid #ededed;
}

.ah-category-card-image {
    display: block;
    position: relative;
    flex: 0 0 auto;
    padding-bottom: 56%;
    overflow: hidden;
    background-color: #f2f2f2;
}

.ah-category-card-image img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
}

.ah-category-card-body {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    padding: 16px;
}

.ah-category-card-badge {
    align-self: flex-start;
    margin: 0 0 10px;
    padding: 5px 10px;
    background-color: #dd0000;
    color: #ffffff;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    text-decoration: none;
}

.ah-category-card-badge:hover {
    background-color: #b50000;
}

.ah-category-card-title {
    min-height: 50px;
    margin: 0 0 6px;
    font-size: 16px;
    line-height: 1.3;
    font-weight: 600;
}

.ah-category-card-title a {
    color: #111111;
    text-decoration: none;
}

.ah-category-card-title a:hover {
    color: #dd0000;
}

.ah-category-card-meta {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 5px;
    font-size: 11px;
    color: #767676;
}

.ah-category-card-author {
    color: #767676;
    text-decoration: none;
}

.ah-category-card-author:hover {
    color: #dd0000;
}

@media (min-width: 768px) and (max-width: 1018px) {
    .ah-category-cards {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 767px) {
    .ah-category-cards {
        grid-template-columns: 1fr;
    }

    .ah-category-row {
        margin-top: 24px;
    }
}
