/**
 * CodeTech Blog Index - Modern Editorial Design
 * Diseño limpio y profesional para el listado de artículos
 * Versión: 2.0
 */

/* ============================================
   0. LOGO - Asegurar colores correctos
   ============================================ */
.logo {
    color: #f8fafc !important;
}

.logo .highlight {
    color: #a855f7 !important;
    /* Tech en morado/púrpura */
}

.logo .code-symbol {
    color: #00d2ff !important;
    /* Símbolos <> en cyan */
}

/* ============================================
   1. BLOG HERO - HEADER PRINCIPAL
   ============================================ */
.blog-hero {
    padding: 140px 0 80px;
    background: var(--bg-dark);
    text-align: center;
}

.blog-hero-content {
    max-width: 800px;
    margin: 0 auto;
}

/* Hero Badge Style */
.hero-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.6rem 1.2rem;
    background: linear-gradient(135deg, rgba(99, 102, 241, 0.2), rgba(168, 85, 247, 0.2));
    border: 1px solid rgba(99, 102, 241, 0.3);
    color: #a5b4fc;
    border-radius: 50px;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: 1.5rem;
    animation: badgePulse 3s ease-in-out infinite;
    /* font-family removed to match Moodle badge (uses default sans-serif/Outfit) */
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.hero-badge svg {
    stroke: #a5b4fc;
    width: 16px;
    height: 16px;
}

@keyframes badgePulse {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3);
    }

    50% {
        box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
    }
}

.blog-hero-overline {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.875rem;
    font-weight: 600;
    color: var(--accent-primary);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: 1.5rem;
    font-family: var(--font-code);
}

.blog-hero-overline svg {
    width: 20px;
    height: 20px;
}

.blog-hero-title {
    font-size: clamp(2.5rem, 6vw, 4rem);
    font-weight: 700;
    line-height: 1.1;
    margin-bottom: 1.5rem;
    color: var(--text-main);
}

.blog-hero-description {
    font-size: 1.25rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 2.5rem;
}

/* Búsqueda */
.blog-search-form {
    max-width: 600px;
    margin: 0 auto;
}

.search-input-wrapper {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: 12px;
    padding: 0.75rem 1.5rem;
    transition: all 0.3s ease;
}

.search-input-wrapper:focus-within {
    border-color: var(--accent-primary);
    box-shadow: 0 0 0 3px rgba(0, 210, 255, 0.1);
}

.search-icon {
    flex-shrink: 0;
    color: var(--text-subtle);
}

.blog-search-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    font-size: 1rem;
    color: var(--text-main);
}

.blog-search-input::placeholder {
    color: var(--text-subtle);
}

.blog-search-btn {
    flex-shrink: 0;
    padding: 0.5rem 1.5rem;
    background: var(--accent-primary);
    color: var(--bg-dark);
    font-weight: 600;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.blog-search-btn:hover {
    background: #06b6d4;
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 210, 255, 0.3);
}

/* ============================================
   2. FEATURED POSTS
   ============================================ */
.blog-featured {
    padding: 3rem 0 4rem;
    background: var(--bg-darker);
}

.featured-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2rem;
}

.featured-card {
    background: var(--bg-card);
    border: 1px solid var(--glass-border);
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-card:hover {
    transform: translateY(-8px);
    border-color: rgba(0, 210, 255, 0.3);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.featured-main {
    grid-column: 1 / -1;
}

.featured-main .featured-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
}

.featured-image {
    position: relative;
    height: 260px;
    overflow: hidden;
    background: var(--bg-darker);
}

.featured-main .featured-image {
    height: 400px;
}

.featured-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-card:hover .featured-image img {
    transform: scale(1.08);
}

.featured-content {
    padding: 2rem;
}

.featured-main .featured-content {
    padding: 3rem;
}

.post-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4rem 1rem;
    background: rgba(0, 210, 255, 0.1);
    color: var(--accent-primary);
    border-radius: 6px;
    margin-bottom: 1rem;
    font-family: var(--font-code);
}

.featured-title {
    font-size: 1.5rem;
    font-weight: 700;
    line-height: 1.3;
    margin-bottom: 1rem;
}

.featured-main .featured-title {
    font-size: 2rem;
}

.featured-title a {
    color: var(--text-main);
    transition: color 0.2s ease;
}

.featured-title a:hover {
    color: var(--accent-primary);
}

.featured-excerpt {
    font-size: 1rem;
    line-height: 1.6;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: var(--text-subtle);
}

.post-author {
    font-weight: 500;
    color: var(--text-muted);
}

.meta-separator {
    opacity: 0.5;
}

