span.term {
    cursor: help;
    text-decoration: none;
    border-bottom: 2px rgba(51,51,51,0.70) dotted;
}

section.content span.term::after {
    content: "?";
    vertical-align: super;
    font-size: small;
}

div.termbank span.term {
    border-bottom: 2px #333 dotted;
}

li.term-list-item {
    margin-bottom: 4px;
}

div.term-description {
    display: none;
    position: fixed;
    z-index: 3;
    text-align: left;
    font-weight: normal;
    font-style: normal;
    line-height: normal;
    background: #eee;
    color: #222;
    font-size: 0.9rem;
    padding: 5px 5px;
    border: 0.5px solid #ccc;
    left: 0;
    top: 0;
    min-width: 22px;
    -webkit-box-shadow: 1px 1px 8px 2px rgba(0,0,0,0.75);
    -moz-box-shadow: 1px 1px 8px 2px rgba(0,0,0,0.75);
    box-shadow: 1px 1px 8px 2px rgba(0,0,0,0.75);
    -webkit-border-radius: 1px;
    -webkit-border-top-left-radius: 2px;
    -moz-border-radius: 1px;
    -moz-border-radius-topleft: 2px;
    border-radius: 1px;
    border-top-left-radius: 2px;
}

div.term-description-left-aligned {
    border-radius: 1px;
    border-top-right-radius: 2px;
}

/* The grace area to allow smooth mouseenter */
div.term-grace-area {
    position: absolute;
    z-index: -1;
    top: 0;
    left: 0;
    width: calc(100% + 20px);
    height: calc(100% + 20px);
    background: transparent;
    margin: -10px;
}

/* The arrow */
div.term-description:before {
    content: ' ';
    height: 0;
    position: absolute;
    width: 0;
    top: -18px;
    left: 0px;
    border: 9px solid transparent;
    border-bottom-color: #ccc;
}

div.term-description:after {
    content: ' ';
    height: 0;
    position: absolute;
    width: 0;
    top: -17.5px;
    left: 0px;
    border: 9px solid transparent;
    border-bottom-color: #eee;
}

/* The arrow for left aligned description */
div.term-description-left-aligned:before {
    left: auto;
    right: 0px;
}

div.term-description-left-aligned:after {
    left: auto;
    right: 0;
}

/* The arrow for top aligned description */
div.term-description-top-aligned {
    border-radius: 1px;
    border-bottom-left-radius: 2px;
}
div.term-description-top-aligned.term-description-left-aligned {
    border-radius: 1px;
    border-bottom-right-radius: 2px;
}
div.term-description-top-aligned:before {
    top: auto;
    bottom: -18px;
    border-top-color: #ccc;
    border-bottom-color: transparent;
}

div.term-description-top-aligned:after {
    top: auto;
    bottom: -17px;
    border-top-color: #eee;
    border-bottom-color: transparent;
}


div.term-desc-contents {
    max-height: 400px;
    max-width: 500px;
    overflow-y: hidden;
}

div.term-desc-contents :last-child {
    margin-bottom: 0;
}

div.term-desc-contents :first-child {
    margin-top: 0;
}

/* The tags */
span.term-tag {
    background: #d4d4d4;
    font-size: 0.6rem;
    color: #444;
    padding: 1px 2px;
    border: 1px inset rgba(224, 224, 224, 0.60);
    border-radius: 6px;
    margin-top: 3px;
    float: right; /* TODO: replace with flex? */
}

/* The tabs */
/* TODO: implement without the !importants */
ol.term-tab-titles {
    margin-left: 0 !important;
    padding-left: 0 !important;
    border-bottom: 2px solid #ccc !important;
    margin-bottom: 4px !important;
}
ol.term-tab-titles > li {
    margin-left: 0 !important;
    padding-left: 0 !important;
    display: inline !important;
    cursor: pointer !important;
    color: #666;
    border-right: 2px solid #ccc !important;
    padding-right: 4px !important;
    margin-right: 4px !important;
}
ol.term-tab-titles > li:last-child {
    border: 0 !important;
    margin-right: 0 !important;
}
li.term-tab-active {
    color: #222 !important;
    font-weight: bold !important;
}

/* The links */
div.term-description > ul {
    border-top: 2px solid #ccc;
    margin: 5px 0 0 0;

}
div.term-description > ul > li {
    margin: 5px 0 0 12px;
    padding: 0;
    list-style-type: square;
}

/* Copied from style.css */

div.term-description h1, div.term-description h2, div.term-description h3, div.term-description h4, div.term-description h5, div.term-description h6 {
    font-family: "Trebuchet MS", "Helvetica", sans-serif;
    font-weight: normal;
    letter-spacing: 0.05em;
    word-spacing: 0.1em;
}

div.term-description span.anchor-offset {
    width: 0;
    height: 0;
    padding-top: 4rem;
    margin-top: -4rem;
    display: none;
}

div.term-description h1:first-child, div.term-description h2:first-child, div.term-description h3:first-child, div.term-description h4:first-child, div.term-description h5:first-child, div.term-description h6:first-child, .task-meta-container + h1, .task-meta-container + h2, .task-meta-container + h3, .task-meta-container + h4, .task-meta-container + h5, .task-meta-container + h6 {
    margin-top: 0 !important;
}

