/** General Theme **/

strong {
    color: #ac4901;
}

b {
    color: #0169c1;
}

dl dt {
    display: inline;
    padding: 0.25rem 0.4rem;
    background: #4e4e4e;
    color: #eaeaea;
    border-radius: 0.25rem;
}

dl dd {
    border-bottom-left-radius: .5rem;
    border-left: 3px solid #4e4e4e;

    margin-bottom: 0.9rem;
    padding-left: 0.618rem;
    padding-top: 0.618rem;
    padding-bottom: 0.309rem;
    position: relative;
    top: -0.5rem;
}

dl dd:hover {
    border-top-right-radius: .5rem;
    border-right: 3px solid #4e4e4e;
}

dd p {
    margin-bottom: 0.7em;
}

details summary {
    cursor: pointer;
}

.hidden {
    display: none;
}

/**********************************************************************************************************************/
/** FIX FOR DIAGRAMS **************************************************************************************************/

.mermaid foreignObject {
    overflow: auto;
}


/**********************************************************************************************************************/

/* Hotfix for https://github.com/getgrav/grav-theme-quark/issues/9 */
/* Must be below 3 or mobile will glitch
 */
section#header { z-index: 2; }

#header > .container {
    padding: 0;
}

#header .navbar-section:last-child {
    margin-right: 0 !important;
}

.navbar-section-layout {
    text-align: center;
}

/* Little fix for the anchors plugin */
.anchorjs-link {
    font-size: 0.8em !important;
    color: #80839a;
}

/* Ensures the footer stays on the bottom of the page */
#page-wrapper {
    min-height: calc(100vh - 3rem);
}

/* Fixed height footer */
#footer {
    height: 3rem;
}
#footer p {
    margin-bottom: 0;
}
#footer .ljbac {
    color: #d632a8;
}
#footer .ljbac:hover,
#footer .ljbac:focus {
    color: #b72b90;
}


iframe.geogebra {
    border: 1px dotted #a6a6a6;
}

/** Desktop header navigation *****************************************************************************************/

/*nav.dropmenu > ul > li > ul > li {*/
/*    font-size: 0.8em;*/
/*}*/
/*nav.dropmenu > ul > li ul li a {*/
/*    min-width: 11rem;*/
/*}*/
/*nav.dropmenu ul {*/
/*    white-space: initial;*/
/*}*/

.mobile-menu {
    display: block;
}

.mobile-menu details[open] > summary ~ * {
    animation: sweep .4s ease-in-out;
}

@keyframes sweep {
    0%    {opacity: 0; margin-left: -10px}
    100%  {opacity: 1; margin-left: 0px}
}


/*.relative{position:relative!important}*/

/*#header {*/
/*    padding-right: 4em;*/
/*}*/

/*@media (max-width: 840px) {*/
/*    #header .navbar-section {*/
/*        margin-right: 0;*/
/*    }*/
/*}*/

/** Mobile navigation without javascript ******************************************************************************/
/** We're using the checkbox hack. **/

.mobile-menu .button_container {
    right: 50%;
}

.mobile-menu .button_container .top,
.mobile-menu .button_container .middle,
.mobile-menu .button_container .bottom {
    z-index: 3;
}

#mobile-navigation-toggle {
    cursor: pointer;
    width: 42px;
    height: 42px;
    position: absolute;
    /*right: 0.8em;*/
    right: 50%;
    right: calc(50% - 7px);
    top: 0.8em;
    z-index: 200;

    opacity: 0;
}

/*#mobile-navigation-toggle:focus ~ .mobile-menu .button_container {*/
/*    outline: 1px dotted darkcyan;*/
/*}*/
#mobile-navigation-toggle:focus ~ .mobile-menu .button_container .top,
#mobile-navigation-toggle:focus ~ .mobile-menu .button_container .middle,
#mobile-navigation-toggle:focus ~ .mobile-menu .button_container .bottom {
    background-color: #262d84;
}

