@import url("brand.css");

/* === Global overrides === */
:root {
  --text: var(--ink);
  --icon-size: 1.3rem;
  --icon-color: var(--text);
}

/* === Links === */
a:link {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.2s ease;
}
a:visited { color: var(--success); }
a:hover,
a:focus {
  color: var(--accent-strong);
  text-decoration: none; /* no underline */
}
a:active { color: var(--warning); }

/* === Header === */
#header-bar {
/*background: var(--header-bg);*/
  border-bottom: 1px solid var(--border);
  width: 100%;
}
#header-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0.5rem 1rem;
}

/* Brand (logo + title) */
.brand a {
  display: flex;
  align-items: center;
  gap: 8px;
  text-decoration: none;
}
.brand img {
  height: 28px;
  width: auto;
  display: block;
}
.brand .site-wordmark {
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 800;
  font-size: 1.3rem;
  color: var(--ink);
}

/* Nav + toggle wrapper */
.nav-toggle-wrapper {
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Nav links */
#nav-bar {
  /* display: flex;  this affeted the mobile nav  toggle view*/
  align-items: center;
  gap: 1rem;
}
#nav-bar a {
  text-decoration: none;
  color: var(--ink);
  font-weight: 600;
  padding: 0.25rem 0.75rem;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease;
}
#nav-bar a:hover {
  background: var(--primary-mid);
  color: var(--primary-ink);
}
#nav-bar a.active {
  background: var(--primary);
  color: var(--primary-ink);
}

/* Theme toggle */
.theme-toggle {
  display: flex;
  align-items: center;
  background: none;
  border: none;
  cursor: pointer;
}
.icon {
  width: var(--icon-size);
  height: var(--icon-size);
  color: var(--icon-color);
  fill: currentColor;
  transition: color 0.3s ease;
}
.theme-toggle:hover .icon { color: var(--accent); }

/* === Footer links === */
.site-footer a,
#footer-container a {
  color: var(--accent) !important;
  text-decoration: none !important;
}
.site-footer a:hover,
#footer-container a:hover {
  color: var(--accent-strong) !important;
  text-decoration: underline !important;
}
.site-footer a:active,
#footer-container a:active {
  color: var(--warning) !important;
}

/* Brand (logo + title link) */
.brand a {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  background: none !important;   /* prevent hover bg */
  padding: 0;                    /* no padding bubble */
}

.brand img {
  height: 45px;                  /* larger logo */
  width: auto;
  display: block;
  border: none !important;       /* kill any default border */
  box-shadow: none !important;   /* just in case */
  align-items: left;
}

.brand .site-wordmark {
  font-family: "Montserrat", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  font-weight: 800;
  font-size: 1.8rem;             /* a little larger */
  color: var(--ink);
}

/* Ensure hover over brand does not change */
.brand a:hover,
.brand a:focus {
  background: none !important;
  color: var(--ink);             /* keep normal text color */
}
/* Override suCSS grid width */
html body {
  grid-template-columns: 1fr min(60rem, 100%) 1fr;
  padding-left: 30px;
  padding-right: 30px;
}

/* === Header background === */
#header-bar {
  background: var(--bg); /* matches main background */
  border-bottom: 1px solid var(--border);
  width: 100%;
  position: sticky;
  top: 0;
  z-index: 1000;
}

/* === Desktop nav links === */
.site-nav {
  display: flex;
  gap: 1rem;
}

/* === Hamburger button === */
.hamburger {
  display: none; /* hidden by default */
  background: var(--accent);
  border: none;
  padding: 0.5rem;
  border-radius: 0.25rem;
  cursor: pointer;
}

/* Hamburger icon (3 bars) */
.hamburger span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
}

/* === Mobile styles === */
@media (max-width: 768px) {
  .site-nav {
    display: none; /* hide links on mobile by default */
    flex-direction: column;
    gap: 0.5rem;
    background: var(--bg);
    position: absolute;
    top: 60px;   /* just below header */
    left: 0;
    width: calc(64% + 40px);
    padding: 1rem;
    border-top: 1px solid var(--border);
  }

  .site-nav.active {
    display: flex; /* show when toggled */
  }

  .hamburger {
    display: block; /* visible only on mobile */
  }
}

/* Header layout */
#header-bar .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

