﻿/* ===== RESET & BASE ===== */
:root {
    --bg: #f4f4f4;
    --text: #333;
    --accent: #FFCD11;
    --dark: #1a1a1a;
    --white: #ffffff;
    --gray-light: #f9f9f9;
    --border: #ddd;
    --shadow: 0 2px 8px rgba(0,0,0,0.08);
    --radius: 8px;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

/* ===== FIX: Prevenir desbordamiento horizontal ===== */
html, body {
    max-width: 100%;
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Segoe UI', Arial, sans-serif;
    line-height: 1.7;
    background: var(--bg);
    color: var(--text);
    width: 100%;
    position: relative;
}

a {
    color: var(--dark);
    text-decoration: none;
}

a:hover {
    color: #000;
    text-decoration: underline;
}

/* CAMBIO 1: max-width ajustado a 1300px para dar un poco más de margen lateral */
.container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 20px;
    width: 100%;
}

/* ===== HEADER ===== */
/* CAMBIO 2: se ha quitado "overflow: hidden" de aquí.
   Con overflow hidden en el header, el menú desplegable móvil
   (nav ul, position:absolute) quedaba recortado y no se veía. */
header {
    background: var(--dark);
    color: #fff;
    padding: 18px 20px;
    border-bottom: 4px solid var(--accent);
    position: relative;
    width: 100%;
    max-width: 100%;
}

.header-flex {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    width: 100%;
    max-width: 100%;
}

.logo {
    font-size: 2rem;
    font-weight: 900;
    letter-spacing: -0.5px;
    font-family: 'Lucida Sans', 'Lucida Sans Regular', 'Lucida Grande', 'Lucida Sans Unicode', Geneva, Verdana, sans-serif;
    flex-shrink: 0;
}

.logo .tech {
    color: #ffffff;
}

.logo .scorgt {
    color: var(--accent);
}

nav ul {
    list-style: none;
    display: flex;
    gap: 18px;
    flex-wrap: wrap;
    max-width: 100vw;
}

nav a {
    color: #eee;
    font-size: 0.95rem;
    font-weight: 500;
    padding: 6px 0;
    border-bottom: 2px solid transparent;
    transition: 0.2s;
    white-space: nowrap;
}

nav a:hover,
nav a.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    text-decoration: none;
}

/* BOTÓN HAMBURGUESA (Oculto en Escritorio) */
.menu-toggle {
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 21px;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    flex-shrink: 0;
    margin-left: 10px;
}

.menu-toggle span {
    width: 100%;
    height: 3px;
    background-color: #ffffff;
    border-radius: 2px;
    transition: all 0.3s ease-in-out;
}

/* ===== MAIN GRID ===== */
.grid-main {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 30px;
    margin: 30px 0;
    width: 100%;
}

/* ===== CONTENIDO ===== */
.content {
    width: 100%;
}

.content h1 {
    font-size: 1.8rem;
    margin-bottom: 20px;
    line-height: 1.3;
    word-wrap: break-word;
}

.post-card {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    margin-bottom: 25px;
    box-shadow: var(--shadow);
    transition: 0.2s;
    width: 100%;
}

.post-card:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
}

.post-card img {
    width: 100%;
    height: auto;
    border-radius: 6px;
    margin-bottom: 12px;
    display: block;
    max-width: 100%;
}

.post-card h2 {
    font-size: 1.4rem;
    margin-bottom: 6px;
    word-wrap: break-word;
}

.post-card h2 a {
    color: var(--dark);
    word-wrap: break-word;
}

.post-card h2 a:hover {
    color: #000;
    text-decoration: underline;
}

.meta {
    font-size: 0.9rem;
    color: #777;
    margin-bottom: 12px;
    word-wrap: break-word;
}

.author {
    font-weight: 600;
    color: var(--dark);
}

.read-more {
    display: inline-block;
    margin-top: 10px;
    font-weight: 600;
    color: var(--dark);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 2px;
}

.read-more:hover {
    color: #000;
    text-decoration: none;
}

/* ===== ADSENSE ===== */
.adsense-placeholder {
    background: #eee;
    padding: 30px 20px;
    text-align: center;
    border: 2px dashed #ccc;
    border-radius: var(--radius);
    margin: 20px 0;
    color: #666;
    font-weight: 500;
    font-size: 0.95rem;
    max-width: 100%;
}

/* ===== PAGINACIÓN CORREGIDA ===== */
.pagination {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin: 30px 0 10px;
}

.pagination a,
.pagination .current {
    display: inline-block;
    padding: 8px 16px;
    background: var(--white);
    border-radius: 4px;
    border: 1px solid var(--border);
    font-weight: 500;
    color: var(--dark); /* <--- CORREGIDO: texto oscuro para que se vea */
}

