/* Escola do Queijo Profissional section. */

.school {
	overflow: clip;
	background-color: var(--color-surface);
}

.school__header {
	margin-block-end: var(--space-gap-section);
}

.school__content {
	display: grid;
	/* 701 and 495 are the Figma card widths, 20px apart; the ratio keeps them fluid. */
	grid-template-columns: 701fr 495fr;
	gap: 20px;
}

/*
 * 702:93087: the three cards keep the height of their content (160, 136 and 160) and
 * share what is left of the 506px of the featured card, 25px between each.
 */
.school__list {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 20px;
}

.school__cta {
	margin-block-start: var(--space-gap-section);
}

/* Badges */

.badge {
	display: inline-flex;
	align-items: center;
	border-radius: var(--radius-pill);
	text-transform: uppercase;
	white-space: nowrap;
}

.badge--accent {
	/* 24 tall in 281:20697. */
	padding: 3px var(--space-3);
	background-color: var(--color-surface-muted);
	color: var(--color-link);
	font-size: var(--font-p4);
	font-weight: 400;
	line-height: 18px;
	letter-spacing: 0.04em;
}

.badge--white {
	/* 20 tall in 281:20749. */
	padding: 1px var(--space-2);
	background-color: var(--color-surface);
	color: var(--color-text);
	font-size: var(--font-p5);
	font-weight: 500;
	line-height: 18px;
	letter-spacing: 0.08em;
}

/* Featured card */

.article-featured {
	position: relative;
	display: flex;
	align-items: flex-end;
	min-height: 506px;
	border-radius: var(--radius-card);
	overflow: clip;
	background-color: var(--color-surface-article);
	isolation: isolate;
}

/* Zoom of 1.144x from the centre, 1000ms, with the card clipping. Nothing else moves. */
.article-featured__image {
	position: absolute;
	inset: 0;
	z-index: -2;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform var(--duration-card-hover) var(--ease-out);
}

/* The clip over the photo (media-motion.css) zooms with it. */
.article-featured > .media-motion {
	transition:
		opacity var(--duration-thumb-hover) var(--ease-out),
		transform var(--duration-card-hover) var(--ease-out);
}

.article-featured:hover .article-featured__image,
.article-featured:focus-within .article-featured__image,
.article-featured:hover > .media-motion,
.article-featured:focus-within > .media-motion {
	transform: scale(1.144);
}

.article-featured:hover,
.article-featured:focus-within {
	box-shadow: var(--shadow-featured-hover);
}

.article-featured::before {
	position: absolute;
	inset: 0;
	z-index: -1;
	background-image: var(--gradient-article-overlay);
	content: '';
}

.article-featured__content {
	display: flex;
	flex-direction: column;
	gap: var(--space-3);
	width: 100%;
	padding: var(--space-4);
}

/* TITLE group of 281:20692: title, excerpt and link 8 apart, 16 under the meta row. */
.article-featured__body {
	display: flex;
	flex-direction: column;
	gap: var(--space-1);
}

.article-featured__meta {
	display: flex;
	align-items: center;
	gap: var(--space-2);
	flex-wrap: wrap;
}

.article-featured__reading {
	color: var(--color-text-on-image);
	font-size: var(--font-p4);
	line-height: var(--lh-heading);
}

.article-featured__title {
	max-width: 618px;
	color: var(--color-text-on-brand);
	font-size: var(--font-h3);
}

/*
 * The stretched pseudo element makes the whole card clickable without nesting links.
 * It has to be the ::before: the underline of "Ler conteúdo" is an ::after, and stacking
 * both on the same pseudo element left it with top and bottom set at once. The link also
 * has to stay unpositioned, so the containing block is the card and not the link box.
 * The z-index puts it over the decorative "Ler conteúdo" span, which is positioned and
 * would otherwise take the pointer over its own text.
 */
.article-featured__link::before,
.article-card__link::before {
	position: absolute;
	z-index: 1;
	inset: 0;
	content: '';
}

.article-featured__excerpt {
	color: var(--color-text-on-brand-muted);
	font-size: var(--font-p3);
	line-height: 1.3;
}