div.term-description h1 {
    margin-top: 1em;
    font-size: 1.5em;
    letter-spacing: 0.07em;
    word-spacing: 0.2em;
    padding-bottom: 2px;
    border-bottom: 1px solid #888;
    margin-bottom: 1em;
    text-shadow: rgba(63, 63, 63, 0.5) 1px 1px 1px;
}

div.term-description h2 {
    font-size: 1.3em;
    margin-top: 1em;
    margin-bottom: 0.5em;
    text-shadow: rgba(63, 63, 63, 0.5) 1px 1px 1px;
    font-weight: bold;
}

div.term-description h3 {
    font-size: 1.25em;
    margin-top: 1em;
    margin-bottom: 0.5em;
    text-shadow: rgba(63, 63, 63, 0.5) 1px 1px 1px;
}

div.term-description h4 {
    font-size: 1.2em;
    letter-spacing: 0.03em;
    word-spacing: 0.07em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

div.term-description h5 {
    font-size: 1.1em;
    margin-bottom: 0.5em;
}

div.term-description h6 {
    font-size: 1.0em;
    margin-bottom: 0.5em;
    font-weight: bold;
}

div.term-description figure {
    margin-top: 0.5em;
    margin-left: 0.5em;
    margin-bottom: 1em;
    display: table;
    width: 1px;
}
    
div.term-description img.content-img {
    margin-top: 0.5em;
    margin-left: 0.5em;
    margin-bottom: 1em;
    display: block;
}
 
div.term-description img.figure-img {
    display: block;
}

div.term-description figcaption {
    display: table-caption;
    caption-side: bottom;
}

div.term-description .centered-block-outer {
    overflow: hidden;
    position: relative;
}
 
div.term-description .centered-block-middle {
    float: left;
    position: relative;
    left: 50%;
}
 
div.term-description .centered-block-inner {
    position: relative;
    left: -50%;
}

div.term-description hr {
    margin-bottom: 1em;
    border: 0;
    height: 1px;
    background: #666;
    background-image: -moz-linear-gradient(left, #999, #666, #999);
}

div.term-description div.paragraph {
    margin-bottom: 0.4em;
}
div.term-description div.paragraph:last-child {
    margin-bottom: 0;
}

div.term-description div.normal {
    margin-bottom: 15px;
    margin-right: 15px;
}

div.term-desc-contents ul, div.term-desc-contents ol {
    margin-left: 1.5em;
    margin-bottom: 5px;
}
div.term-desc-contents div.paragraph + ul,
div.term-desc-contents div.paragraph + ol {
    top: 0;
}

div.term-desc-contents ul > li, div.term-desc-contents ol > li {
    margin-left: 0;
    margin-bottom: 2px;
    padding-left: 5px;
    list-style-type: disc;
}
div.term-desc-contents ul ul > li {
    list-style-type: circle;
}
div.term-desc-contents ul ul ul > li {
    list-style-type: square;
}

div.term-desc-contents ul ul,
div.term-desc-contents ul ol,
div.term-desc-contents ol ol,
div.term-desc-contents ol ul {
    margin-left: 1.5em;
    margin-bottom: 0;
}

div.term-description div.tex {
    margin-left: 8em;
}

div.term-description table {
    border-collapse: collapse;
    border: 1px solid #8a8;
    margin-bottom: 5px;
}

div.term-description table th, div.term-description table td {
    border: 1px solid #8a8;
    padding: 2px 4px 2px 4px;
}

div.term-description div.paragraph code, div.term-description table * code,
div.term-description ul * code, div.term-description ol * code {
    font-family: "Inconsolata", "Lucida Console", "DejaVu Sans Mono", monospace;
    background: #e2e2e2;
    font-size: 1em;
    padding: 0 1px;
    border: 1px solid #cacaca;
    border-radius: 3px;
    box-shadow: inset 0 0 5px #cacaca;
    white-space: nowrap;
}

div.term-description * a {
    padding: 0 1px;
    margin-left: -1px;
    margin-right: -1px;
    color: #143a14;
}

div.term-description * a:visited {
    color: #ad3939;
}

div.term-description * a:hover {
    color: #222;
    background-color: #59cd59;
    border-radius: 3px;
}

div.term-description div.paragraph mark {
    background: #59cd59;
    border-radius: 7px;
    padding: 2px 4px;
}

div.term-description kbd { /* .key */
    padding: 4px 3px;
    margin-right: 1px;
    border: 1px solid #c6c6c6;
    border-radius: 3px;
    box-shadow: 1px 1px 1px rgba(127, 127, 127, 0.2), inset 0 0 6px #fff;
    background: #eee;
}

div.term-description form.feedback {
}

div.term-description div.question {
    margin-bottom: 0;
}

div.term-description form.task {
    width: 100%;
}

div.term-description pre.normal {
    font-family: "Inconsolata", "Lucida Console", "DejaVu Sans Mono", monospace;
    background: #e2e2e2;
    font-size: 1em;
    padding: 2px 4px;
    border: 1px solid #cacaca;
    border-radius: 3px;
    box-shadow: inset 0 0 3px #cacaca;
    line-height: 1.15;

    white-space: pre;
    overflow-x: auto;
    width: auto;
    margin-bottom: 0.25em;
}

div.term-description pre.normal code {
    font-family: inherit;
}

div.term-description div.markup-error {
    font-weight: bold;
    color: red;
    border: 2px dashed red;
    padding: 4px 8px;
    margin-bottom: 1rem;
}