.pagination .current {
    background: var(--dark);
    color: #fff;
    border-color: var(--dark);
}

.pagination a:hover {
    background: var(--accent);
    border-color: var(--accent);
    text-decoration: none;
    color: var(--dark); /* <--- CORREGIDO: texto oscuro al hacer hover */
}

/* ===== SIDEBAR ===== */
.sidebar {
    display: flex;
    flex-direction: column;
    gap: 25px;
    width: 100%;
}

.widget {
    background: var(--white);
    border-radius: var(--radius);
    padding: 20px;
    box-shadow: var(--shadow);
    width: 100%;
}

.widget h3 {
    font-size: 1.2rem;
    margin-bottom: 12px;
    border-bottom: 2px solid var(--accent);
    padding-bottom: 6px;
    word-wrap: break-word;
}

.widget form {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.widget input[type="search"],
.widget input[type="email"] {
    padding: 10px 14px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
}

.widget button {
    background: var(--dark);
    color: #f0e118;
    border: none;
    padding: 10px 16px;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: 0.2s;
    width: 100%;
}

.widget button:hover {
    background: #000;
}

.category-list,
.popular-list {
    list-style: none;
    padding: 0;
}

.category-list li,
.popular-list li {
    margin-bottom: 8px;
}

.category-list a,
.popular-list a {
    display: block;
    padding: 6px 0;
    border-bottom: 1px solid #f0f0f0;
    word-wrap: break-word;
}

.category-list a:hover,
.popular-list a:hover {
    color: #000;
    text-decoration: underline;
}

/* ===== FOOTER ===== */
footer {
    background: var(--dark);
    color: #ccc;
    padding: 30px 20px;
    margin-top: 30px;
    border-top: 4px solid var(--accent);
    width: 100%;
    max-width: 100%;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr;
    gap: 30px;
    width: 100%;
    max-width: 100%;
}

footer .tech {
    color: #fff;
}
footer .scorgt {
    color: var(--accent);
}
footer .logo {
    font-size: 1.6rem;
}

footer h4 {
    color: #fff;
    margin-bottom: 12px;
    font-size: 1.1rem;
    word-wrap: break-word;
}

footer ul {
    list-style: none;
    padding: 0;
}

footer ul li {
    margin-bottom: 6px;
}

footer a {
    color: #bbb;
    word-wrap: break-word;
}

footer a:hover {
    color: var(--accent);
    text-decoration: underline;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 992px) {
    .grid-main {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
    }
}

@media (max-width: 768px) {
    header {
        padding: 15px 15px;
    }

    .header-flex {
        align-items: center;
    }

    .menu-toggle {
        display: flex;
    }

    nav ul {
        display: none;
        flex-direction: column;
        width: 100%;
        position: absolute;
        top: 100%;
        left: 0;
        background: var(--dark);
        padding: 20px;
        gap: 15px;
        border-top: 2px solid var(--accent);
        box-shadow: 0 4px 10px rgba(0,0,0,0.3);
        z-index: 1000;
    }

    nav ul li {
        width: 100%;
    }

    nav a {
        display: block;
        width: 100%;
        padding: 10px 0;
        white-space: normal;
    }

    nav ul.active {
        display: flex;
    }

    .menu-toggle.open span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }
    .menu-toggle.open span:nth-child(2) {
        opacity: 0;
    }
    .menu-toggle.open span:nth-child(3) {
        transform: rotate(-45deg) translate(6px, -6px);
    }

    .container {
        padding: 0 15px;
    }

    .post-card {
        padding: 15px;
    }

    .post-card img {
        max-width: 100%;
        height: auto;
    }

    .sidebar {
        width: 100%;
    }

    .widget {
        padding: 15px;
    }

    footer {
        padding: 20px 15px;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .logo {
        font-size: 1.4rem;
    }

    .post-card h2 {
        font-size: 1.2rem;
    }

    .content h1 {
        font-size: 1.3rem;
    }

    .pagination a,
    .pagination .current {
        padding: 6px 12px;
        font-size: 0.85rem;
    }

    .adsense-placeholder {
        padding: 15px;
        font-size: 0.85rem;
    }
}

/* ===== FIX ADICIONAL: Evitar desbordamiento en elementos específicos ===== */
img, video, iframe, embed, object {
    max-width: 100%;
    height: auto;
}

table {
    max-width: 100%;
    overflow-x: auto;
    display: block;
}

code, pre {
    max-width: 100%;
    overflow-x: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Asegurar que ningún elemento se salga del contenedor */
.sidebar *,
.content *,
.footer-grid *,
.header-flex * {
    max-width: 100%;
    box-sizing: border-box;
}

nav ul {
    max-width: 100vw;
}