/* Página de publicação — tipografia e layout unificados */

:root {
	--pub-navy: #002e5d;
	--pub-navy-mid: #1a4a7a;
	--pub-text: #1f2937;
	--pub-muted: #5c6b7a;
	--pub-border: #dde3ea;
	--pub-sheet-bg: #f3f5f8;
	--pub-white: #ffffff;
	--font-sans: "Roboto", "Open Sans", system-ui, sans-serif;

	/* Escala tipográfica — mínimo 12px; leitura confortável ≥ 18px */
	--text-min: 12px;
	--text-label: 15px;       /* rótulos, subnav, DOI */
	--text-body: 18px;        /* corpo, metadados, apresentação */
	--text-lead: 20px;        /* organizadores */
	--text-title: clamp(1.75rem, 3vw, 2.25rem);
	--text-section: 1.875rem; /* 30px — títulos de seção (Apresentação, Capítulos) */
	--text-chapter-title: 1.75rem; /* 28px — título de cada capítulo */

	--main-nav-height: 100px;
	--subnav-height: 44px;
	--content-max: 1100px;
}

body.pub-page {
	margin: 0;
	font-family: var(--font-sans);
	font-size: var(--text-body);
	line-height: 1.65;
	color: var(--pub-text);
	background: var(--pub-white);
	padding-top: calc(var(--main-nav-height) + var(--subnav-height));
}

/* custom.css usa Yeseva/Graduate — conteúdo da publicação usa Roboto */
body.pub-page h1,
body.pub-page h2,
body.pub-page h3,
body.pub-page h4,
body.pub-page .pub-hero__title,
body.pub-page .pub-section-heading,
body.pub-page .pub-chapter-card__title {
	font-family: var(--font-sans) !important;
}

.pub-muted {
	font-size: var(--text-body);
	color: var(--pub-muted);
}

/* —— Navegação (igual à home — altura e fontes fixas, sem “dançar” no scroll) —— */
body.pub-page #main-nav.navbar-default,
body.pub-page #main-nav.navbar-default.sticky-header {
	background-color: #002e5d !important;
	background: #002e5d !important;
	border: none !important;
	border-bottom: none !important;
	padding: 0 !important;
	margin-bottom: 0 !important;
	min-height: var(--main-nav-height);
	transition: none !important;
	-webkit-transition: none !important;
}

body.pub-page #main-nav .navbar-header {
	height: var(--main-nav-height) !important;
	min-height: var(--main-nav-height);
}

body.pub-page #main-nav .navbar-brand {
	padding: 0 !important;
	float: left;
}

body.pub-page #main-nav .navbar-brand h1 {
	display: inline-block;
	margin: 2% 0 0 0;
	padding: 0;
	font-family: "Roboto", "Open Sans", sans-serif !important;
	font-size: 30px !important;
	font-weight: 400 !important;
	text-transform: none !important;
	color: #fff !important;
	line-height: 1.2;
	transition: none !important;
	-webkit-transition: none !important;
}

body.pub-page #main-nav .navbar-brand h1 img {
	height: 70px !important;
	display: inline-block;
	vertical-align: middle;
	width: auto;
}

body.pub-page #main-nav .navbar-collapse {
	border: none;
	box-shadow: none;
}

@media (min-width: 768px) {
	body.pub-page #main-nav .navbar-collapse {
		height: var(--main-nav-height);
	}

	body.pub-page #main-nav .navbar-nav {
		display: flex;
		align-items: center;
		height: var(--main-nav-height);
		margin: 0;
	}

	body.pub-page #main-nav .navbar-nav > li {
		float: none;
		display: flex;
		align-items: center;
		height: var(--main-nav-height);
	}

	body.pub-page #main-nav .navbar-nav > li > a {
		font-family: "Roboto", "Open Sans", sans-serif !important;
		font-size: 16px !important;
		font-weight: 400 !important;
		text-transform: none !important;
		letter-spacing: normal !important;
		color: #fff !important;
		padding: 0 14px !important;
		line-height: var(--main-nav-height) !important;
		height: var(--main-nav-height) !important;
		display: block !important;
		transition: none !important;
		-webkit-transition: none !important;
	}

	body.pub-page #main-nav .navbar-nav > li > a:hover,
	body.pub-page #main-nav .navbar-nav > li > a:focus {
		color: rgba(255, 255, 255, 0.88) !important;
		background: transparent !important;
	}
}

