/* ==========================================================================
   BASTIDORES DO CÓDIGO — ESTILOS DO BLOG E ARTIGOS
   ========================================================================== */

/* Blog Layout Containers */
.blog-hero {
    padding-top: 160px;
    padding-bottom: 60px;
    text-align: center;
    position: relative;
    z-index: 10;
}

.blog-hero h1 {
    font-size: clamp(2rem, 6vw, 3.5rem);
    margin-top: 1rem;
    margin-bottom: 1.5rem;
    line-height: 1.15;
}

.blog-hero p {
    color: var(--color-text-muted);
    font-size: clamp(1rem, 3vw, 1.2rem);
    max-width: 700px;
    margin: 0 auto;
    line-height: 1.6;
}

/* Article Grid Section */
.blog-section {
    padding-bottom: 100px;
    position: relative;
    z-index: 10;
}

.article-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr));
    gap: 2rem;
    margin-top: 3rem;
}

/* Glassmorphic Article Cards */
.article-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: 2rem;
    border-radius: 20px;
    background: rgba(13, 17, 26, 0.4);
    border: 1px solid var(--color-border);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.article-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.05) 0%, rgba(168, 85, 247, 0.05) 100%);
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
    z-index: 0;
}

.article-card:hover {
    transform: translateY(-6px);
    border-color: rgba(59, 130, 246, 0.3);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.15);
}

.article-card:hover::before {
    opacity: 1;
}

.article-meta {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    font-size: 0.75rem;
    color: var(--color-text-muted);
    margin-bottom: 1rem;
    position: relative;
    z-index: 1;
}

.article-category {
    background: rgba(59, 130, 246, 0.12);
    color: var(--color-primary);
    padding: 0.25rem 0.75rem;
    border-radius: 50px;
    font-weight: 600;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.article-category.tech {
    background: rgba(168, 85, 247, 0.12);
    color: var(--color-secondary);
}

.article-card h3 {
    font-size: 1.35rem;
    line-height: 1.3;
    margin-bottom: 1rem;
    color: var(--color-text-white);
    position: relative;
    z-index: 1;
}

.article-card p {
    color: var(--color-text-muted);
    font-size: 0.925rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    flex-grow: 1;
    position: relative;
    z-index: 1;
}

.article-link {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-primary);
    font-weight: 600;
    font-size: 0.875rem;
    position: relative;
    z-index: 1;
    transition: gap 0.3s ease;
}

.article-card:hover .article-link {
    color: var(--color-text-white);
    gap: 0.75rem;
}

/* ==========================================================================
   ARTICLE PAGE TYPOGRAPHY & LAYOUT (READING VIEW)
   ========================================================================== */
.post-header {
    padding-top: 160px;
    padding-bottom: 50px;
    position: relative;
    z-index: 10;
    max-width: 800px;
    margin: 0 auto;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
}

.post-back-btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--color-text-muted);
    font-weight: 500;
    font-size: 0.875rem;
    margin-bottom: 2rem;
    transition: all 0.3s ease;
}

.post-back-btn:hover {
    color: var(--color-text-white);
    transform: translateX(-3px);
}

.post-meta-details {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 1rem;
    font-size: 0.875rem;
    color: var(--color-text-muted);
    margin-bottom: 1.5rem;
}

.post-header h1 {
    font-size: clamp(2rem, 5vw, 3.25rem);
    line-height: 1.2;
    color: var(--color-text-white);
    margin-bottom: 1.5rem;
}

.post-container {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
    z-index: 10;
    padding-left: 1.5rem;
    padding-right: 1.5rem;
    padding-bottom: 100px;
}

.post-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: #cbd5e1; /* slate-300 for premium text readability */
}

.post-content p {
    margin-bottom: 1.75rem;
}

.post-content h2 {
    font-size: 1.75rem;
    color: var(--color-text-white);
    margin-top: 2.5rem;
    margin-bottom: 1.25rem;
    position: relative;
}

.post-content h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 40px;
    height: 3px;
    background: var(--color-primary);
    border-radius: 2px;
}

.post-content h3 {
    font-size: 1.35rem;
    color: var(--color-text-white);
    margin-top: 2rem;
    margin-bottom: 1rem;
}

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

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

.post-content strong {
    color: var(--color-text-white);
}

/* Callouts / Highlights */
.post-callout {
    padding: 1.5rem;
    border-radius: 12px;
    background: rgba(59, 130, 246, 0.05);
    border-left: 4px solid var(--color-primary);
    margin: 2rem 0;
}

.post-callout p {
    margin-bottom: 0;
    font-size: 1rem;
    color: #e2e8f0;
}

