/**
 * Cards e seções editoriais reutilizáveis.
 *
 * O mesmo markup e as mesmas regras atendem seções de categoria, mais lidos,
 * últimas postagens e artigos relacionados.
 */

.post-grid-section {
	width: 100%;
	margin-bottom: var(--space-xl);
	padding-inline: var(--page-padding);
}

.post-grid-section-embedded {
	margin: var(--space-xl) 0 0;
	padding-inline: 0;
}

.landing-page-intro {
	margin-bottom: 0;
}

.landing-page-intro > :first-child {
	margin-top: 0;
}

.landing-page-intro > :last-child {
	margin-bottom: 0;
}

.post-grid {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 28px 20px;
	width: 100%;
}

.post-card {
	display: flex;
	min-width: 0;
	margin: 0;
	flex-direction: column;
	align-items: flex-start;
}

.post-card-image {
	position: relative;
	display: block;
	width: 100%;
	aspect-ratio: 18 / 7;
	margin-bottom: 12px;
	overflow: hidden;
	border-radius: var(--radius-sm);
	background: var(--color-border-light);
}

.post-card-image img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.25s ease;
}

.post-card-image::before {
	position: absolute;
	inset: 0;
	z-index: 1;
	content: "";
	background: var(--color-primary-overlay);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.post-card-image::after {
	position: absolute;
	inset: 10px;
	z-index: 2;
	display: flex;
	border: 1px solid var(--color-on-primary-muted);
	border-radius: 6px;
	align-items: center;
	justify-content: center;
	content: "";
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

.post-card:hover .post-card-image img,
.post-card:focus-within .post-card-image img {
	transform: scale(1.025);
}

.post-card:hover .post-card-image::before,
.post-card:hover .post-card-image::after,
.post-card:focus-within .post-card-image::before,
.post-card:focus-within .post-card-image::after {
	opacity: 1;
}

/*
 * IDs de categorias existentes no banco. As classes são mantidas porque fazem
 * parte do contrato com a taxonomia. Os pictogramas usam a fonte local de ícones.
 */
.post-card-image.id772946::after,
.post-card-image.id772947::after,
.post-card-image.id772959::after {
	inset: 12px;
	border: 1px solid var(--color-on-primary-muted);
	font-family: 'icons'!important;
	color: #fff;
	font-size: 5.5em;
}

.post-card-image.id772946::after {
	content: '\e912';
}

.post-card-image.id772947::after {
	content: '\e913';
}

.post-card-image.id772959::after {
	content: '\e90f';
}

.post-card-title {
	display: -webkit-box;
	margin-bottom: var(--space-sm);
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 3;
	color: var(--color-text);
	font-size: 1.1rem;
	font-weight: 700;
	line-height: 1.25;
	text-decoration: none;
}

.post-card-title:hover,
.post-card-title:focus-visible {
	color: var(--color-link);
	text-decoration: underline;
}

.post-card-excerpt {
	display: -webkit-box;
	margin-bottom: var(--space-sm);
	overflow: hidden;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	color: var(--color-text);
	font-size: 16px;
	line-height: 1.45;
}

.post-card-date {
	display: block;
	margin-bottom: var(--space-sm);
	color: var(--color-text-muted);
	font-size: 14px;
	font-style: italic;
	line-height: 1.3;
}

.post-card-link {
	position: relative;
	display: inline-flex;
	margin-top: auto;
	color: var(--color-link);
	text-decoration: none;
}

.post-card-link::after {
	position: absolute;
	top: 100%;
	left: 0;
	width: 0;
	height: 2px;
	background: currentColor;
	content: "";
	transition: width 0.18s ease;
}

.post-card-link:hover::after,
.post-card-link:focus-visible::after {
	width: 100%;
}

.section-more {
	width: 100%;
	margin-top: 24px;
	text-align: right;
}

.section-more a {
	display: inline-flex;
	padding: 8px 20px;
	border-radius: var(--radius-pill);
	align-items: center;
	gap: 6px;
	background: #026bd4;
    color: #fff;
	font-weight: 600;
	text-decoration: none;
	transition: background-color 0.18s ease;
}

.section-more-candidates a:hover,
.section-more-candidates a:focus-visible {
	background-color: #0256aa;
    outline: 0;
}

.section-more-companies a:hover,
.section-more-companies a:focus-visible {
	background-color: #0256aa;
    outline: 0;
}

.section-more-media a:hover,
.section-more-media a:focus-visible {
	background: var(--color-media);
}

.post-grid-empty {
	grid-column: 1 / -1;
	margin: 0;
}

.archive-content {
	margin-top: 70px;
}

.related-posts-section .post-card-excerpt,
.related-posts-section .post-card-link {
	display: none;
}

/*
 * Relacionados mantêm o mesmo card, mas usam imagem no formato editorial
 * 350x200 e sem qualquer efeito visual de hover sobre a miniatura.
 */
.related-posts-section .post-card-image {
	aspect-ratio: 7 / 4;
}

.post-card-image-static::before,
.post-card-image-static::after {
	display: none;
}

.post-card:hover .post-card-image-static img,
.post-card:focus-within .post-card-image-static img {
	transform: none;
}

@media (max-width: 800px) {
	.post-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 520px) {
	.post-grid {
		grid-template-columns: 1fr;
	}

	.post-card-image {
		aspect-ratio: 16 / 8;
	}
}

@media (prefers-reduced-motion: reduce) {
	.post-card-image img,
	.post-card-image::before,
	.post-card-image::after,
	.post-card-link::after,
	.section-more a {
		transition: none;
	}
}
