:root {
    font-size: 16px;
    line-height: 1.6;
    font-weight: 400;
    color-scheme: light dark;
    font-synthesis: none;
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    -webkit-text-size-adjust: 100%;

    /* Dark mode (default) */
    --color-text: #ffffffde;
    --color-bg: #242424;
    --color-primary: #6b8e23;
    --color-primary-hover: #7aa329;
    --color-border: rgba(255, 255, 255, 0.1);
    --color-gradient: rgba(36, 36, 36, 0.8);
    --color-tag-bg: rgba(107, 142, 35, 0.2)
}

@media (prefers-color-scheme: light) {
    :root {
        --color-text: #213547;
        --color-bg: #fff;
        --color-primary: #4a6b1a;
        --color-primary-hover: #3d5815;
        --color-border: rgba(0, 0, 0, 0.1);
        --color-gradient: rgba(255, 255, 255, 0.8);
        --color-tag-bg: rgba(107, 142, 35, 0.1)
    }
}

body {
    margin: 0;
    display: flex;
    place-items: center;
    width: 100vw;
    min-height: 100vh;
    padding: 0 !important;
    font-family: 'IBM Plex Sans', sans-serif;
    color: var(--color-text);
    background-color: var(--color-bg)
}

body.blog-page {
    flex-direction: column;
    place-items: stretch;
    justify-content: flex-start
}

a {
    font-weight: 500;
    color: var(--color-primary);
    text-decoration: inherit
}

a:hover {
    color: var(--color-primary-hover)
}

#app {
    max-width: 1280px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center
}

main {
    text-align: center;
    text-align: -webkit-center
}

h1 {
    font-size: 2.5em;
    margin-top: 0;
    margin-bottom: 0
}

ul {
    margin-top: 20px;
    text-align: center;
    text-align: -webkit-center;
    font-size: 1.1em
}

ul, li {
    list-style: none;
    padding: 0;
    line-height: 1.8
}

/* Profile image */
.profile-img {
    width: 150px;
    height: 150px;
    border-radius: 50%
}

/* Blog Header */
.blog-header {
    padding: 2rem;
    text-align: center
}

.blog-author {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    text-decoration: none;
    color: inherit
}

.blog-author-img {
    width: 80px;
    height: 80px;
    border-radius: 50%
}

.blog-author span {
    font-weight: 500;
    font-size: 1.2rem
}

/* Blog App */
#blog-app {
    max-width: 800px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center
}

/* Categorias */
.categorias-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    justify-content: center;
    margin-bottom: 2rem
}

.categoria-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-primary);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem;
    transition: all 0.2s
}

.categoria-btn:hover,
.categoria-btn.active {
    background: var(--color-primary);
    color: #fff
}

/* Publicacoes Lista */
.publicacoes-lista {
    display: flex;
    flex-direction: column;
    gap: 1rem
}

.publicacao-card {
    display: flex;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 1px solid var(--color-border);
    text-align: left;
    cursor: pointer;
    transition: border-color 0.2s;
    background: transparent
}

.publicacao-card:hover {
    border-color: var(--color-primary)
}

.publicacao-img {
    flex-shrink: 0;
    width: 150px;
    height: 100px;
    overflow: hidden
}

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

.publicacao-info {
    flex: 1;
    min-width: 0
}

.publicacao-card h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.2rem;
    color: var(--color-text)
}

.publicacao-card p {
    margin: 0 0 0.5rem 0;
    opacity: 0.8
}

.publicacao-data {
    font-size: 0.85rem;
    opacity: 0.6
}

.publicacao-autor {
    font-size: 0.85rem;
    opacity: 0.8
}

.publicacao-categoria {
    font-size: 0.85rem;
    color: var(--color-primary);
    font-weight: 500
}

.publicacao-meta {
    display: flex;
    gap: 1rem;
    margin-bottom: 0.5rem;
    flex-wrap: wrap
}

.publicacao-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0.75rem 0
}

.tag {
    padding: 0.25rem 0.5rem;
    background: var(--color-tag-bg);
    border: 1px solid var(--color-primary);
    font-size: 0.8rem;
    color: var(--color-text)
}

/* Publicacao Completa */
.publicacao-completa {
    text-align: left
}

.publicacao-completa h1 {
    font-size: 2rem;
    margin: 1rem 0 0.5rem 0
}

.publicacao-img-completa {
    margin: 1rem 0;
    max-height: 400px;
    overflow: hidden
}

.publicacao-img-completa img {
    width: 100%;
    height: auto;
    object-fit: cover
}

.publicacao-conteudo {
    margin-top: 1.5rem;
    line-height: 1.8
}

/* Botoes */
.voltar-btn {
    padding: 0.5rem 1rem;
    border: 1px solid var(--color-primary);
    background: transparent;
    color: var(--color-text);
    cursor: pointer;
    font-family: inherit;
    font-size: 0.9rem
}

.voltar-btn:hover {
    background: var(--color-primary);
    color: #fff
}

/* Estados */
.carregando,
.sem-publicacoes {
    opacity: 0.6;
    font-style: italic
}

/* Responsivo */
@media (max-width: 600px) {
    .publicacao-card {
        flex-direction: column
    }

    .publicacao-img {
        width: 100%;
        height: 150px
    }
}
