/* ======================================
   Active News - Grid Card Layout
   所有选择器加 .news-guide 前缀，确保权重 >= news.css
   ====================================== */

/* Page header: title left, search right */
.news-guide .ng-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 24px 0 20px;
    flex-wrap: wrap;
    gap: 12px;
}

.news-guide .ng-page-title {
    color: #fff;
    font-size: 28px;
    font-weight: 700;
    font-family: 'Oswald', 'Arial', sans-serif;
    line-height: 1.2;
    margin: 0;
}

.news-guide .ng-search-form {
    display: flex;
    align-items: center;
}

.news-guide .ng-search-form input[type="text"] {
    text-overflow: ellipsis;
    overflow: hidden;
    white-space: nowrap;
}

.news-guide .ng-search-form button {
    height: 38px;
    padding: 0 20px;
    background: #00d4f0;
    color: #000;
    font-weight: 700;
    font-size: 14px;
    border: none;
    border-radius: 0 4px 4px 0;
    cursor: pointer;
    white-space: nowrap;
}

.news-guide .ng-search-form button:hover {
    background: #00b8d4;
}

/* Game navigation tabs */
.news-guide .ng-tabs {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 24px;
}

.news-guide .ng-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    background: #1a1e2e;
    color: #ccc;
    font-size: 13px;
    text-decoration: none;
    white-space: nowrap;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.news-guide .ng-tab img {
    width: 18px;
    height: 18px;
    object-fit: contain;
    border-radius: 2px;
    flex-shrink: 0;
}

.news-guide .ng-tab:hover,
.news-guide .ng-tab.active {
    background: #00d4f0;
    color: #000;
}

/* ======================================
   Article grid
   ====================================== */
.news-guide .ng-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-bottom: 30px;
}

/* Single card */
.news-guide .ng-card {
    background: #1a1e2e;
    border-radius: 8px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    transition: box-shadow 0.2s;
}

.news-guide .ng-card:hover {
    box-shadow: 0 0 14px rgba(11, 133, 234, 0.45);
}

/* Card inner link must fill the card */
.news-guide .ng-card > a {
    display: flex;
    flex-direction: column;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* ======================================
   Card image area
   ====================================== */
.news-guide .ng-card-img {
    position: relative;
    display: block;
    height: 164px;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    flex-shrink: 0;
}

/* Dark overlay for readability */
.news-guide .ng-card-img::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    pointer-events: none;
}

