/**
 * Custom CSS for Direitos Porto Alegre Theme
 *
 * @package Direitos_Porto_Alegre
 */

/* Additional custom styles can be added here */

/* Smooth scrolling */
html {
    scroll-behavior: smooth;
}

/* Screen reader text utility */
.screen-reader-text {
    clip: rect(1px, 1px, 1px, 1px);
    position: absolute !important;
    height: 1px;
    width: 1px;
    overflow: hidden;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: hsl(var(--muted));
    border-radius: 3px;
    box-shadow: 0 0 2px 2px hsl(var(--ring) / 0.6);
    clip: auto !important;
    color: hsl(var(--accent));
    display: block;
    font-size: 0.875rem;
    font-weight: 700;
    height: auto;
    left: 5px;
    line-height: normal;
    padding: 15px 23px 14px;
    text-decoration: none;
    top: 5px;
    width: auto;
    z-index: 100000;
}

/* Accessibility improvements */
a:focus,
button:focus,
input:focus,
select:focus,
textarea:focus {
    outline: 2px solid hsl(var(--accent));
    outline-offset: 2px;
}

/* Animation utilities */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

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

/* Loading state */
.loading {
    opacity: 0.6;
    pointer-events: none;
}

/* Print styles */
@media print {
    .whatsapp-float,
    .hero-buttons,
    .btn {
        display: none !important;
    }
    
    body {
        font-size: 12pt;
        line-height: 1.5;
    }
    
    h1, h2, h3 {
        page-break-after: avoid;
    }
}

/* ==========================================================================
   Blog Archive & Single Post Styles - Dr. Enrico Rotter
   Design Focus: Acolhimento, Clareza e Autoridade (E-E-A-T)
   Target: 90% Mobile Users
   ========================================================================== */

/* CSS Variables for Blog Styling - Optimized using theme variables */
:root {
    /* Blog Colors - Using theme's existing color system */
    --blog-title-color: hsl(var(--professional));
    --blog-text-color: hsl(var(--foreground));
    --blog-meta-color: hsl(var(--muted-foreground));
    --blog-card-bg: hsl(var(--card));
    --blog-card-border: hsl(var(--border));
    --blog-card-shadow: var(--shadow-soft);
    --blog-card-shadow-hover: var(--shadow-medium);
    --blog-highlight-bg: hsl(var(--muted));
    --blog-accent-color: hsl(var(--accent));
    --blog-brand-color: hsl(var(--primary));
    
    /* Typography */
    --blog-font-stack: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --blog-body-font-size: 19px;
    --blog-body-line-height: 1.6;
    --blog-title-font-weight: 700;
    
    /* Layout */
    --blog-content-max-width: 700px;
    --blog-card-border-radius: 8px;
    --blog-spacing-mobile: 1.5rem;
}

/* ==========================================================================
   BLOG ARCHIVE (LISTING) PAGE
   Conceito: "Central de Ajuda" não "Feed de Notícias"
   ========================================================================== */

.blog-archive {
    padding: 3rem 0;
    background: var(--gradient-subtle);
}

/* Archive Header */
.archive-header {
    text-align: center;
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: 2px solid var(--blog-card-border);
}

.archive-title {
    color: var(--blog-title-color);
    font-size: 2rem;
    font-weight: var(--blog-title-font-weight);
    margin-bottom: 1rem;
    font-family: var(--blog-font-stack);
}

.archive-description {
    color: var(--blog-meta-color);
    font-size: 1.125rem;
    max-width: 700px;
    margin: 0 auto;
}

/* Blog Grid - Mobile First (1 coluna) */
.blog-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--blog-spacing-mobile);
    margin-bottom: 3rem;
}

/* Blog Cards - Conceito "Central de Ajuda" */
.blog-card {
    background: var(--blog-card-bg);
    border-radius: var(--blog-card-border-radius);
    box-shadow: var(--blog-card-shadow);
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    border: 1px solid var(--blog-card-border);
}

.blog-card:hover {
    box-shadow: var(--blog-card-shadow-hover);
    transform: translateY(-2px);
}

/* Card Thumbnail */
.blog-card-thumbnail {
    position: relative;
    overflow: hidden;
    height: 220px;
}

.blog-card-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

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

.blog-card-thumbnail a {
    display: block;
    width: 100%;
    height: 100%;
}

/* Card Content */
.blog-card-content {
    padding: 1.5rem;
}

/* Card Title */
.blog-card-title {
    margin: 0 0 1rem;
    font-size: 1.375rem;
    line-height: 1.3;
}

.blog-card-title a {
    color: var(--blog-title-color);
    text-decoration: none;
    font-weight: var(--blog-title-font-weight);
    transition: color 0.2s ease;
    font-family: var(--blog-font-stack);
}

.blog-card-title a:hover {
    color: var(--blog-accent-color);
}

