/* ============================================================
   ESN NOTICIAS - ESTILO GLOBAL UNIFICADO (V 2.0)
============================================================ */

/* --- CONFIGURACIÓN GLOBAL --- */
.esn-app-container, .esn-ios-archivo, .esn-ios-article {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    font-family: -apple-system, 'SF Pro Display', 'Inter', system-ui, sans-serif;
}

/* ============================================================
   1. SECCIÓN HOME: DISEÑO APP (BENTO GRID + LISTA)
============================================================ */

/* BENTO GRID DESKTOP */
.esn-app-bento {
    display: grid;
    grid-template-columns: 2.2fr 1fr;
    grid-template-rows: repeat(3, 140px);
    gap: 16px;
    margin-bottom: 40px;
}

.esn-app-card {
    position: relative;
    border-radius: 28px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    text-decoration: none;
    background: #111;
    transform: translateZ(0);
    transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), box-shadow 0.3s ease;
}

.esn-app-card:hover {
    transform: translateY(-4px) scale(1.01);
    box-shadow: 0 16px 32px rgba(0,0,0,0.25);
    z-index: 10;
}

.main-card { grid-row: span 3; }
.sub-card { grid-row: span 1; border-radius: 22px; }

.esn-app-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    z-index: 0;
    transition: transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.esn-app-card:hover .esn-app-bg { transform: scale(1.06); }

.esn-app-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.3) 50%, rgba(0,0,0,0) 100%);
}
.sub-card .esn-app-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.1) 70%);
}

.esn-app-content {
    position: relative;
    z-index: 2;
    padding: 24px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.main-card .esn-app-content { padding: 36px; gap: 12px; }

/* BADGES GLASSMORPHISM */
.esn-app-badges { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 4px; }
.esn-app-badge { padding: 6px 14px; border-radius: 30px; font-size: 11px; font-weight: 700; letter-spacing: 0.5px; color: white; }
.esn-app-badge.solid { background-color: var(--tema); box-shadow: 0 4px 10px rgba(0,0,0,0.2); }
.esn-app-badge.blur { background: rgba(236, 0, 140, 0.85); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); border: 1px solid rgba(255,255,255,0.2); }

/* BENTO TYPOGRAPHY */
.esn-app-title { color: white; margin: 0; font-weight: 800; line-height: 1.15; letter-spacing: -0.02em; }
.main-card .esn-app-title { font-size: 32px; }
.sub-card .esn-app-title { font-size: 18px; }
.esn-app-meta { display: flex; gap: 16px; color: rgba(255,255,255,0.7); font-size: 13px; font-weight: 500; }

/* ÚLTIMAS NOTICIAS (LISTA COMPACTA APP) */
.esn-app-section-header { display: flex; justify-content: space-between; align-items: baseline; margin: 40px 0 20px; }
.esn-app-section-header h3 { font-size: 22px; font-weight: 800; margin: 0; color: #fff; }
.esn-app-link { color: #00aeef; text-decoration: none; font-weight: 600; font-size: 14px; }
.esn-app-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; }

.esn-app-list-item {
    display: flex;
    align-items: center;
    gap: 16px;
    background: rgba(30, 30, 35, 0.6);
    padding: 12px;
    border-radius: 20px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid rgba(255,255,255,0.05);
}
.esn-app-list-item:hover { background: rgba(40, 40, 45, 0.9); transform: translateX(5px); border-color: var(--tema); }
.esn-app-list-img { width: 80px; height: 80px; border-radius: 14px; overflow: hidden; flex-shrink: 0; }
.esn-app-list-img img { width: 100%; height: 100%; object-fit: cover; }
.esn-app-list-content { display: flex; flex-direction: column; justify-content: center; }
.esn-app-list-cat { color: var(--tema); font-size: 11px; font-weight: 700; text-transform: uppercase; margin-bottom: 4px; }
.esn-app-list-title { color: white; font-size: 15px; font-weight: 600; line-height: 1.3; margin: 0 0 6px 0; }
.esn-app-list-date { color: rgba(255,255,255,0.5); font-size: 12px; }


/* ============================================================
   2. SINGLE: DETALLE DE NOTICIA (INYECCIÓN AUTOMÁTICA)
============================================================ */
.esn-ios-article { max-width: 800px; margin: 40px auto; font-family: -apple-system, 'SF Pro Display', 'Georgia', serif; }
.esn-ios-article-card { background: rgba(20, 20, 25, 0.9); border-radius: 28px; overflow: hidden; box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15); }
.esn-ios-article-header { padding: 40px 40px 20px; }
.esn-ios-article-badge { display: inline-flex; align-items: center; gap: 8px; background: #ec008c; padding: 6px 18px; border-radius: 30px; font-size: 12px; font-weight: 600; color: white; margin-bottom: 20px; }
.esn-ios-article-cat { display: inline-flex; align-items: center; gap: 8px; padding: 6px 18px; border-radius: 30px; font-size: 12px; font-weight: 600; color: white; margin-bottom: 24px; }
.esn-ios-article-title { font-size: 42px; font-weight: 800; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 20px; color: white; }
.esn-ios-article-meta { display: flex; gap: 24px; padding: 18px 0; border-top: 1px solid rgba(255,255,255,0.1); border-bottom: 1px solid rgba(255,255,255,0.1); flex-wrap: wrap; }
.esn-ios-meta-item { display: flex; align-items: center; gap: 8px; color: rgba(255,255,255,0.7); font-size: 14px; font-weight: 500; }
.esn-ios-article-img { margin: 20px 40px; border-radius: 20px; overflow: hidden; box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15); }
.esn-ios-article-img img { width: 100%; height: auto; display: block; }