/* Cycling gradient fallback backgrounds (when no image) */
.news-guide .ng-card:nth-child(6n+1) .ng-card-img { background-color: #2a2108; }
.news-guide .ng-card:nth-child(6n+2) .ng-card-img { background-color: #1b1230; }
.news-guide .ng-card:nth-child(6n+3) .ng-card-img { background-color: #1e2008; }
.news-guide .ng-card:nth-child(6n+4) .ng-card-img { background-color: #0d1528; }
.news-guide .ng-card:nth-child(6n+5) .ng-card-img { background-color: #280912; }
.news-guide .ng-card:nth-child(6n+6) .ng-card-img { background-color: #0c1e14; }

/* Tag badge on image */
.news-guide .ng-tag {
    position: absolute;
    bottom: 12px;
    left: 12px;
    padding: 3px 10px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    z-index: 1;
    color: #000;
}

/* Cycling tag colors */
.news-guide .ng-card:nth-child(6n+1) .ng-tag { background: #f5c518; }
.news-guide .ng-card:nth-child(6n+2) .ng-tag { background: #a855f7; color: #fff; }
.news-guide .ng-card:nth-child(6n+3) .ng-tag { background: #eab308; }
.news-guide .ng-card:nth-child(6n+4) .ng-tag { background: #60a5fa; }
.news-guide .ng-card:nth-child(6n+5) .ng-tag { background: #f97316; color: #fff; }
.news-guide .ng-card:nth-child(6n+6) .ng-tag { background: #22c55e; }

/* ======================================
   Card body
   ====================================== */
.news-guide .ng-card-body {
    padding: 14px 16px 16px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.news-guide .ng-card-category {
    height: 200px;
    color: #fff;
    font-size: 18px;
    font-weight: 700;
    font-family: 'Oswald', 'Arial', sans-serif;
    line-height: 1.2;
    border-bottom: 1px solid #252a3f;
    position: relative;
}

/* 有真实封面图：铺满容器 */
.news-guide .ng-card-category img.ng-card-img-cover {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* 无封面图，使用 logo 兜底：自适应居中 */
.news-guide .ng-card-category img.ng-card-img-logo {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    max-width: 60%;
    max-height: 60%;
    width: auto;
    height: auto;
    object-fit: contain;
}

.news-guide .ng-card-category .sub-nav-title {
    position: absolute;
    bottom: 10px;
    left: 10px;
    border-radius: 4px;
    padding: 3px 10px;
    font-size: 16px;
    font-weight: 700;
    background: #10B981;
    color: #fff;
}

.news-guide .ng-art-title {
    font-size: 13px;
    font-weight: 600;
    color: #9ca3af;
    margin-bottom: 8px;
    line-height: 1.45;
}

.news-guide .ng-art-title a {
    color: #9ca3af;
    text-decoration: none;
}

.news-guide .ng-art-title a:hover {
    color: #0b85ea;
}

.news-guide .ng-desc {
    color: #6b7280;
    font-size: 13px;
    line-height: 1.6;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    flex: 1;
    margin-bottom: 12px;
}

.news-guide .ng-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: auto;
    padding-top: 4px;
}

.news-guide .ng-date {
    color: #4b5563;
    font-size: 12px;
}

.news-guide .ng-more {
    color: #0b85ea;
    font-size: 13px;
    text-decoration: none;
    font-weight: 500;
}

.news-guide .ng-more:hover {
    color: #60a5fa;
}

/* Empty state */
.news-guide .ng-empty {
    grid-column: 1 / -1;
    text-align: center;
    color: #6b7280;
    padding: 60px 0;
    font-size: 16px;
}

/* ======================================
   RTL support
   ====================================== */
.lang-ar .news-guide .ng-tag {
    left: auto;
    right: 12px;
}

.lang-ar .news-guide .ng-search-form input[type="text"] {

}

.lang-ar .news-guide .ng-search-form button {
    border-radius: 4px 0 0 4px;
}

.search-results-meta {
    display: flex;
    align-items: center;
    gap: 16px;
    margin: 12px 0 20px;
    flex-wrap: wrap;
}
.back-to-news {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: #00d4f0;
    font-size: 14px;
    text-decoration: none;
    white-space: nowrap;
}
.back-to-news:hover { text-decoration: underline; }
.search-results-count {
    font-size: 14px;
    color: #999;
}
.news-tags {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 6px;
}
.news-game-badge {
    display: inline-block;
    background: #00d4f0;
    color: #000;
    font-size: 11px;
    font-weight: 700;
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
    text-decoration: none;
}
.news-game-badge:hover { opacity: 0.85; }
.news-category-badge {
    display: inline-block;
    background: rgba(0, 212, 240, 0.12);
    color: #00d4f0;
    font-size: 11px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 3px;
    letter-spacing: 0.3px;
    text-transform: uppercase;
}

/* ======================================
   Responsive
   ====================================== */

/* Desktop/large tablet: 3 → 2 columns */
@media (max-width: 1024px) {
    .news-guide {
        padding: 0 15px;
    }
    .news-guide .ng-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }

    .list-cate {
        margin-bottom: 15px !important;
        margin-top: 0 !important;
    }
}

/* iPad portrait (768px) */
@media (max-width: 768px) {
    .news-guide .ng-header {
        padding: 18px 0 16px;
    }

    .news-guide .ng-page-title {
        font-size: 24px;
    }

    .news-guide .ng-card-category {
        height: 170px;
    }

    /* Game tab row: horizontal scroll on iPad */
    .news-guide .list-cate.channel {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
    }

    .news-guide .list-cate.channel::-webkit-scrollbar {
        display: none;
    }
}

/* Mobile (≤600px) */
@media (max-width: 600px) {
    .news-guide .ng-header {
        flex-direction: column;
        align-items: stretch;
        padding: 14px 0 12px;
        gap: 10px;
    }

    .news-guide .ng-page-title {
        font-size: 20px;
    }

    /* Search form stretches full width */
    .news-guide .ng-search-form {
        width: 100%;
    }

    .news-guide .ng-search-form input[type="text"] {
        flex: 1;
        width: auto !important;
        min-width: 0;
    }

    /* Game tabs: horizontal scroll, no wrap */
    .news-guide .ng-tabs {
        overflow-x: auto;
        flex-wrap: nowrap;
        padding-bottom: 6px;
        -webkit-overflow-scrolling: touch;
    }

    .news-guide .list-cate.channel {
        flex-wrap: nowrap !important;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        padding-bottom: 4px;
        gap: 8px !important;
    }

    .news-guide .list-cate.channel::-webkit-scrollbar {
        display: none;
    }

    /* Single column grid */
    .news-guide .ng-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }

    .news-guide .ng-card-category {
        height: 140px;
    }

    .news-guide .ng-card-img {
        height: 140px;
    }

    .news-guide .ng-desc {
        -webkit-line-clamp: 2;
    }
}
