/* ==========================================================================
   Trivali Imóveis — home ([imoveis_home])
   Design system Inter: laranja como única cor de ação, navy de apoio,
   cantos de 8px, elevação baixa. Herda os tokens de ti-front.css.
   ========================================================================== */

/* A home, a busca e a página do imóvel ocupam a largura toda, mesmo dentro do container do tema. */
body.ti-home-page { overflow-x: hidden; }

/* O topo já traz a logo e o título; o título da página viria repetido acima. */
body.ti-plugin-page .wp-block-post-title,
body.ti-plugin-page .entry-title,
body.ti-plugin-page .page-title { display: none; }

/* Temas de blocos aplicam "margin-left/right: auto !important" e um max-width
   nos filhos diretos do conteúdo. Dois nomes de classe vencem essa regra. */
.ti-app.ti-app--home,
.ti-app.ti-app--busca,
.ti-app.ti-app--single {
	max-width: none !important;
	width: auto;
	padding: 0;
	margin-inline: calc(50% - 50vw) !important;
	background: var(--ti-surface);
}

/* Página do imóvel com o template próprio do plugin: não há container do
   tema para "escapar", então o bloco ocupa a tela sem margens negativas. */
body.ti-single-template { margin: 0; padding: 0; background: var(--ti-surface, #fff); }
body.ti-single-template .ti-app.ti-app--single { margin-inline: 0 !important; width: 100%; }

.ti-wrap {
	max-width: 1240px;
	margin-inline: auto;
	padding: 40px 20px 8px;
}


.ti-eyebrow {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--ti-brand);
	margin-bottom: 12px;
}

/* ---------- Topo ---------- */

.ti-hero-home {
	position: relative;
	background-size: cover;
	background-position: center;
	background-color: var(--ti-navy-dark);
	padding-block: 56px 64px;
	padding-inline: 20px;
	text-align: center;
	color: #fff;
	isolation: isolate;
}

.ti-hero-home--liso {
	background-image: linear-gradient(135deg, #061f5c 0%, #04163f 100%);
}

.ti-hero-home__veu {
	position: absolute;
	inset: 0;
	z-index: -1;
	/* Véu vertical + escurecimento extra na coluna central, onde ficam logo, título e busca. */
	background:
		radial-gradient(ellipse 46% 72% at 50% 40%, rgba(7, 37, 52, .42) 0%, rgba(7, 37, 52, 0) 100%),
		linear-gradient(180deg, rgba(7, 37, 52, .78) 0%, rgba(7, 37, 52, .60) 45%, rgba(22, 22, 22, .72) 100%);
}

.ti-hero-home--liso .ti-hero-home__veu { background: none; }

.ti-hero-home__inner {
	max-width: 1100px;
	margin-inline: auto;
	display: flex;
	flex-direction: column;
	align-items: center;
}

.ti-hero-home__logo { display: inline-block; margin-bottom: 30px; }

.ti-hero-home__logo img {
	display: block;
	max-height: 165px;
	width: auto;
	max-width: 390px;
}

.ti-hero-home__marca {
	display: inline-flex;
	flex-direction: column;
	align-items: center;
	gap: 4px;
	margin-bottom: 30px;
	font-family: var(--ti-display);
	font-size: 26px;
	font-weight: 700;
	letter-spacing: -.01em;
	color: #fff;
	text-decoration: none;
}

.ti-hero-home__marca small {
	font-family: var(--ti-sans);
	font-size: 11px;
	font-weight: 600;
	letter-spacing: .14em;
	text-transform: uppercase;
	color: var(--ti-brand);
}

/* Especificidade acima de ".ti-app h1", senão o título herda a cor do texto. */
.ti-app .ti-hero-home__titulo {
	font-family: var(--ti-display);
	font-size: clamp(28px, 4.6vw, 46px);
	font-weight: 700;
	line-height: 1.14;
	letter-spacing: -.01em;
	color: #fff;
	max-width: 20ch;
}

.ti-app .ti-hero-home__sub {
	margin-top: 14px;
	font-size: clamp(15px, 1.6vw, 17px);
	line-height: 1.5;
	color: rgba(255, 255, 255, .86);
	max-width: 58ch;
}

/* Na busca o topo é mais curto: o foco é o formulário, não a manchete. */
.ti-hero-home--busca { padding-block: 40px 44px; }
.ti-hero-home--busca .ti-hero-home__logo { margin-bottom: 22px; }
.ti-hero-home--busca .ti-hero-home__logo img { max-height: 126px; max-width: 300px; }
.ti-app .ti-hero-home--busca .ti-hero-home__titulo { font-size: clamp(25px, 3.6vw, 38px); }
.ti-hero-home--busca .ti-filters { margin-top: 28px; }

/* Busca do topo */

.ti-hbusca { width: 100%; margin-top: 34px; }

.ti-hbusca__abas {
	display: inline-flex;
	gap: 8px;
	margin-bottom: 12px;
}

.ti-hbusca__aba { position: relative; cursor: pointer; }

.ti-hbusca__aba input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.ti-hbusca__aba span {
	display: block;
	padding: 12px 30px;
	border-radius: var(--ti-radius);
	background: rgba(255, 255, 255, .92);
	color: var(--ti-ink);
	font-size: 14px;
	font-weight: 600;
	transition: background .18s ease, color .18s ease;
}

.ti-hbusca__aba input:checked + span {
	background: var(--ti-brand);
	color: #fff;
}

.ti-hbusca__aba input:focus-visible + span {
	outline: 2px solid #fff;
	outline-offset: 2px;
}

.ti-hbusca__campos {
	display: grid;
	grid-template-columns: repeat(3, 1fr) auto;
	gap: 12px;
	align-items: end;
	background: var(--ti-surface);
	border-radius: var(--ti-radius);
	box-shadow: var(--ti-shadow-hover);
	padding: 16px;
	text-align: left;
}

.ti-hbusca__campos .ti-field label { color: var(--ti-muted); }
.ti-hbusca__campos .ti-btn { min-height: 44px; }

.ti-hcodigo {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 8px;
	margin-top: 22px;
}

.ti-hcodigo label {
	font-size: 13px;
	color: rgba(255, 255, 255, .8);
}

.ti-hcodigo__campo {
	display: flex;
	gap: 8px;
	width: min(420px, 100%);
}

.ti-hcodigo input {
	flex: 1;
	min-height: 44px;
	padding: 10px 14px;
	border: 1px solid transparent;
	border-radius: var(--ti-radius);
	background: rgba(255, 255, 255, .94);
	font-family: inherit;
	font-size: 15px;
	color: var(--ti-ink);
}

.ti-hcodigo input:focus {
	outline: none;
	border-color: var(--ti-brand);
	box-shadow: 0 0 0 .2rem var(--ti-brand-ring);
}

/* ---------- Seções ---------- */

/* Cada dobra ocupa a largura toda e alterna um tom leve de fundo
   (branco → frio → quente → branco…), contando a partir do topo. */
.ti-sec {
	padding: 56px 0;
	background: var(--ti-surface);
}

.ti-app--home > .ti-sec:nth-of-type(3n)     { background: var(--ti-tint-cool); }
.ti-app--home > .ti-sec:nth-of-type(3n + 1) { background: var(--ti-tint-warm); }

.ti-sec__inner {
	max-width: 1240px;
	margin-inline: auto;
	padding-inline: 20px;
}

.ti-sec__head { text-align: center; margin-bottom: 30px; }

.ti-sec__head h2 {
	font-family: var(--ti-display);
	font-size: clamp(23px, 3.2vw, 32px);
	font-weight: 700;
	letter-spacing: -.01em;
	line-height: 1.2;
}

.ti-sec__head p {
	margin-top: 10px;
	color: var(--ti-muted);
	font-size: 15.5px;
	max-width: 56ch;
	margin-inline: auto;
}

.ti-sec__head a { color: var(--ti-brand); text-decoration: none; font-weight: 600; }
.ti-sec__head a:hover { text-decoration: underline; }

.ti-sec__cta { display: flex; justify-content: center; margin-top: 32px; }

/* ---------- Carrossel ---------- */

.ti-carousel { position: relative; }

.ti-carousel__track {
	display: flex;
	gap: 22px;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	padding: 6px 4px 14px;
	scrollbar-width: none;
	-ms-overflow-style: none;
}

.ti-carousel__track::-webkit-scrollbar { display: none; }

/* Quando os cartões cabem na tela não há o que rolar: centraliza. */
.ti-carousel__track.is-curto { justify-content: center; }

.ti-carousel__item {
	flex: 0 0 clamp(268px, 31%, 350px);
	scroll-snap-align: start;
	display: flex;
}

.ti-carousel__item .ti-card { width: 100%; }

.ti-carousel__nav {
	position: absolute;
	top: 42%;
	transform: translateY(-50%);
	width: 44px;
	height: 44px;
	display: grid;
	place-items: center;
	border: 1px solid var(--ti-line);
	border-radius: var(--ti-radius-pill);
	background: var(--ti-surface);
	color: var(--ti-ink);
	font-size: 22px;
	line-height: 1;
	cursor: pointer;
	box-shadow: var(--ti-shadow);
	transition: background .18s ease, color .18s ease, opacity .18s ease;
	z-index: 2;
}

.ti-carousel__nav:hover { background: var(--ti-brand); border-color: var(--ti-brand); color: #fff; }

.ti-carousel__nav:focus-visible {
	outline: 2px solid var(--ti-brand);
	outline-offset: 2px;
}

.ti-carousel__nav--prev { left: -10px; }
.ti-carousel__nav--next { right: -10px; }

.ti-carousel__nav[disabled] { opacity: 0; pointer-events: none; }

/* ---------- Sobre ---------- */

.ti-sobre {
	max-width: 1240px;
	margin-inline: auto;
	padding: 64px 20px 72px;
	display: grid;
	grid-template-columns: .85fr 1.15fr;
	gap: 48px;
	align-items: center;
}

.ti-sobre__foto img {
	width: 100%;
	max-width: 100%;
	aspect-ratio: 4 / 5;
	object-fit: cover;
	object-position: center top; /* se precisar cortar, corta embaixo, nunca a cabeça */
	border-radius: var(--ti-radius-lg);
	display: block;
	box-shadow: var(--ti-shadow-hover);
}

.ti-sobre__texto h2 {
	font-family: var(--ti-display);
	font-size: clamp(24px, 3.2vw, 34px);
	font-weight: 700;
	letter-spacing: -.01em;
	margin-bottom: 16px;
}

.ti-sobre__texto p {
	color: var(--ti-ink-soft);
	font-size: 16px;
	line-height: 1.65;
	margin-bottom: 14px;
}

.ti-sobre__lista { margin: 22px 0 6px; display: grid; gap: 10px; }

.ti-sobre__lista li {
	position: relative;
	padding-left: 32px;
	font-size: 15.5px;
	color: var(--ti-ink);
	line-height: 1.5;
}

.ti-sobre__lista li::before {
	content: "";
	position: absolute;
	left: 0;
	top: 1px;
	width: 20px;
	height: 20px;
	border-radius: var(--ti-radius-pill);
	background: var(--ti-brand-soft);
}

.ti-sobre__lista li::after {
	content: "";
	position: absolute;
	left: 7px;
	top: 6px;
	width: 5px;
	height: 9px;
	border-right: 2px solid var(--ti-brand);
	border-bottom: 2px solid var(--ti-brand);
	transform: rotate(42deg);
}

.ti-sobre__cta { margin-top: 26px; }

/* ---------- Instagram ---------- */

.ti-insta {
	background: var(--ti-paper);
	padding: 64px 20px 56px;
	margin-top: 40px;
}

.ti-insta .ti-sec__head { margin-bottom: 26px; }

.ti-insta__grade {
	max-width: 1240px;
	margin-inline: auto;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 10px;
}

.ti-insta__item {
	position: relative;
	display: block;
	aspect-ratio: 1 / 1;
	max-width: 100%;
	border-radius: var(--ti-radius);
	overflow: hidden;
	background: var(--ti-line-soft);
}

.ti-app .ti-insta__item img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform .4s cubic-bezier(.2, .6, .2, 1);
}

.ti-insta__item:hover img { transform: scale(1.05); }

.ti-insta__over {
	position: absolute;
	inset: 0;
	display: grid;
	place-items: center;
	color: #fff;
	background: rgba(22, 22, 22, .42);
	opacity: 0;
	transition: opacity .2s ease;
}

.ti-insta__item:hover .ti-insta__over,
.ti-insta__item:focus-visible .ti-insta__over { opacity: 1; }

/* ---------- Rodapé ---------- */

.ti-rodape {
	background: var(--ti-navy-dark);
	color: rgba(255, 255, 255, .82);
	padding: 56px 20px 24px;
	margin-top: 48px;
}

.ti-rodape__grid {
	max-width: 1240px;
	margin-inline: auto;
	display: grid;
	grid-template-columns: 1.6fr 1fr 1fr 1fr;
	gap: 40px;
}

.ti-rodape__marca img {
	max-height: 72px;
	max-width: 200px;
	width: auto;
	display: block;
	margin-bottom: 16px;
}

.ti-rodape__marca strong {
	display: block;
	font-family: var(--ti-display);
	font-size: 22px;
	font-weight: 700;
	color: #fff;
	margin-bottom: 12px;
}

.ti-rodape__marca p {
	font-size: 14.5px;
	line-height: 1.6;
	max-width: 42ch;
	color: rgba(255, 255, 255, .72);
}

.ti-app .ti-rodape__col h3 {
	font-family: var(--ti-display);
	font-size: 15px;
	font-weight: 600;
	color: #fff;
	margin-bottom: 14px;
}

.ti-rodape__col ul { display: grid; gap: 10px; }

.ti-rodape__col li { font-size: 14.5px; line-height: 1.45; }

.ti-rodape__col a {
	color: rgba(255, 255, 255, .8);
	text-decoration: none;
	transition: color .15s ease;
}

.ti-rodape__col a:hover { color: var(--ti-brand); }

.ti-rodape__col a:focus-visible {
	outline: 2px solid var(--ti-brand);
	outline-offset: 3px;
}

.ti-rodape__base {
	max-width: 1240px;
	margin: 40px auto 0;
	padding-top: 20px;
	border-top: 1px solid rgba(255, 255, 255, .14);
	display: flex;
	flex-wrap: wrap;
	gap: 8px 24px;
	justify-content: space-between;
	font-size: 12.5px;
	color: rgba(255, 255, 255, .58);
}

.ti-rodape__powered a {
	color: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 600;
}

.ti-rodape__powered a:hover { color: var(--ti-accent); }

/* ---------- Página de busca: resultados como uma dobra da home ---------- */

.ti-sec--resultados { padding-block: 48px 56px; }
.ti-sec--resultados .ti-sec__head { margin-bottom: 18px; }
.ti-sec--resultados .ti-results__count { margin-top: 10px; }
.ti-app--busca .ti-results { margin-top: 0; }
.ti-app--busca .ti-results__bar { justify-content: flex-end; padding-bottom: 14px; margin-bottom: 22px; }

.ti-sec--chamada { background: var(--ti-tint-warm); padding-block: 48px 56px; }
.ti-sec--chamada .ti-cta { margin-top: 0; }

/* ---------- Página do imóvel ---------- */

.ti-hero-home--single { padding-block: 40px 44px; }
.ti-hero-home--single .ti-hero-home__logo { margin-bottom: 22px; }
.ti-hero-home--single .ti-hero-home__logo img { max-height: 126px; max-width: 300px; }
.ti-app .ti-hero-home--single .ti-hero-home__titulo { font-size: clamp(24px, 3.4vw, 36px); max-width: 28ch; }

.ti-hero-home__eyebrow {
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .1em;
	text-transform: uppercase;
	color: var(--ti-brand);
	margin-bottom: 12px;
}

.ti-hero-home__eyebrow .ti-dot { color: rgba(255, 255, 255, .5); }

.ti-hero-home__voltar {
	display: inline-block;
	margin-top: 22px;
	color: rgba(255, 255, 255, .86);
	font-size: 14px;
	font-weight: 600;
	text-decoration: none;
}

.ti-hero-home__voltar:hover { color: #fff; text-decoration: underline; }

.ti-sec--imovel { padding-block: 48px 64px; }

/* O título e o endereço já estão no topo. */
.ti-app--single .ti-detail__head { display: none; }

.ti-app--single .ti-detail__aside { display: grid; gap: 16px; align-content: start; }
.ti-app--single .ti-detail__main { display: grid; gap: 26px; }

.ti-app--single .ti-detail__prices { flex-direction: column; align-items: flex-start; gap: 10px; }
.ti-app--single .ti-detail__encargos { flex-basis: auto; width: 100%; }

.ti-app--single .ti-detail__actions { position: static; background: none; padding: 0; margin: 0; border: 0; }
.ti-app--single .ti-detail__actions .ti-btn { flex: 1 1 100%; }

.ti-sec--relacionados { background: var(--ti-tint-cool); }

@media (min-width: 981px) {
	.ti-app--single .ti-detail {
		grid-template-columns: minmax(0, 1fr) 380px;
		column-gap: 40px;
		align-items: start;
	}
	.ti-app--single .ti-gallery { grid-column: 1; grid-row: 1; }
	.ti-app--single .ti-detail__main { grid-column: 1; grid-row: 2; }
	.ti-app--single .ti-detail__aside { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 24px; }
}

/* ---------- Responsivo ---------- */

@media (max-width: 980px) {
	.ti-sobre { grid-template-columns: 1fr; gap: 32px; padding-block: 56px; }
	.ti-sobre__foto { max-width: 380px; margin-inline: auto; }
	.ti-sobre__foto img { aspect-ratio: 4 / 5; }
	.ti-rodape__grid { grid-template-columns: 1fr 1fr; gap: 32px; }
	.ti-rodape__marca { grid-column: 1 / -1; }
}

@media (max-width: 860px) {
	.ti-hbusca__campos { grid-template-columns: 1fr 1fr; }
	.ti-hbusca__campos .ti-btn { grid-column: 1 / -1; }
	.ti-carousel__nav { display: none; }
	.ti-carousel__item { flex-basis: min(300px, 82%); }
}

@media (max-width: 560px) {
	.ti-hero-home { padding-block: 40px 48px; }
	.ti-hero-home__logo img { max-height: 123px; max-width: min(300px, 78vw); }
	.ti-hbusca__abas { display: grid; grid-template-columns: 1fr 1fr; width: 100%; }
	.ti-hbusca__aba span { text-align: center; padding: 12px 10px; }
	.ti-hbusca__campos { grid-template-columns: 1fr; padding: 14px; }
	.ti-sec { padding-block: 44px; }
	.ti-insta { padding-block: 48px 44px; }
	.ti-insta__grade { grid-template-columns: repeat(2, 1fr); }
	.ti-rodape__grid { grid-template-columns: 1fr; gap: 28px; }
	.ti-rodape__base { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) {
	.ti-carousel__track { scroll-behavior: auto; }
	.ti-insta__item img { transition: none; }
}
