/*
  Lista do blog (ricomarinho-landing 1.10.0). Soma-se ao single-post.css, que traz as
  variáveis, o topo, a barra do site, os botões, os CTAs e o placeholder das imagens.

  Ideia: o blog lido como um sistema de água. Os temas ficam numa linha de processo
  (estações sobre um tubo, como num P&ID) e os artigos num registro por ano, em linhas,
  como uma lista de documentos. O único movimento automático é o tubo se desenhando
  quando a página abre.
*/

/* ---------- Topo ---------- */
.rm-post .rm-hero--blog {
	padding: 40px 20px 64px;
}

.rm-hero--blog .rm-hero__inner {
	max-width: 1056px;
}

.rm-post .rm-hero--blog .rm-hero__title {
	font-size: 34px;
	line-height: 1.12;
	letter-spacing: -0.02em;
	max-width: 760px;
	margin-bottom: 16px;
}

.rm-post .rm-hero--blog .rm-hero__lead {
	max-width: 620px;
	margin-bottom: 40px;
}

.rm-hero--blog .rm-hero__lead p {
	margin: 0;
}

@media (min-width: 768px) {
	.rm-post .rm-hero--blog {
		padding: 56px 32px 88px;
	}

	.rm-post .rm-hero--blog .rm-hero__title {
		font-size: 52px;
	}
}

/* ---------- Linha de processo (filtro por tema) ---------- */
.rm-line {
	--rm-dot: 14px;
	margin: 0 -20px;
}

.rm-post .rm-line__label {
	margin: 0 20px 14px;
	font-size: 14px;
	font-weight: 500;
	color: rgba(255, 255, 255, 0.78);
}

