/* Math artifacts shared styles.

   developer:   marionm
   requires:    nothing
   ========================================================================== */

/* ==========================================================================
   setup the environment
   ========================================================================== */

*,
:after,
:before {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:focus { outline: 0; }

html {
    -moz-text-size-adjust: 100%; /* preserve font size on orientation change */
    -ms-text-size-adjust: 100%; /* ^ */
    -webkit-text-size-adjust: 100%; /* ^ */
    background: #fff;
    color: #000;
    font-family: Arial, sans-serif;
    font-size: 16px; /* set default size for rems; this changes at various breakpoints and is used to scale page elements */
    font-weight: 400;
    height: 100%; /* set viewport height as the minimum page height */
    line-height: 1.3; /* scale to any font size */
    min-width: 320px; /* minimum supported device width */
    width: 100%; /* set viewport width as the minimum page width */
}

article,
aside,
details,
figcaption,
figure,
footer,
header,
hgroup,
main,
menu,
nav,
section,
summary { display: block; /* define html5 block elements for inept browsers */ }

audio,
canvas,
progress,
video { display: inline-block; /* define html5 inline-block elements for inept browsers */ }

audio:not([controls]) {
    display: none; /* correct display in iOS 4-7 */
    height: 0; /* ^ */
}

progress { vertical-align: baseline; }

dd,
dl,
dt,
li,
ol,
ul {
    display: block; /* no default list styles */
    list-style: none; /* ^ */
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font: inherit; /* no default heading styles */
    line-height: 1.2; /* tighter for headings */
}

caption,
col,
colgroup,
table,
tbody,
td,
tfoot,
th,
thead,
tr {
    border-collapse: collapse; /* remove excess spacing around table elements */
    border-spacing: 0; /* ^ */
}

a,
summary {
    -webkit-tap-highlight-color: rgba(0, 0, 0, 0); /* remove highlight triggered on tap on some mobile devices */
    -webkit-tap-highlight-color: transparent; /* ^ */
    background: transparent; /* remove gray background from active links in IE 10 */
    cursor: pointer;
    text-decoration: none;
}

img { border: none; /* remove border on linked images in IE */ }

b,
optgroup,
strong { font-weight: 600; }

dfn,
em,
i { font-style: italic; }

del,
s { text-decoration: line-through; }

code,
kbd,
pre,
samp,
tt {
    font-family: monospace, monospace; /* disable automatic monospace resizing */
    font-family: Consolas, Monaco, monospace; /* experimental */
    font-size: inherit;
}

sub,
sup {
    font-size: .75em;
    line-height: 0; /* prevent from affecting the line-height of the parent element */
    position: relative; /* ^ */
    vertical-align: baseline; /* ^ */
}

sub { bottom: -0.25em; }

sup { top: -0.325em; }

small { font-size: .875rem; }

pre {
    overflow: auto;
    white-space: pre-wrap;
    word-wrap: break-word;
}

hr {
    height: 0; /* Firefox */
    overflow: visible; /* IE */
}

legend {
    color: inherit; /* inherit from fieldset */
    display: table; /* fix IE text wrapping */
    max-width: 100%; /* ^ */
    white-space: normal; /* ^ */
}

textarea { overflow: auto; /* remove default vertical scrollbars in IE */ }

abbr[title] {
    border-bottom: none; /* Firefox */
    text-decoration: underline; /* Chrome, Edge, IE, Opera, and Safari */
    text-decoration: underline dotted; /* ^ */
}

button,
fieldset,
form,
input,
label,
legend,
optgroup,
option,
select,
textarea { font: inherit; /* improve font style inheritance */ }

button,
input,
select {
    overflow: visible; /* IE */
    text-transform: none; /* Firefox */
}

button,
html [type='button'],
[type='button'],
[type='reset'],
[type='submit'] {
    -webkit-appearance: button; /* enable button styles in iOS */
    cursor: pointer;
}

[disabled] { cursor: default; }

button::-moz-focus-inner,
input::-moz-focus-inner {
    border: 0; /* remove unwelcome Firefox styles */
    padding: 0; /* ^ */
}

input[type='number']::-webkit-inner-spin-button,
input[type='number']::-webkit-outer-spin-button { height: auto; /* prevent cursor change on increment/decrement buttons in Chrome */ }

input[type='search'] { -webkit-appearance: textfield; /* use same appearance as text input */ }

input[type='search']::-webkit-search-cancel-button,
input[type='search']::-webkit-search-decoration { -webkit-appearance: none; /* remove cancel button in Safari and Chrome on OSX */ }

svg:not(:root) { overflow: hidden; /* IE */ }

template,
[hidden] { display: none; /* IE */ }

input[type='text'],
input[type='password'],
input[type='date'],
input[type='datetime'],
input[type='datetime-local'],
input[type='email'],
input[type='month'],
input[type='number'],
input[type='search'],
input[type='tel'],
input[type='time'],
input[type='url'],
input[type='week'],
keygen,
output,
select,
textarea { font-size: 16px !important; /* disable zoom on text input elements in iOS */ }

/* ==========================================================================
   colors
   ========================================================================== */

:root {
    /* misc utility colors */
    --artifacts-black: #323232;
    --artifacts-charcoal: #222;
    --artifacts-grid-bg: #bebebe;
    --artifacts-orange: #f07100;
    --artifacts-red: #c74336;
    --artifacts-silver: #ccc;

    /* heading text colors */
    --artifacts-area-algebra: #d39a44;
    --artifacts-area-arithmetic: #5d89bb;
    --artifacts-area-counting: #b64e5b;
    --artifacts-area-geometry: #9f88c0;
    --artifacts-area-mathematics-education: #c3829c;
    --artifacts-area-pi: #dd9674;
    --artifacts-area-polyhedra: #7ab1aa;
    --artifacts-area-primes: #68a4ba;
    --artifacts-area-pythagorean-theorem: #78ac75;

    /* heading horizontal bar colors */
    --artifacts-bar-algebra: #bf8733;
    --artifacts-bar-arithmetic: #507bab;
    --artifacts-bar-counting: #9a394b;
    --artifacts-bar-geometry: #8c78aa;
    --artifacts-bar-learning-journeys: #94c3ef;
    --artifacts-bar-mathematics-education: #ab6984;
    --artifacts-bar-pi: #df885f;
    --artifacts-bar-polyhedra: #629b94;
    --artifacts-bar-primes: #4392af;
    --artifacts-bar-pythagorean-theorem: #648f62;
}

/* ==========================================================================
   opinionated defaults
   ========================================================================== */

html {
    color: var(--artifacts-charcoal);
    font-family: 'Source Sans Pro', Arial, sans-serif;
    font-size: 16px;
    min-height: 100vh;
    min-width: 320px;
}

@media all and (max-width: 1200px) {
    html { font-size: 15px; }
}

@media all and (max-width: 900px) {
    html { font-size: 14px; }
}

@media all and (max-width: 600px) {
    html { font-size: 13px; }
}

a { text-decoration: none; }

a:link,
a:visited { color: var(--artifacts-charcoal); }

a:hover { color: var(--artifacts-orange); }

a:active { color: #ffa352; }

::-moz-selection {
    background: #b3d4fc;
    text-shadow: none;
}

::selection {
    background: #b3d4fc;
    text-shadow: none;
}

/* ==========================================================================
   misc utility
   ========================================================================== */

.hidden { display: none !important; }

.serif { font-family: Georgia, serif; }

/* ==========================================================================
   top header
   ========================================================================== */

#top-header {
    background: #1c1c1c;
    padding: .75rem 1rem;
    text-align: center;
}

@media all and (max-width: 900px) {
    html.subpage #top-header { padding: .5rem 1rem; }
}

#top-header h1 img {
    height: auto;
    max-width: 100%;
}

