/* Cases Showcase — front-end
 * Layout inspirado no vídeo de referência: título central, filtros com
 * sublinhado verde, carrossel de cards verticais com hover escuro, modal de vídeo e
 * botão "Saiba mais" que leva ao single do case.
 */

.csw {
	--csw-accent: #22c55e;
	--csw-ink: #0d0d0d;
	--csw-muted: #6b7280;
	--csw-gap: 22px;
	--csw-radius: 8px;
	--csw-font: "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
	--csw-hover-bg: rgba(6, 6, 6, 0.92);
	--csw-card-gradient: linear-gradient(to top, #000 0%, rgba(0, 0, 0, 0.72) 55%, rgba(0, 0, 0, 0) 100%);

	--csw-per-view: 4;

	font-family: var(--csw-font);
	color: var(--csw-ink);
	max-width: 100%;
	margin: 0 auto;
	padding: 0px;
	box-sizing: border-box;
}

.csw *,
.csw *::before,
.csw *::after {
	box-sizing: border-box;
}

/* ---------- Heading ---------- */
.csw .csw__heading {
	text-align: center;
	margin: 0 0 28px;
	color: var(--csw-ink);
	/* Mantém o tamanho ao trocar a tag (h1–h6, p, div) pelo SEO. */
	font-weight: 800 !important;
	font-size: clamp(28px, 4vw, 40px) !important;
	line-height: 1.15 !important;
	letter-spacing: -0.01em !important;
	text-transform: none !important;
}

/* ---------- Filters ---------- */
.csw__filters-bar {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin: 24px 16px 34px;
}

.csw__filters {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 14px 24px;
	background: var(--csw-filter-bg, transparent);
	border-radius: 999px;
	padding: 6px 18px;
}

/* setas do filtro — só no mobile (ver media query) */
.csw__filters-arrow {
	display: none;
	flex: 0 0 auto;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	padding: 0;
	border: 0;
	background: none;
	color: var(--csw-accent);
	cursor: pointer;
	line-height: 0;
}

.csw__filters-arrow:disabled {
	opacity: 0.25;
	cursor: default;
}

.csw__filter {
	appearance: none;
	background: none;
	border: 0;
	padding: 6px 4px 10px;
	margin: 0;
	font: inherit;
	font-weight: 700;
	letter-spacing: 0.01em;
	white-space: nowrap;
	font-size: clamp(15px, 1.5vw, 18px);
	color: var(--csw-filter-color, var(--csw-ink));
	cursor: pointer;
	position: relative;
	line-height: 1.2;
	transition: color 0.2s ease;
}

.csw__filter::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	border-radius: 3px;
	background: var(--csw-accent);
	transform: scaleX(0);
	transform-origin: center;
	transition: transform 0.25s ease;
}

.csw__filter:hover {
	color: var(--csw-filter-hover, var(--csw-accent));
}

.csw__filter.is-active::after {
	transform: scaleX(1);
}

.csw__filter:focus-visible {
	outline: 2px solid var(--csw-accent);
	outline-offset: 3px;
}

/* Neutraliza estilos de botão do tema (ex.: fundo rosa no hover do Elementor/kit).
   Os filtros e setas só mudam de cor — sem fundo, borda ou sombra do tema. */
.csw .csw__filter,
.csw .csw__filter:hover,
.csw .csw__filter:focus,
.csw .csw__filter:active,
.csw .csw__filters-arrow,
.csw .csw__filters-arrow:hover,
.csw .csw__filters-arrow:focus,
.csw .csw__arrow,
.csw .csw__arrow:hover,
.csw .csw__arrow:focus {
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	border-radius: 0 !important;
	text-shadow: none !important;
	text-transform: none !important;
	text-decoration: none !important;
}

.csw .csw__filter {
	color: var(--csw-filter-color, var(--csw-ink)) !important;
	border: 0 !important;
	/* respiro horizontal: o texto nunca encosta na borda do fundo (hover/pílula) */
	padding: 6px 14px 10px !important;
	border-radius: 999px !important;
	transition: color 0.2s ease, background-color 0.2s ease;
}

/* Hover/foco: troca a cor do texto E o fundo do item (se configurado). */
.csw .csw__filter:hover,
.csw .csw__filter:focus-visible {
	color: var(--csw-filter-hover, var(--csw-accent)) !important;
	background: var(--csw-filter-hover-bg, transparent) !important;
	border-radius: 999px !important;
}

/* O sublinhado acompanha a largura do texto, não do padding. */
.csw .csw__filter::after {
	left: 14px;
	right: 14px;
}

