/* =====================================================
   NOTICIAS PÚBLICAS V2
   Portada editorial ligera y consistente con el portal.
===================================================== */

.news-page {
    --news-border: #e6ebf2;
    --news-muted: #6d7888;
    --news-text: #172033;
    --news-blue: #0d6efd;
}

.news-page-hero {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 28px 30px;
    margin-bottom: 20px;
    border: 1px solid #dce7fb;
    border-radius: 22px;
    background: linear-gradient(135deg, #f8fbff 0%, #eef5ff 100%);
}

.news-page-hero-copy {
    max-width: 760px;
}

.news-page-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: var(--news-blue);
    font-size: .78rem;
    font-weight: 800;
    letter-spacing: .06em;
    text-transform: uppercase;
}

.news-page-hero h1 {
    margin: 0 0 8px;
    color: var(--news-text);
    font-size: clamp(1.75rem, 3vw, 2.45rem);
    font-weight: 800;
    line-height: 1.12;
}

.news-page-hero p {
    margin: 0;
    color: var(--news-muted);
    font-size: .98rem;
}

.news-result-pill {
    flex: 0 0 auto;
    min-width: 132px;
    padding: 14px 18px;
    border: 1px solid #dce7fb;
    border-radius: 16px;
    background: #fff;
    text-align: center;
    box-shadow: 0 8px 24px rgba(18, 59, 116, .06);
}

.news-result-pill strong {
    display: block;
    color: var(--news-blue);
    font-size: 1.5rem;
    line-height: 1;
}

.news-result-pill span {
    display: block;
    margin-top: 6px;
    color: var(--news-muted);
    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .04em;
    text-transform: uppercase;
}

.news-toolbar {
    padding: 17px;
    margin-bottom: 16px;
    border: 1px solid var(--news-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .04);
}

.news-search-wrap {
    position: relative;
}

.news-search-wrap > i {
    position: absolute;
    top: 50%;
    left: 14px;
    z-index: 2;
    color: #8793a4;
    transform: translateY(-50%);
    pointer-events: none;
}

.news-search-wrap .form-control {
    min-height: 46px;
    padding-left: 42px;
    border-color: #dfe6ef;
    border-radius: 12px;
}

.news-toolbar .btn {
    min-height: 46px;
    border-radius: 12px;
    font-weight: 700;
}

.news-category-strip {
    display: flex;
    gap: 8px;
    min-width: 0;
    padding: 4px 2px 10px;
    margin: 0;
    overflow-x: auto;
    scroll-behavior: smooth;
    scrollbar-width: none;
}

.news-category-strip::-webkit-scrollbar {
    display: none;
}

.news-category-scroll {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    align-items: center;
    gap: 7px;
    margin-bottom: 18px;
}

.news-category-scroll-btn {
    display: none;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 1px solid #dce4ee;
    border-radius: 50%;
    background: #fff;
    color: #526074;
    box-shadow: 0 4px 14px rgba(15, 23, 42, .06);
    transition: border-color .16s ease, color .16s ease, opacity .16s ease;
}

.news-category-scroll.is-scrollable .news-category-scroll-btn {
    display: inline-flex;
}

.news-category-scroll-btn:hover:not(:disabled) {
    border-color: #aac5ef;
    color: var(--news-blue);
}

.news-category-scroll-btn:disabled {
    opacity: .3;
    cursor: default;
}

.news-category-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 8px 11px;
    border: 1px solid #e1e7ef;
    border-radius: 999px;
    background: #fff;
    color: #536174;
    font-size: .78rem;
    font-weight: 700;
    text-decoration: none;
    transition: border-color .16s ease, color .16s ease, background .16s ease;
}

.news-category-chip:hover {
    border-color: #bcd0ef;
    background: #f6f9ff;
    color: var(--news-blue);
}

.news-category-chip.is-active {
    border-color: #b8d1fb;
    background: #edf4ff;
    color: var(--news-blue);
}

.news-category-chip span {
    display: inline-flex;
    min-width: 22px;
    justify-content: center;
    padding: 2px 6px;
    border-radius: 999px;
    background: #eef2f7;
    color: #7a8594;
    font-size: .67rem;
}

.news-category-chip.is-active span {
    background: #dbe9ff;
    color: #2767c8;
}

.news-archive-actions {
    display: flex;
    justify-content: flex-start;
    margin: -4px 0 14px;
}

