/*
 * Palco, ficha e fios.
 *
 * Uma coluna, largura de leitura, ordem declarada. Nenhum JavaScript
 * participa: o que está aqui é o que a página mostra.
 *
 * A medida que organiza tudo é a largura de leitura (--tnc-leitura): a ficha
 * e os textos ficam dentro dela, e só o palco e os fios atravessam. É o que
 * impede a linha de 1.200 pixels que ninguém lê.
 */

.tnc-stage-page {
	--tnc-leitura: 46rem;
	--tnc-palco: min(78vh, 760px);
}

.tnc-item-page {
	margin: 0 auto;
	max-width: 72rem;
}

/* ---------- cabeçalho ---------- */

.tnc-item-head {
	margin: 0 auto 1.75rem;
	max-width: var(--tnc-leitura);
}

.tnc-item-head__eyebrow {
	color: rgba(0, 0, 0, 0.55);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	margin: 0 0 0.5rem;
	text-transform: uppercase;
}

.tnc-item-head__title {
	font-size: clamp(1.7rem, 1.1rem + 2.2vw, 2.75rem);
	font-weight: 600;
	letter-spacing: -0.015em;
	line-height: 1.12;
	margin: 0;
	text-wrap: balance;
}

.tnc-item-head__subtitle {
	color: rgba(0, 0, 0, 0.62);
	font-size: 1.15rem;
	line-height: 1.4;
	margin: 0.5rem 0 0;
}

/* ---------- palco ---------- */

.tnc-stage {
	background: #15171a;
	border-radius: var(--tnc-radius-lg, 14px);
	margin: 0 0 2.5rem;
	overflow: hidden;
	padding: 0;
}

/*
 * A galeria do Tainacan é um componente de terceiro: aqui o tema só define a
 * altura do palco e o fundo. Mexer no miolo dela seria brigar com o plugin a
 * cada atualização.
 */
.tnc-stage .tainacan-media-component,
.tnc-stage .swiper,
.tnc-stage .swiper-container {
	background: transparent;
}

.tnc-stage img,
.tnc-stage video,
.tnc-stage iframe {
	max-height: var(--tnc-palco);
	object-fit: contain;
	width: auto;
}

.tnc-stage .swiper-slide {
	align-items: center;
	display: flex;
	justify-content: center;
	min-height: 18rem;
}

/* A faixa de miniaturas é o índice dos arquivos, não um segundo palco. */
.tnc-stage .swiper-thumbs,
.tnc-stage .tainacan-media-thumbs {
	background: rgba(255, 255, 255, 0.06);
	padding: 0.5rem;
}

.tnc-stage .swiper-button-next,
.tnc-stage .swiper-button-prev {
	color: #fff;
}

/* ---------- ficha ---------- */

.tnc-item-body {
	margin: 0 auto;
	max-width: var(--tnc-leitura);
}

