/**
 * Shell oscuro — cuerpo, cabecera, cards base, menús y formularios globales.
 * Carga después del tema; usa tokens de cgc-theme-tokens.css.
 */

/* ── Base ── */
html[data-theme="dark"] body {
	background: var(--cgc-bg-gradient) !important;
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .skip-link {
	background: var(--cgc-card-bg-solid) !important;
	color: var(--cgc-text) !important;
}

/* ── Cabecera WP + home site-nav ── */
html[data-theme="dark"] .site-header,
html[data-theme="dark"] .site-nav,
html[data-theme="dark"] header.recipe-nav,
html[data-theme="dark"] .recipe-nav {
	background: var(--cgc-header-bg) !important;
	border-bottom-color: var(--cgc-border) !important;
}

html[data-theme="dark"] .site-header.is-scrolled,
html[data-theme="dark"] .site-nav.scrolled {
	box-shadow: 0 10px 32px rgba(0, 0, 0, 0.35) !important;
}

html[data-theme="dark"] .site-brand .brand__cuidate,
html[data-theme="dark"] .brand .brand__cuidate {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .site-brand .brand__gratis,
html[data-theme="dark"] .brand .brand__gratis {
	color: var(--cgc-accent-bright) !important;
}

html[data-theme="dark"] .primary-nav a,
html[data-theme="dark"] .primary-nav .menu a,
html[data-theme="dark"] .primary-nav .menu > li > a,
html[data-theme="dark"] .nav-links a,
html[data-theme="dark"] .nav-links li a,
html.cg-dark .primary-nav a,
html.cg-dark .primary-nav .menu a,
html.cg-dark .nav-links a {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .calculator-submenu a,
html[data-theme="dark"] .nav-dropdown a,
html.cg-dark .calculator-submenu a,
html.cg-dark .nav-dropdown a {
	color: var(--cgc-text-secondary) !important;
}

html[data-theme="dark"] .primary-nav a:hover,
html[data-theme="dark"] .nav-links a:hover,
html.cg-dark .primary-nav a:hover,
html.cg-dark .nav-links a:hover {
	color: var(--cgc-accent-bright) !important;
}

html[data-theme="dark"] .menu-toggle,
html[data-theme="dark"] .mobile-toggle {
	background: var(--cgc-card-bg) !important;
	border-color: var(--cgc-border) !important;
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .primary-nav.is-open,
html[data-theme="dark"] #nav-links.open {
	background: var(--cgc-card-bg-solid) !important;
	border-color: var(--cgc-border) !important;
	box-shadow: var(--cgc-shadow) !important;
}

html[data-theme="dark"] .calculator-submenu,
html[data-theme="dark"] .nav-dropdown {
	background: var(--cgc-card-bg-solid) !important;
	border-color: var(--cgc-border) !important;
}

html[data-theme="dark"] .calculator-submenu a:hover,
html[data-theme="dark"] .nav-dropdown a:hover {
	background: var(--cgc-bg-soft) !important;
}

html[data-theme="dark"] .header-cta,
html[data-theme="dark"] .nav-cta--bar,
html[data-theme="dark"] .button-primary {
	background: linear-gradient(135deg, #123f2d, #2f7d57) !important;
	color: var(--cgc-text-inverse) !important;
	box-shadow: 0 14px 30px rgba(0, 0, 0, 0.32) !important;
}

/* ── Toggle apariencia (único botón) ── */
.cgc-theme-toggle {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	padding: 0;
	border-radius: 999px;
	border: 1px solid var(--cgc-border);
	background: var(--cgc-bg-muted);
	color: var(--cgc-text);
	cursor: pointer;
	flex-shrink: 0;
	transition: background 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease;
}

.cgc-theme-toggle:hover {
	color: var(--cgc-text);
	background: var(--cgc-bg-elevated);
	border-color: var(--cgc-border-strong);
}

.cgc-theme-toggle:focus-visible {
	outline: 2px solid var(--cgc-focus);
	outline-offset: 2px;
}

.cgc-theme-toggle__icon {
	width: 18px;
	height: 18px;
	stroke: currentColor;
	fill: none;
	stroke-width: 1.75;
	stroke-linecap: round;
	stroke-linejoin: round;
	flex-shrink: 0;
}

.cgc-theme-toggle__icon--moon {
	fill: currentColor;
	stroke: none;
}

.cgc-theme-toggle__icon[hidden] {
	display: none !important;
}

/* Icono según modo (sin depender solo de JS) */
html[data-theme="dark"] .cgc-theme-toggle .cgc-theme-toggle__icon--moon,
html.cg-dark .cgc-theme-toggle .cgc-theme-toggle__icon--moon {
	display: none !important;
}

html[data-theme="dark"] .cgc-theme-toggle .cgc-theme-toggle__icon--sun,
html.cg-dark .cgc-theme-toggle .cgc-theme-toggle__icon--sun {
	display: block !important;
	color: var(--cgc-gold-soft) !important;
}

html[data-theme="dark"] .cgc-theme-toggle .cgc-theme-toggle__icon--sun circle,
html.cg-dark .cgc-theme-toggle .cgc-theme-toggle__icon--sun circle {
	fill: currentColor;
	stroke: none;
}

html[data-theme="light"] .cgc-theme-toggle .cgc-theme-toggle__icon--sun {
	display: none !important;
}

html[data-theme="light"] .cgc-theme-toggle .cgc-theme-toggle__icon--moon {
	display: block !important;
	color: var(--cgc-accent) !important;
}

/* Header WP: nav junto al logo; toggle + CTA a la derecha (sin hueco) */
.site-header__inner > .site-brand {
	margin-right: 0;
	flex-shrink: 0;
}

.site-header__inner > .primary-nav {
	flex: 1;
	min-width: 0;
}

.site-header__inner > .cgc-theme-toggle,
.nav-inner > .cgc-theme-toggle {
	order: 2;
	margin-left: 0;
	flex-shrink: 0;
}

.site-header__inner > .header-cta,
.nav-inner > .nav-cta--bar {
	order: 3;
	flex-shrink: 0;
}

.site-header__inner > .menu-toggle,
.nav-inner > .mobile-toggle {
	order: 4;
	flex-shrink: 0;
}

@media (max-width: 900px) {
	.site-header__inner > .menu-toggle {
		margin-left: auto;
	}
}

/* ── Cards y contenido WP genérico ── */
html[data-theme="dark"] .content-card,
html[data-theme="dark"] .empty-state {
	background: var(--cgc-card-bg) !important;
	border-color: var(--cgc-border) !important;
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .card-body h2,
html[data-theme="dark"] .entry-content h2,
html[data-theme="dark"] .entry-content h3 {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .card-body p,
html[data-theme="dark"] .entry-content,
html[data-theme="dark"] .hero-section p {
	color: var(--cgc-text-secondary) !important;
}

html[data-theme="dark"] .hero-section h1,
html[data-theme="dark"] .single-header h1,
html[data-theme="dark"] .eyebrow {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .card-kicker {
	background: var(--cgc-bg-soft) !important;
	color: var(--cgc-accent-bright) !important;
}

html[data-theme="dark"] .image-fallback {
	background: linear-gradient(135deg, #0d2f22, #123f2d) !important;
	color: var(--cgc-text) !important;
}

/* ── Blog editorial ── */
html[data-theme="dark"] .cg-static-blog-article {
	background: var(--cgc-bg) !important;
}

html[data-theme="dark"] .blog-article-shell {
	background: var(--cgc-card-bg) !important;
	border-color: var(--cgc-border) !important;
}

html[data-theme="dark"] .blog-article-content,
html[data-theme="dark"] .blog-lead,
html[data-theme="dark"] .blog-kicker {
	color: var(--cgc-text-secondary) !important;
}

html[data-theme="dark"] .blog-article-shell h1,
html[data-theme="dark"] .blog-article-content h2,
html[data-theme="dark"] .blog-article-content h3 {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .blog-summary {
	background: linear-gradient(135deg, rgba(13, 47, 34, 0.95), rgba(8, 35, 24, 0.92)) !important;
	border-color: var(--cgc-border) !important;
}

html[data-theme="dark"] .blog-article-cta .secondary {
	background: var(--cgc-card-bg) !important;
	border-color: var(--cgc-border) !important;
	color: var(--cgc-text) !important;
}

/* ── Cuenta (plugin shortcode en tema) ── */
html[data-theme="dark"] .cg-tools-account,
html[data-theme="dark"] .cg-auth-card {
	background: var(--cgc-card-bg) !important;
	border-color: var(--cgc-border) !important;
}

html[data-theme="dark"] .cg-auth-card h2,
html[data-theme="dark"] .cg-auth-card label,
html[data-theme="dark"] .cg-account-hero h1 {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .cg-auth-card p,
html[data-theme="dark"] .cg-account-hero p {
	color: var(--cgc-text-secondary) !important;
}

html[data-theme="dark"] .cg-auth-card input[type="text"],
html[data-theme="dark"] .cg-auth-card input[type="email"],
html[data-theme="dark"] .cg-auth-card input[type="password"] {
	background: var(--cgc-bg-muted) !important;
	border-color: var(--cgc-border-strong) !important;
	color: var(--cgc-text) !important;
}

/* ── Complianz banner ── */
html[data-theme="dark"] .cmplz-cookiebanner {
	background: var(--cgc-card-bg-solid) !important;
	color: var(--cgc-text) !important;
	border-color: var(--cgc-border) !important;
}

html[data-theme="dark"] .cmplz-cookiebanner .cmplz-title {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] .cmplz-cookiebanner .cmplz-message,
html[data-theme="dark"] .cmplz-cookiebanner .cmplz-description {
	color: var(--cgc-text-secondary) !important;
}

/* ── Home (secciones con fondos claros fijos) — paso inicial ── */
html[data-theme="dark"] body.cgc-home-page .quick-card,
html[data-theme="dark"] body.cgc-home-page .test-card,
html[data-theme="dark"] body.cgc-home-page .recommend-card,
html[data-theme="dark"] body.cgc-home-page .path-card {
	background: var(--cgc-card-bg) !important;
	border-color: var(--cgc-border) !important;
}

html[data-theme="dark"] body.cgc-home-page .section-title,
html[data-theme="dark"] body.cgc-home-page .quick-card strong,
html[data-theme="dark"] body.cgc-home-page .test-card blockquote {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] body.cgc-home-page .section-sub,
html[data-theme="dark"] body.cgc-home-page .quick-card span span {
	color: var(--cgc-text-secondary) !important;
}

/* ── Home — contraste premium en oscuro ── */
html[data-theme="dark"] body.cgc-home-page .hero h1,
html[data-theme="dark"] body.cgc-home-page .hero h1 span,
html[data-theme="dark"] body.cgc-home-page .hero .hero-sub,
html[data-theme="dark"] body.cgc-home-page .hero .proof-item strong,
html[data-theme="dark"] body.cgc-home-page .hero .proof-item small,
html[data-theme="dark"] body.cgc-home-page .hero-metrics .metric strong,
html[data-theme="dark"] body.cgc-home-page .hero-metrics .metric span,
html[data-theme="dark"] body.cgc-home-page .hero .hero-pill {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] body.cgc-home-page .quick-start,
html[data-theme="dark"] body.cgc-home-page .quick-intro,
html[data-theme="dark"] body.cgc-home-page .quick-card,
html[data-theme="dark"] body.cgc-home-page .recommended,
html[data-theme="dark"] body.cgc-home-page .recommended-shell,
html[data-theme="dark"] body.cgc-home-page .recommend-card,
html[data-theme="dark"] body.cgc-home-page .tool-card,
html[data-theme="dark"] body.cgc-home-page .article-card,
html[data-theme="dark"] body.cgc-home-page .lead-inner,
html[data-theme="dark"] body.cgc-home-page .calc-intro-card,
html[data-theme="dark"] body.cgc-home-page .calc-body {
	background: var(--cgc-card-bg) !important;
	border-color: var(--cgc-border) !important;
}

html[data-theme="dark"] body.cgc-home-page .quick-intro h2,
html[data-theme="dark"] body.cgc-home-page .quick-intro .section-title,
html[data-theme="dark"] body.cgc-home-page .quick-card strong,
html[data-theme="dark"] body.cgc-home-page .recommended-copy h2,
html[data-theme="dark"] body.cgc-home-page .recommend-title,
html[data-theme="dark"] body.cgc-home-page .tool-card h3,
html[data-theme="dark"] body.cgc-home-page .article-card h3,
html[data-theme="dark"] body.cgc-home-page .lead-inner h2,
html[data-theme="dark"] body.cgc-home-page .section-title,
html[data-theme="dark"] body.cgc-home-page .path-section.section-title,
html[data-theme="dark"] body.cgc-home-page #como.section-title {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] body.cgc-home-page .quick-card span,
html[data-theme="dark"] body.cgc-home-page .recommend-text,
html[data-theme="dark"] body.cgc-home-page .tool-card p,
html[data-theme="dark"] body.cgc-home-page .article-card p,
html[data-theme="dark"] body.cgc-home-page .lead-inner p,
html[data-theme="dark"] body.cgc-home-page .section-sub {
	color: var(--cgc-text-secondary) !important;
}

html[data-theme="dark"] body.cgc-home-page .tools-band,
html[data-theme="dark"] body.cgc-home-page #herramientas,
html[data-theme="dark"] body.cgc-home-page .tools-section {
	background: var(--cgc-bg-soft) !important;
}

html[data-theme="dark"] body.cgc-home-page .tools-band .tool-card,
html[data-theme="dark"] body.cgc-home-page #herramientas .tool-card {
	background: color-mix(in srgb, var(--cgc-card-bg-solid) 88%, #000) !important;
}

/* ── Hubs estáticos (recetas, recursos, PRO) ── */
html[data-theme="dark"] body.cgc-static-recetas .recetas-hero h1.recetas-hero__title,
html[data-theme="dark"] body.cgc-static-recetas .recetas-hero h1.recetas-hero__title .recetas-hero__stat,
html[data-theme="dark"] body.cgc-static-recetas .recetas-hero-copy h1,
html[data-theme="dark"] body.cgc-static-recursos .recursos-hero__copy h1,
html[data-theme="dark"] body.cgc-static-pro .pro-hero .hero-title,
html[data-theme="dark"] body.cgc-page-recursos .recursos-hero h1 {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] body.cgc-static-recetas .recetas-hero__description,
html[data-theme="dark"] body.cgc-static-recetas .recetas-hero-copy .lead,
html[data-theme="dark"] body.cgc-static-recursos .recursos-hero__copy .lead,
html[data-theme="dark"] body.cgc-static-pro .pro-hero__lead {
	color: var(--cgc-text-secondary) !important;
}

html[data-theme="dark"] body.cgc-static-recetas .recetas-hero__kicker,
html[data-theme="dark"] body.cgc-static-recetas .recetas-hero-copy .eyebrow {
	color: var(--cgc-accent-bright) !important;
	background: rgba(72, 173, 114, 0.14) !important;
}

html[data-theme="dark"] body.cgc-static-recetas .recetas-hero__stat-badge,
html[data-theme="dark"] body.cgc-static-recursos .recursos-hero__capture,
html[data-theme="dark"] body.cgc-static-recursos .recursos-hero__capture h2,
html[data-theme="dark"] body.cgc-static-recursos .lead-card,
html[data-theme="dark"] body.cgc-static-recursos .lead-card h2 {
	background: var(--cgc-card-bg-solid) !important;
	border-color: var(--cgc-border) !important;
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] body.cgc-static-recursos .recursos-hero__capture p,
html[data-theme="dark"] body.cgc-static-recursos .lead-card p,
html[data-theme="dark"] body.cgc-static-recursos .lead-card label {
	color: var(--cgc-text-secondary) !important;
}

html[data-theme="dark"] body.cgc-static-pro .pro-hero-band,
html[data-theme="dark"] body.cgc-static-pro .editorial-feature-card,
html[data-theme="dark"] body.cgc-home-page .home-editorial .editorial-feature-card {
	background: var(--cgc-card-bg) !important;
	border-color: var(--cgc-border) !important;
}

html[data-theme="dark"] body.cgc-static-pro .editorial-feature-card h3,
html[data-theme="dark"] body.cgc-static-pro .pro-hero-band h1,
html[data-theme="dark"] body.cgc-home-page .home-editorial .editorial-feature-card h3 {
	color: var(--cgc-text) !important;
}

html[data-theme="dark"] body.cgc-static-pro .editorial-feature-card p,
html[data-theme="dark"] body.cgc-home-page .home-editorial .editorial-feature-card p {
	color: var(--cgc-text-secondary) !important;
}

html[data-theme="dark"] .notice-bar,
html[data-theme="dark"] .preview-bar,
html[data-theme="dark"] .recipe-notice {
	background: var(--cgc-bg-soft) !important;
	border-color: var(--cgc-border) !important;
	color: var(--cgc-text-secondary) !important;
}

@media (max-width: 900px) {
	.cgc-theme-toggle {
		width: 36px;
		height: 36px;
	}

	.cgc-theme-toggle__icon {
		width: 17px;
		height: 17px;
	}
}