#top-header h1 img.small { display: none; }

@media all and (max-width: 900px) {
    #top-header h1 img.large { display: none; }
    #top-header h1 img.small { display: inline; }
}

html.subpage #top-header h1 img.small { display: inline; }

#top-header h1 + p {
    color: #919191;
    font-size: .8125rem;
    font-weight: 300;
    line-height: 1.2;
    margin-top: 2px;
}

html.subpage #top-header h1 + p { margin-top: 0; }

@media all and (max-width: 900px) {
    #top-header h1 + p { margin-top: 0; }
}

/* ==========================================================================
   bottom header
   ========================================================================== */

#bottom-header { background: #1d4167; }

#bottom-header .padding {
    background: url('../img/header-bg.png') no-repeat center;
    padding: 3rem 2rem;
    text-align: center;
}

html.subpage #bottom-header .padding { padding: 1rem; }

@media all and (max-width: 1200px) {
    #bottom-header .padding {
        background-size: cover;
        padding: 2rem;
    }
}

@media all and (max-width: 360px) {
    #bottom-header .padding { background-image: none; }
}

#bottom-header h2 {
    color: #fff;
    font-size: 2.5rem;
    font-weight: 600;
    letter-spacing: 5px;
    line-height: 1;
    text-transform: uppercase;
}

