/* ==========================================================================
   LP Trades: base (fontes, reset, elementos)
   Os resets usam :where() (especificidade zero) para que Elementor, plugins
   e componentes sempre consigam sobrescrever sem !important.
   ========================================================================== */

/* ---------- Fontes: Sora self-hosted, subset latino ---------- */
@font-face {
	font-family: 'Sora';
	src: url('../fonts/sora-400-latin.woff2') format('woff2');
	font-weight: 400;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Sora';
	src: url('../fonts/sora-500-latin.woff2') format('woff2');
	font-weight: 500;
	font-style: normal;
	font-display: swap;
}
@font-face {
	font-family: 'Sora';
	src: url('../fonts/sora-600-latin.woff2') format('woff2');
	font-weight: 600;
	font-style: normal;
	font-display: swap;
}
/* Arial ajustada às métricas da Sora: a troca de fonte não desloca o layout (CLS). */
@font-face {
	font-family: 'Sora Fallback';
	src: local('Arial'), local('ArialMT'), local('Helvetica');
	size-adjust: 112.73%;
	ascent-override: 86.05%;
	descent-override: 25.73%;
	line-gap-override: 0%;
}

/* ---------- Reset ---------- */
*,
*::before,
*::after {
	box-sizing: border-box;
}

:where(html) {
	-webkit-text-size-adjust: 100%;
	text-size-adjust: 100%;
	scroll-padding-top: calc(var(--lpt-header-h) + var(--lpt-space-4));
}

/* Rolagem suave: feita pelo Lenis (assets/js/smooth-scroll.js). O "scroll-behavior: smooth"
   nativo brigaria com ele, então fica só como reserva quando o JS não carregar. */
@media (prefers-reduced-motion: no-preference) {
	:where(html:not(.lenis)) {
		scroll-behavior: smooth;
	}
}

/* Lenis (regras da própria biblioteca) */
html.lenis,
html.lenis body {
	height: auto;
}
.lenis:not(.lenis-autoToggle).lenis-stopped {
	overflow: clip;
}
.lenis [data-lenis-prevent] {
	overscroll-behavior: contain;
}
.lenis.lenis-smooth iframe {
	pointer-events: none;              /* só durante a rolagem animada */
}

