/* ===== ESTILOS PARA PÁGINAS DE ARTIGOS ===== */

/* Layout principal do artigo */
.artigo-layout {
    display: grid;
    grid-template-columns: 2fr 1fr; /* Conteúdo principal 2/3, sidebar 1/3 */
    gap: 3rem;
    align-items: start;
    background: #fff; /* Fundo branco */
}

/* Conteúdo principal do artigo */
.artigo-content {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
}

/* Sidebar do artigo */
.artigo-sidebar {
    background: #fff;
    padding: 2rem;
    border-radius: 12px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.08);
    position: sticky;
    top: 2rem;
}

/* Breadcrumb */
.breadcrumb {
    margin-bottom: 2rem;
    padding: 1rem 0;
}

.breadcrumb ol {
    list-style: none;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin: 0;
    padding: 0;
}

.breadcrumb li {
    display: flex;
    align-items: center;
}

.breadcrumb li:not(:last-child)::after {
    content: '>';
    margin-left: 0.5rem;
    color: #666;
}

.breadcrumb a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.3s ease;
}

.breadcrumb a:hover {
    color: #0056b3;
}

.breadcrumb a[aria-current="page"] {
    color: #333;
    font-weight: 500;
}

/* Header do artigo */
.artigo-header {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 2px solid #f0f0f0;
}

.artigo-header h1 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 1rem;
    color: #333;
    line-height: 1.2;
}

.artigo-meta {
    display: flex;
    gap: 1.5rem;
    flex-wrap: wrap;
    color: #666;
    font-size: 0.9rem;
}