.rm-post .rm-line__list {
	display: flex;
	margin: 0;
	padding: 0 20px 8px;
	list-style: none;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scroll-padding-left: 20px;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
	mask-image: linear-gradient(to right, #000 85%, transparent);
	-webkit-mask-image: linear-gradient(to right, #000 85%, transparent);
}

.rm-line__list::-webkit-scrollbar {
	display: none;
}

.rm-post .rm-line__stop {
	position: relative;
	flex: 0 0 132px;
	margin: 0;
	padding: 0 12px 0 0;
	scroll-snap-align: start;
}

.rm-post .rm-line__stop:last-child {
	flex-basis: 152px;
}

/* Tubo: de cada estação até a próxima. */
.rm-line__stop:not(:last-child)::before {
	content: '';
	position: absolute;
	left: calc(var(--rm-dot) / 2);
	right: calc(var(--rm-dot) / -2);
	top: calc(var(--rm-dot) / 2 - 1px);
	height: 2px;
	background: rgba(28, 189, 201, 0.85);
	transform-origin: 0 50%;
	animation: rm-pipe 0.35s ease-out both;
	animation-delay: calc(var(--i) * 0.07s + 0.15s);
}

@keyframes rm-pipe {
	from {
		transform: scaleX(0);
	}
}

.rm-post .rm-line__stop a {
	position: relative;
	display: block;
	padding-top: calc(var(--rm-dot) + 14px);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.35;
	color: rgba(255, 255, 255, 0.86);
	text-decoration: none;
}

/* Estação: anel no tubo. */
.rm-line__stop a::before {
	content: '';
	position: absolute;
	left: 0;
	top: 0;
	width: var(--rm-dot);
	height: var(--rm-dot);
	border-radius: 50%;
	border: 2px solid var(--rm-secondary);
	background: var(--rm-primary-dark);
	box-sizing: border-box;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.rm-post .rm-line__stop a:hover,
.rm-post .rm-line__stop a:focus-visible {
	color: #fff;
	text-decoration: underline;
	text-underline-offset: 4px;
}

.rm-line__stop a:hover::before,
.rm-line__stop a:focus-visible::before {
	background: var(--rm-secondary);
	transform: scale(1.15);
}

.rm-post .rm-line__stop a:focus-visible {
	outline: 3px solid var(--rm-secondary);
	outline-offset: 4px;
	border-radius: 4px;
}

.rm-post .rm-line__stop a[aria-current='page'] {
	color: #fff;
	font-weight: 600;
}

.rm-line__stop a[aria-current='page']::before {
	background: #fff;
	border-color: #fff;
	box-shadow: 0 0 0 5px rgba(28, 189, 201, 0.35);
}

@media (min-width: 1100px) {
	.rm-line {
		margin: 0;
	}

	.rm-post .rm-line__label {
		margin-left: 0;
	}

	.rm-post .rm-line__list {
		padding: 0 0 8px;
		overflow: visible;
		mask-image: none;
		-webkit-mask-image: none;
	}

	.rm-post .rm-line__stop {
		flex: 1 1 0;
		min-width: 0;
	}

	.rm-post .rm-line__stop:last-child {
		flex: 1 1 0;
	}
}

/* ---------- Corpo ---------- */
.rm-blog__wrap {
	max-width: 1120px;
	margin: 0 auto;
	padding: 0 20px 80px;
}

@media (min-width: 768px) {
	.rm-blog__wrap {
		padding: 0 32px 96px;
	}
}

/* ---------- Mais recente: sobe sobre o topo ---------- */
.rm-post .rm-lead {
	position: relative;
	z-index: 1;
	display: grid;
	margin-top: -32px;
	background: #fff;
	border-radius: var(--rm-radius);
	overflow: hidden;
	box-shadow: var(--rm-shadow);
}

.rm-lead__media {
	aspect-ratio: 16 / 9;
	overflow: hidden;
	background: var(--rm-primary);
}

.rm-post .rm-lead__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.rm-post .rm-lead:hover .rm-lead__media img {
	transform: scale(1.03);
}

.rm-lead__body {
	display: flex;
	flex-direction: column;
	gap: 14px;
	padding: 24px;
}

.rm-post .rm-lead__label {
	margin: 0;
	font-size: 14px;
	font-weight: 600;
	color: var(--rm-link);
}

.rm-post .rm-lead__title {
	margin: 0;
	font-family: var(--rm-font);
	font-size: 24px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: -0.01em;
	text-wrap: balance;
}

.rm-post .rm-lead__title a,
.rm-post .rm-entry__title a {
	color: var(--rm-primary);
	text-decoration: none;
}

/* O card inteiro clica, pelo link do título. */
.rm-post .rm-lead__title a::after,
.rm-post .rm-entry__title a::after {
	content: '';
	position: absolute;
	inset: 0;
	z-index: 1;
}

.rm-post .rm-lead__title a:focus-visible,
.rm-post .rm-entry__title a:focus-visible {
	outline: none;
}

.rm-post .rm-lead:focus-within,
.rm-post .rm-entry:focus-within {
	outline: 3px solid var(--rm-secondary);
	outline-offset: 4px;
}

.rm-post .rm-lead:hover .rm-lead__title a {
	color: var(--rm-link);
}

.rm-post .rm-lead__excerpt {
	margin: 0;
	font-size: 16px;
	line-height: 1.7;
}

.rm-post .rm-lead__meta {
	margin: 0;
	font-size: 14px;
	color: var(--rm-muted);
}

@media (min-width: 900px) {
	.rm-post .rm-lead {
		grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
		margin-top: -48px;
	}

	.rm-lead__media {
		aspect-ratio: auto;
		min-height: 380px;
	}

	.rm-lead__body {
		justify-content: center;
		padding: 48px;
	}

	.rm-post .rm-lead__title {
		font-size: 30px;
	}
}

/* ---------- Registro por ano ---------- */
.rm-register {
	margin-top: 64px;
}

.rm-blog__wrap > .rm-register:first-child {
	margin-top: 48px;
}

.rm-year + .rm-year {
	margin-top: 56px;
}

.rm-post .rm-year__label {
	margin: 0;
	padding-bottom: 12px;
	border-bottom: 2px solid var(--rm-primary);
	font-family: var(--rm-font);
	font-size: 28px;
	font-weight: 600;
	line-height: 1;
	letter-spacing: -0.01em;
	color: var(--rm-primary);
}

.rm-post .rm-entry {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) 96px;
	grid-template-areas:
		'body media'
		'meta meta';
	gap: 12px 16px;
	padding: 24px 0;
	border-bottom: 1px solid var(--rm-border);
}

.rm-entry__body {
	grid-area: body;
	min-width: 0;
}

.rm-post .rm-entry__meta {
	grid-area: meta;
	display: flex;
	flex-wrap: wrap;
	gap: 4px 16px;
	margin: 0;
	font-size: 13px;
	color: var(--rm-muted);
}

.rm-post .rm-entry__cat {
	margin: 0 0 6px;
	font-size: 13px;
	font-weight: 600;
	color: var(--rm-link);
}

.rm-post .rm-entry__title {
	margin: 0;
	font-family: var(--rm-font);
	font-size: 18px;
	font-weight: 600;
	line-height: 1.35;
	text-wrap: pretty;
}

.rm-post .rm-entry__excerpt {
	display: none;
	margin: 10px 0 0;
	font-size: 15px;
	line-height: 1.65;
	color: var(--rm-text);
	max-width: 62ch;
}

.rm-entry__media {
	grid-area: media;
	align-self: start;
	aspect-ratio: 1;
	border-radius: 10px;
	overflow: hidden;
	background: var(--rm-primary);
}

.rm-post .rm-entry__media img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.rm-post .rm-entry:hover .rm-entry__title a {
	color: var(--rm-link);
}

.rm-post .rm-entry:hover .rm-entry__media img {
	transform: scale(1.04);
}

@media (min-width: 640px) {
	.rm-post .rm-entry__excerpt {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.rm-post .rm-entry {
		grid-template-columns: minmax(0, 1fr) 160px;
	}

	.rm-entry__media {
		aspect-ratio: 4 / 3;
	}
}

@media (min-width: 900px) {
	.rm-post .rm-entry {
		grid-template-columns: 168px minmax(0, 1fr) 240px;
		grid-template-areas: 'meta body media';
		gap: 40px;
		padding: 32px 0;
	}

	.rm-post .rm-entry__meta {
		flex-direction: column;
		gap: 4px;
		padding-top: 2px;
		font-size: 14px;
	}

	.rm-post .rm-entry__meta time {
		font-weight: 500;
		color: var(--rm-text);
	}

	.rm-post .rm-entry__title {
		font-size: 21px;
	}

	.rm-entry__media {
		aspect-ratio: 16 / 10;
		border-radius: 12px;
	}

	/* Faixa clara no hover, só onde há espaço lateral. */
	.rm-post .rm-entry::before {
		content: '';
		position: absolute;
		inset: 0 -24px;
		z-index: -1;
		border-radius: 12px;
		background: var(--rm-surface);
		opacity: 0;
		transition: opacity 0.2s ease;
	}

	.rm-post .rm-entry:hover::before {
		opacity: 1;
	}

	.rm-year__list {
		position: relative;
		z-index: 0;
	}
}

/* CTA no meio do registro */
.rm-post .rm-register__cta .rm-cta--inline {
	margin: 32px 0;
}

@media (min-width: 900px) {
	.rm-post .rm-register__cta .rm-cta--inline {
		display: grid;
		grid-template-columns: minmax(0, 1fr) auto;
		grid-template-areas: 'head btn' 'text btn';
		column-gap: 40px;
		align-items: center;
	}

	.rm-register__cta .rm-cta__head {
		grid-area: head;
	}

	.rm-post .rm-register__cta .rm-cta__text {
		grid-area: text;
		margin-bottom: 0;
	}

	.rm-register__cta .rm-btn {
		grid-area: btn;
	}
}

/* ---------- Paginação ---------- */
.rm-pager {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 8px;
	margin-top: 48px;
}

.rm-post .rm-pager .page-numbers {
	min-width: 44px;
	height: 44px;
	padding: 0 18px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50px;
	border: 1px solid var(--rm-border);
	background: #fff;
	color: var(--rm-primary);
	font-size: 15px;
	font-weight: 500;
	text-decoration: none;
	transition: border-color 0.2s ease, background-color 0.2s ease;
}

.rm-post .rm-pager a.page-numbers:hover,
.rm-post .rm-pager a.page-numbers:focus-visible {
	border-color: var(--rm-primary);
	background: var(--rm-surface);
	text-decoration: none;
}

.rm-post .rm-pager .page-numbers.current {
	background: var(--rm-primary);
	border-color: var(--rm-primary);
	color: #fff;
	font-weight: 600;
}

.rm-post .rm-pager .page-numbers.dots {
	border: 0;
	min-width: 0;
	padding: 0 4px;
}

/* ---------- Vazio e CTA final ---------- */
.rm-post .rm-blog__empty {
	padding: 56px 0 8px;
}

.rm-post .rm-blog__empty p {
	margin: 0 0 20px;
	font-size: 17px;
}

.rm-blog__final {
	margin-top: 40px;
}

.rm-post .rm-blog__final .rm-cta--final .rm-cta__title {
	color: #fff;
	font-family: var(--rm-font);
	font-size: 26px;
	font-weight: 600;
	line-height: 1.2;
	margin: 0 0 16px;
}

@media (min-width: 768px) {
	.rm-post .rm-blog__final .rm-cta--final .rm-cta__title {
		font-size: 34px;
	}
}
