/* =====================================================================
   Blog ArchTec - Design 2026
   =====================================================================
   Features:
   - Bento grid adaptativo (container queries)
   - Dark mode automatico + toggle manual
   - Reading progress bar (scroll-driven)
   - TOC sticky lateral
   - View Transitions entre lista/artigo
   - Tilt 3D sutil em cards
   - Reduced motion respeitado
   - WCAG 2.2 AA
   ===================================================================== */

/* ---------- Tokens (light) ---------- */
:root {
    --bg: #F4F6FB;
    --bg-elev: #FFFFFF;
    --bg-soft: #EEF2F9;
    --surface: rgba(255, 255, 255, 0.72);
    --surface-solid: #FFFFFF;
    --border: rgba(15, 23, 41, 0.08);
    --border-strong: rgba(15, 23, 41, 0.16);
    --text: #0F1729;
    --text-muted: #55607A;
    --text-dim: #98A3B5;

    --primary: #0B1E3A;
    --accent: #3B82F6;
    --accent-soft: #60A5FA;
    --accent-dim: rgba(59, 130, 246, 0.12);
    --purple: #8B5CF6;
    --pink: #EC4899;
    --cyan: #06B6D4;

    --success: #059669;
    --warning: #D97706;
    --danger: #DC2626;

    --radius-sm: 0.5rem;
    --radius: 1rem;
    --radius-lg: 1.5rem;
    --radius-xl: 2rem;
    --radius-pill: 9999px;

    --shadow-sm: 0 1px 2px rgba(15,23,41,0.06);
    --shadow: 0 8px 24px rgba(15,23,41,0.08), 0 1px 2px rgba(15,23,41,0.04);
    --shadow-lg: 0 24px 64px rgba(15,23,41,0.14), 0 2px 8px rgba(15,23,41,0.06);
    --shadow-glow: 0 0 0 1px rgba(59,130,246,0.3), 0 16px 32px rgba(59,130,246,0.22);

    --blur: 24px;
    --blur-sm: 12px;
    --ease: cubic-bezier(0.22, 1, 0.36, 1);
    --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
    --t-fast: 0.15s;
    --t: 0.25s;
    --t-slow: 0.4s;
}

/* ---------- Dark mode (auto via system) ---------- */
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #0A0F1E;
        --bg-elev: #11182B;
        --bg-soft: #0F1525;
        --surface: rgba(17, 24, 43, 0.72);
        --surface-solid: #161D33;
        --border: rgba(148, 163, 184, 0.10);
        --border-strong: rgba(148, 163, 184, 0.22);
        --text: #E8EDF5;
        --text-muted: #98A3B5;
        --text-dim: #64748B;
        --primary: #E8EDF5;
        --accent-dim: rgba(96, 165, 250, 0.16);
        --shadow: 0 8px 24px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.2);
        --shadow-lg: 0 24px 64px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
    }
}

/* ---------- Dark mode (manual toggle) ---------- */
[data-theme="dark"] {
    color-scheme: dark;
    --bg: #0A0F1E;
    --bg-elev: #11182B;
    --bg-soft: #0F1525;
    --surface: rgba(17, 24, 43, 0.72);
    --surface-solid: #161D33;
    --border: rgba(148, 163, 184, 0.10);
    --border-strong: rgba(148, 163, 184, 0.22);
    --text: #E8EDF5;
    --text-muted: #98A3B5;
    --text-dim: #64748B;
    --primary: #E8EDF5;
    --accent-dim: rgba(96, 165, 250, 0.16);
    --shadow: 0 8px 24px rgba(0,0,0,0.4), 0 1px 2px rgba(0,0,0,0.2);
    --shadow-lg: 0 24px 64px rgba(0,0,0,0.55), 0 2px 8px rgba(0,0,0,0.3);
}

[data-theme="light"] {
    color-scheme: light;
}

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

