/* in all HTML files */
html, body {
    height: 100%;
    margin: 0;
    font-family: Arial, sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    background-color: #ffffff;
}

header {
    background-color: #ffffff; 
    box-shadow: 0px -2px 10px rgba(0, 0, 0, 0.2);
    border-bottom: 2px dashed;
    border-bottom-color: black;
    padding: 10px 20px;
    height: 77px; /* hard-coded for now */
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 18px;
    margin: 20px 0 20px 0; /* hard-coded for now */
}

.nav-links {
    display: flex;
    justify-content: center;
    list-style: none;
    margin: 0 auto;
    padding: 0;
    /*flex-grow: 1;*/
    /*gap: 5px;*/
}

.nav-links li {
    margin-right: 20px;
}

.nav-links li:last-child {
    margin-right: 0;
}

.nav-links-blog {
    list-style: none;
    padding: 0 30px 0 0;
    margin: 0 0 10px 20px;
}

.nav-container a {
    text-decoration: none;
    color: #333;
    font-weight: bold;
    position: relative;
}

.nav-container a:hover::after {
    transform: scaleX(1);
    transform-origin: bottom left;

    content: "";
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: gray;
}

.current-tab {
    transform: scaleX(1);
    transform-origin: bottom left;

    content: "";
    position: absolute;
    width: 100%;
    height: 2px;
    bottom: 4px; /* TODO: might want to play around with this */
    left: 0;

    font-size: 24px;
/*    text-shadow: 0px 0px 20px #3cd4fa;*/
/*    box-shadow: 3px 3px 5px rgba(0, 0, 0, 0.1);*/
}

.container {
    display: flex;
    align-items: stretch;
    flex: 1;
    /* overflow-x: scroll; */
    /*overflow-y: hidden;*/
}

.sub-container {
    display: flex;
    flex: 1;
}

aside {
	/* order: 2; */
    padding: 18px;
    box-shadow: 2px 0 4px rgba(0, 0, 0, 0.1);
    display: flex;
    flex-direction: column;
    /* Make the sidebar scrollable */
    /*overflow-y: auto;*/
}

.sidebar {
    text-align: center;
}

.sidebar .name {
    font-size: 25pt;
    font-family: "Dancing Script", cursive;
    font-optical-sizing: auto;
}

.sidebar .content {
	text-align: left;
	margin-left: 10px;
    padding-top: 10px;
}

.sidebar .content a:link {
    color: black;
    text-decoration: none;
}

/* Q: why different from '.nav-links a::after' */
.sidebar .content a:hover {
    text-decoration: underline;
}

.sidebar .content a:visited {
    color: black;
}

main {
    /* order: 1; */
    flex: 1;
    padding: 20px;
    display: flex;
    flex-direction: column;
    background-color: rgba(202, 240, 252, 0.3); /* Originally #f0f0f0 */
}

main .content * {
    margin-top: 0;
}

main .content {
    background-color: #ffffff;
    padding: 40px 50px 30px 50px;
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    box-shadow: 0px 3px 10px rgba(0, 0, 0, 0.2);
}

main .content .cv-section {
    margin-bottom: 30px;
}

main .content .greeting {
    font-size: 20pt;
    margin-top: 0px;
}

main .content .notice {
    text-align: center;
    font-style: italic;
    padding-bottom: 16px; /* Spacing for one <br> */
}

/* News */
.announcement {
    list-style-type: none;
    font-size: 12pt;
    margin-left: 47pt;
    margin-bottom: 5pt;
    padding-left: 5em;
    text-indent:-9em;
}

.announcement-date {
    margin-left: 5px;
    font-weight: bold;
}

/* Research */
.research .article {
    display: flex;
    flex: 1;
}

.research .article:not(:last-child) {
    margin-bottom: 30px;
}

.research .article img {
    height: 110px;
    padding-right: 20px;
    -webkit-user-drag: none;
}

.research .title {
    font-size: 13pt;
}

.research .authors {
    font-size: 11pt;
}

.research .venue {
    font-size: 10pt;
    font-style: italic;
}

.research .links {
    font-size: 10pt;
}



/* Teaching */
.teaching .school {
    font-size: 13pt;
    font-weight: bold;
}

.teaching .position {
    font-size: 12pt;
}


/* CV - Education & Languages */
.education .sub-container {
    display: flex;
    flex-direction: row;
    text-align: center;
}

.education .sub-container div {
    width: 300px;
}

.education .sub-container #UR img {
    height: 120px;
    -webkit-user-drag: none;
}

.education .sub-container .text {
    line-height: 1.5;
}

.education .sub-container #UMD img {
    height: 120px;
    -webkit-user-drag: none;    
}

.education .sub-container .school {
    font-size: 12pt;
    font-weight: bold;
}

.blog-posts h2 {
    font-size: 12pt;
}

.blog-posts a:link {
    color: black;
    text-decoration: none;
}

