/* Global reset */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
}

/* Color palette */
:root {
  /* Black to White - 10% lightness steps (HSL format for easy use) */
  --gray-0: hsl(0 0% 0%);   /* Pure black */
  --gray-10: hsl(0 0% 10%);
  --gray-20: hsl(0 0% 20%);
  --gray-30: hsl(0 0% 30%);
  --gray-40: hsl(0 0% 40%);
  --gray-50: hsl(0 0% 50%); /* Mid gray */
  --gray-60: hsl(0 0% 60%);
  --gray-70: hsl(0 0% 70%);
  --gray-80: hsl(0 0% 80%);
  --gray-90: hsl(0 0% 90%);
  --gray-100: hsl(0 0% 100%); /* Pure white */

  --text: var(--gray-10);
  --text-muted: var(--gray-40);
  --accent: #a044ff;
}

/* Base body styling */
body {
  font-family: 'Arial', sans-serif;
  background: var(--gray-100);
  background-attachment: fixed;
  color: var(--gray-10);
  min-height: 100vh;
  line-height: 1.6;
  display: flex;
  flex-direction: column;
}

/* =========
   LAYOUT
   ========= */

/* Wrapper around sidebar + main content (used in base-doc-viewer.html) */
.doc-viewer-layout-main {
  flex: 1;              /* fill space between header and footer */
  display: flex;
  align-items: stretch;
  width: 100%;
}

/* Sidebar: fixed width, scrolls if too tall */
.sidebar {
  flex: 0 0 250px;      /* No grow, no shrink, base 250px */
  max-width: 250px;
  background-color: var(--gray-90); /* Optional: light background */
  border-right: 1px solid var(--gray-10); /* Optional: separator */
  padding: 0.8rem 0.8rem;           /* Optional: content padding */
  overflow-y: auto;                 /* Scroll if content exceeds viewport height */
  height: 100vh;           /* sidebar spans the viewport vertically */
  position: sticky;        /* optional: stick while scrolling */
  top: 0;
} @media (max-width: 768px) {
  .sidebar {
    display: none;        /* Hide sidebar on small screens */
  }
}

/* Main content area (where {% block content %} lives) */
.container-main {
  flex: 1 1 auto;       /* Grow to fill, shrink if needed */
  min-width: 0;
  padding: 20px;
  box-sizing: border-box;
}

/* =========
   NAVBAR
   ========= */

.navbar {
  background-color: var(--gray-0);
  position: sticky;
  top: 0;
  width: 100%;
  z-index: 1000;
}

.nav-container {
  max-width: 1400px;
  margin: 0;
  padding: 0.8rem 0.8rem 0.8rem 0.8rem;
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
}

.navbar-toggler {
  border: none;
  background: transparent;
  cursor: pointer;
  padding-right: 1rem;
}

.hamburger-line {
  display: block;
  width: 25px;
  height: 3px;
  background-color: var(--gray-100);
  margin: 5px 0;
  transition: 0.3s;
}

.logo {
  display: flex;
  align-items: center;
  gap: 0;
  font-size: 1.5rem;
  font-weight: 500;
  color: var(--gray-100);
  text-decoration: none;
}

.logo span {
  font-family: 'Noto Sans', sans-serif;
  font-weight: 500;
  margin: 0;
  padding: 0;
}

.logo img {
  transform: scale(0.67);
  margin: 0;
  padding: 0;
}

.nav-links {
  display: flex;
  gap: 2rem;
  align-items: center;
}