.esn-ios-article-content { padding: 0 40px 40px; color: rgba(255,255,255,0.85); font-size: 18px; line-height: 1.7; }
.esn-ios-article-content p { margin-bottom: 1.5em; }
.esn-ios-article-content h2, .esn-ios-article-content h3 { color: white; margin-top: 1.5em; font-weight: 700; }
.esn-ios-article-content img { max-width: 100%; height: auto; border-radius: 16px; margin: 20px 0; }
.esn-ios-article-content blockquote { border-left: 4px solid #00aeef; margin: 1.5em 0; padding: 1em 1.5em; background: rgba(255,255,255,0.05); border-radius: 16px; font-style: italic; }

.esn-ios-article-footer { padding: 30px 40px; background: rgba(0,0,0,0.3); border-top: 1px solid rgba(255,255,255,0.08); }
.esn-ios-etiquetas strong { color: white; font-size: 13px; font-weight: 600; }
.esn-ios-tag-list { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px; margin-bottom: 25px; }
.esn-ios-tag { background: rgba(255,255,255,0.08); padding: 6px 16px; border-radius: 30px; text-decoration: none; color: #00aeef; font-size: 12px; font-weight: 500; transition: all 0.2s; }
.esn-ios-tag:hover { background: #00aeef; color: white; }

.esn-ios-share { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.esn-ios-share strong { color: white; font-size: 13px; }
.esn-ios-share-buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.esn-ios-share-btn { padding: 8px 20px; border-radius: 30px; text-decoration: none; color: white; font-size: 13px; font-weight: 600; transition: all 0.2s; display: inline-flex; align-items: center; gap: 6px; }
.esn-ios-share-btn:hover { transform: translateY(-2px); }
.share-twitter { background: #1DA1F2; } .share-facebook { background: #4267B2; } .share-whatsapp { background: #25D366; } .share-telegram { background: #0088cc; }

.esn-ios-nav { display: flex; justify-content: space-between; padding: 30px 40px; border-top: 1px solid rgba(255,255,255,0.08); flex-wrap: wrap; gap: 15px; }
.esn-ios-nav a { text-decoration: none; font-weight: 600; transition: all 0.2s; }
.esn-nav-prev a, .esn-nav-next a { color: #00aeef; display: inline-flex; align-items: center; gap: 6px; }
.esn-nav-prev a:hover { transform: translateX(-4px); } .esn-nav-next a:hover { transform: translateX(4px); }
.esn-nav-all a { background: rgba(255,255,255,0.08); padding: 8px 24px; border-radius: 30px; color: white; }
.esn-nav-all a:hover { background: #00aeef; }


/* ============================================================
   3. ARCHIVO GLOBAL: PÁGINA DE BÚSQUEDA Y FILTROS
============================================================ */
.esn-ios-archivo-header { text-align: center; margin-bottom: 40px; }
.esn-ios-glow { font-size: 44px; font-weight: 800; letter-spacing: -1px; background: linear-gradient(135deg, #ffffff, #00aeef); -webkit-background-clip: text; -webkit-text-fill-color: transparent; background-clip: text; margin-bottom: 10px; }
.esn-ios-sub { color: rgba(255,255,255,0.7); font-size: 16px; font-weight: 500; }

.esn-ios-filtros { background: rgba(20, 20, 25, 0.85); border-radius: 20px; padding: 24px; margin-bottom: 40px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.esn-ios-filtros-grid { display: flex; flex-wrap: wrap; gap: 16px; align-items: flex-end; }
.esn-ios-filtro { flex: 1; min-width: 180px; }
.esn-ios-filtro label { display: block; font-size: 12px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; color: rgba(255,255,255,0.6); margin-bottom: 6px; }
.esn-ios-filtro input, .esn-ios-filtro select { width: 100%; padding: 12px 16px; background: rgba(30, 30, 35, 0.9); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color: white; font-size: 14px; font-weight: 500; }
.esn-ios-filtro input:focus, .esn-ios-filtro select:focus { outline: none; border-color: #00aeef; }

.esn-ios-btn { padding: 12px 24px; border-radius: 12px; font-weight: 600; font-size: 14px; cursor: pointer; border: none; transition: all 0.2s; }
.esn-ios-btn-primary { background: #00aeef; color: white; }
.esn-ios-btn-primary:hover { background: #0099d1; transform: translateY(-1px); }
.esn-ios-btn-secondary { background: rgba(50, 50, 55, 0.9); color: white; border: 1px solid rgba(255,255,255,0.1); }

.esn-ios-resultados { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 24px; }
.esn-ios-item { background: rgba(20, 20, 25, 0.85); border-radius: 20px; overflow: hidden; transition: all 0.3s ease; position: relative; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1); }
.esn-ios-item::before { content: ''; position: absolute; left: 0; top: 0; height: 100%; width: 3px; background: var(--color); }
.esn-ios-item:hover { transform: translateY(-5px); background: rgba(20, 20, 25, 0.95); box-shadow: 0 12px 24px rgba(0, 0, 0, 0.2); }
.esn-ios-item-img { position: relative; height: 190px; overflow: hidden; }
.esn-ios-item-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.esn-ios-item:hover .esn-ios-item-img img { transform: scale(1.05); }

.esn-ios-item-content { padding: 16px 18px; }
.esn-ios-item-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.esn-ios-item-cat { color: var(--color); font-size: 11px; font-weight: 600; text-transform: uppercase; letter-spacing: 0.5px; }
.esn-ios-item-date { font-size: 11px; color: rgba(255,255,255,0.5); }
.esn-ios-item-title { font-size: 18px; font-weight: 700; margin: 0 0 12px; line-height: 1.35; }
.esn-ios-item-title a { color: white; text-decoration: none; }
.esn-ios-item-title a:hover { color: var(--color); }
.esn-ios-item-excerpt { font-size: 13px; line-height: 1.5; color: rgba(255,255,255,0.7); margin-bottom: 14px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.esn-ios-item-footer { display: flex; justify-content: space-between; align-items: center; font-size: 11px; color: rgba(255,255,255,0.5); padding-top: 10px; border-top: 1px solid rgba(255,255,255,0.1); }
.esn-ios-item-link { color: var(--color); text-decoration: none; font-size: 12px; font-weight: 600; }
.esn-ios-item-link:hover { text-decoration: underline; }

.esn-ios-paginacion { text-align: center; margin-top: 30px; }
.esn-ios-paginacion ul { list-style: none; padding: 0; display: flex; justify-content: center; gap: 8px; flex-wrap: wrap; }
.esn-ios-paginacion li a, .esn-ios-paginacion li span { display: inline-flex; align-items: center; justify-content: center; min-width: 42px; padding: 8px 16px; background: rgba(20, 20, 25, 0.85); border: 1px solid rgba(255,255,255,0.1); border-radius: 12px; color: white; text-decoration: none; font-weight: 500; transition: all 0.2s; }
.esn-ios-paginacion li a:hover, .esn-ios-paginacion li .current { background: #00aeef; border-color: #00aeef; }


/* ============================================================
   4. RESPONSIVE Y MOBILE RULES
============================================================ */
@media (max-width: 900px) {
    /* Bento Grid Tablet */
    .esn-app-bento { grid-template-columns: 1fr; grid-template-rows: auto; }
    .main-card { grid-row: span 1; height: 400px; }
    .sub-card { grid-row: span 1; height: 200px; }
}

@media (max-width: 768px) {
    /* Home App Mobile: Swipe Horizontal Nativo */
    .esn-app-bento {
        display: flex;
        flex-direction: row;
        overflow-x: auto;
        overflow-y: hidden;
        scroll-snap-type: x mandatory;
        scroll-behavior: smooth;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; 
        margin-left: -20px; 
        margin-right: -20px;
        padding: 0 20px 20px 20px; 
        gap: 12px;
    }
    .esn-app-bento::-webkit-scrollbar { display: none; }
    .esn-app-card { flex: 0 0 85%; height: 380px; scroll-snap-align: center; border-radius: 24px; }
    
    .esn-app-meta span:nth-child(2) { display: none; }
    .main-card .esn-app-title { font-size: 26px; }
    .esn-app-grid { grid-template-columns: 1fr; }

    /* Archive & Single Mobile */
    .esn-ios-filtros-grid { flex-direction: column; }
    .esn-ios-resultados { grid-template-columns: 1fr; }
    .esn-ios-glow { font-size: 32px; }
    .esn-ios-article-title { font-size: 32px; }
    .esn-ios-article-header, .esn-ios-article-content, .esn-ios-article-footer, .esn-ios-nav { padding-left: 20px; padding-right: 20px; }
    .esn-ios-article-img { margin-left: 20px; margin-right: 20px; }
    .esn-ios-nav { flex-direction: column; text-align: center; }
}

@media (max-width: 600px) {
    .esn-app-section-header h3 { font-size: 20px; }
    .esn-app-list-item { flex-direction: column; text-align: center; }
    .esn-app-list-img { width: 100%; height: 140px; }
}