/* ============================================
   3. BLOG MAIN - TEMA CLARO INSTITUCIONAL
   ============================================ */
.blog-main {
    padding: 5rem 0;
    background: #ffffff;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 340px;
    gap: 4rem;
    align-items: start;
}

.blog-posts {
    width: 100%;
}

/* Search Results Header */
.search-results-header {
    margin-bottom: 2.5rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #e2e8f0;
}

.search-results-header h2 {
    font-size: 1.875rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.5rem;
    font-family: var(--font-heading);
}

.search-results-header p {
    font-size: 1.05rem;
    color: #64748b;
}

/* Posts Grid */
.posts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
    gap: 3rem;
}

.post-card {
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.06);
}

.post-card:hover {
    transform: translateY(-6px);
    border-color: #06b6d4;
    box-shadow: 0 12px 32px rgba(6, 182, 212, 0.15);
}

/* Colores por módulo */
.post-card.module-cyan {
    border-top: 3px solid #06b6d4;
}

.post-card.module-emerald {
    border-top: 3px solid #10b981;
}

.post-card.module-violet {
    border-top: 3px solid #a855f7;
}

.post-card.module-indigo {
    border-top: 3px solid #6366f1;
}

.post-card.module-amber {
    border-top: 3px solid #f59e0b;
}

.post-card.module-rose {
    border-top: 3px solid #f43f5e;
}

.post-image {
    display: block;
    height: 220px;
    overflow: hidden;
    background: #f1f5f9;
}

.post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

.post-card:hover .post-image img {
    transform: scale(1.08);
}

.post-content {
    padding: 2rem;
}

.post-content .post-category {
    display: inline-block;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    padding: 0.4rem 1rem;
    border-radius: 6px;
    margin-bottom: 1rem;
    font-family: var(--font-code);
}

.module-cyan .post-category {
    background: rgba(6, 182, 212, 0.1);
    color: #0891b2;
}

.module-emerald .post-category {
    background: rgba(16, 185, 129, 0.1);
    color: #059669;
}

.module-violet .post-category {
    background: rgba(168, 85, 247, 0.1);
    color: #7c3aed;
}

.module-indigo .post-category {
    background: rgba(99, 102, 241, 0.1);
    color: #4f46e5;
}

.module-amber .post-category {
    background: rgba(245, 158, 11, 0.1);
    color: #d97706;
}

.module-rose .post-category {
    background: rgba(244, 63, 94, 0.1);
    color: #e11d48;
}

.post-title {
    font-size: 1.35rem;
    font-weight: 700;
    line-height: 1.35;
    margin-bottom: 0.875rem;
    font-family: var(--font-heading);
}

.post-title a {
    color: #1e293b;
    transition: color 0.2s ease;
}

.post-title a:hover {
    color: #0891b2;
}

.post-excerpt {
    font-size: 1rem;
    line-height: 1.65;
    color: #475569;
    margin-bottom: 1.25rem;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-content .post-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.875rem;
    color: #64748b;
    font-weight: 500;
}

/* No Posts State */
.no-posts {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 5rem 2rem;
    text-align: center;
}

.no-posts svg {
    color: #cbd5e1;
    margin-bottom: 1.5rem;
}

.no-posts h3 {
    font-size: 1.5rem;
    font-weight: 600;
    color: #1e293b;
    margin-bottom: 0.75rem;
}

.no-posts p {
    font-size: 1.05rem;
    color: #64748b;
    margin-bottom: 2rem;
}

/* ============================================
   4. PAGINATION - TEMA CLARO
   ============================================ */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    margin-top: 4rem;
}

.pagination-btn,
.pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 42px;
    height: 42px;
    padding: 0 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    font-size: 0.95rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.pagination-btn {
    gap: 0.5rem;
}

.pagination-btn:hover,
.pagination-number:hover {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border-color: #06b6d4;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.3);
}

.pagination-number.active {
    background: linear-gradient(135deg, #06b6d4, #0891b2);
    border-color: #06b6d4;
    color: #ffffff;
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.3);
}

.pagination-numbers {
    display: flex;
    gap: 0.5rem;
}

/* ============================================
   5. SIDEBAR - TEMA CLARO INSTITUCIONAL
   ============================================ */
