/* ============================================
   Alerson Blog — CSS
   Paleta: #be1616 (red) / #000 (black) / #fff (white)
   ============================================ */

:root {
    --red:         #be1616;
    --black:       #000;
    --white:       #fff;
    --bg:          #fafafa;
    --text:        #111;
    --text-muted:  #666;
    --text-light:  #999;
    --border:      #e8e8e8;
    --font-display: 'Epilogue', sans-serif;
    --font-body:    'Sora', sans-serif;
    --font-mono:    'JetBrains Mono', monospace;
    --content-w:   740px;
    --wide-w:      1140px;
    --ease-out:    cubic-bezier(0.16, 1, 0.3, 1);
}

/* ─── Reset base ──────────────────────────────── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; }
body {
    font-family: var(--font-body);
    background: var(--bg);
    color: var(--text);
    line-height: 1.6;
}
img { display: block; max-width: 100%; height: auto; }

/* --- Skip to content (a11y) --- */
.skip-to-content:focus { top: 0 !important; outline: 2px solid #fff; outline-offset: 2px; }
a { color: inherit; }

/* ─── Progress bar ────────────────────────────── */
#blog-progress-bar {
    position: fixed;
    top: 0;
    left: 0;
    z-index: 200;
    height: 3px;
    width: 0%;
    background: var(--red);
    transition: width 0.1s linear;
    pointer-events: none;
}

/* ─── Header ──────────────────────────────────── */
.blog-header {
    background: #000;
    position: sticky;
    top: 0;
    z-index: 100;
    border-bottom: 1px solid rgba(255,255,255,0.08);
}
.blog-header-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
    height: 64px;
    display: flex;
    align-items: center;
    gap: 32px;
}

/* Logo — hierarquia nivel 1 */
.blog-logo {
    display: flex;
    align-items: baseline;
    gap: 2px;
    text-decoration: none;
    flex-shrink: 0;
}
.blog-logo:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 4px;
    border-radius: 2px;
}
.blog-logo-name {
    font-family: var(--font-display);
    font-size: 1.25rem;
    font-weight: 900;
    color: #fff;
    letter-spacing: -0.01em;
}
.blog-logo-dot {
    font-family: var(--font-display);
    font-size: 1.35rem;
    color: var(--red);
    font-weight: 900;
}
.blog-logo-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--red);
    margin-left: 6px;
    opacity: 0.85;
}

/* Nav — hierarquia nivel 2 */
.blog-nav {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1;
}
.blog-nav-link {
    position: relative;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: rgba(255,255,255,0.6);
    text-decoration: none;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.blog-nav-link:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}
.blog-nav-link.active {
    color: #fff;
    background: rgba(255,255,255,0.08);
}
.blog-nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: 14px;
    right: 14px;
    height: 2px;
    background: var(--red);
    border-radius: 1px;
}
.blog-nav-link:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
    border-radius: 6px;
}

/* Actions container */
.blog-header-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-left: auto;
}

/* Portfolio link — hierarquia nivel 4 */
.blog-portfolio-link {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    color: rgba(255,255,255,0.55);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border: 1px solid rgba(255,255,255,0.15);
    padding: 6px 14px;
    border-radius: 6px;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
    white-space: nowrap;
}
.blog-portfolio-link:hover {
    color: #fff;
    border-color: rgba(255,255,255,0.3);
    background: rgba(255,255,255,0.04);
}
.blog-portfolio-link:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

