/*
Theme Name: LIACC
Theme URI: https://liacc.ufp.pt/
Author: LIACC @ UFP — Universidade Fernando Pessoa
Description: Tema do LIACC @ UFP (Artificial Intelligence and Computer Science Laboratory, Universidade Fernando Pessoa). Sem frameworks, sem jQuery, fontes servidas localmente.
Version: 2.0.0
Requires at least: 6.3
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: http://www.gnu.org/licenses/gpl-2.0.html
Text Domain: liacc
*/

/* =========================================================================
   1. Tokens
   ========================================================================= */

:root {
	--bg:        #fafaf8;
	--navy:      #0a3b5c;
	--navy-2:    #1a4766;
	--ink:       #112331;
	--ink-2:     #40515d;
	--muted:     #5a6975;
	--line:      #dfe4e6;
	--panel:     #e4ecf2;
	--link:      #1c5d94;
	--on-navy:   #ffffff;
	--on-navy-2: #c5d5e1;
	--rule-navy: #5d92b6;

	--f-head: 'Bricolage Grotesque', 'Helvetica Neue', Arial, sans-serif;
	--f-body: 'Newsreader', Georgia, 'Times New Roman', serif;
	--f-mono: 'IBM Plex Mono', ui-monospace, 'SF Mono', Menlo, Consolas, monospace;

	--wrap: 67.5rem;
	--gap:  2rem;
}

/* =========================================================================
   2. Base
   ========================================================================= */

*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
	margin: 0;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 1.0625rem;
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

img, iframe, video { max-width: 100%; }
img { height: auto; }

a { color: var(--link); text-underline-offset: .18em; text-decoration-thickness: 1px; }
a:hover { color: var(--navy); }

:focus-visible { outline: 2px solid var(--link); outline-offset: 3px; }

h1, h2, h3, h4 {
	font-family: var(--f-head);
	color: var(--navy);
	line-height: 1.12;
	letter-spacing: -.02em;
	margin: 0;
}

[hidden] { display: none !important; }

.wrap {
	width: 100%;
	max-width: calc(var(--wrap) + 3rem);
	margin-inline: auto;
	padding-inline: 1.5rem;
}

.label {
	font-family: var(--f-mono);
	font-size: .6875rem;
	font-weight: 400;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--muted);
	line-height: 1.5;
	margin: 0;
}

.lede {
	max-width: 36rem;
	font-size: 1.125rem;
	margin: 0 0 2rem;
}