/* ---------- Carousel ---------- */
.csw__viewport {
	overflow: hidden;
	position: relative;
}

.csw__track {
	display: flex;
	gap: var(--csw-gap);
	transition: transform 0.45s cubic-bezier(0.22, 0.61, 0.36, 1);
	will-change: transform;
}

.csw--animating .csw__track {
	transition: none;
}

/* fade used when switching category */
.csw__track.is-fading {
	opacity: 0;
	transition: opacity 0.18s ease;
}

.csw__card {
	flex: 0 0 calc((100% - (var(--csw-per-view) - 1) * var(--csw-gap)) / var(--csw-per-view));
	min-width: 0;
	position: relative;
}

.csw__card.is-hidden {
	display: none;
}

.csw__card-inner {
	appearance: none;
	border: 0;
	padding: 0;
	margin: 0;
	background: #000;
	font: inherit;
	color: #fff;
	text-align: center;
	width: 100%;
	display: block;
	position: relative;
	border-radius: var(--csw-radius);
	overflow: hidden;
	aspect-ratio: 300 / 430;
	cursor: pointer;
	text-decoration: none;
}

a.csw__card-inner,
a.csw__card-inner:hover,
a.csw__card-inner:focus {
	color: #fff;
	text-decoration: none;
}

.csw__card-media {
	position: absolute;
	inset: 0;
	display: block;
}

.csw__card-media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.5s ease, filter 0.35s ease;
}

.csw__card-footer {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	min-height: 26%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: flex-end;
	gap: 8px;
	padding: 14px 16px 18px;
	background: var(--csw-card-gradient);
	transition: opacity 0.3s ease;
}

/* Círculo branco da logo — forçado para não ser sobrescrito pelo tema.
   O círculo fica no <span>; a <img> vai por dentro. */
.csw .csw__card-logo,
.csw .csw__card-hover-logo {
	display: flex !important;
	align-items: center !important;
	justify-content: center !important;
	flex: 0 0 auto !important;
	border-radius: 50% !important;
	background: #fff !important;
	overflow: hidden !important;
	box-sizing: border-box !important;
	aspect-ratio: 1 / 1 !important;
}

.csw .csw__card-logo {
	width: 56px !important;
	height: 56px !important;
	min-width: 56px !important;
	padding: 8px !important;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.35);
}

.csw .csw__card-hover-logo {
	width: 66px !important;
	height: 66px !important;
	min-width: 66px !important;
	padding: 10px !important;
	box-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}

.csw .csw__card-logo img,
.csw .csw__card-hover-logo img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	object-fit: contain !important;
	border-radius: 0 !important;
	background: none !important;
	filter: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
}

/* Nome da marca (branco) abaixo da logo — a tag HTML (h2/h3/p/span…) é configurável. */
.csw .csw__card-brandname {
	display: block;
	margin: 0;
	padding: 0;
	border: 0;
	font-family: inherit;
	color: #fff;
	text-align: center;
	overflow-wrap: anywhere;
	/* Aparência idêntica em qualquer tag (h2…h6, p, div, span): o tema não altera o tamanho. */
	text-transform: none !important;
	font-weight: 700 !important;
	font-size: 16px !important;
	line-height: 1.2 !important;
	letter-spacing: 0.01em !important;
}