.blog-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-widget {
    background: #f8fafc;
    border: 1px solid #e2e8f0;
    border-radius: 16px;
    padding: 2rem;
    margin-bottom: 1.75rem;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.widget-title {
    font-size: 1.05rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 1.5rem;
    padding-bottom: 0.875rem;
    border-bottom: 2px solid #e2e8f0;
    font-family: var(--font-heading);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-size: 0.85rem;
}

/* Categories */
.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.category-list li {
    margin-bottom: 0.875rem;
}

.category-list li:last-child {
    margin-bottom: 0;
}

.category-link {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.875rem 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 10px;
    color: #1e293b;
    transition: all 0.2s ease;
    font-weight: 500;
}

.category-link:hover {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(16, 185, 129, 0.08));
    border-color: #06b6d4;
    transform: translateX(5px);
    box-shadow: 0 4px 12px rgba(6, 182, 212, 0.15);
}

.category-name {
    font-weight: 600;
}

.category-count {
    font-size: 0.8rem;
    font-weight: 700;
    color: #64748b;
    background: #e2e8f0;
    padding: 0.3rem 0.75rem;
    border-radius: 14px;
}

/* Tags */
.tag-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 0.625rem;
}

.tag-link {
    display: inline-block;
    padding: 0.6rem 1.25rem;
    background: #ffffff;
    border: 1px solid #e2e8f0;
    border-radius: 24px;
    font-size: 0.875rem;
    font-weight: 600;
    color: #475569;
    transition: all 0.2s ease;
}

.tag-link:hover {
    background: linear-gradient(135deg, #06b6d4, #10b981);
    border-color: #06b6d4;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(6, 182, 212, 0.25);
}

/* CTA Widget */
.sidebar-cta {
    background: linear-gradient(135deg, rgba(6, 182, 212, 0.08), rgba(168, 85, 247, 0.08));
    border-color: rgba(6, 182, 212, 0.25);
    text-align: center;
}

.sidebar-cta .cta-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 72px;
    height: 72px;
    background: linear-gradient(135deg, #06b6d4, #a855f7);
    border-radius: 18px;
    color: white;
    margin-bottom: 1.5rem;
    box-shadow: 0 10px 30px rgba(6, 182, 212, 0.35);
}

.sidebar-cta h3 {
    font-size: 1.25rem;
    font-weight: 700;
    color: #0f172a;
    margin-bottom: 0.875rem;
    font-family: var(--font-heading);
}

.sidebar-cta p {
    font-size: 1rem;
    line-height: 1.6;
    color: #475569;
    margin-bottom: 1.75rem;
}

.btn-sm {
    padding: 0.75rem 1.5rem !important;
    font-size: 0.95rem !important;
    font-weight: 600 !important;
}

/* ============================================
   6. RESPONSIVE
   ============================================ */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
        max-width: 700px;
        margin: 4rem auto 0;
    }

    .featured-main .featured-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 120px 0 60px;
    }

    .blog-hero-title {
        font-size: 2.5rem;
    }

    .search-input-wrapper {
        flex-direction: column;
        gap: 1rem;
    }

    .blog-search-btn {
        width: 100%;
    }

    .posts-grid {
        grid-template-columns: 1fr;
    }

    .featured-grid {
        grid-template-columns: 1fr;
    }

    .featured-main .featured-image {
        height: 260px;
    }

    .blog-main {
        padding: 3rem 0;
    }
}

@media (max-width: 480px) {
    .blog-hero-title {
        font-size: 2rem;
    }

    .pagination-btn span {
        display: none;
    }

    .post-content {
        padding: 1.5rem;
    }
}/* ============================================
   BACKGROUND ANIMATIONS - PARTICLES
   ============================================ */
.blog-hero {
    position: relative;
    overflow: hidden;
}

.hero-bg-effects {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
}

.hero-particles span {
    position: absolute;
    width: 6px;
    height: 6px;
    background: rgba(99, 102, 241, 0.4);
    border-radius: 50%;
    animation: floatParticle 15s infinite;
}

.hero-particles span:nth-child(1) {
    left: 10%;
    top: 20%;
    animation-delay: 0s;
}

.hero-particles span:nth-child(2) {
    left: 20%;
    top: 60%;
    animation-delay: -3s;
}

.hero-particles span:nth-child(3) {
    left: 70%;
    top: 30%;
    animation-delay: -5s;
}

.hero-particles span:nth-child(4) {
    left: 80%;
    top: 70%;
    animation-delay: -8s;
}

.hero-particles span:nth-child(5) {
    left: 50%;
    top: 80%;
    animation-delay: -12s;
}

@keyframes floatParticle {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
        opacity: 0.2;
    }

    25% {
        transform: translateY(-30px) rotate(90deg);
        opacity: 0.5;
    }

    50% {
        transform: translateY(-15px) rotate(180deg);
        opacity: 0.3;
    }

    75% {
        transform: translateY(-40px) rotate(270deg);
        opacity: 0.4;
    }
}

.blog-hero-content {
    position: relative;
    z-index: 2;
}
