/* =========================================================
   WP Posts Showcase — Estilos dos 4 layouts
   ========================================================= */

/* ---------------------------------------------------------
   Base
   --------------------------------------------------------- */
.wps-widget {
	--wps-primary: #1B4F8A;
	--wps-panel-bg: var(--wps-primary);
	--wps-panel-text: #fff;
	--wps-panel-excerpt: rgba(255, 255, 255, 0.88);
	--wps-button-bg: var(--wps-primary);
	--wps-button-text: #fff;
	--wps-focus: #111;
	box-sizing: border-box;
	font-family: inherit;
}

.wps-widget *,
.wps-widget *::before,
.wps-widget *::after {
	box-sizing: inherit;
}

.wps-widget a {
	text-decoration: none;
	color: inherit;
	display: block;
}

.wps-widget a:focus-visible,
.wps-widget button:focus-visible {
	outline: 3px solid var(--wps-focus);
	outline-offset: 4px;
}

.wps-widget img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.wps-notice {
	padding: 16px;
	background: #fff3cd;
	border-left: 4px solid #ffc107;
	color: #856404;
	font-size: 14px;
	margin: 0;
}

/* ---------------------------------------------------------
   Layout 1 — Hero Grid
   --------------------------------------------------------- */

.wps-preset-reference .wps-hero-grid {
	width: 100%;
	max-width: 100%;
}

/* Topo: 2 colunas iguais, sem gap */
.wps-hero-top {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0;
}

/* Coluna esquerda — imagem com overlay */
.wps-hero-featured {
	position: relative;
	height: 360px;
	overflow: hidden;
	border-radius: 8px 0 0 8px;
	background: #e9ecef;
}

.wps-hero-featured img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.wps-hero-featured:hover img {
	transform: scale(1.03);
}

.wps-hero-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.78) 0%,
		rgba(0, 0, 0, 0.25) 55%,
		transparent 100%
	);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 28px 24px;
	z-index: 1;
}

.wps-hero-category {
	display: inline-block;
	background: var(--wps-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 4px 12px;
	border-radius: 2px;
	margin-bottom: 10px;
	width: fit-content;
}

.wps-hero-title {
	color: #fff;
	font-size: 17px;
	font-weight: 700;
	margin: 0;
	line-height: 1.4;
}

/* Coluna direita — painel cor primária */
.wps-hero-panel {
	background: var(--wps-panel-bg);
	display: flex !important;
	align-items: center;
	justify-content: flex-start;
	padding: 36px 40px;
	height: 360px;
	border-radius: 0 8px 8px 0;
	transition: background-color 0.2s ease;
}

.wps-hero-panel > div {
	width: 100%;
}

.wps-hero-panel-title {
	color: var(--wps-panel-text);
	font-size: 28px;
	font-weight: 800;
	line-height: 1.35;
	margin: 0;
	transition: color 0.2s ease;
}

/* Cards secundários: 3 colunas */
.wps-hero-cards {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 16px;
	margin-top: 16px;
	width: 100%;
	max-width: 100%;
	overflow-x: hidden;
}

.wps-card {
	display: flex;
	flex-direction: column;
	min-width: 0;
	max-width: 100%;
}

.wps-card-thumb {
	position: relative;
	width: 100%;
	max-width: 100%;
	height: 185px;
	overflow: hidden;
	border-radius: 8px;
	background: #e9ecef;
}

.wps-card-thumb img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.wps-card:hover .wps-card-thumb img {
	transform: scale(1.04);
}

.wps-card-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to top,
		rgba(0, 0, 0, 0.70) 0%,
		rgba(0, 0, 0, 0.10) 55%,
		transparent 100%
	);
	display: flex;
	flex-direction: column;
	justify-content: flex-end;
	padding: 12px;
	z-index: 1;
}

.wps-card-category {
	font-size: 10px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: #fff;
	margin-bottom: 4px;
}

.wps-card-title {
	color: #fff;
	font-size: 12px;
	font-weight: 600;
	margin: 0;
	line-height: 1.35;
}

.wps-card-caption {
	font-size: 14px;
	font-weight: 600;
	margin: 10px 0 0;
	color: #222;
	line-height: 1.45;
	overflow-wrap: anywhere;
}

/* Botão CTA */
.wps-cta {
	text-align: center;
	margin-top: 28px;
}

.wps-btn {
	display: inline-block;
	background: var(--wps-button-bg);
	color: var(--wps-button-text);
	padding: 13px 40px;
	border-radius: 30px;
	font-size: 14px;
	font-weight: 600;
	letter-spacing: 0.3px;
	transition: opacity 0.2s, transform 0.2s;
}