.csw .csw__card-brandname.csw__card-brandname--hover {
	font-size: 18px !important;
	flex: none;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

/* Hover overlay */
.csw__card-hover {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	/* espaço extra na base reservado para o CTA (posicionado em absolute) */
	padding: 18px 16px 46px;
	background: var(--csw-hover-bg);
	opacity: 0;
	visibility: hidden;
	overflow: hidden;
	text-align: center;
	transition: opacity 0.3s ease, visibility 0.3s ease;
}

/* bloco central (logo/marca + título); nunca invade o espaço do CTA */
.csw__card-hover-body {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 10px;
	width: 100%;
	max-height: 100%;
	overflow: hidden;
}

.csw__card-hover :where(img, span, h2, h3, h4, h5, h6, p, div) {
	max-width: 100%;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.csw__card:hover .csw__card-hover,
.csw__card:focus-within .csw__card-hover {
	opacity: 1;
	visibility: visible;
}

.csw__card:hover .csw__card-media img {
	transform: scale(1.04);
}

.csw__card:hover .csw__card-footer {
	opacity: 0;
}

/* Etiqueta da categoria — canto superior esquerdo, acima do overlay de hover. */
.csw__card-badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 2;
	max-width: calc(100% - 24px);
	padding: 5px 11px;
	border-radius: 999px;
	background: var(--csw-badge-bg, rgba(0, 0, 0, 0.7));
	color: var(--csw-badge-color, #fff);
	font-family: var(--csw-font);
	font-size: 12px;
	font-weight: 600;
	line-height: 1.25;
	letter-spacing: 0.02em;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	pointer-events: none;
}

/* Link "Saiba mais" — sobreposto ao card, leva para o single.
 * Fica acima do <button>/<a> do card e só recebe cliques no hover. */
.csw__card-cta {
	position: absolute;
	left: 20px;
	bottom: 20px;
	z-index: 3;
	display: inline-flex;
	align-items: center;
	gap: 4px;
	/* branco fixo: contraste garantido sobre o fundo escuro do hover */
	color: #fff;
	font-weight: 600;
	font-size: 14px;
	text-decoration: underline;
	text-decoration-color: var(--csw-accent);
	text-decoration-thickness: 2px;
	text-underline-offset: 4px;
	min-height: 24px;
	opacity: 0;
	pointer-events: none;
	transform: translateY(4px);
	transition: opacity 0.3s ease, transform 0.3s ease;
}

.csw__card:hover .csw__card-cta,
.csw__card:focus-within .csw__card-cta {
	opacity: 1;
	pointer-events: auto;
	transform: none;
}

.csw .csw__card-cta,
.csw .csw__card-cta:hover,
.csw .csw__card-cta:focus {
	color: #fff !important;
}

.csw__card-cta:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
	border-radius: 3px;
}

/* Foco do card inteiro (teclado): anel branco + faixa escura, visível sobre qualquer foto. */
.csw__card-inner:focus-visible {
	outline: 3px solid #fff;
	outline-offset: -6px;
	box-shadow: inset 0 0 0 6px rgba(0, 0, 0, 0.55);
}

/* Aparelhos sem hover (toque): o CTA fica sempre visível, em pílula no topo. */
@media (hover: none) {
	.csw__card-cta {
		top: 10px;
		left: 10px;
		right: auto;
		bottom: auto;
		min-height: 36px;
		padding: 0 14px;
		border-radius: 999px;
		background: rgba(0, 0, 0, 0.68);
		text-decoration: none;
		opacity: 1;
		pointer-events: auto;
		transform: none;
	}

	/* Com etiqueta: o CTA desce para ficar logo abaixo dela (cards estreitos). */
	.csw__card--has-badge .csw__card-cta {
		top: 46px;
	}
}

.csw__card-cta svg {
	margin-top: 1px;
}

/* ---------- Empty state ---------- */
.csw__empty {
	text-align: center;
	color: var(--csw-muted);
	padding: 40px 0;
	margin: 0;
	font-weight: 500;
}

/* ---------- Nav arrows ---------- */
.csw__nav {
	display: flex;
	justify-content: center;
	align-items: center;
	gap: 46px;
	margin-top: 26px;
}

.csw__arrow {
	appearance: none;
	background: none;
	border: 0;
	padding: 6px;
	color: var(--csw-accent);
	cursor: pointer;
	line-height: 0;
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.csw__arrow:hover {
	transform: scale(1.12);
}

.csw__arrow:disabled {
	opacity: 0.28;
	cursor: default;
	transform: none;
}

.csw__arrow:focus-visible {
	outline: 2px solid var(--csw-accent);
	outline-offset: 2px;
	border-radius: 4px;
}

/* ---------- Modal de vídeo ---------- */
.csw__modal[hidden] {
	display: none;
}

.csw__modal {
	--csw-accent: #22c55e;
	position: fixed;
	top: 0;
	left: 0;
	right: 0;
	bottom: 0;
	width: 100%;
	height: 100%;
	margin: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vw;
	box-sizing: border-box;
}

.csw__modal-backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.82);
	animation: csw-fade 0.2s ease;
}

.csw__modal-dialog {
	position: relative;
	width: min(1100px, 100%);
	animation: csw-pop 0.25s ease;
}

.csw__modal-frame {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 6px;
	overflow: hidden;
}

.csw__modal-frame iframe,
.csw__modal-frame video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

.csw__modal-close {
	position: absolute;
	top: -44px;
	right: 0;
	appearance: none;
	background: none;
	border: 0;
	color: #fff;
	cursor: pointer;
	line-height: 0;
	padding: 6px;
}

.csw__modal-close:hover {
	color: var(--csw-accent);
}

@keyframes csw-fade {
	from { opacity: 0; }
}

@keyframes csw-pop {
	from { opacity: 0; transform: translateY(12px) scale(0.98); }
}

