/* ===============================================
   ALL POSTS PAGE - PÁGINA DE TODOS OS ARTIGOS
   =============================================== */

/* Prevenir overflow horizontal */
.archive-page,
.archive-page * {
    max-width: 100%;
    box-sizing: border-box;
}

.archive-page {
    overflow-x: hidden;
}

/* Container principal */
.all-posts-container {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 40px;
    max-width: 100%;
    width: 100%;
    margin: 0 auto;
    padding: 40px 20px;
    overflow-x: hidden;
}

.container.all-posts-container {
    max-width: 1600px;
}

.all-posts-content {
    min-width: 0;
    overflow-x: hidden;
}

.all-posts-sidebar {
    min-width: 0;
    overflow-x: hidden;
}

/* Cabeçalho da página */
.all-posts-header {
    text-align: center;
    margin-bottom: 50px;
    padding: 60px 40px;
    background: linear-gradient(135deg, rgba(var(--primary-rgb), 0.08) 0%, rgba(var(--primary-rgb), 0.02) 100%);
    border-radius: 24px;
    position: relative;
    max-width: 900px;
    margin-left: auto;
    margin-right: auto;
    overflow-wrap: break-word;
    word-wrap: break-word;
}

.page-title-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 80px;
    height: 80px;
    background: linear-gradient(135deg, var(--primary-color) 0%, rgba(var(--primary-rgb), 0.8) 100%);
    border-radius: 20px;
    margin-bottom: 25px;
    box-shadow: 0 10px 30px rgba(var(--primary-rgb), 0.35);
    flex-shrink: 0;
}

.page-title-icon svg {
    width: 40px;
    height: 40px;
    color: #ffffff;
    stroke-width: 2;
}

.all-posts-title {
    font-size: 2.75rem;
    font-weight: 800;
    color: var(--text-color);
    margin: 0 0 15px 0;
    line-height: 1.2;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

.all-posts-subtitle {
    font-size: 1.15rem;
    color: #6b7280;
    margin: 0;
    font-weight: 400;
    line-height: 1.6;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Descrição de categoria específica */
.archive-description {
    font-size: 1.1rem;
    color: #6b7280;
    margin: 20px auto 0;
    max-width: 700px;
    line-height: 1.7;
    padding: 20px;
    background: rgba(255, 255, 255, 0.6);
    border-radius: 12px;
    border-left: 4px solid var(--primary-color);
    word-wrap: break-word;
    overflow-wrap: break-word;
}

/* Grid de posts - 2 colunas */
.all-posts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
    margin-bottom: 50px;
}

/* Card do post - layout vertical */
.all-posts-grid .post-card {
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border-radius: 20px;
    overflow: hidden;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    transition: all 0.3s ease;
    border: 1px solid #f0f0f0;
    height: 100%;
}

.all-posts-grid .post-card:hover {
    box-shadow: 0 8px 35px rgba(0, 0, 0, 0.12);
    transform: translateY(-4px);
    border-color: rgba(var(--primary-rgb), 0.2);
}

.all-posts-grid .post-thumbnail {
    position: relative;
    width: 100%;
    height: 240px;
    overflow: hidden;
}

.all-posts-grid .post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.all-posts-grid .post-card:hover .post-thumbnail img {
    transform: scale(1.08);
}

.all-posts-grid .post-category-badge {
    position: absolute;
    top: 20px;
    left: 20px;
    background: var(--primary-color);
    color: #ffffff;
    padding: 10px 16px; /* Reduzido visualmente */
    border-radius: 25px;
    font-size: 0.7rem; /* Menor */
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    z-index: 2;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.4);
    min-height: 48px; /* Acessibilidade mantida */
    min-width: 48px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.all-posts-grid .post-content-wrapper {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.all-posts-grid .post-title {
    margin: 0 0 12px 0;
    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.4;
}

.all-posts-grid .post-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.2s ease;
    /* Desktop: garantir área de toque mínima de 48x48px */
    display: inline-block;
    min-height: 48px;
    padding: 8px 0;
    display: flex;
    align-items: center;
}

/* Desktop: garantir espaçamento adequado entre cards e áreas de toque */
@media (min-width: 769px) {
    /* Garantir que o grid tenha espaçamento mínimo de 8px entre áreas de toque */
    .all-posts-grid {
        gap: calc(30px + 8px);
    }
    
    /* Garantir que cards tenham altura mínima adequada */
    .all-posts-grid .post-card {
        min-height: 48px;
    }
    
    /* Garantir que imagens tenham tamanho mínimo de toque */
    .all-posts-grid .post-thumbnail {
        min-height: 48px;
    }
    
    .all-posts-grid .post-thumbnail img {
        min-width: 48px;
        min-height: 48px;
    }
    
    /* Garantir que títulos tenham área de toque adequada */
    .all-posts-grid .post-title a {
        min-height: 48px;
        padding: 8px 0;
    }
    
    /* Garantir que badges tenham área de toque adequada (já tem, mas reforçar) */
    .all-posts-grid .post-category-badge {
        min-height: 48px;
        min-width: 48px;
        padding: 10px 16px;
        display: inline-flex;
        align-items: center;
        justify-content: center;
    }
}

.all-posts-grid .post-title a:hover {
    color: var(--primary-color);
}

.all-posts-grid .post-excerpt {
    color: #6b7280;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: auto;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.all-posts-grid .post-meta-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-top: 15px;
    margin-top: 15px;
    border-top: 1px solid #f0f0f0;
}

.all-posts-grid .post-author-meta {
    display: flex;
    align-items: center;
    gap: 10px;
}

.all-posts-grid .author-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid #f0f0f0;
}