.news-archive-actions .btn {
    min-height: 40px;
    border-radius: 11px;
    font-size: .78rem;
    font-weight: 750;
}

/* Noticia editorial destacada */
.news-featured {
    display: grid;
    grid-template-columns: minmax(0, 1.35fr) minmax(300px, .8fr);
    min-height: 360px;
    margin-bottom: 28px;
    overflow: hidden;
    border: 1px solid var(--news-border);
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 12px 34px rgba(15, 23, 42, .065);
}

.news-featured-media {
    position: relative;
    min-height: 320px;
    overflow: hidden;
    background: #edf1f6;
}

.news-featured-media img {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
    transition: transform .24s ease;
}

.news-featured:hover .news-featured-media img {
    transform: scale(1.018);
}

.news-featured-category {
    position: absolute;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 7px 10px;
    border-radius: 999px;
    background: rgba(13, 110, 253, .92);
    color: #fff;
    font-size: .72rem;
    font-weight: 800;
    text-decoration: none;
    backdrop-filter: blur(5px);
}

.news-featured-body {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 28px;
}

.news-featured-kicker {
    display: flex;
    flex-wrap: wrap;
    gap: 7px 12px;
    margin-bottom: 12px;
    color: #758194;
    font-size: .76rem;
}

.news-featured-title {
    margin: 0 0 12px;
    font-size: clamp(1.35rem, 2.2vw, 2rem);
    font-weight: 800;
    line-height: 1.2;
}

.news-featured-title a {
    color: var(--news-text);
    text-decoration: none;
}

.news-featured-title a:hover {
    color: var(--news-blue);
}

.news-featured-excerpt {
    margin: 0 0 18px;
    color: var(--news-muted);
    font-size: .93rem;
    line-height: 1.65;
}

.news-featured-action {
    align-self: flex-start;
    border-radius: 11px !important;
    font-weight: 700;
}

.news-layout {
    align-items: flex-start;
}

.news-section-heading {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 16px;
}

.news-section-heading h2 {
    margin: 0;
    color: var(--news-text);
    font-size: 1.28rem;
    font-weight: 800;
}

.news-section-heading p {
    margin: 4px 0 0;
    color: var(--news-muted);
    font-size: .86rem;
}

.news-card {
    height: 100%;
    overflow: hidden;
    border: 1px solid var(--news-border);
    border-radius: 17px;
    background: #fff;
    box-shadow: 0 7px 24px rgba(15, 23, 42, .055);
    transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
    content-visibility: auto;
    contain-intrinsic-size: 430px;
}

.news-card:hover {
    transform: translateY(-3px);
    border-color: #cfddf2;
    box-shadow: 0 12px 30px rgba(15, 23, 42, .09);
}

.news-card-media {
    position: relative;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #edf1f6;
}

.news-card-media > a {
    display: block;
    width: 100%;
    height: 100%;
}

.news-card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .22s ease;
}

.news-card:hover .news-card-media img {
    transform: scale(1.025);
}

.news-card-category {
    position: absolute;
    top: 11px;
    left: 11px;
    z-index: 2;
    padding: 6px 9px;
    border-radius: 999px;
    background: rgba(13, 110, 253, .94);
    color: #fff;
    font-size: .68rem;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
}

.news-card-body {
    display: flex;
    flex-direction: column;
    min-height: 238px;
    padding: 16px;
}

.news-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 11px;
    margin-bottom: 9px;
    color: #7a8594;
    font-size: .72rem;
}

.news-card-title {
    min-height: 45px;
    margin: 0 0 8px;
    font-size: .98rem;
    font-weight: 800;
    line-height: 1.4;
}

.news-card-title a {
    color: var(--news-text);
    text-decoration: none;
}

.news-card-title a:hover {
    color: var(--news-blue);
}

.news-card-excerpt {
    margin: 0 0 12px;
    color: #6f7b8b;
    font-size: .79rem;
    line-height: 1.55;
}

.news-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding-top: 11px;
    margin-top: auto;
    border-top: 1px solid #eef1f5;
}

.news-card-author,
.news-card-views {
    color: #7b8694;
    font-size: .72rem;
}

.news-card-read {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--news-blue);
    font-size: .75rem;
    font-weight: 800;
    text-decoration: none;
}

.news-most-viewed {
    position: sticky;
    top: 96px;
    padding: 16px;
    border: 1px solid var(--news-border);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 8px 28px rgba(15, 23, 42, .04);
}

