/* ===================================
   InternetizaME - Estilos comunes (blog + proyectos)
   =================================== */

:root {
    --primary: #0066FF;
    --primary-dark: #0052CC;
    --secondary: #00D9FF;
    --accent: #FF3366;
    --dark: #0A0E27;
    --dark-secondary: #1A1F3A;
    --light: #F8FAFC;
    --gray: #64748B;
    --gray-light: #E2E8F0;
    --gradient-1: linear-gradient(135deg, var(--primary) 0%, var(--secondary) 100%);
    --gradient-2: linear-gradient(135deg, #667EEA 0%, #764BA2 100%);
    --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
    --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.12);
    --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.16);
    --shadow-xl: 0 16px 64px rgba(0, 0, 0, 0.2);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Outfit', sans-serif;
    color: var(--dark);
    line-height: 1.7;
    background: var(--light);
    overflow-x: hidden;
}

/* ===================================
   Navbar & Logo
   =================================== */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    box-shadow: var(--shadow-sm);
    z-index: 1000;
    transition: all 0.3s ease;
}

.nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 1rem 2rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    font-size: 1.75rem;
    font-weight: 800;
    letter-spacing: -0.5px;
    text-decoration: none;
}

.logo span {
    background: var(--gradient-1);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.logo-icono {
    height: 38px;
    width: auto;
    display: block;
    object-fit: contain;
}

.nav-menu {
    display: flex;
    gap: 2.5rem;
    list-style: none;
    align-items: center;
}

.nav-menu a {
    color: var(--dark);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    transition: all 0.3s ease;
    position: relative;
}

.nav-menu a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--gradient-1);
    transition: width 0.3s ease;
}

.nav-menu a:hover::after,
.nav-menu a.activo::after {
    width: 100%;
}

.nav-menu a.activo {
    color: var(--primary);
}

/* Botón Hamburguesa */
.nav-toggle {
    background: transparent !important;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
    cursor: pointer;
    display: none;
    flex-direction: column;
    justify-content: space-between;
    width: 28px;
    height: 20px;
    z-index: 1001;
}

.nav-toggle span {
    width: 100%;
    height: 3px;
    background-color: var(--dark);
    border-radius: 3px;
    transition: all 0.3s ease;
}

.nav-toggle.active span:nth-child(1) {
    transform: translateY(8.5px) rotate(45deg);
}
.nav-toggle.active span:nth-child(2) {
    opacity: 0;
}
.nav-toggle.active span:nth-child(3) {
    transform: translateY(-8.5px) rotate(-45deg);
}

/* ===================================
   Hero
   =================================== */

.blog-hero {
    margin-top: 80px;
    padding: 5rem 2rem 4rem;
    background: var(--gradient-2);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.blog-hero-content {
    position: relative;
    z-index: 1;
}

.section-tag {
    display: inline-block;
    padding: 0.5rem 1.5rem;
    background: rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 1rem;
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.blog-hero h1 {
    font-size: 3rem;
    font-weight: 800;
    color: white;
    margin-bottom: 1rem;
}

.blog-hero p {
    font-size: 1.2rem;
    color: rgba(255, 255, 255, 0.85);
    max-width: 600px;
    margin: 0 auto;
}

/* ===================================
   Listado de artículos
   =================================== */

.listado {
    max-width: 1200px;
    margin: 0 auto;
    padding: 4rem 2rem 6rem;
}

.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(340px, 1fr));
    gap: 2.5rem;
}

.entrada-card {
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    transition: all 0.4s ease;
    border: 1px solid var(--gray-light);
    display: flex;
    flex-direction: column;
}

.entrada-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-xl);
    border-color: transparent;
}

