/* ============================= */
/* Disable dark mode completely  */
/* ============================= */

/* Default light colors */
html, body {
  background-color: #ffffff;
  color: #000000;
}

/* Override academicpages dark mode */
@media (prefers-color-scheme: dark) {
  body,
  body *,
  .page__content,
  .archive,
  .sidebar,
  .masthead,
  .greedy-nav,
  .page__footer {
    background-color: #ffffff;
    color: #000000;
    border-color: #cccccc;
  }

  a {
    color: #0645ad;
  }
}

@media (prefers-color-scheme: dark) {

  /* Navigation bar container */
  .masthead,
  .masthead__inner-wrap,
  .greedy-nav {
    background: #ffffff;
    background-image: none;
    box-shadow: none;
    border-bottom: 1px solid #e0e0e0;
  }

  /* Navigation links */
  .greedy-nav a,
  .greedy-nav a:visited {
    color: #000000;
  }

  .greedy-nav a:hover {
    background: #f2f2f2;
    color: #000000;
  }

  /* Mobile menu button */
  .greedy-nav__toggle {
    background: #ffffff;
    color: #000000;
    box-shadow: none;
  }
}

@media (prefers-color-scheme: dark) {

  .masthead::before,
  .masthead::after,
  .greedy-nav::before,
  .greedy-nav::after {
    content: none;
    display: none;
  }
}

.masthead,
.masthead__inner-wrap,
.greedy-nav {
  background: #ffffff;
  background-image: none;
  box-shadow: none;
}

/* ===================================================== */
/* Fix black rectangles behind navbar text (academicpages) */
/* ===================================================== */

/* Always force light navbar */
.masthead,
.masthead__inner-wrap,
.greedy-nav {
  background-color: #ffffff !important;
  background-image: none !important;
}

/* Kill dark backgrounds applied to nav items */
.greedy-nav li,
.greedy-nav a,
.greedy-nav a:link,
.greedy-nav a:visited,
.greedy-nav a span {
  background-color: transparent !important;
  background-image: none !important;
  box-shadow: none !important;
}

/* On hover: light gray only */
.greedy-nav a:hover,
.greedy-nav a:focus {
  background-color: #f2f2f2 !important;
}

/* Mobile menu */
.greedy-nav__toggle,
.greedy-nav__toggle span {
  background-color: transparent !important;
}

/* Remove pseudo-element blocks */
.greedy-nav li::before,
.greedy-nav li::after,
.greedy-nav a::before,
.greedy-nav a::after {
  content: none !important;
  display: none !important;
}

/* Kill dark-mode toggle everywhere */
.dark-mode-toggle,
.theme-toggle,
button[aria-label*="dark"],
button[aria-label*="theme"] {
  display: none !important;
}

/* ===================================================== */
/* Fix "Current Page" (Active) Link Color                */
/* ===================================================== */

/* Target the specific active class used by academicpages */
.greedy-nav .visible-links .masthead__menu-item--active a {
    color: #000000 !important;
    /* Optional: Add bolding to indicate it is the current page */
    font-weight: bold !important; 
}

/* Ensure the hover state on the active link is also visible */
.greedy-nav .visible-links .masthead__menu-item--active a:hover {
    color: #000000 !important;
    background-color: #f2f2f2 !important;
}

/* ========================================================================== */
/* BRUTE FORCE NAV FIX: Force ALL Nav Links to Black (No Exceptions)          */
/* ========================================================================== */

/* We wrap this in a media query to ensure it hits the Dark Mode preference hard */
@media screen, (prefers-color-scheme: dark), (prefers-color-scheme: light) {
  
  /* 1. Target every single link inside the navigation bar generally */
  .greedy-nav a,
  .greedy-nav li a,
  .greedy-nav .visible-links a,
  .greedy-nav .visible-links li a {
      color: #000000 !important;
      -webkit-text-fill-color: #000000 !important; /* Forces color in Chrome/Safari */
      opacity: 1 !important; /* Prevents dimming */
  }

  /* 2. Target the specific "Active" classes used by different template versions */
  /* Version A (Newer) */
  .greedy-nav .masthead__menu-item--active a, 
  .greedy-nav li.masthead__menu-item--active > a {
      color: #000000 !important;
      background: transparent !important;
  }

  /* Version B (Older) */
  .greedy-nav .active a,
  .greedy-nav li.active > a,
  .greedy-nav a.active {
      color: #000000 !important;
      background: transparent !important;
  }

  /* 3. Force Hover State to remain Black */
  .greedy-nav a:hover,
  .greedy-nav li a:hover,
  .greedy-nav .masthead__menu-item--active a:hover {
      color: #000000 !important;
      background-color: #f2f2f2 !important; /* Light gray background on hover */
  }
}
