/* --- CSS Variables for Easy Customization --- */
:root {
    --bg-color: #fbfbfb;
    --wiki-bg: #ffffff;
    --text-color: #333333;
    --border-color: #cccccc;
    --header-bg: #eeeeee;
    --link-color: #0066cc;
    --hover-bg: #f0f0f0;
    --sidebar-width: 240px;
}

/* --- Dark Mode Variables --- */
@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #121212;
        --wiki-bg: #1e1e1e;
        --text-color: #e0e0e0;
        --border-color: #444444;
        --header-bg: #2a2a2a;
        --link-color: #66b2ff;
        --hover-bg: #2d2d2d;
    }
}

/* --- Base Reset & Typography --- */
* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
 
    /*outline: 1px solid red !important;*/
}

body {
    font-family: Arial, Helvetica, sans-serif;
    font-size: 14px;
    line-height: 1.5;
    background-color: var(--bg-color);
    color: var(--text-color);
}
a {
    color: var(--link-color);
    text-decoration: none;
}
a:hover {
    text-decoration: underline;
}

/* --- Layout Container --- */
.wiki-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    background-color: var(--wiki-bg);
    border-left: 1px solid var(--border-color);
    border-right: 1px solid var(--border-color);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* --- Header Section --- */
header {
    background-color: var(--header-bg);
    border-bottom: 1px solid var(--border-color);
    padding: 10px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo-area h1 {
    font-size: 20px;
    font-weight: normal;
}

.logo-text {
  font-size: 20px;
  font-weight: normal;
}

/* --- Main Body Layout --- */
.main-container {
    display: flex;
    flex: 1;
    position: relative;
    /*overflow-wrap: break-word;  Forces long strings to break and wrap */
    /*word-break: break-all;      Alternative fallback for strict breaking */
    /*display: flex;*/
    /*overflow: hidden; /* 1. Hides the sidebar when it pushes left */
    /*width: 100%;        /* Ensures it fills the screen area */ 
    
    word-break: normal;
    overflow-wrap: normal; /* Prevents long words from being forcefully broken */
    white-space: normal;   /* Ensures default line wrapping is active */    
}

/* --- Collapsible Sidebar --- */
/* CSS-only toggle trick using an invisible checkbox */
#sidebar-toggle {
    display: none;
}

aside {
    width: var(--sidebar-width);
    border-right: 1px solid var(--border-color);
    padding: 20px;
    background-color: var(--wiki-bg);
    transition: margin-left 0.3s ease;
    
    /*width: var(--sidebar-width);*/
    /*flex-shrink: 0;   /* Prevents the sidebar from squishing */
    /*transition: margin-left 0.3s ease; /* Adds smooth sliding */    
}

/* --- Navigation --- */
aside h3 {
    font-size: 14px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 10px;
    padding-bottom: 3px;
}

aside ul {
    list-style: none;
    margin-bottom: 20px;
}
aside li {
    margin-bottom: 5px;
}

/* --- Page --- */
main {
    flex: 1;
    padding: 20px 30px;
}

article h2 {
    font-size: 22px;
    font-weight: normal;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 3px; /*5*/
    margin-bottom: 10px; /*15*/
}

article h3, label {
    font-size: 16px;
    font-weight: 600;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 3px; /*5*/
    margin-bottom: 10px; /*15*/
}

article ul, ol {
  margin-inline-start: 0;
  padding-inline-start: 40px;
  padding-bottom: 3px;
  margin-bottom: 10px;
}

article ul.index-list, 
article ol.index-list {
  list-style-type: none; /* Removes default bullets/numbers */
  padding-inline-start: 0px; /* Changes the indentation */
  font-weight: 500; /* Makes text slightly bolder */
  /* Add any other unique index styles here */
}

article p {
    margin-bottom: 15px;
}

article section {
    margin-bottom: 10px;
    padding-bottom: 3px;
}

/* --- Breadcrumbs and Trace --- */
.breadcrumbs {
    font-size: 12px;
    color: var(--text-color);
    opacity: 0.8;
    margin-bottom: 15px;
}

/* --- Footer Section --- */
footer {
    background-color: var(--header-bg);
    border-top: 1px solid var(--border-color);
    padding: 10px 20px;
    font-size: 11px;
    text-align: right;
    color: var(--text-color);
    opacity: 0.7;
}

/* --- Mobile Responsive Layout --- */
@media (max-width: 768px) {
    .main-container {
        flex-direction: column;
    }
    aside {
        width: 100%;
        border-right: none;
        border-bottom: 1px solid var(--border-color);
        margin-left: 0 !important;
        display: none;
    }
}

table {
  margin: 20px 0;
}

table, th, td {
  border: 1px solid var(--border-color);
  border-collapse: collapse;
}

th {
    background-color: var(--header-bg);
}

th, td {
    padding: 5px;
}

.table-layout-fixed {
    table-layout: fixed;
}

code, pre {
  max-width: 100%;
  overflow-x: auto;
  white-space: pre-wrap;
  word-break: break-all;
  box-sizing: border-box;
  display: block;
  background: var(--bg-color);
  color: var(--text-color);
  padding: 1rem;
}

/*
.wrap {
  flex-wrap: wrap;
}*/