/* ---------- Base blog ---------- */
body.blog-v2 {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ---------- Reading progress bar ---------- */
.blog-progress {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: transparent;
    z-index: 1000;
    pointer-events: none;
}

.blog-progress__fill {
    height: 100%;
    background: linear-gradient(90deg, var(--accent), var(--purple));
    transform-origin: 0 50%;
    transform: scaleX(0);
    transition: transform 0.05s linear;
    box-shadow: 0 0 8px rgba(59,130,246,0.6);
}

/* Scroll-driven animation (onde suportado) */
@supports (animation-timeline: scroll()) {
    .blog-progress__fill {
        transform: scaleX(0);
        animation: blog-progress-grow linear;
        animation-timeline: scroll(root);
        transition: none;
    }
    @keyframes blog-progress-grow {
        to { transform: scaleX(1); }
    }
}

/* ---------- Mesh gradient de fundo (decorativo) ---------- */
.blog-mesh {
    position: fixed;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    overflow: hidden;
    opacity: 0.35;
}

.blog-mesh::before,
.blog-mesh::after {
    content: "";
    position: absolute;
    width: 55vmax;
    height: 55vmax;
    border-radius: 50%;
    filter: blur(90px);
    animation: blog-float 28s var(--ease) infinite;
}

.blog-mesh::before {
    background: radial-gradient(circle at center, var(--accent), transparent 70%);
    top: -20%; left: -10%;
}

.blog-mesh::after {
    background: radial-gradient(circle at center, var(--purple), transparent 70%);
    bottom: -25%; right: -15%;
    animation-delay: -14s;
    animation-direction: reverse;
}

@keyframes blog-float {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(5vw, 3vh) scale(1.08); }
    66% { transform: translate(-4vw, -2vh) scale(0.96); }
}

/* ---------- Header do blog ---------- */
.blog-header {
    position: sticky;
    top: 0;
    z-index: 100;
    backdrop-filter: blur(var(--blur)) saturate(180%);
    -webkit-backdrop-filter: blur(var(--blur)) saturate(180%);
    background: color-mix(in srgb, var(--bg) 80%, transparent);
    border-bottom: 1px solid var(--border);
    padding: 0.875rem 1.5rem;
}

.blog-header__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.blog-logo {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    text-decoration: none;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
    font-weight: 700;
    font-size: 1.25rem;
    letter-spacing: -0.02em;
}

.blog-logo__icon {
    width: 36px;
    height: 36px;
    background: linear-gradient(135deg, #0B1E3A, #1E3A8A);
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.blog-logo__icon svg {
    width: 22px;
    height: 22px;
}

.blog-nav {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.blog-nav a, .blog-nav button {
    padding: 0.5rem 1rem;
    border-radius: var(--radius-pill);
    color: var(--text-muted);
    text-decoration: none;
    font-size: 0.9375rem;
    font-weight: 500;
    transition: all var(--t) var(--ease);
    background: transparent;
    border: 1.5px solid transparent;
    cursor: pointer;
    font-family: inherit;
}

.blog-nav a:hover, .blog-nav button:hover {
    color: var(--text);
    background: var(--bg-soft);
}

.blog-nav a.primary {
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    box-shadow: var(--shadow-sm);
}

.blog-nav a.primary:hover {
    box-shadow: var(--shadow-glow);
    transform: translateY(-1px);
}

/* Dark mode toggle */
.theme-toggle {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    padding: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-elev);
    color: var(--text-muted);
    cursor: pointer;
    transition: all var(--t) var(--ease);
}

.theme-toggle:hover {
    color: var(--text);
    border-color: var(--text-dim);
    transform: rotate(20deg);
}

.theme-toggle svg {
    width: 18px;
    height: 18px;
}

/* ---------- Hero do blog ---------- */
.blog-hero {
    position: relative;
    z-index: 1;
    padding: clamp(3rem, 8vw, 5rem) 1.5rem clamp(2rem, 4vw, 3rem);
    text-align: center;
    max-width: 1100px;
    margin: 0 auto;
}

.blog-hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(2rem, 5vw, 3.25rem);
    font-weight: 700;
    letter-spacing: -0.03em;
    margin: 0 0 1rem;
    line-height: 1.1;
    background: linear-gradient(135deg, var(--text) 0%, var(--accent) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.blog-hero p {
    font-size: clamp(1rem, 1.2vw, 1.125rem);
    color: var(--text-muted);
    max-width: 640px;
    margin: 0 auto 2rem;
}

.blog-filters {
    display: flex;
    gap: 0.5rem;
    justify-content: center;
    flex-wrap: wrap;
}

.blog-filter-btn {
    padding: 0.5rem 1.125rem;
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-pill);
    background: var(--bg-elev);
    color: var(--text-muted);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 500;
    cursor: pointer;
    transition: all var(--t) var(--ease);
}

.blog-filter-btn:hover {
    color: var(--text);
    border-color: var(--text-dim);
}

.blog-filter-btn.active {
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: white;
    border-color: transparent;
    box-shadow: var(--shadow-sm);
}

.blog-filter-btn:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 2px;
}

/* ---------- Bento Grid ---------- */
.blog-container {
    position: relative;
    z-index: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1.5rem 4rem;
}

.bento {
    display: grid;
    gap: 1.25rem;
    grid-template-columns: 1fr;
}

@media (min-width: 640px) {
    .bento {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 960px) {
    .bento {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: minmax(280px, auto);
    }
    .bento-card--featured {
        grid-column: span 2;
        grid-row: span 2;
    }
    .bento-card--wide { grid-column: span 2; }
    .bento-card--tall { grid-row: span 2; }
}

.bento-card {
    position: relative;
    background: var(--surface);
    backdrop-filter: blur(var(--blur-sm));
    -webkit-backdrop-filter: blur(var(--blur-sm));
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    min-height: 260px;
    transition: transform var(--t-slow) var(--ease-spring),
                box-shadow var(--t-slow) var(--ease),
                border-color var(--t) var(--ease);
    text-decoration: none;
    color: var(--text);
    will-change: transform;
}

.bento-card:hover {
    transform: translateY(-4px);
    box-shadow: var(--shadow-lg);
    border-color: var(--border-strong);
}

.bento-card:focus-visible {
    outline: 3px solid var(--accent);
    outline-offset: 3px;
}

.bento-card__cover {
    position: relative;
    aspect-ratio: 16 / 9;
    background: linear-gradient(135deg, var(--accent-dim), var(--bg-soft));
    overflow: hidden;
    flex-shrink: 0;
}

.bento-card__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--t-slow) var(--ease);
}

