/* docs/stylesheets/refinements.css */

/* --- 1. Content Readability: Constrain & Center Main Column --- */
/* This rule targets the main content area (article + right ToC)
   and centers it on the page with a maximum width for readability. */
.md-main__inner {
  max-width: 1100px; /* A comfortable width that includes the ToC */
  margin: 0 auto;
}

/* --- 2. Typographic Hierarchy & Spacing --- */
/* Add more "breathing room" to the text to make it feel less dense. */
.md-typeset p,
.md-typeset li {
  line-height: 1.75; /* Increase line spacing for paragraphs and lists */
}

.md-typeset h1 {
  font-weight: 800; /* Bolder for more impact */
  margin-top: 1.5em;
}

.md-typeset h2 {
  font-weight: 700;
  margin-top: 2em; /* More space above H2 headings */
  border-bottom: 1px solid var(--md-default-fg-color--lighter);
  padding-bottom: 0.3em;
}

/* --- 3. Component Polish & Styling --- */
/* Make the left navigation cleaner and code blocks pop. */

/* Style for the active navigation section */
.md-nav__item--active > .md-nav__link {
    font-weight: 600;
    border-left: 3px solid var(--md-accent-fg-color);
    padding-left: calc(1rem - 3px);
}

/* Style for code blocks to make them stand out */
.md-typeset pre > code {
    background-color: hsla(0, 0%, 0%, 0.15); /* Slightly darker shade */
    border: 1px solid var(--md-default-fg-color--lighter);
    border-radius: 4px;
    box-shadow: 0 4px 10px hsla(0, 0%, 0%, 0.2);
}

/* --- 4. Unified Modern Navigation Bar --- */
/* Create a single, clean navigation bar with logo, tabs, and controls */

/* Enhanced header to contain everything in one bar */
.md-header {
  position: sticky !important;
  top: 0 !important;
  z-index: 1000 !important;
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  margin-bottom: 0 !important;
  padding-bottom: 0 !important;
  min-height: 3.5rem !important; /* Slightly taller for better proportions */
}

/* Hide the separate tabs element since we're integrating into header */
.md-tabs {
  display: none !important;
}

/* Create a unified navigation layout within the header */
.md-header__inner {
  display: flex !important;
  align-items: center !important;
  justify-content: center !important; /* Center the entire header content */
  width: 100% !important;
  max-width: none !important;
  padding: 0 1rem !important;
  position: relative !important;
}

/* Create a centered container for all header content */
.md-header__inner::before {
  content: "" !important;
  display: flex !important;
  width: 100% !important;
  max-width: 1400px !important; /* Constrain total width */
  margin: 0 auto !important;
  position: absolute !important;
  left: 0 !important;
  right: 0 !important;
  height: 100% !important;
  pointer-events: none !important;
}

/* Style the site title/logo section */
.md-header__title {
  flex: 0 0 auto !important;
  min-width: 200px !important;
  z-index: 2 !important;
  position: relative !important;
  padding-right: 2rem !important; /* Space between title and nav */
}

/* Navigation container will be created by JavaScript */
.md-header-nav {
  display: flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  flex: 1 1 auto !important; /* Take up available space */
  justify-content: center !important;
  z-index: 1 !important;
  white-space: nowrap !important;
  padding: 0 2rem !important; /* Padding to prevent edge overlap */
  max-width: 800px !important; /* Limit nav width */
  overflow: hidden !important;
  position: relative !important; /* Change from absolute */
}

/* Right side controls container */
.md-header__option {
  flex: 0 0 auto !important;
  min-width: 200px !important;
  display: flex !important;
  justify-content: flex-end !important;
  align-items: center !important;
  gap: 1rem !important;
  z-index: 2 !important;
  position: relative !important;
  padding-left: 2rem !important; /* Space between nav and controls */
}

/* Hide the vertical separator between theme toggle and search */
.md-header__option + * {
  position: relative !important;
}

.md-header__option + *::before {
  display: none !important;
}

/* Ensure GitHub source link is part of right side */
.md-header__source {
  flex: 0 0 auto !important;
  order: 3 !important;
  z-index: 2 !important;
  position: relative !important;
}

/* Search bar constraints */
.md-search {
  position: relative !important;
  flex: 0 0 auto !important;
}

/* Prevent search expansion from breaking layout */
.md-search__inner {
  width: 280px !important; /* Fixed width */
  max-width: 280px !important;
}

.md-search__input {
  width: 100% !important;
}

/* Disable search modal/overlay expansion */
.md-search--active .md-search__inner {
  width: 280px !important; /* Keep same width when active */
  max-width: 280px !important;
}

.md-search__overlay {
  display: none !important; /* Disable overlay */
}

/* Style for integrated navigation links - we'll add these via JavaScript */
.md-header-nav-link {
  display: inline-block !important;
  padding: 0.6rem 0.8rem !important;
  text-decoration: none !important;
  color: var(--md-primary-bg-color) !important;
  font-weight: 500 !important;
  border-radius: 4px !important;
  transition: all 0.15s ease !important;
  white-space: nowrap !important;
  flex-shrink: 0 !important;
}

.md-header-nav-link:hover {
  background-color: var(--md-default-fg-color--lightest) !important;
  color: var(--md-primary-fg-color) !important;
}

.md-header-nav-link--active {
  background-color: var(--md-default-fg-color--lightest) !important;
  color: var(--md-primary-fg-color) !important;
  font-weight: 600 !important;
}

/* Ensure nav is accessible and doesn't get cut off */
.md-header-nav {
  pointer-events: auto !important;
}

/* Better responsive header layout */
@media screen and (max-width: 90em) {
  .md-header__inner {
    padding: 0 1rem !important;
  }
  
  .md-header-nav {
    padding: 0 1rem !important;
    gap: 0.25rem !important;
  }
  
  .md-header-nav-link {
    padding: 0.5rem 0.6rem !important;
    font-size: 0.9rem !important;
  }
}

/* Responsive design for smaller screens */
@media screen and (max-width: 76.25em) {
  .md-header-nav {
    display: none !important; /* Hide center nav on mobile */
  }
  
  .md-header__inner {
    justify-content: space-between !important; /* Spread out on mobile */
    padding: 0 1rem !important;
  }
  
  .md-header__title {
    min-width: auto !important;
    padding-right: 1rem !important;
  }
  
  .md-header__option {
    min-width: auto !important;
    padding-left: 0 !important;
  }
  
  /* Adjust search bar for mobile */
  .md-search__inner {
    width: 220px !important;
    max-width: 220px !important;
  }
}

/* Even smaller screens */
@media screen and (max-width: 48em) {
  .md-search__inner {
    width: 180px !important;
    max-width: 180px !important;
  }
  
  .md-header__title {
    font-size: 0.9rem !important;
  }
  
  .md-header__inner {
    gap: 0.5rem !important;
    padding: 0 0.5rem !important;
  }
}

/* Update main content spacing for single navigation bar */
.md-main {
  margin-top: 0 !important; /* Reset since we only have one nav bar now */
}



/* Update sidebar positioning for single navigation bar */
.md-sidebar--primary {
  top: 3.5rem !important;
}

.md-sidebar--secondary {
  top: 3.5rem !important;
}

/* Update scroll padding for single navigation bar */
html {
  scroll-behavior: smooth;
  scroll-padding-top: 4rem !important;
}

/* Ensure nav doesn't overlap with side content */
@media screen and (min-width: 76.25em) {
  .md-header-nav {
    max-width: calc(100% - 600px) !important; /* Account for 200px + padding on each side */
    overflow: hidden !important;
  }
}

 