/* Basic Reset and Body Styles */
body {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: #ffffff; /* All-white background */
    color: #333;
}

/* --- THE MAGIC TOUCH: SMOOTH SCROLLING --- */
html {
  scroll-behavior: smooth;
}

/* --- CORE LAYOUT --- */
.site-container {
    display: flex;
    min-height: 100vh;
}

/* Sidebar Styles */
.sidebar {
    width: 250px;
    flex-shrink: 0;
    background-color: #ffffff;
    padding: 20px;
    border-right: 1px solid #ccc;
}

/* Main Content Styles */
.main-content {
    flex-grow: 1;
    padding: 40px;
    background-color: #ffffff;
    overflow-wrap: break-word; /* For fluid text on mobile */
    word-wrap: break-word;     /* For fluid text on mobile */
}

/* --- RESPONSIVE CONTENT RULES --- */
/* Makes all images inside the main content area scale correctly */
.main-content img {
  max-width: 100%;
  height: auto;
}

/* --- SIDEBAR COMPONENTS --- */
.logo {
    font-size: 1.5em;
    font-weight: bold;
    margin-bottom: 30px;
    padding-bottom: 10px;
    /* border-bottom: 1px solid #ccc; */
}

a.logo {
    text-decoration: none;
    color: inherit;
    cursor: pointer;
}

.sidebar ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.sidebar ul li a {
    display: block;
    padding: 12px 15px;
    color: #333;
    text-decoration: none;
    border-radius: 5px;
    margin-bottom: 5px;
    transition: background-color 0.2s ease-in-out;
}

/* --- GRAPHICAL MENU STYLING --- */
.logo img {
  max-width: 180px;
  height: auto;
}

.sidebar ul li a img {
  max-width: 100%;
  height: auto;
  display: block;
  border-radius: 5px;
}

.sidebar ul li a.active {
  background-color: transparent;
}

.sidebar ul li a.active img {
  outline: 3px solid #007bff;
  outline-offset: 2px;
}

.sidebar ul li a:hover img {
  opacity: 0.8;
}
.sidebar ul li a.active:hover img {
  opacity: 1;
}

/* --- CONTENT VISIBILITY (JAVASCRIPT CONTROL) --- */
.content-section {
    display: none;
}

.content-section.visible {
    display: block;
}

/* --- WIKIPEDIA-STYLE CONTENT FORMATTING --- */
.toc {
  background-color: #ffffff; /* All-white background */
  border: 1px solid #a2a9b1;
  border-radius: 4px;
  padding: 15px 20px;
  max-width: 400px;
  margin-bottom: 2em;
}

.toc strong {
  font-size: 1.1em;
  display: block;
  margin-bottom: 0.5em;
  text-align: center;
}

.toc ul {
  list-style-type: none;
  padding-left: 0;
}
.toc ul ul {
  padding-left: 20px;
}
.toc ul li {
  margin-bottom: 0.4em;
}

.toc a {
  text-decoration: none;
  color: #0645ad;
}
.toc a:hover {
  text-decoration: underline;
}

hr.content-separator {
  border: none;
  border-top: 1px solid #e1e1e1;
  margin: 2em 0;
}

.content-topic {
  margin-bottom: 2em;
}

.main-content h1 { margin-bottom: 0.8em; }
.main-content h2 { margin-bottom: 0.7em; }
.main-content h3 { margin-bottom: 0.5em; }


/* --- RESPONSIVE DESIGN FOR MOBILE --- */
/* This section should ALWAYS be last. It contains only the overrides for small screens. */
@media (max-width: 768px) {
    .site-container {
        flex-direction: column;
    }

    .sidebar {
        width: 100%;
        height: auto;
        border-right: none;
        border-bottom: 1px solid #ccc;
    }

    .main-content {
        padding: 20px;
    }
}