.all-posts-grid .author-name {
    font-size: 0.85rem;
    font-weight: 600;
    color: var(--text-color);
}

.all-posts-grid .post-date-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #6b7280;
    font-size: 0.8rem;
}

.all-posts-grid .post-date-meta svg {
    width: 16px;
    height: 16px;
    stroke-width: 2;
}

/* ===============================================
   PAGINAÇÃO MODERNA
   =============================================== */

.all-posts-pagination {
    margin-top: 60px;
    padding: 30px 0;
    border-top: 2px solid rgba(0, 0, 0, 0.06);
}

.pagination-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin-bottom: 20px;
}

.pagination-arrow {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: var(--text-color);
    transition: all 0.3s ease;
    text-decoration: none;
}

.pagination-arrow:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    transform: scale(1.05);
}

.pagination-arrow svg {
    width: 20px;
    height: 20px;
    stroke-width: 2.5;
}

.pagination-numbers {
    display: flex;
    align-items: center;
    gap: 8px;
}

.page-number {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    color: var(--text-color);
    font-weight: 600;
    font-size: 0.9rem;
    transition: all 0.3s ease;
    text-decoration: none;
    cursor: pointer;
}

.page-number:hover {
    background: rgba(var(--primary-rgb), 0.1);
    border-color: var(--primary-color);
    color: var(--primary-color);
    transform: translateY(-2px);
}

.page-number.current {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #ffffff;
    cursor: default;
    box-shadow: 0 4px 15px rgba(var(--primary-rgb), 0.3);
}

.pagination-dots {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    color: var(--text-muted);
    font-weight: 700;
    font-size: 1.2rem;
    letter-spacing: 2px;
}

.pagination-info {
    text-align: center;
    color: var(--text-muted);
    font-size: 0.9rem;
    margin: 0;
}

/* Mensagem de nenhum post encontrado */
.no-posts-found {
    text-align: center;
    padding: 80px 20px;
    color: var(--text-muted);
}

.no-posts-found svg {
    width: 80px;
    height: 80px;
    color: rgba(0, 0, 0, 0.2);
    margin-bottom: 20px;
    stroke-width: 1.5;
}

.no-posts-found p {
    font-size: 1.1rem;
    margin: 0;
}

/* Sidebar específica */
.all-posts-sidebar {
    position: sticky;
    top: 100px;
    align-self: start;
}

.all-posts-sidebar .widget {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    margin-bottom: 25px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    border: 1px solid #f0f0f0;
}

.all-posts-sidebar .widget-title {
    font-size: 1.25rem;
    font-weight: 700;
    color: var(--text-color);
    margin: 0 0 20px 0;
    padding-bottom: 15px;
    border-bottom: 3px solid var(--primary-color);
}

/* ===============================================
   RESPONSIVIDADE
   =============================================== */

@media (max-width: 1200px) {
    .all-posts-container {
        grid-template-columns: 1fr 300px;
        gap: 30px;
    }
    
    .all-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 25px;
    }
}

@media (max-width: 992px) {
    .all-posts-container {
        grid-template-columns: 1fr;
    }
    
    .all-posts-sidebar {
        position: static;
        margin-top: 40px;
    }
    
    .all-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
    
    .all-posts-grid .post-thumbnail {
        height: 200px;
    }
}

@media (max-width: 768px) {
    .all-posts-container {
        padding: 30px 15px;
        gap: 30px;
    }
    
    .all-posts-header {
        padding: 40px 20px;
        margin-bottom: 30px;
        max-width: 100%;
    }
    
    .all-posts-title {
        font-size: 2rem;
    }
    
    .all-posts-subtitle,
    .archive-description {
        font-size: 1rem;
    }
    
    .page-title-icon {
        width: 60px;
        height: 60px;
    }
    
    .page-title-icon svg {
        width: 30px;
        height: 30px;
    }
    
    .all-posts-grid {
        grid-template-columns: 1fr;
        gap: 20px;
        margin-bottom: 40px;
    }
    
    .all-posts-grid .post-card {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.08);
    }
    
    .all-posts-grid .post-title {
        font-size: 1.15rem;
    }
    
    .all-posts-grid .post-content-wrapper {
        padding: 20px;
    }
    
    .pagination-wrapper {
        gap: 6px;
    }
    
    .pagination-arrow,
    .page-number {
        min-width: 36px;
        height: 36px;
        font-size: 0.85rem;
    }
    
    .pagination-dots {
        width: 30px;
        font-size: 1rem;
    }
}

@media (max-width: 480px) {
    .all-posts-container {
        padding: 20px 10px;
    }
    
    .all-posts-header {
        padding: 30px 15px;
        margin-bottom: 20px;
    }
    
    .all-posts-title {
        font-size: 1.6rem;
    }
    
    .all-posts-subtitle,
    .archive-description {
        font-size: 0.95rem;
        padding: 15px;
    }
    
    .all-posts-grid {
        grid-template-columns: 1fr;
    }
    
    .all-posts-grid .post-thumbnail {
        height: 200px;
    }
    
    .all-posts-grid .post-title {
        font-size: 1.1rem;
    }
    
    .all-posts-grid .post-content-wrapper {
        padding: 15px;
    }
    
    .all-posts-grid .post-meta-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 12px;
    }
    
    .pagination-numbers {
        gap: 4px;
    }
    
    .pagination-arrow,
    .page-number {
        min-width: 32px;
        height: 32px;
        font-size: 0.8rem;
    }
    
    .pagination-info {
        font-size: 0.85rem;
    }
}