.bento-card:hover .bento-card__cover img {
    transform: scale(1.05);
}

.bento-card__cover--icon {
    display: flex;
    align-items: center;
    justify-content: center;
}

.bento-card__cover--icon svg {
    width: 64px;
    height: 64px;
    color: var(--accent);
    opacity: 0.6;
    transition: transform var(--t-slow) var(--ease-spring);
}

.bento-card:hover .bento-card__cover--icon svg {
    transform: scale(1.2) rotate(-6deg);
    opacity: 0.9;
}

.bento-card__body {
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 0.625rem;
}

.bento-card__category {
    display: inline-flex;
    align-items: center;
    padding: 0.125rem 0.75rem;
    border-radius: var(--radius-pill);
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.04em;
    align-self: flex-start;
}

.bento-card__category--purple { background: rgba(139,92,246,0.14); color: var(--purple); }
.bento-card__category--cyan { background: rgba(6,182,212,0.14); color: var(--cyan); }
.bento-card__category--pink { background: rgba(236,72,153,0.14); color: var(--pink); }
.bento-card__category--accent { background: rgba(59,130,246,0.14); color: var(--accent); }

.bento-card__title {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.125rem, 1.6vw, 1.375rem);
    font-weight: 700;
    line-height: 1.25;
    margin: 0;
    letter-spacing: -0.02em;
}

.bento-card--featured .bento-card__title {
    font-size: clamp(1.5rem, 2.4vw, 1.875rem);
}