#mobile-navigation-toggle:checked {
    position: fixed;
}

.mobile-menu .button_container:hover { opacity: .95; }

#mobile-navigation-toggle:checked ~ .mobile-menu .button_container { position: fixed; }

#mobile-navigation-toggle:checked ~ .mobile-menu .button_container .top { transform: translateY(8px) translateX(0) rotate(45deg); background: #FFF; }

#mobile-navigation-toggle:checked ~ .mobile-menu .button_container .middle { opacity: 0; background: #FFF; }

#mobile-navigation-toggle:checked ~ .mobile-menu .button_container .bottom { transform: translateY(-8px) translateX(0) rotate(-45deg); background: #FFF; }

#mobile-navigation-toggle:checked ~ .mobile-menu .button_container .overlay {
    visibility: visible;
    height: 100%;
    opacity: .95;
}


.mobile-menu details,
.mobile-menu ul {
    text-align: left;
    word-break: break-word;

    line-height: 1.8rem;
    font-size: 1.6rem;

    padding: 0;
    margin: 0;
}

.mobile-menu details {
    border-top: 1px solid #323232;
    border-left: 1px solid #323232;
    border-bottom: 1px solid #323232;
    border-top-left-radius: 0.618rem;
    padding-bottom: 0.1em;
}

/* Only works on webkit, duh. Can't find this for firefox */
.mobile-menu summary:focus::-webkit-details-marker {
    color: #fafafa;
}
.mobile-menu summary {
    border-right: 4px solid transparent;
}
.mobile-menu summary:focus {
    border-right: 4px solid #fafafa;
}

.mobile-menu li summary {
    padding: .4em 0.05em .2em 0.4em;
}

.mobile-menu li > a {
    padding: 0.2em 0.1em 0.3em 0.4em;
    display: block;
    border-top: 1px solid #323232;
    border-left: 1px solid #323232;
    border-bottom: 1px solid #323232;
}

.mobile-menu a.active {
    font-style: italic;
}

.mobile-menu ul {
    padding-left: 0.33rem;
    list-style: none;
}

/**********************************************************************************************************************/
/* Dropdown menus: language selector, lesson selector, etc. */
/* Showing/hiding is done in pure CSS below */

#language-selector-dropdown {
    /*margin: 0;*/
    /*visibility: hidden;*/
    /*display: block !important;*/
    /*animation: test_show 1.5s ease-in-out;*/
    /*animation-delay: 1s;*/
}

/*@keyframes test_show {*/
/*    0%    {display: block;}*/
/*    100%  {display: none;}*/
/*}*/

.dropdown-navigation {
    display: inline-block;
    white-space: nowrap;
}

/* Little patch for the language selector, to center it vertically. */
/* Beta feature : may cause bugs. We'll see. */
.dropdown-selector {
    -webkit-transform: initial !important;
    -moz-transform: initial !important;
    -o-transform: initial !important;
    -ms-transform: initial !important;
    transform: initial !important;
    /*margin-right: 0rem !important;*/
}

.dropdown-navigation {
    margin: 0 1rem;
}
.dropdown-selector {
    display: inline-block;
    background: #f93;
    /*float: right;*/
    /*position: relative;*/
    /*top: 50%;*/
    /*vertical-align: middle;*/
    /*-webkit-transform: translateY(-50%);*/
    /*-moz-transform: translateY(-50%);*/
    /*-o-transform: translateY(-50%);*/
    /*-ms-transform: translateY(-50%);*/
    /*transform: translateY(-50%);*/
}

.lessons-dropdown-navigation .dropdown-selector {
    margin: 0;
}