/* Mobile / collapse */
@media (max-width: 767px) {
	body.pub-page #main-nav .navbar-nav > li > a {
		font-family: "Roboto", "Open Sans", sans-serif !important;
		font-size: 16px !important;
		font-weight: 400 !important;
		text-transform: none !important;
		color: #fff !important;
		padding: 12px 15px !important;
	}
}

/* Anula animações do custom.css que fazem o menu “dançar” */
body.pub-page #main-nav,
body.pub-page #main-nav * {
	transition: none !important;
	-webkit-transition: none !important;
}

.pub-subnav {
	background: var(--pub-navy-mid);
	position: fixed;
	top: var(--main-nav-height);
	left: 0;
	right: 0;
	z-index: 1100;
}

.pub-subnav .container {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem 1.5rem;
	padding-top: 0.55rem;
	padding-bottom: 0.55rem;
}

.pub-subnav a {
	color: rgba(255, 255, 255, 0.92);
	font-size: var(--text-label);
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.03em;
	text-decoration: none;
	padding: 0.15rem 0;
}

.pub-subnav a:hover {
	color: #fff;
	text-decoration: underline;
}

/* Preloader — centralizado; sem display:!important para o jQuery conseguir esconder */
body.pub-page .preloader {
	position: fixed;
	top: 0;
	right: 0;
	bottom: 0;
	left: 0;
	z-index: 99999;
	background: var(--pub-white);
	display: flex;
	align-items: center;
	justify-content: center;
	margin: 0;
	padding: 0;
	opacity: 1;
	transition: opacity 0.35s ease;
	pointer-events: auto;
}

body.pub-page .preloader.is-hidden {
	opacity: 0;
	pointer-events: none;
	visibility: hidden;
}

body.pub-page .preloader__inner {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	text-align: center;
	position: static;
	width: auto;
	height: auto;
	max-width: none;
	margin: 0;
}

body.pub-page .preloader__spinner {
	width: 40px;
	height: 40px;
	margin: 0 0 1rem;
	border: 3px solid var(--pub-border);
	border-top-color: var(--pub-navy);
	border-radius: 50%;
	animation: pub-spin 0.8s linear infinite;
	flex-shrink: 0;
}

body.pub-page .preloader__text {
	margin: 0;
	font-size: var(--text-body);
	color: var(--pub-muted);
}

@keyframes pub-spin {
	to { transform: rotate(360deg); }
}

/* —— Bloco principal (hero + apresentação) —— */
.pub-main .container {
	max-width: var(--content-max);
}

.pub-sheet {
	background: linear-gradient(180deg, var(--pub-sheet-bg) 0%, var(--pub-white) 520px);
	padding: 2.25rem 0 2.5rem;
	border-bottom: 1px solid var(--pub-border);
}

.pub-hero__grid {
	display: grid;
	grid-template-columns: 220px minmax(0, 1fr);
	gap: 2rem 2.5rem;
	align-items: start;
}

.pub-hero__cover {
	margin: 0;
	max-width: 220px;
	width: 220px;
	flex-shrink: 0;
}

.pub-cover-img {
	display: block;
	width: 100%;
	max-width: 220px;
	height: auto;
	max-height: 300px;
	min-height: 0;
	object-fit: contain;
	border-radius: 3px;
	box-shadow: 0 2px 8px rgba(0, 46, 93, 0.12), 0 8px 24px rgba(0, 46, 93, 0.1);
	border: 1px solid var(--pub-border);
	background: #e8edf2;
}

