@import 'mediawiki.mixins.less';
@import 'variables.less';

@font-face {
    font-family: 'Palanquin';
    src: url('fonts/Palanquin-Regular.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'Palanquin';
    src: url('fonts/Palanquin-Bold.woff') format('truetype');
    font-weight: bold;
    font-style: normal;
}
/* Hide, but keep accessible for screen-readers */
#p-personal h3,
.vectorTabs h3,
#p-search h3,
#footer h2,
#mw-navigation h2 {
	position: absolute;
	top: -9999px;
}

.mw-jump:not( :focus ) {
	.mixin-screen-reader-text;
}

@import 'dropdowns.less';
@import 'search.less';

html,
body {
    margin: 0;
    padding: 0;
    min-width: 320px;
    color: @text-color;
    background-color: @footer-background-color !important;
    font-family: Palanquin, sans-serif !important;
    font-size: 16px !important;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

a {
    text-decoration: none;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    border-bottom: 0;
    color: @text-color;
    font-family: Palanquin, sans-serif !important;
    font-weight: bold;
}

fieldset {
    border: 0;
    border-top: 1px solid @ui-background-color;
}

header {
    background-color: @brand-primary;
    height: auto;
    min-height: 60px;

    @media (min-width: 900px) {
        height: 129px;
    }

    &.fixed {
        width: 100%;
        z-index: 100;
        box-shadow: 0 0 6px 1px rgba(0, 0, 0, 0.2);

        &:not(.nav-toggled) {
            height: 60px;

            .mainnav li a {
                line-height: 60px;
            }
        }

        @media (min-width: 576px) {
            position: fixed;
            top: 0;
        }

        div#mw-panel {
            #p-logo {
                width: 169px;
                height: 60px;
                margin: 0;
                padding: 0;

                a {
                    width: 169px;
                    height: 60px;
                }
            }

            .nav-toggle {
                top: 10px;
            }
        }
    }
}

header.fixed + .main-wrapper {
    padding-top: 129px;
}

// this should avoid that anchors are obscured by the fixed header
:target::before {
    content: '';
    display: block;
    height: 60px; /* fixed header height*/
    margin-top: -60px; /* negative fixed header height */
    visibility: hidden;
}

header div#mw-panel,
header #p-logo {
    position: static;
}

header div#mw-panel {
    padding: 0;
    width: 100%;
    height: 100%;
    max-width: 1000px;
    margin: auto;

    #p-logo {
        width: 169px;
        height: 60px;
        padding: 0;
        transition: 0.2s ease;

        @media (min-width: 576px) {
            width: 307px;
            height: auto;
            padding: 10px 0;
        }

        @media (min-width: 900px) {
            float: left;
            margin: 10px 0;
            padding: 0;
            height: 109px;
        }

        a {
            background-size: contain;
            width: 169px;
            height: 60px;

            @media (min-width: 576px) {
                width: 307px;
                height: 109px;
            }
        }
    }

    .nav-toggle {
        padding: 4px 14px;
        font-size: 1.25rem;
        line-height: 1;
        background-color: lighten(@brand-primary, 5%);
        border: 1px solid transparent;
        border-radius: 0.25rem;
        color: @text-color;
        cursor: pointer;
        position: absolute;
        width: 55px;
        height: 40px;
        right: 15px;
        top: 10px;

        &:hover {
            background-color: lighten(@brand-primary, 7%);
        }

        .hamburger {
            position: absolute;
            width: 100%;
            height: 100%;
            top: 4px;
            left: 14px;

            span {
                width: 25px;
                height: 2px;
                margin: 6px 0;
                display: block;
                background-color: @nav-toggle-color;
                border-radius: 2px;
                transition: 0.25s ease-in-out;
                box-sizing: border-box;

                &:nth-child(1) {
                    transition-delay: 0.5s;
                }
                &:nth-child(2) {
                    transition-delay: 0.625s;
                }
                &:nth-child(3) {
                    transition-delay: 0.75s;
                }
            }
        }
        .cross {
            position: absolute;
            height: 40px;
            width: 40px;
            top: 0;
            left: 7px;
            transform: rotate(45deg);

            span {
                display: block;
                background-color: @nav-toggle-color;
                border-radius: 2px;
                transition: 0.25s ease-in-out;
                box-sizing: border-box;

                &:nth-child(1) {
                    height: 0;
                    width: 2px;
                    position: absolute;
                    top: 5px;
                    left: 18px;
                    transition-delay: 0s;
                }
                &:nth-child(2) {
                    width: 0;
                    height: 2px;
                    position: absolute;
                    left: 4px;
                    top: 19px;
                    transition-delay: 0.25s;
                }
            }
        }

        @media (min-width: 576px) {
            top: 43px;
        }

        @media (min-width: 900px) {
            display: none;
        }

        @media (max-width: 320px) {
            position: relative;
            float: right;
            margin-right: 15px;
        }
    }
}