.artigo-meta span {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.artigo-meta i {
    color: #007bff;
}

/* Conteúdo do artigo */
.artigo-text {
    line-height: 1.7;
    color: #333;
}

.artigo-text h2 {
    font-size: clamp(1.5rem, 4vw, 2.2rem);
    margin: 2rem 0 1rem 0;
    color: #333;
    border-left: 4px solid #007bff;
    padding-left: 1rem;
}

.artigo-text h3 {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    margin: 1.5rem 0 1rem 0;
    color: #444;
}

.artigo-text p {
    margin-bottom: 1rem;
    text-align: justify;
}

.artigo-text ul, .artigo-text ol {
    margin: 1rem 0;
    padding-left: 2rem;
}

.artigo-text li {
    margin-bottom: 0.5rem;
}

.artigo-text code {
    background: #f8f9fa;
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

/* Imagem do artigo */
.artigo-image {
    margin: 2rem 0;
    text-align: center;
}

.artigo-image img {
    max-width: 100%;
    height: auto;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

/* Botões de partilha social */
.social-share,
.artigo-share,
.artigo-partilhar {
    margin: 3rem 0;
    padding: 2rem;
    background: #f8f9fa;
    border-radius: 12px;
    text-align: center;
}

.social-share h3 {
    margin-bottom: 1.5rem;
    color: #333;
}

.share-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
    align-items: center;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border: none;
    border-radius: 8px;
    color: white;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
}

.share-btn.facebook {
    background: #1877f2;
}

.share-btn.twitter {
    background: #1da1f2;
}

.share-btn.whatsapp {
    background: #25d366;
}

.share-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Navegação entre artigos */
.artigo-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin: 3rem 0;
}

.nav-btn {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 1.5rem;
    background: #f8f9fa;
    border-radius: 12px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.nav-btn:hover {
    background: #e9ecef;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.nav-btn.prev {
    text-align: left;
}

.nav-btn.next {
    text-align: right;
    flex-direction: row-reverse;
}

.nav-content span:first-child {
    font-size: 0.8rem;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.nav-title {
    font-weight: 500;
    color: #333;
}

/* Sidebar - Outros artigos */
.outros-artigos {
    background: #fff;
    padding: 1.5rem;
    border-radius: 12px;
    box-shadow: 0 2px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 2rem;
}

.outros-artigos h3 {
    margin-bottom: 1.5rem;
    color: #333;
    font-size: 1.3rem;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 0.5rem;
}

/* Estilos para artigos mini na sidebar */
.artigo-mini {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.artigo-mini:hover {
    background: #e9ecef;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.artigo-mini-image {
    margin-bottom: 0.5rem;
}

.artigo-mini-content h4 {
    margin: 0 0 0.5rem 0;
    color: #333;
    line-height: 1.3;
}

.artigo-mini-link {
    text-decoration: none;
    transition: all 0.3s ease;
}

.artigo-mini-link:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.artigos-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.artigo-card {
    display: flex;
    gap: 1rem;
    padding: 1rem;
    background: #f8f9fa;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
    border: 2px solid transparent;
}

.artigo-card:hover {
    background: #e9ecef;
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.2);
}

.artigo-card img {
    width: 80px;
    height: 60px;
    object-fit: cover;
    border-radius: 6px;
    flex-shrink: 0;
}

.artigo-info h4 {
    margin: 0 0 0.5rem 0;
    font-size: 0.9rem;
    color: #333;
    line-height: 1.3;
}

.artigo-info p {
    margin: 0;
    font-size: 0.8rem;
    color: #666;
    line-height: 1.4;
}

.artigo-data {
    font-size: 0.75rem;
    color: #999;
    font-style: italic;
}

/* Barra de progresso de leitura */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    width: 0%;
    height: 4px;
    background: linear-gradient(90deg, #007bff, #0056b3);
    z-index: 1000;
    transition: width 0.3s ease;
}

/* Botão voltar ao topo */
.back-to-top {
    position: fixed;
    bottom: 2rem;
    right: 2rem;
    width: 50px;
    height: 50px;
    background: #007bff;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(0, 123, 255, 0.3);
}

.back-to-top:hover {
    background: #0056b3;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(0, 123, 255, 0.4);
}

/* Botão imprimir */
.print-btn {
    position: fixed;
    bottom: 2rem;
    right: 6rem;
    width: 50px;
    height: 50px;
    background: #6c757d;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: all 0.3s ease;
    z-index: 1000;
    box-shadow: 0 4px 15px rgba(108, 117, 125, 0.3);
}

.print-btn:hover {
    background: #545b62;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(108, 117, 125, 0.4);
}

/* Animações */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.fade-in {
    animation: fadeIn 0.6s ease-in;
}

/* Responsividade */
@media (max-width: 768px) {
    .artigo-layout {
        grid-template-columns: 1fr; /* Coluna única em ecrãs menores */
        gap: 2rem;
        background: #fff;
    }
    
    .artigo-sidebar {
        position: static;
        order: 1; /* Sidebar aparece depois do conteúdo no mobile */
        background: #fff;
    }
    
    /* Garantir que o header funcione corretamente nos artigos */
    .header {
        z-index: 9999 !important;
        position: fixed !important;
    }
    
    .nav-toggle {
        z-index: 10002 !important;
        position: relative !important;
        pointer-events: auto !important;
    }
    
    .nav-menu {
        z-index: 10001 !important;
        position: absolute !important;
    }
}
    
    .artigo-content {
        background: #fff;
    }
    
    .artigo-navigation {
        grid-template-columns: 1fr;
    }
    
    .nav-btn.next {
        flex-direction: row;
    }

    /* Estilos específicos para mobile */
    .artigo-content, .artigo-sidebar {
        padding: 1.5rem;
    }
    
    .artigo-meta {
        flex-direction: column;
        gap: 1rem;
    }
    
    .share-buttons {
        flex-direction: column;
        align-items: center;
    }
    
    .share-btn {
        width: 100%;
        max-width: 200px;
        justify-content: center;
    }
    
    .back-to-top, .print-btn {
        bottom: 1rem;
        right: 1rem;
        width: 45px;
        height: 45px;
    }
    
    .print-btn {
        right: 5rem;
    }
}

@media (max-width: 480px) {
    .artigo-content, .artigo-sidebar {
        padding: 1rem;
    }
    
    .artigo-header h1 {
        font-size: 1.8rem;
    }
    
    .artigo-text h2 {
        font-size: 1.5rem;
    }
    
    .artigo-text h3 {
        font-size: 1.3rem;
    }
    
    .artigo-card {
        flex-direction: column;
        text-align: center;
    }
    
    .artigo-card img {
        width: 100%;
        height: 120px;
        object-fit: cover;
    }
}

/* Estilos para impressão */
@media print {
    .artigo-sidebar,
    .social-share,
    .artigo-navigation,
    .back-to-top,
    .print-btn,
    .reading-progress {
        display: none !important;
    }
    
    .artigo-layout {
        grid-template-columns: 1fr;
        gap: 0;
    }
    
    .artigo-content {
        box-shadow: none;
        border: 1px solid #ccc;
    }
    
    .artigo-header {
        border-bottom: 1px solid #ccc;
    }
}
