/* ------------------------------------------------------------ layout
   Flex, not absolute positioning, so the page reflows on a narrow screen.
   The desktop result is the same as before: logo left, title centred,
   160px menu column, content to its right. */

/* The page is a light design. Declaring that explicitly stops browsers in
   dark mode from auto-inverting it into something half-legible. */
:root
{
        color-scheme: light;
}

body
{
        font-family: Verdana, Geneva, Arial, Helvetica, sans-serif;
        margin: 8px 16px;
        background-color: rgb(255,255,255);
        color: rgb(0,0,0);
}

body a
{
        text-decoration: none;
}

body a:hover
{
        text-decoration: underline;
}

header
{
        display: flex;
        align-items: center;
        gap: 20px;
}

#logo
{
        flex: 0 0 170px;
}

#logo img
{
        display: block;
        max-width: 100%;
        height: auto;
        border: 0;
}

#title
{
        flex: 1 1 auto;
        text-align: center;
        white-space: nowrap;
}

#separator
{
	padding-top: 10px; 
        padding-bottom: 10px; 
	padding-left: 20px;  
        background-color: rgb(173,216,230);
}

#layout
{
        display: flex;
        align-items: flex-start;
        gap: 30px;
}

#menu 
{
        flex: 0 0 160px;
	padding: 10px;
        line-height: 200%;
        text-align: left;
}

#menu a
{
        color: Blue;
}

#menu .current
{
        color: Red;
        text-decoration: underline;        
}

#content
{
        flex: 1 1 auto;
        min-width: 0;
}

/* Wide tables scroll inside their own box instead of stretching the page. */
.scroll
{
        overflow-x: auto;
}

#content p
{
	text-align: justify;
	width: 90%;
}

#content li
{
	padding: 2px;
}

#syllabus tr.current-week td
{
        background-color: rgb(255,170,170);
}

.important
{
        color: Red;
        font-weight: bold;
}

table#syllabus
{
}

#syllabus .oddweek
{
        background-color: rgb(245,245,220);
}

#syllabus .evenweek
{
        background-color: rgb(173,216,230);
}

#syllabus .num
{
        text-align: right;
}

#syllabus .day
{
        width: 80px;
        text-align: center;
}

#syllabus .date
{
        width: 80px;
        text-align: center;
}

#syllabus .topic
{
        width: 400px;
        text-align: left;
        padding-left: 20px;
	font-weight: bold;        
        text-valign: center;
}

#syllabus .assignment
{
        width: 300px;
        text-align: left;
        padding-left: 20px;
}

#syllabus .speakers
{
        width: 300px;
        text-align: left;
        padding-left: 20px;
}

.item
{
        padding-left: px;
        text-align: justify; 
        width: 90%;
}

div.exercise {
    margin-left: 3em;
    margin-right: 3em;
    margin-bottom: 1em;
    margin-top: 1em;
    width: 80%;
    background-color: #e0e0ff;
    padding-left: 1em;
    padding-right: 1em;
}

div.todo {
    margin: 1pc 4% 0pc 4%;
    padding: 0.5pc 0.5pc 0.5pc 0.5pc;
    background-color: #e0e0ff;
    border: 1px dashed red;
}

div.required .header {
    font-weight: bold;
}

div.challenge .header {
    font-style: italic;
}

div.required {
    background-color: #eeeeff;
}

div.challenge {
    background-color: #ffe0e0;
}

div.question {
    background-color: #e0e0ff;
}

pre.tty {
    font-family: monospace;
    margin: 1pc 4% 0pc 4%;
    padding: 0.5pc 0.5pc 0.5pc 0.5pc;
    border: 1px dashed #99aabb;
    background-color:#f5f5f5
}

blockquote {
    margin: 1pc 4% 0pc 4%;
    padding: 0.5pc 0.5pc 0.5pc 0.5pc;
    border: 1px dashed #99aabb;
    background-color:#f5f5f5
}

span.ttytype {
    color: green;
    font-family: monospace;
    font-weight: bold;
}
table.table {
    width: 92%;
    margin: 1pc 4% 0pc 4%;
}

table.table th {
    text-align: left;
    background-color: #f0f0f0;
    border: 1px solid #dcdcdc;
    padding: 4px;
}

table.table td {
    text-align: left;
    border: 1px solid #dcdcdc;
    padding: 4px;
}


/* ------------------------------------------------------- narrow screens */

@media (max-width: 720px)
{
        header
        {
                flex-direction: column;
                gap: 10px;
        }

        /* flex-basis becomes a height once the header stacks */
        #logo
        {
                flex: none;
        }

        #title
        {
                white-space: normal;
        }

        #layout
        {
                flex-direction: column;
                align-items: stretch;   /* else children size to content and widen the page */
                gap: 0;
        }

        #menu
        {
                flex: none;
                width: auto;
                line-height: 180%;
                padding-left: 0;
        }

        #content p,
        .item,
        table.table
        {
                width: auto;
        }

        table.table
        {
                margin-left: 0;
                margin-right: 0;
        }

        div.exercise
        {
                margin-left: 0;
                margin-right: 0;
                width: auto;
        }
}
