/* Custom Academic Theme - Warm with Dark Blue Accents */

:root {
  /* Warm background colors */
  --page-bg: #faf8f3;
  --content-bg: #ffffff;
  --sidebar-bg: #f5f2ea;
  --code-bg: #f7f5ef;
  --border-color: #d4cdb8;

  /* Dark blue primary colors */
  --primary-blue: #1e3a5f;
  --primary-blue-light: #2d5481;
  --primary-blue-dark: #0f2847;

  /* Accent colors */
  --accent-warm: #8b6f47;
  --accent-rust: #b85c38;
  --heading-color: #2c3e50;
  --text-color: #3a3a3a;
  --text-muted: #6b6b6b;

  /* Link colors */
  --link-color: #1e3a5f;
  --link-hover: #2d5481;
  --link-visited: #4a5f7f;
}

/* Base styling */
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  color: var(--text-color);
  background: var(--page-bg);
  line-height: 1.65;
  font-size: 16px;
  margin: 0;
  padding: 0;
}

/* Links */
a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

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

a:visited {
  color: var(--link-visited);
}

/* Main content area */
.ltx_page_main {
  background: var(--page-bg);
  margin-top: 60px;
  min-height: calc(100vh - 60px);
}

.ltx_page_content {
  max-width: 900px;
  margin: 0 auto;
  padding: 2rem 2.5rem;
  background: var(--content-bg);
  box-shadow: 0 0 30px rgba(0, 0, 0, 0.06);
  border-radius: 4px;
}

/* Headings */
.ltx_title_document,
.ltx_title,
.ltx_title_section,
.ltx_title_subsection,
.ltx_title_subsubsection {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
  font-weight: 600;
  color: var(--primary-blue);
  line-height: 1.3;
}

.ltx_title_document {
  font-size: 2.5rem;
  margin-top: 1rem;
  margin-bottom: 0.5rem;
  border-bottom: 3px solid var(--primary-blue);
  padding-bottom: 0.75rem;
}

.ltx_title_section {
  font-size: 2rem;
  margin-top: 2.5rem;
  margin-bottom: 1rem;
  color: var(--primary-blue-dark);
}

.ltx_title_subsection {
  font-size: 1.5rem;
  margin-top: 1.8rem;
  margin-bottom: 0.8rem;
  color: var(--primary-blue-light);
}

.ltx_title_subsubsection {
  font-size: 1.2rem;
  margin-top: 1.4rem;
  margin-bottom: 0.6rem;
  color: var(--heading-color);
}

/* Author and date */
.ltx_authors {
  color: var(--text-muted);
  font-size: 1.1rem;
  margin-top: 0.5rem;
}

.ltx_dates {
  color: var(--text-muted);
  font-size: 0.95rem;
  font-style: italic;
  margin-bottom: 2rem;
}

/* Paragraphs */
.ltx_para {
  margin: 0 0 1rem;
  text-align: justify;
}

/* Theorem environments */
.ltx_theorem,
.ltx_definition,
.ltx_lemma,
.ltx_proposition,
.ltx_corollary,
.ltx_remark,
.ltx_example {
  border-left: 4px solid var(--primary-blue);
  background: rgba(30, 58, 95, 0.04);
  padding: 1rem 1.25rem;
  margin: 1.2rem 0;
  border-radius: 2px;
}

