/*
Theme Name: Peru Mag Theme
Theme URI: https://gometri.com
Author: Belser Olivera
Author URI: https://gometri.com
Description: Plantilla de WordPress optimizada para portales de noticias, farándula y tendencias en Perú. Alta velocidad (Core Web Vitals), preparado para Google News, Discover y Monetización con AdSense.
Version: 1.1.1
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: perumag
Tags: news, entertainment, blog, modern, seo-optimized, fast
*/

:root {
    /* Colors */
    --bg-color: #FFFFFF;
    --bg-alt: #F8FAFC;
    --text-main: #0F172A;
    --text-muted: #64748B;
    --primary-color: #E11D48;
    --secondary-color: #2563EB;
    --trending-color: #F59E0B;
    --border-color: #E2E8F0;

    --card-bg: #FFFFFF;
    --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -1px rgba(0, 0, 0, 0.03);
    --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);

    --header-height: 70px;

    /* Fonts */
    --font-headings: 'Poppins', system-ui, sans-serif;
    --font-body: 'Inter', system-ui, sans-serif;
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #0F172A;
        --bg-alt: #1E293B;
        --text-main: #F8FAFC;
        --text-muted: #94A3B8;
        --border-color: #334155;
        --card-bg: #1E293B;
        --card-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.3);
        --card-shadow-hover: 0 10px 15px -3px rgba(0, 0, 0, 0.5);
    }
}

/* Base */
*,
*::before,
*::after {
    box-sizing: border-box;
}

body {
    margin: 0;
    font-family: var(--font-body);
    background-color: var(--bg-color);
    color: var(--text-main);
    font-size: 18px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-headings);
    font-weight: 700;
    margin-top: 0;
    line-height: 1.25;
    color: var(--text-main);
}

h1 {
    font-size: 36px;
}

h2 {
    font-size: 28px;
}

h3 {
    font-size: 22px;
}

p {
    margin-top: 0;
    margin-bottom: 1.5rem;
}

a {
    color: inherit;
    text-decoration: none;
    transition: color 0.2s ease;
}

a:hover {
    color: var(--primary-color);
}

img {
    max-width: 100%;
    height: auto;
    display: block;
}

.container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* Utilities */
.stretched-link::after {
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 1;
    content: "";
}

.meta-info {
    font-size: 14px;
    color: var(--text-muted);
}

.section-title {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 24px;
    border-bottom: 2px solid var(--border-color);
    padding-bottom: 12px;
}

.section-title::before {
    content: '';
    display: block;
    width: 6px;
    height: 24px;
    background-color: var(--primary-color);
    border-radius: 4px;
}

.text-trending {
    color: var(--trending-color);
}

/* Header */
.site-header {
    background: var(--bg-color);
    border-bottom: 1px solid var(--border-color);
    position: sticky;
    top: 0;
    z-index: 100;
    height: auto;
    min-height: var(--header-height);
    display: flex;
    align-items: center;
    padding: 10px 0;
}

.header-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    flex-wrap: wrap;
}

.site-logo {
    font-family: var(--font-headings);
    font-size: 28px;
    font-weight: 800;
    color: var(--primary-color);
    letter-spacing: -0.5px;
    display: flex;
    align-items: center;
}

.site-logo img {
    height: 65px;
    width: auto;
    max-width: 100%;
    object-fit: contain;
    transition: height 0.3s ease;
}

@media (max-width: 900px) {
    .site-logo img {
        height: 60px;
    }
}

@media (max-width: 768px) {
    .site-logo img {
        height: 48px;
    }
}

.main-nav ul {
    list-style: none;
    display: flex;
    gap: 24px;
    margin: 0;
    padding: 0;
}

.main-nav a {
    font-family: var(--font-headings);
    font-weight: 600;
    font-size: 16px;
}

.menu-toggle {
    background: none;
    border: none;
    color: var(--text-main);
    cursor: pointer;
    display: none;
    padding: 8px;
    z-index: 101;
}

.hamburger-icon {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: flex-end;
    width: 30px;
    height: 20px;
    position: relative;
}

.hamburger-icon span {
    display: block;
    height: 3px;
    background: var(--text-main);
    border-radius: 4px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    transform-origin: center;
}

.hamburger-icon span:nth-child(1) {
    width: 100%;
}

.hamburger-icon span:nth-child(2) {
    width: 75%;
}

