/* Homepage-only official news: exactly five fixed-height rows, with no page-level scrolling. */
.yp-official-news {
    --yp-news-row-height: 124px;
    width: calc(100% - 40px);
    max-width: 1200px;
    margin: 28px auto;
    padding: 28px;
    box-sizing: border-box;
    border: 1px solid rgba(149, 165, 230, .18);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(102, 126, 234, .16), rgba(233, 69, 96, .12));
    color: var(--text, #f1f1f1);
}

.yp-official-news *,
.yp-official-news *::before,
.yp-official-news *::after {
    box-sizing: border-box;
}

.yp-official-news [hidden] {
    display: none !important;
}

.yp-news-heading h2 {
    margin: 0 0 8px;
    color: var(--text, #f1f1f1);
    font-size: 24px;
    line-height: 1.4;
}

.yp-news-hint {
    min-height: 22px;
    margin: 0 0 18px;
    color: var(--text-secondary, #b8b8b8);
    font-size: 14px;
    line-height: 1.6;
}

.yp-news-viewport {
    height: calc(var(--yp-news-row-height) * 5);
    overflow: hidden;
    position: relative;
    border: 1px solid rgba(255, 255, 255, .09);
    border-radius: 12px;
    background: rgba(13, 20, 43, .28);
}

.yp-news-track {
    margin: 0;
    padding: 0;
    list-style: none;
    transform: translateY(0);
}

.yp-news-item {
    height: var(--yp-news-row-height);
    margin: 0;
    padding: 13px 18px;
    overflow: hidden;
    border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.yp-news-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
    color: var(--text-secondary, #b8b8b8);
    font-size: 12px;
    line-height: 18px;
}

.yp-news-label {
    flex-shrink: 0;
    color: #c4b5fd;
}

.yp-news-item h3 {
    margin: 0 0 6px;
    font-size: 17px;
    font-weight: 600;
    line-height: 24px;
}

.yp-news-title {
    display: block;
    overflow: hidden;
    color: var(--text, #f1f1f1);
    text-decoration: none;
    white-space: nowrap;
    text-overflow: ellipsis;
}

.yp-news-title:hover {
    color: #c4b5fd;
}

.yp-news-summary {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    max-height: 40px;
    overflow: hidden;
    margin: 0;
    color: var(--text-secondary, #c5c8d3);
    font-size: 14px;
    line-height: 20px;
    overflow-wrap: anywhere;
}

.yp-news-message {
    display: flex;
    height: 100%;
    padding: 24px;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--text-secondary, #b8b8b8);
    text-align: center;
    font-size: 14px;
}

.yp-news-actions {
    display: flex;
    min-height: 44px;
    margin-top: 20px;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.yp-news-post {
    display: inline-flex;
    min-height: 44px;
    padding: 10px 26px;
    align-items: center;
    justify-content: center;
    border: 1px solid transparent;
    border-radius: 9px;
    background: var(--highlight, #e94560);
    color: #fff;
    text-decoration: none;
    font-size: 15px;
    font-weight: 600;
    line-height: 22px;
    white-space: nowrap;
}

.yp-news-post:hover {
    color: #fff;
    filter: brightness(1.12);
}

.yp-news-controls {
    display: flex;
    align-items: center;
    gap: 8px;
}

.yp-news-controls button,
.yp-news-message button {
    min-height: 40px;
    padding: 8px 12px;
    border: 1px solid rgba(255, 255, 255, .18);
    border-radius: 8px;
    background: rgba(255, 255, 255, .06);
    color: var(--text, #f1f1f1);
    font: inherit;
    font-size: 13px;
    line-height: 20px;
    cursor: pointer;
}

.yp-news-controls button:hover,
.yp-news-message button:hover {
    background: rgba(255, 255, 255, .12);
}

.yp-news-controls button:disabled {
    opacity: .5;
    cursor: default;
}

.yp-news-title:focus-visible,
.yp-news-post:focus-visible,
.yp-news-controls button:focus-visible,
.yp-news-message button:focus-visible {
    outline: 2px solid #c4b5fd;
    outline-offset: 3px;
}

.yp-news-noscript {
    margin-top: 14px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .yp-official-news {
        --yp-news-row-height: 148px;
        width: auto;
        margin: 18px 15px;
        padding: 20px;
        border-radius: 14px;
    }

    .yp-news-heading h2 {
        font-size: 21px;
    }

    .yp-news-hint {
        font-size: 12px;
    }

    .yp-news-item {
        padding: 12px;
    }

    .yp-news-item h3 {
        font-size: 15px;
        line-height: 22px;
    }

    .yp-news-title {
        display: -webkit-box;
        -webkit-box-orient: vertical;
        -webkit-line-clamp: 2;
        max-height: 44px;
        white-space: normal;
        overflow-wrap: anywhere;
    }

    .yp-news-meta {
        gap: 8px;
        font-size: 11px;
    }

    .yp-news-summary {
        font-size: 13px;
    }

    .yp-news-actions {
        gap: 8px;
    }

    .yp-news-post {
        padding: 10px 16px;
        font-size: 14px;
    }

    .yp-news-controls {
        gap: 6px;
    }

    .yp-news-controls button {
        padding: 8px;
        font-size: 12px;
    }
}

@media (max-width: 359px) {
    .yp-official-news {
        padding: 14px;
    }

    .yp-news-actions {
        flex-wrap: wrap;
    }
}

@media (prefers-reduced-motion: reduce) {
    .yp-news-track {
        transition: none !important;
    }
}
