/* Reset básico */
*,
*::before,
*::after {
	box-sizing: border-box;
}

body {
	margin: 0;
	background: var( --color-bg );
	color: var( --color-text );
	font-family: var( --font-body );
	line-height: 1.6;
	-webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
	font-family: var( --font-display );
	line-height: 1.2;
	margin: 0 0 0.5em;
}

a {
	color: var( --color-secondary );
	text-decoration: none;
}

a:hover {
	text-decoration: underline;
}

img {
	max-width: 100%;
	height: auto;
	display: block;
}

.container {
	width: 100%;
	max-width: 1120px;
	margin-inline: auto;
	padding-inline: 1.25rem;
}

:focus-visible {
	outline: 2px solid var( --color-secondary );
	outline-offset: 2px;
}

.skip-link {
	position: absolute;
	left: -9999px;
	top: 0;
	z-index: 1000;
	background: var( --color-bg-alt );
	color: var( --color-text );
	padding: 0.75rem 1rem;
	border-radius: 0 0 4px 0;
}

.skip-link:focus {
	left: 0;
}

/* Header */
.site-header {
	border-bottom: 1px solid var( --color-border );
	background: var( --color-bg-alt );
}

.site-header__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	flex-wrap: wrap;
	gap: 1rem;
	padding-block: 1rem;
}

.site-title {
	font-family: var( --font-display );
	font-weight: 700;
	font-size: 1.25rem;
	color: var( --color-text );
}

.site-nav {
	display: flex;
	align-items: center;
	gap: 1.25rem;
	flex-wrap: wrap;
}

.site-nav__glossario {
	color: var( --color-primary );
	font-weight: 600;
}

/* Hero */
.hero {
	background: radial-gradient( circle at top left, var( --color-bg-alt ), var( --color-bg ) 60% );
	padding-block: 3rem;
	text-align: center;
}

.hero__title {
	font-size: 2rem;
	color: var( --color-text );
}

.hero__subtitle {
	color: var( --color-text-muted );
	max-width: 40rem;
	margin-inline: auto;
}

.hero__busca {
	margin-top: 1.75rem;
	display: flex;
	justify-content: center;
}

.glossario-busca {
	display: flex;
	width: 100%;
	max-width: 32rem;
	gap: 0.5rem;
}

.glossario-busca__input {
	flex: 1;
	background: var( --color-bg-alt );
	border: 1px solid var( --color-border );
	border-radius: 999px;
	padding: 0.75rem 1.25rem;
	color: var( --color-text );
	font-family: var( --font-body );
	font-size: 1rem;
}

.glossario-busca__input::placeholder {
	color: var( --color-text-muted );
}

.glossario-busca__input:focus-visible {
	border-color: var( --color-secondary );
}

.glossario-busca__botao {
	background: var( --color-secondary );
	color: #0f0f1a;
	border: none;
	border-radius: 999px;
	padding: 0.75rem 1.5rem;
	font-weight: 600;
	font-family: var( --font-body );
	cursor: pointer;
}

.glossario-busca__botao:hover {
	filter: brightness( 1.1 );
}

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

@media ( max-width: 480px ) {
	.glossario-busca {
		flex-direction: column;
	}
}

.hero__cta {
	display: inline-block;
	margin-top: 1.5rem;
	padding: 0.75rem 1.5rem;
	border-radius: 999px;
	background: var( --color-primary );
	color: #0f0f1a;
	font-weight: 600;
}

.hero__cta:hover {
	text-decoration: none;
	filter: brightness( 1.1 );
}

/* Índice A-Z */
.az-nav {
	position: sticky;
	top: 0;
	z-index: 10;
	background: var( --color-bg );
	border-bottom: 1px solid var( --color-border );
	padding-block: 0.75rem;
	margin-block: 1.5rem;
}

.az-nav__list {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
}

.az-nav__link {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.75rem;
	height: 1.75rem;
	border-radius: 4px;
	font-weight: 600;
	color: var( --color-text );
}

.az-nav__link:hover {
	background: var( --color-bg-alt );
	text-decoration: none;
}

.az-nav__link.is-active {
	background: var( --color-primary );
	color: #0f0f1a;
}

.az-nav__link--indisponivel {
	color: var( --color-text-muted );
	opacity: 0.4;
}

/* Grid de cards */
.term-card-grid {
	display: grid;
	grid-template-columns: 1fr;
	gap: 1rem;
	margin-block: 1.5rem;
}

.term-card {
	background: var( --color-bg-alt );
	border: 1px solid var( --color-border );
	border-radius: 10px;
	padding: 1.25rem;
	transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.term-card:hover {
	transform: translateY( -2px );
	box-shadow: 0 0 0 1px var( --color-primary ), 0 8px 24px rgba( 168, 85, 247, 0.15 );
}

.term-card__link {
	color: inherit;
}

.term-card__link:hover {
	text-decoration: none;
}

.term-card__title {
	color: var( --color-text );
	font-size: 1.1rem;
}

.term-card__excerpt {
	color: var( --color-text-muted );
	margin: 0;
}

.term-card__categorias {
	margin-top: 0.75rem;
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.term-card__categoria {
	font-size: 0.75rem;
	color: var( --color-secondary );
	border: 1px solid var( --color-border );
	border-radius: 999px;
	padding: 0.15rem 0.6rem;
}

/* Arquivo de termos */
.archive-termo__header {
	text-align: center;
	padding-block: 2rem 1rem;
}

.archive-termo__letra {
	color: var( --color-primary );
	border-bottom: 1px solid var( --color-border );
	padding-bottom: 0.4rem;
	margin-top: 2rem;
}

/* Termo individual */
.single-termo {
	padding-block: 2rem 4rem;
	max-width: 42rem;
}

.single-termo__title {
	font-size: 2rem;
}

.single-termo__categorias {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin-top: 0.5rem;
}

.single-termo__categoria {
	font-size: 0.8rem;
	color: var( --color-secondary );
	border: 1px solid var( --color-border );
	border-radius: 999px;
	padding: 0.2rem 0.7rem;
}

.single-termo__thumbnail {
	margin-block: 1.5rem;
	border-radius: 10px;
	overflow: hidden;
}

.single-termo__toc {
	background: var( --color-bg-alt );
	border: 1px solid var( --color-border );
	border-radius: 10px;
	padding: 1rem 1.25rem;
	margin-block: 1.5rem;
}

.single-termo__toc ul {
	margin: 0;
	padding-left: 1.25rem;
}

.single-termo__toc a {
	color: var( --color-text );
}

.single-termo__secao {
	margin-block: 2rem;
	scroll-margin-top: 1rem;
}

.single-termo__secao h2 {
	color: var( --color-primary );
	font-size: 1.4rem;
	border-bottom: 1px solid var( --color-border );
	padding-bottom: 0.4rem;
}

.single-termo__conteudo {
	color: var( --color-text );
}

.single-termo__conteudo a {
	color: var( --color-secondary );
}

.single-termo__voltar {
	margin-top: 2rem;
}

/* Footer */
.site-footer {
	border-top: 1px solid var( --color-border );
	margin-top: 3rem;
	background: var( --color-bg-alt );
}

.site-footer__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-block: 1.5rem;
	color: var( --color-text-muted );
}

/* Breakpoints */
@media ( min-width: 768px ) {
	.term-card-grid {
		grid-template-columns: repeat( 2, 1fr );
	}

	.hero__title {
		font-size: 2.5rem;
	}
}

@media ( min-width: 1024px ) {
	.term-card-grid {
		grid-template-columns: repeat( 3, 1fr );
	}
}
