:root {
    --bg: #ffffff;
    --text: #0f172a;
    /* slate-900 */
    --muted: #475569;
    /* slate-600 */
    --line: #e2e8f0;
    /* slate-200 */
    --brand: #2563eb;
    /* blue-600 */
    --brand-2: #0ea5e9;
    /* sky-500 */
    --chip: #f1f5f9;
    /* slate-100 */
    --card: #ffffff;
    --shadow: 0 10px 20px rgba(2, 6, 23, 0.06);
    --radius: 16px;
    --radius-sm: 12px;
    --radius-lg: 20px;
}

* {
    box-sizing: border-box;
}

html,
body {
    height: 100%;
}

body {
    margin: 0;
    font-family: system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, "Helvetica Neue", Arial, "Noto Sans", "Apple Color Emoji", "Segoe UI Emoji";
    color: var(--text);
    background: var(--bg);
    line-height: 1.55;
}

a {
    color: inherit;
    text-decoration: none;
}

img {
    max-width: 100%;
    display: block;
}

/* Header */
.topbar {
    border-bottom: 1px solid var(--line);
    background: var(--bg);
    position: sticky;
    top: 0;
    z-index: 50;
}

.container {
    width: min(1200px, 92%);
    margin: 0 auto;
}

.row {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 14px 0;
}

.brand {
    font-weight: 800;
    letter-spacing: .2px;
    font-size: 1.25rem;
    display: flex;
    align-items: center;
    gap: 10px;
}

.brand-badge {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 900;
}

.spacer {
    flex: 1;
}

/* Tabs */
.tabs {
    display: flex;
    gap: 8px;
    background: #f8fafc;
    padding: 6px;
    border-radius: 999px;
    border: 1px solid var(--line);
}

.tab {
    padding: 10px 16px;
    border-radius: 999px;
    color: var(--muted);
    font-weight: 600;
    transition: background .2s, color .2s, transform .1s;
}

.tab:hover {
    background: #eef2f7;
    color: var(--text);
}

.tab.active {
    background: var(--text);
    color: #fff;
}

/* Layout */
main {
    padding: 26px 0 60px;
}

.grid {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 28px;
}

/* Featured square */
.featured-wrapper {}

.square {
    position: relative;
    width: 100%;
    aspect-ratio: 2 / 1;
    /* retângulo horizontal */
    overflow: hidden;
}

.featured-grid {
    position: absolute;
    inset: 0;
    display: grid;
    grid-template-columns: 2fr 1fr;
    /* coluna esquerda maior */
    grid-template-rows: repeat(2, 1fr);
    gap: 8px;
    padding: 8px;
    background: #f8fafc;
}

.featured-grid article:nth-child(1) {
    grid-row: 1 / span 2;
}

.featured-grid article:nth-child(2) {
    grid-column: 2;
    grid-row: 1;
}

.featured-grid article:nth-child(3) {
    grid-column: 2;
    grid-row: 2;
}

.feat-card {
    position: relative;
    overflow: hidden;
    background: var(--card);
    box-shadow: var(--shadow);
    display: grid;
    grid-template-rows: 1fr auto;
}

.feat-thumb {
    background: linear-gradient(135deg, #e2e8f0, #cbd5e1);
    height: 100%;
    background-size: cover;
    /* cobre todo o espaço sem distorcer */
    background-position: center;
    /* centraliza a imagem */
    background-repeat: no-repeat;
    /* evita repetição */
}

.feat-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.feat-content {
    padding: 12px;
}

.badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .2px;
    padding: 6px 10px;
    border-radius: 999px;
    background: var(--chip);
    border: 1px solid var(--line);
    color: var(--muted);
    text-transform: uppercase;
}

@media (max-width: 600px) {
  .badge {
    margin-bottom: 8px; /* espaço entre linhas e colunas */
  }
}

.feat-title {
    margin: 8px 0 4px;
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 800;
}

.meta {
    color: var(--muted);
    font-size: 0.85rem;
}

/* Content & sidebar */
.content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 8px;
    margin-top: 24px;
}

.post-card {
    display: grid;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
}

.post-thumb {
    width: 100%;
    height: 120px;
    overflow: hidden;
    background: #e2e8f0;
}