/* Hamburger */
.blog-menu-btn {
    display: none;
    flex-direction: column;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 6px;
    border-radius: 4px;
    transition: background 0.2s;
}
.blog-menu-btn:hover {
    background: rgba(255,255,255,0.06);
}
.blog-menu-btn:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}
.blog-menu-btn span {
    display: block;
    width: 20px;
    height: 2px;
    background: #fff;
    border-radius: 1px;
    transition: transform 0.3s var(--ease-out), opacity 0.2s;
}
/* Hamburger animacao X quando aberto */
.blog-menu-btn[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.blog-menu-btn[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.blog-menu-btn[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* Mobile nav */
.blog-mobile-nav {
    display: none;
    flex-direction: column;
    border-top: 1px solid rgba(255,255,255,0.1);
    padding: 16px 24px 20px;
    background: #0a0a0a;
}
.blog-mobile-nav.open { display: flex; }

/* Busca dentro do mobile nav */
.blog-mobile-nav-search {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 10px 14px;
    margin-bottom: 12px;
    transition: border-color 0.2s;
}
.blog-mobile-nav-search:focus-within {
    border-color: rgba(190,22,22,0.5);
}
.blog-mobile-nav-search svg {
    color: rgba(255,255,255,0.4);
    flex-shrink: 0;
}
.blog-mobile-nav-search input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
}
.blog-mobile-nav-search input::placeholder {
    color: rgba(255,255,255,0.4);
}

.blog-mobile-link {
    padding: 12px 0;
    color: rgba(255,255,255,0.75);
    text-decoration: none;
    font-size: 15px;
    font-weight: 500;
    border-bottom: 1px solid rgba(255,255,255,0.06);
    transition: color 0.2s;
}
.blog-mobile-link:last-child {
    border-bottom: none;
}
.blog-mobile-link:hover { color: #fff; }
.blog-mobile-link:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}
.blog-mobile-link--portfolio {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    margin-top: 8px;
    padding-top: 16px;
    border-top: 1px solid rgba(255,255,255,0.1);
    border-bottom: none;
    color: rgba(255,255,255,0.5);
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.blog-mobile-link--portfolio:hover { color: var(--red); }

/* ─── Main ────────────────────────────────────── */
.blog-main {
    background: var(--bg);
    min-height: 100vh;
}
@media (max-width: 1024px) {
    .blog-main { padding-bottom: 0; } /* footer margin-top handles spacing */
}

/* ─── Hero da listagem ────────────────────────── */
.blog-index-hero {
    background: #000;
    padding: 80px 24px 64px;
    text-align: center;
}
.blog-index-hero__sub {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--red);
    margin-bottom: 16px;
}
.blog-index-hero h1 {
    font-family: var(--font-display);
    font-weight: 900;
    font-size: clamp(3rem, 8vw, 6rem);
    color: #fff;
    letter-spacing: -0.04em;
    line-height: 1;
    margin-bottom: 12px;
}
.blog-index-hero p {
    color: rgba(255,255,255,0.45);
    font-size: 1rem;
}

/* ─── Filtro de categorias ────────────────────── */
.blog-filter {
    background: #fff;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 60px;
    z-index: 90;
}
.blog-filter-inner {
    max-width: var(--wide-w);
    margin: 0 auto;
    padding: 0 24px;
    display: flex;
    align-items: center;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: none;
}
.blog-filter-inner::-webkit-scrollbar { display: none; }
.filter-pill {
    padding: 12px 16px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    white-space: nowrap;
    border-bottom: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
}
.filter-pill:hover { color: var(--text); }
.filter-pill.active { color: var(--red); border-bottom-color: var(--red); }

/* ─── Grid ────────────────────────────────────── */
.blog-container { max-width: var(--content-w); margin: 0 auto; padding: 0 24px; }
.blog-container-wide { max-width: 1140px; margin: 0 auto; padding: 64px 24px 96px; }
.blog-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr));
    gap: 32px;
}

