/* =========================
   1. SISTEMA EDITORIAL
   Videos / Artículos / Entradas
   ========================= */

/* =========================
   2. BARRA DE HERRAMIENTAS
   Filtros y búsqueda
   ========================= */
.posts-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
    flex-wrap: wrap;
    margin: 24px 0;
    padding: 16px;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: #f7f9fc;
}

/* Grupo de botones de filtro */
.filter-buttons {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
}

/* Botones del sistema de filtrado */
.filter-btn {
    border: 1px solid var(--color-secondary);
    background: #ffffff;
    color: var(--color-secondary);
    padding: 10px 14px;
    border-radius: 999px;
    font-size: 0.95rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--transition);
}

.filter-btn:hover,
.filter-btn.active {
    background: var(--color-secondary);
    color: #ffffff;
}

/* Campo de búsqueda */
.search-box input {
    min-width: 280px;
    padding: 14px 16px;
    border: 1px solid #cfcfcf;
    border-radius: 10px;
    font-size: 1rem;
    outline: none;
    transition: border-color var(--transition), box-shadow var(--transition);
    background: #ffffff;
}

.search-box input:focus {
    border-color: var(--color-secondary);
    box-shadow: 0 0 0 3px rgba(29, 79, 145, 0.12);
}

/* =========================
   3. CONTENIDO AUDIOVISUAL
   Grilla y tarjetas de videos
   ========================= */
.content-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.content-card {
    background: var(--color-surface);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e8edf3;
    overflow: hidden;
    padding: 18px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.content-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.content-card img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    border-radius: 10px;
    margin-bottom: 12px;
}

.content-body h2,
.content-body h3 {
    color: #1f2d3d;
    margin-bottom: 10px;
}

.content-body p {
    color: #444;
    line-height: 1.7;
}

/* Etiqueta de tipo de contenido */
.content-tag {
    display: inline-block;
    background: #e8f0fb;
    color: var(--color-primary);
    padding: 6px 10px;
    border-radius: 20px;
    font-size: 0.85rem;
    font-weight: 600;
    margin-bottom: 10px;
}

/* Metadatos editoriales */
.content-meta,
.article-meta,
.post-meta {
    font-size: 0.92rem;
    color: #5b6570;
    margin-bottom: 10px;
}

/* =========================
   4. ARTÍCULOS
   Lista editorial y tarjetas
   ========================= */
.articles-list {
    display: flex;
    flex-direction: column;
    gap: 18px;
    margin-top: 20px;
}

.article-item {
    background: var(--color-surface);
    border-radius: 14px;
    box-shadow: var(--shadow-sm);
    border: 1px solid #e8edf3;
    padding: 18px;
    transition: transform var(--transition), box-shadow var(--transition);
}

.article-item:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
}

.article-item h2,
.article-item h3 {
    color: #1f2d3d;
    margin-bottom: 10px;
}

.article-item p {
    color: #444;
    line-height: 1.7;
}

/* =========================
   5. ENTRADAS INDIVIDUALES
   Artículos y videos en detalle
   ========================= */
.post-detail {
    max-width: 860px;
    margin: 0 auto;
}

.post-detail .post-meta {
    font-size: 0.95rem;
    color: #5b6570;
    margin-bottom: 12px;
}

/* Imagen principal de la entrada:
   se centra y se limita para evitar
   que se vea excesivamente grande */
.post-detail img {
    display: block;
    width: 100%;
    max-width: 420px;
    height: auto;
    margin: 18px auto 24px;
    border-radius: 12px;
    box-shadow: var(--shadow-sm);
}

.post-detail h1 {
    margin-bottom: 16px;
}

.post-detail h2 {
    margin-top: 28px;
    margin-bottom: 12px;
    color: var(--color-primary);
}

.post-detail p {
    line-height: 1.85;
    margin-bottom: 16px;
}

/* =========================
   6. VIDEO EMBEBIDO
   ========================= */
.video-embed {
    position: relative;
    width: 100%;
    padding-bottom: 56.25%;
    margin: 20px 0 24px;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
}

.video-embed iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
}

/* =========================
   7. MENSAJES DE ESTADO
   ========================= */
.no-results {
    display: none;
    padding: 16px;
    border: 1px dashed var(--color-border);
    border-radius: 10px;
    background: #fafcff;
    color: #5b6570;
    text-align: center;
    margin-top: 20px;
}

/* =========================
   8. RESPONSIVE
   Ajustes para tablets y móviles
   ========================= */
@media (max-width: 768px) {
    .posts-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .filter-buttons {
        justify-content: flex-start;
    }

    .search-box input {
        min-width: 100%;
        width: 100%;
    }

    .content-grid {
        grid-template-columns: 1fr;
    }

    .content-card,
    .article-item {
        padding: 16px;
    }

    .content-card img {
        height: 200px;
    }

    .post-detail {
        max-width: 100%;
    }

    .post-detail img {
        max-width: 100%;
        margin: 18px auto 24px;
    }
}