/* ==========================================================
   lucasberti.com — estilos compartilhados por todas as páginas
   Forma inspirada em fmeireles.com; cores e fontes do site:
   verde, dourado e creme · Playfair Display + Inter
   ========================================================== */

:root {
  --bg:        #F8F6F0;
  --bg-alt:    #F0EDE4;
  --surface:   #FFFFFF;
  --line:      #E5E0D5;
  --line-2:    #D8D1C1;
  --text:      #1A1A1A;
  --muted:     #5F6570;
  --faint:     #6B7280;
  --primary:   #1C3A2E;
  --on-primary:#FFFFFF;
  --accent:    #D4A853;          /* dourado: detalhes, bordas, marcadores */
  --accent-text: #8C6A1F;        /* dourado legível sobre o creme */
  --accent-soft: rgba(212,168,83,.14);

  --serif: 'Playfair Display', Georgia, serif;
  --sans:  'Inter', system-ui, -apple-system, 'Segoe UI', sans-serif;

  --max: 1180px;
  --pad: clamp(1.25rem, 4vw, 2.5rem);
  color-scheme: light;
}
[data-theme="dark"] {
  --bg:        #161a15;
  --bg-alt:    #1b1f1a;
  --surface:   #1e221d;
  --line:      #2e332d;
  --line-2:    #3a4139;
  --text:      #e8e4dc;
  --muted:     #a9b3aa;
  --faint:     #8a9a8e;
  --primary:   #7db885;
  --on-primary:#161a15;
  --accent:    #D4A853;
  --accent-text: #D4A853;
  --accent-soft: rgba(212,168,83,.12);
  color-scheme: dark;
}

/* ── base ── */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 1.5rem; }
body {
  margin: 0; min-height: 100vh; display: flex; flex-direction: column;
  background: var(--bg); color: var(--text);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  transition: background .3s, color .3s;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
::selection { background: var(--accent); color: #1A1A1A; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 2px; }

/* idiomas: mostra só os elementos do idioma ativo */
html:not(.l-pt) [data-l="pt"],
html:not(.l-en) [data-l="en"],
html:not(.l-es) [data-l="es"] { display: none !important; }

.wrap { width: 100%; max-width: var(--max); margin-left: auto; margin-right: auto; padding-left: var(--pad); padding-right: var(--pad); }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 1rem; top: .75rem; z-index: 100; background: var(--primary); color: var(--on-primary); padding: .5rem 1rem; border-radius: 4px; }

/* links de texto: verde, sublinhado ao passar o mouse */
.a, .prose a, .item .by a, .md a, .kv a {
  color: var(--primary); font-weight: 500; text-decoration: none;
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.a:hover, .prose a:hover, .item .by a:hover, .md a:hover, .kv a:hover { border-color: var(--primary); }

/* ── cabeçalho ── */
.site-header { background: var(--bg); }
.nav { display: flex; align-items: center; gap: 1.75rem; height: 64px; }
.brand {
  margin-right: auto; white-space: nowrap; text-decoration: none;
  font-family: var(--serif); font-size: 16px; font-weight: 600; color: var(--text);
}
.brand-mark { display: none; }
.nav-links { display: flex; gap: 1.4rem; }
.nav-links a { font-size: 14.5px; color: var(--muted); text-decoration: none; transition: color .2s; }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--primary); }
.nav-links a[aria-current="page"] { font-weight: 600; }
.nav-tools { display: flex; align-items: center; gap: .5rem; }
.lang-switch { display: flex; border: 1px solid var(--line); border-radius: 4px; overflow: hidden; }
.lang-switch button {
  font: 600 10.5px/1 var(--sans); letter-spacing: .08em;
  padding: .45rem .5rem; border: 0; background: none; color: var(--faint); cursor: pointer;
}
.lang-switch button + button { border-left: 1px solid var(--line); }
.lang-switch button[aria-pressed="true"] { background: var(--primary); color: var(--on-primary); }
.icon-btn {
  width: 30px; height: 30px; display: grid; place-items: center; cursor: pointer;
  border: 0; border-radius: 50%; background: none; color: var(--faint);
}
.icon-btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.lang-switch button:not([aria-pressed="true"]):hover, .icon-btn:hover { color: var(--primary); }
[data-theme="dark"] .i-moon, :root:not([data-theme="dark"]) .i-sun { display: none; }

@media (max-width: 820px) {
  .nav { flex-wrap: wrap; height: auto; padding-top: .8rem; gap: .4rem 1rem; }
  .nav-links { order: 3; width: 100%; gap: 1.3rem; overflow-x: auto; padding-bottom: .5rem; scrollbar-width: none; }
  .nav-links::-webkit-scrollbar { display: none; }
  .nav-links a { white-space: nowrap; }
}

