/* ============================================
   BLOG — JÚLIO CÉSAR
   Identidade visual alinhada ao site principal
   ============================================ */

/* ---- Blog Hero ---- */
.blog-hero {
    position: relative;
    padding: 160px 0 80px;
    background: var(--azul);
    overflow: hidden;
}

.blog-hero-grain {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    pointer-events: none;
}

.blog-hero-content {
    position: relative;
    z-index: 2;
    max-width: 700px;
}

.blog-hero-title {
    font-family: var(--font-title);
    font-size: clamp(36px, 5vw, 56px);
    font-weight: 400;
    color: var(--offwhite);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 20px;
}

.blog-hero-subtitle {
    font-size: 17px;
    color: rgba(231, 236, 239, 0.65);
    line-height: 1.7;
}

/* ---- Blog Layout ---- */
.blog-main {
    padding: 80px 0 120px;
    min-height: 60vh;
}

.blog-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 60px;
    align-items: start;
}

/* ---- Post Cards ---- */
.blog-posts {
    display: grid;
    gap: 32px;
}

.post-card {
    background: #fff;
    border-radius: var(--radius-md);
    overflow: hidden;
    border: 1px solid rgba(34, 34, 34, 0.06);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 16px 48px rgba(39, 76, 120, 0.1);
    border-color: rgba(39, 76, 120, 0.12);
}

.post-card-featured {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
}

.post-card-image {
    display: block;
    overflow: hidden;
    aspect-ratio: 16/10;
}

.post-card-featured .post-card-image {
    aspect-ratio: auto;
    min-height: 100%;
}

.post-card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.post-card:hover .post-card-image img {
    transform: scale(1.04);
}

.post-card-body {
    padding: 32px;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.post-card-featured .post-card-body {
    padding: 40px;
}

.post-card-category {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--azul);
    background: rgba(39, 76, 120, 0.08);
    padding: 4px 12px;
    border-radius: 20px;
    margin-bottom: 16px;
    width: fit-content;
    transition: all 0.3s;
}

.post-card-category:hover {
    background: var(--azul);
    color: var(--offwhite);
}

.post-card-title {
    font-family: var(--font-title);
    font-size: 26px;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 12px;
    letter-spacing: -0.01em;
    line-height: 1.3;
}

.post-card-featured .post-card-title {
    font-size: 32px;
}

.post-card-title a {
    color: inherit;
    transition: color 0.3s;
}

.post-card-title a:hover {
    color: var(--azul);
}

.post-card-excerpt {
    font-size: 15px;
    color: var(--dark);
    opacity: 0.65;
    line-height: 1.7;
    margin-bottom: 16px;
}

.post-card-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--dark);
    opacity: 0.45;
}

.meta-separator {
    opacity: 0.5;
}

/* ---- Blog Empty State ---- */
.blog-empty {
    text-align: center;
    padding: 100px 40px;
    background: #fff;
    border-radius: var(--radius-lg);
    border: 1px solid rgba(34, 34, 34, 0.06);
}

.blog-empty-icon {
    color: var(--sage);
    margin-bottom: 24px;
}

.blog-empty h2 {
    font-family: var(--font-title);
    font-size: 36px;
    font-weight: 400;
    color: var(--dark);
    margin-bottom: 12px;
}

.blog-empty p {
    font-size: 16px;
    color: var(--dark);
    opacity: 0.6;
    max-width: 460px;
    margin: 0 auto;
    line-height: 1.7;
}

/* ---- Sidebar ---- */
.blog-sidebar {
    position: sticky;
    top: 100px;
}

.sidebar-card {
    background: #fff;
    border-radius: var(--radius-md);
    padding: 28px;
    border: 1px solid rgba(34, 34, 34, 0.06);
    margin-bottom: 24px;
}

.sidebar-author {
    text-align: center;
}

.sidebar-author-photo {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    object-fit: cover;
    margin: 0 auto 16px;
    display: block;
    border: 3px solid rgba(39, 76, 120, 0.1);
}

.sidebar-author-name {
    font-family: var(--font-title);
    font-size: 22px;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 4px;
}

.sidebar-author-role {
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--sage);
    margin-bottom: 12px;
}

.sidebar-author-bio {
    font-size: 14px;
    color: var(--dark);
    opacity: 0.6;
    line-height: 1.6;
    margin-bottom: 16px;
}

.sidebar-author-links {
    display: flex;
    gap: 12px;
    justify-content: center;
}

.sidebar-author-links a {
    color: var(--azul);
    opacity: 0.7;
    transition: all 0.3s;
    padding: 8px;
    border-radius: 8px;
    background: rgba(39, 76, 120, 0.06);
}

.sidebar-author-links a:hover {
    opacity: 1;
    background: rgba(39, 76, 120, 0.12);
}