.nav-links a {
  color: var(--text);
  text-decoration: none;
  transition: color 0.3s;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-item {
  display: flex;
  gap: 1.5rem;
  align-items: center;
  color: inherit;
  text-decoration: none;
}

/* Desktop - always show links horizontally */
@media (min-width: 992px) {
  .navbar-collapse {
    display: none !important;
  }

  .navbar-toggler {
    display: none;
  }
}

/* Mobile - hamburger and dropdown */
@media (max-width: 991px) {
  .navbar {
    flex-direction: column;
    background: var(--gray-0);
  }

  .nav-container {
    flex-wrap: wrap;
    justify-content: space-between;
  }

  .navbar-collapse {
    flex-basis: 100%;
    background: var(--gray-100);
    padding: 1rem;
    display: none;
  }

  .navbar-collapse.show {
    display: block;
  }

  .nav-links {
    flex-direction: column;
    gap: 1rem;
    align-items: flex-start;
    width: 100%;
  }

  .nav-links a {
    text-align: left;
    width: 100%;
  }
}

/* =========
   SIDEBAR CONTENT
   ========= */

.sidebar-menu {
  padding: 0 2rem;
}

/* Already handled: .sidebar as layout; keep display if needed on mobile */
.sidebar {
  /* display: block;  default; allow for overrides in media queries */
}

/* Directory items */
.dir-item {
  display: flex;
  align-items: center;
  cursor: pointer;
}

.dir-item a {
  text-decoration: none;
  color: var(--gray-10);
  font-size: 1rem;
}

.dir-text {
  margin-left: 4px;
  text-decoration: underline;
}

/* Document items under a dir */
.doc-item {
  display: flex;
  align-items: center;
  max-width: 250px;
  padding-left: 1rem;
}

/* wrapper that is shown/hidden */
.doc-span {
  display: flex;              /* keep icon + text on one line */
  align-items: center;
  min-width: 0;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* actual text node that should truncate */
.doc-text {
  margin-left: 4px;
  font-size: 0.9rem;
}

/* These are overridden by global .hide/.show */
.doc-item .hide {
  display: none;
}
.doc-item .show {
  display: inline !important;
}

/* =========
   DOC VIEWER CONTENT
   ========= */

/* Generic show/hide helpers used by JS */
.hide {
  display: none !important;
}
.show {
  display: block !important;
}

/* Demo content */
#documentDemoContent {
  padding: 1rem 20rem;
}

/* Real document content: use page scroll, not inner scroll */
#documentContent {
  white-space: pre-wrap;
  font-family: Arial, sans-serif;
  line-height: 1.6;
  padding: 1rem 20rem;
  box-sizing: border-box;
} @media (max-width: 1200px) {
  #documentContent {
    padding: 0 1rem;
  }
}
/* Document Container */
.odt-content {
    font-family: 'Segoe UI', 'Calibri', 'Arial', sans-serif;
    font-size: 16px;
    line-height: 1.8;
    color: #333;
    max-width: 900px;
    margin: 0 auto;
    padding: 1rem 2rem;
    background: white;
}

/* Headings */
.odt-content h1 {
    font-size: 2.5em;
    font-weight: 700;
    color: var(--gray-10);
    margin-top: 1.5em;
    margin-bottom: 0.5em;
    border-bottom: 3px solid var(--gray-70);
    padding-bottom: 10px;
}

.odt-content h2 {
    font-size: 2em;
    font-weight: 600;
    color: var(--gray-20);
    margin-top: 1.3em;
    margin-bottom: 0.5em;
    border-bottom: 2px solid var(--gray-70);
    padding-bottom: 8px;
}

.odt-content h3 {
    font-size: 1.6em;
    font-weight: 600;
    color: var(--gray-10);
    margin-top: 1.2em;
    margin-bottom: 0.5em;
}

.odt-content h4 {
    font-size: 1.3em;
    font-weight: 600;
    color: var(--gray-20);
    margin-top: 1.1em;
    margin-bottom: 0.5em;
}

.odt-content h5, .odt-content h6 {
    font-size: 1.1em;
    font-weight: 600;
    color: var(--gray-10);
    margin-top: 1em;
    margin-bottom: 0.5em;
}

/* Paragraphs */
.odt-content p {
    margin: 1em 0;
    text-align: justify;
    text-justify: inter-word;
}

/* Text Formatting */
.odt-content strong, .odt-content b {
    font-weight: 700;
    color: var(--gray-10);
}

.odt-content em, .odt-content i {
    font-style: italic;
}

.odt-content u {
    text-decoration: underline;
    text-decoration-color: var(--gray-70);
    text-underline-offset: 2px;
    font-size: 0.6em;         /* smaller text like a superscript */
    vertical-align: super;    /* make it sit above the baseline */
    line-height: 1;           /* keep normal line spacing */
    display: inline-block;    /* allows using top for fine tuning */
    position: relative;
    top: -0.35em;             /* tweak to taste */
}


/* Superscript and Subscript */
.odt-content sup {
    vertical-align: super;
    font-size: 0.75em;
    line-height: 0;
}

.odt-content sub {
    vertical-align: sub;
    font-size: 0.75em;
    line-height: 0;
}

/* Lists */
.odt-content ul, .odt-content ol {
    margin: 1.5em 0;
    padding-left: 40px;
}