:where(body) {
	margin: 0;
	min-height: 100vh;
	background: var(--lpt-bg);
	color: var(--lpt-text);
	font-family: var(--lpt-font);
	font-size: var(--lpt-fs-body);
	font-weight: var(--lpt-fw-regular);
	line-height: var(--lpt-lh-body);
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

:where(h1, h2, h3, h4, h5, h6, p, ul, ol, dl, dd, figure, blockquote) {
	margin: 0;
}

:where(h1, h2, h3, h4, h5, h6) {
	font-weight: var(--lpt-fw-semibold);
	line-height: var(--lpt-lh-heading);
	letter-spacing: var(--lpt-tracking-heading);
	color: var(--lpt-text-strong);
	text-wrap: balance;
}

:where(p, li) {
	text-wrap: pretty;
}

:where(ul, ol)[role='list'] {
	list-style: none;
	padding: 0;
}

:where(img, svg, video, canvas, picture, iframe) {
	display: block;
	max-width: 100%;
}

:where(img, video) {
	height: auto;
}

:where(a) {
	color: inherit;
	text-decoration-thickness: 1px;
	text-underline-offset: .2em;
}

:where(button, input, select, textarea) {
	font: inherit;
	color: inherit;
}

:where(button) {
	cursor: pointer;
}

:where(table) {
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

:where(strong, b) {
	font-weight: var(--lpt-fw-semibold);
}

:focus-visible {
	outline: 2px solid var(--lpt-focus);
	outline-offset: 3px;
}

::selection {
	background: var(--lpt-violet);
	color: #fff;
}

[hidden] {
	display: none !important;
}

/* ---------- Acessibilidade ---------- */
.screen-reader-text {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	clip-path: inset(50%);
	white-space: nowrap;
	border: 0;
	word-wrap: normal !important;
}

.skip-link {
	position: fixed;
	top: var(--lpt-space-4);
	left: var(--lpt-space-4);
	z-index: calc(var(--lpt-z-modal) + 1);
	padding: var(--lpt-space-3) var(--lpt-space-5);
	border-radius: var(--lpt-radius-pill);
	background: var(--lpt-violet);
	color: #fff;
	font-size: var(--lpt-fs-sm);
	font-weight: var(--lpt-fw-semibold);
	text-decoration: none;
	transform: translateY(-200%);
}

.skip-link:focus {
	transform: none;
}

/* ---------- Transições x Elementor ----------
   O frontend.min.css do Elementor (carregado no site todo por causa dos popups) zera TODA
   transição com "html * { transition-duration: 0s !important }" quando o sistema pede
   movimento reduzido. Troca de cor e opacidade não é movimento, então os componentes do tema
   recuperam os 0,5s. "html body" + classe pesa mais que "html *", e os dois são !important. */
@media (prefers-reduced-motion: reduce) {
	html body :is(
		.c-btn, .c-link, .c-icon-btn, .c-tabs__tab, .c-badge,
		.c-nav__list a, .c-footer a, .c-header__toggle-lines,
		.c-video__play, .c-video__cover,
		.s-edition__link, .s-hero__skip, .p-rules__toc-list a, .c-rank-table td
	),
	html body .c-header::before {
		transition-duration: var(--lpt-dur) !important;
	}
}

/* ==========================================================================
   Movimento de entrada (assets/js/motion.js). Só vale com <html class="lpt-motion">,
   marcado no <head>; sem JS nada fica escondido.
   ========================================================================== */

/* Blocos que sobem (0,9s), como no site de referência */
:root {
	--reveal-y: 90px;
}
@media (max-width: 47.99em) {
	:root {
		--reveal-y: 48px;
	}
}
html.lpt-motion [data-reveal]:not(.is-revealed) {
	opacity: 0;
}
html.lpt-motion [data-reveal].is-revealed {
	animation: lpt-reveal-up .9s cubic-bezier(.22, .61, .36, 1) var(--reveal-delay, 0s) both;
}
@keyframes lpt-reveal-up {
	from { opacity: 0; transform: translateY(var(--reveal-y)); }
	to { opacity: 1; transform: none; }
}

/* Títulos linha a linha: cada linha gira de -60° para a frente (1s, 0,2s entre linhas) */
html.lpt-motion [data-split]:not(.is-split) {
	opacity: 0;
}
[data-split].is-split:not(.is-done) {
	perspective: 300px;
}
.lpt-line {
	display: block;
}
.lpt-line__in {
	display: inline-block;
	transform-origin: center top -50px;
}
html.lpt-motion [data-split].is-split:not(.is-revealed) .lpt-line__in {
	opacity: 0;
}
html.lpt-motion [data-split].is-revealed:not(.is-done) .lpt-line__in {
	animation: lpt-line-in 1s cubic-bezier(.25, .46, .45, .94) calc(.3s + var(--line, 0) * .2s) both;
}
@keyframes lpt-line-in {
	from { opacity: 0; transform: rotateX(-60deg); }
	to { opacity: 1; transform: none; }
}

/* Movimento reduzido: só aparece (fade), nada se desloca nem gira */
@media (prefers-reduced-motion: reduce) {
	html.lpt-motion [data-reveal].is-revealed {
		animation-name: lpt-fade-in;
		animation-duration: .6s;
	}
	html.lpt-motion [data-split].is-revealed:not(.is-done) .lpt-line__in {
		animation-name: lpt-fade-in;
		animation-duration: .6s;
	}
}
@keyframes lpt-fade-in {
	from { opacity: 0; }
	to { opacity: 1; }
}
