/* ==========================================================================
   DevRocket Blog — Theme Toggle (dark / light) seguindo o mesmo padrão
   de https://devrocket.com.br/ (theme-toggle.css + theme-toggle.js)
   Dark = padrão atual do blog. Light = overrides claros.
   ========================================================================== */

:root {
	color-scheme: dark;
}

:root[data-theme="light"] {
	color-scheme: light;
}

/* Transição suave entre temas */
body {
	transition: background-color 0.3s ease, color 0.3s ease;
}

/* Troca instantânea: desliga transitions (não animations) enquanto aplica o tema */
.theme-no-anim,
.theme-no-anim *,
.theme-no-anim *::before,
.theme-no-anim *::after {
	transition: none !important;
}

/* ---------- Botão icon-only (mesmo padrão devrocket.com.br) ---------- */
.theme-toggle {
	width: 40px;
	height: 40px;
	flex: 0 0 40px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	border-radius: 50%;
	border: 1px solid rgba(255, 255, 255, 0.28);
	background: transparent;
	color: #fff;
	cursor: pointer;
	transition: border-color 0.25s ease, color 0.25s ease, background-color 0.25s ease;
	margin-left: 12px;
}

.theme-toggle:hover {
	border-color: #fd9500;
	color: #fd9500;
}

.theme-toggle:focus-visible {
	outline: 2px solid #fd9500;
	outline-offset: 2px;
}

.theme-toggle svg {
	width: 20px;
	height: 20px;
}

/* Dark (padrão): mostra sol para ir ao claro. Light: mostra lua para voltar ao escuro. */
.theme-toggle .icon-moon {
	display: none;
	margin-top: -2px;
	margin-right: -2px;
}

:root[data-theme="light"] .theme-toggle {
	border-color: rgba(8, 113, 224, 0.25);
	color: #0b1a33;
	background: transparent;
}

:root[data-theme="light"] .theme-toggle .icon-sun {
	display: none;
}

:root[data-theme="light"] .theme-toggle .icon-moon {
	display: block;
}

/* Alinhamento no navbar Bootstrap do blog — botão no final do menu */
.navbar .container {
	align-items: center;
}
.navbar-collapse .theme-toggle {
	margin-left: 12px;
	align-self: center;
}
.navbar-toggler {
	margin-left: auto;
}

@media (max-width: 991px) {
	.navbar-collapse .theme-toggle {
		margin: 12px 0 8px;
		align-self: flex-start;
	}
	.navbar-toggler {
		margin-left: auto;
	}
}

/* ---------- ::before igual ao hero-home da referência (vale nos 2 temas) ---------- */
.hero::before,
.post-hero::before,
.newsletter-box::before {
	content: "";
	position: absolute;
	top: -160px;
	left: 50%;
	transform: translateX(-50%);
	width: 900px;
	height: 640px;
	background: radial-gradient(
		50% 50% at 50% 50%,
		rgba(10, 99, 244, 0.34) 0%,
		rgba(10, 99, 244, 0) 70%
	);
	filter: blur(16px);
	pointer-events: none;
	z-index: 0;
}

.hero > .container,
.post-hero > .container,
.newsletter-box > .container {
	position: relative;
	z-index: 1;
}

/* ---------- Ajustes finos do tema claro ---------- */

/* 1. Navbar */
:root[data-theme="light"] .navbar {
	background: rgba(255, 255, 255, 0.92) !important;
	-webkit-backdrop-filter: blur(14px);
	backdrop-filter: blur(14px);
	box-shadow: 0 12px 32px rgba(11, 26, 51, 0.12) !important;
}

:root[data-theme="light"] .navbar.scrolled {
	background: rgba(255, 255, 255, 0.92) !important;
	box-shadow: 0 12px 32px rgba(11, 26, 51, 0.12) !important;
}

:root[data-theme="light"] .navbar-nav a {
	color: rgba(11, 26, 51, 0.82) !important;
}

:root[data-theme="light"] .navbar-nav a:hover,
:root[data-theme="light"] .navbar-nav .active > a {
	color: #0871e0 !important;
}

:root[data-theme="light"] .navbar-toggler {
	border-color: rgba(11, 26, 51, 0.2);
}

:root[data-theme="light"] .navbar-toggler-icon {
	filter: invert(1);
}

:root[data-theme="light"] .navbar .dropdown-menu {
	background: #ffffff;
	box-shadow: 0 20px 50px rgba(11, 26, 51, 0.14);
}

