/**
 * Dokuwiki Namespaced template
 *
 * @link    https://www.dokuwiki.org/template:namespaced
 * @author  Simon DELAGE <sdelage@gmail.com>
 * @license GPL 2 (https://www.gnu.org/licenses/gpl-2.0.html)
 *
 * This file contains namespace dependent style (mostly colors), loaded from main.php header
*/

/**
* HTML ITEMS
* -- Headings
* HEADER
* -- Navbar
* MAIN
* -- Page nav
* -- SubNS index
* -- docInfo
* -- Pagetools & Contools
* FOOTER
* GENERIC CLASSES
* DOKUWIKI GLOBAL
* DOKUWIKI MODES
* -- Media manager
* -- Settings
* PLUGINS
* -- Blockquote
* -- Cloud
* -- Wrap
* BOX LAYOUT
*/

/* HTML ITEMS
-------------------------------------------------------------- */

button {
    color: @ini_text_alt;
}

[dir] button {
    background-color: @ini_background_alt;
}

button:hover {
    color: @ini_theme_text_color;
}

[dir] button:hover {
    background-color: @ini_secondary_color;
}

[dir] button:active {
    background-color: @ini_secondary_color;
}

[dir] input[type=text]:focus {
    border-color: @ini_theme_color;
}

[dir] body.colored-tables th, [dir] body.striped-tables th {
    background-color: @ini_theme_color;
}

[dir] hr {
    border-color: @ini_dark_color;
}

[dir] pre:not(.dbg) {
    border-bottom-color: @ini_border;
}

[dir] table, [dir] thead, [dir] th, [dir] td {
    border-color: @ini_border;
}

/* -- Headings -- */

/*
h1,
h2,
h3,
h4,
h5 {
    color: @ini_theme_color;
}
*/

h1 {
    color: @ini_h1_color;
}

h2 {
    color: @ini_h2_color;
}

h3 {
    color: @ini_h3_color;
}

h4 {
    color: @ini_h4_color;
}

h5 {
    color: @ini_h5_color;
}

#namespaced__site_title a span {
    color: @ini_theme_color;
}

#namespaced__site_title a:hover span {
    color: @ini_secondary_color;
}

[dir] #namespaced__site_nav_labels h6 {
    background-color: @ini_secondary_color;
}

#namespaced__site_nav_labels h6 {
    color: @ini_theme_text_color;
}

/* HEADER
----------------------------------------------- */

/* -- Navbar -- */

[dir] #namespaced__site_nav.navbar {
    background-color: @ini_theme_color;
    border-top: .6rem solid @ini_secondary_color;
}

/*
.navbar ul li a,
.navbar ul li span,
.navbar ul li button {
    color: @ini_theme_text_color;
}
*/
#namespaced_ns_menu li a {
    color: @ini_theme_text_color;
}

#namespaced__site_nav.navbar ul li.no-pages svg,
#namespaced__site_nav.navbar ul li a svg,
#namespaced__site_nav.navbar ul li span svg,
#namespaced__site_nav.navbar ul li button svg {
    fill: @ini_theme_text_color;
}

/*
nav ul.menu li a.action:hover,
nav ul.sub-menu li a.action:hover,
nav ul.menu li span:hover,
nav ul.sub-menu li span:hover,
#namespaced__contools ul.menu li button:hover,
#namespaced__contools ul.sub-menu li button:hover {
*/
nav ul.menu li a.nav:hover,
nav ul.menu li a.action:hover,
nav ul.sub-menu li a.action:hover,
#namespaced__contools ul.menu li button:hover,
#namespaced__contools ul.sub-menu li button:hover {
    /*box-shadow: 0 0 40px 40px @ini_secondary_color inset;*/
}
[dir] nav ul.menu li a.nav:hover, [dir] nav ul.menu li a.action:hover, [dir] nav ul.sub-menu li a.action:hover, [dir] #namespaced__contools ul.menu li button:hover, [dir] #namespaced__contools ul.sub-menu li button:hover {
    background-color: @ini_secondary_color;
}