.ltx_theorem .ltx_title_theorem,
.ltx_definition .ltx_title_definition,
.ltx_lemma .ltx_title_lemma,
.ltx_proposition .ltx_title_proposition {
  font-weight: 700;
  color: var(--primary-blue-dark);
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.ltx_proof {
  border-left: 3px solid var(--accent-warm);
  background: rgba(139, 111, 71, 0.03);
  padding: 0.8rem 1.25rem;
  margin: 1rem 0 1.5rem;
}

.ltx_proof .ltx_title_proof {
  font-style: italic;
  color: var(--accent-warm);
  font-weight: 600;
}

/* Lists */
.ltx_itemize,
.ltx_enumerate {
  padding-left: 2rem;
  margin-bottom: 1rem;
}

.ltx_item {
  margin-bottom: 0.4rem;
}

/* Tables */
.ltx_table,
.ltx_tabular {
  border-collapse: separate;
  border-spacing: 0;
  margin: 1.5rem auto;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.ltx_table th,
.ltx_tabular th {
  background: var(--primary-blue);
  color: white;
  padding: 0.75rem 1rem;
  font-weight: 600;
  text-align: left;
  border: none;
}

.ltx_table td,
.ltx_tabular td {
  padding: 0.65rem 1rem;
  border: none;
  border-bottom: 1px solid var(--border-color);
}

.ltx_table tr:nth-child(even) td,
.ltx_tabular tr:nth-child(even) td {
  background: var(--code-bg);
}

/* Code and verbatim */
.ltx_code,
.ltx_verbatim {
  font-family: 'Consolas', 'Monaco', 'Courier New', monospace;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  padding: 0.2rem 0.4rem;
  border-radius: 3px;
  font-size: 0.9em;
}

/* Math display */
.ltx_equation,
.ltx_equationgroup {
  margin: 1.5rem 0;
  overflow-x: auto;
}

/* Top banner */
.top-banner {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 60px;
  background: var(--primary-blue);
  color: white;
  display: flex;
  align-items: center;
  padding: 0 1.5rem;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
  z-index: 1000;
}

.burger-menu {
  width: 30px;
  height: 24px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  cursor: pointer;
  margin-right: 1rem;
}

.burger-menu span {
  display: block;
  height: 3px;
  background: white;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.burger-menu.active span:nth-child(1) {
  transform: rotate(45deg) translate(8px, 8px);
}

.burger-menu.active span:nth-child(2) {
  opacity: 0;
}

.burger-menu.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.banner-title-link {
  text-decoration: none;
  color: white;
  display: flex;
  align-items: center;
  flex: 1;
  overflow: hidden;
}

.banner-title-link:hover {
  text-decoration: none;
  opacity: 0.9;
}

.banner-title-link:visited {
  color: white;
}

.banner-title {
  font-size: 1.2rem;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Navigation sidebar */
.ltx_page_navbar {
  background: var(--sidebar-bg);
  border-right: 2px solid var(--border-color);
  padding: 1.5rem;
  position: fixed;
  top: 60px;
  left: 0;
  bottom: 0;
  width: 280px;
  overflow-y: auto;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
  z-index: 999;
}

/* Hide the home page link at the top of the navbar */
.ltx_page_navbar > a[rel="start"] {
  display: none;
}

.ltx_page_navbar.open {
  transform: translateX(0);
  box-shadow: 4px 0 12px rgba(0, 0, 0, 0.1);
}

.ltx_page_navbar a {
  color: var(--primary-blue);
  padding: 0.4rem 0.6rem;
  display: block;
  border-radius: 3px;
  transition: background 0.2s ease;
  word-wrap: break-word;
  overflow-wrap: break-word;
  white-space: normal;
}

.ltx_page_navbar a:hover {
  background: rgba(30, 58, 95, 0.08);
  text-decoration: none;
  color: var(--primary-blue-dark);
}

/* Overlay for mobile */
.sidebar-overlay {
  display: none;
  position: fixed;
  top: 60px;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
}

.sidebar-overlay.active {
  display: block;
}

/* TOC */
.ltx_TOC {
  background: var(--code-bg);
  padding: 1.5rem;
  border-radius: 4px;
  border: 1px solid var(--border-color);
  margin: 2rem 0;
}

.ltx_TOC h6 {
  color: var(--primary-blue-dark);
  font-size: 1.1rem;
  font-weight: 700;
  margin-bottom: 1rem;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Helvetica Neue', Arial, sans-serif;
}

.ltx_toclist {
  list-style: none;
  padding-left: 0;
}

.ltx_tocentry {
  margin: 0.3rem 0;
}

.ltx_tocentry a {
  color: var(--link-color);
  padding: 0.2rem 0;
  display: inline-block;
}

/* Page header/footer */
.ltx_page_header {
  display: none;
}

.ltx_page_footer {
  padding: 1rem 2.5rem;
  background: var(--sidebar-bg);
  border-top: 1px solid var(--border-color);
  margin-top: 3rem;
}

/* Bibliography */
.ltx_bibitem {
  margin-bottom: 0.8rem;
}

.ltx_bib_author {
  font-weight: 600;
  color: var(--primary-blue-dark);
}

/* Responsive design */
@media (min-width: 1024px) {
  /* On large screens, show sidebar by default but allow collapsing */
  .ltx_page_navbar {
    transform: translateX(0);
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
  }

  .ltx_page_main {
    margin-left: 280px;
    transition: margin-left 0.3s ease;
  }

  /* When sidebar is closed on desktop */
  body.sidebar-closed .ltx_page_navbar {
    transform: translateX(-100%);
    box-shadow: none;
  }

  body.sidebar-closed .ltx_page_main {
    margin-left: 0;
  }

  .sidebar-overlay {
    display: none !important;
  }
}

@media (max-width: 768px) {
  body {
    font-size: 15px;
  }

  .ltx_page_content {
    padding: 1.5rem;
  }

  .ltx_title_document {
    font-size: 2rem;
  }

  .ltx_title_section {
    font-size: 1.6rem;
  }
}

/* Print styles */
@media print {
  body {
    background: white;
  }

  .ltx_page_navbar {
    display: none;
  }

  .ltx_page_content {
    box-shadow: none;
    max-width: 100%;
  }
}