.bento-card__excerpt {
    color: var(--text-muted);
    font-size: 0.9375rem;
    line-height: 1.5;
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.bento-card__meta {
    margin-top: auto;
    padding-top: 0.75rem;
    display: flex;
    align-items: center;
    gap: 0.75rem;
    color: var(--text-dim);
    font-size: 0.8125rem;
    border-top: 1px solid var(--border);
}

.bento-card__meta-item {
    display: inline-flex;
    align-items: center;
    gap: 0.25rem;
}

/* View transition animations */
@supports (view-transition-name: auto) {
    .bento-card {
        view-transition-name: auto;
    }
}

/* ---------- Skeleton loading ---------- */
.bento-skeleton {
    background: linear-gradient(110deg,
        var(--bg-elev) 8%,
        var(--bg-soft) 18%,
        var(--bg-elev) 33%);
    background-size: 200% 100%;
    animation: skeleton-shimmer 1.8s linear infinite;
    border-radius: var(--radius-lg);
    min-height: 280px;
    border: 1px solid var(--border);
}

@keyframes skeleton-shimmer {
    to { background-position: -200% 0; }
}

/* Empty state */
.blog-empty {
    text-align: center;
    padding: 4rem 1rem;
    color: var(--text-muted);
}

.blog-empty svg {
    width: 80px;
    height: 80px;
    opacity: 0.3;
    margin-bottom: 1rem;
}

/* =====================================================================
   Article page redesign
   ===================================================================== */

body.article-v2 {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: 'Inter', -apple-system, sans-serif;
    font-size: 17px;
    line-height: 1.7;
    -webkit-font-smoothing: antialiased;
}

.article-layout {
    display: grid;
    grid-template-columns: 1fr min(720px, 100%) 1fr;
    gap: 0;
    padding: 0 1.5rem;
}

.article-hero {
    grid-column: 1 / -1;
    padding: clamp(3rem, 6vw, 5rem) 1.5rem clamp(2rem, 4vw, 3rem);
    max-width: 860px;
    margin: 0 auto;
    text-align: center;
    position: relative;
    z-index: 1;
}

.article-hero__category {
    display: inline-flex;
    align-items: center;
    padding: 0.25rem 0.875rem;
    border-radius: var(--radius-pill);
    background: var(--accent-dim);
    color: var(--accent);
    font-size: 0.8125rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 1rem;
}

.article-hero h1 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.875rem, 4.5vw, 3rem);
    font-weight: 700;
    line-height: 1.15;
    letter-spacing: -0.03em;
    margin: 0 0 1.25rem;
    color: var(--text);
}

.article-hero__meta {
    display: flex;
    gap: 1.25rem;
    justify-content: center;
    flex-wrap: wrap;
    color: var(--text-muted);
    font-size: 0.9375rem;
}

.article-hero__meta span {
    display: inline-flex;
    align-items: center;
    gap: 0.375rem;
}

.article-hero__cover {
    max-width: 960px;
    margin: 2rem auto 0;
    aspect-ratio: 16 / 9;
    background: var(--bg-elev);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow-lg);
}

.article-hero__cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.article-body-wrap {
    grid-column: 2;
    position: relative;
    padding: 2rem 0 4rem;
}

.article-body {
    font-size: clamp(1rem, 1.1vw, 1.125rem);
    color: var(--text);
}

.article-body h2 {
    font-family: 'Outfit', sans-serif;
    font-size: clamp(1.375rem, 2.2vw, 1.75rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 2.5rem 0 1rem;
    color: var(--text);
    line-height: 1.25;
    scroll-margin-top: 6rem;
}

.article-body h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.25rem;
    font-weight: 600;
    margin: 2rem 0 0.75rem;
    color: var(--text);
    scroll-margin-top: 6rem;
}

.article-body p {
    margin: 0 0 1.25rem;
}

.article-body a {
    color: var(--accent);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color var(--t) var(--ease);
}

.article-body a:hover {
    color: var(--accent-soft);
}

.article-body ul, .article-body ol {
    padding-left: 1.5rem;
    margin: 0 0 1.25rem;
}

.article-body li { margin-bottom: 0.5rem; }

.article-body strong { color: var(--text); font-weight: 600; }

.article-body blockquote {
    border-left: 3px solid var(--accent);
    padding: 0.5rem 0 0.5rem 1.25rem;
    margin: 1.5rem 0;
    color: var(--text-muted);
    font-style: italic;
}

.article-body img {
    max-width: 100%;
    height: auto;
    border-radius: var(--radius);
    margin: 1.5rem 0;
}

.article-body code {
    font-family: ui-monospace, SFMono-Regular, monospace;
    font-size: 0.875em;
    padding: 0.125em 0.375em;
    background: var(--bg-soft);
    border-radius: 4px;
    color: var(--text);
}

.article-body pre {
    background: var(--bg-soft);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 1rem;
    overflow-x: auto;
    margin: 1.5rem 0;
}

.article-body pre code {
    background: none;
    padding: 0;
}

/* ---------- Floating action bar (side) ---------- */
.article-actions {
    position: sticky;
    top: 6rem;
    grid-column: 1;
    justify-self: end;
    padding-right: 1.5rem;
    padding-top: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    align-items: center;
    align-self: start;
}