.navbar ul.sub-menu li:hover a:not(.active) {
    color: @ini_theme_text_color;
}

.navbar ul.sub-menu li:hover a:not(.active) svg {
    fill: @ini_theme_text_color !important;
}

/* MAIN
----------------------------------------------- */

[dir] body.theme-toc #dw__toc {
    background-color: @ini_theme_color;
}

[dir] body.secondary-toc #dw__toc {
    background-color: @ini_secondary_color;
}

[dir] body.dark-toc #dw__toc {
    background-color: @ini_dark_color;
}

[dir] body.theme-toc:not(.neu-toc) #dw__toc h3 {
    background-color: @ini_secondary_color;
}

[dir] body.secondary-toc:not(.neu-toc) #dw__toc h3 {
    background-color: @ini_dark_color;
}

[dir] body.dark-toc:not(.neu-toc) #dw__toc h3 {
    background-color: @ini_secondary_color;
}

body.theme-toc:not(.neu-toc) #dw__toc h3,
body.secondary-toc:not(.neu-toc) #dw__toc h3,
body.dark-toc:not(.neu-toc) #dw__toc h3 {
    color: @ini_theme_text_color;
}

[dir] body.fourborders-toc:not(.neu-toc) #dw__toc {
    border-color: @ini_border;
}

[dir=ltr] body.oneborder-toc #dw__toc {
    border-left-color: @ini_border;
}

[dir=rtl] body.oneborder-toc #dw__toc {
    border-right-color: @ini_border;
}

[dir=ltr] #namespaced__aside aside.oneborder {
    border-right-color: @ini_border;
}

[dir=rtl] #namespaced__aside aside.oneborder {
    border-left-color: @ini_border;
}

[dir] #namespaced__subns_index.oneborder {
    border-top-color: @ini_border;
}

[dir] #namespaced__aside aside.fourborders:not(.neu), [dir] #namespaced__footer_widgets aside.fourborders:not(.neu), [dir] #namespaced__subns_index.fourborders:not(.neu) {
    border-color: @ini_border;
}

[dir] aside.theme {
    background-color: @ini_theme_color;
}

[dir] aside.theme:not(.neu) h6 {
    background-color: @ini_secondary_color;
}

[dir] aside.secondary:not(.neu) {
    background-color: @ini_secondary_color;
}

[dir] aside.secondary:not(.neu) h6 {
    background-color: @ini_dark_color;
}

[dir] aside.dark:not(.neu) {
    background-color: @ini_dark_color;
}

[dir] aside.dark:not(.neu) h6 {
    background-color: @ini_secondary_color;
}

aside.theme,
aside.theme:not(.neu) h6,
aside.secondary,
aside.secondary:not(.neu) h6,
aside.dark,
aside.dark:not(.neu) h6 {
    color: @ini_theme_text_color;
}

[dir] aside.labeled:not(.neu) {
    border-color: @ini_border;
}

[dir] #namespaced__footer.theme aside.labeled h6 {
    background-color: @ini_theme_color;
}

[dir] #namespaced__footer.secondary aside.labeled h6 {
    background-color: @ini_secondary_color;
}

[dir] #namespaced__footer.dark aside.labeled h6 {
    background-color: @ini_dark_color;
}

[dir] aside.labeled:not(.neu) h6 span {
    background-color: @ini_border;
}

/* -- Page nav -- */

[dir] #namespaced__page_nav.oneborder {
    border-bottom-color: @ini_border;
}

[dir] #namespaced__page_nav.fourborders {
    border-color: @ini_border;
}

[dir] #namespaced__page_nav.theme:not(.neu) {
    background-color: @ini_theme_color;
}

[dir] #namespaced__page_nav.secondary:not(.neu) {
    background-color: @ini_secondary_color;
}

[dir] #namespaced__page_nav.dark:not(.neu) {
    background-color: @ini_dark_color;
}

#namespaced__page_nav.theme:not(.neu) .pageId,
#namespaced__page_nav.secondary:not(.neu) .pageId,
#namespaced__page_nav.dark:not(.neu) .pageId {
    color: @ini_theme_text_color;
}

