/* --- 0. LAYOUT & HEADER FIXES --- */
:root {
  /* Set to 6.5rem to clear both title and tab bars */
  --md-header-height: 6.5rem;
}

/* Fixes both sidebars sliding behind the header — DESKTOP ONLY */
@media screen and (min-width: 76.25em) {
  .md-sidebar {
    top: var(--md-header-height) !important;
    height: calc(100vh - var(--md-header-height)) !important;
    position: sticky !important;
  }
}

/* Prevent horizontal overflow on small screens */
html,
body {
  overflow-x: hidden;
}

/* Add breathing room to the main content */
.md-main__inner {
  margin-top: 1.5rem;
}

/* --- 1. TYPOGRAPHY & COLORS --- */
h1,
h2,
h3,
h4 {
  color: var(--md-primary-fg-color) !important;
  font-weight: 300;
  letter-spacing: -0.01em;
}

.md-typeset a {
  color: var(--md-accent-fg-color) !important;
  text-decoration: underline;
}

/* --- 2. HEADER & SEARCH --- */
.md-header {
  height: 3.5rem;
}

.md-header__inner {
  padding-top: 0.4rem;
}

.md-search__input,
.md-search__form {
  background-color: rgba(255, 255, 255, 0.15) !important;
  border-radius: 20px !important;
  transition: all 0.3s ease;
  border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

/* --- 3. UNIFIED SIDEBAR (LEFT & RIGHT) --- */

/* Removes all nested lines and standardized padding */
.md-sidebar__inner {
  margin-top: 1rem !important;
  padding: 0 0.5rem !important;
}

/* Removes those vertical lines and folder indentations */
.md-nav__list,
.md-nav__item {
  border-left: none !important;
  margin-left: 0 !important;
  padding-left: 0 !important;
}

/* Styling for the Navigation links (Left) and TOC links (Right) */
.md-nav__link {
  font-size: 0.75rem !important;
  padding: 0.3rem 0.8rem !important;
  display: block;
  transition: color 0.2s ease;
}

/* Active state color matching your theme */
.md-nav__link--active {
  color: var(--md-accent-fg-color) !important;
  font-weight: 700 !important;
}

/* Sidebar Title styling (e.g. 'Projects' or 'Table of Contents') */
.md-nav__title,
.md-sidebar--secondary .md-nav__title {
  font-size: 0.8rem !important;
  font-weight: 700 !important;
  margin-bottom: 0.8rem !important;
  color: var(--md-typeset-color) !important;
  opacity: 0.6;
}

/* --- 4. SLIM FOOTER CARDS --- */
.md-footer__link {
  padding: 0.5rem 1rem;
  border: 1px solid var(--md-accent-fg-color--transparent);
  border-radius: 8px;
  display: inline-flex;
  align-items: center;
  text-decoration: none !important;
  margin: 0.5rem 0;
  max-width: 45%;
}

.md-footer__link--next {
  border-left: 3px solid var(--md-accent-fg-color);
  float: right;
}

.md-footer__link--prev {
  border-right: 3px solid var(--md-accent-fg-color);
  float: left;
}

.md-footer-nav__direction {
  font-size: 0.55rem;
}

.md-footer-nav__title {
  font-size: 0.75rem;
  color: var(--md-accent-fg-color) !important;
  font-weight: 700;
}

.md-footer-nav {
  overflow: hidden;
  padding: 1rem 0;
}

/* --- 5. SCROLLBAR & META --- */
.md-footer-meta {
  background-color: var(--md-primary-fg-color--dark);
}

.md-copyright {
  font-size: 0.7rem;
  color: rgba(255, 255, 255, 0.6);
}

::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-thumb {
  background-color: var(--md-primary-fg-color--transparent);
  border-radius: 10px;
}

/* --- Custom 404 Page Styling --- */
[data-md-content-id="404"] .md-content__inner {
  text-align: center;
  padding-top: 5rem;
}

[data-md-content-id="404"] h1 {
  font-size: 3rem;
  margin-bottom: 1rem;
}

[data-md-content-id="404"] .md-button {
  margin-top: 2rem;
  border-radius: 20px;
}

/* --- 7. FOCUS MODE (hide both sidebars) --- */
#focus-toggle {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 10;
  width: 2.8rem;
  height: 2.8rem;
  border: none;
  border-radius: 50%;
  background: var(--md-primary-fg-color);
  color: #fff;
  font-size: 1.3rem;
  cursor: pointer;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: transform 0.2s ease, background 0.2s ease;
}

#focus-toggle:hover {
  transform: scale(1.1);
}

/* Hide on mobile/tablet — sidebars already hidden there */
@media screen and (max-width: 76.1875em) {
  #focus-toggle {
    display: none !important;
  }
}

/* When focus mode is active, hide both sidebars */
.focus-mode .md-sidebar {
  display: none !important;
}

/* Let content stretch to full width */
.focus-mode .md-content {
  max-width: 100%;
  margin: 0 auto;
}

.focus-mode .md-content__inner {
  max-width: 50rem;
  margin: 0 auto;
}