/* ==================================================
   GM24 NEWS PREMIUM V6
   Latest News Cards
   Depends on variables.css and base.css. Fallbacks keep
   this file safe when a shared token is unavailable.
   ================================================== */

/* ==================================================
   LATEST NEWS GRID
   ================================================== */

.latest-news-grid,
.news-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 30px;
    margin-top: 30px;
}

/* ==================================================
   SECTION HEADER
   ================================================== */

.section-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 24px;
    padding-bottom: 14px;
    border-bottom: 2px solid var(--border-color, #e9e9e9);
}

.section-header__title{
    position:relative;
    margin:0;
    padding-left:14px;
    color:var(--heading-color, #171717);
    font-size:clamp(1.35rem, 2vw, 1.8rem);
    font-weight:800;
    line-height:1.2;
}

.section-header__title::before{
    position:absolute;
    top:.08em;
    bottom:.08em;
    left:0;
    width:4px;
    border-radius:999px;
    background:var(--primary-color, #d40000);
    content:"";
}
.section-header__link,
.section-view-all {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    flex: 0 0 auto;
    color: var(--primary-color, #d40000);
    font-size: 0.875rem;
    font-weight: 700;
    text-decoration: none;
    transition: color 0.2s ease, transform 0.2s ease;
}

.section-header__link:hover,
.section-header__link:focus-visible,
.section-view-all:hover,
.section-view-all:focus-visible {
    color: var(--heading-color, #171717);
    transform: translateX(3px);
}

/* ==================================================
   PREMIUM NEWS CARD
   ================================================== */

.news-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--border-color, #e9e9e9);
    border-radius: var(--card-radius, 14px);
    background: var(--surface-color, #ffffff);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
}

.news-card:hover {
    border-color: rgba(212, 0, 0, 0.2);
    box-shadow: 0 18px 42px rgba(0, 0, 0, 0.14);
    transform: translateY(-6px);
}

.news-thumb {
    position: relative;
    display: block;
    overflow: hidden;
    aspect-ratio: 16 / 9;
    background: var(--muted-bg, #f0f1f3);
}

.news-thumb img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-thumb img {
    transform: scale(1.06);
}

.news-content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    min-width: 0;
    padding: 22px;
}

/* ==================================================
   CATEGORY AND POST META
   ================================================== */

.category-badge {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    margin-bottom: 14px;
    padding: 5px 12px;
    border-radius: 999px;
    background: var(--primary-color, #d40000);
    color: #ffffff;
    font-size: 0.6875rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    line-height: 1.2;
    text-decoration: none;
    text-transform: uppercase;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.category-badge:hover,
.category-badge:focus-visible {
    background: var(--primary-dark, #a90000);
    color: #ffffff;
    transform: translateY(-1px);
}

.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px 14px;
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border-color, #e9e9e9);
    color: var(--text-muted, #727272);
    font-size: 0.8125rem;
    line-height: 1.4;
}

.post-date,
.post-author {
    display: inline-flex;
    align-items: center;
    gap: 5px;
}

/* ==================================================
   TITLE, EXCERPT, AND CTA
   ================================================== */

.news-title {
    display: -webkit-box;
    margin: 0 0 12px;
    overflow: hidden;
    color: var(--heading-color, #171717);
    font-size: clamp(1.125rem, 1.5vw, 1.375rem);
    font-weight: 800;
    line-height: 1.38;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.news-title a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

.news-title a:hover,
.news-title a:focus-visible {
    color: var(--primary-color, #d40000);
}

.news-excerpt {
    display: -webkit-box;
    margin: 0;
    overflow: hidden;
    color: var(--text-color, #4c4c4c);
    font-size: 0.9375rem;
    line-height: 1.65;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
}

.news-read-more,
.news-cta {
    display: inline-flex;
    align-self: flex-start;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: auto;
    padding: 10px 16px;
    border: 1px solid var(--primary-color, #d40000);
    border-radius: 7px;
    background: transparent;
    color: var(--primary-color, #d40000);
    font-size: 0.8125rem;
    font-weight: 800;
    line-height: 1.2;
    text-decoration: none;
    transition: background-color 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.news-excerpt + .news-read-more,
.news-excerpt + .news-cta {
    margin-top: 20px;
}

.news-read-more:hover,
.news-read-more:focus-visible,
.news-cta:hover,
.news-cta:focus-visible {
    background: var(--primary-color, #d40000);
    color: #ffffff;
    transform: translateY(-2px);
}

/* ==================================================
   NO POSTS STATE
   ================================================== */

.no-posts,
.no-posts-found {
    display: grid;
    place-items: center;
    min-height: 220px;
    padding: 32px 24px;
    border: 1px dashed var(--border-color, #d7d7d7);
    border-radius: var(--card-radius, 14px);
    background: var(--muted-bg, #f8f8f8);
    color: var(--text-muted, #727272);
    text-align: center;
}

.no-posts p,
.no-posts-found p {
    margin: 0;
}

/* ==================================================
   RESPONSIVE
   ================================================== */

@media (max-width: 767px) {
    .latest-news-grid,
    .news-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-top: 22px;
    }

    .section-header {
        align-items: flex-start;
        gap: 14px;
        margin-bottom: 20px;
    }

    .news-content {
        padding: 18px;
    }
}

@media (max-width: 479px) {
    .section-header {
        flex-direction: column;
    }

    .section-header__link,
    .section-view-all {
        align-self: flex-start;
    }

    .post-meta {
        gap: 6px 12px;
    }

    .news-read-more,
    .news-cta {
        width: 100%;
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-card,
    .news-thumb img,
    .category-badge,
    .section-header__link,
    .section-view-all,
    .news-title a,
    .news-read-more,
    .news-cta {
        transition: none;
    }
}
