/*
Theme Name: Typo.Graphicæ
Template: twentytwentyfive
Description: Tema-filho do Twenty Twenty-Five para o grupo de investigação Typo.Graphicæ (FA.ULisboa). Reproduz o aspeto do site feito com o Divi (barra verde, logótipo, menu em PT Serif, coluna de texto à direita) só com blocos do editor, sem o Divi.
Version: 1.0.0
Requires at least: 6.7
Requires PHP: 8.1
Author: CIFA – FA.ULisboa
License: GNU General Public License v2 or later
Text Domain: typo
*/

/* Grelha do Divi: linha de 80% (máx. 1080px), colunas 1/3 e 2/3 com 5,5% de intervalo. */
:root { --typo-linha: min(80%, 1080px); }
.wp-site-blocks > * { margin-block-start: 0; }

/* ---------- Barra verde com EN / PT ---------- */
.typo-barra { background: #99ff33; height: 30px; }
.typo-linguas {
	width: var(--typo-linha);
	margin: 0 auto !important;
	text-align: right;
	font-size: 12px;
	font-weight: 700;
	line-height: 30px;
	word-spacing: 14px;
}
.typo-linguas a { color: #070707; text-decoration: none; word-spacing: normal; }
.typo-linguas a:hover { opacity: .7; text-decoration: none; }

/* ---------- Logótipo e menu ---------- */
.wp-block-columns.typo-cabecalho {
	width: var(--typo-linha);
	margin: 40px auto 0 !important;
	gap: 0 5.5%;
	align-items: flex-end;
}
.typo-cabecalho .typo-col-1-3 { flex-basis: 29.6667% !important; }
.typo-cabecalho .typo-col-2-3 { flex-basis: 64.8333% !important; align-self: flex-end; }
.typo-logotipo { margin: 0 !important; text-align: right; }
.typo-logotipo img { width: 227px; height: auto; display: inline-block; vertical-align: top; }
.typo-menu { width: 80%; padding-bottom: 2px; }
.typo-menu .wp-block-navigation-item__content {
	font-family: var(--wp--preset--font-family--pt-serif);
	font-size: 10.5px;
	letter-spacing: 1.5px;
	text-transform: uppercase;
	color: #5e5e5e !important;
	text-decoration: none !important;
	line-height: 1.6;
}
.typo-menu .wp-block-navigation-item__content:hover { opacity: .7; }
.typo-menu .current-menu-item > .wp-block-navigation-item__content { border-bottom: 1.95px dotted #99ff33; }
/* Menu do telemóvel (aberto): margens e espaço entre itens. */
.typo-menu .wp-block-navigation__responsive-container.is-menu-open { padding: 22px 7% !important; }
.typo-menu .is-menu-open .wp-block-navigation__responsive-container-content { padding-top: 48px !important; }
.typo-menu .is-menu-open .wp-block-navigation__container { gap: 22px !important; }
.typo-menu .is-menu-open .wp-block-navigation-item__content { font-size: 14px; padding: 2px 0 !important; width: auto !important; flex-grow: 0 !important; }

/* ---------- Conteúdo ---------- */
.typo-principal { padding: 73px 0 100px; min-height: 50vh; }
.typo-seccao { width: var(--typo-linha); margin: 0 auto; }
.typo-seccao + .typo-seccao { margin-top: 0; }
.typo-seccao .wp-block-columns { gap: 0 5.5%; margin: 0; flex-wrap: nowrap; }
.typo-seccao .wp-block-column, .typo-cabecalho .wp-block-column { box-sizing: border-box; }
.typo-seccao .wp-block-columns > .typo-col-1-3 { flex-basis: 29.6667% !important; }
.typo-seccao .wp-block-columns > .typo-col-2-3 { flex-basis: 64.8333% !important; }
.typo-seccao .wp-block-columns + .wp-block-columns { margin-top: 0; }

/* Texto (módulos de texto do Divi): preto, 13px, coluna de 557px como no original. */
.typo-texto { color: #000; font-size: 13px; line-height: 1.4; max-width: 560px; margin-bottom: 40px; }
.typo-texto:last-child { margin-bottom: 0; }
.typo-texto > * { margin-block: 0 !important; }
.typo-texto p { padding-bottom: 1em; }
.typo-texto p:last-child { padding-bottom: 0; }
.typo-texto h1, .typo-texto h2, .typo-texto h3, .typo-texto h4, .typo-texto h5, .typo-texto h6 { padding-bottom: 10px; line-height: 1; }
.typo-texto h5 strong, .typo-texto h5 b { font-weight: 700; }
.typo-texto strong, .typo-texto b { font-weight: 700; }
.typo-texto.typo-texto-15 { line-height: 1.5; }
html { scroll-behavior: smooth; scroll-padding-top: 20px; }

/* Índice da página (botões do Divi com âncora): verde, à esquerda. */
.typo-indice { margin: 0 0 0 40px !important; font-size: 14px; line-height: 1.7; }
.typo-indice a { display: inline-block; padding: 4.2px 14px; color: #7ee226; }
.typo-indice a:hover { text-decoration: none; opacity: .75; }

/* Botão Cienciavitae: contorno verde arredondado. */
.typo-seccao .wp-block-buttons { margin-top: 30px; }
.wp-block-button.typo-botao .wp-block-button__link {
	background: transparent;
	color: #7ee226;
	border: 2px solid #7ee226;
	border-radius: 100px;
	padding: 4.2px 14px;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.7;
}
.wp-block-button.typo-botao .wp-block-button__link:hover { background: rgba(126, 226, 38, .08); text-decoration: none; }

/* ---------- Equipa (blurbs do Divi) ---------- */
.typo-membro { width: 178px; min-height: 191px; margin-bottom: 23px; text-align: center; }
.typo-membro-foto { margin: 0 !important; }
.typo-membro-foto img { width: 129px; height: auto; display: inline-block; vertical-align: top; }
.typo-membro-nome {
	width: 129px;
	margin: 37px auto 0 !important;
	text-align: left;
	font-size: 13px;
	font-weight: 500;
	line-height: 1;
	color: #333;
}
.typo-membro-nome a { color: inherit; }
.typo-membro-nome a:hover { text-decoration: none; opacity: .7; }
.typo-membro-nota { width: 129px; margin: 1px auto 0; text-align: left; font-size: 10px; line-height: 1.5; color: #000; }
.typo-membro-nota > * { margin: 0 !important; }
.typo-recuo { padding-left: 142px; }
/* Grelha da equipa: três colunas internas de 216px, alinhadas com a primeira. */
.typo-seccao .wp-block-columns.typo-colunas-1-3--1-3--1-3 { padding-left: 12px; gap: 0 !important; }
.typo-seccao .wp-block-columns.typo-colunas-1-3--1-3--1-3 > .wp-block-column { flex: 0 0 216px !important; }
.typo-colunas-1-3--1-3--1-3 .typo-membro { width: 129px; }
.typo-colunas-1-3--1-3--1-3 .typo-membro-nome,
.typo-colunas-1-3--1-3--1-3 .typo-membro-nota { width: auto; }

/* ---------- Navegação entre investigadores ---------- */
.typo-navegacao { width: var(--typo-linha); margin: 160px auto 0 !important; padding: 0 100px; box-sizing: border-box; font-size: 14px; letter-spacing: 1px; line-height: 1.1; }
.typo-navegacao .wp-block-post-navigation-link { font-size: 14px !important; letter-spacing: 1px; line-height: 1.1; color: #99ff33; margin: 0; }
.typo-navegacao a { color: #99ff33; }
.typo-navegacao a:hover { text-decoration: none; opacity: .75; }
.typo-navegacao .wp-block-post-navigation-link__arrow-previous,
.typo-navegacao .wp-block-post-navigation-link__arrow-next { margin: 0 4px; }

/* ---------- Rodapé ---------- */
.typo-rodape { width: var(--typo-linha); margin: 0 auto; padding: 15px 0 5px; }
.typo-rodape p { margin: 0; font-size: 13px; color: #b2b2b2; line-height: 1.8; }

/* ---------- Tablet e telemóvel ---------- */
@media (max-width: 980px) {
	:root { --typo-linha: 86%; }
	.wp-block-columns.typo-cabecalho { margin-top: 24px !important; align-items: center; }
	.typo-logotipo { text-align: left; }
	.typo-logotipo img { width: 170px; }
	.typo-menu { width: 100%; justify-content: flex-end !important; }
	.typo-principal { padding-top: 40px; }
	.typo-seccao .wp-block-columns { flex-wrap: wrap !important; }
	.typo-seccao .wp-block-columns > .wp-block-column { flex-basis: 100% !important; }
	.typo-seccao .wp-block-columns > .typo-col-1-3:not(:has(*)) { display: none; }
	.typo-indice { margin-left: 0 !important; }
	.typo-indice a { padding-left: 0; }
	.typo-texto { max-width: none; }
	.typo-recuo { padding-left: 0; }
	.typo-col-1-3:has(.typo-indice) { margin-bottom: 30px; }
	.typo-col-1-3:has(> .typo-membro) { margin-bottom: 24px; }
	/* Equipa: as fotos de todas as colunas passam a uma grelha única de 2 ou 3 por linha. */
	.typo-seccao > .wp-block-columns:has(.typo-colunas-1-3--1-3--1-3) { display: grid !important; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 0 4%; }
	.typo-seccao > .wp-block-columns:has(.typo-colunas-1-3--1-3--1-3) > .wp-block-column,
	.typo-seccao .wp-block-columns.typo-colunas-1-3--1-3--1-3,
	.typo-seccao .wp-block-columns.typo-colunas-1-3--1-3--1-3 > .wp-block-column { display: contents !important; }
	.typo-membro, .typo-colunas-1-3--1-3--1-3 .typo-membro { width: auto; min-height: 0; margin-bottom: 30px; text-align: left; }
	.typo-membro-foto img { width: 100%; max-width: 160px; }
	.typo-membro-nome, .typo-membro-nota { width: auto; margin-left: 0 !important; }
	.typo-membro-nome { margin-top: 12px !important; }
	.typo-navegacao { padding: 0; margin-top: 60px !important; gap: 20px; }
}
@media (max-width: 600px) {
	.typo-seccao > .wp-block-columns:has(.typo-colunas-1-3--1-3--1-3) { grid-template-columns: 1fr 1fr; }
	/* Investigador: foto mais pequena por cima do texto. */
	.typo-membro-foto img { max-width: 140px; }
}

/* ---------- 404, pesquisa e arquivos ---------- */
.typo-titulo { font-size: 22px !important; color: #333; padding-bottom: 20px !important; }
.typo-lista .wp-block-post-template { list-style: none; margin: 0 !important; padding: 0; }
.typo-lista .wp-block-post-title { font-size: 14px; font-weight: 500; line-height: 1.4; padding: 0 0 10px !important; margin: 0 !important; }
.typo-lista .wp-block-post-title a { color: #000; }
.typo-lista .wp-block-query-pagination { margin-top: 20px; font-size: 13px; }