/*.dropdown-selector .btn {*/
/*.dropdown-selector > .btn:first-child {*/
.dropdown-menu-button {

    /*float: left;*/
    position: relative;
    display: inline-block;
    margin-left: 0;
    margin-bottom: 0;
    font-weight: 400;
    text-align: center;
    white-space: nowrap;
    vertical-align: middle;
    touch-action: manipulation;
    cursor: pointer;
    user-select: none;
    background-image: none;
    /* Size */
    padding: 5px 10px;
    font-size: 0.8rem;
    line-height: 1.5;
    border-radius: 3px;
    /* Aspect */
    color: #333;
    background-color: #fff;
    border: 1px solid #ccc;
}


/*#language-selector-button:hover ~ *,
#language-selector-button:focus ~ *,
#lesson-selector-button:hover ~ *,
#lesson-selector-button:focus ~ *,*/
/* class only won't work, we need an id here for some reason */
.dropdown-menu-button:hover ~ *,
.dropdown-menu-button:focus ~ * {
    display: block !important;
    visibility: visible !important;
}


.dropdown-selector .dropdown-menu {
    display: none; /* shown by hover or focus on elder sibling btn */
    position: absolute;

    /*top: 95%;*/
    /*right: -2.0rem;*/
    /*float: left;*/  /* no float if I can help it -- perhaps needed for browser compat */

    max-width: 90vw;
    z-index: 1000;
    padding: 5px 0;
    margin: 0;
    /*margin-top: -2px;*/
    font-size: 1rem;
    text-align: left;
    list-style: none;
    background-color: #fff;
    background-clip: padding-box;
    border-radius: 4px;
    box-shadow: 0 6px 12px rgba(0, 0, 0, .175);
}
.dropdown-selector .dropdown-menu.lesson-list {
    /* align the lesson list on the right of the screen */
    right: 2%;
}


/*#language-selector-dropdown:focus-within,
#language-selector-dropdown:hover,
#language-selector-dropdown:focus,
#lesson-selector-dropdown:focus-within,
#lesson-selector-dropdown:hover,
#lesson-selector-dropdown:focus,*/
/* same, id is required somehow -- try again later, smells like cache shenanigans */
/* nah, it was just BAD DESIGN © */

.dropdown-selector:focus-within .dropdown-menu, /* allows keyboard tabbing inside the menu */
.dropdown-selector .dropdown-menu:focus-within,
.dropdown-selector .dropdown-menu:hover,
.dropdown-selector .dropdown-menu:focus {
    display: block !important;
    visibility: visible !important;
}

/*@media screen and (max-width: 400px) {*/
/*    .dropdown-selector .dropdown-menu {*/
/*        max-width: 320px;*/
/*    }*/
/*}*/

.dropdown-selector .dropdown-menu img {
    width: 24px;
    height: 12px;
    max-width: inherit;
}

.dropdown-selector .dropdown-menu li {
    line-height: 1rem;
    /*text-color: #c0c0c0;*/
    display: list-item;
    text-align: -webkit-match-parent;
    overflow: hidden;
}

.dropdown-selector .dropdown-menu li:hover {
    background-color: #eee;
}

.dropdown-selector .dropdown-menu > li > a {
    display: block;
    padding: 3px 15px;
    /*clear: both;*/
    font-weight: 400;
    line-height: 1.42857143;
    /*color: #333;*/
    white-space: nowrap;

    /*overflow: hidden;*/

    /* hmmmm ; why not?    not working    needs more testing */
    /*text-overflow: ellipsis;*/
    /*-ms-text-overflow: ellipsis;*/
}

.dropdown-navigation-previous,
.dropdown-navigation-next {
    display: inline-block;
    width: 1.5em;
    /*height: 3em;*/
    /*background: #f39;*/
    /*font-size: 2em;*/
    /*line-height: 1em;*/
    /*font-size: 1em;*/
    text-align: center;
    vertical-align: center;
}

.dropdown-navigation-previous:hover,
.dropdown-navigation-previous:focus,
.dropdown-navigation-next:hover,
.dropdown-navigation-next:focus {
    font-weight: bolder;
    text-decoration: none;
    color: #0B61A4 !important;
}

/**********************************************************************************************************************/

