/* -------------------------------------------------
   Fonts
-------------------------------------------------- */

@import url("https://fonts.googleapis.com/css?family=Lato:400,400italic,700,700italic|Source+Code+Pro:400");

/* -------------------------------------------------
   Reset & base
-------------------------------------------------- */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
}

body {
  background: #ffffff;
  color: #000000;
  font-family: "Lato", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
  font-size: 16px;
  line-height: 1.75;
  -webkit-text-size-adjust: none;
}

/* Basic type */

a {
  color: #0047ab;
  text-decoration: none;
  transition: color 0.2s ease-in-out;
}

a:hover {
  text-decoration: underline;
}

strong,
b {
  font-weight: 700;
  /* color inherits (no gray override) */
}

em,
i {
  font-style: italic;
}

p {
  margin: 0 0 1.5em 0;
}

h1, h2, h3, h4, h5, h6 {
  color: #333333;
  font-weight: 700;
  line-height: 1.1;
  margin: 0 0 0.75em 0;
}

h1 a, h2 a, h3 a, h4 a, h5 a, h6 a {
  color: inherit;
  text-decoration: none;
}

h1 { font-size: 2.25em; }
h2 { font-size: 2em; }
h3 { font-size: 1.6em; }
h4 { font-size: 1.25em; }
h5 { font-size: 0.95em; }
h6 { font-size: 0.8em; }

sub {
  font-size: 0.8em;
  position: relative;
  top: 0.3em;
}

sup {
  font-size: 0.8em;
  position: relative;
  top: -0.3em;
}

hr {
  border: 0;
  border-bottom: 2px solid #f4f4f4;
  margin: 2em 0;
}

.align-left   { text-align: left; }
.align-center { text-align: center; }
.align-right  { text-align: right; }

code {
  background: #555555;
  border-radius: 4px;
  color: #ffffff;
  font-family: "Source Code Pro", monospace;
  font-size: 0.9em;
  padding: 0.2em 0.5em;
}

pre {
  font-family: "Source Code Pro", monospace;
  font-size: 0.9em;
  margin: 0 0 1.5em 0;
}

pre code {
  display: block;
  overflow-x: auto;
  padding: 1em 1.5em;
}

/* -------------------------------------------------
   Lists (generic)
-------------------------------------------------- */

ol {
  list-style: decimal;
  margin: 0 0 1.5em 0;
  padding-left: 1.25em;
}

ol li {
  padding-left: 0.25em;
}

ul {
  list-style: disc;
  margin: 0 0 1.5em 0;
  padding-left: 1em;
}

ul li {
  padding-left: 0.5em;
}

/* -------------------------------------------------
   Container
-------------------------------------------------- */

.container {
  margin: 0 auto;
  max-width: calc(100% - 4.5em);
  width: 45em;
}

.container.max {
  width: 100%;
}

@media screen and (max-width: 1024px) {
  .container {
    width: 100% !important;
  }
}

@media screen and (max-width: 480px) {
  .container {
    max-width: calc(100% - 3.375em);
  }
}

/* -------------------------------------------------
   Section / Article headers
-------------------------------------------------- */

section.special,
article.special {
  text-align: center;
}

header p {
  color: #777777;
  margin: 0 0 1.25em 0;
}

header h2 + p {
  font-size: 1.2em;
  margin-top: -0.4em;
}

/* Big section title (used on Research, Talks, etc.) */
header.major h2 {
  color: #7b1e1e; /* matches your home-name color */
  font-size: 2em;
}

header.major h2 + p {
  color: #000000;
  font-size: 1.4em;
  font-weight: 400;
  margin-top: -0.5em;
}

/* -------------------------------------------------
   Images (basic)
-------------------------------------------------- */

.image {
  border: 0;
  display: inline-block;
}

.image img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* -------------------------------------------------
   Layout: wrapper + main sections
-------------------------------------------------- */

#wrapper {
  background: #ffffff;
  padding-right: 17em; /* space for the right sidebar */
}

#main > section {
  border-top: 6px solid #f4f4f4;
}

#main > section:first-child {
  border-top: 0;
}

#main > section > .container {
  padding: 6em 0 4em 0;
}

@media screen and (max-width: 1680px) {
  #main > section > .container {
    padding: 4em 0 2em 0;
  }
}

@media screen and (max-width: 736px) {
  #main > section > .container {
    padding: 2em 0 0 0;
  }
}

/* -------------------------------------------------
   Sidebar header + nav (#header)
-------------------------------------------------- */

#header {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  background: #2559e9;        /* blue sidebar background */
  color: #ffffff;
  font-weight: 700;
  height: 100%;
  overflow-y: auto;
  position: fixed;
  text-align: center;
  top: 0;
  right: 0;
  width: 16em;
}

/* Titles inside sidebar */
#header h1,
#header h2,
#header h3,
#header h4,
#header h5,
#header h6 {
  color: #ffffff;
}

#header h1 a,
#header h2 a,
#header h3 a,
#header h4 a,
#header h5 a,
#header h6 a {
  color: #ffffff;
}

/* Sidebar top block (name, maybe a short text) */
#header > header {
  flex-shrink: 0;
  padding: 3em 2em;
}

