/* Site-specific overrides on top of the just-the-docs Franklin template.
   Keeps the typography and purple/plum palette of the original website
   (https://people.eecs.berkeley.edu/~gireeja/), with maroon accents:
   purple = links and the name; maroon = headings, dates, venues and details. */

:root {
  --purple: #7300e6;       /* primary accent from the original site */
  --purple-light: #f3ebfd; /* light tint for backgrounds */
  --plum: #993366;         /* secondary accent from the original site */
  --maroon: #7b1e3a;       /* headings, dates, venues, current-page marker */
  --maroon-light: #f6e8ed; /* light maroon tint for list rules and the photo ring */
  --warm-bg: #faf5f7;      /* sidebar / top bar background */
  --warm-rule: #f0e2e8;    /* sidebar dividers */
  --font-main: avenir, 'avenirnext', helvetica, arial, sans-serif;
  --sidebar-width: 195px;
}

/* Match the exact font family and 17px base size of people.eecs.berkeley.edu/~gireeja/ */
html,
body,
.side-bar,
.side-bar .header .title,
.menu-list,
.menu-list-item,
.menu-list-link,
.franklin-content,
.franklin-content h1,
.franklin-content h2,
.franklin-content h3,
.franklin-content h4,
.franklin-content p,
.franklin-content li,
.page-foot {
  font-family: var(--font-main);
}

html {
  font-size: 17px;
}

@media (min-width: 31.25rem) {
  html {
    font-size: 17px;
  }
}

body {
  font-size: 17px;
  color: #333333;
}

a,
.franklin-content a,
.show-menu {
  color: var(--purple);
  text-decoration: none;
}

a:hover,
.franklin-content a:hover {
  text-decoration: underline;
}

/* The template truncates every link to one line with an ellipsis;
   let long links (paper titles, bio links) wrap normally. */
.franklin-content a {
  white-space: normal;
  overflow: visible;
  text-overflow: clip;
}

/* Uniform 17px font size and readable rhythm across paragraphs and lists */
.franklin-content p,
.franklin-content ul,
.franklin-content ol,
.franklin-content li {
  font-size: 1rem;
  line-height: 1.45;
}

.franklin-content p {
  margin: 0 0 1rem;
}

/* Compact bullet lists: Franklin wraps each bullet's text in a <p>, whose
   bottom margin made lists (e.g. Group, Media) look double-spaced. */
.franklin-content li > p:only-child {
  margin: 0;
}

.franklin-content ul > li {
  margin-top: 0.2rem;
  margin-bottom: 0;
}

/* Extra-compact pages (wrapped in @@compact ... @@, e.g. Group) */
.franklin-content .compact ul > li {
  margin-top: 0;
  line-height: 1.3;
}

.franklin-content .compact li > p {
  line-height: 1.3;
}

.franklin-content .compact ul {
  margin-top: 0;
  margin-bottom: 0.5rem;
}

.franklin-content .compact h2 {
  margin: 1.25rem 0 0.4rem;
}

/* Heading scale: same font family, clean medium weight like the original site.
   Headings are maroon; purple is reserved for links and the name. */
.franklin-content h1,
.franklin-content h2,
.franklin-content h3,
.franklin-content h4 {
  color: var(--maroon);
  font-weight: 500;
}

.franklin-content h1 {
  font-size: 28px;
  line-height: 1.2;
}

.franklin-content h2 {
  font-size: 22px;
  line-height: 1.3;
  margin: 2rem 0 0.75rem;
  padding-bottom: 0.3rem;
  /* purple -> maroon rule that fades out */
  border-bottom: 2px solid transparent;
  border-image: linear-gradient(90deg, var(--purple), var(--maroon) 45%, var(--warm-rule) 75%) 1;
}

.franklin-content h3 {
  font-size: 18px;
  margin: 1.4rem 0 0.4rem;
}

.franklin-content h3 a {
  color: var(--purple);
}

/* Franklin wraps every heading in a self-link; keep it the heading color. */
.franklin-content h1 a.header-anchor,
.franklin-content h2 a.header-anchor,
.franklin-content h3 a.header-anchor,
.franklin-content h4 a.header-anchor {
  color: inherit;
}

/* Thin purple -> maroon bar across the top of every page */
.page-wrap::before {
  content: "";
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 4px;
  background: linear-gradient(90deg, var(--purple), var(--maroon));
  z-index: 300;
}

/* Warm sidebar (also the top bar on phones) */
.side-bar {
  background-color: var(--warm-bg);
}

.side-bar .header {
  border-bottom-color: var(--warm-rule);
}

@media (min-width: 50rem) {
  .side-bar {
    border-right: 1px solid var(--warm-rule);
  }
}

/* Narrow left sidebar and centered main content column */
@media (min-width: 50rem) {
  .side-bar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
    align-items: flex-start;
  }

  .side-bar .header,
  .side-bar .menu,
  .side-bar .footer {
    width: 100%;
    box-sizing: border-box;
    padding-left: 1.35rem;
    padding-right: 1rem;
  }

  .side-bar .header .title {
    padding-left: 0;
    padding-right: 0;
  }

  .side-bar .menu {
    padding-top: 2rem;
  }

  .main-content-wrap {
    left: var(--sidebar-width);
    width: calc(100% - var(--sidebar-width));
  }

  .main-content {
    max-width: 840px;
    margin-left: auto;
    margin-right: auto;
  }
}