header.nav-toggled div#mw-panel {
    .nav-toggle {
        .hamburger {
            span {
                width: 0;
                &:nth-child(1){
                    transition-delay: 0s;
                }
                &:nth-child(2){
                    transition-delay: 0.125s;
                }
                &:nth-child(3){
                    transition-delay: 0.25s;
                }
            }
        }

        .cross {
            span {
                &:nth-child(1) {
                    height: 30px;
                    transition-delay: 0.625s;
                }
            }
            span {
                &:nth-child(2) {
                    width: 30px;
                    transition-delay: 0.375s;
                }
            }
        }
    }
}

#jump-to-nav {
    background-color: white;
    position: absolute;
    top: 0;
    left: 0;
    margin: 0;
    padding: 0 10px;

    a {
        line-height: 40px;
    }
}

.main-wrapper {
    background-color: #fff;
}

main.mw-body {
    border: 0;
    display: block;
    color: @text-color;
    max-width: 1000px;
    margin: auto;
    font-size: 1.18em;
    padding-top: 20px;
    padding-bottom: 40px;

    @media (min-width: 576px) {
        padding-top: 50px;
        padding-bottom: 80px;
    }

    .mw-body-content {
        p {
            margin: 1em 0;
        }

        a {
            color: darken(@brand-primary, 60%);
            text-decoration: underline;

            &:visited {
                color: desaturate(darken(@brand-primary, 40%), 10%);
            }

            &:focus,
            &:active {
                color: darken(@brand-primary, 80%);
            }

            &.external {
                padding-right: 0;
                background-image: none;
            }

            &.new {
                color: @new-link-color;
            }
        }

        ul {
            list-style: none;
            list-style-image: none;

            li {
                position: relative;

                &::before {
                    content: '';
                    display: block;
                    width: 5px;
                    height: 5px;
                    border-radius: 20px;
                    background-color: @text-color;
                    position: absolute;
                    top: 12px;
                    left: -15px;
                }
            }
        }

        #toc,
        #mw-normal-catlinks {
            & ul li::before {
                width: 0;
            }
        }
    }
}

#mw-personal #p-personal {
    position: static;
}

.logo {
    background-image: url('img/logo.png');
}

.mainnav {
    margin: 0;
    list-style: none;
    height: 100%;
    border-top: 1px solid desaturate(darken(@brand-primary, 20%), 10%);
    border-bottom: 1px solid transparent;
    display: none;

    @media (min-width: 900px) {
        display: flex !important;
        align-items: stretch;
        margin-left: 350px;
        border: 0;
    }

    li {
        display: block;
        height: 100%;

        @media (min-width: 900px) {
            display: inline-block;
        }

        a {
            display: block;
            color: @text-color;
            font-size: 1.1em;
            padding: 10px 20px;

            &:hover,
            &:focus {
                text-decoration: none;
                background-color: darken(@brand-primary, 5%);
            }

            @media (min-width: 900px) {
                height: 129px;
                text-align: center;
                font-size: 1.2em;
                min-width: 70px;
                line-height: 129px;
                padding: 0 10px;

                span {
                    display: inline-block;
                    vertical-align: middle;
                    line-height: 1.2em;
                    margin-top: -10px;
                }
            }
        }
    }
}

header.fixed .mainnav li a {
    @media (min-width: 900px) {
        height: 60px;
        line-height: 60px;
    }
}