/* Meta Badges (Categoria e Tempo de Leitura) */
.blog-card-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin-bottom: 1rem;
}

.meta-badge {
    display: inline-flex;
    align-items: center;
    padding: 0.375rem 0.75rem;
    font-size: 0.8125rem;
    font-weight: 600;
    border-radius: 4px;
    background: var(--blog-highlight-bg);
    color: var(--blog-title-color);
    text-transform: uppercase;
    letter-spacing: 0.025em;
}

.meta-category {
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
}

.meta-reading-time {
    background: var(--blog-highlight-bg);
    color: var(--blog-meta-color);
}

/* Card Excerpt */
.blog-card-excerpt {
    color: var(--blog-text-color);
    font-size: 1rem;
    line-height: 1.6;
    margin-bottom: 1.25rem;
}

.blog-card-excerpt p {
    margin: 0;
}

/* Card Link */
.blog-card-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--blog-accent-color);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.2s ease;
    font-size: 0.9375rem;
}

.blog-card-link:hover {
    gap: 0.75rem;
    color: var(--blog-title-color);
}

.blog-card-link svg {
    transition: transform 0.2s ease;
}

.blog-card-link:hover svg {
    transform: translateX(4px);
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 3rem;
    flex-wrap: wrap;
}

.pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 44px;
    height: 44px;
    padding: 0 1rem;
    border: 1px solid var(--blog-card-border);
    border-radius: 6px;
    color: var(--blog-title-color);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.2s ease;
}

.pagination .page-numbers:hover,
.pagination .page-numbers.current {
    background: var(--blog-title-color);
    color: hsl(var(--primary-foreground));
    border-color: var(--blog-title-color);
}

/* No Posts Message */
.no-posts {
    text-align: center;
    padding: 3rem 1rem;
    color: var(--blog-meta-color);
    font-size: 1.125rem;
}

/* ==========================================================================
   SINGLE POST PAGE
   Foco: Leitura confortável, autoridade e clareza
   ========================================================================== */

.single-post {
    padding: 2rem 0 4rem;
    background: hsl(var(--background));
}

/* Single Post Wrapper - Largura limitada para melhor leitura */
.single-post-wrapper {
    max-width: var(--blog-content-max-width);
    margin: 0 auto;
}

/* Post Thumbnail */
.single-post .post-thumbnail {
    margin-bottom: 2rem;
    border-radius: var(--blog-card-border-radius);
    overflow: hidden;
    box-shadow: var(--blog-card-shadow);
}

.single-post .post-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
}

/* Entry Header */
.single-post .entry-header {
    margin-bottom: 2rem;
}

.single-post .entry-title {
    color: var(--blog-title-color);
    font-size: 2rem;
    font-weight: var(--blog-title-font-weight);
    line-height: 1.2;
    margin-bottom: 1rem;
    font-family: var(--blog-font-stack);
}

.single-post .entry-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    color: var(--blog-meta-color);
    font-size: 0.9375rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--blog-card-border);
}

.single-post .entry-meta span {
    display: flex;
    align-items: center;
    gap: 0.25rem;
}

/* Entry Content - Tipografia otimizada */
.single-post .entry-content {
    color: var(--blog-text-color);
    font-size: var(--blog-body-font-size);
    line-height: var(--blog-body-line-height);
    margin-bottom: 3rem;
}

.single-post .entry-content p {
    margin-bottom: 1.5rem;
}

.single-post .entry-content h2 {
    color: var(--blog-title-color);
    font-size: 1.625rem;
    font-weight: var(--blog-title-font-weight);
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    line-height: 1.3;
}

.single-post .entry-content h3 {
    color: var(--blog-title-color);
    font-size: 1.375rem;
    font-weight: var(--blog-title-font-weight);
    margin-top: 2rem;
    margin-bottom: 0.875rem;
    line-height: 1.3;
}

.single-post .entry-content h4 {
    color: var(--blog-title-color);
    font-size: 1.125rem;
    font-weight: 600;
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
}

