/* =========================================================================
   Estilos compartilhados — lucasmurata.com
   Base reproduzida do index.html original (tema claro, Lora itálico nos
   títulos, layout centralizado) + navegação + componentes da seção Livros.
   ========================================================================= */

/* ---- Base ---- */
html {
    scroll-behavior: smooth;
}

body {
    text-align: center;
    font-family: Arial, sans-serif;
    margin: 0;
    padding: 0;
    background-color: #f9f9f9;
    color: #333;
}

/* Âncoras param com folga abaixo da barra fixa (não ficam escondidas) */
[id] {
    scroll-margin-top: 4.5rem;
}

section {
    padding: 30px;
    max-width: 800px;
    margin: 0 auto;
}

h2 {
    text-align: center;
    margin-bottom: 1rem;
    font-family: 'Lora', serif;
    font-style: italic;
}

img {
    display: block;
    margin: 20px auto;
    max-width: 300px;
    height: auto;
}

p {
    font-size: 1.1rem;
    line-height: 1.6;
    margin-bottom: 1rem;
}

ul {
    list-style: none;
    padding: 0;
}

li {
    font-size: 1.1rem;
    margin: 10px 0;
}

a {
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* Nome na barra: cor do texto, sem virar link azul */
.site-bar__name a {
    color: inherit;
}

.site-bar__name a:hover {
    text-decoration: none;
}

/* ---- Refinamentos de estilo ---- */

/* Foto da home: mesma linguagem de moldura/sombra das capas */
.profile-photo {
    border-radius: 6px;
    box-shadow: 0 8px 28px rgba(0, 0, 0, 0.14);
}

/* Livro em destaque na home (capa + texto, link único) */
.featured-book__link {
    display: inline-flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 100%;
    text-align: left;
    color: inherit;
}

.featured-book__link:hover {
    text-decoration: none;
}

.featured-book__cover {
    flex: 0 0 auto;
    width: 130px;
    height: auto;
    margin: 0;
    padding: 7px;
    background-color: #ffffff;
    border-radius: 3px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    transition: box-shadow 0.15s ease;
}

.featured-book__link:hover .featured-book__cover {
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.28);
}

.featured-book__text {
    display: flex;
    flex-direction: column;
}

.featured-book__title {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1.6rem;
    color: #333;
}

.featured-book__subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    color: #777;
    margin-top: 0.1rem;
}

.featured-book__cta {
    margin-top: 0.8rem;
    color: #111;
    text-decoration: underline;
    text-decoration-color: #c4c4c4;
    text-underline-offset: 2px;
}

.featured-book__link:hover .featured-book__cta {
    text-decoration-color: #111;
}

/* Traço discreto sob os títulos de seção, para dar estrutura */
h2 {
    padding-bottom: 0.6rem;
}

h2::after {
    content: "";
    display: block;
    width: 44px;
    height: 1px;
    margin: 0.6rem auto 0;
    background-color: #dcdcdc;
}

/* Links de conteúdo: tratamento editorial sutil (em vez do azul padrão) */
section p a,
section li a {
    color: #111;
    text-decoration: underline;
    text-decoration-color: #c4c4c4;
    text-underline-offset: 2px;
}

section p a:hover,
section li a:hover {
    text-decoration-color: #111;
}

/* Listas de publicações (artigos/traduções): itens com veículo e ano */
.pub-list li {
    line-height: 1.5;
    margin: 0 0 1rem;
}

.pub-list em {
    color: #555;
}

/* ---- Apresentações: miniatura de vídeo clicável (botão de play em CSS) ---- */
.talk__link {
    position: relative;
    display: inline-block;
    line-height: 0;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.talk__thumb {
    display: block;
    margin: 0;
    width: 360px;
    max-width: 100%;
    aspect-ratio: 16 / 9;
    object-fit: cover;
    border-radius: 4px;
}

.talk__link::before {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 54px;
    height: 54px;
    transform: translate(-50%, -50%);
    background-color: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    transition: background-color 0.15s ease;
}

.talk__link::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-40%, -50%);
    border-style: solid;
    border-width: 11px 0 11px 18px;
    border-color: transparent transparent transparent #ffffff;
}