.wps-btn:hover {
	opacity: 0.85;
	transform: translateY(-1px);
}

/* Tamanhos predefinidos do botão */
.wps-btn-size-sm .wps-btn { padding: 7px 22px; font-size: 12px; }
.wps-btn-size-md .wps-btn { padding: 11px 36px; font-size: 14px; }
.wps-btn-size-lg .wps-btn { padding: 16px 52px; font-size: 16px; }
.wps-btn-size-full .wps-cta { display: block; }
.wps-btn-size-full .wps-btn { display: block; width: 100%; text-align: center; }

/* Efeitos de hover do botão */
.wps-btn-effect-lift .wps-btn:hover { opacity: 0.85; transform: translateY(-1px); }
.wps-btn-effect-none .wps-btn:hover { opacity: 1; transform: none; }
.wps-btn-effect-darken .wps-btn:hover { opacity: 0.7; transform: none; }
.wps-btn-effect-scale .wps-btn:hover { opacity: 1; transform: scale(1.04); }

/* ---------------------------------------------------------
   Layout 2 — Full Grid (2×2)
   --------------------------------------------------------- */
.wps-full-grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 20px;
}

.wps-grid-card {
	display: flex;
	flex-direction: column;
	overflow: hidden;
	min-width: 0;
}

.wps-grid-card img {
	height: 210px;
	object-fit: cover;
	border-radius: 8px;
	transition: transform 0.3s ease;
}

.wps-grid-card:hover img {
	transform: scale(1.03);
}

.wps-grid-card-body {
	padding: 14px 0 4px;
}

.wps-grid-card-body .wps-cat {
	display: block;
	font-size: 11px;
	color: var(--wps-primary);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	margin-bottom: 6px;
}

.wps-grid-card-body h3 {
	font-size: 15px;
	font-weight: 600;
	margin: 0;
	color: #222;
	line-height: 1.45;
}

/* ---------------------------------------------------------
   Layout 3 — List View
   --------------------------------------------------------- */
.wps-list-view {
	display: flex;
	flex-direction: column;
	gap: 18px;
}

.wps-list-item {
	display: flex;
	gap: 16px;
	align-items: flex-start;
}

.wps-list-item img {
	width: 110px;
	height: 80px;
	flex-shrink: 0;
	object-fit: cover;
	border-radius: 8px;
}

.wps-list-body {
	flex: 1;
}

.wps-list-body h3 {
	font-size: 15px;
	font-weight: 600;
	margin: 0 0 7px;
	color: #222;
	line-height: 1.45;
}

.wps-list-body p {
	font-size: 13px;
	color: #555;
	margin: 0;
	line-height: 1.6;
}

/* ---------------------------------------------------------
   Layout 4 — Carousel
   --------------------------------------------------------- */
.wps-carousel-wrap {
	position: relative;
	padding: 0 24px;
}

.wps-carousel {
	display: flex;
	overflow-x: auto;
	scroll-snap-type: x mandatory;
	gap: 16px;
	scroll-behavior: smooth;
	-ms-overflow-style: none;
	scrollbar-width: none;
}

.wps-carousel::-webkit-scrollbar {
	display: none;
}

.wps-carousel-slide {
	flex: 0 0 calc(33.333% - 11px);
	scroll-snap-align: start;
	min-width: 0;
}

.wps-carousel-slide a {
	display: block;
}

.wps-carousel-slide img {
	height: 185px;
	object-fit: cover;
	border-radius: 8px;
}

.wps-carousel-slide h3 {
	font-size: 14px;
	font-weight: 600;
	margin: 10px 0 7px;
	color: #222;
	line-height: 1.45;
}

.wps-btn-sm {
	display: inline-block;
	font-size: 12px;
	color: var(--wps-primary);
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.4px;
}

.wps-carousel-prev,
.wps-carousel-next {
	position: absolute;
	top: 50%;
	transform: translateY(-60%);
	background: var(--wps-primary);
	color: #fff;
	border: none;
	cursor: pointer;
	width: 38px;
	height: 38px;
	border-radius: 50%;
	font-size: 22px;
	line-height: 1;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
	transition: opacity 0.2s;
}

.wps-carousel-prev:hover,
.wps-carousel-next:hover {
	opacity: 0.8;
}

.wps-carousel-prev {
	left: -6px;
}

.wps-carousel-next {
	right: -6px;
}

/* ---------------------------------------------------------
   Painel — excerpt (oculto no desktop, visível no mobile)
   --------------------------------------------------------- */