/* -- SubNS index -- */

#namespaced__subns_index:not(.neu) a span {
    color: @ini_theme_text_color;
}

[dir] #namespaced__subns_index:not(.neu) a span {
    background-color: @ini_theme_color;
}

[dir] #namespaced__subns_index:not(.neu) a:hover span {
    background-color: @ini_secondary_color;
}

[dir] #namespaced__subns_index.theme:not(.neu) {
    background-color: @ini_theme_color;
}

[dir] #namespaced__subns_index.secondary:not(.neu) {
    background-color: @ini_secondary_color;
}

[dir] #namespaced__subns_index.dark:not(.neu) {
    background-color: @ini_dark_color;
}

#namespaced__subns_index.theme h6,
#namespaced__subns_index.secondary h6,
#namespaced__subns_index.dark h6 {
    color: @ini_theme_text_color;
}

[dir] #namespaced__subns_index.theme:not(.neu) div a span {
    background-color: @ini_secondary_color;
}

[dir] #namespaced__subns_index.secondary:not(.neu) div a span {
    background-color: @ini_dark_color;
}

[dir] #namespaced__subns_index.dark:not(.neu) div a span {
    background-color: @ini_secondary_color;
}

[dir] #namespaced__subns_index.theme:not(.neu) div a:hover span {
    background-color: @ini_dark_color;
}

[dir] #namespaced__subns_index.secondary:not(.neu) div a:hover span, [dir] #namespaced__subns_index.dark:not(.neu) div a:hover span {
    background-color: @ini_theme_color;
}

/* -- docInfo -- */

[dir] #namespaced__docinfo.oneborder:not(.neu) {
    border-top-color: @ini_border;
}

[dir] #namespaced__docinfo.fourborders:not(.neu) {
    border-color: @ini_border;
}

[dir] #namespaced__docinfo.theme:not(.neu) {
    background-color: @ini_theme_color;
}

[dir] #namespaced__docinfo.secondary:not(.neu) {
    background-color: @ini_secondary_color;
}

[dir] #namespaced__docinfo.dark:not(.neu) {
    background-color: @ini_dark_color;
}

/* -- Pagetools & Contools -- */

#namespaced__contools ul li:hover a,
#namespaced__contools ul li:hover button,
#namespaced__pagetools ul li:hover a {
    color: @ini_theme_text_color;
}

#namespaced__contools ul li:hover a svg,
#namespaced__contools ul li:hover button svg,
#namespaced__pagetools ul li:hover a svg {
    fill: @ini_theme_text_color;
}

/* FOOTER
----------------------------------------------- */

[dir] #namespaced__footer.theme {
    background-color: @ini_theme_color;
}

[dir] #namespaced__footer.secondary {
    background-color: @ini_secondary_color;
}

[dir] #namespaced__footer.dark {
    background-color: @ini_dark_color;
}

#namespaced__footer.theme:not(.neu) aside:not(.neu),
#namespaced__footer.secondary:not(.neu) aside:not(.neu),
#namespaced__footer.dark:not(.neu) aside:not(.neu),
#namespaced__footer.theme:not(.neu) aside:not(.neu) h6,
#namespaced__footer.secondary:not(.neu) aside:not(.neu) h6,
#namespaced__footer.dark:not(.neu) aside:not(.neu) h6 {
    color: @ini_theme_text_color;
}

[dir] #namespaced__footer.theme:not(.neu) #namespaced__footer_sole {
    background-color: @ini_secondary_color;
}

[dir] #namespaced__footer.secondary:not(.neu) #namespaced__footer_sole {
    background-color: @ini_dark_color;
}

[dir] #namespaced__footer.dark:not(.neu) #namespaced__footer_sole {
    background-color: @ini_secondary_color;
}

#namespaced__footer.theme #namespaced__footer_sole a:hover svg,
#namespaced__footer.secondary #namespaced__footer_sole a:hover svg,
#namespaced__footer.dark #namespaced__footer_sole a:hover svg {
    fill: @ini_theme_text_color;
}