/* Imagen: se ve siempre completa (contain), con margen mínimo de 14px */
.entrada-imagen {
    width: 100%;
    height: 200px;
    background: var(--gradient-1);
    padding: 14px;
    box-sizing: border-box;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.entrada-imagen img {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    display: block;
    margin: auto;
    border-radius: 12px;
}

.entrada-cuerpo {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.entrada-card h2 {
    font-size: 1.35rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
}

.entrada-card h2 a {
    color: var(--dark);
    text-decoration: none;
    transition: color 0.3s ease;
}

.entrada-card h2 a:hover {
    color: var(--primary);
}

.resumen {
    color: var(--gray);
    font-size: 0.95rem;
    flex: 1;
    margin-bottom: 1.5rem;
}

/* Fila inferior de la tarjeta: Leer más a la izquierda, fecha a la derecha */
.entrada-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.leer-mas {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    font-size: 0.95rem;
    transition: gap 0.3s ease;
}

.leer-mas:hover {
    gap: 0.85rem;
}

.fecha-inline {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    color: var(--gray);
    font-size: 0.85rem;
    font-weight: 600;
    white-space: nowrap;
}

.fecha-inline svg.icono {
    color: var(--primary);
}

/* Compatibilidad con iconos Font Awesome (usados en blog/post.php) */
.entrada-imagen i {
    font-size: 3.5rem;
    color: white;
}

.fecha-inline i {
    font-size: 0.8rem;
    color: var(--primary);
}

.vacio {
    text-align: center;
    color: var(--gray);
    padding: 4rem;
    font-size: 1.2rem;
    grid-column: 1 / -1;
}

/* ===================================
   Footer
   =================================== */

footer {
    background: var(--dark);
    color: rgba(255, 255, 255, 0.5);
    text-align: center;
    padding: 2rem;
    font-size: 0.9rem;
}

footer a {
    color: rgba(255, 255, 255, 0.75);
    text-decoration: none;
}

footer a:hover {
    color: var(--secondary);
}

/* ===================================
   Responsive Menu Mobile
   =================================== */

@media (max-width: 968px) {
    .nav-toggle {
        display: flex !important;
    }

    .nav-menu {
        position: fixed;
        left: -100%;
        top: 70px;
        flex-direction: column;
        background-color: #ffffff;
        width: 100%;
        text-align: center;
        transition: 0.3s ease;
        box-shadow: 0 10px 27px rgba(0, 0, 0, 0.05);
        padding: 2rem 0;
        gap: 1.5rem;
    }

    .nav-menu.active {
        left: 0;
    }
}

/* ===================================
   Página de detalle (post-page)
   =================================== */

.post-page {
    max-width: 800px;
    margin: 0 auto;
    padding: calc(80px + 3rem) 2rem 5rem;
}

.volver-listado {
    margin-bottom: 2rem;
}

.volver-listado a,
.btn-volver {
    color: var(--primary);
    font-weight: 600;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: gap 0.3s ease;
}

.volver-listado a:hover,
.btn-volver:hover {
    gap: 0.85rem;
    color: var(--primary-dark);
}

.post-article {
    background: white;
    border-radius: 24px;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-light);
    overflow: hidden;
}

.post-article-body {
    padding: 3rem;
}

.post-meta {
    margin-bottom: 1.5rem;
}

.post-fecha-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--light);
    color: var(--gray);
    padding: 0.5rem 1rem;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
}

.post-titulo {
    font-size: 2.25rem;
    font-weight: 800;
    line-height: 1.25;
    color: var(--dark);
    margin-bottom: 1.5rem;
}

.post-divisor {
    border: none;
    border-top: 1px solid var(--gray-light);
    margin-bottom: 2rem;
}

.post-contenido {
    color: var(--dark);
    font-size: 1.05rem;
    line-height: 1.8;
}

.post-contenido p {
    margin-bottom: 1.5rem;
}

.post-contenido strong {
    font-weight: 700;
}

.post-contenido em {
    font-style: italic;
}

.post-contenido ul,
.post-contenido ol {
    margin: 0 0 1.5rem 1.5rem;
}

.post-contenido li {
    margin-bottom: 0.5rem;
}

.post-img {
    display: block;
    width: 100%;
    max-width: 100%;
    height: auto;
    border-radius: 16px;
    margin: 1rem 0 2rem;
    box-shadow: var(--shadow-sm);
}

