/* ============================================================================
   CRIPTOBID — BLOG
   Estilos para listado y detalle de artículos
   ============================================================================ */

/* ========== BUSCADOR ========== */
.blog-search {
    margin-bottom: 24px;
}

.blog-search-wrap {
    position: relative;
    display: flex;
    align-items: center;
}

.blog-search-icon {
    position: absolute;
    left: 18px;
    color: var(--muted);
    font-size: 0.9rem;
    pointer-events: none;
    transition: color 0.2s;
}

.blog-search-input {
    width: 100%;
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid var(--line);
    border-radius: var(--r-md);
    color: #fff;
    padding: 14px 48px 14px 48px;
    font-family: var(--body);
    font-size: 0.95rem;
    transition: border-color 0.25s, box-shadow 0.25s;
}

.blog-search-input::placeholder {
    color: #3d5162;
}

.blog-search-input:focus {
    outline: none;
    border-color: var(--blue);
    box-shadow: 0 0 0 1px var(--blue), 0 0 20px rgba(0, 200, 255, 0.2);
}

.blog-search-input:focus ~ .blog-search-icon,
.blog-search-wrap:focus-within .blog-search-icon {
    color: var(--blue);
}

.blog-search-clear {
    position: absolute;
    right: 18px;
    color: var(--muted);
    font-size: 1rem;
    transition: color 0.2s;
    cursor: pointer;
    text-decoration: none;
}

.blog-search-clear:hover {
    color: var(--blue);
}

.blog-search-result {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--muted);
    font-size: 0.9rem;
    margin: 0 0 24px;
    padding: 12px 18px;
    background: rgba(0, 200, 255, 0.04);
    border-left: 3px solid var(--blue);
    border-radius: var(--r-sm);
}

.blog-search-result i {
    color: var(--blue);
}

.blog-search-result strong {
    color: var(--pale);
    font-weight: 600;
}

/* ========== GRID DE POSTS ========== */
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 22px;
}

/* ========== TARJETA DE POST ========== */
.blog-card {
    position: relative;
    background: var(--panel);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-lg);
    overflow: hidden;
    transition: transform 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

.blog-card:hover {
    transform: translateY(-6px);
    border-color: var(--line);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.5), 0 0 30px rgba(0, 200, 255, 0.12);
}

.blog-card-link {
    display: block;
    color: inherit;
    text-decoration: none;
    height: 100%;
}

/* Imagen */
.blog-card-image {
    position: relative;
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    background: #04060a;
}

.blog-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.blog-card:hover .blog-card-image img {
    transform: scale(1.05);
}

.blog-card-image-placeholder {
    display: grid;
    place-items: center;
    color: var(--line);
    font-size: 2.5rem;
}

.blog-card-image-placeholder i {
    opacity: 0.4;
}

/* Contenido */
.blog-card-body {
    padding: 22px 24px 24px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.blog-card-title {
    font-family: var(--disp);
    font-size: 1.1rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.35;
    letter-spacing: 0.01em;
    transition: color 0.2s;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.blog-card:hover .blog-card-title {
    color: var(--blue);
    text-shadow: 0 0 16px rgba(0, 200, 255, 0.4);
}

.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-family: var(--num);
    font-size: 0.72rem;
    color: var(--muted);
    letter-spacing: 0.03em;
}

.blog-card-meta span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.blog-card-meta i {
    color: var(--blue2);
}

.blog-card-excerpt {
    color: var(--muted);
    font-size: 0.88rem;
    font-weight: 300;
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    flex: 1;
}

.blog-card-readmore {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--blue);
    font-family: var(--disp);
    font-size: 0.72rem;
    font-weight: 600;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    margin-top: 6px;
    transition: gap 0.25s ease;
}

.blog-card:hover .blog-card-readmore {
    gap: 14px;
}

/* ========== PAGINACIÓN ========== */
.blog-pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 14px;
    margin-top: 40px;
    padding-top: 32px;
    border-top: 1px solid var(--line-soft);
}

.blog-page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: var(--r-sm);
    background: rgba(0, 200, 255, 0.05);
    border: 1px solid var(--line);
    color: var(--blue);
    text-decoration: none;
    transition: all 0.25s ease;
}

.blog-page-btn:hover:not(.disabled) {
    background: rgba(0, 200, 255, 0.15);
    border-color: var(--blue);
    transform: translateY(-2px);
    box-shadow: 0 0 20px rgba(0, 200, 255, 0.35);
}

.blog-page-btn.disabled {
    opacity: 0.3;
    cursor: not-allowed;
    color: var(--muted);
    background: transparent;
}