.post-callout.warning {
    background: rgba(168, 85, 247, 0.05);
    border-left-color: var(--color-secondary);
}

/* Fenced Code Blocks & Copy Action */
.code-block-wrapper {
    position: relative;
    margin: 2rem 0;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-border);
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: rgba(15, 23, 42, 0.6);
    padding: 0.6rem 1.25rem;
    font-family: var(--font-sans);
    font-size: 0.8rem;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
}

.btn-copy-code {
    background: transparent;
    border: none;
    color: var(--color-text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-copy-code:hover {
    color: var(--color-text-white);
}

.post-content pre {
    margin: 0;
    padding: 1.5rem;
    background: #090d16;
    overflow-x: auto;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9rem;
}

.post-content code {
    background: rgba(255, 255, 255, 0.05);
    padding: 0.2rem 0.4rem;
    border-radius: 4px;
    font-family: 'Consolas', 'Courier New', monospace;
    font-size: 0.9em;
    color: #f472b6; /* Pink accent color for inline code definitions */
}

.post-content pre code {
    background: transparent;
    padding: 0;
    border-radius: 0;
    color: #e2e8f0;
}

/* Post Article Bottom CTA Box */
.post-cta-box {
    margin-top: 4rem;
    padding: 3rem;
    border-radius: 20px;
    background: linear-gradient(135deg, rgba(13, 17, 26, 0.6) 0%, rgba(7, 9, 14, 0.9) 100%);
    border: 1px solid var(--color-border);
    text-align: center;
    position: relative;
    overflow: hidden;
}

.post-cta-box h3 {
    font-size: 1.75rem;
    margin-bottom: 1rem;
    background: linear-gradient(135deg, #60A5FA 0%, #C084FC 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.post-cta-box p {
    color: var(--color-text-muted);
    margin-bottom: 2rem;
    max-width: 550px;
    margin-left: auto;
    margin-right: auto;
}

/* ==========================================================================
   LIGHT MODE STYLING OVERRIDES
   ========================================================================== */
body.light-theme .blog-hero h1 {
    color: #0f172a;
}

body.light-theme .article-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .article-card h3 {
    color: #0f172a;
}

body.light-theme .article-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.08);
}

body.light-theme .post-header h1,
body.light-theme .post-content h2,
body.light-theme .post-content h3,
body.light-theme .post-content strong {
    color: #0f172a;
}

body.light-theme .post-content {
    color: #334155; /* slate-700 */
}

/* Table Styles */
.post-table-wrapper {
    overflow-x: auto;
    margin: 2rem 0;
    border: 1px solid var(--color-border);
    border-radius: 12px;
    background: rgba(13, 17, 26, 0.4);
    backdrop-filter: blur(8px);
}

.post-table {
    width: 100%;
    border-collapse: collapse;
    text-align: left;
    font-size: 0.95rem;
}

.post-table th,
.post-table td {
    padding: 1rem;
}

.post-table thead tr {
    border-bottom: 2px solid var(--color-border);
    background: rgba(15, 23, 42, 0.6);
    color: var(--color-text-white);
}

.post-table tbody tr {
    border-bottom: 1px solid var(--color-border);
}

.post-table tbody tr:last-child {
    border-bottom: none;
}

.post-table td.criterion {
    font-weight: bold;
    color: var(--color-text-white);
}

.post-table td.wp {
    color: var(--color-text-muted);
}

.post-table td.static {
    font-weight: 600;
    color: #10b981;
}

/* ==========================================================================
   LIGHT MODE STYLING OVERRIDES
   ========================================================================== */
body.light-theme .blog-hero h1 {
    color: #0f172a;
}

body.light-theme .article-card {
    background: rgba(255, 255, 255, 0.85);
    border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .article-card h3 {
    color: #0f172a;
}

body.light-theme .article-card:hover {
    border-color: rgba(59, 130, 246, 0.4);
    box-shadow: 0 12px 30px rgba(59, 130, 246, 0.08);
}

body.light-theme .post-header h1,
body.light-theme .post-content h2,
body.light-theme .post-content h3,
body.light-theme .post-content strong {
    color: #0f172a;
}

body.light-theme .post-content {
    color: #334155; /* slate-700 */
}

body.light-theme .post-callout {
    background: rgba(59, 130, 246, 0.04);
}

body.light-theme .post-callout p {
    color: #334155;
}

body.light-theme .post-callout.warning {
    background: rgba(168, 85, 247, 0.04);
}

body.light-theme .code-block-wrapper {
    border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .code-header {
    background: rgba(241, 245, 249, 0.9);
    border-bottom-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .post-content pre {
    background: #f8fafc;
}

body.light-theme .post-content pre code {
    color: #1e293b;
}

body.light-theme .post-content code {
    background: rgba(15, 23, 42, 0.05);
    color: #db2777;
}

body.light-theme .post-cta-box {
    background: rgba(255, 255, 255, 0.9);
    border-color: rgba(15, 23, 42, 0.08);
}

body.light-theme .post-table-wrapper {
    background: rgba(255, 255, 255, 0.85);
}

body.light-theme .post-table thead tr {
    background: rgba(241, 245, 249, 0.95);
    color: #0f172a;
}

/* ==========================================================================
   RESPONSIVENESS / MEDIA QUERIES
   ========================================================================== */
@media (max-width: 768px) {
    .blog-hero {
        padding-top: 120px;
        padding-bottom: 40px;
    }
    .blog-hero h1 {
        font-size: clamp(1.8rem, 8vw, 2.5rem) !important;
    }
    .post-header {
        padding-top: 120px;
        padding-bottom: 30px;
    }
    .post-header h1 {
        font-size: clamp(1.6rem, 7vw, 2.25rem) !important;
    }
    .post-content h2 {
        font-size: clamp(1.35rem, 6vw, 1.6rem) !important;
        margin-top: 2rem !important;
    }
    .post-content h3 {
        font-size: clamp(1.15rem, 5vw, 1.3rem) !important;
        margin-top: 1.75rem !important;
    }
    .post-cta-box {
        padding: 2rem 1.5rem !important;
        margin-top: 3rem !important;
    }
    .article-card {
        padding: 1.5rem !important;
    }
    .post-table th,
    .post-table td {
        padding: 0.75rem 0.5rem !important;
        font-size: 0.85rem !important;
    }
}

/* ==========================================================================
   MOBILE ACTIVE MENU DRAWER STYLING
   ========================================================================== */
@media (max-width: 1100px) {
    header .nav-links {
        display: none !important;
    }
    header .nav-links.mobile-active {
        display: flex !important;
        flex-direction: column !important;
        position: fixed !important;
        left: 0 !important;
        right: 0 !important;
        top: 68px !important;
        background: linear-gradient(135deg, rgba(11, 14, 20, 0.95), rgba(7, 9, 14, 0.98)) !important;
        backdrop-filter: blur(20px) !important;
        -webkit-backdrop-filter: blur(20px) !important;
        padding: 2rem 1.5rem !important;
        gap: 1.25rem !important;
        border-bottom: 2px solid rgba(59, 130, 246, 0.25) !important;
        box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
        z-index: 99 !important;
        margin: 0 !important;
    }

    header .nav-links.mobile-active li {
        width: 100% !important;
        border-bottom: 1px solid rgba(255, 255, 255, 0.03) !important;
        padding-bottom: 0.75rem !important;
        margin: 0 !important;
    }
    header .nav-links.mobile-active li:last-child {
        border-bottom: none !important;
        padding-bottom: 0 !important;
    }
    
    header .nav-links.mobile-active li a {
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        width: 100% !important;
        transition: all 0.3s ease !important;
    }
    header .nav-links.mobile-active li a::after {
        content: '\f105' !important;
        font-family: 'Font Awesome 6 Free' !important;
        font-weight: 900 !important;
        font-size: 0.8rem !important;
        color: rgba(59, 130, 246, 0.5) !important;
        transition: transform 0.3s ease !important;
    }
    header .nav-links.mobile-active li a:hover {
        color: #3B82F6 !important;
        padding-left: 4px !important;
    }
    header .nav-links.mobile-active li a:hover::after {
        transform: translateX(4px) !important;
        color: #3B82F6 !important;
    }

    /* Light Theme overrides */
    body.light-theme header .nav-links.mobile-active {
        background: linear-gradient(135deg, rgba(248, 250, 252, 0.94), rgba(241, 245, 249, 0.98)) !important;
        border-bottom: 2px solid rgba(59, 130, 246, 0.35) !important;
        box-shadow: 0 20px 40px rgba(15, 23, 42, 0.06) !important;
    }
    /* Light Theme overrides */
    body.light-theme header .nav-links.mobile-active li {
        border-bottom: 1px solid rgba(15, 23, 42, 0.04) !important;
    }
    body.light-theme header .nav-links.mobile-active li a {
        color: #334155 !important;
    }
    body.light-theme header .nav-links.mobile-active li a:hover {
        color: #3B82F6 !important;
    }
}

/* ==========================================================================
   ESTÁCIO SIDEBAR AD BANNER
   ========================================================================== */
.estacio-ad-banner {
    position: fixed !important;
    right: 1.5rem !important;
    z-index: 9999 !important;
    max-width: 280px !important;
    width: calc(100% - 3rem) !important;
    bottom: auto !important;
    top: 50% !important;
    transform: translateY(-50%) translateX(340px) !important;
    opacity: 0 !important;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.6s ease !important;
    pointer-events: none;
}

.estacio-ad-banner.show-ad {
    transform: translateY(-50%) translateX(0) !important;
    opacity: 1 !important;
    pointer-events: auto;
}

.estacio-ad-card {
    background: rgba(11, 14, 20, 0.96) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    padding: 1.25rem !important;
    border-radius: 16px !important;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5) !important;
    position: relative !important;
    backdrop-filter: blur(16px) !important;
    -webkit-backdrop-filter: blur(16px) !important;
    font-family: 'Outfit', sans-serif !important;
}

.estacio-ad-close {
    position: absolute !important;
    top: 0.75rem !important;
    right: 0.75rem !important;
    background: none !important;
    border: none !important;
    color: #94a3b8 !important;
    cursor: pointer !important;
    font-size: 0.875rem !important;
    transition: color 0.3s ease !important;
    padding: 0 !important;
}

.estacio-ad-close:hover {
    color: #ffffff !important;
}

.estacio-ad-content {
    display: flex !important;
    flex-direction: column !important;
    align-items: center !important;
    text-align: center !important;
}

.estacio-ad-icon {
    width: 48px !important;
    height: 48px !important;
    border-radius: 12px !important;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.2), rgba(168, 85, 247, 0.2)) !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    color: #3b82f6 !important;
    font-size: 1.25rem !important;
    margin-bottom: 0.75rem !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.2) !important;
}

