/* ==========================================================================
   Seção acadêmica (prefixo .ac-): cabeçalho, linha do tempo, temas,
   grade de projetos com filtros e página de projeto.
   ========================================================================== */

/* ---------- Cabeçalho ---------- */
.ac-cabecalho {
  display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 32px; align-items: end;
  padding-bottom: clamp(28px, 4vw, 44px); margin-bottom: clamp(32px, 5vw, 56px);
  border-bottom: 1px solid var(--border);
}
.ac-cabecalho h1 { max-width: 14em; }
.ac-bio { max-width: 660px; }
.ac-bio p:last-child { margin-bottom: 0; }
.ac-perfis { list-style: none; margin: 22px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 10px; }
.ac-perfil { padding: 8px 16px; font-size: .9rem; }

.ac-numeros { display: grid; grid-template-columns: repeat(2, minmax(110px, 1fr)); gap: 10px; margin: 0; }
.ac-numeros div {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px 18px; box-shadow: var(--shadow);
}
.ac-numeros dt { font-size: .75rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 600; }
.ac-numeros dd { margin: 2px 0 0; font-family: var(--font-display); font-size: 2rem; font-weight: 650; line-height: 1.1; color: var(--accent); }

/* ---------- Formação + temas ---------- */
.ac-colunas {
  display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px);
  align-items: start; margin-bottom: clamp(48px, 7vw, 80px);
}
.ac-colunas > :only-child { grid-column: 1 / -1; }

.ac-linha { list-style: none; margin: 24px 0 0; padding: 0; position: relative; }
.ac-linha::before {
  content: ""; position: absolute; left: 21px; top: 8px; bottom: 8px; width: 2px;
  background: linear-gradient(to bottom, var(--accent), var(--border) 85%);
  border-radius: 2px;
}
.ac-marco { position: relative; padding-left: 64px; padding-bottom: 28px; }
.ac-marco:last-child { padding-bottom: 0; }
.ac-marco-ponto {
  position: absolute; left: 0; top: 0; width: 44px; height: 44px; border-radius: 50%;
  display: grid; place-items: center; font-size: 1.2rem;
  background: var(--surface); border: 2px solid var(--border); box-shadow: var(--shadow);
}
.ac-andamento .ac-marco-ponto { border-color: var(--accent); box-shadow: 0 0 0 5px var(--accent-soft); }
.ac-marco-corpo {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px 20px; box-shadow: var(--shadow); position: relative;
}
.ac-marco-corpo::before {
  content: ""; position: absolute; left: -7px; top: 16px; width: 12px; height: 12px;
  background: var(--surface); border-left: 1px solid var(--border); border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
}
.ac-marco-periodo { margin: 0 0 4px; font-size: .85rem; color: var(--muted); font-weight: 500; display: flex; flex-wrap: wrap; align-items: center; gap: 4px; }
.ac-marco-nivel { margin: 0 0 2px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.ac-marco-corpo h3 { margin: 0 0 4px; font-size: 1.25rem; }
.ac-marco-inst { margin: 0; font-weight: 500; }
.ac-marco-inst span { color: var(--muted); font-weight: 400; }
.ac-marco-desc { margin-top: 12px; font-size: .97rem; }
.ac-marco-desc > :last-child { margin-bottom: 0; }
.ac-editar { position: absolute; top: 12px; right: 14px; font-size: .8rem; text-decoration: none; }

.ac-badge {
  display: inline-block; font-size: .72rem; font-weight: 700; padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); color: var(--link); text-transform: none; letter-spacing: 0;
}
.ac-andamento .ac-badge { background: var(--accent); color: var(--accent-text); }

