@import url("colors.css");

:root {
    --measure: 50rem;
    --gutters: 5rem;
    --s1: 2rem;
}

html {
    height: 100%;
}

body {
    font-family: Helvetica Neue, Helvetica, Arial, Verdana, Geneva, sans-serif;
    letter-spacing: -0.00278rem;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    height: 100%;
    margin-left: 2rem;
    margin-right: 2rem;
}

main {
    flex: 1;
    margin-top: 1rem;
}

footer {
    font-style: italic;
    text-align: center;
    margin-top: 10vh;
    padding-bottom: 5vh;
}

a, a:visited {
    color: var(--primary);  
}

a:hover {
    text-decoration-thickness: 2px;
}

em {
    font-weight: bold;
    font-style: inherit;
}

.hidden {
    display: none;
}
.center {
    box-sizing: content-box;
    margin-left: auto;
    margin-right: auto;
    max-width: var(--measure);
    padding-left: var(--gutters);
    padding-right: var(--gutters);
    display:flex;
    flex-direction: column;
    justify-content: center;
}

.with-sidebar {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s1);
}

.with-sidebar > :first-child {
    flex-grow: 1;
}

.with-sidebar > :last-child {
    flex-basis: 0;
    flex-grow: 999;
    min-width: 60%;
}

footer > * {
    font-size: smaller;
}

main.with-sidebar h2:first-of-type {
    margin-top: 0;
}

nav.secondary-nav h2 {
    font-size: medium;
    margin-top: .5rem !important;
}
nav.secondary-nav .score {
    font-size: smaller;
}
div.sponsorship {
    background-color: var(--softcomp) !important;
    border: none;
    font-style: italic;
}
div.sponsorship a {
    font-style: normal;
}
/* testing environment details */
ul.detailslist {
    list-style-type: none;
    width: 30rem;
    padding-left: 0;
    display: grid;
    gap: 0.25rem;
}
ul.detailslist.compact {
    width: 100%;
}
ul.detailslist > li {
    display: grid;
    grid-template-columns: 50% 50%;
    border-radius: 4px;
    border: thin var(--darkgray) solid;
}
ul.detailslist.compact li {
    border: none;
}
ul.detailslist li > span {
    display: block;
}
ul.detailslist li > span:first-child {
    background-color: var(--darkgray);
    color: white;
    font-weight: bold;
    padding-left: 0.5rem;
}
ul.detailslist li > span:last-child {
    padding-left: 1rem;
}
ul.detailslist.compact li span:first-child {
    display: none;
}
ul.detailslist > li ul {
    padding-left: 1rem;
    list-style-type: none;
}
/* alert message */
p.message {
    border-radius: 10px;
    vertical-align: middle;
    text-align: center;
    line-height: 2em;
    margin-bottom: 1vh;
    background-color: var(--message);
    grid-column-start: 1;
    grid-column-end: 4;
}

/* long blocks of text that scroll */
.limit {
    max-height: 30vh;
    /* overflow: scroll; */
    /* max-width: 40rem; */
    white-space: break-spaces;

    /* borrowed from https://dabblet.com/gist/2462915*/
    overflow: auto;
    background:
        /* Shadow covers */
        linear-gradient(white 30%, rgba(255,255,255,0)),
        linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
        
        /* Shadows */
        radial-gradient(50% 0, farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)),
        radial-gradient(50% 100%,farthest-side, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
    background:
        /* Shadow covers */
        linear-gradient(white 30%, rgba(255,255,255,0)),
        linear-gradient(rgba(255,255,255,0), white 70%) 0 100%,
        
        /* Shadows */
        radial-gradient(farthest-side at 50% 0, rgba(0,0,0,.2), rgba(0,0,0,0)),
        radial-gradient(farthest-side at 50% 100%, rgba(0,0,0,.2), rgba(0,0,0,0)) 0 100%;
    background-repeat: no-repeat;
    background-color: white;
    background-size: 100% 40px, 100% 40px, 100% 14px, 100% 14px;
    
    /* Opera doesn't support this in the shorthand */
    background-attachment: local, local, scroll, scroll;
}
/* test env labels */
.testenv span {
    margin-bottom: 1vh;
    display: block;
}
/* list with columns e.g. reinvite users page */
ul.cols {
    columns: 2;
}