@media (min-width: 66.5rem) {
  .side-bar {
    width: var(--sidebar-width);
    min-width: var(--sidebar-width);
  }

  .main-content {
    margin-left: auto;
    margin-right: auto;
  }
}

/* Sidebar typography */
.side-bar .header .title {
  color: var(--purple);
  font-size: 21px !important;
  font-weight: 400;
  white-space: nowrap;
}

.menu-list-item {
  font-size: 17px !important;
}

/* Narrow mode (bar on top): the template gives the title a fixed 150px box,
   which clips the name. Let the title take the space it needs and keep the
   MENU toggle on the right. */
@media (max-width: 49.99rem) {
  .side-bar .header {
    width: auto;
    flex: 1 1 auto;
    min-width: 0;
  }

  .show-menu {
    width: auto;
    flex: 0 0 auto;
    padding-left: 1rem;
    padding-right: 1.25rem;
    background-color: var(--warm-bg); /* same as the rest of the top bar */
  }
}

.menu-list-link:hover {
  color: var(--maroon);
}

/* Current page: maroon text with a maroon bar on its left */
.menu-list-link.active {
  color: var(--maroon);
  font-weight: 500;
  border-left: 3px solid var(--maroon);
  padding-left: 0.55rem;
  margin-left: calc(-0.55rem - 3px);
}

.menu-list-item.active::before,
.menu-list-link.active::before {
  color: var(--maroon);
}

.side-bar .footer {
  color: var(--plum);
  font-size: 14px;
  line-height: 1.4;
}

.main-header {
  font-size: 17px;
}

.main-header .sep {
  color: #ccc;
  margin: 0 0.5rem;
}

/* Profile block on the home page */
.profile {
  display: flex;
  gap: 1.75rem;
  align-items: center;
  margin: 0.5rem 0 1.5rem;
}

/* Needs .franklin-content in the selector to beat the template's
   `.franklin-content img { width: 70%; padding-left: 10% }`. */
.franklin-content img.profile-photo {
  width: 210px;
  height: auto;
  max-width: 40%;
  padding-left: 0;
  border-radius: 8px;
  /* white gap, thin maroon-tinted ring, soft shadow */
  box-shadow: 0 0 0 3px #fff, 0 0 0 5px var(--maroon-light), 0 4px 14px rgba(123, 30, 58, 0.18);
  flex-shrink: 0;
}

.profile-info { min-width: 0; }

.franklin-content .profile-name {
  color: var(--purple);
  margin: 0 0 0.35rem !important;
  font-size: 28px;
  font-weight: 400;
  line-height: 1.15;
}

.franklin-content .profile-role {
  font-size: 1rem;
  margin: 0 0 0.5rem;
}

.franklin-content .profile-contact {
  font-size: 1rem;
  line-height: 1.55;
  margin: 0;
}

@media (max-width: 600px) {
  .profile { flex-direction: column; align-items: flex-start; gap: 1rem; }
  .franklin-content img.profile-photo { width: 130px; max-width: 50%; }
}

/* Publication lists — same 17px font as the rest of the site */
.franklin-content ul.pub-list {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.franklin-content li.pub {
  padding: 0.55rem 0 0.55rem 0.9rem;
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  border-left: 3px solid var(--maroon-light);
  border-bottom: 1px dashed #bbbbbb;
  transition: border-color 150ms ease, background-color 150ms ease;
}

.franklin-content li.pub:hover {
  border-left-color: var(--maroon);
  background-color: #fcf7f9;
}

.pub-title {
  font-family: 'AvenirNext-Italic', avenir, helvetica, arial, sans-serif;
  font-style: italic;
  font-size: 1rem;
}

.pub-authors {
  color: #333333;
  font-size: 1rem;
}

.pub-venue {
  color: var(--maroon);
  font-size: 1rem;
}

.pub-note {
  font-size: 0.9rem;
  color: #666666;
}

/* Teaching page — course list (generated from data/teaching.yaml) */
.course-title {
  font-weight: 500;
}

.course-role {
  color: #555555;
}

.course-terms {
  color: var(--maroon);
}

.course-links {
  font-size: 0.95rem;
}

/* Updates (news) list on the home page and /updates/ —
   generated from data/updates.yaml by tools/build_sites.py */
.franklin-content ul.updates {
  list-style: none;
  padding-left: 0;
  margin-left: 0;
}

.franklin-content ul.updates > li {
  display: flex;
  gap: 1rem;
  padding: 0.4rem 0 0.4rem 0.9rem;
  margin: 0;
  font-size: 1rem;
  line-height: 1.45;
  border-left: 3px solid var(--maroon-light);
  transition: border-color 150ms ease, background-color 150ms ease;
}

.franklin-content ul.updates > li::before {
  content: none;
}

.franklin-content ul.updates > li:hover {
  border-left-color: var(--maroon);
  background-color: #fcf7f9;
}

.update-date {
  flex: 0 0 6.75rem;
  color: var(--maroon);
  white-space: nowrap;
}

.update-text {
  flex: 1;
  min-width: 0;
}

@media (max-width: 600px) {
  .franklin-content ul.updates > li { flex-direction: column; gap: 0.1rem; }
  .update-date { flex-basis: auto; }
}
