/* ===== Site Header ===== */
.site-header {
  background: var(--bg-header);
  color: var(--text-header);
  padding: 0.875rem 1.5rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

.header-inner {
  max-width: 1400px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.site-brand {
  color: var(--text-header);
  text-decoration: none;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 0.75rem;
  flex-shrink: 0;
}

.site-logo {
  display: block;
  flex-shrink: 0;
}

.site-brand:hover {
  color: var(--text-header);
  text-decoration: none;
}

.site-brand-mark {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.25rem;
  flex-shrink: 0;
}

.site-title {
  font-size: 1.1875rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  white-space: nowrap;
  line-height: 1.2;
}

.site-title-accent {
  color: #60a5fa;
}

.site-tagline {
  font-size: 0.6875rem;
  color: rgba(255, 255, 255, 0.4);
  white-space: nowrap;
  letter-spacing: 0.01em;
}

.header-controls {
  display: flex;
  align-items: center;
  gap: 0.625rem;
}

.header-search input {
  padding: 0.4rem 0.75rem;
  font-size: 0.8125rem;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-header);
  width: 240px;
  outline: none;
  transition: border-color var(--transition), background var(--transition);
}

.header-search input::placeholder {
  color: rgba(255, 255, 255, 0.35);
}

.header-search input:focus {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.theme-toggle {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: var(--radius);
  color: rgba(255, 255, 255, 0.65);
  cursor: pointer;
  padding: 0.3rem 0.5rem;
  font-size: 1rem;
  line-height: 1;
  transition: background var(--transition), color var(--transition);
}

.theme-toggle:hover {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text-header);
}

/* Show/hide sun/moon based on theme */
.theme-icon-dark { display: none; }
[data-theme="dark"] .theme-icon-light { display: none; }
[data-theme="dark"] .theme-icon-dark { display: inline; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-icon-light { display: none; }
  :root:not([data-theme="light"]) .theme-icon-dark { display: inline; }
}

/* ===== Site Navigation ===== */
.site-nav {
  background: var(--bg-nav);
  border-bottom: 1px solid rgba(0, 0, 0, 0.25);
}

.nav-inner {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem;
  position: relative;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: rgba(255, 255, 255, 0.65);
  font-size: 1.25rem;
  cursor: pointer;
  padding: 0.5rem;
}

.nav-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
}

.nav-links a {
  color: rgba(255, 255, 255, 0.58);
  text-decoration: none;
  font-size: 0.8125rem;
  font-weight: 500;
  padding: 0.6rem 0.875rem;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
  transition: color var(--transition), border-color var(--transition);
  letter-spacing: 0.01em;
}

.nav-links a:hover {
  color: rgba(255, 255, 255, 0.9);
  text-decoration: none;
}

.nav-links a.active {
  color: #e2e8f0;
  border-bottom-color: #60a5fa;
}

/* ===== Main Content ===== */
.site-main {
  max-width: 1400px;
  margin: 0 auto;
  padding: 2rem 1.5rem;
  min-height: calc(100vh - 200px);
}

/* ===== Site Footer ===== */
.site-footer {
  padding: 1.75rem 1.5rem;
  text-align: center;
  font-size: 0.8125rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
  margin-top: 2rem;
}

.site-footer p + p {
  margin-top: 0.25rem;
}

/* ===== Responsive ===== */
@media (max-width: 900px) {
  .site-tagline {
    display: none;
  }

  .header-search input {
    width: 180px;
  }
}

@media (max-width: 768px) {
  .site-header {
    padding: 0.75rem 1rem;
  }

  .site-logo {
    width: 32px;
    height: 38px;
  }

  .site-title {
    font-size: 1rem;
  }

  .header-search input {
    width: 140px;
  }

  .nav-toggle {
    display: block;
  }

  .nav-links {
    display: none;
    flex-direction: column;
    padding-bottom: 0.5rem;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    border-bottom: none;
    border-left: 2px solid transparent;
    padding: 0.5rem 0.75rem;
  }

  .nav-links a.active {
    border-left-color: #60a5fa;
    border-bottom-color: transparent;
    color: #e2e8f0;
  }

  .site-main {
    padding: 1.25rem 1rem;
  }
}