.pub-hero__body {
	min-width: 0;
}

.pub-hero__kicker {
	margin: 0 0 0.5rem;
	font-size: var(--text-label);
	font-weight: 600;
	color: var(--pub-muted);
	letter-spacing: 0.02em;
}

.pub-hero__title {
	font-family: var(--font-sans);
	font-size: var(--text-title);
	font-weight: 700;
	line-height: 1.28;
	color: var(--pub-navy);
	margin: 0 0 1rem;
}

/* Organizadores — linha editorial */
.pub-byline {
	margin: 0 0 1.25rem;
	font-size: var(--text-lead);
	line-height: 1.55;
	color: var(--pub-text);
}

.pub-byline__label {
	font-weight: 700;
	color: var(--pub-navy);
}

.pub-byline__names {
	font-weight: 400;
}

/* Metadados — lista legível */
.pub-facts {
	list-style: none;
	margin: 0 0 1.5rem;
	padding: 0;
	display: flex;
	flex-wrap: wrap;
	gap: 0.65rem 2rem;
}

.pub-facts__item {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.35rem 0.5rem;
	font-size: var(--text-body);
	line-height: 1.5;
}

.pub-facts__item--full {
	flex: 1 1 100%;
}

.pub-facts__label {
	font-size: var(--text-label);
	font-weight: 700;
	color: var(--pub-muted);
	text-transform: uppercase;
	letter-spacing: 0.03em;
	min-width: 0;
}

.pub-facts__label::after {
	content: ':';
}

.pub-facts__value {
	font-size: var(--text-body);
	font-weight: 500;
	color: var(--pub-text);
}

.pub-facts__value a {
	color: var(--pub-navy-mid);
	text-decoration: none;
}

.pub-facts__value a:hover {
	text-decoration: underline;
}

/* Botão — proporcional ao texto, não gritante */
.pub-actions {
	margin-top: 0.25rem;
}

.pub-actions .btn-download {
	display: inline-block;
	background: var(--pub-navy);
	color: #fff !important;
	font-family: var(--font-sans);
	font-size: var(--text-body);
	font-weight: 600;
	letter-spacing: 0.01em;
	text-transform: none;
	padding: 0.65rem 1.35rem;
	border-radius: 4px;
	text-decoration: none;
	transition: background 0.2s;
}

.pub-actions .btn-download:hover {
	background: var(--pub-navy-mid);
	color: #fff !important;
	text-decoration: none;
}

.pub-actions--row {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75rem 1rem;
	align-items: center;
}

.btn-download--outline {
	background: transparent !important;
	color: var(--pub-navy) !important;
	border: 2px solid var(--pub-navy);
}

.btn-download--outline:hover {
	background: var(--pub-navy) !important;
	color: #fff !important;
}

/* Página de capítulo (sem subnav) */
body.pub-page--chapter {
	padding-top: var(--main-nav-height);
}

.pub-sheet--chapter {
	padding: 3.5rem 0 3.75rem;
}

.pub-chapter-page__title {
	margin: 0 0 1.5rem;
}

.pub-page--chapter .pub-hero__kicker {
	margin: 0 0 1rem;
}

.pub-page--chapter .pub-hero__kicker a {
	color: var(--pub-navy-mid);
	font-weight: 600;
	text-decoration: none;
}

.pub-page--chapter .pub-hero__kicker a:hover {
	text-decoration: underline;
}

.pub-byline--chapter {
	margin: 0 0 2rem;
	font-size: var(--text-label);
	line-height: 1.55;
}

/* Autores abaixo do título — menor que título e corpo */
.pub-page--chapter .pub-byline--chapter .pub-byline__label {
	font-size: var(--text-label);
	font-weight: 700;
}

.pub-page--chapter .pub-byline--chapter .pub-author-links,
.pub-page--chapter .pub-byline--chapter .pub-author-link {
	font-size: var(--text-label);
	font-weight: 400;
	font-family: var(--font-sans) !important;
}