.post-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.post-title {
    margin: 2px 0 6px;
    font-size: 1.05rem;
    line-height: 1.25;
    font-weight: 800;
    display: -webkit-box;
    -webkit-line-clamp: 1;
    /* Mostra no máximo 2 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.excerpt {
    color: var(--muted);
    font-size: .95rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Mostra no máximo 2 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stack {
    display: grid;
    gap: 14px;
}

aside {
    display: grid;
    gap: 24px;
}

.widget {
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
}

.widget h3 {
    margin: 0;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line);
    font-size: 1rem;
    text-transform: uppercase;
    letter-spacing: .6px;
}

.widget .box {
    padding: 12px 16px;
}

.list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: grid;
    gap: 10px;
}

.list li a {
    display: block;
    color: var(--text);
}

.list li small {
    color: var(--muted);
}

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

.tag {
    background: var(--chip);
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 8px 10px;
    font-weight: 600;
    font-size: .9rem;
}

.tags a:hover {
    background: var(--brand);
    color: #fff;
}

/* Footer */
footer {
    margin-top: 50px;
    padding: 28px 0;
    border-top: 1px solid var(--line);
    color: var(--muted);
    font-size: .95rem;
}

/* Responsive */
@media (max-width: 1000px) {
    .grid {
        grid-template-columns: 1fr;
    }

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

@media (max-width: 640px) {
    .featured-grid {
        position: static;
        display: grid;
        grid-template-columns: 1fr;
        grid-template-rows: auto;
        gap: 16px;
        padding: 0;
        background: none;
        /* remove fundo cinza extra */
    }

    .square {
        aspect-ratio: auto;
        /* libera altura automática */
    }

    .feat-card {
        grid-template-rows: auto auto;
        /* imagem + texto */
    }

    .feat-thumb {
        width: 100%;
        height: 200px;
        /* 👈 altura fixa no mobile */
        background-size: cover;
        background-position: center;
        border-radius: 8px;
    }

    .featured-grid article {
        grid-column: auto !important;
        grid-row: auto !important;
    }

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

    .post-thumb {
        height: 180px;
    }

    .tabs {
        width: 100%;
        justify-content: center;
        /* centraliza */
        gap: 6px;
    }

    .tab {
        flex: 1;
        /* 👈 ocupa largura igual */
        text-align: center;
        /* centraliza o texto */
        padding: 10px 0;
        /* não deixa muito largo */
        white-space: nowrap;
        /* evita quebra feia */
    }

    .feat-title {
        font-size: .98rem;
    }
}

/* Sidebar ajustes */
aside {
    display: grid;
    gap: 18px;
    /* menos espaço entre widgets */
}

/* Postagens Recentes */
.recent-posts {
    display: grid;
    gap: 12px;
    padding: 12px 16px 0 16px;
    /* remove espaço de baixo */
}

.recent-card {
    display: grid;
    grid-template-columns: 90px 1fr;
    gap: 0;
    align-items: center;
    padding: 0 0;
    /* já cria respiro em cima e embaixo */
    border-bottom: 1px solid var(--line);
}

.recent-card:last-child {
    border-bottom: none;
    padding-bottom: 14px;
    /* 👈 garante espaço no último item */
}


.recent-thumb {
    width: 80px;
    height: 60px;
    overflow: hidden;
    border-radius: 6px;
    background: #e2e8f0;
    flex-shrink: 0;
}

.recent-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.recent-title {
    font-weight: 600;
    font-size: .95rem;
    line-height: 1.3;
    color: var(--text);
    display: block;
    margin-bottom: 2px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    /* Mostra no máximo 2 linhas */
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

.recent-title:hover {
    color: var(--brand);
}

.recent-meta {
    font-size: .8rem;
    color: var(--muted);
}

/* Categorias estilo Tags (quadrados) */
.cats {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 12px 16px;
}

.cats a {
    background: var(--chip);
    border: 1px solid var(--line);
    color: var(--muted);
    padding: 8px 12px;
    font-weight: 600;
    font-size: .9rem;
    transition: background .2s, color .2s;
}

.cats a:hover {
    background: var(--brand);
    color: #fff;
}

.post-meta-line {
    margin: 6px 0 14px;
    font-size: 0.95rem;
    color: #555;
}

.post-meta-line strong {
    color: #111;
}

.comentarios {
    width: 70%;
    margin: 40px auto;
    padding: 20px;
    border-top: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.comentarios h2 {
    font-size: 1.4rem;
    margin-bottom: 16px;
    color: var(--text);
}

@media (max-width: 768px) {
    .comentarios {
        width: 100%;
        margin: 20px 0;
    }
}

@media (max-width: 1600px) {
    .comentarios {
        width: 100%;
        margin: 20px 0;
    }
}

.todas-postagens {
    display: flex;
    grid-template-columns: 160px 1fr;
    gap: 16px;
    padding: 14px;
    border: 1px solid var(--line);
    background: var(--card);
    box-shadow: var(--shadow);
}

.todas-postagens:hover {
    cursor: pointer;
}