.estacio-ad-badge {
    font-size: 0.7rem !important;
    font-weight: 600 !important;
    text-transform: uppercase !important;
    letter-spacing: 0.1em !important;
    color: #60a5fa !important;
    margin-bottom: 0.25rem !important;
}

.estacio-ad-title {
    font-size: 0.875rem !important;
    font-weight: 700 !important;
    color: #ffffff !important;
    margin-top: 0 !important;
    margin-bottom: 0.5rem !important;
    line-height: 1.25 !important;
}

.estacio-ad-text {
    font-size: 0.75rem !important;
    color: #94a3b8 !important;
    margin-top: 0 !important;
    margin-bottom: 1rem !important;
    line-height: 1.4 !important;
}

.estacio-ad-button {
    width: auto !important;
    text-align: center !important;
    padding: 0.65rem 1.5rem !important;
    border-radius: 10px !important;
    color: #ffffff !important;
    font-size: 0.75rem !important;
    font-weight: 700 !important;
    text-decoration: none !important;
    background: linear-gradient(135deg, #3b82f6, #a855f7) !important;
    box-shadow: 0 4px 15px rgba(59, 130, 246, 0.3) !important;
    transition: all 0.3s ease !important;
    display: inline-block !important;
}

.estacio-ad-button:hover {
    transform: translateY(-1px) !important;
    box-shadow: 0 6px 20px rgba(59, 130, 246, 0.4) !important;
}

.estacio-ad-button i {
    margin-left: 0.25rem !important;
}

/* On mobile viewports */
@media (max-width: 640px) {
    .estacio-ad-banner {
        right: 1rem !important;
        left: 1rem !important;
        width: calc(100% - 2rem) !important;
        max-width: none !important;
        bottom: 24px !important;
        top: auto !important;
        transform: translateY(200px) !important;
        opacity: 0 !important;
    }
    
    .estacio-ad-banner.show-ad {
        transform: translateY(0) !important;
        opacity: 1 !important;
    }
}

/* ==========================================================================
   LIGHT THEME OVERRIDES FOR ESTÁCIO BANNER
   ========================================================================== */
body.light-theme .estacio-ad-card {
    background: rgba(255, 255, 255, 0.98) !important;
    border: 1px solid rgba(59, 130, 246, 0.25) !important;
    box-shadow: 0 20px 40px rgba(15, 23, 42, 0.08), 0 0 20px rgba(59, 130, 246, 0.05) !important;
}

body.light-theme .estacio-ad-close {
    color: #64748b !important;
}

body.light-theme .estacio-ad-close:hover {
    color: #0f172a !important;
}

body.light-theme .estacio-ad-icon {
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.1), rgba(168, 85, 247, 0.1)) !important;
    color: #2563eb !important;
    box-shadow: 0 0 15px rgba(59, 130, 246, 0.1) !important;
}

body.light-theme .estacio-ad-badge {
    color: #2563eb !important;
}

body.light-theme .estacio-ad-title {
    color: #0f172a !important;
}

body.light-theme .estacio-ad-text {
    color: #475569 !important;
}