.odt-content li {
    margin: 0.8em 0;
    line-height: 1.6;
}

.odt-content ul {
    list-style-type: disc;
}

.odt-content ul ul {
    list-style-type: circle;
    margin-top: 0.5em;
    margin-bottom: 0.5em;
}

.odt-content ol {
    list-style-type: decimal;
}

.odt-content ol ol {
    list-style-type: lower-alpha;
}

/* Images */
.odt-content img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 30px auto;
    border-radius: 4px;
}

/* Tables */
.odt-table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
    font-size: 0.95em;
}


/* keep aggressive breaks for second column but exclude anchors and wrapped URL spans */
.odt-table th:nth-child(2),
.odt-table td:nth-child(2) {
  white-space: normal;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-all;
}


.url-clickable {
    white-space: normal;
  overflow-wrap: anywhere;
  word-wrap: break-word;
  word-break: break-all;
}

.odt-table thead {
    background: #3498db;
    color: white;
}

.odt-table th, .odt-table td {
    border: 1px solid #ddd;
    padding: 12px 15px;
    text-align: left;
}

.odt-table th {
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.odt-table tr:nth-child(even) {
    background-color: #f8f9fa;
}

.odt-table tr:hover {
    background-color: #e9ecef;
}

/* Math Containers */
.math-container {
    margin: 25px 0;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
    overflow-x: auto;
    text-align: center;
}

.math-container mjx-container {
    display: inline-block;
    margin: 10px;
}

/* Inline Math */
mjx-container[display="false"] {
    display: inline-block;
    margin: 0 2px;
}

/* Display Math */
mjx-container[display="true"] {
    display: block;
    margin: 20px auto;
    text-align: center;
}

/* Blockquotes */
.odt-content blockquote {
    margin: 20px 0;
    padding: 15px 20px;
    border-left: 4px solid #3498db;
    background: #f8f9fa;
    font-style: italic;
    color: #555;
}

/* Code blocks */
.odt-content code {
    background: #f4f4f4;
    padding: 2px 6px;
    border-radius: 3px;
    font-family: 'Consolas', 'Monaco', monospace;
    font-size: 0.9em;
    color: #e74c3c;
}

.odt-content pre {
    background: #2c3e50;
    color: #ecf0f1;
    padding: 15px;
    border-radius: 5px;
    overflow-x: auto;
    margin: 20px 0;
}

.odt-content pre code {
    background: none;
    color: inherit;
    padding: 0;
}

/* Horizontal Rules */
.odt-content hr {
    border: none;
    border-top: 2px solid #e0e0e0;
    margin: 30px 0;
}

/* Links */
.odt-content a {
    color: #3498db;
    text-decoration: none;
    border-bottom: 1px dotted #3498db;
    transition: color 0.3s, border-color 0.3s;
}

.odt-content a:hover {
    color: #2980b9;
    border-bottom-color: #2980b9;
}

/* Footnotes/References */
.odt-content .footnote {
    font-size: 0.85em;
    vertical-align: super;
    color: #3498db;
}

/* Print Styles */
@media print {
    .odt-content {
        box-shadow: none;
        max-width: 100%;
    }

    .odt-content h1, .odt-content h2 {
        page-break-after: avoid;
    }

    .odt-content img {
        page-break-inside: avoid;
    }

    .odt-table {
        page-break-inside: avoid;
    }
}

/* Responsive Design */
@media (max-width: 768px) {
    .odt-content {
        padding: 15px;
        font-size: 14px;
    }

    .odt-content h1 {
        font-size: 2em;
    }

    .odt-content h2 {
        font-size: 1.6em;
    }

    .odt-content h3 {
        font-size: 1.3em;
    }

    .odt-table {
        font-size: 0.85em;
    }

    .odt-table th, .odt-table td {
        padding: 8px 10px;
    }
}

/* =========
   FOOTER
   ========= */

.doc-viewer-footer-bottom {
  max-width: 1400px;
  margin: 0 auto;
  padding-top: 1rem;
  padding-bottom: 1rem;
  border-top: 1px solid rgba(160, 68, 255, 0.1);
  text-align: center;
  color: var(--text-muted);
} @ media (max-width: 600px) {
  .doc-viewer-footer-bottom {
    font-size: 0.3rem!important;
    padding: 0.5rem 1rem;
  }
}