.wps-hero-panel-excerpt {
	display: block;
	color: var(--wps-panel-excerpt);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.65;
	margin: 12px 0 0;
	transition: color 0.2s ease;
}

/* ---------------------------------------------------------
   Responsivo — Tablet  768px – 1024px
   --------------------------------------------------------- */
@media (max-width: 1024px) {

	/* Hero Grid: mantém 2 colunas, reduz alturas */
	.wps-hero-featured,
	.wps-hero-panel {
		height: 300px;
	}

	.wps-hero-panel {
		padding: 28px 28px;
	}

	.wps-hero-panel-title {
		font-size: 22px;
	}

	/*
	 * Cards: 2 colunas no tablet para evitar overflow.
	 * A 3ª card quebra para a linha seguinte centralizada.
	 */
	.wps-hero-cards {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	/* Centraliza o card ímpar que ficar sozinho na última linha */
	.wps-hero-cards .wps-card:last-child:nth-child(odd) {
		grid-column: 1 / -1;
		max-width: 50%;
		justify-self: center;
	}

	.wps-card-thumb {
		height: 160px;
	}

	/* Full Grid */
	.wps-full-grid {
		gap: 14px;
	}

	.wps-grid-card img {
		height: 180px;
	}

	/* Carousel: 2 slides visíveis */
	.wps-carousel-slide {
		flex: 0 0 calc(50% - 8px);
		min-width: calc(50% - 8px);
	}

	/* List */
	.wps-list-item img {
		width: 95px;
		height: 72px;
	}
}

/* ---------------------------------------------------------
   Responsivo — Mobile  ≤ 767px
   Hero: imagem → painel (título + resumo) → cards → botão

   Usa !important nos layouts críticos para garantir prioridade
   sobre o CSS inline gerado pelos controles do Elementor.
   --------------------------------------------------------- */
@media (max-width: 767px) {

	/*
	 * Quando o controle "Layout das colunas" está em "Empilhado"
	 * (mobile_default = 1fr), o Elementor já gera grid-template-columns: 1fr.
	 * O !important aqui garante o empilhamento mesmo se o controle
	 * não tiver sido salvo ainda (primeiro uso do widget).
	 */
	.wps-hero-top {
		grid-template-columns: 1fr !important;
	}

	/*
	 * Com o grid em 1 coluna, a altura fixa do painel deve ceder
	 * para que o conteúdo (título + resumo) determine a altura.
	 * O !important vence o height inline gerado por hero_height.
	 */
	.wps-hero-panel {
		height: auto !important;
		min-height: unset;
		padding: 22px 20px 26px;
		align-items: flex-start;
		border-radius: 0 0 8px 8px;
	}

	.wps-hero-featured {
		border-radius: 8px 8px 0 0;
	}

	.wps-hero-panel-title {
		font-size: 18px;
		line-height: 1.4;
	}

	/* Cards: segue o controle hero_cards_cols (mobile_default = 1) */
	.wps-hero-cards {
		gap: 12px;
		margin-top: 12px;
	}

	/* Cancela o override de card ímpar centralizado do tablet */
	.wps-hero-cards .wps-card:last-child:nth-child(odd) {
		grid-column: auto;
		max-width: 100%;
		justify-self: auto;
	}

	.wps-card-caption {
		font-size: 13px;
	}

	/* Full Grid */
	.wps-full-grid {
		grid-template-columns: 1fr !important;
	}

	.wps-grid-card img {
		height: 200px;
	}

	/* List */
	.wps-list-item img {
		width: 85px;
		height: 68px;
	}

	/* Carousel */
	.wps-carousel-slide {
		flex: 0 0 calc(82% - 8px) !important;
		min-width: calc(82% - 8px) !important;
	}

	.wps-carousel-wrap {
		padding: 0 16px;
	}

	/* Botão CTA */
	.wps-btn {
		padding: 12px 32px;
		font-size: 13px;
	}
}

/* ---------------------------------------------------------
   Responsivo — Mobile pequeno  ≤ 479px
   --------------------------------------------------------- */
@media (max-width: 479px) {

	.wps-hero-featured {
		height: 195px;
	}

	.wps-hero-panel-title {
		font-size: 17px;
	}

	.wps-card-thumb {
		height: 160px;
	}

	/* List: empilha imagem acima do texto */
	.wps-list-item {
		flex-direction: column;
		gap: 8px;
	}

	.wps-list-item img {
		width: 100%;
		height: 175px;
		flex-shrink: unset;
	}

	/* Carousel: quase tela cheia */
	.wps-carousel-slide {
		flex: 0 0 calc(92% - 8px);
		min-width: calc(92% - 8px);
	}
}