.sidebar-title {
    font-family: var(--font-title);
    font-size: 20px;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 16px;
}

.sidebar-categories {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.sidebar-category-link {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 14px;
    border-radius: 8px;
    font-size: 14px;
    color: var(--dark);
    opacity: 0.7;
    transition: all 0.3s;
}

.sidebar-category-link:hover,
.sidebar-category-link.active {
    background: rgba(39, 76, 120, 0.06);
    opacity: 1;
    color: var(--azul);
}

.sidebar-category-link span {
    font-size: 12px;
    font-weight: 600;
    background: rgba(39, 76, 120, 0.08);
    padding: 2px 8px;
    border-radius: 10px;
    color: var(--azul);
}

.sidebar-cta {
    background: var(--azul);
    border-color: transparent;
}

.sidebar-cta .sidebar-title {
    color: var(--offwhite);
}

.sidebar-cta p {
    font-size: 14px;
    color: rgba(231, 236, 239, 0.7);
    line-height: 1.6;
    margin-bottom: 20px;
}

.sidebar-btn {
    width: 100%;
    text-align: center;
    justify-content: center;
    padding: 14px 24px;
    font-size: 13px;
}

/* ---- Article Header ---- */
.article-header {
    position: relative;
    padding: 160px 0 60px;
    background: var(--azul);
    overflow: hidden;
}

.article-header-grain {
    position: absolute;
    inset: 0;
    opacity: 0.05;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
    background-repeat: repeat;
    background-size: 256px 256px;
    pointer-events: none;
}

/* Breadcrumb */
.breadcrumb {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 32px;
    position: relative;
    z-index: 2;
    flex-wrap: wrap;
}

.breadcrumb a {
    color: rgba(231, 236, 239, 0.6);
    transition: color 0.3s;
}

.breadcrumb a:hover {
    color: var(--offwhite);
}

.breadcrumb-sep {
    color: rgba(231, 236, 239, 0.3);
}

.breadcrumb-current {
    color: rgba(231, 236, 239, 0.5);
    max-width: 300px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.article-header-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.article-category {
    display: inline-block;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--sage-light);
    background: rgba(231, 236, 239, 0.1);
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 20px;
}

.article-title {
    font-family: var(--font-title);
    font-size: clamp(32px, 5vw, 52px);
    font-weight: 400;
    color: var(--offwhite);
    letter-spacing: -0.02em;
    line-height: 1.15;
    margin-bottom: 32px;
}

.article-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 20px;
}

.article-author {
    display: flex;
    align-items: center;
    gap: 14px;
}

.article-author-photo {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    border: 2px solid rgba(231, 236, 239, 0.2);
}

.article-author-name {
    font-weight: 600;
    color: var(--offwhite);
    font-size: 15px;
    display: block;
}

.article-author-role {
    font-size: 12px;
    color: rgba(231, 236, 239, 0.5);
    display: block;
}

.article-meta-info {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 14px;
    color: rgba(231, 236, 239, 0.5);
}

/* ---- Article Cover ---- */
.article-cover {
    margin-top: -40px;
    margin-bottom: 60px;
    position: relative;
    z-index: 3;
}

.article-cover-img {
    width: 100%;
    max-height: 480px;
    object-fit: cover;
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.15);
}

/* ---- Article Content ---- */
.article-main {
    padding: 40px 0 120px;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr 280px;
    gap: 60px;
    align-items: start;
}

.article-content {
    max-width: 720px;
    font-size: 17px;
    line-height: 1.85;
    color: var(--dark);
}

