/* Ao Gosto Banners — frontend
   Sem dependências. Tudo via CSS custom properties. */

.agb {
	--agb-accent: #E8551F;
	--agb-h: 520px;
	--agb-hm: 420px;
	--agb-radius: 0px;
	--agb-ease: cubic-bezier(.22, .61, .36, 1);
	--agb-dur: 700ms;

	position: relative;
	width: 100%;
	overflow: hidden;
	border-radius: var(--agb-radius);
	background: #0d0b0a;
	isolation: isolate;
	touch-action: pan-y;
}

.agb__viewport {
	position: relative;
	width: 100%;
	height: var(--agb-h);
}

.agb--auto .agb__viewport {
	height: auto;
	aspect-ratio: var(--agb-ratio, 16 / 6);
}

/* ---------- slides ---------- */

.agb__slide {
	position: absolute;
	inset: 0;
	opacity: 0;
	visibility: hidden;
	z-index: 1;
}

.agb__slide.is-active {
	opacity: 1;
	visibility: visible;
	z-index: 2;
}

.agb__slide.agb-hidden {
	display: none;
}

.agb--fade .agb__slide {
	transition: opacity var(--agb-dur) var(--agb-ease), visibility 0s var(--agb-dur);
}

.agb--fade .agb__slide.is-active {
	transition: opacity var(--agb-dur) var(--agb-ease), visibility 0s 0s;
}

.agb--slide .agb__slide {
	opacity: 1;
	transform: translate3d(100%, 0, 0);
	transition: transform var(--agb-dur) var(--agb-ease), visibility 0s var(--agb-dur);
}

.agb--slide .agb__slide.is-active {
	transform: translate3d(0, 0, 0);
	transition: transform var(--agb-dur) var(--agb-ease), visibility 0s 0s;
}

.agb--slide .agb__slide.is-exit {
	visibility: visible;
	z-index: 1;
}

.agb--slide .agb__slide.to-left {
	transform: translate3d(-100%, 0, 0);
}

.agb--slide .agb__slide.from-left {
	transform: translate3d(-100%, 0, 0);
}

.agb__slide.no-anim {
	transition: none !important;
}

/* ---------- mídia ---------- */

.agb__media {
	display: block;
	position: absolute;
	inset: 0;
	text-decoration: none;
	color: #fff;
	overflow: hidden;
}

.agb__media picture {
	display: block;
	position: absolute;
	inset: 0;
}

.agb__img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transform: scale(1.02);
}

/* Ken Burns: só roda no slide ativo, e só se o usuário permitir movimento. */
.agb--kb .agb__slide.is-active .agb__img {
	animation: agb-kb 9s var(--agb-ease) forwards;
}

@keyframes agb-kb {
	from { transform: scale(1.02); }
	to   { transform: scale(1.11); }
}

.agb__scrim {
	position: absolute;
	inset: 0;
	background:
		linear-gradient(90deg, rgba(0, 0, 0, .85) 0%, rgba(0, 0, 0, .35) 55%, rgba(0, 0, 0, 0) 100%),
		linear-gradient(0deg, rgba(0, 0, 0, .5) 0%, rgba(0, 0, 0, 0) 45%);
	opacity: var(--agb-scrim, .35);
	pointer-events: none;
}

/* ---------- conteúdo ---------- */

.agb__content {
	position: absolute;
	inset: 0;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 14px;
	padding: clamp(24px, 5vw, 72px);
	max-width: 640px;
	pointer-events: none;
}

.agb__content--center {
	max-width: 100%;
	align-items: center;
	text-align: center;
}

.agb__content--right {
	max-width: 100%;
	align-items: flex-end;
	text-align: right;
}

.agb__content--right > * {
	max-width: 620px;
}

.agb__kicker {
	font-size: clamp(11px, 1.1vw, 14px);
	font-weight: 700;
	letter-spacing: .22em;
	text-transform: uppercase;
	color: #fff;
	opacity: .85;
	display: inline-flex;
	align-items: center;
	gap: 12px;
}

.agb__kicker::before {
	content: "";
	width: 28px;
	height: 2px;
	background: var(--agb-accent);
	display: inline-block;
}

.agb__content--center .agb__kicker::before,
.agb__content--right .agb__kicker::before {
	display: none;
}

.agb__title {
	margin: 0;
	font-size: clamp(28px, 4.4vw, 62px);
	line-height: 1.02;
	font-weight: 800;
	letter-spacing: -.02em;
	text-transform: uppercase;
	color: #fff;
	text-wrap: balance;
}

.agb__text {
	margin: 0;
	font-size: clamp(14px, 1.35vw, 19px);
	line-height: 1.5;
	color: rgba(255, 255, 255, .88);
	max-width: 46ch;
}

.agb__cta {
	margin-top: 6px;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	align-self: flex-start;
	padding: 14px 28px;
	border-radius: 999px;
	background: var(--agb-accent);
	color: #fff;
	font-weight: 700;
	font-size: clamp(13px, 1.1vw, 16px);
	letter-spacing: .04em;
	text-transform: uppercase;
	line-height: 1;
	transition: transform .25s var(--agb-ease), box-shadow .25s var(--agb-ease), filter .25s;
	box-shadow: 0 10px 30px -12px rgba(0, 0, 0, .9);
}