.single-post .entry-content a {
    color: var(--blog-accent-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}

.single-post .entry-content a:hover {
    color: var(--blog-title-color);
}

.single-post .entry-content ul,
.single-post .entry-content ol {
    margin-bottom: 1.5rem;
    padding-left: 1.5rem;
}

.single-post .entry-content li {
    margin-bottom: 0.5rem;
}

.single-post .entry-content blockquote {
    margin: 2rem 0;
    padding: 1.5rem;
    border-left: 4px solid var(--blog-brand-color);
    background: var(--blog-highlight-bg);
    border-radius: 0 var(--blog-card-border-radius) var(--blog-card-border-radius) 0;
    font-style: italic;
    color: var(--blog-text-color);
}

/* Box "Resumo Rápido" - Para uso no início dos posts */
.resumo-destaque {
    background: var(--blog-highlight-bg);
    border-left: 4px solid var(--blog-brand-color);
    border-radius: 0 var(--blog-card-border-radius) var(--blog-card-border-radius) 0;
    padding: 1.5rem;
    margin: 2rem 0;
    box-shadow: var(--blog-card-shadow);
}

.resumo-destaque h3,
.resumo-destaque h4 {
    color: var(--blog-brand-color);
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.125rem;
}

.resumo-destaque p:last-child {
    margin-bottom: 0;
}

.resumo-destaque ul {
    margin-bottom: 0;
}

/* Author Box - Box de Autoridade (Fim do Post) */
.author-box {
    display: flex;
    gap: 1.5rem;
    padding: 2rem;
    margin-top: 3rem;
    background: var(--gradient-subtle);
    border: 2px solid var(--blog-card-border);
    border-radius: var(--blog-card-border-radius);
    box-shadow: var(--blog-card-shadow);
}

.author-box-avatar {
    flex-shrink: 0;
}

.author-box-avatar img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    border: 4px solid var(--blog-card-bg);
    box-shadow: var(--shadow-soft);
}

.author-box-content {
    flex: 1;
}

.author-box-label {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    margin-bottom: 0.75rem;
    background: hsl(var(--accent));
    color: hsl(var(--accent-foreground));
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: 4px;
}

.author-box-name {
    color: var(--blog-title-color);
    font-size: 1.5rem;
    font-weight: var(--blog-title-font-weight);
    margin: 0 0 0.25rem;
}

.author-box-oab {
    color: var(--blog-accent-color);
    font-weight: 600;
    margin: 0 0 1rem;
    font-size: 1rem;
}

.author-box-bio {
    color: var(--blog-text-color);
    line-height: 1.6;
    margin: 0;
}

/* Entry Footer (Tags) */
.single-post .entry-footer {
    margin-top: 2rem;
    padding-top: 2rem;
    border-top: 1px solid var(--blog-card-border);
}

.single-post .tags-links {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.single-post .tags-links a {
    display: inline-block;
    padding: 0.375rem 0.875rem;
    background: var(--blog-highlight-bg);
    color: var(--blog-title-color);
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.single-post .tags-links a:hover {
    background: var(--blog-title-color);
    color: hsl(var(--primary-foreground));
}

/* Post Navigation */
.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
    margin-top: 3rem;
    padding-top: 3rem;
    border-top: 2px solid var(--blog-card-border);
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    padding: 1.5rem;
    background: var(--blog-card-bg);
    border: 1px solid var(--blog-card-border);
    border-radius: var(--blog-card-border-radius);
    transition: all 0.2s ease;
}

.post-navigation .nav-previous:hover,
.post-navigation .nav-next:hover {
    box-shadow: var(--blog-card-shadow-hover);
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.875rem;
    color: var(--blog-meta-color);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    font-weight: 600;
    letter-spacing: 0.025em;
}

.post-navigation .nav-title {
    display: block;
    color: var(--blog-title-color);
    font-weight: 600;
    line-height: 1.3;
}

/* ==========================================================================
   RESPONSIVE - TABLETS AND DESKTOP
   ========================================================================== */

/* Tablets (768px+) */
@media (min-width: 768px) {
    /* Archive Page - 2 colunas */
    .blog-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    
    .archive-title {
        font-size: 2.5rem;
    }
    
    .blog-card-title {
        font-size: 1.5rem;
    }
    
    /* Single Post */
    .single-post {
        padding: 3rem 0 5rem;
    }
    
    .single-post .entry-title {
        font-size: 2.5rem;
    }
    
    /* Author box side by side */
    .author-box {
        flex-direction: row;
    }
}

/* Desktop (1024px+) */
@media (min-width: 1024px) {
    /* Archive Page - 3 colunas em telas maiores se desejado, ou manter 2 */
    /* Mantenha 2 colunas para melhor legibilidade */
    
    .blog-card-thumbnail {
        height: 240px;
    }
    
    /* Single Post - container mais confortável */
    .single-post-wrapper {
        padding: 0 2rem;
    }
}

/* Mobile específico (até 767px) */
@media (max-width: 767px) {
    .blog-archive {
        padding: 2rem 0;
    }
    
    .archive-header {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }
    
    .archive-title {
        font-size: 1.75rem;
    }
    
    .blog-card-content {
        padding: 1.25rem;
    }
    
    .single-post .entry-title {
        font-size: 1.75rem;
    }
    
    .single-post .entry-content {
        font-size: 18px;
    }
    
    /* Author box empilhado no mobile */
    .author-box {
        flex-direction: column;
        text-align: center;
        padding: 1.5rem;
        gap: 1rem;
    }
    
    .author-box-avatar {
        margin: 0 auto;
    }
    
    /* Post Navigation - uma coluna no mobile */
    .post-navigation {
        grid-template-columns: 1fr;
    }
}
