html {
    overflow-y: scroll;
    overflow-x: hidden;
}

body {
  font-size: 17px;
  font-family: 'Crimson Text', serif;
  line-height: 1.25;
  margin: 0;
  padding: 0;
  background-color: white;
  text-rendering: optimizeLegibility;
}

.hide { display: none; }

#header, #content {
    width: 98%;
    max-width: 980px;
    margin: 0 auto;
    padding: 0.5% 1% 0.5% 1%;
    clear: both;
}
#header {
    height: 11vw;
    max-height: 110px;
    margin-bottom: 1%;
}
#nav {
    width: 100%;
    max-width: 500px; /** To prevent 4 icons on a line; overridden for >800px below */
    text-align: center;
    margin: auto;
    padding: 0;
    clear: both;
}
#header {
    box-shadow: 0px 5px 10px rgba(150, 150, 150, 0.75);
    background: linear-gradient(to right, white, #cccccc);
}

#header>* {
    display: block;
    float: left;
	background-repeat: no-repeat;
	background-size: auto 100%;
    height: 100%;
    text-decoration: none;
}
#header>a.queens, #header>a.qed { width: 22%; }
#header>div.econ250             { width: 56%; }
#header>a.queens {
    background-image: url(images/QueensLogo_colour.png);
}
#header>a.qed {
    background-image: url(images/QED.png);
    background-position: right center;
    background-size: auto 75%;
}
#header>div.econ250 {
    text-align: center;
}
#header>div.econ250>h1 {
    font-size: 5.5vw;
    letter-spacing: 0.25vw;
    line-height: 1;
    font-weight: bold;
    margin: 1vw 0 0 0;
}
#header>div.econ250>h2 {
    font-size: 4.0vw;
    font-weight: normal;
    line-height: 1.2;
    margin: 0;
    padding: 0;
    white-space: nowrap;
    overflow-x: hidden;
    overflow-y: hidden;

}
#header>div.econ250 a {
    text-decoration: none;
}

h1, h2, h3 {
    color: #11335d;
    line-height: 1;
    clear: left;
}
h1 { font-size: 6.5vw; margin-bottom: 0.7em; }
h2 { font-size: 5.5vw; margin-bottom: 0; }
h3 { font-size: 4.5vw; margin-bottom: 0; }
a {
    color: #11335d;
}

#nav>li:before {
    content: "";
    display: inline-block;
    /** The following controls the aspect ratio of nav buttons (the percentage is relative to the
     * width): */
    padding-top: 95%;
}
#nav>li {
	display: inline-block;
    position: relative;
    padding: 0;
	margin: 1%;
	border: 1px solid rgb(50%,50%,50%);
	border-radius: 10%;
	box-shadow: rgba(0, 0, 0, 0.75) 0.4vw 0.4vw 1.2vw;
    width: 22.5%; /* for browsers not supporting calc(): */
    width: calc(23% - 2px);
    max-width: 125px;
    overflow: hidden;
}
/* inset the shadow for the current page */
body#home #nav>li.home,
body#people #nav>li.people,
body#outline #nav>li.outline,
body#assignments #nav>li.assignments,
body#resources #nav>li.resources,
body#integrity #nav>li.integrity,
body#archive #nav>li.archive
{
    box-shadow: rgba(0,0,0,0.75) 0.4vw 0.4vw 1.2vw inset;
}

#nav>li>a {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;

    text-decoration: none;

	padding: 75% 1px 0 1px;
	font-size: 3vw;
	font-weight: bold;
	line-height: 90%;
	background-position: center top;
	background-repeat: no-repeat;
	background-size: 75%;
}
#nav>li>a:hover {
    text-decoration: none;
}

/* Override padding-top for 1 buttons: */
#nav>li.resources>a, #nav>li.archive>a {
    padding-top: 80%;
}

#nav>li:hover {
	box-shadow: rgba(0, 0, 0, 0.85) 0.6vw 0.6vw 2.4vw;
}
    