@media (max-width: 1080px) {
    .article-actions {
        position: fixed;
        bottom: 1.5rem;
        left: 50%;
        transform: translateX(-50%);
        top: auto;
        grid-column: auto;
        justify-self: auto;
        padding: 0.5rem;
        flex-direction: row;
        background: var(--surface);
        backdrop-filter: blur(var(--blur));
        -webkit-backdrop-filter: blur(var(--blur));
        border: 1px solid var(--border-strong);
        border-radius: var(--radius-pill);
        box-shadow: var(--shadow-lg);
        z-index: 50;
    }
}

.article-action {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1.5px solid var(--border-strong);
    background: var(--bg-elev);
    color: var(--text-muted);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: all var(--t) var(--ease);
    font-family: inherit;
    padding: 0;
}

.article-action:hover {
    color: var(--text);
    border-color: var(--text-dim);
    transform: scale(1.08);
}

.article-action.active {
    color: var(--pink);
    border-color: var(--pink);
    background: rgba(236,72,153,0.08);
}

.article-action svg { width: 18px; height: 18px; }

.article-action__count {
    position: absolute;
    bottom: -6px;
    right: -4px;
    background: var(--bg-elev);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius-pill);
    padding: 0 0.375rem;
    font-size: 0.6875rem;
    font-weight: 600;
    min-width: 18px;
    text-align: center;
    color: var(--text-muted);
}

/* ---------- TOC sticky ---------- */
.article-toc {
    position: sticky;
    top: 6rem;
    grid-column: 3;
    justify-self: start;
    padding-left: 1.5rem;
    padding-top: 2rem;
    width: 240px;
    max-height: calc(100vh - 8rem);
    overflow-y: auto;
    align-self: start;
    font-size: 0.8125rem;
}

@media (max-width: 1080px) { .article-toc { display: none; } }

.article-toc__title {
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-dim);
    margin: 0 0 0.75rem;
}

.article-toc ul {
    list-style: none;
    padding: 0;
    margin: 0;
    border-left: 2px solid var(--border);
}

.article-toc li { margin: 0; }

.article-toc a {
    display: block;
    padding: 0.375rem 0.875rem;
    color: var(--text-muted);
    text-decoration: none;
    margin-left: -2px;
    border-left: 2px solid transparent;
    transition: all var(--t) var(--ease);
    line-height: 1.4;
}

.article-toc a:hover {
    color: var(--text);
    border-left-color: var(--text-dim);
}

.article-toc a.active {
    color: var(--accent);
    border-left-color: var(--accent);
    font-weight: 500;
}

.article-toc ul ul a {
    padding-left: 1.75rem;
    font-size: 0.75rem;
}

/* ---------- CTA Box ---------- */
.cta-box {
    background: linear-gradient(135deg, var(--accent-dim), rgba(139,92,246,0.08));
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 2rem;
    margin: 3rem 0;
    text-align: center;
}

.cta-box h3 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.375rem;
    font-weight: 700;
    margin: 0 0 0.75rem;
    color: var(--text);
}

.cta-box p {
    color: var(--text-muted);
    margin: 0 0 1.5rem;
}

.cta-box .btn {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.875rem 1.75rem;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    border-radius: var(--radius-pill);
    text-decoration: none;
    font-weight: 600;
    transition: all var(--t) var(--ease);
    box-shadow: var(--shadow);
}

.cta-box .btn:hover {
    transform: translateY(-2px);
    box-shadow: var(--shadow-glow);
}

/* =====================================================================
   Comments widget
   ===================================================================== */

.comments-section {
    max-width: 720px;
    margin: 4rem auto 0;
    padding: 0 1.5rem;
}

.comments-section h2 {
    font-family: 'Outfit', sans-serif;
    font-size: 1.5rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    margin: 0 0 1.5rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.comments-section h2 .count {
    background: var(--accent-dim);
    color: var(--accent);
    padding: 0.125rem 0.625rem;
    border-radius: var(--radius-pill);
    font-size: 0.875rem;
    font-weight: 600;
}

.comment-form {
    background: var(--bg-elev);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 1.25rem;
    margin-bottom: 2rem;
}

.comment-form textarea {
    width: 100%;
    min-height: 80px;
    padding: 0.75rem;
    font: inherit;
    font-size: 0.9375rem;
    color: var(--text);
    background: var(--bg);
    border: 1.5px solid var(--border-strong);
    border-radius: var(--radius);
    resize: vertical;
    outline: none;
    transition: border-color var(--t) var(--ease);
}

.comment-form textarea:focus-visible {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-dim);
}