.hamburger-icon span:nth-child(3) {
    width: 50%;
}

.menu-toggle:hover .hamburger-icon span {
    width: 100%;
}

/* Animación hamburguesa → X */
.menu-toggle[aria-expanded="true"] .hamburger-icon span {
    width: 100%;
}

.menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(2) {
    opacity: 0;
    transform: translateX(10px) scaleX(0);
}

.menu-toggle[aria-expanded="true"] .hamburger-icon span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* Current menu item */
.main-nav .current-menu-item>a,
.main-nav .current-cat>a {
    color: var(--primary-color);
}

/* Hero Section */
.hero-section {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 20px;
    margin-block: 30px;
    align-items: stretch;
}

.hero-main {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    display: block;
    height: 100%;
}

.hero-main > a {
    display: block;
    height: 100%;
}

.hero-main a > img,
.hero-main a > picture > img,
.hero-main img {
    width: 100% !important;
    height: 100% !important;
    min-height: 420px;
    max-height: 500px;
    object-fit: cover !important;
    transition: transform 0.5s ease;
    display: block;
}

.hero-main:hover img {
    transform: scale(1.05);
}

.hero-main-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9) 0%, rgba(15, 23, 42, 0.4) 50%, transparent 100%);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    align-items: flex-start;
    padding: 24px;
}

.hero-main-title {
    color: #fff;
    margin-bottom: 8px;
    font-size: 30px;
}

.hero-secondary-list {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 0;
    height: 100%;
}

.hero-secondary-card {
    display: flex;
    gap: 12px;
    align-items: center;
}

.hero-secondary-card img {
    width: 100px;
    height: 66px;
    object-fit: cover;
    border-radius: 8px;
    flex-shrink: 0;
}

.hero-secondary-title {
    font-size: 15px;
    margin: 0 0 3px 0;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.3;
}

.badge-category {
    background: var(--primary-color);
    color: white;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 10px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    font-weight: 700;
    font-family: var(--font-headings);
    position: relative;
    z-index: 2;
    align-self: flex-start;
    width: max-content;
    max-width: 100%;
    transition: background 0.2s ease, color 0.2s ease;
}

/* Hover: fondo rojo oscuro + texto blanco (Opción A - alta accesibilidad) */
.badge-category:hover {
    background: #BE123C !important;
    color: #ffffff !important;
    text-decoration: none;
}

.badge-category.trending {
    background: var(--trending-color);
    color: #000;
}

.badge-category.trending:hover {
    background: #D97706 !important; /* amber oscuro */
    color: #000 !important;
}

.badge-category.tv {
    background: var(--secondary-color);
}

.badge-category.tv:hover {
    background: #1D4ED8 !important; /* blue oscuro */
    color: #ffffff !important;
}

/* Trending Bar (Scroll Horizontal Mobile) */
.trending-bar {
    background: var(--bg-alt);
    padding: 15px 20px;
    border-radius: 8px;
    margin-bottom: 40px;
    display: flex;
    align-items: center;
    gap: 15px;
    overflow-x: auto;
    white-space: nowrap;
    -ms-overflow-style: none;
    /* IE and Edge */
    scrollbar-width: none;
    /* Firefox */
}

.trending-bar::-webkit-scrollbar {
    display: none;
}

.trending-label {
    font-weight: 800;
    color: var(--primary-color);
    font-size: 14px;
    text-transform: uppercase;
}

.trending-items {
    display: flex;
    gap: 20px;
}

.trending-item {
    font-size: 16px;
    font-weight: 600;
}

/* Cards (Redesigned) */
.news-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
    margin-bottom: 40px;
}

