/* ==================== HEADER, NAV & TEMA ==================== */

.header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  padding: 0.45rem 0; /* margen vertical suave arriba y abajo del logo */
}
:root.dark .header { background: rgba(15,23,42,0.9); }

.header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

/* Wrapper del logo: bloque flex para eliminar el gap de baseline del <img> */
.header__inner > a:first-child {
  display: flex;
  align-items: center;
  line-height: 0;
}

/* Logo */
.logo {
  height: 72px;
  display: block; /* elimina el gap inferior que deja display:inline */
  transition: filter 0.3s;
}
:root.dark .logo { filter: brightness(0) invert(1); }

/* Nav desktop */
.nav { display: flex; gap: 2rem; align-items: center; }
.nav a {
  color: var(--text-muted);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s;
}
.nav a:hover    { color: var(--primary); }
.nav a.nav-active { color: var(--primary); font-weight: 600; }

/* Theme toggle */
.theme-toggle {
  background: var(--bg-alt);
  border: 1px solid var(--border);
  border-radius: 50%;
  width: 40px; height: 40px;
  cursor: pointer;
  display: grid;
  place-items: center;
  color: var(--text);
}
.theme-toggle svg { width: 18px; height: 18px; }
.icon-sun { display: none; }
:root.dark .icon-sun  { display: block; }
:root.dark .icon-moon { display: none; }

/* Hamburger (mobile) */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 5px;
}
.nav-toggle span {
  width: 24px; height: 2px;
  background: var(--text);
  transition: 0.3s;
}

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
  .nav {
    position: fixed;
    top: 72px; left: 0; right: 0;
    background: var(--bg);
    padding: 2rem;
    flex-direction: column;
    border-bottom: 1px solid var(--border);
    transform: translateY(-150%);
    transition: transform 0.3s;
    z-index: 99;
  }
  .nav.show { transform: translateY(0); }
}