/* ─── Card ────────────────────────────────────── */
.blog-card {
    border-top: 3px solid transparent;
    transition: border-color 0.2s;
    background: #fff;
    position: relative; /* stretched-link anchor */
    isolation: isolate; /* contain stacking context so ::after does not bleed over footer */
    overflow: hidden; /* clip stretched-link pseudo-element to card bounds */
}
.blog-card:hover { border-top-color: var(--red); }
.blog-card-inner {
    display: flex;
    flex-direction: column;
    color: inherit;
    height: 100%;
}
/* Stretched link — cobre o card inteiro, clicável em qualquer área */
.blog-card-link {
    color: inherit;
    text-decoration: none;
}
.blog-card-link::after {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
}
/* Categoria e tags ficam acima do stretched-link */
.blog-card-rel {
    position: relative;
    z-index: 2;
}
.blog-card-img {
    overflow: hidden;
    aspect-ratio: 16/9;
    width: 100%;
    flex-shrink: 0;
    background: #f0f0f0; /* placeholder quando imagem não carrega */
    position: relative;
}
.blog-card-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--ease-out);
    display: block;
}
/* Ícone placeholder via CSS quando imagem falha */
.blog-card-img::after {
    content: '';
    position: absolute;
    inset: 0;
    background: #f5f5f5;
    z-index: -1;
}
.blog-card:hover .blog-card-img img { transform: scale(1.04); }
.blog-card-body {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.blog-card-badge {
    display: inline-block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    background: var(--red);
    color: #fff;
    padding: 3px 8px;
    margin-bottom: 4px;
    align-self: flex-start;
}
.blog-card-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 12px;
    color: var(--text-light);
    flex-wrap: wrap;
}
.blog-category {
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--red);
}
.blog-card-title {
    font-family: var(--font-display);
    font-weight: 800;
    font-size: clamp(1.05rem, 2vw, 1.3rem);
    line-height: 1.25;
    color: var(--text);
    letter-spacing: -0.01em;
}
.blog-card:hover .blog-card-title { color: var(--red); }
.blog-card-excerpt {
    font-size: 14px;
    color: var(--text-muted);
    line-height: 1.6;
    margin-top: 4px;
    flex: 1;
}
.blog-card-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: auto;
    padding-top: 12px;
}
.blog-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}
.blog-card-read {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 16px;
    border-radius: 4px;
    background: var(--red);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    flex-shrink: 0;
    z-index: 2;
    transition: transform 0.2s;
    text-decoration: none;
}
.blog-card-read::before {
    content: '';
    position: absolute;
    top: 0;
    left: -75%;
    width: 50%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255,255,255,0.35), transparent);
    transform: skewX(-20deg);
    animation: btn-shimmer 2.8s infinite;
    pointer-events: none;
}
@keyframes btn-shimmer {
    0%   { left: -75%; }
    60%  { left: 125%; }
    100% { left: 125%; }
}
.blog-card:hover .blog-card-read { transform: translateY(-1px); }

/* Featured card */
.blog-card--featured {
    grid-column: 1 / -1;
    border-top-width: 4px;
}
.blog-card--featured .blog-card-inner {
    flex-direction: row;
}
.blog-card--featured .blog-card-img {
    flex: 0 0 55%;
    aspect-ratio: unset;
    min-height: 300px;
    max-height: 420px;
}
.blog-card--featured .blog-card-body {
    padding: 32px;
    justify-content: center;
}
.blog-card--featured .blog-card-title {
    font-size: clamp(1.5rem, 3vw, 2.2rem);
}

/* ─── Post individual ─────────────────────────── */
.blog-post {
    max-width: var(--content-w);
    padding: 64px 0 96px;
}
.blog-post__header { margin-bottom: 48px; }
.blog-post__back { margin-bottom: 24px; }
.blog-post__back a {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-muted);
    text-decoration: none;
    transition: color 0.2s;
}
.blog-post__back a:hover { color: var(--red); }
.blog-post__category {
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--red);
    display: inline-block;
    margin-bottom: 16px;
    text-decoration: none;
}
.blog-post__category:hover { opacity: 0.8; }
.blog-post__title {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 3.2rem);
    font-weight: 900;
    line-height: 1.1;
    letter-spacing: -0.03em;
    color: var(--text);
    margin-bottom: 20px;
}
.blog-post__excerpt {
    font-size: 1.1rem;
    color: var(--text-muted);
    line-height: 1.7;
    margin-bottom: 24px;
}
.blog-post__meta {
    display: flex;
    align-items: center;
    gap: 16px;
    font-size: 13px;
    color: var(--text-light);
    padding-bottom: 24px;
    border-bottom: 1px solid var(--border);
}
.blog-post__meta time {
    font-weight: 600;
    color: var(--text-muted);
}
.blog-post__meta .sep { opacity: 0.3; }