footer {
    max-width: 1000px;
    margin: auto;
    padding: 30px 1.5em;
    color: @footer-text-color;

    ul {
        list-style: none none;
        margin: 0;
        padding: 0;
    }

    li {
        color: @color-base;
        margin: 0;
        padding: 0.5em 0;
        font-size: @font-size-footer;
    }

    .first-row,
    .second-row {
        margin-bottom: 20px;

        @media (min-width: 768px) {
            display: flex;
            flex-direction: row-reverse;
            margin-bottom: 30px;
        }
    }

    .third-row {
        margin-bottom: 20px;

        @media (min-width: 768px) {
            display: flex;
            margin-bottom: 30px;
        }
    }

    a,
    a:visited {
        color: @footer-text-color;
    }

    a:active {
        color: darken(@footer-text-color, 30%);
    }

    a.new,
    #p-personal a.new {
        color: lighten(@new-link-color, 20%);
    }

    #footer-info {
        list-style: none;
        margin: 0;
        font-size: 0.9em;
        width: 100%;

        li {
            color: white;
        }

        @media (min-width: 768px) {
            width: 50%;
        }
    }

    #mw-personal {
        width: 100%;
        margin-bottom: 10px;

        @media (min-width: 768px) {
            width: 50%;
            margin-bottom: 0;

            #p-personal {
                text-align: right;
            }
        }

        #p-personal {
            ul {
                padding-left: 0;
            }

            li {
                float: none;
                font-size: 0.9em;
                display: inline-block;

                &:first-of-type {
                    margin-left: 0;
                }

                &.active a {
                    text-decoration: underline;
                }
            }
        }

        #pt-userpage {
            background-image: none;
            padding-left: 0 !important;
        }
    }

    div.vectorTabs {
        background-image: none;
        float: none;
        height: inherit;

        ul {
            background-image: none;
            float: none;

            & > li {
                display: inline-block;
            }

            li {
                background-color: transparent;
                background-image: none;
                float: none;

                a {
                    color: @footer-text-color;
                    font-size: 0.9em;
                    height: inherit;
                    padding-right: 0;
                    padding-left: 1em;
                }

                &:first-of-type a {
                    padding-left: 0;
                }

                &.new a {
                    color: @new-link-color;
                }

                &.selected {
                    background-image: none;

                    a {
                        color: @footer-text-color !important;
                        text-decoration: underline;
                    }
                }
            }
        }

        span {
            background-image: none;

            a {
                padding-top: 0;
            }
        }
    }

    div.vectorMenu {
        float: none;

        h3 {
            font-size: 0.9em;

            a {
                right: -5px;
                height: 1.6em;
            }
        }

        &.menuForceShow h3 a {
            background-position: 100% 70%;
        }

        h3 span {
            padding-left: 1em;
            padding-top: 0;
            color: @footer-text-color;
            font-size: inherit;
        }

        li a {
            color: @footer-background-color;
            padding: 0.8em 1.3em;
        }

        div.menu {
            top: 1.7em;
            background-color: lighten(@brand-secondary, 20%);
            border: 0;
        }
    }

    #left-navigation,
    #right-navigation,
    #p-search {
        float: none;
        margin: 0;
    }

    #search,
    .page-nav {
        width: 100%;

        @media (min-width: 768px) {
            width: 50%;
        }
    }

    #search {
        #searchform,
        #simpleSearch {
            margin-top: 0;
        }

        #simpleSearch {
            height: inherit;
            background-color: @footer-text-color;
            border-color:darken(@footer-text-color, 20%);
            background-image: none;
            color: @brand-secondary;
            padding: 5px 10px;
            width: 80%;
            max-width: none;
            box-sizing: border-box;
            margin-top: 5px;

            @media (max-width: 900px) {
                width: 100%;
            }

            @media (max-width: 768px) {
                margin-top: 15px;
            }

            #searchInput {
                color: @brand-secondary;
                font-size: inherit;
                padding-right: 2em;
            }

            #searchButton {
                width: 2.5em;
                top: 1px;
            }
        }
    }

    .page-nav {
        @media (min-width: 768px) {
            text-align: right;
        }

        #p-cactions,
        #p-views {
            display: inline-block;
        }

        #p-cactions {
            h3 {
                margin-bottom: 0;
                padding: 0;
                position: relative;
                top: 3px;
            }
        }
    }

    .powered-by {
        text-align: right;
        font-size: 0.9em;

        &,
        a,
        a:visited {
            color: lighten(@brand-secondary, 30%);
        }
    }

    .third-row {
        & > .portal:not(:first-child) {
            @media (min-width: 768px) {
                margin-left: 40px;
            }
        }
    }

    .portal {
        h3 {
            color: @footer-text-color;
        }

        .body {
            ul {
                list-style: none;
                margin: 0;
            }
        }
    }
}

