/* styles/header.css */

/* ========================
   CSS Variables
   ======================== */
:root {
  --bg: #ffffff;
  --text: #222222;
  --primary: #2563eb; /* Brand primary color */
  --shadow: rgba(0, 0, 0, 0.1);
  --bg-dark: #111111;
  --text-dark: #f5f5f5;
}

/* Dark theme */
body.dark {
  --bg: var(--bg-dark);
  --text: var(--text-dark);
}

/* ========================
   Global resets
   ======================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  color: var(--text);
  background: var(--bg);
}

/* Skip link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--primary);
  color: #fff;
  padding: 8px 12px;
  z-index: 1000;
  transition: top 0.3s;
}
.skip-link:focus {
  top: 0;
}

/* ========================
   Header styles
   ======================== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  background: var(--bg);
  z-index: 999;
  transition: box-shadow 0.3s ease;
}
.site-header.scrolled {
  box-shadow: 0 2px 6px var(--shadow);
}

.header-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
}

.logo {
  font-weight: bold;
  font-size: 1.25rem;
  color: var(--text);
  text-decoration: none;
}

/* Desktop nav */
.nav-desktop {
  display: flex;
  align-items: center;
  gap: 1rem;
}
.nav-desktop ul {
  display: flex;
  gap: 1rem;
  list-style: none;
}
.nav-link {
  text-decoration: none;
  color: var(--text);
  position: relative;
  padding: 4px 0;
  transition: color 0.3s;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 0;
  height: 2px;
  background: var(--primary);
  transition: width 0.3s;
}
.nav-link:hover::after,
.nav-link.is-active::after {
  width: 100%;
}
.nav-link.is-active {
  color: var(--primary);
}

.cta-btn {
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 9999px;
  padding: 8px 16px;
  font-weight: bold;
  cursor: pointer;
  transition: transform 0.2s, box-shadow 0.2s;
}
.cta-btn:hover {
  transform: scale(1.05);
  box-shadow: 0 2px 8px var(--shadow);
}

/* Theme toggle */
.theme-toggle {
  background: transparent;
  border: none;
  cursor: pointer;
  font-size: 1.25rem;
  margin-left: 0.5rem;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 24px;
  height: 18px;
  background: none;
  border: none;
  cursor: pointer;
}
.hamburger span {
  display: block;
  height: 3px;
  background: var(--text);
  border-radius: 2px;
}

/* Mobile drawer */
.mobile-drawer {
  position: fixed;
  top: 0;
  right: -100%;
  width: 80%;
  max-width: 300px;
  height: 100%;
  background: var(--bg);
  transition: transform 0.3s ease;
  box-shadow: -2px 0 6px var(--shadow);
  display: flex;
  flex-direction: column;
  z-index: 1001;
}
.mobile-drawer.open {
  right: 0;
}

.drawer-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
}
.drawer-close {
  background: none;
  border: none;
  font-size: 2rem;
  cursor: pointer;
  color: var(--text);
}

.nav-mobile {
  padding: 16px;
}
.nav-mobile ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.nav-mobile .cta-btn {
  margin-top: 1rem;
  width: 100%;
}

/* Overlay */
.drawer-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0,0,0,0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s;
  z-index: 1000;
}
.drawer-overlay.active {
  opacity: 1;
  visibility: visible;
}

/* Responsive breakpoints */
@media (max-width: 1023px) {
  .nav-desktop {
    display: none;
  }
  .hamburger {
    display: flex;
  }
}