.blog-page-info {
    font-family: var(--disp);
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--pale);
    letter-spacing: 0.1em;
    min-width: 60px;
    text-align: center;
}

/* ========== ESTADO VACÍO ========== */
.blog-empty {
    text-align: center;
    padding: 60px 20px;
    color: var(--muted);
}

.blog-empty i {
    font-size: 3rem;
    color: var(--line);
    margin-bottom: 20px;
    display: block;
}

.blog-empty p {
    font-size: 1.05rem;
    margin-bottom: 24px;
}

/* ========== DETALLE DEL POST ========== */

.blog-detail-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    font-family: var(--num);
    font-size: 0.82rem;
    color: var(--muted);
    margin-top: 12px;
}

.blog-detail-meta span {
    display: inline-flex;
    align-items: center;
    gap: 7px;
}

.blog-detail-meta i {
    color: var(--blue2);
}

.blog-detail-image {
    width: 100%;
    border-radius: var(--r-md);
    overflow: hidden;
    margin: 0 0 32px;
    border: 1px solid var(--line-soft);
}

.blog-detail-image img {
    width: 100%;
    height: auto;
    display: block;
}

.blog-detail-excerpt {
    font-size: 1.1rem;
    color: var(--pale);
    font-weight: 300;
    font-style: italic;
    line-height: 1.7;
    border-left: 3px solid var(--blue);
    padding-left: 20px;
    margin: 0 0 32px;
}

/* ========== CUERPO DEL ARTÍCULO (Markdown renderizado) ========== */
.blog-body {
    color: var(--muted);
    font-size: 1rem;
    line-height: 1.75;
    font-weight: 300;
}

.blog-body > *:first-child { margin-top: 0; }
.blog-body > *:last-child { margin-bottom: 0; }

/* Encabezados */
.blog-body h1,
.blog-body h2,
.blog-body h3,
.blog-body h4,
.blog-body h5,
.blog-body h6 {
    font-family: var(--disp);
    color: #fff;
    font-weight: 700;
    line-height: 1.3;
    letter-spacing: 0.01em;
    margin: 36px 0 16px;
}

.blog-body h1 {
    font-size: 1.9rem;
    color: var(--blue);
    text-shadow: 0 0 18px rgba(0, 200, 255, 0.4);
}

.blog-body h2 {
    font-size: 1.5rem;
    color: var(--blue);
    padding-bottom: 10px;
    border-bottom: 1px solid var(--line-soft);
    text-shadow: 0 0 14px rgba(0, 200, 255, 0.3);
}

.blog-body h3 {
    font-size: 1.2rem;
    color: var(--pale);
}

.blog-body h4,
.blog-body h5,
.blog-body h6 {
    font-size: 1rem;
    color: var(--pale);
    text-transform: uppercase;
    letter-spacing: 0.08em;
}

/* Párrafos */
.blog-body p {
    margin-bottom: 18px;
}

.blog-body strong,
.blog-body b {
    color: #fff;
    font-weight: 600;
}

.blog-body em,
.blog-body i {
    color: var(--pale);
    font-style: italic;
}

/* Listas */
.blog-body ul,
.blog-body ol {
    margin: 18px 0 18px 26px;
    padding-left: 0;
}

.blog-body li {
    margin-bottom: 8px;
}

.blog-body li::marker {
    color: var(--blue);
}

/* Links */
.blog-body a {
    color: var(--blue);
    text-decoration: none;
    border-bottom: 1px dashed rgba(0, 200, 255, 0.4);
    transition: all 0.2s;
}

.blog-body a:hover {
    border-bottom-style: solid;
    text-shadow: 0 0 10px rgba(0, 200, 255, 0.6);
}

/* Citas */
.blog-body blockquote {
    border-left: 3px solid var(--blue);
    padding: 14px 22px;
    margin: 24px 0;
    background: rgba(0, 200, 255, 0.04);
    border-radius: 0 var(--r-sm) var(--r-sm) 0;
    color: var(--pale);
    font-style: italic;
}

.blog-body blockquote p {
    margin-bottom: 0;
}

/* Código inline */
.blog-body code {
    font-family: var(--num);
    background: rgba(0, 200, 255, 0.08);
    border: 1px solid rgba(0, 200, 255, 0.15);
    padding: 2px 8px;
    border-radius: 4px;
    color: var(--cyan);
    font-size: 0.88em;
    font-weight: 500;
}

/* Bloques de código */
.blog-body pre {
    background: rgba(0, 0, 0, 0.6);
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--blue);
    border-radius: var(--r-sm);
    padding: 18px 22px;
    overflow-x: auto;
    margin: 22px 0;
    font-family: var(--num);
    font-size: 0.88rem;
    line-height: 1.6;
}