/* Excellent hand-drawn icons by Aleksandra Wolska (see http://imaginary.ca/olawolska-icons/about.txt) */
#nav>.home>a      { background-image: url(olawolska-icons/256x256/home.png); background-size: 72%; }
#nav>.people>a    { background-image: url(olawolska-icons/256x256/users.png); }
#nav>.outline>a   { background-image: url(olawolska-icons/256x256/calendar.png); }
#nav>.assignments>a  { background-image: url(olawolska-icons/256x256/notepad.png); background-size: 68%; }
#nav>.resources>a { background-image: url(olawolska-icons/256x256/help.png); }
#nav>.integrity>a { background-image: url(olawolska-icons/256x256/alert.png); background-size: 73%; }
#nav>.archive>a   { background-image: url(olawolska-icons/256x256/download.png); background-size: 85%; background-position: center -5px; }

/* Stop increasing nav icon text and margins at 500px */
@media screen and (min-width: 500px) {
#nav>li {
    margin: 5px;
    box-shadow: rgba(0,0,0,0.75) 2px 2px 6px;
}
#nav>li:hover {
    box-shadow: rgba(0,0,0,0.75) 3px 3px 12px;
}
#nav>li>a {
    font-size: 15px;
}
}

/* Max out h* sizes at 600px wide */
@media screen and (min-width: 600px) {
h1 { font-size: 39px; }
h2 { font-size: 33px; }
h3 { font-size: 27px; }
}


/* At 700, we switch to a single row of nav icons instead of two rows, and let
 * the icons get bigger.  They will be smaller (jumping down to around 100 at
 * 700, expanding back to full size at around 1000px width.
 */
@media screen and (min-width: 700px) {
#nav { max-width: 1000px; }
#nav>li {
    width: 15%; /* conservative value for browsers not supporting calc(): */
    max-width: 156px;
    /* 84px = 14 margins of 5px each plus 14 1px borders */
    width: calc((100% - 84px) / 7);
    overflow: hidden;
}
#nav>li>a {
	font-size: 1.7vw;
}
}


/* At 1000px, we stop the header text and header/content padding from expanding anymore */
@media screen and (min-width: 1000px) {
#header, #content {
    padding: 5px 10px 5px 10px;
}
#header {
    margin-bottom: 10px;
}
#header>div.econ250>h1 {
    font-size: 55px;
    letter-spacing: 2.5px;
    margin-top: 10px;
}
#header>div.econ250>h2 { font-size: 40px; }

#nav>li>a {
	font-size: 17px;
}
}

@media print {
#nav {
    display: none;
}
/*#header>a.qed { background-size: auto 65%; }*/
h1, h2, h3, a {
    color: black;
}
a { text-decoration: none; }
h1 { font-size: 28pt; margin-bottom: 3pt; }
h2 { font-size: 24pt; margin-bottom: 0; }
h3 { font-size: 20pt; margin-bottom: 0; }
#header {
    height: 4.8em;
}
#header>div.econ250 {
    text-align: center;
}
#header>div.econ250>h1 {
    font-size: 28pt;
    letter-spacing: 1.3pt;
    margin: 10px 0 0 0;
}
#header>div.econ250>h2 {
    font-size: 24pt;
    margin-bottom: 5px;
}
}

body#archive #content .test ul { padding-left: 20px; }

body#home ul.announcements li.current { color: blue; }

@media screen and (min-width: 870px) {
body#archive #content .test {
    display: inline-block;
    vertical-align: top;
}
body#archive #content #final    {
    width: 26%;
    padding-left: 1%;
    border-left: 2px solid #11335d;
}
body#archive #content #midterm1 { width: 34%; padding-right: 1%; }
body#archive #content #midterm2 { width: 35.5%; width: calc(36% - 4px);
    border-left: 2px solid #11335d;
    padding-left: 1%;
    padding-right: 1%;
}
}
@media screen and (min-width: 640px) and (max-width: 869px) {
body#archive #content #midterm1, body#archive #content #midterm2 {
    display: inline-block;
    vertical-align: top;
}
body#archive #content #midterm1 { width: 47.5%; padding-right: 1%; }
body#archive #content #midterm2 { width: 50.0%; width: calc(50.5% - 2px);
    border-left: 2px solid #11335d;
    padding-left: 1%;
}
}

#content>div {
    border-top: 2px solid #11335d;
    overflow: auto;
}
#content>div:first-child {
    border-top: none;
}
#content>div>*:last-child {
    margin-bottom: 1em;
}

