/* ==========================================
   WRITEUPS GRID & CARDS
   ========================================== */

/* Ajuste del dashboard para ocupar el espacio del panel derecho ausente */
.layout-full {
    grid-template-columns: 12.5rem 1fr !important;
}

.writeups-grid {
    display: grid;
    /* 4 columnas en pantallas grandes */
    grid-template-columns: repeat(4, 1fr);
    gap: 1.25rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 100%;
}

.writeup-card {
    background: rgba(13, 17, 28, 0.4);
    border: 0.0625rem solid var(--border-color);
    border-radius: 0.75rem;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    min-height: 14rem;
}

.writeup-card:hover {
    transform: translateY(-0.25rem);
    background: rgba(13, 17, 28, 0.7);
    border-color: var(--accent-blue);
    box-shadow: 0 0.625rem 1.875rem rgba(10, 13, 20, 0.5);
}

.card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
}

.difficulty {
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    padding: 0.2rem 0.5rem;
    border-radius: 0.25rem;
    font-family: var(--font-mono);
}

/* Colores de dificultad */
.difficulty.very-easy { color: #22d3ee; background: rgba(34, 211, 238, 0.1); }
.difficulty.easy { color: var(--accent-green); background: rgba(16, 185, 129, 0.1); }
.difficulty.medium { color: #f59e0b; background: rgba(245, 158, 11, 0.1); }
.difficulty.hard { color: #ef4444; background: rgba(239, 68, 68, 0.1); }
.difficulty.insane { color: #8b5cf6; background: rgba(139, 92, 246, 0.1); }

.writeup-date {
    font-size: 0.65rem;
    color: var(--text-muted);
    font-family: var(--font-mono);
}

.platform { color: var(--text-muted); font-size: 0.7rem; font-family: var(--font-mono); }
.card-title { font-family: var(--font-title); font-size: 1.25rem; color: var(--text-main); margin: 0.25rem 0; }
.card-desc { color: var(--text-muted); font-size: 0.85rem; line-height: 1.5; flex-grow: 1; }

/* Sección de Tags */
.card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.5rem 0 1rem 0;
}

.tag-item {
    font-size: 0.6rem;
    font-family: var(--font-mono);
    color: var(--accent-blue);
    background: rgba(59, 130, 246, 0.05);
    border: 0.0625rem solid rgba(59, 130, 246, 0.2);
    padding: 0.15rem 0.4rem;
    border-radius: 0.25rem;
    text-transform: lowercase;
}

.tag-item.highlight {
    color: var(--accent-green);
    border-color: rgba(16, 185, 129, 0.3);
    background: rgba(16, 185, 129, 0.05);
}

.view-link {
    margin-top: auto;
    display: block;
    padding: 0.625rem;
    text-align: center;
    color: var(--accent-blue);
    text-decoration: none;
    font-size: 0.7rem;
    font-family: var(--font-mono);
    border: 0.0625rem solid rgba(59, 130, 246, 0.2);
    border-radius: 0.375rem;
    background: rgba(59, 130, 246, 0.03);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-transform: uppercase;
    letter-spacing: 0.0625rem;
}

.view-link:hover {
    background: rgba(59, 130, 246, 0.1);
    border-color: var(--accent-blue);
    color: var(--text-main);
    transform: translateY(-0.125rem);
    box-shadow: 0 0.25rem 0.75rem rgba(59, 130, 246, 0.15);
}

/* ==========================================
   RESPONSIVE (ADAPTACIÓN SEGÚN PANTALLA)
   ========================================== */
@media (max-width: 80rem) { /* 1280px */
    .writeups-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 64rem) { /* 1024px */
    .layout-full {
        grid-template-columns: 1fr !important;
    }
    .writeups-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 48rem) { /* 768px */
    .writeups-grid {
        grid-template-columns: 1fr;
    }
    .main-title, .sub-title { font-size: 2.5rem !important; }
}