.news-card {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.news-card:hover {
    box-shadow: var(--card-shadow-hover);
    transform: translateY(-4px);
}

.news-card-img-wrap {
    position: relative;
    overflow: hidden;
    aspect-ratio: 16 / 9;
}

.news-card-img-wrap img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.news-card:hover .news-card-img-wrap img {
    transform: scale(1.05);
}

.news-card-badge {
    position: absolute;
    top: 12px;
    left: 12px;
    z-index: 2;
    margin-bottom: 0;
}

.news-card-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.news-card-title {
    font-size: 20px;
    margin-bottom: 12px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.news-card-meta {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Layout Builder */
.home-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 40px;
    margin-top: 40px;
}

.main-column {
    min-width: 0;
}

.sidebar-column {
    min-width: 0;
}

.widget-title {
    font-family: var(--font-headings);
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--border-color);
}

.ranking-list {
    padding: 0;
    margin: 0;
    list-style: none;
}

.ranking-list li {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
}

.ranking-num {
    font-size: 32px;
    font-weight: 900;
    color: var(--border-color);
    font-family: var(--font-headings);
    line-height: 1;
}

/* Single Article */
.single-container {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 40px;
    margin-top: 30px;
}

.single-article {
    max-width: 100%;
}

.breadcrumbs {
    font-size: 14px;
    color: var(--text-muted);
    margin-bottom: 20px;
}

.breadcrumbs a {
    color: var(--secondary-color);
    font-weight: 500;
}

.article-title {
    font-size: 36px;
    margin-bottom: 15px;
}

.article-excerpt {
    font-size: 20px;
    color: var(--text-muted);
    font-weight: 400;
    margin-bottom: 24px;
    line-height: 1.5;
}

.article-meta-info {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    font-size: 14px;
    border-top: 1px solid var(--border-color);
    border-bottom: 1px solid var(--border-color);
    padding: 15px 0;
    margin-bottom: 30px;
}

.article-featured-image {
    margin: 0 0 30px 0;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--card-shadow);
}

.article-featured-image img {
    width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
}

.article-content {
    font-size: 18px;
    line-height: 1.8;
}

.article-content h2,
.article-content h3 {
    margin-top: 40px;
    margin-bottom: 20px;
}

.article-content img {
    border-radius: 8px;
    margin: 30px 0;
}

.article-content a {
    color: var(--primary-color);
    text-decoration: underline;
    text-underline-offset: 3px;
    text-decoration-thickness: 1.5px;
    transition: all 0.2s ease;
}

.article-content a:hover {
    color: #BE123C;
    text-decoration-thickness: 3px;
}