.agb__content--center .agb__cta { align-self: center; }
.agb__content--right .agb__cta { align-self: flex-end; }

.agb__cta svg {
	width: 16px;
	height: 16px;
}

.agb__media:hover .agb__cta {
	transform: translateY(-2px);
	filter: brightness(1.08);
	box-shadow: 0 16px 36px -14px rgba(0, 0, 0, .95);
}

/* Entrada escalonada do texto */
.agb__slide.is-active .agb__kicker,
.agb__slide.is-active .agb__title,
.agb__slide.is-active .agb__text,
.agb__slide.is-active .agb__cta {
	animation: agb-in .8s var(--agb-ease) both;
}

.agb__slide.is-active .agb__title { animation-delay: .09s; }
.agb__slide.is-active .agb__text  { animation-delay: .18s; }
.agb__slide.is-active .agb__cta   { animation-delay: .27s; }

@keyframes agb-in {
	from { opacity: 0; transform: translateY(22px); }
	to   { opacity: 1; transform: translateY(0); }
}

/* ---------- setas ---------- */

.agb__nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	z-index: 5;
	width: 52px;
	height: 52px;
	display: grid;
	place-items: center;
	border: 1px solid rgba(255, 255, 255, .28);
	border-radius: 50%;
	background: rgba(16, 12, 10, .32);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
	color: #fff;
	cursor: pointer;
	padding: 0;
	opacity: 0;
	transition: opacity .3s, background .25s, border-color .25s, transform .25s var(--agb-ease);
}

.agb__nav svg {
	width: 22px;
	height: 22px;
}

.agb__nav--prev { left: 20px; }
.agb__nav--next { right: 20px; }

.agb:hover .agb__nav,
.agb:focus-within .agb__nav {
	opacity: 1;
}

.agb__nav:hover {
	background: var(--agb-accent);
	border-color: var(--agb-accent);
}

.agb__nav--prev:hover { transform: translateY(-50%) translateX(-3px); }
.agb__nav--next:hover { transform: translateY(-50%) translateX(3px); }

.agb__nav:focus-visible {
	opacity: 1;
	outline: 3px solid #fff;
	outline-offset: 3px;
}

/* ---------- pontinhos ---------- */

.agb__dots {
	position: absolute;
	left: 50%;
	bottom: 26px;
	transform: translateX(-50%);
	z-index: 5;
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 8px 12px;
	border-radius: 999px;
	background: rgba(16, 12, 10, .35);
	backdrop-filter: blur(10px);
	-webkit-backdrop-filter: blur(10px);
}

.agb__dot {
	width: 9px;
	height: 9px;
	padding: 0;
	border: 0;
	border-radius: 999px;
	background: rgba(255, 255, 255, .45);
	cursor: pointer;
	transition: width .35s var(--agb-ease), background .3s;
}

.agb__dot:hover { background: rgba(255, 255, 255, .8); }

.agb__dot.is-active {
	width: 30px;
	background: var(--agb-accent);
}

.agb__dot:focus-visible {
	outline: 2px solid #fff;
	outline-offset: 3px;
}

/* ---------- barra de tempo ---------- */

.agb__progress {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	height: 3px;
	background: rgba(255, 255, 255, .16);
	z-index: 6;
}

.agb__progress span {
	display: block;
	height: 100%;
	width: 0;
	background: var(--agb-accent);
	box-shadow: 0 0 14px var(--agb-accent);
}

/* ---------- acessibilidade ---------- */

.agb__sr {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.agb.is-dragging {
	cursor: grabbing;
}

/* ---------- mobile ---------- */

@media (max-width: 767px) {
	.agb__viewport { height: var(--agb-hm); }
	.agb--auto .agb__viewport { height: auto; aspect-ratio: var(--agb-ratio-m, var(--agb-ratio, 4 / 5)); }

	.agb__nav { display: none; }
	.agb__dots { bottom: 16px; }
	.agb__content { padding: 24px 22px 56px; max-width: 100%; }
	.agb__cta { padding: 12px 22px; }
	.agb__scrim { opacity: calc(var(--agb-scrim, .35) + .12); }
}

/* ---------- movimento reduzido ---------- */

@media (prefers-reduced-motion: reduce) {
	.agb__slide,
	.agb__slide.is-active {
		transition-duration: 1ms !important;
	}
	.agb--kb .agb__slide.is-active .agb__img { animation: none; }
	.agb__slide.is-active .agb__kicker,
	.agb__slide.is-active .agb__title,
	.agb__slide.is-active .agb__text,
	.agb__slide.is-active .agb__cta { animation: none; }
}

/* ---------- um banner só: sem controles ---------- */

.agb--single .agb__nav,
.agb--single .agb__dots,
.agb--single .agb__progress {
	display: none;
}
