/* =========================================================
   Knox Kids — overrides de layout / modo escuro (Eduma)
   Tokens: kk-ui-tokens.css | --thim-*: kk-eduma-bridge.css
   html.dark + html.kk-site-dark (toggle em kk-color-mode.js)
   ========================================================= */

/* Botão tema: inline no header (Elementor mount / LD) ou fallback flutuante */
.kk-color-mode-mount {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  vertical-align: middle;
  line-height: 0;
}

.kk-color-mode-toggle {
  position: relative;
  z-index: 2;
  flex-shrink: 0;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: 1px solid rgba(15, 23, 42, 0.1);
  background: #fff;
  color: #334155;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06);
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

/*
 * Site em modo CLARO + botão a convidar para escuro (lua visível):
 * painel bem light, baixo contraste com o header — não “grita”
 */
html:not(.kk-site-dark):not(.dark) .kk-color-mode-toggle:not(.kk-color-mode-toggle--is-dark) {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  border: 1px solid rgba(15, 23, 42, 0.07);
  color: #475569;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

html:not(.kk-site-dark):not(.dark) .kk-color-mode-toggle:not(.kk-color-mode-toggle--is-dark):hover {
  background: #fff;
  border-color: rgba(14, 162, 221, 0.35);
  color: #0f172a;
  box-shadow: 0 2px 8px rgba(15, 23, 42, 0.07);
  transform: scale(1.03);
}

html:not(.kk-site-dark):not(.dark) .kk-color-mode-toggle:not(.kk-color-mode-toggle--is-dark):focus-visible {
  outline: 2px solid rgba(14, 162, 221, 0.55);
  outline-offset: 2px;
}

/* Até o JS montar o botão no header, fica fora do ecrã */
.kk-color-mode-toggle--pending {
  position: fixed !important;
  left: -9999px !important;
  top: 0 !important;
  opacity: 0 !important;
  pointer-events: none !important;
}

.kk-color-mode-toggle--floating {
  position: fixed;
  bottom: 24px;
  left: 24px;
  right: auto;
  z-index: 99998;
}

.kk-color-mode-toggle--in-header {
  position: relative;
  left: auto;
  top: auto;
  opacity: 1;
  pointer-events: auto;
}

/* Hover quando o site já está escuro (sol visível); modo claro+lua usa regra específica acima */
html.dark .kk-color-mode-toggle:hover,
html.kk-site-dark .kk-color-mode-toggle:hover {
  transform: scale(1.04);
  filter: brightness(1.06);
}

.kk-color-mode-toggle:focus-visible {
  outline: 2px solid #00b7eb;
  outline-offset: 3px;
}

.kk-color-mode-toggle .kk-color-mode-toggle__sun,
.kk-color-mode-toggle .kk-color-mode-toggle__moon {
  display: none;
  line-height: 0;
}

.kk-color-mode-toggle.kk-color-mode-toggle--is-dark .kk-color-mode-toggle__sun {
  display: block;
}

.kk-color-mode-toggle:not(.kk-color-mode-toggle--is-dark) .kk-color-mode-toggle__moon {
  display: block;
}

.kk-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Site em modo ESCURO: botão alinha ao painel (sol = voltar ao claro) */
html.dark .kk-color-mode-toggle,
html.kk-site-dark .kk-color-mode-toggle {
  background: hsl(var(--card-hover));
  color: hsl(var(--foreground));
  border-color: hsl(var(--border));
  box-shadow: var(--shadow-card);
}

/* Sol um pouco mais suave no escuro (raios não “queimam”) */
html.dark .kk-color-mode-toggle.kk-color-mode-toggle--is-dark .kk-color-mode-toggle__sun circle,
html.kk-site-dark .kk-color-mode-toggle.kk-color-mode-toggle--is-dark .kk-color-mode-toggle__sun circle {
  opacity: 0.95;
}

html.dark body,
html.kk-site-dark body {
  background-color: var(--kk-bg);
  color: var(--thim-font-body-color);
}

html.dark, html.kk-site-dark #wrapper-container,
html.dark, html.kk-site-dark .content-pusher,
html.dark, html.kk-site-dark #main-content {
  background-color: var(--kk-bg);
}

html.dark, html.kk-site-dark #masthead.site-header {
  background-color: var(--kk-card) !important;
  border-bottom: 1px solid var(--kk-border);
  box-shadow: none;
}

html.dark, html.kk-site-dark #toolbar.toolbar {
  background-color: var(--kk-card-2) !important;
  border-bottom: 1px solid var(--kk-border);
  color: var(--kk-muted);
}

