/* Blog Layout Manager - Frontend Styles */

.blm-blog-section {
    display: grid;
    gap: 30px;
}

.blm-blog-section.blm-layout-grid {
    grid-template-columns: repeat(3, 1fr);
}

/* LAYOUT ESPECIAL PARA TRENDING */
.blm-blog-section.blm-section-trending.blm-layout-grid {
    grid-template-columns: repeat(3, 1fr);
}

.blm-blog-section.blm-section-trending .blm-post-card:nth-child(1) {
    grid-column: span 1;
}

.blm-blog-section.blm-section-trending .blm-post-card:nth-child(2) {
    grid-column: span 2;
}

.blm-blog-section.blm-section-trending .blm-post-card:nth-child(3),
.blm-blog-section.blm-section-trending .blm-post-card:nth-child(4),
.blm-blog-section.blm-section-trending .blm-post-card:nth-child(5) {
    grid-column: span 1;
}

.blm-blog-section.blm-layout-list {
    grid-template-columns: 1fr;
}

.blm-blog-section.blm-layout-list .blm-post-card {
    display: flex;
    flex-direction: row;
}

.blm-blog-section.blm-layout-list .blm-post-thumbnail {
    flex: 0 0 300px;
}

.blm-post-card {
    background: #ffffff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
    display: flex;
    flex-direction: column;
}

.blm-post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

.blm-post-link {
    text-decoration: none;
    color: inherit;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blm-post-thumbnail {
    position: relative;
    overflow: hidden;
    padding-top: 60%;
    background: #f0f0f0;
}

.blm-post-thumbnail img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.blm-post-card:hover .blm-post-thumbnail img {
    transform: scale(1.05);
}

.blm-post-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    flex: 1;
}

.blm-post-title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 10px 0;
    line-height: 1.4;
    color: #333;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 2.8em;
    word-break: break-word;
}

.blm-post-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    font-size: 13px;
    color: #999;
    margin-bottom: 12px;
}

.blm-post-meta span {
    display: flex;
    align-items: center;
    gap: 4px;
}

.blm-post-meta .dashicons {
    width: 16px;
    height: 16px;
    font-size: 16px;
}

.blm-post-excerpt {
    font-size: 14px;
    line-height: 1.6;
    color: #666;
    margin-bottom: 15px;
    flex: 1;
}

.blm-read-more {
    display: inline-block;
    color: #2196f3;
    font-weight: 600;
    font-size: 14px;
    margin-top: auto;
}

.blm-post-card:hover .blm-read-more {
    text-decoration: underline;
}

.blm-post-tag {
    display: inline-block;
    background: #e3f2fd;
    color: #1976d2;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    margin-bottom: 10px;
    text-transform: uppercase;
}

.blm-post-button {
    display: inline-block;
    background: #2196f3;
    color: white;
    padding: 10px 24px;
    border-radius: 6px;
    font-weight: 600;
    font-size: 14px;
    margin-top: auto;
    transition: all 0.3s;
}

.blm-post-card:hover .blm-post-button {
    background: #1976d2;
    transform: translateY(-2px);
}

.blm-manual-mode .blm-post-card {
    display: flex;
    flex-direction: column;
}

.blm-manual-mode .blm-post-link {
    display: flex;
    flex-direction: column;
    height: 100%;
}

.blm-no-posts {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    background: #f9f9f9;
    border-radius: 8px;
}

/* ============================================
   PAGINAÇÃO - ESTILOS CONSOLIDADOS
   ============================================ */

.blm-pagination {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-top: 40px;
    transition: opacity 0.3s ease;
}

/* SETAS DA PAGINAÇÃO */
.blm-pagination-arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    min-width: 40px;
    min-height: 40px;
    border: 1px solid #ddd;
    border-radius: 50%;
    background: transparent;
    color: #666;
    cursor: pointer;
    transition: all 0.3s ease;
    flex-shrink: 0;
    padding: 0;
    text-decoration: none;
}

.blm-pagination-arrow svg {
    width: 20px;
    height: 20px;
    min-width: 20px;
    min-height: 20px;
    display: block;
    flex-shrink: 0;
}

.blm-pagination-arrow:hover:not(.blm-disabled) {
    background: #f5f5f5;
    border-color: #999;
}

.blm-pagination-arrow.blm-disabled {
    cursor: not-allowed;
    opacity: 0.5;
    pointer-events: none;
}