.blog-posts a:hover {
    text-decoration: underline;
}

.blog-posts a:visited {
    color: black;
}

footer {
    background-color: #f0f0f0;
    text-align: center;
    padding: 20px 0;
    box-shadow: 0 -2px 4px rgba(0, 0, 0, 0.1);
}


/* stand-alone */
h1 {
    font-size: 20pt;
    font-weight: bold;
}

h2 {
    font-size: 15pt;
    font-weight: normal;
}

ul {
    line-height: 1.5;
}

#regular-text {
    font-size: 11pt;
    -webkit-text-size-adjust: 100%;
}

#profile-pic {
    border-radius: 50%;
    width: 180px;
    height: auto; /* Keep aspect ratio */
    object-fit: cover;
    -webkit-user-drag: none;
}

/*#profile-pic-text {
    font-size: 10pt;
}*/

#rotating-globe {
    width: 17px;
    height: auto;
    -webkit-user-drag: none;    
}

#boba {
    padding-top: 20px;
    width: 40px;
    height: auto;
    opacity: 0.0;
    -webkit-user-drag: none;
}

#blog.current-tab {
    text-shadow: 0px 0px 20px #3cd4fa;
    list-style: none;
}

/* Visitors: apparently GitHub Pages doesn't support server-side processing :( */

.visitors {
    display: flex;
    justify-content: center;  
}

#visitor-map {
    width: 190px;
    height: auto;
    padding-top: 30px; /* NOTE: hard-coded for now */
    padding-bottom: 50px;
    opacity: 0.4;
    -webkit-user-drag: none;
}

#copyright {
    height: 100%;
    font-size: 10pt;
    display: flex;
    justify-content: flex-end;
    align-items: flex-end;
}


/* from font-awesome.min.css */
.icon {
    display: inline;
    font: normal normal normal 14px FontAwesome;
    font-size: inherit; /* Inherit from parent element */
    text-rendering: auto;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* TODO: refine responsive design (esp. for phone) */

/* Phone */
@media (max-width: 400px) {
    .container {
        flex-direction: column; /* Original side-by-side layout did not work well */
        width: 100%;
        min-width: 100%;
        height: 100vh; /* full viewport height ? */
        align-items: stretch;
        flex: 1;
    }
    aside {
        flex: 0 0 20%;
        padding-bottom: 5px;
    }
    main {
        flex: 0 0 80%;
        padding: 5px;
        /*overflow-y: auto;*/
        display: block;
    }
    main .content {
        overflow-y: visible;
        margin: 0;
        padding: 30px 15px 15px 15px;
    }
    main .content,
    main .research,
    main .teaching {
        gap: 5px;
    }
    #copyright {
        padding-top: 10px;
    }
    #profile-pic {
        width: 160px;
        height: auto;
    }
    .sidebar .name {
        font-size: 20pt;
    }
    .nav-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        margin: 0;
        padding: 0;
        gap: 10px;
    }
    .nav-links,
    .nav-links-blog {
        list-style: none;
        margin: 0;
        padding: 0;
        display: flex;
        justify-content: center;
    }
    .nav-links li,
    .nav-links-blog li {
        margin-right: 20px;
    }
    .nav-links li:last-child,
    .nav-links-blog li:last-child {
        margin-right: 0;
    }
    .current-tab {
        font-size: 14pt;
        text-shadow: 0px 0px 20px #3cd4fa;
    }
    .current-tab-phone { /* TODO: use JavaScript? */
        transform: scaleX(1);
        transform-origin: bottom left;
        content: "";
        position: absolute;
        width: 100%;
        height: 2px;
        bottom: 4px;
        left: 0;
        font-size: 14pt;
    }
    .education .sub-container,
    .research .article {
        flex-direction: column;
    }
    .education .sub-container .institution:not(:last-child) {
        margin-bottom: 30px;
        padding-bottom: 0;
    }
    .notice {
        margin: 0;
    }
    .announcement {
        margin-left: 5px;
        padding-left: 0;
        text-indent: 0;
    }
    main .content,
    header,
    aside,
    footer,
    #blog {
        text-shadow: none;
        box-shadow: none;
    }
}

/* Laptop */
@media (max-width: 1000px) {
    aside {
        width: 100%;
    }
    main {
        width: 100%;
    }
    #profile-pic {
        padding-left: 15px;
        padding-right: 15px;
    }
    .education .sub-container {
        flex-direction: column;
    }
    .education .sub-container .institution:not(:last-child) {
        margin-bottom: 30px;
        padding-bottom: 0;
    }
}

/* Monitor */
@media (min-width: 1399px) and (max-width: 1001) {
    aside {
        width: 20%;
    }
    main {

    }
}

@media (min-width: 1400px) {
    aside {
        width: 300px;
    }
    main {

    }
    #visitor-map {
        width: 210px;
        height: auto;
    }
}

@media (min-width: 1700px) {
    aside {
        width: 400px;
    }
    main {

    }
}