.suggestions {
    .suggestions-results,
    .suggestions-special {
        background-color: @footer-text-color;
    }

    .suggestions-result-current {
        background-color: lighten(@brand-secondary, 40%);
        color: @footer-text-color;
    }
}

.search-types {
    ul li::before {
        width: 0 !important;
    }
}

.mw-ui-button.mw-ui-progressive,
.mw-ui-button.mw-ui-constructive {
    color: @ui-button-color;
    background-color: @ui-background-color;
    border: 1px solid @ui-background-color;

    &:hover {
        background-color: @ui-background-color-hover;
        border: 1px solid @ui-background-color-hover;
    }

    &:active {
        background-color: @ui-background-color-active;
        border: 1px solid @ui-background-color-active;
    }

    &:focus {
        box-shadow: inset 0 0 0 1px @ui-background-color,inset 0 0 0 2px #fff;
    }
}

.mw-ui-input:focus {
    border-color: @ui-background-color;
    box-shadow: inset 0 0 0 1px @ui-background-color;
}

.oo-ui-textInputWidget.oo-ui-widget-enabled input:focus,
.oo-ui-textInputWidget.oo-ui-widget-enabled textarea:focus {
    border-color: @ui-background-color;
    box-shadow: inset 0 0 0 1px @ui-background-color;

}

.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:hover + span,
.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:focus:hover + span {
    border-color: @ui-background-color;
}

.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:active + span,
.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:active:focus + span {
    background-color: @ui-background-color-active;
    border-color: @ui-background-color-active;
    box-shadow: inset 0 0 0 1px @ui-background-color-active;
}

.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:focus + span {
    border-color: @ui-background-color;
    box-shadow: inset 0 0 0 1px @ui-background-color;
}

.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:checked + span {
    background-color: @ui-background-color;
    border-color: @ui-background-color;
}

.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:checked:hover + span,
.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:checked:focus:hover + span {
    background-color: @ui-background-color-hover;
    border-color: @ui-background-color-hover;
}

.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:checked:focus + span {
    background-color: @ui-background-color-hover;
    border-color: @ui-background-color-hover;
    box-shadow: inset 0 0 0 1px @ui-background-color-hover,inset 0 0 0 2px #fff;
}

.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:checked:active + span,
.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:checked:active:hover + span,
.oo-ui-checkboxInputWidget.oo-ui-widget-enabled [type="checkbox"]:checked:active:focus + span {
    background-color: @ui-background-color-active;
    border-color: @ui-background-color-active;
    box-shadow: inset 0 0 0 1px @ui-background-color-active;
}

.oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-constructive > .oo-ui-buttonElement-button {
    color: @ui-button-color;
    background-color: @ui-background-color;
    border-color: @ui-background-color;
}

.oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-constructive > .oo-ui-buttonElement-button:hover {
    background-color: @ui-background-color-hover;
    border-color: @ui-background-color-hover;
}

.oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-constructive > .oo-ui-buttonElement-button:active,
.oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-constructive > .oo-ui-buttonElement-button:active:focus,
.oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-constructive.oo-ui-buttonElement-pressed > .oo-ui-buttonElement-button,
.oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-constructive.oo-ui-buttonElement-active > .oo-ui-buttonElement-button,
.oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-constructive.oo-ui-popupToolGroup-active > .oo-ui-buttonElement-button {
    color: @ui-button-color;
    background-color: @ui-background-color-active;
    border-color: @ui-background-color-active;
}

.oo-ui-buttonElement-framed.oo-ui-widget-enabled.oo-ui-flaggedElement-primary.oo-ui-flaggedElement-constructive > .oo-ui-buttonElement-button:focus {
    border-color: @ui-background-color;
    box-shadow: inset 0 0 0 1px @ui-background-color,inset 0 0 0 2px #fff;
    outline: 0;
}