.news-most-viewed-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin: 0 0 12px;
    color: var(--news-text);
    font-size: .92rem;
    font-weight: 800;
}

.news-most-viewed-item {
    display: grid;
    grid-template-columns: 82px minmax(0, 1fr);
    gap: 10px;
    padding: 10px 0;
    color: inherit;
    text-decoration: none;
}

.news-most-viewed-item + .news-most-viewed-item {
    border-top: 1px solid #eef1f5;
}

.news-most-viewed-image {
    width: 82px;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    border-radius: 10px;
    background: #edf1f6;
}

.news-most-viewed-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.news-most-viewed-copy {
    min-width: 0;
}

.news-most-viewed-copy h3 {
    display: -webkit-box;
    overflow: hidden;
    margin: 0 0 5px;
    color: #273247;
    font-size: .8rem;
    font-weight: 800;
    line-height: 1.35;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
}

.news-most-viewed-item:hover h3 {
    color: var(--news-blue);
}

.news-most-viewed-copy small {
    display: flex;
    flex-wrap: wrap;
    gap: 4px 8px;
    color: #818b98;
    font-size: .67rem;
}

.news-empty {
    padding: 54px 24px;
    border: 1px dashed #ccd7e6;
    border-radius: 18px;
    background: #fbfcfe;
    text-align: center;
}

.news-empty-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 58px;
    height: 58px;
    margin-bottom: 14px;
    border-radius: 50%;
    background: #eaf2ff;
    color: var(--news-blue);
    font-size: 1.45rem;
}

.news-pagination .pagination {
    justify-content: center;
    gap: 4px;
}

.news-pagination .page-link {
    border-radius: 9px !important;
    border-color: #e1e7ef;
}

body.dark-mode .news-page-hero,
body.dark-mode .news-result-pill,
body.dark-mode .news-toolbar,
body.dark-mode .news-featured,
body.dark-mode .news-card,
body.dark-mode .news-most-viewed,
body.dark-mode .news-category-chip,
body.dark-mode .news-empty,
body.dark-mode .news-category-scroll-btn {
    background: #1f1f1f;
    border-color: #333;
}

body.dark-mode .news-page-hero h1,
body.dark-mode .news-featured-title a,
body.dark-mode .news-section-heading h2,
body.dark-mode .news-card-title a,
body.dark-mode .news-most-viewed-title,
body.dark-mode .news-most-viewed-copy h3 {
    color: #f1f3f5;
}

body.dark-mode .news-page-hero p,
body.dark-mode .news-featured-excerpt,
body.dark-mode .news-card-excerpt,
body.dark-mode .news-card-meta,
body.dark-mode .news-card-author,
body.dark-mode .news-card-views {
    color: #b4bbc4;
}

body.dark-mode .news-category-chip {
    color: #d1d5db;
}

body.dark-mode .news-category-chip.is-active {
    background: #18263b;
    border-color: #31598e;
    color: #8fbcff;
}

@media (max-width: 991px) {
    .news-featured {
        grid-template-columns: 1fr;
    }

    .news-featured-media,
    .news-featured-media img {
        min-height: 300px;
    }

    .news-most-viewed {
        position: static;
        margin-top: 24px;
    }
}

@media (max-width: 767px) {
    .news-page-hero {
        align-items: flex-start;
        flex-direction: column;
        padding: 24px;
    }

    .news-result-pill {
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        width: 100%;
        min-width: 0;
    }

    .news-result-pill span {
        margin-top: 0;
    }

    .news-toolbar {
        padding: 14px;
    }

    .news-featured-body {
        padding: 22px;
    }

    .news-section-heading {
        align-items: flex-start;
        flex-direction: column;
    }

    .news-category-scroll {
        gap: 4px;
    }

    .news-category-scroll-btn {
        width: 32px;
        height: 32px;
        font-size: .8rem;
    }
}

@media (max-width: 575px) {
    .news-featured-media,
    .news-featured-media img {
        min-height: 230px;
    }

    .news-most-viewed-item {
        grid-template-columns: 74px minmax(0, 1fr);
    }

    .news-most-viewed-image {
        width: 74px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .news-card,
    .news-card-media img,
    .news-featured-media img,
    .news-category-chip,
    .news-category-scroll-btn {
        transition: none !important;
    }
}
