/* ==========================================================
   ZACHARIAH EMMANUEL ACADEMIC WEBSITE
   Shared layout inspired by the structure of Graeme Peterson's
   academic website
   ========================================================== */


/* ==========================================================
   THEME VARIABLES
   ========================================================== */

:root {
    --bg: #ffffff;
    --text: #333333;
    --muted: #666666;
    --heading: #222222;
    --link: #2f5f8f;
    --border: #e5e5e5;
    --button-bg: #f4f4f4;
    --button-hover: #e9e9e9;
    --header-bg: #ffffff;
}

html[data-theme="dark"] {
    --bg: #181818;
    --text: #dddddd;
    --muted: #aaaaaa;
    --heading: #f2f2f2;
    --link: #85b7e8;
    --border: #383838;
    --button-bg: #282828;
    --button-hover: #333333;
    --header-bg: #181818;
}


/* ==========================================================
   BASIC PAGE SETTINGS
   ========================================================== */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--bg);
    color: var(--text);

    font-family:
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        Roboto,
        Helvetica,
        Arial,
        sans-serif;

    font-size: 16px;
    line-height: 1.6;

    transition:
        background-color 0.2s ease,
        color 0.2s ease;
}

a {
    color: var(--link);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

img {
    max-width: 100%;
}

.container {
    width: min(1120px, calc(100% - 40px));
    margin: 0 auto;
}


/* ==========================================================
   TOP NAVIGATION
   ========================================================== */

.site-header {
    width: 100%;

    background: var(--header-bg);

    border-bottom: 1px solid var(--border);
}

.nav-wrap {
    min-height: 64px;

    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* LEFT NAME IN NAV */

.site-title {
    color: var(--heading);

    font-size: 1rem;
    font-weight: 600;

    text-decoration: none;
}

.site-title:hover {
    text-decoration: none;
}


/* RIGHT NAVIGATION */

nav {
    display: flex;
    align-items: center;

    gap: 28px;
}

nav a,
.theme-toggle {
    color: var(--text);

    font-family: inherit;
    font-size: 0.94rem;
    font-weight: 500;

    text-decoration: none;
}

nav a:hover {
    color: var(--link);
    text-decoration: none;
}


/* THEME BUTTON */

.theme-toggle {
    border: 0;
    background: transparent;

    padding: 5px;

    cursor: pointer;
}

.theme-toggle:hover {
    color: var(--link);
}


/* ==========================================================
   SHARED PAGE LAYOUT
   LEFT PROFILE + RIGHT CONTENT
   ========================================================== */

.page-layout {
    display: grid;

    grid-template-columns: 280px minmax(0, 1fr);

    column-gap: 72px;

    align-items: start;

    padding-top: 48px;
    padding-bottom: 60px;
}


/* ==========================================================
   LEFT PROFILE SIDEBAR
   ========================================================== */

.profile-sidebar {
    width: 280px;

    text-align: left;
}


/* KEEP YOUR CURRENT IMAGE SIZE AND FRAME */

.profile-photo {
    display: block;

    width: 180px;
    height: 220px;

    object-fit: cover;
    object-position: center top;

    border-radius: 0;

    margin: 0 0 18px 0;
}


/* NAME */

.profile-name {
    margin: 0 0 7px 0;

    color: var(--heading);

    font-size: 1.25rem;
    font-weight: 700;
    line-height: 1.3;
}


/* PROFILE INFORMATION */

.profile-details {
    color: var(--muted);

    font-size: 0.88rem;
    line-height: 1.55;
}

.profile-details span {
    display: block;
}

.profile-details a {
    font-size: inherit;
}


/* SOCIAL ICONS */

.social-links {
    display: flex;
    align-items: center;

    gap: 13px;

    margin-top: 13px;
}

.social-links a {
    color: var(--muted);

    font-size: 1.18rem;
}

.social-links a:hover {
    color: var(--link);
    text-decoration: none;
}


/* ==========================================================
   RIGHT PAGE CONTENT
   ========================================================== */

.page-content {
    width: 100%;
    max-width: 780px;

    min-width: 0;
}


/* MAIN PAGE HEADING */

.page-content > h1:first-child,
.home-name {
    margin-top: 0;
    margin-bottom: 22px;

    color: var(--heading);

    font-size: 2rem;
    font-weight: 700;
    line-height: 1.25;
}


/* GENERAL HEADINGS */

.page-content h2 {
    margin-top: 36px;
    margin-bottom: 10px;

    color: var(--heading);

    font-size: 1.45rem;
    line-height: 1.3;
}

.page-content h3 {
    margin-top: 25px;
    margin-bottom: 6px;

    color: var(--heading);

    font-size: 1.1rem;
    line-height: 1.4;
}


/* PARAGRAPHS */

.page-content p {
    margin-top: 0;
    margin-bottom: 17px;

    line-height: 1.67;
}

.hero-summary {
    margin-top: 0;
    margin-bottom: 17px;

    line-height: 1.67;
}


/* SECTION DIVIDERS */

.research-heading {
    padding-bottom: 7px;

    border-bottom: 1px solid var(--border);
}


/* ==========================================================
   HOMEPAGE BUTTONS
   ========================================================== */

.hero-actions {
    display: flex;
    flex-wrap: wrap;

    gap: 9px;

    margin-top: 22px;
}

.button {
    display: inline-block;

    padding: 8px 13px;

    border: 1px solid var(--border);
    border-radius: 3px;

    background: var(--button-bg);
    color: var(--text);

    font-size: 0.85rem;
    font-weight: 500;

    text-decoration: none;
}

.button:hover {
    background: var(--button-hover);

    text-decoration: none;
}


/* ==========================================================
   RESEARCH INTERESTS
   ========================================================== */

.interests {
    display: flex;
    flex-wrap: wrap;

    gap: 7px;

    margin-top: 18px;
}

.interests span {
    padding: 5px 9px;

    border: 1px solid var(--border);
    border-radius: 3px;

    color: var(--muted);

    font-size: 0.77rem;
}


/* ==========================================================
   RESEARCH PAGE
   ========================================================== */

.paper {
    margin-bottom: 34px;
}

.paper h3 {
    margin-bottom: 5px;
}

.paper p {
    margin-bottom: 9px;
}

.publications-heading {
    margin-top: 38px;
}

.first-publication {
    margin-top: 0;
}


/* ==========================================================
   TEACHING PAGE
   ========================================================== */

.teaching-section h3 {
    margin-top: 28px;
    margin-bottom: 8px;

    color: var(--heading);

    font-size: 1.08rem;
    font-weight: 600;
}

.institution-gap {
    height: 22px;
}


/* ==========================================================
   CONTACT
   ========================================================== */

.contact-social {
    margin-top: 28px;
}

.contact-social-title {
    margin-bottom: 12px;

    font-weight: 500;
}


/* ==========================================================
   CV PAGE
   ========================================================== */

.cv-frame {
    width: 100%;
    height: 900px;

    margin-top: 15px;

    border: 1px solid var(--border);
}


/* ==========================================================
   FOOTER
   ========================================================== */

footer {
    border-top: 1px solid var(--border);

    color: var(--muted);

    font-size: 0.82rem;
}

.footer-wrap {
    display: flex;
    align-items: center;
    justify-content: space-between;

    min-height: 65px;
}


/* ==========================================================
   TABLET / MOBILE
   ========================================================== */

@media (max-width: 768px) {

    .container {
        width: calc(100% - 30px);
    }


    /* NAVIGATION */

    .nav-wrap {
        min-height: auto;

        padding: 13px 0;

        flex-direction: column;

        gap: 10px;
    }

    nav {
        flex-wrap: wrap;
        justify-content: center;

        gap: 9px 18px;
    }


    /* PAGE */

    .page-layout {
        display: block;

        padding-top: 28px;
        padding-bottom: 40px;
    }


    /* PROFILE */

    .profile-sidebar {
        width: 100%;

        margin-bottom: 35px;

        text-align: center;
    }

    .profile-photo {
        width: 180px;
        height: 220px;

        margin-left: auto;
        margin-right: auto;
    }

    .profile-details {
        text-align: center;
    }

    .social-links {
        justify-content: center;
    }


    /* CONTENT */

    .page-content {
        max-width: none;
    }

    .page-content > h1:first-child,
    .home-name {
        font-size: 1.8rem;
    }


    /* CV */

    .cv-frame {
        height: 650px;
    }


    /* FOOTER */

    .footer-wrap {
        justify-content: center;

        text-align: center;
    }
}


/* ==========================================================
   SMALL PHONE
   ========================================================== */

@media (max-width: 420px) {

    body {
        font-size: 15px;
    }

    nav {
        gap: 8px 13px;
    }

    nav a,
    .theme-toggle {
        font-size: 0.85rem;
    }

    .page-content > h1:first-child,
    .home-name {
        font-size: 1.65rem;
    }

    .profile-name {
        font-size: 1.2rem;
    }

    .cv-frame {
        height: 520px;
    }
}

.abstract-toggle {
  margin-top: 8px;
  margin-bottom: 8px;
}

.abstract-toggle summary {
  cursor: pointer;
  list-style: none;
  font-weight: normal;
  display: inline-block;
}

.abstract-toggle summary::-webkit-details-marker {
  display: none;
}

/* Triangle when collapsed */
.abstract-toggle summary::before {
  content: "▶";
  display: inline-block;
  margin-right: 6px;
  font-size: 0.75em;
}

/* Triangle when expanded */
.abstract-toggle[open] summary::before {
  content: "▼";
}

.abstract-text {
  margin-top: 8px;
  line-height: 1.6;
}

.works-progress {
    padding-left: 25px;
    margin-top: 10px;
}

.works-progress li {
    margin-bottom: 14px;
    line-height: 1.6;
    padding-left: 5px;
}


/* =====================================
   TEACHING EVALUATION
===================================== */

.evaluation-details {
    width: 100%;
    margin-top: 12px;
    margin-left: 0;
    padding-left: 0;
}

.evaluation-details summary {
    cursor: pointer;
    font-weight: 600;
    margin-bottom: 15px;
}

.evaluation-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 15px;
    margin-bottom: 15px;
}

.evaluation-table th,
.evaluation-table td {
    text-align: left;
    padding: 8px 10px;
    border-bottom: 1px solid #ddd;
}

.evaluation-table th:last-child,
.evaluation-table td:last-child {
    text-align: center;
    width: 100px;
}

.evaluation-note {
    margin-top: 15px;
    margin-bottom: 20px;
}

.evaluation-details h4 {
    margin-top: 25px;
    margin-bottom: 15px;
}


/* Keep all questions aligned */

.evaluation-question {
    margin: 0 0 24px 0;
    padding: 0;
}

.evaluation-question-title {
    margin: 0 0 10px 0;
    padding: 0;
}


/* Keep every student comment aligned */

.evaluation-question blockquote {
    margin: 8px 0 8px 25px;
    padding-left: 14px;
    border-left: 3px solid #ccc;
}


/* Links below evaluation */

.teaching-links {
    margin-top: 20px;
    margin-left: 0;
}


/* =========================================
   RESPONSIVE NAVIGATION
========================================= */

/* Hamburger is NEVER visible on desktop */
.menu-toggle {
    display: none;
}


/* =========================================
   MOBILE ONLY
========================================= */

@media screen and (max-width: 768px) {

    /*
       Keep the title on the left and
       hamburger on the far right.
    */
    .nav-wrap {
        position: relative;
    }


    /* Hamburger button */
    .menu-toggle {
        display: flex;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        gap: 5px;

        position: absolute;
        right: 0;
        top: 50%;
        transform: translateY(-50%);

        width: 40px;
        height: 40px;

        margin: 0;
        padding: 6px;

        border: 0;
        background: transparent;
        cursor: pointer;

        z-index: 1001;
    }


    /* Three stripes */
    .menu-toggle span {
        display: block;
        width: 25px;
        height: 2px;
        margin: 0;
        padding: 0;

        background-color: currentColor;
        border-radius: 2px;

        transition: transform 0.25s ease,
                    opacity 0.25s ease;
    }


    /*
       Hide desktop navigation on mobile
       until hamburger is clicked.
    */
    .main-nav {
        display: none !important;

        position: absolute;
        top: calc(100% + 10px);
        right: 0;

        width: 190px;
        margin: 0;
        padding: 8px 0;

        background: var(--bg, #ffffff);
        border: 1px solid rgba(128, 128, 128, 0.25);
        border-radius: 6px;

        box-shadow: 0 6px 20px rgba(0, 0, 0, 0.12);

        z-index: 1000;
    }


    /* This is what actually opens the menu */
    .main-nav.menu-open {
        display: block !important;
    }


    /* Navigation links */
    .main-nav a {
        display: block;
        width: auto;

        margin: 0;
        padding: 10px 18px;

        text-align: left;
        white-space: nowrap;
    }


    /* Theme button inside mobile menu */
    .main-nav .theme-toggle {
        display: block;
        width: 100%;

        margin: 0;
        padding: 10px 18px;

        text-align: left;

        border: 0;
        background: transparent;
        cursor: pointer;
    }


    /* Turn hamburger into X when opened */

    .menu-toggle.menu-open span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .menu-toggle.menu-open span:nth-child(2) {
        opacity: 0;
    }

    .menu-toggle.menu-open span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }
}
