/**
 * Power to Move — project cards and the project carousel, shared by the
 * projects listing, the single project ("Mais Projetos") and the
 * [ptm_projetos] shortcode ("Os Nossos Projetos" on the homepage).
 *
 * Builds on shop.css (chips) and round-button.css (arrows). The carousel
 * markup is template-parts/projects/carousel.php; its arrows are driven by
 * assets/js/projects.js.
 *
 * Breakpoints match Blocksy: tablet ≤ 999.98px, mobile ≤ 689.98px.
 */

/* The carousel can sit in page content: undo heading/list spacing there. */
.ptm-more-projects {
	color: var(--theme-palette-color-2);
}

.ptm-more-projects .ptm-more-projects__title,
.ptm-more-projects .ptm-more-projects__subtitle {
	margin: 0;
}

.ptm-more-projects .ptm-more-projects__track {
	margin-top: 0;
	margin-bottom: 0;
	padding: 0;
	list-style: none;
}

.ptm-more-projects .ptm-project-card {
	margin: 0;
}

.ptm-project-card .ptm-icon {
	flex-shrink: 0;
}

/* Project card ------------------------------------------------------- */

.ptm-project-card__link {
	display: flex;
	flex-direction: column;
	gap: 24px;
	color: var(--theme-palette-color-2);
	text-decoration: none;
}

.ptm-project-card__link:hover {
	color: var(--theme-palette-color-2);
}

.ptm-project-card__media {
	display: block;
	aspect-ratio: 410 / 465;
	overflow: hidden;
	border-radius: 12px;
	background-color: var(--theme-palette-color-6);
}

.ptm-project-card__image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.4s ease;
}

.ptm-project-card__link:hover .ptm-project-card__image {
	transform: scale(1.04);
}

.ptm-project-card__info {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 16px;
}

.ptm-project-card__tags {
	display: flex;
	flex-wrap: wrap;
	gap: 7px;
}

.ptm-project-card--grid .ptm-chip {
	padding: 5px 12px;
	line-height: 17px;
}

.ptm-project-card__title {
	font-size: 24px;
	line-height: 1.1;
	letter-spacing: -0.006em;
}

.ptm-project-card__context {
	font-size: 14px;
	line-height: 1.3;
	color: var(--theme-palette-color-9);
}

.ptm-project-card__description {
	font-size: 16px;
	line-height: 1.3;
	letter-spacing: 0.0014em;
	color: var(--theme-palette-color-9);
}

.ptm-project-card__more {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding-bottom: 3px;
	border-bottom: 1px solid var(--theme-palette-color-12);
	font-size: 16px;
	line-height: 1.2;
}

.ptm-project-card__more .ptm-icon--link-arrow-thin {
	width: 11px;
	height: 11px;
	margin: 3px;
	transition: transform 0.15s ease;
}

.ptm-project-card__link:hover .ptm-project-card__more .ptm-icon {
	transform: translateX(4px);
}

/* Carousel ("Mais Projetos", "Os Nossos Projetos") ----------------- */

.ptm-more-projects {
	display: flex;
	flex-direction: column;
	gap: 72px;
	padding: 80px 0;
	overflow: hidden;
	background-color: var(--theme-palette-color-6);
}

.ptm-more-projects__header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 48px;
}

.ptm-more-projects__heading {
	display: flex;
	flex-direction: column;
	gap: 4px;
}

.ptm-more-projects .ptm-more-projects__title {
	font-size: 48px;
	font-weight: 500;
	line-height: 1.1;
	letter-spacing: 0;
	color: var(--theme-palette-color-4);
}

.ptm-more-projects__subtitle {
	font-size: 18px;
	line-height: 1.3;
}

.ptm-more-projects__controls {
	display: flex;
	gap: 12px;
}

/* Cards run past the right edge of the container, as in the design. */
.ptm-more-projects__track {
	display: flex;
	align-items: flex-start;
	gap: 24px;
	margin-right: calc((100% - 100vw) / 2);
	overflow-x: auto;
	overscroll-behavior-x: contain;
	scroll-snap-type: x mandatory;
	scrollbar-width: none;
}

.ptm-more-projects__track::-webkit-scrollbar {
	display: none;
}

.ptm-more-projects__track > li {
	flex: 0 0 410px;
	scroll-snap-align: start;
}

.ptm-more-projects__track > li:last-child {
	margin-right: calc((100vw - 100%) / 2);
}

.ptm-project-card--compact .ptm-project-card__link {
	gap: 24px;
}

.ptm-project-card--compact:nth-child(even) .ptm-project-card__media {
	aspect-ratio: 409 / 327;
}

.ptm-project-card--compact .ptm-project-card__info {
	gap: 12px;
}

/* Keep the tags visible on the grey section background. */
.ptm-project-card--compact .ptm-chip {
	background-color: var(--theme-palette-color-11);
}

