/**
* Theme Name: Devil Survivor 2 (Restoration Final)
* Version: 11.9 - Modern Pagination, Tags Restored & Download Buttons
* GitHub: SamaelCr/AltyGamesTheme
*/

:root { 
    --brand-color: #0860ca; 
    --hover-color: #0860ca; 
    --title-color: #357ebd; 
}

/* --- 1. ESTILOS BASE & RESET --- */
* { box-sizing: border-box; }
body { 
    margin: 0; padding: 0; 
    font-family: 'Segoe UI', Tahoma, sans-serif; 
    color: #fff !important; 
    transition: background 0.3s; 
    overflow-x: hidden; 
    width: 100%;
}

/* MODO CLARO GENERAL */
html.light-theme body, .light-theme body, body.light-theme { background: #fdfdfd !important; color: #111 !important; }
.light-theme #casing { background: #fff !important; border-color: #eee !important; }
.light-theme .post-card h2 a { color: #111 !important; }
.light-theme .section-title { border-color: #eee !important; }

#wrapper { width: 100%; margin: 0; position: relative; overflow-x: hidden; }

/* --- 2. HEADER & TITULO --- */
#header { 
    border-bottom: 1px solid var(--brand-color); 
    position: relative; width: 100%; height: 350px; 
    background-color: #000; background-repeat: no-repeat; 
    background-position: center; background-size: cover; 
    overflow: hidden; 
}
.header-inner { max-width: 1120px; margin: auto; position: relative; height: 100%; }

h1#blog-title { 
    position: absolute; top: 35px; left: 20px; 
    font-size: 38pt; color: #fff !important; 
    text-shadow: 4px 4px 0px rgba(0,0,0,0.8); 
    text-transform: uppercase; margin: 0; z-index: 10; line-height: 45px; 
}
h1#blog-title a { color: #fff !important; text-decoration: none !important; border: 0 !important; }

/* --- 3. REDES SOCIALES --- */
.jorib { 
    position: absolute; top: 15px; right: 20px; z-index: 99; 
    display: flex; list-style: none; padding: 0; margin: 0; gap: 10px; 
}
.jorib li a { 
    display: flex; width: 45px; height: 45px; 
    background-color: var(--brand-color) !important; 
    color: #ffffff !important; 
    align-items: center; justify-content: center; 
    text-decoration: none !important; border: 3px solid #ffffff !important; 
    box-shadow: 4px 4px 0px #000; font-size: 22px; transition: 0.1s; 
}
.jorib li a:hover { 
    background-color: #ffffff !important; 
    color: var(--brand-color) !important;
    border-color: var(--brand-color) !important;
    transform: translate(2px, 2px); 
    box-shadow: 2px 2px 0px #000;
}
.jorib li a i { color: inherit !important; }

/* --- 4. MENU DE NAVEGACION --- */
.menujohanes { position: relative; width: 1120px; margin: auto; z-index: 1000; height: 40px; }
ul.dark_menu { 
    margin: 0; padding: 0; padding-left: 30px; list-style: none !important; 
    display: flex; margin-top: -45px; float: left; gap: 4px; 
    opacity: 0; transition: opacity 0.3s ease;
}
ul.dark_menu.menu-ready { opacity: 1; }
ul.dark_menu li { position: relative; min-width: 140px; transition: 0.3s; list-style: none !important; }
ul.dark_menu li:before, ul.dark_menu li ul li:before { 
    content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(0,0,0,0.85); transform: skewX(-20deg); transition: 0.3s; z-index: 1; 
}
ul.dark_menu li:hover:before { background: var(--hover-color) !important; }
ul.dark_menu li a { 
    color: #fff !important; display: block; padding: 12px 18px; 
    text-align: center; position: relative; z-index: 5; 
    text-transform: uppercase; font-size: 12px; font-weight: bold; 
    text-decoration: none !important; border: 0 !important; 
}

/* INDICADOR DE SUBMENU (Desktop) */
ul.dark_menu li.has-children > a { padding-right: 28px; }
ul.dark_menu li.has-children > a::after { 
    content: "\f078"; font-family: "Font Awesome 6 Free"; font-weight: 900; 
    font-size: 9px; position: absolute; right: 12px; top: 52%; transform: translateY(-50%); 
    opacity: 0.7; transition: 0.3s;
}
ul.dark_menu li.has-children:hover > a::after { opacity: 1; transform: translateY(-50%) scale(1.1); }

/* SUBMENU BRIDGE */
ul.dark_menu li ul { 
    display: none; position: absolute; left: -45px; 
    top: 40px; padding-top: 10px; 
    width: auto; list-style: none !important; z-index: 9999; 
    flex-direction: column; gap: 6px; 
}
ul.dark_menu li:hover > ul { display: flex; }
ul.dark_menu li ul li { display: block; width: 100%; }

/* --- 5. LUPA, TEMA Y BOTONES --- */
.nav-tools { float: right; margin-top: -45px; display: flex; margin-right: 20px; gap: 5px; border: 0 !important; }
.tool-btn { 
    position: relative; width: 50px; height: 40px; cursor: pointer; 
    display: flex; align-items: center; justify-content: center; 
    z-index: 20; background: none !important; 
    overflow: hidden; border: 0 !important; text-decoration: none !important;
}
.tool-btn i, .tool-btn svg { 
    color: #ffffff !important; fill: #ffffff !important; 
    opacity: 1 !important; font-size: 18px !important; 
    position: relative; z-index: 5; visibility: visible !important;
}
.tool-btn:before { 
    content: ""; position: absolute; top: 0; left: 0; right: 0; bottom: 0; 
    background: rgba(0,0,0,0.9); transform: skewX(-20deg); transition: 0.3s; z-index: 1; 
}
.tool-btn:hover:before { background: var(--brand-color); }
#menu-toggle { display: none; }

/* --- 6. CUERPO Y GRIDS --- */
#casing { 
    border: 1px solid var(--brand-color); margin: 10px auto; 
    max-width: 1120px; width: 95%; background: rgba(113,113,113,0.05); 
    padding: 20px 0; min-height: 600px; display: flex; box-sizing: border-box; 
}
#content-wrapper { flex: 1; padding: 0 20px; box-sizing: border-box; display: flex; flex-direction: column; overflow: hidden; }
.section-title { 
    font-size: 18px; text-transform: uppercase; margin: 10px 0 20px 0; 
    color: var(--title-color); font-weight: bold; 
    border-bottom: 2px solid rgba(255,255,255,0.1); padding-bottom: 10px; width: 100%; 
}