/* Cover */
.blog-post__cover {
    margin: 0 0 48px;
    aspect-ratio: 16/9;
    overflow: hidden;
}
.blog-post__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Content prose */
.blog-post__content {
    font-family: var(--font-body);
    font-size: 1.0625rem;
    line-height: 1.85;
    color: #1a1a1a;
}
.blog-post__content h2 {
    font-family: var(--font-display);
    font-size: 1.6rem;
    font-weight: 800;
    margin: 56px 0 20px;
    letter-spacing: -0.02em;
    padding-left: 1rem;
    border-left: 3px solid var(--red);
}
.blog-post__content h3 {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 700;
    margin: 40px 0 16px;
}
.blog-post__content p { margin-bottom: 24px; }
.blog-post__content a {
    color: var(--red);
    text-decoration: underline;
}
.blog-post__content strong { font-weight: 700; }
.blog-post__content em { font-style: italic; }
.blog-post__content blockquote {
    border-left: 3px solid var(--red);
    padding: 16px 24px;
    background: #f5f5f5;
    margin: 32px 0;
    font-style: italic;
    color: var(--text-muted);
    border-radius: 0;
}
.blog-post__content code {
    font-family: var(--font-mono);
    font-size: 0.875em;
    background: #f0f0f0;
    padding: 2px 6px;
}
.blog-post__content pre {
    background: #0d0d0d;
    color: #e8e8e8;
    padding: 28px;
    overflow-x: auto;
    margin: 32px 0;
    position: relative;
    font-family: var(--font-mono);
    font-size: 14px;
    line-height: 1.65;
}
.blog-post__content pre code {
    background: none;
    padding: 0;
}
.blog-post__content img {
    width: 100%;
    margin: 32px 0;
    display: block;
}
.blog-post__content ul,
.blog-post__content ol {
    padding-left: 28px;
    margin-bottom: 24px;
}
.blog-post__content li { margin-bottom: 8px; }

/* Tags */
.blog-post__tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 48px;
    padding-top: 32px;
    border-top: 1px solid var(--border);
}
.blog-post__tag {
    display: inline-block;
    padding: 4px 12px;
    border: 1px solid var(--border);
    font-size: 12px;
    color: var(--text-muted);
    transition: border-color 0.2s, color 0.2s;
    text-decoration: none;
}
.blog-post__tag:hover {
    border-color: var(--red);
    color: var(--red);
}

/* Related posts */
.blog-post__related {
    max-width: 1140px;
    margin: 0 auto;
    padding: 64px 24px;
    border-top: 1px solid var(--border);
}
.blog-post__related-title {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 800;
    margin-bottom: 32px;
}
.blog-post__related-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;
}

/* ─── Pagination ──────────────────────────────── */
.blog-pagination {
    display: flex;
    align-items: center;
    gap: 4px;
    justify-content: center;
    padding: 48px 0;
}
.page-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    padding: 0 12px;
    font-size: 14px;
    font-weight: 600;
    border: 1px solid var(--border);
    color: var(--text);
    text-decoration: none;
    transition: all 0.2s;
}
.page-btn:hover { border-color: var(--black); }
.page-btn--active {
    background: var(--black);
    color: var(--white);
    border-color: var(--black);
}

/* ─── Copy button ─────────────────────────────── */
.code-copy-btn {
    position: absolute;
    top: 12px;
    right: 12px;
    padding: 4px 10px;
    font-size: 11px;
    font-weight: 600;
    background: rgba(255,255,255,0.1);
    color: #ccc;
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    font-family: var(--font-mono);
    transition: background 0.15s;
}
.code-copy-btn:hover {
    background: rgba(255,255,255,0.2);
    color: #fff;
}

/* ─── Footer ──────────────────────────────────── */
.blog-footer {
    background: #0a0a0a;
    padding: 64px 0 0;
    margin-top: 80px;
    position: relative; /* own stacking context so cards never overlap footer */
    z-index: 10;
}
@media (max-width: 1024px) {
    .blog-footer {
        margin-top: 48px;
        padding-top: 40px;
        padding-bottom: calc(84px + env(safe-area-inset-bottom, 0px));
    }
}
.blog-footer-inner {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px 48px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 48px;
    align-items: start;
}
.blog-footer-logo {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 900;
    color: #fff;
    text-decoration: none;
    display: block;
    margin-bottom: 8px;
}
.blog-footer-tagline {
    font-size: 13px;
    color: rgba(255,255,255,0.35);
    margin-bottom: 16px;
}
.blog-footer-portfolio-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--red);
    text-decoration: none;
    transition: opacity 0.2s;
}
.blog-footer-portfolio-link:hover { opacity: 0.7; }
.blog-footer-social {
    display: flex;
    align-items: center;
    gap: 16px;
}
.blog-footer-social-link {
    color: rgba(255,255,255,0.4);
    transition: color 0.2s;
}
.blog-footer-social-link:hover { color: var(--red); }
.blog-footer-bottom {
    border-top: 1px solid rgba(255,255,255,0.06);
    padding: 16px 24px;
    text-align: center;
    font-size: 12px;
    color: rgba(255,255,255,0.2);
}