.tnc-record--essential {
	border-top: 2px solid var(--tnc-accent, #187181);
	display: grid;
	gap: 0 2rem;
	grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
	margin: 0 0 2rem;
	padding-top: 1.25rem;
}

/* Cada campo é um <div class="tnc-field"> com o par rótulo/valor dentro. */
.tnc-record--essential .tnc-field {
	margin: 0 0 1.1rem;
	min-width: 0;
}

.tnc-record--essential .tnc-field:empty {
	display: none;
}

.tnc-record--essential dt,
.tnc-record--essential .metadata-label {
	color: rgba(0, 0, 0, 0.5);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.07em;
	margin: 0 0 0.15rem;
	text-transform: uppercase;
}

.tnc-record--essential dd,
.tnc-record--essential .metadata-value {
	font-size: 1.02rem;
	line-height: 1.45;
	margin: 0;
}

/* ---------- o resto da ficha, recolhido ---------- */

.tnc-record-sections {
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	margin: 0 0 2rem;
}

.tnc-record-section {
	border-bottom: 1px solid rgba(0, 0, 0, 0.12);
}

.tnc-record-section > summary {
	cursor: pointer;
	font-size: 0.95rem;
	font-weight: 600;
	list-style: none;
	padding: 0.9rem 1.75rem 0.9rem 0;
	position: relative;
}

.tnc-record-section > summary::-webkit-details-marker {
	display: none;
}

.tnc-record-section > summary::after {
	content: "+";
	font-size: 1.25rem;
	font-weight: 400;
	line-height: 1;
	position: absolute;
	right: 0.25rem;
	top: 50%;
	transform: translateY(-50%);
}

.tnc-record-section[open] > summary::after {
	content: "−";
}

.tnc-record-section > summary:focus-visible {
	outline: 2px solid var(--tnc-accent, #187181);
	outline-offset: 2px;
}

.tnc-record-section .tnc-record {
	padding: 0 0 1.25rem;
}

.tnc-record-section .metadata-label,
.tnc-record-section h3 {
	color: rgba(0, 0, 0, 0.5);
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.07em;
	margin: 0.9rem 0 0.15rem;
	text-transform: uppercase;
}

.tnc-record-section .metadata-value,
.tnc-record-section .metadata-value p {
	margin: 0;
}

/* ---------- fios ---------- */

.tnc-threads {
	border-top: 2px solid rgba(0, 0, 0, 0.1);
	margin-top: 3rem;
	padding-top: 1.75rem;
}

.tnc-threads__title {
	font-size: 1.15rem;
	margin: 0 0 1.25rem;
}

.tnc-thread {
	margin-bottom: 2rem;
}

.tnc-thread__title {
	color: rgba(0, 0, 0, 0.65);
	font-size: 0.78rem;
	font-weight: 600;
	letter-spacing: 0.07em;
	margin: 0 0 0.75rem;
	text-transform: uppercase;
}

.tnc-thread__list {
	display: grid;
	gap: 1rem;
	grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
	list-style: none;
	margin: 0;
	padding: 0;
}

.tnc-thread__item a {
	display: block;
	text-decoration: none;
}

.tnc-thread__item img {
	aspect-ratio: 1;
	background: #f1f1f1;
	border-radius: var(--tnc-radius, 10px);
	display: block;
	object-fit: cover;
	transition: transform 160ms ease;
	width: 100%;
}

.tnc-thread__item a:hover img {
	transform: scale(1.03);
}

.tnc-thread__item span {
	display: block;
	font-size: 0.88rem;
	line-height: 1.3;
	margin-top: 0.45rem;
}

/* ---------- navegação entre itens ---------- */

.tnc-item-nav {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1rem;
	justify-content: space-between;
	margin: 0 0 1.75rem;
}

.tnc-item-nav__side--next {
	margin-left: auto;
	text-align: right;
}

.tnc-adjacent {
	align-items: center;
	display: inline-flex;
	gap: 0.5rem;
	max-width: 16rem;
	text-decoration: none;
}

.tnc-adjacent img {
	border-radius: 4px;
	height: 36px;
	object-fit: cover;
	width: 36px;
}

.tnc-adjacent-title {
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

/* ---------- texto longo recolhido ---------- */

.tnc-text--clamped {
	-webkit-line-clamp: 6;
	-webkit-box-orient: vertical;
	display: -webkit-box;
	overflow: hidden;
}

.tnc-text--clamped.is-open {
	-webkit-line-clamp: unset;
	display: block;
}

.tnc-text__toggle {
	background: transparent;
	border: 0;
	color: var(--tnc-accent, #187181);
	cursor: pointer;
	padding: 0.25rem 0;
	text-decoration: underline;
}

@media (prefers-reduced-motion: reduce) {
	.tnc-thread__item img {
		transition: none;
	}

	.tnc-thread__item a:hover img {
		transform: none;
	}
}

@media (max-width: 48rem) {
	.tnc-stage-page {
		--tnc-palco: 60vh;
	}

	.tnc-record--essential {
		grid-template-columns: 1fr;
	}
}
