// Copyright (c) 2017-2025, CKSource Holding sp. z o.o. All rights reserved.
// For licensing, see LICENSE.md.

/* If you want to activate dark mode, fire in the console `localStorage.setItem( 'theme', 'theme-dark' ); `*/
:root {
	--dark--3: hsl(0, 0%, 20%);
	--dark--2: hsl(0, 0%, 16%);
	--dark--1: hsl(0, 0%, 12%);
	--dark-link-color: hsl(196, 100%, 50%);
	--light: hsl(0, 0%, 97%);
}

html.theme-dark{
	body {
		color: var(--light);
		background-color: var(--dark--1);
	}

	.main .main__content,
	nav.api-secondary-navigation,
	.main .side-navigation__wrapper,
	.main .side-navigation__inner,
	.main__content--sdk .sdk-sample-source-code__code-block-action-buttons a{
		background-color: var(--dark--1);
		border-color: var(--dark--2);
	}

	.api-subheader .badge,
	.collapsing-list__term .badge,
	.collapsing-list__term .badge a {
		color: var(--light);
		border-color: var(--light)
	}

	.tree li .tree__item__wrapper--active {
		background-color: var(--dark--3)
	}

	.tree.api-tree,
	.tree li a,
	.top__menu li a,
	nav.secondary-navigation,
	nav.secondary-navigation a,
	nav.api-info-box.api-secondary-navigation dt,
	.api-tree__filter label,
	.api-subheader__navigation-category,
	div.api-props-filter h4,
	.footer p,
	.header__menu-rwd,
	.header__menu-rwd ul.header__menu-rwd__projects li[data-project]>a,
	.algolia-docsearch-suggestion,
	.algolia-autocomplete .ds-suggestion .algolia-docsearch-suggestion--subcategory-column-text,
	.algolia-autocomplete .algolia-docsearch-suggestion--category-header,
	input.example-input,
	.collapsing-list__description dl .dlheading5,
	.collapsing-list__description dl .dlheading6 {
		color: var(--light);
	}

	.top .header__sub,
	.header__menu-rwd ul.header__menu-rwd__projects li[data-project]>a,
	.main__content--sdk a.sdk-sample-source-code__button:hover,
	.main__content--sdk a.sdk-sample-source-code__button.active{
		background-color: var(--dark--3);
		border-color: var(--dark--2);
	}

	.top,
	.top .header__main,
	.top__menu li a:hover,
	.main__content-inner .api-subheader__navigation-category,
	.tree li .tree__item__wrapper:hover,
	p.notice, div.notice, nav.notice, div.tip, p.tip,
	div.docs-categories__item ul li a:hover,
	div.docs-categories__item ul li a:focus,
	.formatted .hljs,
	.main__content-inner .api-subheader__navigation-category:hover ul,
	.header__menu-rwd,
	.main__content--sdk a.sdk-sample-source-code__button,{
		background-color: var(--dark--2);
	}

	.top__search__box,
	.api-tree__filter,
	div.api-props-filter,
	.header__menu-rwd ul.header__menu-rwd__projects ul.header__menu-rwd__projects-pages,
	nav.secondary-navigation{
		background-color: var(--dark--1);
		color: var(--light);
	}

	.formatted code:not(.hljs){
		background-color: rgba( 255, 255, 255, 0.1 );
		padding: .1em .25em;
	}

	nav.secondary-navigation>ol,
	div.api-props-filter{
		border-color: var(--dark--2);
	}

	.main .main__content .github-contrib img,
	div.api-props-filter h4::before{
		filter: invert(85%);
	}

	.top__menu li a,
	.footer,
	.formatted kbd,
	input.example-input {
		background-color: transparent;
	}

	.footer,
	.api-tree__filter{
		border-color: transparent;
	}

	/* LINK COLORS. */
	a,
	.formatted a code:not(.hljs),
	nav.secondary-navigation a.secondary-navigation__current-position,
	div.main__content-inner a.headerlink,
	nav.secondary-navigation a:hover{
		color: var(--dark-link-color);
	}

	nav.secondary-navigation a.secondary-navigation__current-position::before{
		background-color: var(--dark-link-color);
	}

	/* SEARCH */
	.algolia-autocomplete .ds-dropdown-menu,
	.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column,
	.algolia-autocomplete .algolia-docsearch-suggestion--category-header{
		background-color: var(--dark--1);
	}

	.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content{
		background-color: var(--dark--3);
		color: var(--dark-link-color);
	}

	a.algolia-docsearch-suggestion.algolia-docsearch-suggestion__secondary,
	.algolia-autocomplete .ds-suggestion.ds-cursor .algolia-docsearch-suggestion--content{
		text-decoration: none;
	}
	.algolia-docsearch-suggestion--content,
	.algolia-autocomplete .algolia-docsearch-suggestion__secondary,
	.algolia-autocomplete .algolia-docsearch-suggestion--subcategory-column,
	.collapsing-list__term{
		border-color: var(--dark--3);
	}

	.algolia-docsearch-footer .algolia-docsearch-footer--logo{
		background: none;
	}

	/* FIX CKEDITOR CONTENT COLOR. */
	.ck-content {
		background-color: var(--light);
		color: var(--dark--1);
	}

	/* #709. */
	.docs-categories__item ul li:first-of-type a:hover{
		border-top-left-radius: 7px;
		border-top-right-radius: 7px;
	}

	.docs-categories__item ul li:last-of-type a:hover{
		border-bottom-left-radius: 7px;
		border-bottom-right-radius: 7px;
	}
}