/* ─── Alert ───────────────────────────────────── */
.blog-alert {
    max-width: 1140px;
    margin: 16px auto;
    padding: 12px 24px;
    font-size: 14px;
}
.blog-alert-success {
    background: #f0fdf4;
    color: #166534;
    border-left: 3px solid #22c55e;
}

/* ─── Empty state ─────────────────────────────── */
.blog-empty {
    text-align: center;
    padding: 80px 24px;
    color: var(--text-muted);
    font-size: 1rem;
}

/* ─── Busca desktop ──────────────────────────────── */
.blog-search-form {
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255,255,255,0.07);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 0 12px;
    height: 36px;
    transition: border-color 0.25s, background 0.25s, box-shadow 0.25s, width 0.3s var(--ease-out);
    width: 220px;
}
.blog-search-form:focus-within {
    border-color: rgba(190,22,22,0.6);
    background: rgba(255,255,255,0.1);
    box-shadow: 0 0 0 3px rgba(190,22,22,0.12);
    width: 280px;
}
.blog-search-icon {
    color: rgba(255,255,255,0.45);
    flex-shrink: 0;
    transition: color 0.2s;
}
.blog-search-form:focus-within .blog-search-icon {
    color: var(--red);
}
.blog-search-input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: 13px;
    flex: 1;
    padding: 0;
    min-width: 0;
}
.blog-search-input::placeholder {
    color: rgba(255,255,255,0.45);
}
.blog-search-btn {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.4);
    display: flex;
    padding: 2px;
    border-radius: 4px;
    transition: color 0.2s, background 0.2s;
    opacity: 0;
    transform: translateX(-4px);
    transition: opacity 0.2s, transform 0.2s, color 0.2s;
}
.blog-search-form:focus-within .blog-search-btn {
    opacity: 1;
    transform: translateX(0);
}
.blog-search-btn:hover {
    color: var(--red);
    background: rgba(255,255,255,0.06);
}
.blog-search-btn:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

/* Toggle busca mobile */
.blog-search-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.7);
    padding: 6px;
    border-radius: 6px;
    transition: color 0.2s, background 0.2s;
}
.blog-search-toggle:hover {
    color: #fff;
    background: rgba(255,255,255,0.06);
}
.blog-search-toggle:focus-visible {
    outline: 2px solid var(--red);
    outline-offset: 2px;
}