html.dark, html.kk-site-dark #toolbar.toolbar a,
html.dark, html.kk-site-dark #toolbar.toolbar {
  color: var(--kk-muted);
}

html.dark, html.kk-site-dark .thim-nav-wrapper {
  background-color: transparent;
}

html.dark, html.kk-site-dark .navigation .tm-table {
  background: transparent;
}

html.dark, html.kk-site-dark .navbar-nav > li > a,
html.dark, html.kk-site-dark .navbar-nav li a {
  color: var(--menu-text-color) !important;
}

html.dark, html.kk-site-dark .navbar-nav .sub-menu,
html.dark, html.kk-site-dark .navbar-nav .children,
html.dark, html.kk-site-dark .thim-ekits-menu .sub-menu,
html.dark, html.kk-site-dark .thim-megamenu .sub-menu {
  background: var(--kk-card-2) !important;
  border: 1px solid var(--kk-border);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}

html.dark, html.kk-site-dark .navbar-nav .sub-menu a,
html.dark, html.kk-site-dark .thim-ekits-menu .sub-menu a {
  color: var(--kk-muted) !important;
}

html.dark, html.kk-site-dark .navbar-nav .sub-menu a:hover,
html.dark, html.kk-site-dark .thim-ekits-menu .sub-menu a:hover {
  color: var(--kk-primary) !important;
}

html.dark, html.kk-site-dark .site-main,
html.dark, html.kk-site-dark #main.site-main {
  color: var(--thim-font-body-color);
}

html.dark, html.kk-site-dark h1,
html.dark, html.kk-site-dark h2,
html.dark, html.kk-site-dark h3,
html.dark, html.kk-site-dark h4,
html.dark, html.kk-site-dark h5,
html.dark, html.kk-site-dark h6,
html.dark, html.kk-site-dark .heading__primary,
html.dark, html.kk-site-dark .widget-title,
html.dark, html.kk-site-dark .thim-widget-heading .title {
  color: var(--thim-font-title-color);
}

html.dark, html.kk-site-dark a:not(.button):not(.lp-button):not(.wp-block-button__link):not(.added_to_cart):not(.elementor-button),
html.dark, html.kk-site-dark .entry-meta a {
  color: var(--kk-primary);
}

html.dark, html.kk-site-dark a:not(.button):not(.lp-button):hover,
html.dark, html.kk-site-dark .entry-meta a:hover {
  color: hsl(197 90% 58%);
}

html.dark, html.kk-site-dark .mobile-menu-wrapper {
  background: var(--kk-card) !important;
}

html.dark, html.kk-site-dark .mobile-menu-inner,
html.dark, html.kk-site-dark .mobile-menu-container {
  background: transparent !important;
  color: var(--kk-fg);
}

html.dark, html.kk-site-dark .mobile-menu-container a,
html.dark, html.kk-site-dark .mobile-menu-container .navbar-nav > li > a {
  color: var(--kk-muted) !important;
}

html.dark, html.kk-site-dark .navbar-toggle .icon-bar {
  background: var(--kk-fg);
}

html.dark, html.kk-site-dark footer#colophon,
html.dark, html.kk-site-dark footer#colophon .footer {
  background-color: var(--thim-footer-bg-color) !important;
  color: var(--thim-footer-color-text);
  border-top: 1px solid var(--kk-border);
}

html.dark, html.kk-site-dark footer#colophon a {
  color: var(--thim-footer-color-link);
}

html.dark, html.kk-site-dark footer#colophon .widget-title {
  color: var(--kk-fg);
}

html.dark, html.kk-site-dark .top_site_main {
  background-color: var(--kk-card) !important;
}

html.dark, html.kk-site-dark .page-title .title,
html.dark, html.kk-site-dark .top_site_main .page-title-wrapper h1,
html.dark, html.kk-site-dark .top_site_main .page-title-wrapper h2 {
  color: var(--kk-fg) !important;
}

html.dark, html.kk-site-dark .breadcrumbs-wrapper,
html.dark, html.kk-site-dark #breadcrumbs,
html.dark, html.kk-site-dark .sc_breadcrumbs {
  background: transparent !important;
}

html.dark, html.kk-site-dark #breadcrumbs a,
html.dark, html.kk-site-dark .breadcrumbs a {
  color: var(--kk-primary);
}

html.dark, html.kk-site-dark .sidebar,
html.dark, html.kk-site-dark #sidebar,
html.dark, html.kk-site-dark aside.widget-area {
  color: var(--kk-muted);
}