/* participage page */
span.cmd {
    font-weight: bold;
}

.archived {
    border: var(--primary) thin solid;
    padding: 1vh;
    border-radius: 4px;
    background-color: var(--softlight);
}

/* in-page error */
#local-error {
    background-color: lightyellow;
    border-radius: 4px;
}
/* test book title for testing environment page */
em.title {
    font-weight: normal;
}

div.testing-environment-title > * {
    display: inline-block;
}
div.testing-environment-title > *:first-child {
    margin-right: 0.75rem;
}
.skipnav {
    font-size: small;
}
.test-excerpt {
    border: thick gray solid;
    padding: 1em;
}
.test-excerpt img {
    width: 200px;
    height: 200px;
}
.test-excerpt .eval {
    display: none;
}

.breadcrumbs ol {
    list-style-type: none;
    padding: 0;
    display: flex;
}
.breadcrumbs a {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
    clip-path: polygon(95% 0, 100% 50%, 95% 100%, 0% 100%, 5% 50%, 0% 0%);
    letter-spacing: 0.01em;
    padding-left: 1rem;
    padding-right: 1rem;
    padding-top: 0.25rem;
    padding-bottom: 0.25rem;
    position: relative;
    text-decoration: none;  
    width: min-content;
    white-space: nowrap;
}
.breadcrumbs a:not(:last-child) {    
    width: 105%;
}
  
.breadcrumbs a {
    background-color: var(--softcomp);
}
.breadcrumbs a:hover,
.breadcrumbs a:active {
    color: inherit;
    text-decoration: underline;
}
  
.breadcrumbs a:focus {
    box-shadow: 0 -3px 0 0 var(--softcomp) inset;
    outline: none;
}

.needs-attention {
    background-color: var(--message);
}
.latest-testbook-tag:after {
    content: " latest version";
    font-size: smaller;
    background-color: var(--message);
    width: min-content;
    font-variant: small-caps;
}
.notlatest-testbook-tag:after {
    content: " outdated version";
    font-size: smaller;
    background-color: var(--message);
    width: min-content;
    font-variant: small-caps;
}

td.not-latest-testbook:after {
    content: "Update required";
    font-size: smaller;
    border: thin solid var(--primary);
    border-radius: 5px;
    padding: 3px;
    width: min-content;
    font-variant: small-caps;
    background-color: white;
    display: block;
    white-space: nowrap;
}
p.not-latest-testbook, span.not-latest-testbook {
    background-color: var(--message);
    display: block;
    font-size: smaller;
    padding: 5px;
    margin: 5px;
}
span.latest-testbook, p.latest-testbook {
    background-color: var(--message);
    display: block;
    font-size: smaller;
    width: min-content;
    white-space: nowrap;
}
td span.not-latest-testbook {
    padding: 0;
    margin: 0;
}
li span.latest-testbook {
    display: inline;
}
p.latest-testbook {
    font-size: medium;
}

/*****************************/
/* MOBILE                    */
/*****************************/
@media (max-width: 768px) {
    body {
        margin-left: .5rem;
        margin-right: .5rem;
    }
    .center {
        --measure: 100vw;
        --gutters: 0;
    }
    
    footer {
        border-top: none;
    }
    ul.detailslist {
        width: 100%;
    }
    ul.detailslist li {
        grid-template-columns: 1fr;
    }
    
    .message {
        grid-area: message;
    }
    ul.cols {
        columns: 1;
    }
    .big {
        white-space: normal;
    }
    td.not-latest-testbook:after {
        white-space: wrap;
    }
}

.info-note {
    font-style: italic;
    font-size: smaller;
}

/* TODO remove this when math is removed at the data level */
/* this just disables the display of math entries */
#results-table thead th:nth-of-type(7) {
    display: none;
}
#results-table tbody tr td:nth-of-type(7) {
    display: none;
}
.secondary-nav li:has(a[href='#math']) {
    display: none;
}
section:has(h3[id='math']) {
    display: none;
}
#test-books-table tr:has(a[href='/test-books/math']) {
    display: none;
}
/* the admin view of the testing environment */
#testing-environment-details tr[id='math-1.1.1'] {
    /* display: none; */
}
.dashboard-topics tr[class='math'] {
    display: none;
}
ul.topics li:has(a[href='/results/topic/math']) {
    display: none;
}