main { flex: 1; padding: clamp(1.5rem, 4vw, 2.5rem) 0 6rem; }

/* ── início: coluna de identidade | sobre ── */
.about-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); max-width: 1000px; margin: 0 auto; }
.about-side {
  display: flex; flex-direction: column; align-items: center; text-align: center;
  padding: 1.5rem 2.5rem 2rem 0; border-right: 1px solid var(--line);
}
.about-main { padding: .5rem 0 2rem 2.75rem; }
.avatar {
  position: relative; width: 210px; aspect-ratio: 1;
  border-radius: 50%; border: 3px solid var(--accent); background: var(--bg-alt);
}
.avatar::before {
  content: ""; position: absolute; inset: -11px;
  border-radius: 50%; border: 2px solid var(--accent); opacity: .45;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.about-name { margin: 1.9rem 0 .2rem; font-family: var(--serif); font-size: 2rem; font-weight: 700; line-height: 1.15; color: var(--primary); }
.about-aff { margin: 0; font-size: 1.2rem; font-weight: 300; color: var(--faint); }
.about-role { margin: .35rem 0 0; font-size: 14px; color: var(--muted); }
.icons { display: flex; flex-wrap: wrap; justify-content: center; gap: .55rem; margin-top: 1.35rem; }
.icons a {
  width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%;
  color: var(--primary); text-decoration: none; transition: background .2s, color .2s;
}
.icons a:hover { background: var(--primary); color: var(--on-primary); }
.icons svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icons .orcid { font: 700 11px/1 var(--sans); letter-spacing: -.02em; border: 1.8px solid currentColor; width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; }

.about-h { margin: 0 0 .9rem; font-family: var(--serif); font-size: 1.8rem; font-weight: 700; color: var(--primary); }
.prose { font-size: 16px; line-height: 1.8; color: var(--text); }
.prose p { margin: 0 0 1.1rem; }
.about-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem 2rem; margin-top: 1.9rem; }
.about-sub { margin: 0 0 .6rem; padding-bottom: .35rem; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 1.15rem; font-weight: 600; color: var(--primary); }
.about-list { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.about-list li { position: relative; padding-left: 1.1rem; margin: .4rem 0; line-height: 1.5; }
.about-list li::before { content: ""; position: absolute; left: 0; top: .55em; width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }
.about-list small { display: block; font-size: 13px; color: var(--faint); }
@media (max-width: 780px) {
  .about-grid { grid-template-columns: 1fr; }
  .about-side { padding: .5rem 0 2rem; border-right: 0; border-bottom: 1px solid var(--line); }
  .about-main { padding: 2rem 0 0; }
  .about-cols { grid-template-columns: 1fr; }
}

/* ── páginas internas: conteúdo + "Nesta página" ── */
.page { display: grid; grid-template-columns: minmax(0, 46rem) 12rem; gap: 4rem; justify-content: center; }
.page:has(> .page-toc[hidden]) { grid-template-columns: minmax(0, 46rem); }
.page-toc { position: sticky; top: 1.5rem; align-self: start; padding-top: .6rem; font-size: 12.5px; line-height: 1.4; }
.page-toc p { margin: 0 0 .5rem; font-weight: 600; color: var(--text); }
.page-toc a { display: block; padding: .28rem 0 .28rem .75rem; border-left: 1px solid var(--line); color: var(--faint); text-decoration: none; }
.page-toc a:hover { color: var(--primary); border-left-color: var(--accent); }
@media (max-width: 1000px) {
  .page, .page:has(> .page-toc[hidden]) { grid-template-columns: minmax(0, 1fr); }
  .page-toc { display: none; }
}

.page-head { margin-bottom: .5rem; }
.page-head h1 { margin: .6rem 0 .2rem; font-family: var(--serif); font-size: clamp(2rem, 4vw, 2.5rem); font-weight: 700; line-height: 1.15; color: var(--primary); }
.subtitle { margin: 0; font-size: 1.2rem; font-weight: 300; line-height: 1.5; color: var(--faint); }
.page-head .btns { margin-top: 1.25rem; }
.page-head .links { margin-top: .9rem; }

.section { margin-top: 2.5rem; }
.h2 { margin: 0 0 1rem; padding-bottom: .45rem; border-bottom: 1px solid var(--line); font-family: var(--serif); font-size: 1.45rem; font-weight: 600; line-height: 1.3; color: var(--primary); }

/* itens (publicações, mídia, cursos, cv) */
.item { padding: .75rem 0 1.15rem; }
.item[hidden] { display: none; }
.it-meta { margin: 0 0 .25rem; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.it-meta .hl { color: var(--accent-text); }
.item h3 { margin: 0 0 .2rem; font-family: var(--serif); font-size: 1.1rem; font-weight: 600; line-height: 1.4; color: var(--text); }
.item h3 a { color: var(--primary); text-decoration: none; transition: color .2s; }
.item h3 a:hover { color: var(--accent-text); }
.item .by { margin: .15rem 0 0; font-size: 14px; color: var(--muted); }
.item .venue { margin: .1rem 0 0; font-family: var(--serif); font-style: italic; font-size: 14.5px; color: var(--muted); }
.item .desc { margin: .35rem 0 0; font-size: 14px; line-height: 1.7; color: var(--muted); }
.item .desc strong { color: var(--text); font-weight: 600; }
.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: .6rem; }
.tag {
  display: inline-block; padding: 2px 8px; border: 0; border-radius: 3px; cursor: pointer;
  font: 500 11.5px/1.6 var(--sans); color: var(--on-primary); background: var(--primary); text-decoration: none;
  transition: opacity .2s;
}
.tag:hover { opacity: .85; }
.tag[aria-expanded="true"] { background: var(--accent-text); }
.abstract { margin: .7rem 0 0; padding-left: .9rem; border-left: 2px solid var(--accent); font-size: 14px; line-height: 1.75; color: var(--muted); }

.btns { display: flex; flex-wrap: wrap; gap: .6rem; }
.btn {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: 8px 16px; border-radius: 4px; border: 1.5px solid var(--primary);
  font-size: 13px; font-weight: 600; color: var(--primary); background: none; text-decoration: none;
  transition: background .2s, color .2s;
}
.btn:hover, .btn-primary { background: var(--primary); color: var(--on-primary); }
.btn-primary:hover { opacity: .88; }
.links { display: flex; flex-wrap: wrap; gap: .3rem 1.2rem; font-size: 13px; }
.links a { color: var(--primary); font-weight: 500; text-decoration: none; }
.links a:hover { text-decoration: underline; }

/* filtros (mídia) */
.chips { display: flex; flex-wrap: wrap; gap: .4rem; margin: .25rem 0 1rem; }
.chip {
  padding: .3rem .75rem; border-radius: 99px; cursor: pointer;
  font: 500 12.5px/1.4 var(--sans); color: var(--muted);
  background: none; border: 1px solid var(--line-2);
}
.chip:hover { color: var(--primary); border-color: var(--primary); }
.chip[aria-pressed="true"] { color: var(--on-primary); background: var(--primary); border-color: var(--primary); }
.chip .n { margin-left: .35rem; opacity: .65; }

/* arquivos */
.files { margin: 0; }
.file { display: flex; align-items: center; gap: .8rem; padding: .6rem 0; text-decoration: none; }
.file .badge { font: 600 10.5px/1.6 var(--sans); padding: 1px 7px; border-radius: 3px; color: var(--on-primary); background: var(--primary); }
.file-name { flex: 1; font-family: var(--serif); font-size: 1.05rem; font-weight: 600; color: var(--primary); }
.file-meta { font-size: 12.5px; color: var(--faint); }
.file:hover .file-name { color: var(--accent-text); }

/* idiomas e contato (cv) */
.kv { display: grid; grid-template-columns: 8rem minmax(0, 1fr); gap: .4rem 1rem; margin: 0; font-size: 14.5px; }
.kv dt { color: var(--faint); }
.kv dd { margin: 0; }
.contact { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 210px), 1fr)); gap: .4rem 1.5rem; }
.contact a { display: block; padding: .45rem 0; text-decoration: none; }
.contact b { display: block; font-size: 11px; font-weight: 600; letter-spacing: .07em; text-transform: uppercase; color: var(--faint); }
.contact span { font-size: 14.5px; font-weight: 500; color: var(--primary); }
.contact a:hover span { text-decoration: underline; }

/* ── rodapé (faixa verde, como no site anterior) ── */
.site-footer { background: var(--primary); padding: 1.75rem 0; font-size: 12.5px; color: rgba(255,255,255,.62); }
[data-theme="dark"] .site-footer { background: var(--bg-alt); border-top: 1px solid var(--line); color: var(--faint); }
.foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .75rem 2rem; }
.foot .links { font-size: 12.5px; }
.foot .links a { color: rgba(255,255,255,.85); font-weight: 400; }
.foot .links a:hover { color: var(--accent); text-decoration: none; }
[data-theme="dark"] .foot .links a { color: var(--muted); }