/* Article Topics / Tags Chips */
.article-topics {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.article-topics-label {
    font-family: var(--font-headings);
    font-weight: 700;
    font-size: 15px;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.article-topics-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.topic-chip {
    display: inline-flex;
    align-items: center;
    padding: 7px 16px;
    background: var(--bg-alt);
    color: var(--text-main) !important;
    border: 1px solid var(--border-color);
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--font-body);
    line-height: 1.4;
    white-space: nowrap;
    text-decoration: none;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    cursor: pointer;
}

.topic-chip:hover {
    background: var(--primary-color);
    color: #FFFFFF !important;
    border-color: var(--primary-color);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(225, 29, 72, 0.25);
}

.topic-chip:active {
    transform: translateY(0);
    box-shadow: none;
}

@media (max-width: 480px) {
    .topic-chip {
        padding: 6px 12px;
        font-size: 12px;
    }

    .article-topics-list {
        gap: 8px;
    }
}

/* Newsletter */
.newsletter-box {
    background: var(--bg-alt);
    padding: 30px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid var(--border-color);
    margin-top: 40px;
}

.newsletter-box input[type="email"] {
    padding: 12px 20px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 16px;
    width: 100%;
    max-width: 300px;
    margin-right: 10px;
    margin-bottom: 10px;
}

.newsletter-box button {
    padding: 12px 24px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: bold;
    cursor: pointer;
    transition: background 0.2s;
}

.newsletter-box button:hover {
    background: #BE123C;
}

/* Ads Placeholder */
.ad-slot {
    background: var(--bg-alt);
    border: 1px dashed var(--border-color);
    text-align: center;
    color: var(--text-muted);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin: 30px 0;
    min-height: 250px;
    font-size: 14px;
}

.ad-slot.sticky {
    position: sticky;
    top: 100px;
}

/* Footer */
.site-footer {
    background-color: #0F172A;
    /* Dark always */
    color: #94A3B8;
    padding: 60px 0 20px;
    margin-top: 60px;
    border-top: 6px solid var(--primary-color);
}

.site-footer a {
    color: #E2E8F0;
}

.site-footer a:hover {
    color: var(--primary-color);
}

.site-footer h4 {
    color: #FFFFFF;
    margin-bottom: 24px;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-nav li {
    margin-bottom: 10px;
}

.site-info {
    text-align: center;
    border-top: 1px solid #334155;
    padding-top: 20px;
    font-size: 14px;
}

/* Mobile responsive */
@media (max-width: 900px) {
    .news-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .home-layout,
    .single-container {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }

    .main-nav {
        display: none;
        width: 100%;
        order: 3;
        /* Empujar debajo del logo y hamburguesa */
        padding: 20px 0 10px;
        border-top: 1px solid var(--border-color);
        margin-top: 10px;
        background: var(--bg-color);
    }

    .main-nav.active {
        display: block;
    }

    .main-nav ul {
        flex-direction: column;
        gap: 0;
        padding: 0;
        margin: 0;
    }

    .main-nav li {
        border-bottom: 1px solid var(--border-color);
    }

    .main-nav li:last-child {
        border-bottom: none;
    }

    .main-nav a {
        display: block;
        padding: 12px 0;
    }

    .hero-section {
        grid-template-columns: 1fr;
    }

    .hero-main img {
        height: 350px;
        min-height: 300px;
        max-height: 400px;
    }

    .hero-secondary-list {
        gap: 12px;
    }

    .news-grid {
        grid-template-columns: 1fr 1fr;
    }

    /* 2 columns on mobile as requested */

    h1 {
        font-size: 32px;
    }

    h2 {
        font-size: 24px;
    }
}

@media (max-width: 480px) {
    .news-grid {
        grid-template-columns: 1fr;
    }

    /* Optional if too small, but prompt asked for 2 col mobile. Will keep 2 col on tablet, 1 on very small mobile, wait, prompt says "2 columnas móvil". I'll adjust this */
    .news-card-title {
        font-size: 16px;
    }
}

/* Force 2 columns on mobile as requested */
@media (max-width: 600px) {
    .news-grid {
        grid-template-columns: 1fr 1fr;
        gap: 15px;
    }

    .news-card-content {
        padding: 12px;
    }

    .news-card-title {
        font-size: 15px;
    }

    .news-card-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }

    .hero-secondary-card {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }

    .hero-secondary-card img {
        width: 80px;
        height: 54px;
        aspect-ratio: auto;
    }
}

/* =========================================================================
   FOOTER (Dark Mode Siempre - Legibilidad y Contraste Alto)
   ========================================================================= */
.site-footer {
    background-color: #0F172A;
    /* Slate 900 - Dark elegant navy casi negro */
    color: #94A3B8;
    /* Slate 400 - Muted clear text */
    padding: 60px 0 20px;
    margin-top: 60px;
    border-top: 4px solid var(--primary-color);
}

.site-footer a {
    color: #CBD5E1;
    /* Slate 300 */
    text-decoration: none;
    transition: color 0.3s ease;
}

.site-footer a:hover {
    color: #FFFFFF;
}

.site-footer h4 {
    color: #F8FAFC;
    /* Titulos blancos para buen contraste */
    margin-bottom: 20px;
    font-family: var(--font-headings);
    font-weight: 700;
}

.footer-widgets {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 40px;
    margin-bottom: 40px;
}

.footer-widgets ul,
.footer-cats-dynamic {
    list-style: none;
    padding: 0;
    margin: 0;
}

.footer-widgets ul li {
    margin-bottom: 12px;
}

.footer-widgets ul li::before {
    content: "›";
    color: var(--primary-color);
    margin-right: 8px;
    font-weight: bold;
    font-size: 1.1em;
}

.site-info {
    text-align: center;
    border-top: 1px solid #1E293B;
    /* Slate 800 */
    padding-top: 25px;
    font-size: 0.9rem;
}

/* Submenu / Dropdown Moderno Multi-nivel */
.main-nav .menu-item-has-children {
    position: relative;
    padding-right: 15px;
    /* Espacio para el indicador */
}

.main-nav .menu-item-has-children>a::after {
    content: " ▾";
    font-size: 12px;
    margin-left: 5px;
    vertical-align: middle;
}

.main-nav .sub-menu .menu-item-has-children>a::after {
    content: " ▸";
}

.main-nav .sub-menu {
    visibility: hidden;
    opacity: 0;
    position: absolute;
    top: 100%;
    left: 0;
    background: var(--bg-color);
    box-shadow: var(--card-shadow);
    z-index: 1000;
    min-width: 220px;
    padding: 10px 0;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    margin-top: 10px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    transform: translateY(-10px);
    display: block;
}

/* Nivel 2 y posteriores (Subcategorías múltiples) */
.main-nav .sub-menu .sub-menu {
    top: 0;
    left: 100%;
    margin-top: -10px;
    margin-left: 5px;
}

.main-nav .menu-item-has-children:hover>.sub-menu,
.main-nav .menu-item-has-children:focus-within>.sub-menu {
    visibility: visible;
    opacity: 1;
    transform: translateY(0);
}

.main-nav .sub-menu li {
    width: 100%;
    position: relative;
    list-style: none;
}

.main-nav .sub-menu a {
    display: block;
    padding: 10px 20px;
    font-size: 15px;
    font-weight: 500;
}

.main-nav .sub-menu a:hover {
    background: var(--bg-alt);
    color: var(--primary-color);
}

@media (max-width: 768px) {
    .main-nav .sub-menu {
        position: static;
        box-shadow: none;
        border: none;
        padding-left: 20px;
        background: transparent;
        margin-top: 0;
        visibility: visible;
        opacity: 1;
        transform: translateY(0);
        display: none;
        transition: none;
    }

    .main-nav .menu-item-has-children.active>.sub-menu {
        display: block;
    }

    .main-nav .sub-menu .menu-item-has-children>a::after {
        content: " ▾";
        /* En móvil todos abren hacia abajo */
    }
}

/* =========================================================================
   SIDEBAR EDITORIAL MODULES (Lo Más Leído, Último Minuto, Tendencias)
   ========================================================================= */

.sidebar-editorial {
    padding-left: 20px;
    border-left: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    gap: 16px;
    /* Compactado: antes 30px */
}

/* Widget Container Base */
.sidebar-widget {
    background: var(--card-bg);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    padding: 12px;
    /* Compactado: antes 20px */
    transition: box-shadow 0.3s ease;
}

.sidebar-widget:hover {
    box-shadow: var(--card-shadow);
}

/* Widget Title */
.sidebar-widget-title {
    font-family: var(--font-headings);
    font-size: 14px;
    /* Compactado: antes 20px */
    font-weight: 700;
    color: var(--text-main);
    text-transform: uppercase;
    letter-spacing: 0.6px;
    margin: 0 0 10px 0;
    /* Compactado: antes 16px */
    padding-bottom: 6px;
    /* Compactado: antes 8px */
    border-bottom: 2px solid var(--primary-color);
    display: flex;
    align-items: center;
    gap: 6px;
    line-height: 1.3;
}

.sidebar-widget-icon {
    font-size: 16px;
    /* Compactado: antes 20px */
    line-height: 1;
}

/* Sidebar Item Base */
.sidebar-item {
    display: flex;
    gap: 10px;
    align-items: center;
    text-decoration: none;
    color: var(--text-main);
    padding: 6px 6px;
    /* Compactado: antes 10px 8px */
    border-radius: 6px;
    transition: all 0.25s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
}

.sidebar-item:hover {
    background: var(--bg-alt);
    transform: translateX(4px);
}

.sidebar-item+.sidebar-item {
    border-top: 1px solid var(--border-color);
}

/* Sidebar Item: Rank Number */
.sidebar-item-rank {
    font-family: var(--font-headings);
    font-size: 18px;
    /* Compactado: antes 24px */
    font-weight: 900;
    color: var(--border-color);
    line-height: 1;
    min-width: 22px;
    /* Compactado: antes 28px */
    text-align: center;
    flex-shrink: 0;
    transition: color 0.25s ease;
}

.sidebar-item:hover .sidebar-item-rank {
    color: var(--primary-color);
}

/* Top 3 special accent */
.sidebar-item-numbered:nth-child(1) .sidebar-item-rank {
    color: var(--primary-color);
}

.sidebar-item-numbered:nth-child(2) .sidebar-item-rank {
    color: var(--trending-color);
}

.sidebar-item-numbered:nth-child(3) .sidebar-item-rank {
    color: var(--secondary-color);
}

/* Sidebar Item: Thumbnail */
.sidebar-item-thumb {
    flex-shrink: 0;
    width: 64px;
    /* Ajustado: rango recomendado 60-70px */
    height: 48px;
    border-radius: 5px;
    overflow: hidden;
}

.sidebar-item-thumb img,
.sidebar-item-thumb .sidebar-thumb {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sidebar-item:hover .sidebar-item-thumb img {
    transform: scale(1.08);
}

.sidebar-item-thumb-sm {
    width: 56px;
    /* Compactado */
    height: 42px;
    border-radius: 4px;
}

/* Sidebar Item: Info Block */
.sidebar-item-info {
    flex: 1;
    min-width: 0;
}

.sidebar-item-cat {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--primary-color);
    font-family: var(--font-headings);
    line-height: 1;
    /* Meta info ya optimizada a 10px - dentro del rango 12px recomendado */
}

.sidebar-item-title {
    font-family: var(--font-headings);
    font-size: 12.5px;
    /* Compactado */
    font-weight: 600;
    line-height: 1.3;
    margin: 2px 0 0 0;
    color: var(--text-main);
    /* Limitar a máximo 2 líneas con line-clamp */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    line-clamp: 2;
    /* Propiedad estándar - compatibilidad progresiva */
    overflow: hidden;
}

.sidebar-item-date {
    font-size: 11px;
    /* Meta info compacta */
    color: var(--text-muted);
    margin-top: 2px;
    display: block;
}

/* Sidebar Item: Compact (Último Minuto) */
.sidebar-item-compact {
    justify-content: space-between;
}

.sidebar-item-compact-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 2px;
}