#bottom-header h2 span { font-size: 3.5rem; }

@media all and (max-width: 900px) {
    #bottom-header h2 { font-size: 2rem; }
    #bottom-header h2 span { font-size: 3rem; }
}

html.subpage #bottom-header h2 {
    font-size: 1.625rem;
    letter-spacing: 3px;
}

html.subpage #bottom-header h2 span { font-size: 2.4rem; }

html.subpage #bottom-header a:hover h2 { color: #b5d4ff; }

#bottom-header h2 + p {
    color: #b5d4ff;
    font-size: 2.25rem;
    letter-spacing: 5px;
    line-height: 1;
    margin-top: 2px;
    text-transform: uppercase;
}

html.subpage #bottom-header h2 + p {
    font-size: 1.5rem;
    letter-spacing: 3px;
}

#bottom-header p + p,
#bottom-header a + p {
    color: #b5d4ff;
    font-size: 1.375rem;
    font-weight: 300;
    margin: 1.5rem auto 0 auto;
    max-width: 625px;
}

/* ==========================================================================
   main nav
   ========================================================================== */

#main-nav {
    align-items: center;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    margin: 0 auto;
    max-width: calc(1200px - 4rem);
    padding: 2rem 2rem 1rem;
}

@media all and (max-width: 600px) {
    #main-nav { padding: 2rem .8rem .5rem; }
}

/* breadcrumbs
   ========================================================================== */

#main-nav .breadcrumbs {
    align-items: center;
    display: flex;
    flex-direction: row;
    justify-content: flex-start;
}

#main-nav .breadcrumbs > a {
    background: url('https://www.wolframcloud.com/obj/history-of-mathematics/production/img/home-icon.png') no-repeat top left;
    background-size: 26px 40px;
    display: block;
    height: 20px;
    margin-right: -3px;
    width: 26px;
}

#main-nav .breadcrumbs > a:hover { background-position: 0 -20px; }

#main-nav .breadcrumbs p {
    color: #575757;
    line-height: 1;
    padding-left: .25rem;
}

#main-nav .breadcrumbs p span {
    color: #aaa;
    font-size: 20px;
    font-weight: 600;
    margin: 0 2px;
}

/* browse exhibits + LJs menu
   ========================================================================== */

#browse {
    position: relative;
    text-align: right;
    z-index: 9999999;
}

#browse > * { text-align: left; }

#browse div {
    background: #d77219;
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
    display: inline-block;
    font-size: .85rem;
    min-height: 25px;
    padding: .25rem 2.25rem;
    position: relative;
}

@media all and (max-width: 600px) {
    #browse div { padding-right: 1.5rem; }
}

#browse div:hover { background: #ff7700; }

#browse.active div {
    background: #ff7700;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}

#browse div i {
    content: '';
    display: block;
    position: absolute;
}

#browse div i:nth-of-type(1) {
    background: url('https://www.wolframcloud.com/obj/history-of-mathematics/production/img/browse.png') no-repeat top left;
    height: 17px;
    left: .75rem;
    top: 4px;
    width: 16px;
}

#browse div i:nth-of-type(2) {
    background: url('https://www.wolframcloud.com/obj/history-of-mathematics/production/img/down.png') no-repeat top left;
    height: 7px;
    right: .75rem;
    top: 10px;
    width: 11px;
}

@media all and (max-width: 600px) {
    #browse div i:nth-of-type(1) { left: .5rem; }
    #browse div i:nth-of-type(2) { right: .5rem; }
    #browse div span { display: none; }
}

#browse ul {
    background: #fff;
    border-bottom-left-radius: 4px;
    border-bottom-right-radius: 4px;
    border-top-width: 5px;
    border: 1px solid var(--artifacts-orange);
    display: none;
    min-width: 248px;
    position: absolute;
    right: 0;
    top: 25px;
}

#browse.active ul { display: block; }

#browse li {
    border-bottom: 1px solid #d1d1d1;
    list-style: none;
}

#browse li.no-link {
    border-bottom: none;
    border-top: 2px solid var(--artifacts-orange);
    color: #878787;
    font-size: .75rem;
    margin-top: -1px;
    padding: .25rem 0 0 1rem;
}

#browse li:last-child { border-bottom: none; }

#browse a {
    color: #2f2f2f;
    display: block;
    padding: 12px 1rem 12px 44px;
    position: relative;
}