.blog-body pre code {
    background: none;
    border: none;
    padding: 0;
    color: var(--pale);
    font-size: inherit;
}

/* Imágenes dentro del artículo */
.blog-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--r-sm);
    border: 1px solid var(--line-soft);
    margin: 22px 0;
    display: block;
}

/* Tablas */
.blog-body table {
    width: 100%;
    border-collapse: collapse;
    margin: 24px 0;
    font-size: 0.9rem;
    border: 1px solid var(--line-soft);
    border-radius: var(--r-sm);
    overflow: hidden;
}

.blog-body th,
.blog-body td {
    padding: 12px 16px;
    text-align: left;
    border-bottom: 1px solid var(--line-soft);
}

.blog-body th {
    background: rgba(0, 200, 255, 0.06);
    color: var(--pale);
    font-family: var(--disp);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.blog-body tr:last-child td {
    border-bottom: none;
}

.blog-body tr:hover td {
    background: rgba(0, 200, 255, 0.02);
}

/* Separador */
.blog-body hr {
    border: none;
    border-top: 1px solid var(--line-soft);
    margin: 36px 0;
}

/* ========== HR del detalle ========== */
.blog-detail-hr {
    border: none;
    border-top: 1px solid var(--line-soft);
    margin: 44px 0;
}

/* ========== ARTÍCULOS RELACIONADOS ========== */
.blog-related {
    margin-bottom: 32px;
}

.blog-related-title {
    font-family: var(--disp);
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    letter-spacing: 0.04em;
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 18px;
}

.blog-related-title i {
    color: var(--blue);
    font-size: 0.95em;
    text-shadow: 0 0 12px rgba(0, 200, 255, 0.5);
}

.blog-related-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.blog-related-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 16px 20px;
    background: rgba(0, 200, 255, 0.02);
    border: 1px solid var(--line-soft);
    border-radius: var(--r-md);
    text-decoration: none;
    color: inherit;
    transition: all 0.25s ease;
}

.blog-related-item:hover {
    background: rgba(0, 200, 255, 0.06);
    border-color: var(--line);
    transform: translateX(4px);
}

.blog-related-item-content {
    min-width: 0;
    flex: 1;
}

.blog-related-item h4 {
    font-family: var(--disp);
    font-size: 0.95rem;
    font-weight: 600;
    color: #fff;
    margin-bottom: 4px;
    line-height: 1.35;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.blog-related-item:hover h4 {
    color: var(--blue);
}

.blog-related-item small {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: var(--num);
    font-size: 0.72rem;
    color: var(--muted);
}

.blog-related-item small i {
    color: var(--blue2);
}

.blog-related-arrow {
    color: var(--blue);
    opacity: 0.5;
    transition: opacity 0.25s, transform 0.25s;
    flex-shrink: 0;
}

.blog-related-item:hover .blog-related-arrow {
    opacity: 1;
    transform: translateX(4px);
}

/* ========== FOOTER DEL DETALLE ========== */
.blog-detail-footer {
    margin-top: 32px;
    padding-top: 24px;
    border-top: 1px solid var(--line-soft);
}

/* ========== RESPONSIVE ========== */
@media (max-width: 768px) {
    .blog-grid {
        grid-template-columns: 1fr;
        gap: 18px;
    }
    
    .blog-card-body {
        padding: 18px 20px 20px;
    }
    
    .blog-card-title {
        font-size: 1rem;
    }
    
    .blog-search-input {
        padding: 12px 44px;
        font-size: 0.9rem;
    }
    
    .blog-body {
        font-size: 0.95rem;
    }
    
    .blog-body h1 { font-size: 1.6rem; }
    .blog-body h2 { font-size: 1.3rem; }
    .blog-body h3 { font-size: 1.1rem; }
    
    .blog-body pre {
        padding: 14px 16px;
        font-size: 0.8rem;
    }
    
    .blog-body table {
        font-size: 0.82rem;
    }
    
    .blog-body th,
    .blog-body td {
        padding: 8px 10px;
    }
    
    .blog-detail-meta {
        gap: 14px;
        font-size: 0.76rem;
    }
    
    .blog-related-item {
        padding: 12px 14px;
        gap: 10px;
    }
    
    .blog-related-item h4 {
        font-size: 0.88rem;
    }
}

@media (max-width: 480px) {
    .blog-card-image {
        aspect-ratio: 3 / 2;
    }
    
    .blog-pagination {
        gap: 10px;
    }
    
    .blog-page-btn {
        width: 40px;
        height: 40px;
    }
    
    .blog-page-info {
        font-size: 0.8rem;
        min-width: 50px;
    }
}