#copyright {
    margin-top: 45px;
    padding-top: 5px;
    font-style: italic;
}

.info-section {
    clear: left;
    float: left;
    margin-left: 100px;
    padding: 0 0 15px 0;
}
.info-section>label {
    clear: left;
    float: left;
    width: 100px;
    margin-left: -100px;
    margin-top: 3px;
    font-weight: bold;
}
.info-section>div {
    display: inline-block;
    max-width: 400px;
    white-space: pre-line;
}

/* Events are bold and don't break */
.event {
    font-weight: bold;
    font-style: italic;
    white-space: nowrap;
}

/* Titles are italicized */
.title {
    font-style: italic;
}

/* Links in an "additional" section don't break */
.additional a {
    white-space: nowrap;
}

#content strong {
    text-decoration: underline;
    line-height: 1;
}

body#resources #content #textbook img {
    width: 116px;
    height: auto;
    float: left;
    margin: 0 15px 15px 0;
    padding: 0;
}

body#resources #content #lecture-notes h1 {
    text-decoration: line-through;
}

body#outline table a.switch {
    font-style: italic;
    font-size: 14px;
}

body#outline table p.switch {
    display: none;
}

table {
    border-collapse: collapse;
    margin: 0 auto;
}
table th, table td {
    border: 1px solid #bbbbbb;
    margin: 0;
}
table thead tr {
    color: #11335d;
    background-color: #eeeeee;
}
table thead th {
    text-align: left;
    padding: 5px 5px 0 5px;
    vertical-align: bottom;
    line-height: 1;
}

/* Tables really don't work properly below about 650px, so below 700px change the layout.
 * NB: they have to be in a "tabular" div container in order for this to apply, and they'll need
 * the appropriate :before entries added near the bottom of this @media section. */
@media screen and (max-width: 699px) {
    body#outline table p.switch {
        display: none;
    }

    #content>div.tabular {
        margin: 0% -1%;
        padding: 0;
        overflow-x: hidden;
    }
    #content>div.tabular>h1, #content>div.tabular>p {
        padding: 1.02%;
    }
    table {
        width: 100%;
        width: calc(100% + 1px);
        overflow-x: hidden;
    }
    table thead {
        display: none;
    }
    table td {
        display: block;
        border: none;
        margin-left: 90px;
        padding: 5px 5px 0 5px;
        line-height: 1;
    }
    table td:empty {
        display: none;
    }
    table td:first-child {
        font-weight: bold;
        line-height: 1;
        margin: 10px 0 0 0;
        width: 97%;
        width: calc(100% - 10px);
        border: none;
        background-color: #11335d;
        color: white;
        clear: both;
    }
    table td:first-child a {
        color: white;
        font-weight: bold;
    }
    table td:first-child a:hover {
        text-decoration: none;
    }
    table td:before {
        display: block;
        width: 90px;
        margin-left: -90px;
        float: left;
    }
    table td:first-child:before {
        display: inline;
        margin-left: 0;
        float: none;
    }
    table td:first-child:before {
    }
    table td.week:before { content: "Week "; }
    table td.chapter:before { content: "Chapters: "; }
    table td.chapter.e2016:not(:empty):after { font-style: italic; content: " (2016 edition)"; }
    table td.chapter.e2012:not(:empty):after { font-style: italic; content: " (2012 edition)"; }
    table td.applets:before { content: "Applets: "; }
    table td.additional:before { content: "Additional: "; }

    /* Omissions */
    table td.topic:before { content: "Topic: "; }
    table td.pages:before { content: "Pages: "; }
    table td.pages.e2016:not(:empty):after { font-style: italic; content: " (2016 edition)"; }
    table td.pages.e2012:not(:empty):after { font-style: italic; content: " (2012 edition)"; }

    /*table td.project:before { content: "Project: "; }*/
    table tr.exercise td.due:before { content: "Due Date: "; }
    table tr.exam     td.due:before { content: "Date: "; }
    table td.grade:before { content: "Worth: "; }
    body#assignments table td.additional:before { content: "Note: "; }
    table td.follow-up:before { content: "Follow-up: "; }

}

