/*
 * Trabalhos grid ([textual_trabalhos_grid]).
 * Typography and colors inherit from the theme/Elementor kit; this file only
 * lays out the filters and the 3/2/1-column card grid.
 */

.ttg {
	--ttg-gap: 2rem;
	--ttg-media-bg: #e9e9e9;
	--ttg-muted: #6b6b6b;
	--ttg-border: #cfcfcf;
	--ttg-accent: #fbb118;
	--ttg-radius: 22px;
}

/* Filters — pill controls echoing the home page's label/button language. */

.ttg-filters {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 1rem 1.25rem;
	margin-bottom: var(--ttg-gap);
}

.ttg-filters__field {
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
	min-width: 11rem;
}

.ttg-filters__field--search {
	flex: 1 1 16rem;
}

.ttg-filters__field label {
	padding-left: 0.25rem;
	font-size: 0.72rem;
	font-weight: 600;
	letter-spacing: 0.12em;
	text-transform: uppercase;
	color: #000;
}

/* The extra `.ttg-filters` class outranks Elementor's kit input rule
   (.elementor-kit-14164 input:not(...):not(...), specificity 0,3,1). */
.ttg .ttg-filters .ttg-filters__field select,
.ttg .ttg-filters .ttg-filters__field input {
	width: 100%;
	padding: 0.7rem 1.1rem;
	border: 1px solid rgba(0, 0, 0, 0.18);
	border-radius: 999px;
	background: #fff;
	font: inherit;
	font-size: 0.95rem;
	line-height: 1.2;
	color: #000;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Replace the native select chevron with a brand-consistent one. */
.ttg .ttg-filters .ttg-filters__field select {
	appearance: none;
	-webkit-appearance: none;
	padding-right: 2.6rem;
	cursor: pointer;
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23000000' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 1.1rem center;
	background-size: 0.85rem;
}

.ttg .ttg-filters .ttg-filters__field select:hover,
.ttg .ttg-filters .ttg-filters__field input:hover {
	border-color: rgba(0, 0, 0, 0.4);
}

.ttg .ttg-filters .ttg-filters__field select:focus,
.ttg .ttg-filters .ttg-filters__field input:focus {
	outline: none;
	border-color: var(--ttg-accent);
	box-shadow: 0 0 0 3px rgba(251, 177, 24, 0.3);
}

.ttg-filters__field input::placeholder {
	color: var(--ttg-muted);
	opacity: 1;
}

.ttg-filters__field input[type="search"]::-webkit-search-cancel-button {
	-webkit-appearance: none;
	appearance: none;
}

.ttg-filters__field select option:disabled {
	color: var(--ttg-muted);
}

/* Grid */

.ttg-grid {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: var(--ttg-gap);
}

@media (max-width: 1024px) {
	.ttg-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

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

/* On the home the grid shows big two-column cards, like the mockup. */
.ttg--home .ttg-grid {
	grid-template-columns: repeat(2, 1fr);
}

@media (max-width: 767px) {
	.ttg--home .ttg-grid {
		grid-template-columns: 1fr;
	}
}

/* Cards — featured photo as background, chip with cliente/ano, vector overlay. */

/* .ttg prefix outranks hello-elementor's `.page-content a` underline rule. */
.ttg .ttg-card {
	position: relative;
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	min-height: 300px;
	padding: clamp(1.25rem, 2.5vw, 2rem);
	border-radius: var(--ttg-radius);
	overflow: hidden;
	background: var(--ttg-media-bg);
	color: #fff;
	text-decoration: none;
	transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.ttg--home .ttg-card {
	min-height: 340px;
}

.ttg .ttg-card:hover,
.ttg .ttg-card:focus-visible {
	transform: translateY(-6px);
	box-shadow: 0 22px 44px -22px rgba(0, 0, 0, 0.45);
}

.ttg .ttg-card:focus-visible {
	outline: 3px solid var(--ttg-accent);
	outline-offset: 3px;
}

.ttg-card[hidden] {
	display: none;
}

.ttg-card__media {
	position: absolute;
	inset: 0;
	display: block;
	background: var(--ttg-media-bg);
}

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

.ttg-card:hover .ttg-card__media img,
.ttg-card:focus-visible .ttg-card__media img {
	transform: scale(1.05);
}

/* Legibility scrim under the text. */
.ttg-card__media::after {
	content: "";
	position: absolute;
	inset: 0;
	background: linear-gradient(180deg, rgba(0, 0, 0, 0.06) 38%, rgba(0, 0, 0, 0.74) 100%);
}

/* Decorative vector shapes over the photo. */
.ttg-card__overlay {
	position: absolute;
	inset: 0;
	pointer-events: none;
	mix-blend-mode: hard-light;
}

.ttg-card__overlay svg {
	display: block;
	width: 100%;
	height: 100%;
}

/* The "Premiado" seal lives in css/selo-premiado.css — it is shared with the
   single-trabalho hero and is no longer a grid-owned element. */

.ttg-card__body {
	position: relative;
	display: grid;
	gap: 0.6rem;
	justify-items: start;
}

.ttg-card__chip {
	display: inline-flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.375rem 0.8rem;
	border-radius: 999px;
	background: rgba(0, 0, 0, 0.85);
	color: var(--ttg-accent);
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.ttg-card__title {
	font-weight: 700;
	font-size: clamp(1.15rem, 1.8vw, 1.55rem);
	line-height: 1.2;
	letter-spacing: -0.015em;
	color: #fff;
	text-wrap: balance;
}

/* Scroll reveal (class added by js/main.js; no-JS keeps cards visible). */
html.textual-js .ttg-card {
	opacity: 0;
	transform: translateY(26px);
	transition: opacity 0.6s ease, transform 0.6s ease, box-shadow 0.25s ease;
	transition-delay: var(--ttg-d, 0s), var(--ttg-d, 0s), 0s;
}

html.textual-js .ttg-card.is-in {
	opacity: 1;
	transform: none;
}

html.textual-js .ttg-card.is-in:hover,
html.textual-js .ttg-card.is-in:focus-visible {
	transform: translateY(-6px);
	transition-delay: 0s;
}

@media (prefers-reduced-motion: reduce) {
	html.textual-js .ttg-card {
		opacity: 1;
		transform: none;
		transition: none;
	}

	.ttg-card__media img {
		transition: none;
	}
}

/* Empty state (search can zero out the grid; the selects cannot) */

.ttg-empty {
	margin: var(--ttg-gap) 0;
	color: var(--ttg-muted);
}