.pub-page--chapter .pub-chapter-page__title {
	font-size: var(--text-title);
	line-height: 1.28;
}

.pub-facts--chapter {
	gap: 1rem 2.25rem;
	margin: 0 0 2.75rem;
}

.pub-overview--chapter {
	margin-top: 2.75rem;
	padding-top: 2.5rem;
}

.pub-overview--chapter .pub-section-heading {
	margin-bottom: 1.35rem;
}

/* Ações do capítulo — botões editoriais, bem espaçados */
.pub-chapter-actions {
	display: flex;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-items: center;
	gap: 1.25rem 2.5rem;
	margin-top: 3rem;
	padding-top: 2.5rem;
	border-top: 1px solid var(--pub-border);
}

.pub-chapter-actions .btn-download {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 0;
	min-width: 0;
	padding: 0.55rem 1.15rem;
	font-size: 16px;
	font-weight: 600;
	text-align: center;
	white-space: normal;
	line-height: 1.35;
	text-decoration: none !important;
	background: var(--pub-navy) !important;
	color: #fff !important;
	border: none;
	border-radius: 4px;
	transition: background 0.2s;
}

.pub-chapter-actions .btn-download:hover,
.pub-chapter-actions .btn-download:focus {
	background: var(--pub-navy-mid) !important;
	color: #fff !important;
	text-decoration: none !important;
}

@media (max-width: 640px) {
	.pub-sheet--chapter {
		padding: 2.5rem 0 3rem;
	}

	.pub-chapter-actions {
		flex-direction: column;
		align-items: stretch;
		gap: 1rem;
	}

	.pub-chapter-actions .btn-download {
		width: 100%;
		min-width: 0;
	}
}

/* Apresentação — continuação do mesmo bloco */
.pub-overview {
	margin-top: 2.5rem;
	padding-top: 2rem;
	border-top: 1px solid var(--pub-border);
}

.pub-section-heading {
	font-family: var(--font-sans);
	font-size: var(--text-section);
	font-weight: 700;
	color: var(--pub-navy);
	margin: 0 0 1rem;
	padding: 0;
	border: none;
	line-height: 1.3;
}

.pub-overview__text {
	font-size: var(--text-body);
	line-height: 1.7;
	color: var(--pub-text);
	max-width: 72em;
}

.pub-overview__text p {
	margin: 0 0 1em;
}

.pub-overview__text p:last-child {
	margin-bottom: 0;
}

/* Capítulos */
.pub-chapters-section {
	padding: 2.75rem 0 4rem;
	background: var(--pub-white);
}

.pub-chapters-section .pub-section-heading {
	margin-bottom: 1.75rem;
}

.pub-chapters-list {
	display: flex;
	flex-direction: column;
	gap: 1.75rem;
}

.pub-chapter-card {
	border: 1px solid var(--pub-border);
	border-radius: 6px;
	padding: 1.5rem 1.75rem 1.35rem;
	background: var(--pub-white);
}

.pub-chapter-card__head {
	margin: 0 0 1rem;
	padding-bottom: 0.85rem;
	border-bottom: 1px solid var(--pub-border);
}

.pub-chapter-card__num {
	display: block;
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.06em;
	color: var(--pub-muted);
	margin: 0 0 0.4rem;
}

.pub-chapter-card__title {
	font-size: var(--text-chapter-title);
	font-weight: 600;
	color: var(--pub-navy);
	margin: 0;
	line-height: 1.38;
}

.pub-chapter-card__title-link {
	color: inherit;
	text-decoration: none;
	cursor: pointer;
}

.pub-chapter-card__title-link:hover {
	color: var(--pub-navy-mid);
	text-decoration: underline;
}

.pub-chapter-card__title-link:focus {
	outline: 2px solid var(--pub-navy-mid);
	outline-offset: 2px;
}

/* Autores com link — hero e capítulos */
.pub-byline .pub-author-links,
.pub-hero__authors-list .pub-author-links {
	line-height: 1.6;
}