.oo-ui-buttonElement-framed.oo-ui-widget-enabled > .oo-ui-buttonElement-button:focus {
    border-color: @ui-background-color;
    box-shadow: inset 0 0 0 1px @ui-background-color;
}

.client-js #preferences > fieldset {
    border: 0;
    padding: 0;
    margin: 1em;

    & > legend {
        display: none;
    }
}

#preftoc {
    li::before {
        width: 0;
    }

    li {
        display: inline-block;
        margin-bottom: 0;

        a {
            color: @text-color;
            display: block;
            text-decoration: none;
            padding: 10px 15px;
        }

        &.selected {
            background-color: @brand-primary;
        }
    }

    border-bottom: 1px solid @ui-background-color;
    margin-left: 0;
}

#mw-notification-area {
    top: 129px;
}

.header-fixed #mw-notification-area {
    top: 60px;
}

main.mw-body .mw-body-content .toc {
    a {
        text-decoration: none;
    }

    .toctitle a:hover,
    .toctext:hover {
        text-decoration: underline;
    }
}

.mw-content-ltr .tocnumber {
    padding-right: 0.8em;
}

#toc, .toc {
    padding: 15px;
}

.noautonum .tocnumber {
    display: none;
}

.osmf-box-primary {
    border: 1px solid darken(@brand-primary, 10%);
    background-color: @brand-primary;
    padding: 7px 12px;

    a {
        color: @text-color !important;
    }
}

.osmf-center {
    text-align: center;
}

.osmf-box-corporate {
    border: 10px solid lighten(@brand-secondary, 40%);
    margin: 15px 0;

    .osmf-box-corporate-title {
        text-align: center;
        background-color: lighten(@brand-secondary, 40%);
        padding: 10px 8px;
        font-size: 1.8em;
    }

    .osmf-box-corporate-title,
    .osmf-box-corporate-members {
        margin: 2px;
    }

    .osmf-box-corporate-members {
        display: flex;
        flex-wrap: wrap;
        align-items: center;

        .osmf-box-corporate-member {
            width: 45%;
            text-align: center;
            padding: 25px 15px;

            @media (max-width: 900px) {
                width: 100%;
            }
        }
    }
}

.osmf-box-corporate.corporate-platinum {
    border-color: @corporate-platinum;

    .osmf-box-corporate-title {
        background-color: @corporate-platinum;
    }
}

.osmf-box-corporate.corporate-gold {
    border-color: @corporate-gold;

    .osmf-box-corporate-title {
        background-color: @corporate-gold;
    }
}

.osmf-box-corporate.corporate-silver {
    border-color: @corporate-silver;

    .osmf-box-corporate-title {
        background-color: @corporate-silver;
    }
}

.osmf-box-corporate.corporate-bronze {
    border-color: @corporate-bronze;

    .osmf-box-corporate-title {
        background-color: @corporate-bronze;
    }
}

.osmf-box-corporate.corporate-supporter {
    border-color: @corporate-supporter;

    .osmf-box-corporate-title {
        background-color: @corporate-supporter;
    }

    .osmf-box-corporate-member a,
    .osmf-box-corporate-member a:active,
    .osmf-box-corporate-member a:visited {
        color: @text-color;
        text-decoration: none;
        font-size: 1.35em;
    }
}

table.wikitable {
    color: @text-color;
    border-color: darken(@brand-primary, 20%) !important;
    background-color: transparent !important;

    & > tr > th,
    & > tr > td,
    & > * > tr > th,
    & > * > tr > td {
        padding: 5px 10px;
        border: 0;
        background-color: transparent;
    }

    & > tr > th,
    & > * > tr > th {
        background-color: @brand-primary;
        border-bottom: 1px solid darken(@brand-primary, 20%);
    }

    & > tr:not(:last-of-type) > td,
    & > * > tr:not(:last-of-type) > td {
        border-bottom: 1px solid darken(@brand-primary, 10%);
    }
}

#toc,
.toc,
.mw-warning,
.toccolours,
.catlinks {
    background-color: lighten(@brand-secondary, 80%);
    border-color: lighten(@brand-secondary, 70%);
}

/* Logo */
#p-logo {
	width: 10em;
	height: 160px;

	a {
		display: block;
		width: 10em;
		height: 160px;
		background-repeat: no-repeat;
		background-position: center center;
		text-decoration: none;
	}
}