/*
 * "Ler conteúdo" is the element that carries the line in the node (LINK | MENU light in
 * the featured card, LINK | MENU dark in the secondary ones), and the line is as wide as
 * the text, so the span hugs its content instead of stretching across the column.
 */
.article-featured__cta {
	--underline-offset: -1px;
	align-self: flex-start;
	/* LINK | MENU light has 12 above and below its text. */
	padding-block: var(--space-2);
	color: var(--color-text-on-brand);
	font-size: var(--font-cta);
	font-weight: 500;
	line-height: 24px;
}

.article-featured :focus-visible {
	outline-color: var(--color-focus-ring-on-brand);
}

/* Secondary card */

.article-card {
	position: relative;
	display: flex;
	flex: none;
	align-items: stretch;
	gap: var(--space-3);
	padding: 20px;
	border-radius: var(--radius-card);
	background-color: var(--color-surface-muted);
}

.article-card__thumb {
	display: flex;
	align-items: center;
	justify-content: center;
	flex: none;
	width: 92px;
	border-radius: var(--radius-thumb);
	background-color: var(--color-surface);
	overflow: hidden;
}

/* Zoom of 1.163x on the thumbnail, 800ms. The rest of the card does not move. */
.article-card__image {
	width: 92px;
	height: 120px;
	object-fit: cover;
	transition: transform var(--duration-thumb-hover) var(--ease-out);
}

.article-card:hover .article-card__image,
.article-card:focus-within .article-card__image {
	transform: scale(1.163);
}

.article-card:hover,
.article-card:focus-within {
	box-shadow: var(--shadow-card-hover);
}

/* CONTENT of 281:20736 hugs its children: tag, 8, title, 8, a 36px link row. */
.article-card__content {
	display: flex;
	flex: 1;
	flex-direction: column;
	gap: var(--space-1);
	min-width: 0;
}

.article-card__eyebrow {
	display: flex;
}

.article-card__title {
	color: var(--color-title-card);
	font-size: var(--font-h7);
}

.article-card__footer {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	min-height: 36px;
}

.article-card__cta {
	display: inline-flex;
	align-items: center;
	gap: var(--space-1);
	color: var(--color-link);
	font-size: var(--font-p3);
	font-weight: 500;
	line-height: 1.3;
}

/* Line 1 of LINK | MENU dark is 2px, against the 1.4px of the other two link components. */
.article-card__cta-text {
	--underline-offset: -1px;
	--underline-thickness: 2px;
}

.article-card__cta-icon {
	width: 12px;
	height: 12px;
}

/*
 * The whole card is one link, so the line follows the card hover, not the hover of the
 * decorative span that draws it.
 */
.article-card:hover .article-card__cta-text::after,
.article-card:focus-within .article-card__cta-text::after,
.article-featured:hover .article-featured__cta::after,
.article-featured:focus-within .article-featured__cta::after {
	opacity: 1;
}

/* As duas colunas do Figma sobrevivem até 1024: com gutter de 40px sobram 944px,
   que divididos em 701:495 dão 553 e 391, largura suficiente para o card destaque
   e para os secundários. Empilhar antes disso desperdiçava a tela do notebook. */
@media (max-width: 1023px) {
	.school__header {
		margin-block-end: var(--space-6);
	}

	.school__content {
		grid-template-columns: 1fr;
		gap: var(--space-4);
	}

	/* Sem numero fixo de colunas: o card declara a largura minima em que o titulo
	   ainda respira ao lado da thumb de 92px, e a fileira quebra sozinha em 3, 2
	   ou 1. Fixar repeat(3, 1fr) por breakpoint deixava cards de 258px no iPad. */
	.school__list {
		display: grid;
		grid-template-columns: repeat(auto-fit, minmax(min(100%, 20rem), 1fr));
	}

	.school__cta {
		margin-block-start: var(--space-6);
	}
}

@media (prefers-reduced-motion: reduce) {
	.article-featured__image,
	.article-card__image {
		transition: none;
	}

	.article-featured:hover .article-featured__image,
	.article-card:hover .article-card__image {
		transform: none;
	}
}

@media (max-width: 767px) {
	.article-featured {
		min-height: 380px;
	}
}