.pub-author-link {
	color: var(--pub-navy-mid);
	text-decoration: none;
	font-weight: 500;
}

.pub-author-link:hover {
	color: var(--pub-navy);
	text-decoration: underline;
}

/* Metadados secundários nos capítulos */
.pub-chapter-card__meta-label {
	font-size: 14px;
	font-weight: 600;
	color: var(--pub-muted);
}

.pub-chapter-card__authors {
	font-size: 15px;
	font-weight: 400;
	color: var(--pub-text);
	margin: 0 0 0.65rem;
	line-height: 1.6;
}

.pub-chapter-card .pub-author-link {
	font-size: 15px;
	font-weight: 400;
}

.pub-chapter-card__doi {
	font-size: 14px;
	font-weight: 400;
	color: var(--pub-muted);
	margin: 0 0 0.85rem;
	line-height: 1.5;
}

.pub-chapter-card__doi a {
	color: var(--pub-navy-mid);
	font-weight: 400;
	text-decoration: none;
}

.pub-chapter-card__doi a:hover {
	text-decoration: underline;
}

.pub-chapter-card__actions {
	margin: 0.25rem 0 0;
	padding-top: 0.85rem;
	border-top: 1px solid var(--pub-border);
}

.pub-chapter-card__cta {
	display: inline-block;
	font-size: 15px;
	font-weight: 600;
	color: var(--pub-navy);
	text-decoration: none;
	padding: 0;
	background: none;
	border: none;
	letter-spacing: 0;
	text-transform: none;
}

.pub-chapter-card__cta:hover {
	color: var(--pub-navy-mid);
	text-decoration: underline;
}

.pub-chapter-card__cta::after {
	content: ' →';
	font-weight: 400;
}

.pub-chapters-empty {
	font-size: var(--text-body);
	color: var(--pub-muted);
}

/* Footer e utilitários */
.pub-footer .footer-social a {
	background: var(--pub-navy);
	color: #fff;
}

.pub-error {
	position: fixed;
	bottom: 1.5rem;
	left: 50%;
	transform: translateX(-50%);
	z-index: 1200;
	max-width: 90%;
	padding: 12px 20px;
	background: #fff3cd;
	border: 1px solid #ffc107;
	border-radius: 4px;
	color: #856404;
	font-size: var(--text-body);
}

#myModal.modal {
	display: none;
	position: fixed;
	inset: 0;
	z-index: 1300;
	background: rgba(0, 0, 0, 0.7);
}

#myModal .modal-content {
	background: #fff;
	margin: 15% auto;
	padding: 20px;
	width: min(500px, 90%);
	text-align: center;
	position: relative;
	border-radius: 6px;
	font-size: var(--text-body);
}

#myModal .close {
	position: absolute;
	top: 10px;
	right: 14px;
	font-size: 1.5rem;
	cursor: pointer;
}

@media (max-width: 991px) {
	.pub-hero__grid {
		grid-template-columns: 1fr;
		gap: 1.5rem;
	}

	.pub-hero__cover {
		display: flex;
		justify-content: center;
	}

	.pub-hero__cover {
		width: 100%;
		max-width: 200px;
		margin-left: auto;
		margin-right: auto;
	}

	.pub-cover-img {
		max-width: 200px;
		max-height: 280px;
	}
}

@media (max-width: 767px) {
	body.pub-page {
		padding-top: calc(80px + var(--subnav-height));
	}

	body.pub-page #main-nav .navbar-header {
		height: auto !important;
		min-height: 72px;
	}

	body.pub-page #main-nav .navbar-brand h1 {
		font-size: 1.4rem !important;
		white-space: nowrap;
		margin-top: 4% !important;
	}

	body.pub-page #main-nav .navbar-brand h1 img {
		height: 56px !important;
	}

	.pub-facts {
		flex-direction: column;
		gap: 0.75rem;
	}

	.pub-byline {
		font-size: var(--text-body);
	}
}