.article-content h2 {
    font-family: var(--font-title);
    font-size: 32px;
    font-weight: 500;
    color: var(--dark);
    margin: 56px 0 20px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.article-content h3 {
    font-family: var(--font-title);
    font-size: 24px;
    font-weight: 500;
    color: var(--dark);
    margin: 40px 0 16px;
    letter-spacing: -0.01em;
}

.article-content h4 {
    font-family: var(--font-body);
    font-size: 18px;
    font-weight: 600;
    color: var(--dark);
    margin: 32px 0 12px;
}

.article-content p {
    margin-bottom: 20px;
    opacity: 0.8;
}

.article-content ul,
.article-content ol {
    margin: 20px 0;
    padding-left: 24px;
}

.article-content li {
    margin-bottom: 10px;
    opacity: 0.8;
}

.article-content a {
    color: var(--azul);
    text-decoration: underline;
    text-decoration-color: rgba(39, 76, 120, 0.3);
    text-underline-offset: 3px;
    transition: all 0.3s;
}

.article-content a:hover {
    text-decoration-color: var(--azul);
}

.article-content blockquote {
    margin: 32px 0;
    padding: 24px 28px;
    border-left: 4px solid var(--azul);
    background: rgba(39, 76, 120, 0.04);
    border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
    font-family: var(--font-title);
    font-size: 20px;
    font-style: italic;
    color: var(--azul);
    line-height: 1.6;
}

.article-content pre {
    margin: 24px 0;
    padding: 24px;
    background: var(--dark);
    border-radius: var(--radius-sm);
    overflow-x: auto;
}

.article-content pre code {
    font-size: 14px;
    color: var(--offwhite);
    background: none;
    padding: 0;
    border-radius: 0;
}

.article-content code {
    font-size: 14px;
    background: rgba(39, 76, 120, 0.08);
    color: var(--azul);
    padding: 2px 8px;
    border-radius: 4px;
    font-family: 'Fira Code', 'Consolas', monospace;
}

.article-content figure {
    margin: 32px 0;
}

.article-content figure img {
    width: 100%;
    border-radius: var(--radius-sm);
}

.article-content figcaption {
    text-align: center;
    font-size: 13px;
    color: var(--dark);
    opacity: 0.5;
    margin-top: 10px;
}

.article-content hr {
    border: none;
    border-top: 1px solid rgba(34, 34, 34, 0.08);
    margin: 48px 0;
}

.article-content strong {
    font-weight: 600;
    opacity: 1;
}

/* ---- Table of Contents ---- */
.toc-card {
    position: sticky;
    top: 100px;
    background: #fff;
    border-radius: var(--radius-md);
    padding: 28px;
    border: 1px solid rgba(34, 34, 34, 0.06);
}

.toc-title {
    font-family: var(--font-title);
    font-size: 18px;
    font-weight: 500;
    color: var(--dark);
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(34, 34, 34, 0.06);
}

.toc-nav {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.toc-link {
    font-size: 13px;
    color: var(--dark);
    opacity: 0.6;
    padding: 8px 12px;
    border-radius: 6px;
    line-height: 1.4;
    transition: all 0.3s;
}

.toc-link:hover {
    opacity: 1;
    background: rgba(39, 76, 120, 0.05);
    color: var(--azul);
}

.toc-h3 {
    padding-left: 24px;
    font-size: 12px;
}

/* ---- Tags ---- */
.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.tag-item {
    font-size: 12px;
    font-weight: 500;
    padding: 4px 12px;
    border-radius: 20px;
    background: rgba(39, 76, 120, 0.06);
    color: var(--azul);
}

/* ---- Share Buttons ---- */
.share-buttons {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.share-btn {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 16px;
    border-radius: 8px;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s;
}

.share-linkedin {
    background: rgba(0, 119, 181, 0.08);
    color: #0077B5;
}

.share-linkedin:hover {
    background: rgba(0, 119, 181, 0.15);
}

.share-twitter {
    background: rgba(0, 0, 0, 0.05);
    color: var(--dark);
}

.share-twitter:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* ---- Reading Progress Bar ---- */
.reading-progress {
    position: fixed;
    top: 0;
    left: 0;
    height: 3px;
    background: linear-gradient(90deg, var(--azul), var(--sage));
    z-index: 9999;
    width: 0;
    transition: width 0.1s linear;
}

/* ---- Related Posts ---- */
.related-posts {
    padding: 80px 0;
    background: var(--offwhite);
    border-top: 1px solid rgba(34, 34, 34, 0.06);
}

.related-title {
    font-family: var(--font-title);
    font-size: 32px;
    font-weight: 400;
    color: var(--dark);
    margin-bottom: 40px;
    text-align: center;
}

.related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ---- Responsive Blog ---- */
@media (max-width: 1024px) {
    .blog-layout {
        grid-template-columns: 1fr 280px;
        gap: 40px;
    }

    .article-layout {
        grid-template-columns: 1fr 240px;
        gap: 40px;
    }
}

@media (max-width: 768px) {
    .blog-hero {
        padding: 140px 0 60px;
    }

    .blog-layout {
        grid-template-columns: 1fr;
    }

    .blog-sidebar {
        position: static;
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 16px;
    }

    .sidebar-author {
        grid-column: span 2;
    }

    .post-card-featured {
        grid-template-columns: 1fr;
    }

    .article-header {
        padding: 140px 0 40px;
    }

    .article-layout {
        grid-template-columns: 1fr;
    }

    .article-sidebar {
        display: none;
    }

    .related-grid {
        grid-template-columns: 1fr;
    }

    .article-meta {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 480px) {
    .blog-sidebar {
        grid-template-columns: 1fr;
    }

    .sidebar-author {
        grid-column: span 1;
    }

    .post-card-body {
        padding: 20px;
    }

    .post-card-title {
        font-size: 20px;
    }

    .article-content {
        font-size: 16px;
    }

    .article-content h2 {
        font-size: 26px;
    }
}