.comment-form__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.75rem;
    gap: 1rem;
    flex-wrap: wrap;
}

.comment-form__hint {
    color: var(--text-dim);
    font-size: 0.75rem;
}

.comment-form__submit {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.625rem 1.25rem;
    background: linear-gradient(135deg, var(--accent), var(--primary));
    color: white;
    border: none;
    border-radius: var(--radius-pill);
    font: inherit;
    font-size: 0.875rem;
    font-weight: 600;
    cursor: pointer;
    transition: all var(--t) var(--ease);
}

.comment-form__submit:hover:not(:disabled) {
    transform: translateY(-1px);
    box-shadow: var(--shadow-glow);
}

.comment-form__submit:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.comments-login-cta {
    background: var(--bg-elev);
    border: 1.5px dashed var(--border-strong);
    border-radius: var(--radius-lg);
    padding: 2rem 1.5rem;
    text-align: center;
    margin-bottom: 2rem;
}

.comments-login-cta p {
    margin: 0 0 1rem;
    color: var(--text-muted);
}

.comment {
    display: flex;
    gap: 0.875rem;
    padding: 1.25rem 0;
    border-bottom: 1px solid var(--border);
}

.comment:last-child { border-bottom: none; }

.comment--reply {
    margin-left: 2.5rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
}

.comment__avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), var(--purple));
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    font-size: 0.875rem;
    flex-shrink: 0;
    text-transform: uppercase;
}

.comment__avatar img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.comment__body { flex: 1; min-width: 0; }

.comment__head {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.25rem;
    flex-wrap: wrap;
}

.comment__author {
    font-weight: 600;
    color: var(--text);
    font-size: 0.9375rem;
}

.comment__role {
    font-size: 0.625rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 0.125rem 0.5rem;
    border-radius: var(--radius-pill);
    background: var(--accent-dim);
    color: var(--accent);
    font-weight: 700;
}

.comment__time {
    color: var(--text-dim);
    font-size: 0.8125rem;
}

.comment__content {
    color: var(--text);
    font-size: 0.9375rem;
    line-height: 1.55;
    word-wrap: break-word;
}

.comment__content a {
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
}

.comment__actions {
    margin-top: 0.5rem;
    display: flex;
    gap: 0.75rem;
    font-size: 0.75rem;
}

.comment__actions button {
    background: none;
    border: none;
    color: var(--text-dim);
    cursor: pointer;
    font: inherit;
    padding: 0;
    transition: color var(--t) var(--ease);
}

.comment__actions button:hover { color: var(--text-muted); }
.comment__actions button.danger:hover { color: var(--danger); }

/* ---------- Toast (se ainda nao carregado) ---------- */
.blog-toast-container {
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    pointer-events: none;
    max-width: calc(100vw - 2rem);
}

.blog-toast {
    pointer-events: auto;
    min-width: 260px;
    padding: 0.75rem 1rem;
    background: var(--bg-elev);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-lg);
    font-size: 0.875rem;
    color: var(--text);
    opacity: 0;
    transform: translateX(20px);
    transition: all var(--t) var(--ease);
}

.blog-toast.show { opacity: 1; transform: translateX(0); }
.blog-toast--success { border-left: 4px solid var(--success); }
.blog-toast--error { border-left: 4px solid var(--danger); }

/* ---------- Skip link + a11y ---------- */
.blog-skip {
    position: absolute;
    top: -40px;
    left: 1rem;
    background: var(--primary);
    color: var(--bg-elev);
    padding: 0.5rem 1rem;
    border-radius: 0 0 var(--radius-sm) var(--radius-sm);
    text-decoration: none;
    z-index: 200;
}

.blog-skip:focus-visible { top: 0; }

/* ---------- View Transitions (cross-doc onde suportado) ---------- */
@view-transition {
    navigation: auto;
}

::view-transition-old(root),
::view-transition-new(root) {
    animation-duration: 0.3s;
}