.talk__link:hover::before {
    background-color: rgba(0, 0, 0, 0.75);
}

/* ---- Página de Apresentações: lista de palestras (miniatura + texto) ---- */
.talks {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.talk-entry {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    text-align: left;
}

.talk-entry + .talk-entry {
    border-top: 1px solid #ececec;
    padding-top: 3rem;
}

.talk-entry .talk__link {
    flex: 0 0 auto;
}

.talk-entry .talk__thumb {
    width: 300px;
}

.talk-entry__body {
    flex: 1 1 auto;
    min-width: 0;
}

.talk-entry__title {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1.6rem;
    margin: 0 0 0.3rem;
}

.talk-entry__meta {
    font-family: 'Lora', serif;
    font-style: italic;
    color: #777;
    margin: 0 0 1.2rem;
}

.talk-entry__par {
    margin-bottom: 1rem;
}

.talk-entry__keywords {
    color: #555;
    font-size: 0.95rem;
    margin: 1.2rem 0 0;
}

/* Expansor "ler resumo completo" (nativo, sem JS) */
.talk-entry__more {
    margin-top: 0.25rem;
}

.talk-entry__more summary {
    cursor: pointer;
    display: inline-block;
    margin-bottom: 0.5rem;
    font-family: 'Lora', serif;
    font-style: italic;
    color: #111;
    list-style: none;
}

.talk-entry__more summary::-webkit-details-marker {
    display: none;
}

.talk-entry__more summary::before {
    content: "";
    display: inline-block;
    margin-right: 7px;
    border-style: solid;
    border-width: 5px 0 5px 7px;
    border-color: transparent transparent transparent currentColor;
    transition: transform 0.15s ease;
}

.talk-entry__more[open] summary::before {
    transform: rotate(90deg);
}

.talk-entry__more summary:hover {
    text-decoration: underline;
    text-underline-offset: 2px;
}

.talk-entry__more[open] summary {
    margin-bottom: 1rem;
}

/* ---- Barra principal (nome + menu, fixa ao rolar) ---- */
.site-bar {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
    padding: 0.6rem 1rem;
    background-color: #ffffff;
    border-bottom: 1px solid #ececec;
    text-align: center;
}

.site-bar__name {
    font-family: 'Lora', serif;
    font-style: italic;
    font-weight: 400;
    font-size: 1.2rem;
    color: #333;
    margin: 0;
    white-space: nowrap;
}

.site-bar nav ul {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 0.3rem 1.2rem;
    margin: 0;
}

.site-bar nav li {
    margin: 0;
    font-size: 1rem;
}

.site-bar nav a {
    font-family: 'Lora', serif;
    font-style: italic;
    color: #555;
    padding: 0.2rem 0.05rem;
}

.site-bar nav a:hover,
.site-bar nav a[aria-current="page"] {
    color: #111;
    text-decoration: underline;
}

/* Seletor de idioma (PT · EN) na barra */
.lang-switch {
    display: flex;
    align-items: center;
    font-size: 0.8rem;
}

.lang-switch a,
.lang-switch span {
    font-family: 'Lora', serif;
    font-style: italic;
    color: #999;
}

.lang-switch a:hover {
    color: #111;
    text-decoration: underline;
}

.lang-switch [aria-current="true"] {
    color: #333;
}

.lang-switch > * + *::before {
    content: "·";
    padding: 0 0.45rem;
    color: #ccc;
}

@media (max-width: 600px) {
    .site-bar nav ul {
        gap: 0.2rem 0.9rem;
    }

    .site-bar nav li {
        font-size: 0.95rem;
    }
}

/* ---- Seção Livros (página única: lista de livros completos) ---- */
.books {
    display: flex;
    flex-direction: column;
    gap: 3rem;
}

.book-entry {
    display: flex;
    gap: 2rem;
    align-items: flex-start;
    text-align: left;
}

/* Separador discreto entre livros (a partir do segundo) */
.book-entry + .book-entry {
    border-top: 1px solid #ececec;
    padding-top: 3rem;
}

.book-entry__cover {
    /* Respiro para capas escuras/atmosféricas: leve moldura clara + sombra */
    flex: 0 0 auto;
    align-self: flex-start;
    background-color: #ffffff;
    padding: 10px;
    border-radius: 4px;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
}

.book-entry__cover img {
    display: block;
    margin: 0;
    width: 240px;
    max-width: 100%;
    height: auto;
    border-radius: 2px;
}

.book-entry__body {
    flex: 1 1 auto;
    min-width: 0;
}

.book-entry__title {
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1.9rem;
    margin: 0 0 0.25rem;
}

.book-entry__subtitle {
    font-family: 'Lora', serif;
    font-style: italic;
    color: #777;
    font-size: 1.15rem;
    margin: 0 0 1.2rem;
}

.book-entry__par {
    margin-bottom: 1rem;
}

.book-title-inline {
    font-style: italic;
}

/* ---- Botões de compra ---- */
.book-buy {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-start;
    gap: 0.75rem;
    margin: 1.5rem 0 0.5rem;
}

.btn {
    display: inline-block;
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 1.05rem;
    padding: 0.7rem 1.6rem;
    border-radius: 4px;
    border: 1px solid #111;
    background-color: #111;
    color: #fff;
    cursor: pointer;
    transition: background-color 0.15s ease, color 0.15s ease;
}

.btn:hover {
    background-color: #fff;
    color: #111;
    text-decoration: none;
}

.btn[aria-disabled="true"] {
    background-color: #f1f1f1;
    color: #999;
    border-color: #ddd;
    cursor: default;
    pointer-events: none;
}

.book-buy__soon {
    width: 100%;
    text-align: left;
    color: #999;
    font-size: 0.9rem;
    margin: 0.2rem 0 0;
}

/* ---- Placeholder de capa (caso a imagem falte) ----
   Estética escura/terminal, coerente com a capa de "Deploy final". */
.cover-placeholder {
    width: 240px;
    height: 340px;
    background-color: #0a0a0a;
    color: #4ade80;
    font-family: "Courier New", monospace;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: center;
    gap: 0.4rem;
    padding: 1.2rem;
    box-sizing: border-box;
    text-align: left;
    border-radius: 2px;
}

.cover-placeholder .ph-prompt {
    color: #6b7280;
    font-size: 0.8rem;
}

.cover-placeholder .ph-title {
    color: #e5e7eb;
    font-size: 1.1rem;
    font-weight: bold;
}

.cover-placeholder .ph-caret::after {
    content: "_";
    animation: ph-blink 1.1s steps(1) infinite;
}

@keyframes ph-blink {
    50% { opacity: 0; }
}

/* ---- Rodapé ---- */
.site-footer {
    text-align: center;
    color: #999;
    font-family: 'Lora', serif;
    font-style: italic;
    font-size: 0.9rem;
    padding: 2rem 1rem 2.5rem;
}

.site-footer p {
    font-size: 0.9rem;
    margin: 0;
}

/* ---- Responsivo ---- */
@media (max-width: 600px) {
    section {
        padding: 24px 18px;
    }

    /* Capa acima, texto abaixo; tudo centralizado */
    .book-entry {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.2rem;
    }

    .book-entry__cover {
        align-self: center;
    }

    .book-entry__title {
        font-size: 1.6rem;
    }

    .book-buy {
        justify-content: center;
    }

    .book-buy__soon {
        text-align: center;
    }

    /* Livro em destaque: capa acima, texto abaixo; centralizado */
    .featured-book__link {
        flex-direction: column;
        text-align: center;
        gap: 1rem;
    }

    /* Apresentações: miniatura acima, texto abaixo; centralizado */
    .talk-entry {
        flex-direction: column;
        align-items: center;
        text-align: center;
        gap: 1.2rem;
    }

    .talk-entry .talk__thumb {
        width: 360px;
    }

    .talk-entry__title {
        font-size: 1.35rem;
    }

    .talk-entry__keywords {
        text-align: center;
    }
}