.post-footer-nav {
    max-width: 800px;
    margin: 2.5rem auto 0;
    text-align: center;
}

@media (max-width: 640px) {
    .post-article-body {
        padding: 2rem 1.5rem;
    }

    .post-titulo {
        font-size: 1.75rem;
    }
}

/* ===================================
   Sección carrusel (siguientes 5 entradas)
   =================================== */

.carrusel-seccion {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem 5rem;
}

.carrusel-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 1.5rem;
}

.carrusel-cabecera h2 {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--dark);
}

.btn-ver-todos {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: var(--light);
    color: var(--primary);
    border: 1px solid var(--gray-light);
    padding: 0.65rem 1.25rem;
    border-radius: 50px;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: all 0.25s ease;
}

.btn-ver-todos:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

.carrusel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.carrusel-track {
    display: flex;
    gap: 1.5rem;
    overflow-x: auto;
    scroll-behavior: auto; /* el JS mueve scrollLeft a mano; el scroll "smooth" nativo choca con scroll-snap */
    padding: 0.5rem 0.25rem 1rem;
    cursor: grab;
    scrollbar-width: none; /* Firefox: oculta la barra de scroll nativa */
}
.carrusel-track::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Edge: oculta la barra de scroll nativa */
}

.carrusel-track.arrastrando {
    cursor: grabbing;
}

.carrusel-card {
    flex: 0 0 280px;
    background: white;
    border-radius: 24px;
    overflow: hidden;
    box-shadow: var(--shadow-md);
    border: 1px solid var(--gray-light);
    display: flex;
    flex-direction: column;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    user-select: none;
}

.carrusel-card:hover {
    transform: translateY(-6px);
    box-shadow: var(--shadow-xl);
}

.carrusel-card .entrada-cuerpo {
    padding: 1.5rem;
}

.carrusel-card h2 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
}

.carrusel-card .resumen {
    font-size: 0.88rem;
    -webkit-line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.carrusel-flecha {
    flex-shrink: 0;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: white;
    border: 1px solid var(--gray-light);
    box-shadow: var(--shadow-sm);
    color: var(--primary);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.25s ease;
    z-index: 2;
}

.carrusel-flecha:hover {
    background: var(--primary);
    color: white;
    border-color: var(--primary);
}

@media (max-width: 640px) {
    .carrusel-flecha {
        display: none;
    }
}

/* ===================================
   Modal "Mostrar todos los artículos"
   =================================== */

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(10, 14, 39, 0.6);
    backdrop-filter: blur(4px);
    z-index: 2000;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
}

.modal-overlay.activo {
    display: flex;
}

.modal-caja {
    background: white;
    border-radius: 20px;
    width: 100%;
    max-width: 640px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
}

.modal-cabecera {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 1.5rem 1.75rem;
    border-bottom: 1px solid var(--gray-light);
}

.modal-cabecera h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: var(--dark);
}

.modal-cerrar {
    background: var(--light);
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    color: var(--gray);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.modal-cerrar:hover {
    background: var(--accent);
    color: white;
}

.modal-lista {
    list-style: none;
    overflow-y: auto;
    padding: 0.5rem 0;
}

.modal-lista li a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.9rem 1.75rem;
    text-decoration: none;
    transition: background 0.2s ease;
}

.modal-lista li a:hover {
    background: var(--light);
}

.modal-lista-izq {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    min-width: 0;
}

.modal-lista-icono {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    object-fit: contain;
    flex-shrink: 0;
    display: block;
}

.modal-lista-titulo {
    color: var(--dark);
    font-weight: 600;
    font-size: 0.95rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.modal-lista-fecha {
    color: var(--gray);
    font-size: 0.85rem;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ===================================
   Iconos SVG inline (sustituyen a Font Awesome)
   =================================== */

svg.icono {
    width: 1em;
    height: 1em;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    vertical-align: -0.125em;
    display: inline-block;
}
