/**
 * Blog Grid Widget Styles
 * Arquivo: assets/style.css
 */

/* Container Principal */
.bgw-container {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 40px 20px;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.bgw-wrapper {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* === BARRA LATERAL === */
.bgw-sidebar {
    width: 320px;
    min-width: 320px;
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 20px;
}

/* Caixa de Pesquisa */
.bgw-search-box {
    position: relative;
    margin-bottom: 30px;
}

.bgw-search-input {
    width: 100%;
    padding: 14px 50px 14px 20px;
    border: 2px solid #E8E9EB;
    border-radius: 15px;
    font-size: 15px;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #333333;
}

.bgw-search-input::placeholder {
    color: #999999;
}

.bgw-search-input:focus {
    outline: none;
    border-color: #34A7DE;
    background: #ffffff;
    box-shadow: 0 0 0 4px rgba(52, 167, 222, 0.1);
}

.bgw-search-btn {
    position: absolute;
    right: 6px;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(135deg, #34A7DE, #0D85C0);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bgw-search-btn:hover {
    background: linear-gradient(135deg, #0D85C0, #0a6a99);
    transform: translateY(-50%) scale(1.05);
    box-shadow: 0 4px 12px rgba(52, 167, 222, 0.4);
}

.bgw-search-btn:active {
    transform: translateY(-50%) scale(0.98);
}

/* Seções de Filtro */
.bgw-filter-section {
    margin-bottom: 30px;
}

.bgw-filter-section:last-child {
    margin-bottom: 0;
}

.bgw-filter-title {
    font-size: 18px;
    font-weight: 700;
    color: #333333;
    margin: 0 0 15px 0;
    padding-bottom: 10px;
    border-bottom: 2px solid #F6F7F9;
}

/* Lista de Categorias */
.bgw-category-list {
    list-style: none;
    padding: 0;
    margin: 0;
}

.bgw-category-list > li {
    margin-bottom: 8px;
}

.bgw-category-item {
    display: block;
    padding: 10px 15px;
    color: #666666;
    text-decoration: none;
    border-radius: 12px;
    transition: all 0.3s ease;
    font-size: 15px;
}

.bgw-category-item:hover {
    background: #F6F7F9;
    color: #34A7DE;
    transform: translateX(5px);
    text-decoration: none;
}

.bgw-category-item.active {
    background: linear-gradient(135deg, #34A7DE, #0D85C0);
    color: #ffffff;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 167, 222, 0.3);
    text-decoration: none;
}

/* Subcategorias */
.bgw-subcategory-list {
    list-style: none;
    padding: 8px 0 0 20px;
    margin: 8px 0 0 0;
}

.bgw-subcategory-list .bgw-category-item {
    font-size: 14px;
    padding: 8px 12px;
}

/* Tags Cloud */
.bgw-tags-cloud {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.bgw-tag-item {
    display: inline-block;
    padding: 8px 16px;
    background: #F6F7F9;
    color: #666666;
    text-decoration: none;
    border-radius: 20px;
    font-size: 14px;
    transition: all 0.3s ease;
}

.bgw-tag-item:hover {
    background: #34A7DE;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 167, 222, 0.3);
    text-decoration: none;
}

.bgw-tag-item.active {
    background: #0D85C0;
    color: #ffffff;
    text-decoration: none;
}

/* === ÁREA PRINCIPAL === */
.bgw-main {
    flex: 1;
    min-width: 0;
}

/* Barra de Ferramentas */
.bgw-toolbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 30px;
    padding: 20px;
    background: #ffffff;
    border-radius: 20px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.bgw-view-options {
    display: flex;
    gap: 8px;
}

.bgw-view-btn {
    width: 44px;
    height: 44px;
    border: 2px solid #E8E9EB;
    background: #ffffff;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #666666;
    padding: 0;
}

.bgw-view-btn svg {
    width: 20px;
    height: 20px;
}

.bgw-view-btn:hover {
    border-color: #34A7DE;
    color: #34A7DE;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 167, 222, 0.2);
}

.bgw-view-btn.active {
    background: linear-gradient(135deg, #34A7DE, #0D85C0);
    border-color: #34A7DE;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(52, 167, 222, 0.3);
}

.bgw-order-select {
    padding: 12px 40px 12px 20px;
    border: 2px solid #E8E9EB;
    border-radius: 12px;
    font-size: 15px;
    background: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    max-width: 200px;
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23666666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 12px center;
    background-size: 20px;
}

.bgw-order-select:hover {
    border-color: #34A7DE;
}

.bgw-order-select:focus {
    outline: none;
    border-color: #34A7DE;
    background-color: #ffffff;
    box-shadow: 0 0 0 4px rgba(52, 167, 222, 0.1);
}

/* === GRID DE POSTS === */
.bgw-posts-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
}

.bgw-grid-1 {
    grid-template-columns: 1fr;
}

.bgw-grid-2 {
    grid-template-columns: repeat(2, 1fr);
}

.bgw-grid-3 {
    grid-template-columns: repeat(3, 1fr);
}

.bgw-grid-list {
    grid-template-columns: 1fr;
}

/* Card de Post */
.bgw-post-card {
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.4s ease;
    display: flex;
    flex-direction: column;
}

.bgw-post-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 40px rgba(52, 167, 222, 0.2);
}

/* Layout em Lista */
.bgw-grid-list .bgw-post-card {
    flex-direction: row;
    align-items: center;
}

.bgw-grid-list .bgw-post-thumbnail-link {
    width: 300px;
    min-width: 300px;
}

.bgw-grid-list .bgw-post-content {
    flex: 1;
}

/* Link da Thumbnail */
.bgw-post-thumbnail-link {
    display: block;
    text-decoration: none;
    position: relative;
}

/* Thumbnail */
.bgw-post-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
}

.bgw-post-thumbnail {
    width: 100%;
    height: 338px;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

.bgw-post-card:hover .bgw-post-thumbnail {
    transform: scale(1.08);
}

.bgw-no-thumbnail {
    background: linear-gradient(135deg, #F6F7F9, #e0e0e0);
}

/* Badge de Categoria */
.bgw-category-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: linear-gradient(135deg, #34A7DE, #0D85C0);
    color: #ffffff;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
    box-shadow: 0 4px 12px rgba(52, 167, 222, 0.4);
    z-index: 2;
}

/* Conteúdo do Post */
.bgw-post-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    gap: 15px;
    flex: 1;
}

.bgw-post-title {
    margin: 0;
    font-size: 22px;
    font-weight: 700;
    color: #333333;
    line-height: 1.4;
}

.bgw-post-title a {
    color: #333333;
    text-decoration: none;
    transition: color 0.3s ease;
}

.bgw-post-title a:hover {
    color: #34A7DE;
}

.bgw-post-card:hover .bgw-post-title a {
    color: #34A7DE;
}

.bgw-post-excerpt {
    margin: 0;
    font-size: 15px;
    color: #666666;
    line-height: 1.6;
}

/* Meta Informações */
.bgw-post-meta {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 15px;
    border-top: 1px solid #F6F7F9;
    font-size: 14px;
    color: #999999;
}

/* Botão Leia Mais */
.bgw-read-more {
    display: inline-block;
    padding: 12px 28px;
    background: #34A7DE;
    color: #ffffff;
    text-decoration: none;
    border-radius: 12px;
    font-weight: 600;
    font-size: 15px;
    transition: all 0.3s ease;
    text-align: center;
    margin-top: auto;
}

.bgw-read-more:hover {
    background: #0D85C0;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(13, 133, 192, 0.3);
}

/* Mensagem Sem Posts */
.bgw-no-posts {
    text-align: center;
    padding: 60px 20px;
    color: #999999;
    font-size: 18px;
    grid-column: 1 / -1;
}

/* Ver Mais Tags */
.bgw-see-more-tags {
    display: block;
    margin-top: 15px;
    padding: 12px 24px;
    background: #ffffff;
    color: #34A7DE;
    text-decoration: none;
    border: 2px solid #34A7DE;
    border-radius: 12px;
    font-size: 14px;
    font-weight: 600;
    text-align: center;
    transition: all 0.3s ease;
    cursor: pointer;
}

.bgw-see-more-tags:hover {
    background: #34A7DE;
    color: #ffffff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(52, 167, 222, 0.3);
    text-decoration: none;
}

.bgw-see-more-tags:active {
    transform: translateY(0);
}

/* Paginação */
.bgw-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 40px;
    padding: 20px;
}

.bgw-pagination-btn {
    min-width: 44px;
    width: 44px;
    height: 44px;
    padding: 0;
    background: #ffffff;
    color: #666666;
    border: 2px solid #E8E9EB;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.bgw-pagination-btn svg {
    width: 20px;
    height: 20px;
}

.bgw-pagination-btn:hover:not(:disabled) {
    border-color: #34A7DE;
    color: #34A7DE;
    transform: scale(1.1);
}

.bgw-pagination-btn.active {
    background: linear-gradient(135deg, #34A7DE, #0D85C0);
    border-color: #34A7DE;
    color: #ffffff;
    box-shadow: 0 4px 12px rgba(52, 167, 222, 0.3);
}

.bgw-pagination-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bgw-pagination-dots {
    color: #999999;
    font-weight: 600;
    padding: 0 8px;
    display: flex;
    align-items: center;
}

/* Loading State */
.bgw-loading {
    text-align: center;
    padding: 40px;
    color: #999999;
    grid-column: 1 / -1;
}

.bgw-loading::after {
    content: '';
    display: inline-block;
    width: 30px;
    height: 30px;
    border: 3px solid #F6F7F9;
    border-top-color: #34A7DE;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* === RESPONSIVIDADE === */
@media (max-width: 1200px) {
    .bgw-grid-3 {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 992px) {
    .bgw-wrapper {
        flex-direction: column;
    }
    
    .bgw-sidebar {
        width: 100%;
        position: static;
    }
    
    .bgw-grid-2,
    .bgw-grid-3 {
        grid-template-columns: 1fr;
    }
    
    .bgw-grid-list .bgw-post-card {
        flex-direction: column;
    }
    
    .bgw-grid-list .bgw-post-thumbnail-link {
        width: 100%;
    }
}

@media (max-width: 768px) {
    .bgw-container {
        padding: 20px 15px;
    }
    
    .bgw-toolbar {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .bgw-view-options {
        justify-content: center;
    }
    
    .bgw-order-select {
        width: 100%;
    }
    
    .bgw-post-title {
        font-size: 20px;
    }
}

@media (max-width: 480px) {
    .bgw-sidebar {
        padding: 20px;
    }
    
    .bgw-post-thumbnail {
        height: 250px;
    }
    
    .bgw-category-badge {
        top: 15px;
        left: 15px;
        font-size: 12px;
        padding: 6px 12px;
    }
    
    .bgw-pagination {
        gap: 6px;
        padding: 15px 10px;
    }
    
    .bgw-pagination-btn {
        min-width: 38px;
        width: 38px;
        height: 38px;
        font-size: 14px;
    }
    
    .bgw-pagination-btn svg {
        width: 18px;
        height: 18px;
    }
}