#featured-ajax-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 25px; margin-bottom: 40px; width: 100%; }
.latest-grid-container { 
    display: grid !important; 
    grid-template-columns: repeat(3, 1fr) !important; 
    gap: 35px 25px !important; 
    width: 100% !important;
}

/* TARJETA: Animación de levantamiento */
.post-card { 
    display: flex; 
    flex-direction: column; 
    height: 400px !important; 
    background: rgba(255,255,255,0.02);
    padding: 10px;
    border-radius: 8px;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    border: 1px solid transparent;
}
.post-card:hover { 
    transform: translateY(-5px); 
    background: rgba(255,255,255,0.05);
    border-color: rgba(255,255,255,0.1);
    box-shadow: 0 10px 20px rgba(0,0,0,0.3);
}

.post-thumb-wrap { 
    width: 100%; 
    height: 160px; 
    flex-shrink: 0; 
    overflow: hidden; 
    border-radius: 4px; 
    margin-bottom: 12px; 
    background: #222; 
    border-bottom: 3px solid transparent; 
    transition: 0.3s;
}
.post-card:hover .post-thumb-wrap { border-color: var(--brand-color); }
.post-thumb { width: 100%; height: 100%; object-fit: cover; transition: 0.5s; }
.post-card:hover .post-thumb { transform: scale(1.1); }

.post-card h2 { 
    margin: 0 0 5px 0; 
    font-size: 15px; 
    line-height: 1.3; 
    font-weight: bold; 
    height: 40px; 
    flex-shrink: 0;
    overflow: hidden; 
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}
.post-card h2 a { color: inherit; text-decoration: none !important; border: 0 !important; }