html.dark, html.kk-site-dark .widget {
  background: var(--kk-card);
  border: 1px solid var(--kk-border);
  border-radius: var(--kk-radius);
}

html.dark, html.kk-site-dark .widget a {
  color: var(--kk-primary);
}

html.dark, html.kk-site-dark input[type="text"],
html.dark, html.kk-site-dark input[type="email"],
html.dark, html.kk-site-dark input[type="url"],
html.dark, html.kk-site-dark input[type="password"],
html.dark, html.kk-site-dark input[type="search"],
html.dark, html.kk-site-dark input[type="number"],
html.dark, html.kk-site-dark input[type="tel"],
html.dark, html.kk-site-dark textarea,
html.dark, html.kk-site-dark select,
html.dark, html.kk-site-dark .wpcf7-form input,
html.dark, html.kk-site-dark .wpcf7-form textarea,
html.dark, html.kk-site-dark .wpcf7-form select {
  background-color: var(--kk-card-2) !important;
  border-color: var(--kk-border) !important;
  color: var(--kk-fg) !important;
}

html.dark, html.kk-site-dark input::placeholder,
html.dark, html.kk-site-dark textarea::placeholder {
  color: var(--thim-placeholder-color);
}

html.dark, html.kk-site-dark .blog-content article,
html.dark, html.kk-site-dark .post-format-content,
html.dark, html.kk-site-dark .content-inner {
  background: var(--kk-card);
  border-color: var(--kk-border);
}

html.dark, html.kk-site-dark .content-inner .title a {
  color: var(--kk-fg);
}

html.dark, html.kk-site-dark .learn-press-breadcrumb,
html.dark, html.kk-site-dark .lp-archive-courses .course-filter,
html.dark, html.kk-site-dark .lp-single-course .course-author,
html.dark, html.kk-site-dark .course-item .thim-course-content,
html.dark, html.kk-site-dark .course-meta,
html.dark, html.kk-site-dark .course-summary {
  color: var(--kk-muted);
}

html.dark, html.kk-site-dark .learn-press-breadcrumb {
  background: var(--kk-card);
}

html.dark, html.kk-site-dark .lp-content-area .lp-button,
html.dark, html.kk-site-dark .course-item .course-title a {
  color: inherit;
}

html.dark, html.kk-site-dark .lp-single-course .entry-title,
html.dark, html.kk-site-dark .course-title a {
  color: var(--kk-fg) !important;
}

html.dark, html.kk-site-dark .thim-course-list .lpr_course,
html.dark, html.kk-site-dark .thim-course-list .course-item {
  border-color: var(--kk-border);
}

html.dark, html.kk-site-dark .learndash-wrapper {
  color: var(--kk-muted);
}

html.dark, html.kk-site-dark .learndash-wrapper .ld-item-list,
html.dark, html.kk-site-dark .learndash-wrapper .ld-table-list,
html.dark, html.kk-site-dark .learndash-wrapper .ld-focus-content {
  background: transparent;
}

html.dark, html.kk-site-dark .learndash-wrapper h1,
html.dark, html.kk-site-dark .learndash-wrapper h2,
html.dark, html.kk-site-dark .learndash-wrapper h3,
html.dark, html.kk-site-dark .learndash-wrapper .ld-item-title {
  color: var(--kk-fg);
}

html.dark, html.kk-site-dark .elementor-widget-text-editor,
html.dark, html.kk-site-dark .elementor-widget-theme-post-content {
  color: var(--kk-muted);
}

html.dark, html.kk-site-dark .elementor-heading-title {
  color: var(--kk-fg);
}

html.dark, html.kk-site-dark .elementor-section.elementor-section-boxed > .elementor-container {
  background-color: transparent;
}

html.dark, html.kk-site-dark body.woocommerce-page .product .summary,
html.dark, html.kk-site-dark body.woocommerce-page table.shop_table,
html.dark, html.kk-site-dark body.woocommerce-page .woocommerce-checkout,
html.dark, html.kk-site-dark body.woocommerce-page .cart-collaterals {
  color: var(--kk-muted);
}

html.dark, html.kk-site-dark body.woocommerce-page table.shop_table {
  background: var(--kk-card);
  border-color: var(--kk-border);
}

html.dark, html.kk-site-dark .wp-block-quote,
html.dark, html.kk-site-dark .wp-block-pullquote {
  border-color: var(--kk-border);
  color: var(--kk-muted);
}

html.dark, html.kk-site-dark pre,
html.dark, html.kk-site-dark code,
html.dark, html.kk-site-dark kbd {
  background: var(--kk-card-2);
  color: var(--thim-font-title-color);
}