#header > header p {
  color: #d2f2e9;
  font-style: italic;
  margin: 1em 0 0 0;
}

/* Sidebar bottom block (e.g., social icons if you ever add) */
#header > footer {
  flex-shrink: 0;
  padding: 2em;
}

/* Sidebar nav */
#header > nav {
  flex-grow: 1;
}

#header > nav ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

#header > nav ul li {
  display: block;
  padding: 0;
}

#header > nav ul li a {
  border: 0;
  color: #ffffff !important;
  display: block;
  padding: 0.85em 0;
  text-decoration: none;
}

/* Active page in nav */
#header > nav ul li a.active {
  background: #143cc2;     /* darker blue */
  color: #ffffff !important;
  font-weight: 700;
}

/* -------------------------------------------------
   Mobile header panel (#titleBar) + off-canvas nav
-------------------------------------------------- */

#titleBar {
  display: none; /* only visible on smaller screens */
}

/* Medium and below: convert sidebar into off-canvas menu */
@media screen and (max-width: 1024px) {

  html, body {
    overflow-x: hidden;
  }

  /* Off-canvas sidebar */
  #header {
    transform: translateX(17em);
    transition: transform 0.5s ease;
    z-index: 10002;
  }

  /* Main content shifts when menu opens */
  #wrapper {
    padding: 44px 0 1px 0;
    transition: transform 0.5s ease;
  }

  /* Mobile title bar with hamburger */
  #titleBar {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    height: 44px;
    width: 100%;
    background: #222222;
    color: #ffffff;
    z-index: 10001;
    min-width: 320px;
  }

  #titleBar .title {
    display: block;
    height: 44px;
    line-height: 44px;
    padding: 0 1em;
    font-weight: 700;
    text-align: left;
    color: #ffffff;
  }

  #titleBar .title a {
    border: 0;
    text-decoration: none;
    color: inherit;
  }

  /* Hamburger button */
  #titleBar .toggle {
    position: absolute;
    top: 0;
    right: 0;
    width: 64px;
    height: 44px;
    border: 0;
    outline: 0;
    text-decoration: none;
    cursor: pointer;
  }

  #titleBar .toggle::before {
    content: "≡";
    display: block;
    background: #2559e9;
    color: #ffffff;
    font-size: 20px;
    text-align: center;
    line-height: 44px;
  }

  /* When body.header-visible is toggled by JS */
  body.header-visible #wrapper,
  body.header-visible #titleBar {
    transform: translateX(-17em);
    transition: transform 0.5s ease;
  }

  body.header-visible #header {
    transform: translateX(0);
  }
}

/* Small screens: slightly smaller headings */
@media screen and (max-width: 736px) {
  body {
    font-size: 14px;
  }

  h2 { font-size: 1.75em; }
  h3 { font-size: 1.5em; }
  h4 { font-size: 1.1em; }

  header.major h2 {
    font-size: 2.4em;
  }

  header.major h2 + p {
    font-size: 1.3em;
  }
}

/* Extra-small: ensure min width */
@media screen and (max-width: 480px) {
  html, body {
    min-width: 320px;
  }
}

#mobile-header {
  display: none;
}

/* Show top bar and hide sidebar on small screens */
@media (max-width: 1050px) {
  /* hide right sidebar and remove right padding */
  #header {
    display: none;
  }

  #wrapper {
    padding-right: 0;
  }

  /* show mobile header */
  #mobile-header {
    display: block;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: #2559e9;      /* same blue as sidebar */
    color: #ffffff;
    box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  }

  .mobile-header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.6em 1em;
  }

  .mobile-title {
    display: flex;
    flex-direction: column;
  }

  .mobile-name {
    font-weight: 700;
    font-size: 1.05em;
  }

  .mobile-subtitle {
    font-size: 0.85em;
    opacity: 0.9;
  }

  .mobile-menu-toggle {
    border: none;
    background: transparent;
    color: #ffffff;
    font-size: 1.4em;
    line-height: 1;
    cursor: pointer;
    padding: 0.2em 0.4em;
  }

  /* dropdown menu */
  #mobile-nav {
    display: none;
    background: #2559e9;
    border-top: 1px solid rgba(255,255,255,0.2);
  }

  #mobile-nav ul {
    list-style: none;
    margin: 0;
    padding: 0.4em 0;
  }

  #mobile-nav li a {
    display: block;
    padding: 0.5em 1em;
    color: #ffffff;
    text-decoration: none;
  }

  #mobile-nav li a:hover,
  #mobile-nav li a.active {
    background: #143cc2;
  }

  /* when header has .open, show the menu */
  #mobile-header.open #mobile-nav {
    display: block;
  }

  /* push main content down so it isn't hidden behind header */
  #main {
    padding-top: 70px;  /* tweak if needed */
  }
}

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

  /* Hide old title bar */
  #titleBar {
    display: none !important;
  }

  /* Prevent HTML5UP from sliding content */
  body.header-visible #wrapper,
  body.header-visible #titleBar,
  body.header-visible #header {
    transform: none !important;
  }

  /* Reset wrapper transforms */
  #wrapper {
    transform: none !important;
  }

  /* Ensure sidebar stays hidden */
  #header {
    transform: none !important;
    display: none !important;
  }
}