.sidebar-item-time {
    font-size: 11px;
    /* Meta info compacta */
    color: var(--text-muted);
    font-family: var(--font-body);
}

.sidebar-item-arrow {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 700;
    opacity: 0;
    transform: translateX(-5px);
    transition: all 0.25s ease;
    flex-shrink: 0;
}

.sidebar-item:hover .sidebar-item-arrow {
    opacity: 1;
    transform: translateX(0);
}

/* Sidebar Item: Trending */
.sidebar-item-trending {
    align-items: center;
}

/* Sidebar Último Minuto pulse indicator */
.sidebar-ultimo-minuto .sidebar-widget-title::after {
    content: '';
    width: 8px;
    height: 8px;
    background: var(--primary-color);
    border-radius: 50%;
    animation: sidebar-pulse 2s ease-in-out infinite;
    margin-left: auto;
}

@keyframes sidebar-pulse {

    0%,
    100% {
        opacity: 1;
        transform: scale(1);
    }

    50% {
        opacity: 0.4;
        transform: scale(0.8);
    }
}

/* =========================================================================
   SIDEBAR RESPONSIVE
   ========================================================================= */
@media (max-width: 900px) {
    .sidebar-editorial {
        padding-left: 0;
        border-left: none;
        margin-top: 30px;
        /* Compactado: antes 40px */
        gap: 14px;
    }

    .sidebar-widget-title {
        font-size: 13px;
        /* Compactado en tablet/mobile */
    }

    .sidebar-widget-icon {
        font-size: 15px;
    }

    /* En mobile, grid horizontal para las tendencias */
    .sidebar-tendencias-list {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    .sidebar-item-trending {
        flex-direction: column;
        align-items: flex-start;
        text-align: left;
    }

    .sidebar-item-trending .sidebar-item-thumb-sm {
        width: 100%;
        height: 80px;
    }
}

@media (max-width: 480px) {
    .sidebar-widget {
        padding: 10px;
        /* Compactado: antes 15px */
    }

    .sidebar-editorial {
        gap: 12px;
    }

    .sidebar-item {
        padding: 5px 4px;
    }

    .sidebar-tendencias-list {
        grid-template-columns: 1fr;
    }
}

/* Layout de Lista para Noticias Generico */
.news-list-layout {
    display: flex;
    flex-direction: column;
    gap: 25px;
}

.news-list-layout .news-card {
    margin-bottom: 0;
}

.news-list-layout .news-card {
    flex-direction: row;
    align-items: stretch;
}

.news-list-layout .news-card-img-wrap {
    width: 40%;
    flex-shrink: 0;
    max-width: 350px;
    aspect-ratio: 16/10;
}

.news-list-layout .news-card-content {
    width: 60%;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

/* Responsivo para Vista en Lista */
@media (max-width: 768px) {
    .news-list-layout .news-card {
        flex-direction: column;
    }
    .news-list-layout .news-card-img-wrap {
        width: 100%;
        max-width: 100%;
        aspect-ratio: 16/9;
    }
    .news-list-layout .news-card-content {
        width: 100%;
    }
}