[dir] #namespaced__footer.oneborder:not(.neu) {
    border-top-color: @ini_border;
}

[dir] #namespaced__footer_widgets aside.oneborder {
    border-top-color: @ini_border;
}

[dir] #namespaced__footer.oneborder.neu {
    border-top-color: desaturate(@ini_border, 100%);
}

/* GENERIC CLASSES
----------------------------------------------- */

[dir=ltr] body.neu-toc.oneborder-toc #dw__toc {
    border-left-color: desaturate(@ini_border, 100%);
}

[dir=rtl] body.neu-toc.oneborder-toc #dw__toc {
    border-right-color: desaturate(@ini_border, 100%);
}

[dir] body.neu-toc.fourborders-toc #dw__toc {
    border-color: desaturate(@ini_border, 100%);
}

[dir] #namespaced__page_nav.fourborders.neu {
    border-color: desaturate(@ini_border, 100%);
}

[dir] #namespaced__page_nav.oneborder.neu {
    border-bottom-color: desaturate(@ini_border, 100%);
}

[dir] #namespaced__docinfo.oneborder.neu {
    border-top-color: desaturate(@ini_border, 100%);
}

[dir] #namespaced__footer_widgets aside.neu {
    border-top-color: desaturate(@ini_border, 100%);
}

/* DOKUWIKI GLOBAL
----------------------------------------------- */

[dir] .footnotes {
    border-top: 2px dotted @ini_border;
    padding-top: .3rem;
}

[dir=ltr] blockquote {
    border-color: transparent transparent transparent @ini_border;
}

[dir=rtl] blockquote {
    border-color: transparent @ini_border transparent transparent;
}

blockquote,
pre {
    color: @ini_text_alt;
}

[dir] blockquote, [dir] pre {
    background-color: @ini_background_alt;
}

[dir] body.striped-tables tr:nth-child(even) {
    background-color: @ini_background_alt;
}

/* DOKUWIKI MODES
----------------------------------------------- */

/* -- Media details */

[dir] div.img_detail table {
    border: 1px solid @ini_border;
}

/* -- Media manager -- */

[dir] #mediamanager__page > div {
    border: 1px solid @ini_border;
}
/*
#mediamanager__page div.namespaces,
#mediamanager__page div.filelist {
    border: 1px solid @ini_border;
}
*/

[dir] #mediamanager__page div.filelist ul.thumbs li {
    background-color: @ini_background_neu;
}

/* -- Settings -- */

[dir] .dokuwiki #config__manager fieldset {
    border: 1px solid @ini_border;
}

[dir] .dokuwiki #config__manager fieldset table tr:nth-child(odd) {
    background-color: @ini_background_alt;
}

/* PLUGINS
----------------------------------------------- */

/* -- Blockquote -- */

[dir] blockquote.blockquote-plugin {
    background-color: @ini_background_alt;
}

[dir=ltr] blockquote.blockquote-plugin {
    border-color: transparent transparent transparent @ini_border;
}

[dir=rtl] blockquote.blockquote-plugin {
    border-color: transparent @ini_border transparent transparent;
}

/* -- Cloud -- */

@d: 15%; /* Percentage to desaturate the original color. */

@c0: @ini_link;
.dokuwiki div.cloud a.cloud1 { color: desaturate(@c0, 4 * @d); }
.dokuwiki div.cloud a.cloud2 { color: desaturate(@c0, 3 * @d); }
.dokuwiki div.cloud a.cloud3 { color: desaturate(@c0, 2 * @d); }
.dokuwiki div.cloud a.cloud4 { color: desaturate(@c0, 1 * @d); }
.dokuwiki div.cloud a.cloud5 { color: @c0; }