/* ---------- Single do case ---------- */
.csw-single {
	font-family: var(--csw-font, "Poppins", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif);
	margin: 0 0 28px;
}

.csw-single__video {
	position: relative;
	width: 100%;
	aspect-ratio: 16 / 9;
	background: #000;
	border-radius: 10px;
	overflow: hidden;
}

.csw-single__video iframe,
.csw-single__video video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	border: 0;
}

/* ---------- Galeria de fotos (single) ---------- */
.csw-gallery {
	--csw-accent: #22c55e;
	list-style: none;
	margin: 0;
	padding: 0;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
	gap: 12px;
}

.csw-gallery__item {
	margin: 0;
}

.csw-gallery__link {
	display: block;
	position: relative;
	aspect-ratio: 4 / 3;
	border-radius: 8px;
	overflow: hidden;
	background: #eee;
	cursor: zoom-in;
}

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

.csw-gallery__link:hover img {
	transform: scale(1.05);
}

.csw-gallery__link:focus-visible {
	outline: 2px solid var(--csw-accent);
	outline-offset: 2px;
}

/* ---------- Lightbox ---------- */
.csw-lightbox[hidden] {
	display: none;
}

.csw-lightbox {
	--csw-accent: #22c55e;
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 4vw;
	box-sizing: border-box;
}

.csw-lightbox__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.9);
	animation: csw-fade 0.2s ease;
}

.csw-lightbox__stage {
	position: relative;
	margin: 0;
	max-width: 100%;
	max-height: 90vh;
	animation: csw-pop 0.25s ease;
}

.csw-lightbox__stage img {
	display: block;
	max-width: 100%;
	max-height: 90vh;
	width: auto;
	height: auto;
	border-radius: 4px;
}

.csw-lightbox__close {
	position: absolute;
	top: 14px;
	right: 18px;
	z-index: 2;
	width: 42px;
	height: 42px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	font-size: 28px;
	line-height: 42px;
	cursor: pointer;
}

.csw-lightbox__nav {
	position: relative;
	z-index: 2;
	flex: none;
	width: 52px;
	height: 52px;
	margin: 0 6px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.4);
	color: #fff;
	font-size: 32px;
	line-height: 1;
	cursor: pointer;
}

.csw-lightbox__close:hover,
.csw-lightbox__nav:hover {
	background: var(--csw-accent);
	color: #04140b;
}

@media (max-width: 600px) {
	.csw-lightbox__nav {
		width: 40px;
		height: 40px;
		font-size: 24px;
	}
}

/* ---------- Responsive ----------
 * O número de cards por tela (--csw-per-view) é calculado pelo JS a partir da
 * largura do container; aqui só ajustamos espaçamentos.
 */
@media (max-width: 768px) {
	.csw { --csw-gap: 16px; }

	/* Filtro em modo carrossel: uma única linha com rolagem horizontal + setas. */
	.csw__filters-bar {
		gap: 8px;
		margin: 20px 10px 30px;
	}

	.csw__filters {
		flex-wrap: nowrap;
		justify-content: flex-start;
		gap: 18px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		-webkit-overflow-scrolling: touch;
		scroll-snap-type: x proximity;
		scrollbar-width: none;
		-ms-overflow-style: none;
		border-radius: 0;
		padding: 4px 6px;
	}

	.csw__filters::-webkit-scrollbar {
		display: none;
	}

	.csw__filter {
		flex: 0 0 auto;
		white-space: nowrap;
		scroll-snap-align: center;
	}

	.csw__filters-arrow {
		display: inline-flex;
	}
}

@media (max-width: 560px) {
	.csw__nav { gap: 32px; }
}

@media (prefers-reduced-motion: reduce) {
	.csw__track,
	.csw__track.is-fading,
	.csw__card-media img,
	.csw__card-hover,
	.csw__card-footer,
	.csw__card-cta,
	.csw__filter,
	.csw__filter::after,
	.csw__arrow,
	.csw-gallery__link img {
		transition: none !important;
	}

	.csw__modal-backdrop,
	.csw__modal-dialog,
	.csw-lightbox__backdrop,
	.csw-lightbox__stage {
		animation: none !important;
	}

	.csw__card:hover .csw__card-media img,
	.csw-gallery__link:hover img,
	.csw__arrow:hover {
		transform: none;
	}
}

/* Foco visível nos controles sobre fundo escuro (modal e lightbox). */
.csw__modal-close:focus-visible,
.csw-lightbox__close:focus-visible,
.csw-lightbox__nav:focus-visible {
	outline: 3px solid #fff;
	outline-offset: 2px;
}