.skip {
	position: absolute;
	left: -999px;
	top: 0;
	background: var(--navy);
	color: #fff;
	padding: .75rem 1rem;
	z-index: 10;
}
.skip:focus { left: 0; color: #fff; }

/* =========================================================================
   3. Cabeçalho
   ========================================================================= */

.site-header { border-bottom: 1px solid var(--line); background: var(--bg); }

.site-header__in {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1.5rem;
	min-height: 4.25rem;
}

.brand { text-decoration: none; display: grid; gap: .1rem; }
.brand__mark {
	font-family: var(--f-head);
	font-weight: 800;
	font-size: 1.25rem;
	letter-spacing: -.03em;
	color: var(--navy);
	line-height: 1;
}
.brand__sub { font-size: .625rem; }

.nav__list {
	display: flex;
	gap: 1.5rem;
	list-style: none;
	margin: 0;
	padding: 0;
}
.nav__list a {
	display: block;
	padding: .5rem 0 .375rem;
	border-bottom: 2px solid transparent;
	font-family: var(--f-head);
	font-size: .875rem;
	font-weight: 500;
	color: var(--navy);
	text-decoration: none;
	white-space: nowrap;
}
.nav__list a:hover,
.nav__list .current-menu-item > a,
.nav__list .current_page_item > a,
.nav__list .current-page-ancestor > a,
.nav__list .current_page_ancestor > a { border-bottom-color: var(--navy); }

.nav-toggle {
	display: none;
	background: none;
	border: 1px solid var(--line);
	border-radius: 3px;
	padding: .5rem .75rem;
	cursor: pointer;
}
.nav-toggle .label { color: var(--navy); }

/* =========================================================================
   4. Página inicial
   ========================================================================= */

.hero {
	position: relative;
	background: var(--navy) var(--hero-sm, none) center / cover no-repeat;
	color: var(--on-navy);
	isolation: isolate;
}
@media (min-width: 900px) {
	.hero { background-image: var(--hero-lg, none); }
}
.hero::before {
	content: '';
	position: absolute;
	inset: 0;
	z-index: -1;
	background: linear-gradient(90deg, rgba(9, 34, 54, .93) 0%, rgba(9, 38, 60, .82) 55%, rgba(10, 45, 70, .66) 100%);
}
/* Sequência de imagens com zoom lento e transição suave («efeito vídeo»).
   Quatro imagens, 7 s cada; as imagens seguintes só carregam depois da página. */
.hero { overflow: hidden; }
.hero__slides { position: absolute; inset: 0; z-index: -2; }
.hero__slide {
	position: absolute;
	inset: 0;
	background: center / cover no-repeat;
	opacity: 0;
	animation: hero-slide 28s linear infinite;
	will-change: opacity, transform;
}
.hero__slide:nth-child(2) { animation-delay: 7s; transform-origin: 80% 30%; }
.hero__slide:nth-child(3) { animation-delay: 14s; transform-origin: 20% 70%; }
.hero__slide:nth-child(4) { animation-delay: 21s; transform-origin: 70% 80%; }
@keyframes hero-slide {
	0%   { opacity: 0; transform: scale(1); }
	5%   { opacity: 1; }
	25%  { opacity: 1; }
	31%  { opacity: 0; transform: scale(1.14); }
	100% { opacity: 0; transform: scale(1.14); }
}
@media (prefers-reduced-motion: reduce) {
	.hero__slide { animation: none; }
}

.hero__in { padding-block: 5.5rem 5rem; }
.hero .label { color: var(--on-navy-2); }
.hero__title {
	max-width: 10em;
	margin: .75rem 0 1.5rem;
	color: #fff;
	font-size: clamp(2.5rem, 6vw, 4.25rem);
	font-weight: 700;
	line-height: 1.02;
	letter-spacing: -.035em;
}
.hero__sub {
	max-width: 16em;
	margin: -.5rem 0 1.5rem;
	font-family: var(--f-head);
	font-size: clamp(1.375rem, 3vw, 1.875rem);
	font-weight: 600;
	line-height: 1.15;
	letter-spacing: -.02em;
	color: #fff;
}
/* O subtítulo faz parte do h1: bloco próprio, mesmo espaço de antes. */
.hero__title .hero__sub { display: block; margin: 1rem 0 0; }
.hero__lede {
	max-width: 24rem;
	margin: 0 0 2rem;
	font-size: 1.3125rem;
	line-height: 1.45;
	color: #fff;
}

.btn {
	display: inline-block;
	background: #fff;
	color: var(--navy);
	padding: .75rem 1.125rem;
	border-radius: 3px;
	font-family: var(--f-head);
	font-size: .8125rem;
	font-weight: 600;
	text-decoration: none;
}
.btn:hover { background: var(--panel); color: var(--navy); }

.btn--cta { background: var(--navy); color: #fff; white-space: nowrap; }
.btn--cta:hover { background: var(--ink); color: #fff; }
.nav { display: flex; align-items: center; gap: 1.75rem; }

/* Botão Collaborate + seletor de língua: mesma altura, lado a lado. */
.nav__actions { display: flex; align-items: center; gap: .5rem; }
.nav__actions .btn,
.lang-switch {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	height: 2.75rem;
	line-height: 1;
}
.nav__actions .btn { padding-block: 0; }

/* Seletor de língua (EN / PT) */
.lang-switch {
	min-width: 2.75rem;
	padding: 0 .875rem;
	border: 1px solid var(--line);
	border-radius: 3px;
	font-size: .75rem;
	color: var(--navy);
	text-decoration: none;
}
.lang-switch:hover { border-color: var(--navy); color: var(--navy); }

.cta { border-top: 1px solid var(--line); background: var(--panel); }
.cta__in { display: flex; align-items: center; justify-content: space-between; gap: 2rem; padding-block: 3rem; }
.cta__title { margin-bottom: .5rem; font-size: clamp(1.5rem, 3.5vw, 2rem); font-weight: 700; letter-spacing: -.03em; }
.cta p { max-width: 34rem; margin: 0; color: var(--ink-2); }
.cta + .site-footer { margin-top: 0; }

.stats {
	display: grid;
	grid-template-columns: repeat(5, 1fr);
	margin: 0;
	border-bottom: 1px solid var(--line);
}
.stats__cell {
	display: flex;
	flex-direction: column;
	padding: 1.25rem 1rem 1.5rem;
	border-left: 1px solid var(--line);
}
.stats__cell:first-child { border-left: 0; }
.stats__n {
	margin: 0 0 .5rem;
	font-family: var(--f-head);
	font-size: 2rem;
	font-weight: 700;
	letter-spacing: -.03em;
	color: var(--navy);
	line-height: 1.1;
}
.stats .label { font-size: .625rem; }

.section { padding-block: 3.5rem 4.5rem; }
.section--ruled { border-top: 1px solid var(--line); margin-top: 3.5rem; padding-bottom: 2rem; }

.section__title {
	font-size: clamp(2rem, 4.5vw, 2.75rem);
	font-weight: 700;
	letter-spacing: -.035em;
	margin-bottom: 2.5rem;
}
.section__title--ruled { border-top: 1px solid var(--line); padding-top: 1.75rem; }

.section__head {
	display: flex;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1.5rem;
	margin-bottom: 2.5rem;
}
.section__head .section__title { margin-bottom: 0; }
.section__actions { display: flex; align-items: baseline; gap: 1.5rem; }

/* Destaque que roda (página inicial, Research); a animação está em site.js */
.rotator__toggle {
	padding: 0 0 .5rem;
	border: 0;
	background: none;
	cursor: pointer;
	font-size: .625rem;
}
.rotator__toggle:hover { text-decoration: underline; }
.band .rotator__toggle { color: var(--on-navy-2); }

.more {
	font-family: var(--f-head);
	font-size: .8125rem;
	font-weight: 600;
	color: var(--navy);
	text-decoration: none;
	white-space: nowrap;
	padding-bottom: .5rem;
}
.more:hover { text-decoration: underline; }

.areas {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 2.5rem 4.5rem;
}
.area {
	border-top: 2px solid var(--navy);
	padding: 1.25rem 0 1rem;
}
.area h3 {
	max-width: 13em;
	margin-bottom: .625rem;
	font-size: 1.375rem;
	font-weight: 600;
}
.area h3 a { color: inherit; text-decoration: none; }
.area h3 a:hover { text-decoration: underline; text-underline-offset: .15em; }
.area p { max-width: 17rem; margin: 0; font-size: .9375rem; line-height: 1.5; color: var(--ink-2); }

/* Faixa azul (Projects na página inicial) */
.band { background: var(--navy); color: var(--on-navy); }
.band .section__title,
.band .more,
.band .card__title a { color: #fff; }
.band .section__title--ruled { border-top-color: rgba(255, 255, 255, .16); }
.band .label { color: var(--on-navy-2); }
.band .card__text { color: var(--on-navy-2); }
.band .card__body { border-top-color: var(--rule-navy); }
.band .card__media--empty { background-color: var(--navy-2); }

/* =========================================================================
   5. Cartões e grelhas
   ========================================================================= */

.grid { display: grid; gap: 3rem var(--gap); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

.card { display: flex; flex-direction: column; min-width: 0; }

.card__media {
	display: block;
	aspect-ratio: 3 / 2;
	margin-bottom: 1.25rem;
	border-radius: 2px;
	overflow: hidden;
	background: var(--panel);
}
.card__media img { width: 100%; height: 100%; object-fit: cover; display: block; }
.card__media--empty {
	display: grid;
	place-items: end start;
	padding: 1rem;
	background: var(--navy) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='360' height='240' viewBox='0 0 360 240'%3E%3Cg fill='none' stroke='%235d92b6' stroke-opacity='.45' stroke-width='1'%3E%3Cpath d='M30 190 96 120 170 150 236 70 318 96M96 120 120 40 236 70M170 150 214 214 318 96M30 190 170 150M120 40 30 60 96 120M214 214 330 200 318 96'/%3E%3C/g%3E%3Cg fill='%237fb0d2'%3E%3Ccircle cx='30' cy='190' r='3'/%3E%3Ccircle cx='96' cy='120' r='5'/%3E%3Ccircle cx='170' cy='150' r='3.5'/%3E%3Ccircle cx='236' cy='70' r='5'/%3E%3Ccircle cx='318' cy='96' r='3'/%3E%3Ccircle cx='120' cy='40' r='3'/%3E%3Ccircle cx='214' cy='214' r='3'/%3E%3Ccircle cx='30' cy='60' r='2.5'/%3E%3Ccircle cx='330' cy='200' r='2.5'/%3E%3C/g%3E%3Cg fill='none' stroke='%237fb0d2' stroke-opacity='.35'%3E%3Ccircle cx='96' cy='120' r='14'/%3E%3Ccircle cx='96' cy='120' r='26'/%3E%3Ccircle cx='236' cy='70' r='14'/%3E%3Ccircle cx='236' cy='70' r='26'/%3E%3C/g%3E%3C/svg%3E") center / cover no-repeat;
	text-decoration: none;
}
.card__media--empty span {
	font-family: var(--f-mono);
	font-size: .625rem;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--on-navy-2);
}

.card__body { border-top: 2px solid var(--navy); padding-top: 1.25rem; }
.card__body .label { font-size: .625rem; margin-bottom: 1.25rem; }

.card__title {
	max-width: 19em;
	margin-bottom: .5rem;
	font-size: 1.0625rem;
	font-weight: 600;
	line-height: 1.22;
	letter-spacing: -.015em;
}
.card__title a { color: var(--navy); text-decoration: none; }
.card__title a:hover { text-decoration: underline; }
.card__text { margin: 0; font-size: .875rem; line-height: 1.5; color: var(--ink-2); }

.card--feature {
	display: grid;
	grid-template-columns: 1.36fr 1fr;
	gap: var(--gap) 3.25rem;
	align-items: center;
	margin-bottom: 3rem;
}
.card--feature .card__media { aspect-ratio: 16 / 10; margin-bottom: 0; }
.card--feature .card__body { padding-top: .5rem; }
.card--feature .card__body .label { margin-bottom: 1.5rem; }
.card--feature .card__title { font-size: 1.625rem; line-height: 1.15; letter-spacing: -.025em; margin-bottom: .75rem; }
.card--feature .card__text { max-width: 15.5rem; font-size: 1rem; line-height: 1.55; }

/* Financiamento em Research (no tema Funding dos cartões): imagem e texto. */
.funding {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 0 var(--gap);
	align-items: start;
}
.funding .card__media { margin-bottom: 0; }
.funding__body {
	grid-column: span 2;
	border-top: 2px solid var(--navy);
	padding-top: 1.25rem;
}
.funding__body .card__title { max-width: none; font-size: 1.375rem; letter-spacing: -.02em; margin-bottom: .75rem; }
.funding__text { max-width: 40rem; margin: 0 0 1.5rem; font-size: 1rem; line-height: 1.55; color: var(--ink-2); }
.funding__facts {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 1rem var(--gap);
	margin: 0 0 1.5rem;
}
.funding__facts dt { font-size: .625rem; margin-bottom: .25rem; }
.funding__facts dd { margin: 0; font-size: .9375rem; line-height: 1.45; overflow-wrap: anywhere; }
.funding__foot {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem var(--gap);
	flex-wrap: wrap;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
}
.funding__logos { display: block; width: 100%; max-width: 26rem; height: auto; }
.funding__foot .more { padding-bottom: 0; }

.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
}

/* =========================================================================
   6. Páginas interiores
   ========================================================================= */

.pagehead {
	padding: 3.25rem 0 2rem;
	margin-bottom: 2.5rem;
	border-bottom: 1px solid var(--line);
}
.crumbs { margin-bottom: .75rem; font-size: .625rem; }
.crumbs a { color: inherit; text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.pagehead__title {
	font-size: clamp(2.25rem, 5.5vw, 3rem);
	font-weight: 800;
	letter-spacing: -.04em;
}
.pagehead__title--long { font-size: clamp(1.75rem, 4vw, 2.25rem); letter-spacing: -.03em; max-width: 22em; }
.pagehead__meta {
	margin: .75rem 0 0;
	font-family: var(--f-mono);
	font-size: .75rem;
	color: var(--muted);
}

.prose { max-width: 36rem; margin: 0 auto 4rem; }
.prose > :first-child { margin-top: 0; }
.prose p { margin: 0 0 1.125rem; }
.prose h1, .prose h2 { font-size: 1.625rem; font-weight: 700; margin: 2.5rem 0 1rem; }
.prose h3 { font-size: 1.25rem; font-weight: 600; margin: 2rem 0 .75rem; }
.prose h4 { font-size: 1.0625rem; font-weight: 600; margin: 1.75rem 0 .5rem; }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 1.125rem; }
.prose li { margin-bottom: .375rem; }
.prose img { border-radius: 2px; }
.prose figure { margin: 2rem 0; }
.prose figcaption { font-size: .875rem; color: var(--muted); margin-top: .5rem; }
.prose .tiled-gallery__gallery { display: grid; grid-template-columns: repeat(3, 1fr); gap: .5rem; margin: 2rem 0; }
.prose .tiled-gallery__row, .prose .tiled-gallery__col { display: contents; }
.prose .tiled-gallery__item { margin: 0; }
.prose .tiled-gallery__item img { display: block; width: 100%; aspect-ratio: 1; object-fit: cover; }
.prose iframe { display: block; width: 100%; aspect-ratio: 16 / 9; height: auto; margin: 0 auto 1.5rem; border: 0; }
.prose table { width: 100%; border-collapse: collapse; margin: 0 0 1.5rem; font-size: .9375rem; display: block; overflow-x: auto; }
.prose th, .prose td { border-bottom: 1px solid var(--line); padding: .5rem .75rem .5rem 0; text-align: left; vertical-align: top; }
.prose .wp-block-table { margin: 0 0 1.5rem; }
.prose .wp-block-table table { margin: 0; }
.prose .wp-block-table th,
.prose .wp-block-table td { border: 0; border-bottom: 1px solid var(--line); padding: .5rem 1.5rem .5rem 0; }
.prose .wp-block-table td:first-child { color: var(--ink-2); white-space: nowrap; }
.prose blockquote { margin: 1.5rem 0; padding-left: 1.25rem; border-left: 2px solid var(--navy); color: var(--ink-2); }
.prose pre { overflow-x: auto; background: var(--panel); padding: 1rem; font-size: .8125rem; }
.prose figure.prose__lead { margin: 0 0 2rem; }
.prose__lead img { display: block; width: 100%; border-radius: 3px; }

.prose iframe.map { aspect-ratio: 4 / 3; margin-bottom: .75rem; border: 1px solid var(--line); border-radius: 3px; }

.postnav {
	display: flex;
	justify-content: space-between;
	gap: 2rem;
	margin-bottom: 4rem;
	padding-top: 1.5rem;
	border-top: 1px solid var(--line);
	font-family: var(--f-head);
	font-size: .875rem;
}
.postnav span { max-width: 45%; }
.postnav span:last-child { text-align: right; margin-left: auto; }
.postnav a { color: var(--navy); text-decoration: none; }
.postnav a:hover { text-decoration: underline; }

/* Formulário (Contact Form 7) */
.wpcf7 form { display: grid; gap: 1.25rem; margin: 2rem 0 0; padding: 1.5rem; background: var(--panel); border-radius: 4px; }
.wpcf7 form p { margin: 0; }
.wpcf7 label { display: block; font-family: var(--f-mono); font-size: .6875rem; letter-spacing: .12em; text-transform: uppercase; color: var(--ink-2); }
.wpcf7 input[type="text"],
.wpcf7 input[type="email"],
.wpcf7 select,
.wpcf7 textarea {
	display: block;
	width: 100%;
	margin-top: .5rem;
	padding: .625rem .75rem;
	border: 1px solid #cfdae2;
	border-radius: 3px;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: 1rem;
	letter-spacing: 0;
	text-transform: none;
}
.wpcf7 textarea { min-height: 9rem; resize: vertical; }
.wpcf7 .hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.wpcf7 .wpcf7-acceptance label,
.wpcf7 .wpcf7-list-item label { font-family: var(--f-body); font-size: .875rem; letter-spacing: 0; text-transform: none; color: var(--ink); }
.wpcf7 .wpcf7-list-item { margin: 0; }
.wpcf7 input[type="submit"] {
	padding: .75rem 1.25rem;
	border: 0;
	border-radius: 3px;
	background: var(--navy);
	color: #fff;
	font-family: var(--f-head);
	font-size: .875rem;
	font-weight: 600;
	cursor: pointer;
}
.wpcf7 input[type="submit"]:hover { background: var(--ink); }
.wpcf7 .wpcf7-not-valid-tip { margin-top: .375rem; font-family: var(--f-body); font-size: .8125rem; letter-spacing: 0; text-transform: none; color: #a4262c; }
.wpcf7 form .wpcf7-response-output { margin: 0; padding: .75rem 1rem; border: 1px solid var(--navy); border-radius: 3px; background: var(--bg); font-size: .9375rem; }

/* News */
.chips { display: flex; flex-wrap: wrap; gap: .5rem; margin: -.5rem 0 2rem; }
.chip {
	padding: .375rem .625rem;
	border: 1px solid var(--line);
	border-radius: 3px;
	font-family: var(--f-mono);
	font-size: .625rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-2);
	text-decoration: none;
}
.chip:hover { border-color: var(--navy); color: var(--navy); }
.chip.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }

.pagination {
	display: flex;
	gap: .375rem;
	align-items: center;
	margin: 3.5rem 0 4rem;
	padding-top: 1.25rem;
	border-top: 1px solid var(--line);
	font-family: var(--f-mono);
	font-size: .6875rem;
}
.pagination .page-numbers {
	min-width: 1.75rem;
	padding: .375rem .5rem;
	border-radius: 3px;
	text-align: center;
	color: var(--navy);
	text-decoration: none;
}
.pagination a.page-numbers:hover { background: var(--panel); }
.pagination .current { background: var(--navy); color: #fff; }

/* Members */
.people { margin-bottom: 3rem; }
.people .section__title { margin-bottom: 1.25rem; }
.people__list { list-style: none; margin: 0; padding: 0 0 0 1.25rem; display: grid; gap: 2rem var(--gap); }
.people__list--cards { grid-template-columns: repeat(4, 1fr); }
.people__list--names { grid-template-columns: repeat(5, 1fr); gap: 2.25rem var(--gap); padding-top: .5rem; }

.person { display: flex; flex-direction: column; align-items: flex-start; }
.person__photo {
	width: 100%;
	aspect-ratio: 1;
	margin-bottom: .75rem;
	border-radius: 3px;
	overflow: hidden;
	background: var(--panel);
}
.person__photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.person__name {
	font-family: var(--f-head);
	font-size: .875rem;
	font-weight: 600;
	color: var(--navy);
	line-height: 1.3;
}
.person__name a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .25em; }
.person__email { margin-top: .375rem; font-size: .75rem; }
.person__interests { margin-top: .5rem; font-size: .8125rem; line-height: 1.45; color: var(--ink-2); }
.person__links { display: flex; gap: .875rem; margin-top: .625rem; font-size: .625rem; }
.person__links a { color: var(--link); text-decoration: none; }
.person__links a:hover { text-decoration: underline; }

/* Publications */
.filters {
	display: grid;
	grid-template-columns: 2fr 1.3fr 1fr 1fr;
	gap: 1rem;
	padding: 1.25rem;
	margin-bottom: 2rem;
	background: var(--panel);
	border-radius: 4px;
}
.filters__field { display: grid; gap: .5rem; min-width: 0; }
.filters .label { font-size: .625rem; color: var(--ink-2); }
.filters input,
.filters select {
	width: 100%;
	height: 2.25rem;
	padding: 0 .75rem;
	border: 1px solid #cfdae2;
	border-radius: 3px;
	background: var(--bg);
	color: var(--ink);
	font-family: var(--f-body);
	font-size: .875rem;
}

.pubs__count { margin: 0 0 2rem; font-family: var(--f-mono); font-size: .6875rem; color: var(--muted); }

.pubyear {
	display: grid;
	grid-template-columns: 5.5rem 1fr;
	padding: 1.5rem 0 1rem;
	border-top: 1px solid var(--line);
}
.pubyear__label {
	font-family: var(--f-mono);
	font-size: 1.0625rem;
	font-weight: 400;
	letter-spacing: 0;
	color: var(--muted);
	line-height: 1.5;
}
.pubyear__list { list-style: none; margin: 0; padding: 0; min-width: 0; }

.pub { margin-bottom: 2.5rem; }
.pub__title { margin-bottom: .25rem; font-size: 1.0625rem; font-weight: 600; line-height: 1.3; letter-spacing: -.015em; }
.pub__authors { margin: 0 0 .25rem; font-size: .8125rem; line-height: 1.5; }
.pub__venue { margin: 0 0 .5rem; font-size: .8125rem; font-style: italic; color: var(--ink-2); line-height: 1.5; }
.pub__tags { display: flex; flex-wrap: wrap; gap: .375rem; margin: 0 0 .875rem; }
.tag {
	padding: .25rem .5rem;
	border-radius: 2px;
	background: var(--panel);
	font-family: var(--f-mono);
	font-size: .5625rem;
	letter-spacing: .12em;
	text-transform: uppercase;
	color: var(--ink-2);
}
.pub__links { display: flex; gap: 1rem; margin-bottom: .875rem; font-size: .625rem; }
.pub__links a { color: var(--link); text-decoration: none; }
.pub__links a:hover { text-decoration: underline; }

.pub__bib summary { cursor: pointer; display: inline-block; list-style: none; font-size: .625rem; color: var(--link); }
.pub__bib summary::-webkit-details-marker { display: none; }
.pub__bib summary::before { content: '+ '; }
.pub__bib[open] summary::before { content: '− '; }
.pub__bib pre {
	margin: .75rem 0 0;
	padding: 1rem;
	overflow-x: auto;
	background: var(--panel);
	border-radius: 3px;
	font-family: var(--f-mono);
	font-size: .75rem;
	line-height: 1.6;
	white-space: pre-wrap;
	word-break: break-word;
}

/* =========================================================================
   7. Rodapé
   ========================================================================= */

.site-footer {
	margin-top: 2rem;
	padding: 4.5rem 0 1.5rem;
	background: var(--navy);
	color: var(--on-navy-2);
	font-size: .8125rem;
	line-height: 1.6;
}
.site-footer__cols {
	display: grid;
	grid-template-columns: 1fr 1fr 1fr;
	gap: 2.5rem 6rem;
	padding-bottom: 3rem;
	border-bottom: 1px solid rgba(255, 255, 255, .16);
}
.site-footer .label { font-size: .625rem; color: #8fa9bd; margin-bottom: 1rem; }
.site-footer p { margin: 0; max-width: 19rem; color: #fff; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .5rem; }
.site-footer a { color: #fff; text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer address { font-style: normal; color: #fff; }
.site-footer__funders {
	padding: 2rem 0;
	border-bottom: 1px solid rgba(255, 255, 255, .16);
}
.funders { position: relative; }
.funders img { display: block; width: 100%; height: auto; }
.site-footer__funders .funders { max-width: 40rem; margin-inline: auto; }
.funders--content { max-width: 1024px; }
.funders__links, .funders__links li { margin: 0; padding: 0; list-style: none; }
.funders__link { position: absolute; border-radius: 4px; }
.funders__link:hover { background: rgba(9, 34, 54, .06); }
.funders__link:focus-visible { outline: 2px solid var(--navy); outline-offset: 2px; }
.site-footer .funders__link:hover { background: rgba(255, 255, 255, .06); }
.site-footer .funders__link:focus-visible { outline-color: var(--on-navy); }
.site-footer__base {
	display: flex;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 1.25rem;
	text-transform: none;
	letter-spacing: .08em;
}

/* Research: um cartão por tema e o texto de um tema de cada vez por baixo.
   A rotação está em site.js; sem JavaScript os temas aparecem todos. */
.topics { margin: 0 0 4rem; }
.topics__head {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1.5rem;
	border-top: 1px solid var(--line);
	padding-top: 1.25rem;
	margin-bottom: 1rem;
}
.topics__head .rotator__toggle { padding: 0; }
.topics__tabs {
	display: grid;
	grid-auto-flow: column;
	grid-auto-columns: minmax(0, 1fr);
	gap: .5rem;
}
.topic {
	position: relative;
	display: flex;
	flex-direction: column;
	gap: .875rem;
	min-height: 8.75rem;
	padding: 1rem .875rem 1.25rem;
	background: #fff;
	border: 1px solid var(--line);
	border-top: 2px solid var(--navy);
	color: var(--navy);
	text-decoration: none;
	transition: background-color .25s ease, color .25s ease;
}
.topic:hover { background: var(--panel); }
.topic:focus-visible { outline: 2px solid var(--link); outline-offset: 2px; }
.topic__n {
	font-family: var(--f-mono);
	font-size: .625rem;
	letter-spacing: .14em;
	color: var(--muted);
}
.topic__title {
	font-family: var(--f-head);
	font-size: .875rem;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -.01em;
}
.topic.is-active { background: var(--navy); border-color: var(--navy); color: #fff; }
.topic.is-active .topic__n { color: var(--on-navy-2); }
/* Seta do cartão ativo para o texto */
.topic.is-active::after {
	content: '';
	position: absolute;
	left: 1rem;
	bottom: -.5625rem;
	border: .5rem solid transparent;
	border-bottom: 0;
	border-top-color: var(--navy);
}
.topic__bar { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; overflow: hidden; }
.topic__bar::after {
	content: '';
	display: block;
	height: 100%;
	background: var(--rule-navy);
	transform: scaleX(0);
	transform-origin: left;
}
.topics.is-running .topic.is-active .topic__bar::after { animation: topic-progress var(--topic-time, 12s) linear forwards; }
.topics.is-held .topic.is-active .topic__bar::after,
.topics.is-paused .topic.is-active .topic__bar::after { animation-play-state: paused; }
@keyframes topic-progress { to { transform: scaleX(1); } }

.topics__panels { margin-top: .75rem; }
.topics__panel.prose {
	max-width: none;
	margin: 0;
	padding: 2rem 2.5rem 1.25rem;
	background: #fff;
	border: 1px solid var(--line);
}
.topics__panel > * { max-width: 44rem; }
.topics__panel h2 { margin: 0 0 1rem; font-size: 1.5rem; letter-spacing: -.02em; }
.topics__panel + .topics__panel { margin-top: .75rem; }
/* Tema Funding: o texto à esquerda e o painel do PRR à direita (sem a imagem
   e sem o resumo, que repete o texto), para não ser muito mais alto que os outros. */
.topics__panel > .funding,
.topics__panel > .grid { max-width: none; margin-top: 2rem; }
.topics__panel .funding { display: block; }
.topics__panel .funding .card__media,
.topics__panel .funding__text { display: none; }
.topics__panel .funding .card__title { margin: 0 0 1.25rem; font-size: 1.25rem; }
.topics__panel .funding__facts { margin-top: 0; column-gap: 1.5rem; }
.topics__panel .funding__facts dd { font-size: .875rem; }
.topics__panel .funding__foot { flex-wrap: nowrap; padding-bottom: 1rem; }
.topics__panel .funding__logos { flex: 1 1 auto; min-width: 0; max-width: 20rem; margin: 0; }
.topics__panel .funding__foot .more { flex: none; }
@media (min-width: 64.01rem) {
	.topics__panel--funding { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.1fr); column-gap: 3rem; align-content: start; }
	.topics__panel--funding > * { grid-column: 1; }
	.topics__panel--funding > .funding { grid-column: 2; grid-row: 1 / span 9; margin-top: .375rem; }
}

/* Com JavaScript: os textos ficam empilhados na mesma célula, para a altura
   ser a do maior e nada saltar por baixo quando o tema muda. */
.js .topics__panels { display: grid; }
.js .topics__panel {
	grid-area: 1 / 1;
	margin: 0;
	visibility: hidden;
	opacity: 0;
	transition: opacity .4s ease, visibility 0s linear .4s;
}
.js .topics__panel.is-active { visibility: visible; opacity: 1; transition: opacity .4s ease .1s; }

@media (max-width: 64rem) {
	/* Cartões numa fila que desliza na horizontal */
	.topics__tabs {
		grid-auto-columns: 10.5rem;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		scroll-padding-inline: 1.5rem;
		margin-inline: -1.5rem;
		padding: 0 1.5rem .625rem;
		scrollbar-width: none;
	}
	.topics__tabs::-webkit-scrollbar { display: none; }
	.topic { scroll-snap-align: start; min-height: 7.5rem; }
	.topic.is-active::after { display: none; }
	.topics__panels { margin-top: .125rem; }
}

/* =========================================================================
   8. Ecrãs estreitos
   ========================================================================= */

@media (max-width: 60rem) {
	.nav-toggle { display: block; }
	.site-header__in { flex-wrap: wrap; }
	.nav { display: none; flex-basis: 100%; padding-bottom: 1rem; }
	.nav.is-open { display: flex; flex-direction: column; align-items: flex-start; gap: 1rem; }
	.nav__list { flex-direction: column; gap: 0; }
	.nav__list a { display: inline-block; padding: .625rem 0 .25rem; }

	.grid--3 { grid-template-columns: repeat(2, 1fr); }
	.people__list--cards { grid-template-columns: repeat(3, 1fr); }
	.people__list--names { grid-template-columns: repeat(3, 1fr); }
	.site-footer__cols { gap: 2.5rem; }
}

@media (max-width: 40rem) {
	body { font-size: 1rem; }
	.hero__in { padding-block: 3.5rem 3rem; }
	.hero__lede { font-size: 1.125rem; }

	.stats { grid-template-columns: repeat(2, 1fr); }
	.stats__cell:nth-child(odd) { border-left: 0; }
	.stats__cell:nth-child(n + 3) { border-top: 1px solid var(--line); }

	.areas,
	.grid--3,
	.card--feature,
	.filters,
	.site-footer__cols { grid-template-columns: 1fr; }

	.areas { gap: 1.5rem; }
	.area p { max-width: none; }
	.card--feature { gap: 1.25rem; }
	.card--feature .card__text { max-width: none; }
	.funding__facts { grid-template-columns: 1fr; }
	/* Em telemóvel a altura acompanha o tema (o maior seria muito comprido). */
	.js .topics__panels { display: block; }
	.js .topics__panel { display: none; transition: none; }
	.js .topics__panel.is-active { display: block; }
	.topics__panel.prose { padding: 1.5rem 1.25rem .5rem; }
	.section { padding-block: 2.5rem 3rem; }

	.people__list { padding-left: 0; }
	.people__list--cards,
	.people__list--names { grid-template-columns: repeat(2, 1fr); }

	.pubyear { grid-template-columns: 1fr; gap: .75rem; }
	.site-footer__base { flex-direction: column; }
	.cta__in { flex-direction: column; align-items: flex-start; }
	.postnav { flex-direction: column; }
	.postnav span { max-width: none; }
	.postnav span:last-child { text-align: left; margin-left: 0; }
}

@media (prefers-reduced-motion: reduce) {
	html { scroll-behavior: auto; }
	.js .topics__panel { transition: none; }
}