@c1: @ini_existing;
.dokuwiki div.cloud a.cloud1_tag1 { color: desaturate(@c1, 4 * @d); }
.dokuwiki div.cloud a.cloud2_tag1 { color: desaturate(@c1, 3 * @d); }
.dokuwiki div.cloud a.cloud3_tag1 { color: desaturate(@c1, 2 * @d); }
.dokuwiki div.cloud a.cloud4_tag1 { color: desaturate(@c1, 1 * @d); }
.dokuwiki div.cloud a.cloud5_tag1 { color: @c1; }

@c2: @ini_missing;
.dokuwiki div.cloud a.cloud1_tag2 { color: desaturate(@c2, 4 * @d); }
.dokuwiki div.cloud a.cloud2_tag2 { color: desaturate(@c2, 3 * @d); }
.dokuwiki div.cloud a.cloud3_tag2 { color: desaturate(@c2, 2 * @d); }
.dokuwiki div.cloud a.cloud4_tag2 { color: desaturate(@c2, 1 * @d); }
.dokuwiki div.cloud a.cloud5_tag2 { color: @c2; }

@c3: @ini_yellow_color;
#namespaced__widget_search div.cloud a.cloud1 { color: desaturate(@c3, 4 * @d); }
#namespaced__widget_search div.cloud a.cloud2 { color: desaturate(@c3, 3 * @d); }
#namespaced__widget_search div.cloud a.cloud3 { color: desaturate(@c3, 2 * @d); }
#namespaced__widget_search div.cloud a.cloud4 { color: desaturate(@c3, 1 * @d); }
#namespaced__widget_search div.cloud a.cloud5 { color: @c3; }

/* -- WRAP -- */

/* Style Wrap's basic boxes a bit like many DW blocks (code and file mostly)... */
div.wrap_box,
span.wrap_box {
    color: @ini_text_alt;
}
[dir] div.wrap_box, [dir] span.wrap_box {
    background-color: @ini_background_alt;
}

/* ...with a slight diff√©rence */
[dir] div.wrap_box {
    border-top-color: @ini_border;
}

[dir] div.wrap_info, [dir] div.wrap_notice {
    background-color: @ini_blue_color;
}
[dir] span.wrap_info, [dir] span.wrap_notice {
    background-color: mix(#fff, @ini_blue_color, 40%);
}

[dir] div.wrap_tip, [dir] div.wrap_caution {
    background-color: @ini_yellow_color;
}
[dir] span.wrap_tip, [dir] span.wrap_caution {
    background-color: mix(#fff, @ini_yellow_color, 50%);
}

[dir] div.wrap_alert, [dir] div.wrap_danger {
    background-color: @ini_red_color;
}
[dir] span.wrap_alert, [dir] span.wrap_danger {
    background-color: mix(#fff, @ini_red_color, 30%);
}

[dir] div.wrap_download, [dir] div.wrap_safety {
    background-color: @ini_green_color;
}
[dir] span.wrap_download, [dir] span.wrap_safety {
    background-color: mix(#fff, @ini_green_color, 30%);
}

[dir] div.wrap_important, [dir] div.wrap_warning {
    background-color: mix(@ini_red_color, @ini_yellow_color, 50%);
}
[dir] span.wrap_important, [dir] span.wrap_warning {
    background-color: mix(#fff, mix(@ini_red_color, @ini_yellow_color, 50%), 50%);
}

[dir] div.wrap_help {
    background-color: mix(@ini_red_color, @ini_blue_color, 50%);
}
[dir] span.wrap_help {
    background-color: mix(#fff, mix(@ini_red_color, @ini_blue_color, 50%), 50%);
}

[dir] div.wrap_todo {
    background-color: mix(@ini_green_color, @ini_blue_color, 50%);
}
[dir] span.wrap_todo {
    background-color: mix(#fff, mix(@ini_green_color, @ini_blue_color, 50%), 50%);
}

[dir] span.wrap_hi {
    background-color: @ini_highlight;
}

span.wrap_em {
    color: @ini_red_color;
}

/* BOX LAYOUT
-------------------------------------------------------------- */

@media screen and (min-width: @ini_site_width + 62px) {
    [dir] body.box-layout, [dir] body.mix-layout {
        background-color: @ini_body_background;
        background-image: initial;
    }
}