/* --- 7. FICHA, REQUISITOS Y DESCRIPCIÓN --- */
.post-body-container { width: 100%; color: #fff !important; }
.light-theme .post-body-container { color: #111 !important; }

/* FIX: Sincronización de texto con tema claro/oscuro */
.post-body-container p, .post-body-container span:not(.post-sub-title), .post-body-container div:not(.steam-buy-box):not(.steam-btn) { color: inherit !important; }

.post-main-img { width: 100%; height: auto; border-radius: 4px; border-bottom: 4px solid var(--brand-color); margin-bottom: 20px; box-shadow: 5px 5px 0px rgba(0,0,0,0.5); }
.post-sub-title { background: var(--brand-color) !important; color: #ffffff !important; padding: 12px 15px !important; text-transform: uppercase !important; font-weight: bold !important; font-size: 18px !important; margin: 25px 0 15px 0 !important; border-left: 5px solid #fff !important; display: block !important; }
.light-theme .post-sub-title { color: #ffffff !important; }

.info-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 10px !important; background: rgba(255,255,255,0.05) !important; padding: 15px !important; border: 1px solid #333 !important; margin: 15px 0 !important; border-radius: 4px !important; }
.info-item { color: inherit !important; }
.info-item b { color: var(--brand-color) !important; text-transform: uppercase !important; font-size: 12px !important; }

.req-container { background: #0a0a0a !important; border: 1px dashed #444 !important; padding: 20px !important; margin: 25px 0 !important; border-radius: 5px !important; }
.req-title { color: #ffca28 !important; font-weight: bold !important; margin-bottom: 15px !important; display: block !important; text-transform: uppercase !important; font-size: 16px !important; }
.req-grid { display: grid !important; grid-template-columns: 1fr 1fr !important; gap: 20px !important; }
.req-grid div { color: inherit !important; font-size: 13px !important; line-height: 1.6 !important; }
.req-grid b { color: #0860ca !important; display: block; margin-bottom: 5px; text-transform: uppercase; }

/* --- 8. STEAM, TRAILER E INSTRUCCIONES --- */
.steam-buy-box { background: #171a21 !important; border: 1px solid #2a475e !important; display: flex !important; align-items: center !important; justify-content: space-between !important; padding: 15px 25px !important; margin: 20px 0 !important; border-radius: 4px !important; }
.steam-text { color: #acb2b8 !important; font-size: 13px !important; font-weight: bold !important; text-transform: uppercase !important; }
.steam-btn { background: linear-gradient(to right, #47bfff 5%, #1a44c2 95%) !important; color: #fff !important; padding: 10px 20px !important; text-decoration: none !important; font-weight: bold !important; border-radius: 3px !important; display: flex !important; align-items: center !important; gap: 8px !important; transition: 0.3s !important; font-size: 13px !important; border: 0 !important; }
.steam-btn:hover { transform: scale(1.03) !important; box-shadow: 0 0 15px rgba(71, 191, 255, 0.6) !important; }

.video-container { position: relative; padding-bottom: 56.25%; height: 0; overflow: hidden; max-width: 100%; background: #000; margin: 0 0 20px 0; border-radius: 4px; border: 1px solid var(--brand-color); box-shadow: 5px 5px 0px rgba(0,0,0,0.5); }
.video-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; }

.inst-container { background: rgba(255, 255, 255, 0.03) !important; border: 1px solid var(--brand-color) !important; padding: 20px !important; margin: 15px 0 !important; border-radius: 4px !important; color: inherit !important; }
.inst-title { color: var(--brand-color) !important; font-weight: bold !important; text-transform: uppercase !important; margin-bottom: 15px !important; display: flex !important; align-items: center !important; gap: 10px !important; font-size: 16px !important; }
.inst-list { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.inst-list li { padding: 8px 0 8px 30px !important; position: relative !important; border-bottom: 1px solid rgba(255,255,255,0.05) !important; font-size: 14px !important; color: inherit !important; }
.inst-list li:before { content: "\f058"; font-family: "Font Awesome 6 Free"; font-weight: 900; position: absolute; left: 0; color: var(--brand-color); }
.inst-list li:last-child { border: 0 !important; }

/* --- 9. BOTONES DE DESCARGA --- */
.dl-wrapper { text-align: center !important; margin: 30px 0 !important; display: flex !important; flex-direction: column !important; gap: 12px !important; align-items: center !important; }
.btn-dl { display: flex !important; align-items: center !important; justify-content: center !important; gap: 10px !important; background: #28a745 !important; color: #fff !important; padding: 16px 30px !important; text-decoration: none !important; font-weight: bold !important; text-transform: uppercase !important; border-radius: 4px !important; width: 80% !important; max-width: 420px !important; box-shadow: 0px 4px 0px #1e7e34 !important; transition: 0.2s; }
.btn-dl:hover { transform: translateY(2px); box-shadow: 0px 2px 0px #1e7e34 !important; }
.btn-dl.torrent { background: #007bff !important; box-shadow: 0px 4px 0px #0056b3 !important; }
.btn-dl.torrent:hover { box-shadow: 0px 2px 0px #0056b3 !important; }

/* --- 10. BUSCADOR SIDEBAR & PUBLICIDAD --- */
.sidebar { width: 340px; padding-right: 20px; box-sizing: border-box; }
.sidebar-search { margin-bottom: 20px; width: 100%; transition: 0.3s; }
.sidebar-search form { display: flex; background: #000000 !important; border: 2px solid #333 !important; padding: 2px; position: relative; width: 100%; }
.sidebar-search input { border: 0; background: transparent !important; color: #ffffff !important; width: 100%; padding: 10px 15px; outline: none; font-size: 13px; }
.sidebar-search button { background: #222 !important; border: 0; color: #fff !important; padding: 0 15px; cursor: pointer; }
.sidebar-box { width: 100%; height: 250px; background: #111111 !important; border: 2px solid #333333 !important; display: flex; align-items: center; justify-content: center; color: #555555 !important; font-weight: bold; border-radius: 4px; transition: 0.3s; }

/* --- 11. MENÚ LATERAL (SIDE DRAWER) --- */
#side-drawer { position: fixed; top: 0; left: -300px; width: 280px; height: 100%; background: #000; border-right: 2px solid var(--brand-color); z-index: 10001; transition: 0.4s; padding: 20px; box-sizing: border-box; overflow-y: auto; }
body.drawer-open #side-drawer { left: 0; }
#drawer-overlay { position: fixed; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0,0,0,0.8); z-index: 10000; display: none; }
body.drawer-open #drawer-overlay { display: block; }
.drawer-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 30px; border-bottom: 1px solid #333; padding-bottom: 10px; color: var(--brand-color); font-weight: bold; }
#side-drawer ul.dark_menu { display: flex !important; flex-direction: column !important; margin: 0 !important; padding: 0 !important; opacity: 1 !important; float: none !important; }
#side-drawer ul.dark_menu li { margin-bottom: 5px; width: 100%; min-width: 0 !important; position: relative; list-style: none !important;}
#side-drawer ul.dark_menu li a { text-align: left; padding: 15px; font-size: 14px; border-bottom: 1px solid rgba(255,255,255,0.05); text-decoration: none !important; color: #fff !important; display: block; position: relative; }

/* INDICADOR DE SUBMENU (Side Drawer) */
#side-drawer ul.dark_menu li.has-children > a::after { 
    content: "\f054"; font-family: "Font Awesome 6 Free"; font-weight: 900; 
    font-size: 12px; position: absolute; right: 20px; top: 50%; transform: translateY(-50%); 
    transition: 0.3s; color: var(--brand-color);
}
#side-drawer ul.dark_menu li.has-children.active > a::after { transform: translateY(-50%) rotate(90deg); }

/* --- 12. ETIQUETAS Y PAGINACIÓN --- */
/* ETIQUETAS: Con máscara de desvanecimiento premium */
.post-labels { 
    display: flex; 
    flex-wrap: wrap; 
    gap: 6px; 
    height: 145px; 
    overflow-y: auto; 
    scrollbar-width: none; 
    align-content: start;
    -webkit-mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 80%, transparent 100%);
}
.post-labels::-webkit-scrollbar { display: none; }

.post-tag { 
    font-size: 10px; 
    text-transform: uppercase; 
    background: rgba(255,255,255,0.08); 
    padding: 4px 10px; 
    border-radius: 4px; 
    color: #aaa !important; 
    font-weight: bold; 
    transition: all 0.2s ease; 
    text-decoration: none !important;
}
.post-tag:hover { background: var(--brand-color); color: #fff !important; }

#blog-pager { clear: both; width: 100%; display: flex; justify-content: center; align-items: center; gap: 8px; margin: 40px auto 20px auto; padding: 20px 0; border-top: 1px solid rgba(255,255,255,0.1); }
.showpageNum, .showpagePoint { display: inline-flex; align-items: center; justify-content: center; width: 40px; height: 40px; border-radius: 6px; color: #fff !important; font-weight: bold; font-size: 15px; text-decoration: none !important; transition: all 0.2s ease; background: rgba(255, 255, 255, 0.05); border: 1px solid rgba(255, 255, 255, 0.1); }
.showpageNum:hover { background: var(--brand-color); border-color: var(--brand-color); transform: translateY(-3px); box-shadow: 0 4px 10px rgba(0,0,0,0.5); }
.showpagePoint { background: var(--brand-color); border-color: var(--brand-color); cursor: default; box-shadow: 0 4px 10px rgba(0,0,0,0.5); }

/* --- 13. DISQUS CONTAINER --- */
#comments { margin: 40px 0; padding: 20px; border: 1px solid var(--brand-color); background: #0b0b0b !important; border-radius: 4px; }
#comments h4 { font-size: 18px; text-transform: uppercase; color: var(--brand-color); margin-bottom: 20px; border-bottom: 1px solid rgba(255,255,255,0.1); padding-bottom: 10px; }

/* --- 14. MODO CLARO OVERRIDES --- */
.light-theme .info-grid { background: rgba(0,0,0,0.05) !important; border-color: #ddd !important; }
.light-theme .req-container { background: #f4f4f4 !important; border: 1px solid #ddd !important; }
.light-theme .steam-buy-box { background: #f0f2f5 !important; border-color: #dcdcdc !important; }
.light-theme .steam-text { color: #444 !important; }
.light-theme .inst-container { background: #f9f9f9 !important; border-color: #ddd !important; }
.light-theme .inst-list li { border-bottom-color: #eee !important; }
.light-theme #comments { background: #ffffff !important; border-color: #ddd !important; color: #111 !important; }
.light-theme .sidebar-search form { background: #ffffff !important; border: 2px solid #dddddd !important; }
.light-theme .sidebar-search input { color: #111111 !important; }
.light-theme .sidebar-search button { background: #f0f0f0 !important; color: #333333 !important; }
.light-theme .sidebar-box { background: #ffffff !important; border: 2px solid #dddddd !important; color: #888888 !important; }

html.light-theme .showpageNum, .light-theme .showpageNum { background: #e0e0e0 !important; color: #111 !important; border: 1px solid #ccc !important; }
html.light-theme .showpageNum:hover, .light-theme .showpageNum:hover { background: var(--brand-color) !important; color: #fff !important; border-color: var(--brand-color) !important; }
html.light-theme .showpagePoint, .light-theme .showpagePoint { background: var(--brand-color) !important; color: #fff !important; border-color: var(--brand-color) !important; }

.light-theme .post-tag { background: #f0f0f0 !important; color: #555 !important; border: 1px solid #ddd !important; }
.light-theme .post-tag:hover { background: var(--brand-color) !important; color: #fff !important; }

/* --- 15. MEDIA QUERIES --- */
@media screen and (max-width: 768px) {
    #header { height: 200px; }
    h1#blog-title { font-size: 20pt; top: 50px; width: 100%; text-align: center; left: 0; }
    .jorib { top: 10px; right: 10px; transform: scale(0.7); }
    .menujohanes { width: 100%; height: 50px; }
    ul.dark_menu { display: none; } 
    .nav-tools { margin-top: 0; float: none; width: 100%; height: 50px; display: flex; justify-content: center; padding: 0 15px; box-sizing: border-box; position: relative; }
    #menu-toggle { display: flex !important; position: absolute; left: 15px; top: 0; }
    #casing { flex-direction: column; width: 100%; padding: 10px 0; }
    .sidebar { width: 100%; border-top: 1px solid var(--brand-color); margin-top: 20px; padding: 20px 15px; }
    #featured-ajax-grid, .latest-grid-container, .info-grid, .req-grid { grid-template-columns: 1fr !important; }
    .steam-buy-box { flex-direction: column; gap: 10px; text-align: center; }
    .post-card { height: auto !important; }
    .post-labels { height: auto !important; -webkit-mask-image: none; mask-image: none; }
}

.fleft { text-align: center; padding: 15px; border: 1px solid var(--brand-color); background: rgba(0,0,0,0.8); color: #999; max-width: 1120px; width: 95%; margin: 10px auto; }

/* --- 16. PAGE SPECIFIC OVERRIDES --- */
body.is-search-page #comments,
body.is-search-page .sidebar-search,
body.is-category-page #comments,
body.is-category-page .sidebar-search { 
    display: none !important; 
}