#browse a:hover { color: #f06a1b; }

#browse a i {
    background: url('https://www.wolframcloud.com/obj/history-of-mathematics/production/img/browse-icons-new.png') no-repeat top left;
    background-size: 34px 400px;
    content: '';
    display: block;
    height: 34px;
    left: 4px;
    position: absolute;
    top: 0;
    width: 34px;
}

/* artifacts */
#browse li:nth-child(2) a i { background-position: 0 -42px; }
#browse li:nth-child(3) a i { background-position: 0 -82px; }
#browse li:nth-child(4) a i { background-position: 0 -122px; }
#browse li:nth-child(5) a i { background-position: 0 -160px; }
#browse li:nth-child(6) a i { background-position: 0 -202px; }
#browse li:nth-child(7) a i { background-position: 0 -240px; }
#browse li:nth-child(8) a i { background-position: 0 -284px; }
#browse li:nth-child(9) a i { background-position: 0 -326px; }
/* learning journeys */
#browse li:nth-child(11) a i { background-position: 0 -362px; }
#browse li:nth-child(12) a i { background-position: 0 -362px; }
#browse li:nth-child(13) a i { background-position: 0 -362px; }
#browse li:nth-child(14) a i { background-position: 0 -362px; }
#browse li:nth-child(15) a i { background-position: 0 -362px; }
#browse li:nth-child(16) a i { background-position: 0 -362px; }
#browse li:nth-child(17) a i { background-position: 0 -362px; }
#browse li:nth-child(18) a i { background-position: 0 -362px; }

#browse a:after {
    content: '\00BB';
    display: inline;
    margin-left: .25rem;
}

/* ==========================================================================
   main footer
   ========================================================================== */

#main-footer {
    background: #242424;
    border-top: 6px #235186 solid;
    padding: 2rem;
}

@media all and (max-width: 1200px) {
    #main-footer { padding: 1rem 2rem; }
}

/* logos
   ========================================================================== */

#main-footer .flexbox {
    align-content: center;
    align-items: center;
    display: flex;
    justify-content: center;
    margin: 0 auto;
    max-width: 960px;
    text-align: center;
}

@media all and (max-width: 1200px) {
    #main-footer .flexbox img { transform: scale(.8); }
}

@media all and (max-width: 900px) {
    #main-footer .flexbox img { transform: scale(.7); }
}

@media all and (max-width: 600px) {
    #main-footer .flexbox { flex-direction: column; }
    #main-footer .flexbox img { transform: scale(1); }
}

#main-footer .flexbox div {
    padding: 2rem 3rem;
    border-right: 1px solid #3a3a3a;
}

@media all and (max-width: 900px) {
    #main-footer .flexbox div { padding: 1rem 2rem; }
}

@media all and (max-width: 600px) {
    #main-footer .flexbox div {
        border: none;
        border-bottom: 1px solid #3a3a3a;
        padding: 2rem;
        text-align: center;
        width: 100%;
    }
}

#main-footer .flexbox div:last-of-type { border-right: none; }

@media all and (max-width: 600px) {
    #main-footer .flexbox div:last-of-type { border-bottom: none; }
}

#main-footer .flexbox a { display: block; }

#main-footer .flexbox img {
    height: auto;
    max-width: 100%;
}

/* copyright
   ========================================================================== */

#main-footer .copyright {
    border-top: 1px #3a3a3a solid;
    margin: 2rem auto 0 auto;
    max-width: 1300px;
    padding: 1rem 0;
}

@media all and (max-width: 1200px) {
    #main-footer .copyright { margin: 1rem auto 0 auto; }
}

@media all and (max-width: 600px) {
    #main-footer .copyright {
        background: #393939;
        margin: 0 -2rem -2rem -2rem;
        padding: 1rem 2rem;
        text-align: center;
    }
}

#main-footer .copyright p {
    padding-left: 1rem;
    text-align: center;
}

@media all and (max-width: 600px) {
    #main-footer .copyright p { padding-left: 0; }
}

#main-footer .copyright p,
#main-footer .copyright a {
    font-size: .9rem;
    color: #bababa;
}

#main-footer .copyright a:hover { color: var(--artifacts-orange); }

#main-footer .copyright span {
    color: #646464;
    margin: 0 3px;
}

@media all and (max-width: 600px) {
    #main-footer .copyright span { display: none; }
}

#main-footer .copyright br { display: none; }

@media all and (max-width: 600px) {
    #main-footer .copyright br { display: block; }
}

