/* ==== Excertos ==== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: Arial, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f4f4f4;
    padding: 1.5rem;
}

/* Coluna de leitura: tudo alinhado na mesma largura */
.cabecalho,
main {
    max-width: 40rem;
    margin: 0 auto;
}

/* ---- Cabeçalho ---- */

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

.subtitulo {
    color: #666;
    font-size: 0.95em;
}

.voltar {
    margin-top: 0.75rem;
}

.voltar a {
    color: #333;
    text-decoration: none;
    font-weight: bold;
    display: inline-block;
    padding: 0.25rem 0.5rem;
    margin-left: -0.5rem;
    border-radius: 4px;
    transition: background-color 0.3s;
}

.voltar a:hover {
    background-color: #8c8b8b;
}

/* ---- Filtros ---- */

.filtros {
    margin: 2rem 0 1rem;
    border-bottom: 1px solid #d8d8d8;
    padding-bottom: 1rem;
}

.rotulo-oculto {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.campo-busca input {
    width: 100%;
    font: inherit;
    color: inherit;
    padding: 0.6rem 0.75rem;
    border: 1px solid #c9c9c9;
    border-radius: 4px;
    background: #fff;
}

.campo-busca input:focus {
    outline: 2px solid #243d4a;
    outline-offset: 1px;
}

.temas {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.9rem;
}

.tema {
    font: inherit;
    font-size: 0.85em;
    color: #4a4a4a;
    background: transparent;
    border: 1px solid #c9c9c9;
    border-radius: 999px;
    padding: 0.2rem 0.7rem;
    cursor: pointer;
    transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}

.tema:hover {
    background-color: #e2e2e2;
}

.tema[aria-pressed="true"] {
    background-color: #243d4a;
    border-color: #243d4a;
    color: #fff;
}

.contagem {
    margin-top: 0.9rem;
    font-size: 0.85em;
    color: #777;
}

/* ---- Excertos ---- */

.excerto {
    padding: 2rem 0;
    border-bottom: 1px solid #e0e0e0;
}

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

.excerto.destaque .texto {
    background-color: #fffbe7;
    box-shadow: 0 0 0 0.75rem #fffbe7;
    border-radius: 2px;
}

.texto {
    font-family: "Times New Roman", Times, serif;
    font-size: 1.35em;
    line-height: 1.45;
}

.texto p + p {
    margin-top: 0.8em;
}

.fonte {
    margin-top: 1.1rem;
}

.autoria {
    font-style: normal;
    font-size: 0.9em;
}

.autoria .autor {
    text-transform: uppercase;
    letter-spacing: 0.06em;
    font-weight: bold;
}

.autoria .obra {
    display: block;
    color: #666;
    font-style: italic;
}

.tags {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-top: 0.5rem;
}

.tags button {
    font: inherit;
    font-size: 0.8em;
    color: #6a6a6a;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

.tags button:hover {
    color: #243d4a;
    text-decoration: underline;
}

/* ---- Ações ---- */

.acoes {
    margin-top: 0.9rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    opacity: 0;
    transition: opacity 0.2s;
}

.excerto:hover .acoes,
.excerto:focus-within .acoes {
    opacity: 1;
}

@media (hover: none) {
    .acoes {
        opacity: 1;
    }
}

.acao {
    font: inherit;
    font-size: 0.78em;
    color: #4a4a4a;
    background: none;
    border: 1px solid #c9c9c9;
    border-radius: 4px;
    padding: 0.15rem 0.6rem;
    cursor: pointer;
    transition: background-color 0.2s;
}

.acao:hover {
    background-color: #e2e2e2;
}

.aviso {
    font-size: 0.78em;
    color: #4a7a4a;
}

.vazio,
.erro {
    padding: 2rem 0;
    color: #777;
}

.erro {
    color: #a33;
}

@media (max-width: 600px) {
    body {
        padding: 1rem;
    }

    h1 {
        font-size: 2em;
    }

    .texto {
        font-size: 1.2em;
    }
}