/* Busca mobile colapsavel */
.blog-search-mobile {
    display: none;
    background: #0a0a0a;
    border-top: 2px solid var(--red);
    padding: 14px 24px;
}
.blog-search-mobile.is-open { display: block; }
.blog-search-mobile form {
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.12);
    border-radius: 8px;
    padding: 10px 14px;
}
.blog-search-icon-mobile {
    color: rgba(255,255,255,0.4);
    flex-shrink: 0;
}
.blog-search-input-mobile {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-family: var(--font-body);
    font-size: 14px;
    padding: 0;
}
.blog-search-input-mobile::placeholder {
    color: rgba(255,255,255,0.4);
}
.blog-search-mobile button {
    background: none;
    border: none;
    cursor: pointer;
    color: rgba(255,255,255,0.5);
    transition: color 0.2s;
}
.blog-search-mobile button:hover { color: var(--red); }
.blog-highlight { background: rgba(190,22,22,0.18); color: #be1616; font-weight: 600; }
.blog-search-result-banner {
    max-width: 1140px; margin: 0 auto; padding: 16px 24px;
    display: flex; align-items: center; justify-content: space-between;
    background: rgba(190,22,22,0.06); border-left: 3px solid var(--red);
    font-size: 14px; color: var(--text);
}
.blog-search-clear { font-size: 13px; color: var(--text-muted); text-decoration: none; transition: color 0.2s; }
.blog-search-clear:hover { color: var(--red); }

/* ─── Layout de duas colunas ──────────────────── */
.blog-layout {
    display: grid;
    grid-template-columns: 1fr 300px;
    gap: 48px;
    align-items: start;
}
.blog-layout.blog-container-wide {
    max-width: 1140px;
    margin: 0 auto;
    padding: 64px 24px 96px;
}
.blog-layout__main { min-width: 0; }

/* post layout */
.blog-layout--post {
    max-width: 1140px;
    margin: 0 auto;
    padding: 0 24px;
}
/* sidebar sticky no post */
.blog-layout--post .blog-sidebar { position: sticky; top: 80px; max-height: calc(100vh - 100px); overflow-y: auto; scrollbar-width: thin; }

/* ─── Sidebar widgets ─────────────────────────── */
.blog-sidebar { padding-top: 32px; }
.sidebar-widget { margin-bottom: 32px; padding-bottom: 32px; border-bottom: 1px solid var(--border); }
.sidebar-widget:last-child { border-bottom: none; }
.sidebar-widget__title {
    font-family: var(--font-display); font-weight: 900;
    font-size: 0.7rem; text-transform: uppercase; letter-spacing: 0.12em;
    color: var(--red); margin-bottom: 16px;
}
.sidebar-recent-list { list-style: none; display: flex; flex-direction: column; gap: 12px; }
.sidebar-recent-link { display: flex; gap: 12px; text-decoration: none; color: inherit; }
.sidebar-recent-thumb { flex-shrink: 0; }
.sidebar-recent-thumb img,
.sidebar-recent-placeholder {
    width: 60px; height: 60px; object-fit: cover; display: block;
    background: #f0f0f0;
}
.sidebar-recent-info { display: flex; flex-direction: column; gap: 4px; }
.sidebar-recent-title { font-size: 13px; font-weight: 600; color: var(--text); line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.sidebar-recent-link:hover .sidebar-recent-title { color: var(--red); }
.sidebar-recent-date { font-size: 11px; color: var(--text-light); }
.sidebar-categories-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.sidebar-category-link { display: flex; justify-content: space-between; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: 14px; color: var(--text); text-decoration: none; transition: color 0.2s; }
.sidebar-category-link:last-child { border-bottom: none; }
.sidebar-category-link:hover, .sidebar-category-link.active { color: var(--red); }
.sidebar-category-count { font-size: 11px; color: var(--text-light); background: #f5f5f5; padding: 2px 7px; }
.sidebar-tags-cloud { display: flex; flex-wrap: wrap; gap: 8px; }
.sidebar-tag { text-decoration: none; color: var(--text-muted); border: 1px solid var(--border); padding: 4px 10px; transition: color 0.2s, border-color 0.2s; }
.sidebar-tag:hover { color: var(--red); border-color: var(--red); }
.sidebar-tag--sm { font-size: 11px; }
.sidebar-tag--md { font-size: 13px; }
.sidebar-tag--lg { font-size: 15px; font-weight: 600; }
.sidebar-author { display: flex; flex-direction: column; gap: 12px; }
.sidebar-author__name { font-family: var(--font-display); font-weight: 900; font-size: 1rem; color: var(--text); margin: 0; }
.sidebar-author__bio { font-size: 13px; color: var(--text-muted); line-height: 1.5; margin: 0; }
.sidebar-author__link { font-size: 12px; font-weight: 700; color: var(--red); text-decoration: none; transition: opacity 0.2s; }
.sidebar-author__link:hover { opacity: 0.7; }
.sidebar-empty { font-size: 13px; color: var(--text-light); }

/* ─── Share ───────────────────────────────────── */
.blog-share { margin: 40px 0 0; padding-top: 32px; border-top: 1px solid var(--border); }
.blog-share__label { font-size: 11px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase; color: var(--text-light); margin-bottom: 14px; }
.blog-share__buttons { display: flex; gap: 10px; flex-wrap: wrap; }
.share-btn {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 9px 16px; border: 1px solid var(--border);
    background: transparent; color: var(--text); font-family: var(--font-body);
    font-size: 13px; font-weight: 600; cursor: pointer; text-decoration: none;
    transition: background 0.15s, border-color 0.15s, color 0.15s;
}
.share-btn:hover { background: var(--text); border-color: var(--text); color: #fff; }
.share-btn--twitter:hover  { background: #000; border-color: #000; }
.share-btn--linkedin:hover { background: #0a66c2; border-color: #0a66c2; }
.share-btn--whatsapp:hover { background: #25d366; border-color: #25d366; }
.share-btn--copied, .share-btn--copy.share-btn--copied { background: var(--red); border-color: var(--red); color: #fff; }
.blog-share-mobile {
    display: none; position: fixed; bottom: 0; left: 0; right: 0;
    background: #111; border-top: 1px solid #222;
    padding: 10px 24px; justify-content: space-around;
    z-index: 150; gap: 8px;
}
.share-mobile-btn {
    display: flex; align-items: center; justify-content: center;
    width: 44px; height: 44px; background: none; border: 1px solid #333;
    color: rgba(255,255,255,0.7); cursor: pointer; transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
}
.share-mobile-btn:hover { color: var(--red); border-color: var(--red); }

/* ─── TOC ─────────────────────────────────────── */
.sidebar-toc { max-height: 320px; overflow-y: auto; scrollbar-width: thin; }
.toc-list { list-style: none; display: flex; flex-direction: column; gap: 2px; }
.toc-item { border-left: 2px solid var(--border); }
.toc-item--sub { margin-left: 12px; }
.toc-link {
    display: block; padding: 5px 10px; font-size: 13px;
    color: var(--text-muted); text-decoration: none; line-height: 1.4;
    transition: color 0.15s, border-color 0.15s; border-left: 2px solid transparent;
    margin-left: -2px;
}
.toc-link:hover { color: var(--text); }
.toc-link.active { color: var(--red); border-left-color: var(--red); font-weight: 600; }
.toc-loading { font-size: 12px; color: var(--text-light); }

/* ─── Responsive ──────────────────────────────── */
@media (max-width: 1024px) {
    .blog-nav { display: none; }
    .blog-menu-btn { display: flex; }
    .blog-card--featured .blog-card-inner { flex-direction: column; }
    .blog-card--featured .blog-card-img { min-height: 220px; flex: none; aspect-ratio: 16/9; }
    .blog-post__related-grid { grid-template-columns: repeat(2, 1fr); }
    .blog-search-form { display: none; }
    .blog-search-toggle { display: flex; }
    .blog-portfolio-link { display: none; }

    /* ── Layout: bloco simples no mobile (mais confiável que grid/flex override) */
    .blog-layout,
    .blog-layout.blog-container-wide {
        display: block !important; /* tira o grid e usa flow normal */
    }
    .blog-layout__main {
        display: block;
        width: 100%;
        min-width: 0;
        margin-bottom: 40px;
    }
    /* Sidebar: oculta no mobile — aparece abaixo em telas maiores */
    .blog-sidebar {
        display: none !important;
    }

    .blog-layout--post { padding: 0 16px; }
    .blog-layout.blog-container-wide { padding-left: 16px; padding-right: 16px; }
    /* index hero no tablet */
    .blog-index-hero { padding: 56px 20px 44px; }
    .blog-filter { top: 64px; } /* sticky abaixo do header (64px) */
}
@media (max-width: 767px) {
    .blog-share-mobile { display: flex; }
    .blog-share { display: none; }
    .blog-post { padding-bottom: 80px; }
    /* hero do blog index */
    .blog-index-hero { padding: 44px 18px 36px; }
    .blog-index-hero h1 { font-size: clamp(2rem, 10vw, 3.5rem); letter-spacing: -0.03em; }
    .blog-index-hero p { font-size: 0.9375rem; }
    /* filtro de categorias */
    .blog-filter { top: 56px; overflow-x: auto; -webkit-overflow-scrolling: touch; }
    .blog-filter-inner { white-space: nowrap; flex-wrap: nowrap; overflow-x: auto; gap: 6px; padding: 10px 18px; }
    .blog-filter-link { font-size: 13px; padding: 6px 14px; flex-shrink: 0; }
    /* layout blog */
    .blog-layout.blog-container-wide { padding: 32px 16px 48px; }
    .blog-layout--post { padding: 0 14px; }
    /* artigo: tipografia mobile */
    .blog-post__title { font-size: 1.625rem; line-height: 1.2; }
    .blog-post__content { font-size: 1rem; line-height: 1.75; }
    .blog-post__content h2 { font-size: 1.375rem; }
    .blog-post__content h3 { font-size: 1.125rem; }
    .blog-post__content pre { font-size: 0.8125rem; padding: 16px; border-radius: 8px; overflow-x: auto; }
    .blog-post__content blockquote { padding: 14px 16px; font-size: 0.9375rem; }
    /* cards */
    .blog-card-title { font-size: 1rem; }
    .blog-card-excerpt { font-size: 0.875rem; }
    /* share mobile posicionada acima de tudo */
    .blog-share-mobile { z-index: 200; }
}
@media (max-width: 640px) {
    .blog-grid { grid-template-columns: 1fr; }
    .blog-post__related-grid { grid-template-columns: 1fr; }
    .blog-footer-inner { grid-template-columns: 1fr; }
    .blog-post__title { font-size: 1.5rem; }
    .blog-index-hero h1 { font-size: clamp(1.875rem, 9vw, 2.5rem); }
    .blog-card--featured { grid-column: 1; }
    /* hero blog menor */
    .blog-index-hero { padding: 36px 16px 28px; }
    /* padding do container no artigo */
    .blog-layout.blog-container-wide { padding: 24px 14px 48px; }
    .blog-layout--post { padding: 0 12px; }
    /* código inline */
    .blog-post__content code { font-size: 0.8rem; }
}

/* ─── P1: Card badges (Novo / Destaque) ──────────── */
.blog-card-badges {
    display: flex;
    gap: 6px;
    flex-wrap: wrap;
    margin-bottom: 4px;
}
.blog-card-badge--featured {
    background: var(--red);
    color: #fff;
}
.blog-card-badge--new {
    background: transparent;
    color: var(--red);
    border: 1px solid var(--red);
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 2px 8px;
    align-self: flex-start;
}

/* ─── P1: Views counter no card ──────────────────── */
.blog-card-views {
    font-size: 11px;
    color: var(--text-light);
}

/* ─── P1: Tag filter banner ──────────────────────── */
.blog-tag-banner {
    margin-top: -8px;
    background: rgba(190,22,22,0.04);
    border-left: 3px solid var(--red);
}

/* ─── P1: Empty state reset link ─────────────────── */
.blog-empty-reset {
    display: inline-block;
    margin-top: 16px;
    font-size: 14px;
    font-weight: 600;
    color: var(--red);
    text-decoration: none;
}
.blog-empty-reset:hover { text-decoration: underline; }

/* ─── P1: Sidebar mais lidos ─────────────────────── */
.sidebar-mostread-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 14px;
    counter-reset: mostread;
}
.sidebar-mostread-item {
    display: flex;
    gap: 12px;
    align-items: flex-start;
}
.sidebar-mostread-num {
    font-family: var(--font-display);
    font-size: 1.2rem;
    font-weight: 900;
    color: #e8e8e8;
    line-height: 1;
    flex-shrink: 0;
    min-width: 26px;
}
.sidebar-mostread-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
}
.sidebar-mostread-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.sidebar-mostread-title:hover { color: var(--red); }
.sidebar-mostread-views {
    font-size: 11px;
    color: var(--text-light);
}

/* ─── P1: Remaining read time ─────────────────────── */
.blog-reading-remaining {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    color: var(--text-light);
    padding: 4px 10px;
    background: #f5f5f5;
    border-left: 2px solid var(--red);
    margin-bottom: 8px;
    transition: opacity 0.3s;
}
.blog-reading-remaining.is-hidden { opacity: 0; }

/* ─── P1: Back to top button ─────────────────────── */
.back-to-top {
    position: fixed;
    bottom: 32px;
    right: 32px;
    z-index: 140;
    width: 44px;
    height: 44px;
    background: var(--black);
    color: var(--white);
    border: 1px solid rgba(255,255,255,0.12);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transform: translateY(12px);
    transition: opacity 0.25s, transform 0.25s;
}
.back-to-top.is-visible {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
}
.back-to-top:hover {
    background: var(--red);
    border-color: var(--red);
}
@media (max-width: 767px) {
    .back-to-top { bottom: 84px; right: 16px; }
}

/* ─── P1: Page dots (pagination ellipsis) ────────── */
.page-dots {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 40px;
    height: 40px;
    font-size: 14px;
    color: var(--text-muted);
}
.page-btn--disabled {
    opacity: 0.35;
    cursor: not-allowed;
    pointer-events: none;
}