.ptm-project-card--compact .ptm-project-card__title {
	line-height: 25px;
	letter-spacing: -0.025em;
}

.ptm-project-card--compact .ptm-project-card__more {
	gap: 12px;
	border-bottom-color: var(--theme-palette-color-2);
	font-weight: 500;
	line-height: 25px;
	padding-bottom: 0;
}

.ptm-project-card--compact .ptm-icon--link-arrow {
	width: 16px;
	height: 14px;
}

/* ------------------------------------------------------------------ */
/* Tablet                                                               */
/* ------------------------------------------------------------------ */

@media (max-width: 999.98px) {
	.ptm-more-projects {
		gap: 40px;
		padding: 48px 0;
	}
}

/* ------------------------------------------------------------------ */
/* Mobile                                                               */
/* ------------------------------------------------------------------ */

@media (max-width: 689.98px) {
	.ptm-project-card__link {
		gap: 20px;
	}

	.ptm-project-card__media {
		aspect-ratio: 350 / 387;
	}

	.ptm-project-card .ptm-chip {
		font-size: 12px;
	}

	.ptm-more-projects {
		gap: 36px;
		background-color: var(--theme-palette-color-11);
	}

	.ptm-more-projects__header {
		flex-direction: column;
		align-items: flex-start;
		gap: 24px;
	}

	.ptm-more-projects .ptm-more-projects__title {
		font-size: 34px;
		color: var(--theme-palette-color-2);
	}

	.ptm-more-projects__subtitle {
		font-size: 16px;
		color: var(--theme-palette-color-9);
	}

	/* Stacked list on mobile (three projects), so the arrows have nothing to move. */
	.ptm-more-projects__controls {
		display: none;
	}

	.ptm-more-projects__track {
		flex-direction: column;
		gap: 40px;
		margin-right: 0;
		overflow: visible;
	}

	.ptm-more-projects__track > li {
		flex: none;
		width: 100%;
	}

	.ptm-more-projects__track > li:nth-child(n + 4) {
		display: none;
	}

	.ptm-more-projects__track > li:last-child {
		margin-right: 0;
	}

	.ptm-project-card--compact .ptm-project-card__link {
		gap: 18px;
	}

	.ptm-project-card--compact .ptm-project-card__media {
		aspect-ratio: 350 / 388;
	}

	.ptm-project-card--compact:nth-child(even) .ptm-project-card__media {
		aspect-ratio: 350 / 274;
	}

	.ptm-project-card--compact .ptm-project-card__title {
		font-size: 22px;
		line-height: 1.1;
	}

	.ptm-project-card--compact .ptm-project-card__more {
		gap: 8px;
		padding-bottom: 3px;
		border-bottom-color: var(--theme-palette-color-5);
		font-size: 14px;
		font-weight: 400;
		line-height: 1.2;
	}

	/* Homepage (--swipe): a swipeable row on white instead of the stacked list. */
	.ptm-more-projects--swipe {
		gap: 24px;
		padding: 40px 0;
		background-color: transparent;
	}

	.ptm-more-projects--swipe .ptm-more-projects__title {
		font-size: 28px;
		color: var(--theme-palette-color-4);
	}

	.ptm-more-projects--swipe .ptm-more-projects__subtitle {
		color: var(--theme-palette-color-2);
	}

	.ptm-more-projects--swipe .ptm-more-projects__track {
		flex-direction: row;
		gap: 24px;
		margin-right: calc((100% - 100vw) / 2);
		overflow-x: auto;
	}

	.ptm-more-projects--swipe .ptm-more-projects__track > li,
	.ptm-more-projects--swipe .ptm-more-projects__track > li:nth-child(n + 4) {
		display: block;
		flex: 0 0 min(310px, 80vw);
		width: auto;
	}

	.ptm-more-projects--swipe .ptm-more-projects__track > li:last-child {
		margin-right: calc((100vw - 100%) / 2);
	}

	.ptm-more-projects--swipe .ptm-project-card--compact .ptm-project-card__link {
		gap: 24px;
	}

	.ptm-more-projects--swipe .ptm-project-card--compact .ptm-project-card__media {
		aspect-ratio: 310 / 352;
	}

	.ptm-more-projects--swipe .ptm-project-card--compact:nth-child(even) .ptm-project-card__media {
		aspect-ratio: 310 / 248;
	}

	.ptm-more-projects--swipe .ptm-project-card--compact .ptm-chip {
		background-color: var(--theme-palette-color-6);
	}

	.ptm-more-projects--swipe .ptm-project-card--compact .ptm-project-card__title {
		font-size: 20px;
		line-height: 25px;
		letter-spacing: -0.03em;
	}

	.ptm-more-projects--swipe .ptm-project-card--compact .ptm-project-card__more {
		gap: 12px;
		padding-bottom: 0;
		border-bottom-color: var(--theme-palette-color-2);
		font-size: 16px;
		font-weight: 500;
		line-height: 25px;
	}
}