/* NÚMEROS DA PAGINAÇÃO */
.blm-pagination-numbers {
    display: flex;
    align-items: center;
    gap: 10px;
}

.blm-pagination-number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    border-radius: 50%;
    font-size: 14px;
    font-weight: 500;
    color: #666;
    background: transparent;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    text-decoration: none;
}

.blm-pagination-number:hover:not(.blm-current) {
    background: #f5f5f5;
    color: #333;
}

.blm-pagination-number.blm-current {
    background: #4CAF50;
    color: #fff;
    cursor: default;
    font-weight: 600;
}

.blm-pagination-dots {
    color: #999;
    padding: 0 5px;
}

/* Transição para AJAX */
.blm-blog-section {
    transition: opacity 0.3s ease;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .blm-blog-section.blm-layout-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .blm-blog-section {
        gap: 20px;
    }
}

@media (max-width: 768px) {
    .blm-blog-section.blm-layout-grid {
        grid-template-columns: 1fr;
    }
    
    .blm-blog-section.blm-layout-list .blm-post-card {
        flex-direction: column;
    }
    
    .blm-blog-section.blm-layout-list .blm-post-thumbnail {
        flex: 1;
        padding-top: 60%;
    }
    
    .blm-post-content {
        padding: 15px;
    }
    
    .blm-post-title {
        font-size: 16px;
    }
    
    .blm-post-excerpt {
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .blm-blog-section {
        gap: 15px;
        margin: 20px 0;
    }
    
    .blm-post-meta {
        gap: 10px;
        font-size: 12px;
    }
    
    .blm-pagination {
        gap: 5px;
    }
    
    .blm-pagination-arrow,
    .blm-pagination-number {
        min-width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .blm-pagination-arrow svg {
        width: 18px;
        height: 18px;
        min-width: 18px;
        min-height: 18px;
    }
}

/* ============================================
   DARK MODE SUPPORT
   ============================================ */

@media (prefers-color-scheme: dark) {
    .blm-post-card {
        background: #1e1e1e;
    }
    
    .blm-post-title {
        color: #ffffff;
    }
    
    .blm-post-excerpt {
        color: #cccccc;
    }
    
    .blm-post-meta {
        color: #999999;
    }
    
    .blm-no-posts {
        background: #1e1e1e;
        color: #999999;
    }
}

/* ============================================
   ESTILOS PARA SEÇÃO BLING - VÍDEOS DO YOUTUBE
   ============================================ */

/* Cards de Vídeo do Bling */
.blm-bling-card {
    position: relative;
}

.blm-bling-card .blm-post-thumbnail {
    position: relative;
    overflow: hidden;
}

/* Ícone de Play */
.blm-video-play-icon {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 48px;
    color: white;
    background: rgba(0, 0, 0, 0.75);
    width: 80px;
    height: 80px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    z-index: 2;
    pointer-events: none;
}

.blm-bling-card:hover .blm-video-play-icon {
    background: rgba(255, 0, 0, 0.9);
    transform: translate(-50%, -50%) scale(1.15);
    box-shadow: 0 0 30px rgba(255, 0, 0, 0.5);
}

/* Badge de YouTube */
.blm-bling-card::before {
    content: 'YouTube';
    position: absolute;
    top: 15px;
    right: 15px;
    background: #ff0000;
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    z-index: 3;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

/* Overlay escuro no hover */
.blm-bling-card .blm-post-thumbnail::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 1;
}

.blm-bling-card:hover .blm-post-thumbnail::after {
    opacity: 1;
}

/* Ajustes no texto do card */
.blm-bling-card .blm-read-more {
    color: #ff0000;
    font-weight: 700;
}

.blm-bling-card:hover .blm-read-more {
    text-decoration: underline;
    color: #cc0000;
}

/* Animação no thumbnail */
.blm-bling-card .blm-post-thumbnail img {
    transition: transform 0.5s ease;
}

.blm-bling-card:hover .blm-post-thumbnail img {
    transform: scale(1.08);
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 768px) {
    .blm-video-play-icon {
        width: 60px;
        height: 60px;
        font-size: 32px;
    }
    
    .blm-bling-card::before {
        top: 10px;
        right: 10px;
        padding: 4px 8px;
        font-size: 10px;
    }
}

@media (max-width: 480px) {
    .blm-video-play-icon {
        width: 50px;
        height: 50px;
        font-size: 28px;
    }
}