/* Controls group (theme + hamburger) */
.controls {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

/* Hide hamburger by default (desktop) */
.nav-toggle {
  display: none;
  background: var(--accent, orange);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  padding: 0.4rem 0.6rem;
  border-radius: 4px;
  cursor: pointer;
}

/* Mobile behavior */
@media (max-width: 768px) {
  /* Hide nav links initially */
  .site-nav {
    display: none;
    flex-direction: column;
    background: var(--header-bg, #222);
    padding: 1rem;
  }

  /* Show nav when toggled */
  .site-nav.open {
    display: flex;
  }

  /* Show hamburger */
  .nav-toggle {
    display: inline-block;
  }
}

/* --- HEADER LAYOUT --- */
#header-bar {
  background-color: var(--bg); /* match site background */
  border-bottom: 1px solid var(--border);
  width: 100%;
}

#header-bar .container {
  max-width: 60rem; /* ~960px */
  margin: 0 auto;
  padding: 0 1rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* --- LOGO / BRAND --- */
.brand {
  display: flex;
  align-items: center;
}

.brand a {
  display: flex;
  align-items: center;
  text-decoration: none;
}
.brand a:hover {
  background: none; /* remove hover bg */
}

/* --- NAVIGATION --- */
.site-nav {
  display: flex;
  gap: 1.5rem;
}
.site-nav a {
  text-decoration: none;
  font-weight: 500;
}
.site-nav a:hover {
  text-decoration: none;
}
.site-nav a.active {
  background-color: var(--accent);
  color: var(--bg);
  border-radius: 6px;
  padding: 0.3rem 0.6rem;
}

/* --- THEME TOGGLE --- */
.theme-toggle {
  margin-left: 1rem;
}

/* --- HAMBURGER --- */
.hamburger {
  display: none; /* hidden on desktop */
  background: var(--accent);
  border: none;
  border-radius: 4px;
  padding: 0.4rem 0.6rem;
  cursor: pointer;
}
.hamburger svg {
  fill: var(--bg);
}

/* --- MOBILE STYLES --- */
@media (max-width: 768px) {
  .site-nav {
    display: none; /* hide by default */
    flex-direction: column;
    gap: 1rem;
    background-color: var(--bg);
    position: absolute;
    top: 100%;
    left: 0;
    width: 100%;
    padding: 1rem 0;
    border-top: 1px solid var(--border);
  }

  .site-nav.open {
    display: flex; /* show when hamburger toggles */
  }

  .hamburger {
    display: block; /* only visible on mobile */
  }

  #header-bar .container {
    justify-content: space-between;
  }
}

/* ABK: Mobile-specific styles for the hamburger icon and theme toggle */
@media (max-width: 768px) {
    .nav-toggle-wrapper {
        position: relative;
        display: flex;
        align-items: center;
        justify-content: flex-end; /* Align items to the right */
        gap: 1px; /* Add space between the hamburger and theme toggle */
        padding-right: 10px; /* Add padding to shift both icons right */
    }

    .hamburger {
        position: relative;
        right: 0;
        margin-left: 50px;
        z-index: 1000;
    }

    .theme-toggle {
        position: relative;
        z-index: 1000;
    }
}

/* ABK: Hide navigation items by default on mobile */
@media (max-width: 768px) {
    .site-nav {
        display: none;
        position: absolute;
        top: 60px; /* Adjust based on header height */
        left: 0;
        width: 100%;
       
        padding: 10px;
        box-sizing: border-box;
        flex-direction: column;
    }

    /* ABK: Show navigation items when active */
    .site-nav.active {
        display: flex;
        width: calc(64% + 40px);
    }
}

/* ABK: Ensure proper margins for the container */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
    box-sizing: border-box;
}

/* ABK: Ensure content within the container respects margins */
.site-header {
    width: 100%;
    box-sizing: border-box;
    padding: 0 0;
}


html body {
  padding-left: 30px;
  padding-right: 30px;
}

main a:hover,
main a:focus {
    background: none !important;
    color: var(--ink); /* Keep the normal text color */
}


/* ABK: Mobile-specific styles for hamburger and toggle */
@media (max-width: 768px) {
    .site-header .mobile-nav-bar{
        display: flex;
        justify-content: space-between; /* Pushes brand to the left and nav-toggle-wrapper to the right */
        align-items: center;
        gap: 5px; /* Fixed 15px gap between hamburger and toggle */
    }

}
/* ABK: Dark mode override if necessary */
[data-theme="dark"] .site-nav {
    background: #383736; /* Match your theme */
    /*background: var(--dark-nav-bg); /* Your existing dark mode color */
}

[data-theme="light"] .site-nav {
    background: #fcfcef; /* Light beige color */
    /*background: var(--dark-nav-bg); /* Your existing dark mode color */
}

footer a:hover,
footer a:focus {
    background: none !important;
    color: var(--ink); /* Keep the normal text color */
}