/* ==========================================================================
   Personalização do template iPortfolio para o website académico.
   Mantém a identidade visual do template; ajusta contraste (WCAG 2.2 AA),
   acessibilidade e componentes específicos (publicações, tabelas, CV).
   ========================================================================== */

:root {
  /* Acento do template (#149ddd) escurecido para cumprir 4.5:1 em texto sobre branco. */
  --accent-color: #0b6fa4;
  --accent-bright: #149ddd;
  --muted-2: #5a6470;
}
.dark-background {
  --accent-color: #4cc0f0;
}

body { font-size: 1rem; line-height: 1.6; }
a { text-underline-offset: 2px; }
.text-accent { color: var(--accent-color) !important; }
.text-muted-2 { color: var(--muted-2) !important; }
.dark-background .text-muted-2 { color: #b8c2cc !important; }

/* Ligação "saltar para o conteúdo" */
.skip-link {
  position: absolute; left: 1rem; top: -100px; z-index: 10000;
  background: #fff; color: #040b14; padding: .6rem 1rem; border-radius: 4px; font-weight: 600;
}
.skip-link:focus { top: 1rem; }

:focus-visible { outline: 3px solid var(--accent-bright); outline-offset: 2px; }
#main:focus { outline: none; }

/* Cabeçalho lateral */
.header .header-toggle { border: 0; line-height: 1; }
.header .logo .sitename {
  font-size: 24px; margin: 0; font-weight: 700; color: var(--heading-color);
  font-family: var(--heading-font); text-align: center;
}
.header .header-role { color: #a8a9b4; font-size: 13px; margin: 2px 0 12px; }
.header .profile-img img { width: 120px; height: 120px; object-fit: cover; background: #0b6fa4; }
.navmenu a, .navmenu a:focus { color: #b8bac4; }

/* Página inicial */
.hero h1.hero-name {
  margin: 0; font-size: 56px; font-weight: 700; color: var(--heading-color);
}
.hero .hero-affiliation { font-size: 18px !important; margin-top: 12px !important; color: #d8e3ec; }
.hero .typed { color: #fff; border-bottom: 2px solid var(--accent-bright); }
.hero .hero-actions { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 12px; }
.hero:before { background: color-mix(in srgb, #040b14, transparent 30%); }
@media (max-width: 768px) {
  .hero h1.hero-name { font-size: 34px; line-height: 1.2; }
  .hero p { font-size: 18px; }
}

.btn-accent { background: var(--accent-color); border-color: var(--accent-color); color: #fff; }
.btn-accent:hover, .btn-accent:focus { background: #085a86; border-color: #085a86; color: #fff; }
.dark-background .btn-accent { background: #0b6fa4; border-color: #0b6fa4; }
.btn-outline-accent { color: var(--accent-color); border-color: var(--accent-color); }
.btn-outline-accent:hover { background: var(--accent-color); color: #fff; }
.link-arrow { font-weight: 500; text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

.about-photo { border-radius: 8px; max-width: 320px; width: 100%; aspect-ratio: 1; object-fit: cover; background: #0b6fa4; }
.about .content ul li { align-items: flex-start; }
.info-list li { margin-bottom: 8px; font-size: 15px; }

.stats .stats-item .purecounter { color: var(--heading-color); }

.services .service-item .title { font-size: 18px; }
.services .service-item .icon { color: var(--accent-color); }

/* Títulos de secção secundários */
.section-subtitle {
  font-size: 22px; font-weight: 700; margin-bottom: 16px; padding-bottom: 6px;
  border-bottom: 2px solid color-mix(in srgb, var(--accent-color), transparent 70%);
}
.page-title h1 { font-size: 26px; }

/* Listas de etiquetas */
.tag-list { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tag-list li {
  background: color-mix(in srgb, var(--accent-color), transparent 90%);
  border: 1px solid color-mix(in srgb, var(--accent-color), transparent 75%);
  border-radius: 20px; padding: 4px 12px; font-size: 14px;
}
.id-list li { margin-bottom: 6px; }

/* Indicadores */
.indicator {
  background: var(--surface-color); border: 1px solid #e3e8ee; border-radius: 8px; padding: 14px; height: 100%;
  display: flex; flex-direction: column;
}
.indicator-value { font-size: 28px; font-weight: 700; color: var(--heading-color); font-family: var(--heading-font); }
.indicator-label { font-weight: 500; }
.indicator-source { font-size: 12px; color: var(--muted-2); }
.biblio-card {
  background: var(--surface-color); border: 1px solid #e3e8ee; border-radius: 8px; padding: 14px 16px; height: 100%;
}
.biblio-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: baseline; gap: 4px 12px; margin-bottom: 8px; }
.biblio-head h3 { color: var(--heading-color); }
.biblio-table { --bs-table-bg: transparent; }
.biblio-table th[scope="row"] { font-weight: 500; }
.biblio-table td:nth-child(2) { font-family: var(--heading-font); font-size: 18px; white-space: nowrap; }
.biblio-table td.biblio-na { font-family: inherit; font-size: 14px; font-style: italic; }

/* Publicações */
.pub-filters .form-label { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.pub-group {
  font-size: 22px; font-weight: 700; margin: 28px 0 8px; color: var(--accent-color);
  border-bottom: 1px solid #dfe6ec; padding-bottom: 4px;
}
.pub-list { padding-left: 1.4rem; margin: 0; }
.pub-item { margin-bottom: 16px; padding-left: 4px; }
.pub-item::marker { color: var(--muted-2); font-size: 14px; }
.pub-type {
  display: inline-block; font-size: 12px; text-transform: uppercase; letter-spacing: .03em; font-weight: 600;
  color: var(--accent-color); margin-right: 6px;
}
.pub-title { font-weight: 600; color: var(--heading-color); }
.pub-links { display: block; font-size: 14px; margin-top: 2px; }
.pub-links a { word-break: break-all; }
.pub-ids { font-size: 14px; color: var(--muted-2); }
.pub-list.compact .pub-item { margin-bottom: 10px; font-size: 15px; }

/* Cartões */
.card-box {
  background: var(--surface-color); border: 1px solid #e3e8ee; border-radius: 8px; padding: 22px;
  box-shadow: 0 2px 12px rgba(4, 11, 20, .04);
}
.dl-compact { display: grid; grid-template-columns: max-content 1fr; gap: 4px 14px; font-size: 15px; margin: 12px 0; }
.dl-compact dt { font-weight: 600; }
.dl-compact dd { margin: 0; }
@media (max-width: 576px) { .dl-compact { grid-template-columns: 1fr; } .dl-compact dd { margin-bottom: 6px; } }

.skill-card { background: var(--surface-color); border-left: 3px solid var(--accent-color); padding: 12px 16px; border-radius: 4px; height: 100%; }
.skill-cat { font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: var(--accent-color); font-weight: 600; }

.activity-list { list-style: none; padding: 0; margin: 12px 0 0; }
.activity-list li { padding: 10px 0; border-top: 1px solid #eef1f4; }
.activity-list li:first-child { border-top: 0; }

/* Docência */
.unit-list { list-style: none; padding: 0; margin: 0; }
.unit-list li { padding: 8px 0; border-bottom: 1px solid #eef1f4; }
.unit-years { float: right; font-size: 14px; color: var(--muted-2); margin-left: 8px; }
.data-table { font-size: 15px; }
.data-table thead th { background: color-mix(in srgb, var(--accent-color), transparent 90%); font-weight: 600; }
.col-period { width: 11rem; }
details.collapsible { margin: 18px 0; }
details.collapsible > summary { cursor: pointer; font-weight: 600; padding: 6px 0; }
details.collapsible > summary .resume-title { font-size: 20px; margin: 0; }

/* Resume (títulos de níveis semânticos diferentes, mesmo aspeto) */
.resume .resume-item h3, .resume .resume-item h2 {
  line-height: 18px; font-size: 18px; font-weight: 600; text-transform: uppercase;
  color: color-mix(in srgb, var(--default-color), transparent 20%); margin-bottom: 10px;
}

/* Contactos */
.contact .info-wrap { background: var(--surface-color); padding: 26px; box-shadow: 0 0 20px rgba(0,0,0,.08); border-radius: 6px; }
.contact .info-item { margin-bottom: 22px; }
.contact .info-item i {
  font-size: 20px; color: var(--accent-color); background: color-mix(in srgb, var(--accent-color), transparent 92%);
  width: 44px; height: 44px; display: flex; justify-content: center; align-items: center; border-radius: 50%; margin-right: 15px;
}
.contact .info-item h3 { padding: 0; font-size: 18px; font-weight: 700; margin-bottom: 4px; }
.contact .info-item p { margin-bottom: 0; font-size: 15px; word-break: break-word; }
.link-cards { list-style: none; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 12px; margin-bottom: 28px; }
.link-cards li { display: flex; gap: 12px; align-items: flex-start; background: var(--surface-color); border: 1px solid #e3e8ee; border-radius: 8px; padding: 12px 14px; }
.link-cards i { font-size: 22px; color: var(--accent-color); }
.link-cards a, .link-cards span { display: block; font-size: 14px; word-break: break-all; }

/* CV */
.cv-header { border-left: 4px solid var(--accent-color); padding-left: 16px; margin-bottom: 24px; }
.cv-page .resume-title { font-size: 22px; margin-top: 28px; }

.footer .credits { font-size: 12px; }
.footer .credits a, .pub-links a, .content a, p a { text-decoration: underline; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  [data-aos] { opacity: 1 !important; transform: none !important; }
}

/* Fotografia de fundo: pessoa à direita — manter visível em ecrãs estreitos */
.hero img { object-position: 72% center; }
@media (max-width: 768px) { .hero img { object-position: 78% center; } .hero:before { background: color-mix(in srgb, #040b14, transparent 20%); } }

/* Página de orientações */
.sup-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }
.sup-nav a { border: 1px solid color-mix(in srgb, var(--accent-color), transparent 60%); border-radius: 20px; padding: 4px 14px; font-size: 14px; text-decoration: none; }
.sup-nav a:hover, .sup-nav a:focus { background: var(--accent-color); color: #fff; }
.sup-level { color: var(--accent-color); font-weight: 700; margin-top: 8px; }
section[id], div[id^="concluidas-"] { scroll-margin-top: 20px; }
