/* global styles for personal website using CSS variables */
:root {
    /* light-mode defaults */
    --bg-body: #f9f9f9;
    --text-color: #333;
    --bg-header: #ffffff;
    --bg-nav: #f0f0f0;
    --bg-section: #ffffff;
    --link-color: #0066cc;
    --link-hover: #0055aa;
    --heading-color: #0059b3;
    --subheading-color: #333;
    --footer-bg: #333;
    --footer-text: #fff;
    --pic-border: transparent;
    --border-color: #0088dd;
    --code-bg: #f4f4f4;
    --code-text: inherit;
    --bg-banner: var(--bg-section);
    --bg-banner-button: rgba(0,102,204,0.2);
    --banner-button-hover: rgba(0,102,204,0.4);
    --banner-button-color: rgb(17, 77, 136);
    --bg-theme-toggle: rgba(0,0,0,0.5);
}

/* dark-mode overrides via toggle class */
.dark-mode {
    --bg-body: #121212;
    --text-color: #e0e0e0;
    --bg-header: #1e1e1e;
    --bg-nav: #242424;
    --bg-section: #1e1e1e;
    --link-color: #71b0f0;
    --link-hover: #aedfff;
    --heading-color: #5494c5;
    --subheading-color: #2d6dac;
    --footer-bg: #1e1e1e;
    --footer-text: #e0e0e0;
    --pic-border: transparent;
    --border-color: var(--subheading-color);
    --code-bg: #2b2b2b;
    --code-text: #f8f8f2;
    --bg-banner: var(--bg-section);
    --bg-banner-button: rgba(255,255,255,0.2);
    --banner-button-hover: rgba(255,255,255,0.4);
    --banner-button-color: white;
    --bg-theme-toggle: rgba(255,255,255,0.5);
}

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

body {
    font-family: 'Arial', sans-serif;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--bg-body);
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

main {
    flex: 1 0 auto;
}

header {
    position: relative;
    background-color: var(--bg-header);
    padding: 20px;
    border-bottom: 1px solid var(--border-color);
    text-align: center;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
    line-height: 1.1em;
}

header p {
    font-size: 1.1em;
    color: #666;
}

nav {
    background-color: var(--bg-nav);
    padding: 10px;
    text-align: center;
    border-bottom: 1px solid var(--border-color);
}

nav a {
    text-decoration: none;
    color: var(--link-color);
    margin: 0 20px;
    font-weight: bold;
}

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

#theme-toggle {
    position: absolute;
    top: 20px;
    right: 20px;
    background: var(--bg-theme-toggle);
    border: none;
    font-size: 1.2em;
    cursor: pointer;
    margin-left: 20px;
    border-radius: 25%;
    padding: 2px;
}

main {
    width: 100%;           /* fill most of viewport but leave margin */
    max-width: 900px;     /* cap on large screens */
    margin: 30px auto;
    padding: 0 20px;
}

section {
    background-color: var(--bg-section);
    margin-bottom: 20px;
    padding: 25px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    box-sizing: border-box;
}

section h2 {
    overflow: hidden;
    color: var(--heading-color);
    margin-bottom: 15px;
    border-bottom: 2px solid var(--heading-color);
    padding-bottom: 10px;
}

h3 {
    color: var(--subheading-color);
    margin-top: 15px;
}

.contact-info {
    overflow: hidden;
    background-color: var(--bg-nav);
    padding: 15px;
    margin: 10px 0;
    border-left: 4px solid var(--border-color);
}

.publication, .project {
    margin: 15px 0;
    padding: 10px;
    border-left: 3px solid var(--border-color);
    padding-left: 15px;
}

footer {
    background-color: var(--footer-bg);
    color: var(--footer-text);
    text-align: center;
    padding: 20px;
}

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

a:hover {
    text-decoration: underline;
}

/* profile picture styling */
.profile-pic {
    margin-left: 20px;
    margin-bottom: 0px;
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    border-radius: 10%;
    border: 2px solid var(--pic-border);
    display: block;
}

/* inline code blocks */
code, pre {
    background-color: var(--code-bg);
    padding: 2px 4px;
    border-radius: 5px;
    font-family: monospace;
    color: var(--code-text);
}

/* Slideshow for teaching feedback; from ChatGPT */
.banner {
    position: relative;
    max-width: 900px;
    overflow: hidden;
    background: var(--bg-banner);
    color: var(--text-color);
    margin-bottom: 20px;
    padding: 10px;
    border-radius: 5px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    text-align: right;
    font-size: 0.8rem;
    line-height: 1.4;
}

.slider {
  display: flex;
  transition: transform 0.6s ease-in-out;
  width: 100%;
}

.slide {
  min-width: 100%;
  padding: 20px 40px;
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
  font-size: 1.2rem;
  line-height: 1.6;
}

/* Buttons */
.banner button {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: var(--bg-banner-button);
  border: none;
  color: var(--banner-button-color);
  font-size: 18px;
  padding: 8px 14px;
  cursor: pointer;
  border-radius: 50%;
}

.prev { left: 15px; }
.next { right: 15px; }

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

/*table spacing*/
td, th {
  padding: 5px;
}

span {
  border-bottom: 1px dotted;        /* dotted underline */
  cursor: help;                     /* shows ? or help cursor */
}

.two-column {
  display: grid;
  grid-template-columns: 1fr 150px;
  gap: 20px;
}

/* box where the content changes depending on the size of the box */
.size-reactive-box {
    container-type: inline-size;
    display: block;
}

.full-size-content { display: inline; }
.compact-content { display: none; }

/* show/hide content based on container size */
@container (max-width: 160px) {
  .full-size-content { display: none; }
  .compact-content { display: inline; }
}