/* ==========================================================================
   magnific popup
   ========================================================================== */

.mfp-bg {
    height: auto !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0;
    left: 0;
    right: 0;
}

.mfp-wrap {
    height: auto !important;
    overflow: hidden !important;
    position: fixed !important;
    top: 0 !important;
    bottom: 0;
    left: 0;
    right: 0;
}

.mfp-container {
    padding: 0 !important;
    margin: 0 auto !important;
    max-width: 1140px !important;
    right: 0;
}

.mfp-content {
    background: #303030;
    height: 100%;
    max-width: 1140px !important;
    width: 100%;
}

.mfp-inner-content p {
    color: #8c8c8c;
    font-size: 1rem;
    line-height: 1.5;
    padding: 0;
}

.mfp-inner-content a { color: #f85b42; }

.mfp-iframe-scaler { overflow: auto !important; }

.mfp-iframe-scaler iframe {
    background: transparent !important;
    max-width: 1140px !important;
    min-height: 100%;
    overflow: hidden !important;
}

.mfp-inner-content {
    background: #303030;
    margin: 1rem 0 0;
    padding: 0 3rem;
}

.ajax-text-and-image {
    background: #303030;
    height: 100%;
    line-height: 1;
    text-align: center;
}

.mfp-inner-content img {
    height: auto;
    max-width: 100%;
    width: auto;
}

.image-container {
    height: 76vh;
    overflow: auto;
    margin: 4.5% auto;
    width: 76vw;
}

.image-container.smaller { height: 67vh; }

.mfp-inner-content img.fullsize {
    margin: 1rem auto;
    max-height: inherit !important;
    max-width: inherit !important;
    padding: 0;
    position: relative;
    width: 800px;
}

.mfp-inner-content img.smaller { max-height: 67vh; }

.ajax-text-and-image .inner { padding: 0; }

.ajax-text-and-image p img {
    display: block;
    height: auto;
    max-height: 69vh;
    max-width: 100%;
    padding: 0 4rem;
    bottom: 0;
    left: 0;
    margin: auto;
    position: absolute;
    right: 0;
    top: 0;
}

.image-container.magnify { cursor: pointer; }

.image-container .mag { display: none; }

.image-container.magnify .mag {
    display: inline-block;
    position: absolute;
    height: 20px;
    width: 20px;
}

.magnify:hover .mag path { fill: #f67865; }

.ajax-text-and-image .heading {
    border-top: 0;
    color: #fff;
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.1;
    margin: 1rem 1.5rem 0;
}

.ajax-text-and-image .heading .date {
    color: #f67865;
    font-style: normal;
}

.mfp-content button.mfp-close {
    background: transparent !important;
    box-shadow: none !important;
    color: #878787 !important;
    font-weight: 700;
    height: 36px !important;
    padding: 8px !important;
    right: 1px !important;
    top: 1px !important;
    width: 36px !important;
}

.scroll .mfp-content button.mfp-close { right: 15px !important; }

.mfp-arrow {
    opacity: 1 !important;
    text-align: center;
    width: 20px !important;
}

.mfp-arrow:after { display: none !important; }

.mfp-arrow:before {
    color: #f85b42 !important;
    border: 0 !important;
    bottom: 0 !important;
    display: block !important;
    font-family: Arial !important;
    font-size: 6rem !important;
    height: 7.625rem !important;
    left: 0 !important;
    margin: auto !important;
    opacity: 1 !important;
    right: 0 !important;
    width: 15px !important;
}

.mfp-arrow:hover:before { color: #fa7d64 !important; }

.mfp-arrow-right { right: 45px; }

.mfp-arrow-left { left: 30px; }

@media all and (max-width: 600px) {
    .mfp-arrow-left { left: 4px; }
    .mfp-arrow-right { right: 12px; }
}

.mfp-arrow-right:before { content: '\203A' !important; }

.mfp-arrow-left:before { content: '\2039' !important; }

.mfp-bg { opacity: .65; }

.mfp-figure:after { display: none; }

.mfp-figure figure {
    display: flex;
    height: 100vh;
}

.mfp-figure img.mfp-img {
    align-self: center;
    max-height: 90% !important;
    max-width: 82%;
    padding: 0;
}

.mfp-bottom-bar {
    top: 0;
    margin: 0;
}

.mfp-title {
    color: #fff;
    font-size: 1.3rem;
    font-style: italic;
    line-height: 1.1;
    margin: 1rem 1.5rem 0;
    text-align: center;
}

.mfp-counter { display: none; }