/* 2. Heros */
:root[data-theme="light"] .hero,
:root[data-theme="light"] .post-hero,
:root[data-theme="light"] .newsletter-box {
	background: linear-gradient(180deg, #ffffff 0%, #eef2f9 100%);
	color: #0b1a33;
}

:root[data-theme="light"] .hero h1,
:root[data-theme="light"] .hero h2,
:root[data-theme="light"] .hero h3,
:root[data-theme="light"] .post-hero h1,
:root[data-theme="light"] .newsletter-box h1,
:root[data-theme="light"] .newsletter-box h2,
:root[data-theme="light"] .newsletter-box h3,
:root[data-theme="light"] .newsletter-box h4 {
	color: #0b1a33;
}

:root[data-theme="light"] .hero .hero-descricao,
:root[data-theme="light"] .post-hero .pagina-post-descricao,
:root[data-theme="light"] .newsletter-box p {
	color: rgba(11, 26, 51, 0.75);
}

:root[data-theme="light"] .post-hero .pagina-post-descricao span,
:root[data-theme="light"] .post-hero .pagina-post-descricao strong {
	color: #0b1a33 !important;
}

:root[data-theme="light"] .post-hero .breadcrumb-seo .breadcrumb-item + .breadcrumb-item::before {
	color: rgba(11, 26, 51, 0.5);
}

:root[data-theme="light"] .post-hero .breadcrumb-seo a {
	color: rgba(11, 26, 51, 0.7);
}

:root[data-theme="light"] .post-hero .breadcrumb-seo a:hover {
	color: #0871e0;
}

:root[data-theme="light"] .post-hero .breadcrumb-seo [aria-current="page"] {
	color: #0b1a33;
}

:root[data-theme="light"] .newsletter-box .text-white {
	color: #0b1a33 !important;
}

:root[data-theme="light"] .hero .hero-badge,
:root[data-theme="light"] .post-meta-chip,
:root[data-theme="light"] .pagina-post-compartilhar a {
	background: rgba(8, 113, 224, 0.08);
	border-color: rgba(8, 113, 224, 0.22);
	color: #0b1a33 !important;
}

:root[data-theme="light"] a.post-meta-chip {
	color: #0b1a33 !important;
}

:root[data-theme="light"] .pagina-post-compartilhar a:hover {
	background: #0871e0;
	color: #fff !important;
}

:root[data-theme="light"] .hero-busca {
	background: #ffffff;
	border-color: rgba(8, 113, 224, 0.2);
	box-shadow: 0 12px 32px rgba(11, 26, 51, 0.1);
}

:root[data-theme="light"] .hero-busca input {
	color: #0b1a33;
}

:root[data-theme="light"] .hero-busca input:focus {
	color: #0b1a33;
	background: #fff;
}

:root[data-theme="light"] .hero-busca input::placeholder {
	color: rgba(11, 26, 51, 0.5);
}

:root[data-theme="light"] .newsletter-card .form-control {
	background: #ffffff;
	border: 1px solid rgba(11, 26, 51, 0.14);
	color: #0b1a33;
}

:root[data-theme="light"] .newsletter-card .form-control::placeholder {
	color: rgba(11, 26, 51, 0.5);
}

:root[data-theme="light"] .newsletter-card .form-control:focus {
	background: #ffffff;
	border-color: #2b8fff;
	box-shadow: 0 0 0 4px rgba(8, 113, 224, 0.18);
}

/* ::before igual ao hero-home do link de referência no light */
:root[data-theme="light"] .hero::before,
:root[data-theme="light"] .post-hero::before,
:root[data-theme="light"] .newsletter-box::before {
	background: radial-gradient(
		50% 50% at 50% 50%,
		rgba(8, 113, 224, 0.16) 0%,
		rgba(8, 113, 224, 0) 70%
	);
}

/* Sem blobs decorativos no light (eram brilhos do dark) */
:root[data-theme="light"] .hero .hero-blob,
:root[data-theme="light"] .hero .hero-blob-2,
:root[data-theme="light"] .hero .hero-blob-3,
:root[data-theme="light"] .newsletter-box .hero-blob,
:root[data-theme="light"] .newsletter-box .hero-blob-2 {
	display: none;
}

/* 3. Cards — mesmo background do link de referência */
:root[data-theme="light"] .post-card,
:root[data-theme="light"] .ebook-card,
:root[data-theme="light"] .post-conteudo-card,
:root[data-theme="light"] .pagina-secao-post .breadcrumb-seo {
	background: linear-gradient(100deg, #ffffff 0%, #eef2f9 100%);
	box-shadow:
		0 1px 2px rgba(11, 26, 51, 0.06),
		0 8px 24px rgba(11, 26, 51, 0.06);
}

:root[data-theme="light"] .section-ebooks {
	background: linear-gradient(180deg, #ffffff 0%, #eef2f9 100%);
	border-block-color: rgba(11, 26, 51, 0.1);
}

/* 4. Newsletter card — mesmo background do link de referência (.cta-card, .newsletter-card) */
:root[data-theme="light"] .newsletter-card {
	background:
		radial-gradient(
			60% 100% at 50% 0%,
			rgba(8, 113, 224, 0.12) 0%,
			rgba(8, 113, 224, 0) 70%
		),
		linear-gradient(180deg, #ffffff 0%, #eef2f9 100%);
	border-color: rgba(8, 113, 224, 0.2);
	box-shadow:
		0 1px 2px rgba(11, 26, 51, 0.06),
		0 12px 32px rgba(11, 26, 51, 0.08);
}

/* 5. Ecossistema + Black Friday (gradientes dark fixos -> claros) */
:root[data-theme="light"] #ecossistema,
:root[data-theme="light"] #black-friday {
	background: linear-gradient(180deg, #ffffff 0%, #eef2f9 100%);
}

:root[data-theme="light"] #ecossistema .bf-titulo,
:root[data-theme="light"] #black-friday .bf-titulo {
	color: #0b1a33 !important;
}

:root[data-theme="light"] #ecossistema .bf-sub,
:root[data-theme="light"] #black-friday .bf-sub,
:root[data-theme="light"] .bf-label,
:root[data-theme="light"] .bf-trust,
:root[data-theme="light"] .bf-stats span,
:root[data-theme="light"] .eco-desc,
:root[data-theme="light"] .eco-list li {
	color: rgba(11, 26, 51, 0.75);
}

:root[data-theme="light"] .bf-stats strong,
:root[data-theme="light"] .offer-popup .offer-highlight {
	color: #0b1a33;
}

:root[data-theme="light"] .eco-card {
	background: #ffffff;
	box-shadow:
		0 1px 2px rgba(11, 26, 51, 0.06),
		0 8px 24px rgba(11, 26, 51, 0.06);
}

/* Mesmo background do .bf-card do link de referência */
:root[data-theme="light"] #black-friday .cta-card.bf-card {
	background:
		radial-gradient(
			60% 100% at 50% 0%,
			rgba(229, 46, 46, 0.1) 0%,
			rgba(229, 46, 46, 0) 60%
		),
		linear-gradient(180deg, #ffffff 0%, #fbeeee 100%);
	box-shadow:
		0 1px 2px rgba(11, 26, 51, 0.06),
		0 12px 32px rgba(185, 28, 28, 0.1);
}

:root[data-theme="light"] .eco-card-title {
	color: #0b1a33 !important;
}

:root[data-theme="light"] .eco-card-title small {
	color: rgba(11, 26, 51, 0.6);
}

:root[data-theme="light"] .eco-img {
	background: linear-gradient(180deg, #e6ecf5 0%, #dbe4f1 100%);
}

:root[data-theme="light"] .bf-timer-item,
:root[data-theme="light"] .bf-pill,
:root[data-theme="light"] .offer-pill {
	background: rgba(255, 255, 255, 0.9);
	border-color: rgba(8, 113, 224, 0.22);
	color: #0b1a33;
	box-shadow: 0 8px 24px rgba(11, 26, 51, 0.08);
}

:root[data-theme="light"] .bf-timer-item span {
	color: rgba(11, 26, 51, 0.6);
}

:root[data-theme="light"] .btn-bf-dark {
	background: #ffffff;
	border-color: rgba(8, 113, 224, 0.25);
	color: #0b1a33 !important;
}

:root[data-theme="light"] .btn-bf-dark:hover {
	color: #0871e0 !important;
	border-color: rgba(8, 113, 224, 0.45);
}

/* Textos com .text-white do Bootstrap sobre fundos que clareiam no light */
:root[data-theme="light"] #ecossistema .text-white,
:root[data-theme="light"] #black-friday .text-white {
	color: #0b1a33 !important;
}

/* 6. Footer */
:root[data-theme="light"] footer {
	background: linear-gradient(180deg, #ffffff 0%, #eef2f9 100%);
	color: rgba(11, 26, 51, 0.75);
	box-shadow: none;
	border-top: 1px solid rgba(11, 26, 51, 0.1);
}

:root[data-theme="light"] footer h2,
:root[data-theme="light"] footer h6,
:root[data-theme="light"] footer .footer-info strong {
	color: #0b1a33;
}

:root[data-theme="light"] footer a {
	color: rgba(11, 26, 51, 0.75) !important;
}

:root[data-theme="light"] footer a:hover {
	color: #0871e0 !important;
}

:root[data-theme="light"] footer .footer-barra a {
	color: rgba(11, 26, 51, 0.75) !important;
}

:root[data-theme="light"] footer .footer-barra a:hover {
	color: #0871e0 !important;
}

:root[data-theme="light"] footer .social-box a {
	background: rgba(11, 26, 51, 0.05);
	border-color: rgba(11, 26, 51, 0.12);
}

:root[data-theme="light"] footer .social-box a svg {
	fill: #0b1a33;
}

:root[data-theme="light"] footer .social-box a:hover {
	background: var(--gradiente-brand);
	border-color: transparent;
}

:root[data-theme="light"] footer .social-box a:hover svg {
	fill: #fff;
}

:root[data-theme="light"] footer .footer-barra {
	border-top-color: rgba(11, 26, 51, 0.1);
	color: rgba(11, 26, 51, 0.55);
}

/* Ícone do WhatsApp flutuante sempre branco (sobre fundo verde) */
:root[data-theme="light"] .whatsapp-flutuante svg,
:root[data-theme="light"] .whatsapp-flutuante a {
	color: #fff !important;
	fill: #fff;
}

/* 7. Offer popups */
:root[data-theme="light"] .offer-popup {
	background: linear-gradient(180deg, #ffffff 0%, #eef2f9 100%);
	box-shadow: 0 24px 60px rgba(11, 26, 51, 0.2);
}

:root[data-theme="light"] .offer-popup h3 {
	color: #0b1a33 !important;
}

:root[data-theme="light"] .offer-popup p {
	color: rgba(11, 26, 51, 0.7);
}

/* Botão do offer-popup fica dentro do footer: precisa vencer o `footer a` no light */
:root[data-theme="light"] footer .offer-popup .btn-offer-primary.btn-block,
:root[data-theme="light"] footer .offer-popup a.btn-offer-primary.btn-block:hover {
	color: #fff !important;
}

:root[data-theme="light"] .offer-close {
	background: #ffffff;
	color: rgba(11, 26, 51, 0.6);
}

/* ---------- Prompt de preferência (10s) — mesmo padrão devrocket.com.br ---------- */
.theme-prompt {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 500;
	max-width: 360px;
	padding: 40px 20px;
	border: 1px solid rgba(41, 137, 255, 0.25);
	border-radius: 16px;
	background: #01081f;
	color: #ebf3fe;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
	opacity: 0;
	visibility: hidden;
	transform: translateY(16px);
	transition:
		opacity 0.35s ease,
		transform 0.35s ease,
		visibility 0.35s ease;
}

.theme-prompt.show {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.theme-prompt p {
	font-size: 15px;
	line-height: 1.5;
	color: rgba(235, 243, 254, 0.85);
	margin: 0 28px 14px 0;
}

.theme-prompt-actions {
	display: flex;
	gap: 10px;
}

.theme-prompt-actions [data-theme-pick] {
	flex: 1;
	height: 44px;
	display: flex;
	align-items: center;
	justify-content: center;
	border-radius: 10px;
	border: 1px solid rgba(41, 137, 255, 0.25);
	background: transparent;
	color: #ebf3fe;
	cursor: pointer;
	transition:
		border-color 0.25s ease,
		color 0.25s ease;
}

.theme-prompt-actions [data-theme-pick]:hover {
	border-color: #fd9500;
	color: #fd9500;
}

.theme-prompt-actions [data-theme-pick] svg {
	width: 22px;
	height: 22px;
}

.theme-prompt-close {
	display: flex;
	align-items: center;
	justify-content: center;
	position: absolute;
	top: 8px;
	right: 8px;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: 1px solid rgba(41, 137, 255, 0.25);
	background: transparent;
	color: rgba(235, 243, 254, 0.6);
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
}

.theme-prompt-close:hover {
	color: #fff;
	border-color: rgba(41, 137, 255, 0.45);
}

:root[data-theme="light"] .theme-prompt {
	background: #ffffff;
	color: #0b1a33;
	box-shadow: 0 24px 60px rgba(11, 26, 51, 0.2);
}

:root[data-theme="light"] .theme-prompt p {
	color: rgba(11, 26, 51, 0.8);
}

:root[data-theme="light"] .theme-prompt-actions [data-theme-pick] {
	color: #0b1a33;
	border-color: rgba(8, 113, 224, 0.25);
}

:root[data-theme="light"] .theme-prompt-close {
	color: rgba(11, 26, 51, 0.55);
}

@media (max-width: 809px) {
	.theme-prompt {
		left: 16px;
		right: 16px;
		bottom: 132px;
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.theme-prompt {
		transition: none;
		transform: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	body {
		transition: none;
	}
}