/* Nuvem de temas */
.ac-temas {
  position: sticky; top: 84px;
  background: var(--bg-alt); border: 1px solid var(--border); border-radius: calc(var(--radius) + 4px);
  padding: 22px;
}
.ac-temas h2 { font-size: 1.4rem; margin-bottom: .2em; }
.ac-temas-dica { color: var(--muted); font-size: .88rem; margin-bottom: 16px; }
.ac-nuvem { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.ac-tema {
  --peso: 0;
  display: inline-flex; align-items: center; gap: 6px;
  font-size: calc(.85rem + var(--peso) * .45rem); font-weight: calc(500 + var(--peso) * 200);
  padding: 5px 12px; border-radius: 999px; text-decoration: none;
  background: var(--surface); color: var(--text); border: 1px solid var(--border);
  transition: background .15s, color .15s, border-color .15s;
}
.ac-tema:hover { border-color: var(--accent); color: var(--accent); }
.ac-tema[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: var(--accent-text); }
.ac-tema-qtd {
  font-size: .72rem; font-weight: 700; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 999px;
  display: inline-grid; place-items: center; background: var(--accent-soft); color: var(--link);
}
.ac-tema[aria-pressed="true"] .ac-tema-qtd { background: color-mix(in srgb, var(--accent-text) 25%, transparent); color: inherit; }

/* ---------- Projetos ---------- */
.ac-projetos { scroll-margin-top: 80px; }
.ac-projetos-cab { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; margin-bottom: 18px; }
.ac-projetos-cab h2 { margin: 0; }
.ac-busca {
  display: flex; align-items: center; gap: 8px; min-width: min(100%, 300px);
  background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 0 14px; color: var(--muted);
}
.ac-busca:focus-within { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.ac-busca input { border: 0; background: none; outline: none; padding: 10px 0; flex: 1; min-width: 0; color: var(--text); }
.ac-filtro-qtd { opacity: .6; font-size: .8em; margin-left: 2px; }

.ac-estado { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: -8px 0 18px; color: var(--muted); font-size: .92rem; }
.ac-estado[hidden] { display: none; }
.ac-limpar { border: 0; background: none; color: var(--link); cursor: pointer; font-weight: 600; padding: 4px 0; }

.ac-grade {
  list-style: none; margin: 0; padding: 0;
  display: grid; gap: clamp(16px, 2.5vw, 24px);
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
}
.ac-card { display: flex; flex-direction: column; transition: transform .2s ease, box-shadow .2s ease; }
.ac-card[hidden] { display: none; }
.ac-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.ac-card-imagem { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--bg-alt); }
.ac-card-imagem img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.ac-card:hover .ac-card-imagem img { transform: scale(1.04); }
.ac-sem-imagem { display: grid; place-items: center; width: 100%; height: 100%; font-size: 2.4rem; }
.ac-card-corpo { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.ac-card-meta { margin: 0 0 4px; font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--accent); }
.ac-card h3 { margin: 0 0 6px; font-size: 1.2rem; }
.ac-card h3 a { color: var(--text); text-decoration: none; }
.ac-card h3 a:hover { color: var(--accent); }
.ac-card h3 a::after { content: ""; position: absolute; inset: 0; } /* card inteiro clicável */
.ac-card { position: relative; }
.ac-card-resumo { color: var(--muted); font-size: .94rem; line-height: 1.5; margin-bottom: 12px; }
.ac-card-tags { list-style: none; margin: auto 0 0; padding: 0; position: relative; z-index: 1; }
.ac-tag { border: 0; cursor: pointer; font-family: inherit; }
.ac-tag:hover { background: var(--accent); color: var(--accent-text); }
.ac-tag[aria-pressed="true"] { background: var(--accent); color: var(--accent-text); }

/* Destaque */
.ac-destaque { border-color: color-mix(in srgb, var(--accent) 55%, var(--border)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--accent) 35%, transparent), var(--shadow); }
.ac-fita {
  position: absolute; top: 12px; left: 12px;
  background: var(--accent); color: var(--accent-text); font-size: .75rem; font-weight: 700;
  padding: 4px 10px; border-radius: 999px; box-shadow: var(--shadow);
}

/* ---------- Página do projeto ---------- */
.ac-voltar { margin-bottom: 20px; }
.ac-voltar a { text-decoration: none; font-weight: 600; font-size: .93rem; }
.ac-projeto-cab { max-width: 820px; margin-bottom: clamp(24px, 4vw, 36px); }
.ac-projeto-cab .sobretitulo { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.ac-badge-destaque { background: var(--accent); color: var(--accent-text); }
.ac-projeto-acoes { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 0; }
.ac-projeto-imagem { margin: 0 0 clamp(28px, 4vw, 44px); }
.ac-projeto-imagem a { display: block; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); cursor: zoom-in; }
.ac-projeto-imagem img { width: 100%; max-height: 560px; object-fit: cover; }

.ac-projeto-corpo { display: grid; grid-template-columns: minmax(0, 1fr) 280px; gap: clamp(28px, 5vw, 64px); align-items: start; }
.ac-projeto-ficha { padding: 20px; position: sticky; top: 84px; }
.ac-projeto-ficha dl { margin: 0; display: grid; gap: 16px; }
.ac-projeto-ficha dt { font-size: .75rem; font-weight: 700; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); margin-bottom: 4px; }
.ac-projeto-ficha dd { margin: 0; font-weight: 500; }
.ac-projeto-ficha .etiquetas { list-style: none; margin: 0; padding: 0; }
.ac-projeto-ficha .etiqueta:hover { background: var(--accent); color: var(--accent-text); }

.ac-relacionados { margin-top: clamp(48px, 7vw, 80px); padding-top: clamp(32px, 5vw, 48px); border-top: 1px solid var(--border); }

/* ---------- Responsivo ---------- */
@media (max-width: 900px) {
  .ac-cabecalho { grid-template-columns: minmax(0, 1fr); align-items: start; }
  .ac-numeros { grid-template-columns: repeat(auto-fit, minmax(120px, 1fr)); }
  .ac-colunas { grid-template-columns: minmax(0, 1fr); }
  .ac-temas { position: static; }
  .ac-projeto-corpo { grid-template-columns: minmax(0, 1fr); }
  .ac-projeto-ficha { position: static; }
}
@media (max-width: 520px) {
  .ac-marco { padding-left: 52px; }
  .ac-linha::before { left: 17px; }
  .ac-marco-ponto { width: 36px; height: 36px; font-size: 1rem; }
  .ac-marco-corpo { padding: 16px; }
  .ac-numeros dd { font-size: 1.6rem; }
  .ac-busca { width: 100%; }
}
