/* File: /assets/css/components/header.css
   Owner: EC
   Purpose: Responsive site header with brand, nav, and toggle
   Version: 1.0
   Updated: 2025-11-09
   Notes (ALCOA-C):
     - Theme-aware via semantic tokens (no hex, no blends)
     - Mobile-first; menu visibility controlled by a class (.is-open)
     - Keyboard and screen-reader friendly hooks preserved
*/

.header {
  --hdr-bg: var(--color-bg);
  --hdr-fg: var(--color-heading);
  --hdr-bd: var(--color-border);

  position: relative;
  z-index: var(--z-header);
  background: var(--hdr-bg);
  color: var(--hdr-fg);
  border-bottom: var(--border-width) solid var(--hdr-bd);
}

.header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 3.5rem;                    /* ~56px comfortable tap target */
  padding-inline: 1rem;
  width: min(100% - 2rem, var(--container-max));
  margin-inline: auto;
}

/* Brand block: logo + wordmark */
.header__brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: inherit;
  text-decoration: none;
}
.header__logo {
  display: inline-block;
  width: 1.75rem;
  height: 1.75rem;
  line-height: 0;
  color: currentColor;                   /* SVGs use currentColor */
}
.header__title {
  font-family: var(--font-sans-tight);
  font-weight: var(--weight-semibold);
  font-size: 1.05rem;
  letter-spacing: -0.005em;
  color: inherit;
}

/* Nav area */
.header__nav {
  display: none;                         /* mobile: collapsed by default */
}
.header.is-open .header__nav { display: block; }

/* Toggle (hamburger) */
.header__toggle {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0;
  margin-left: 0.25rem;
  border: var(--border-width) solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  color: var(--color-heading);
  cursor: pointer;
}
.header__toggle:focus-visible {
  outline: var(--focus-ring);
  outline-offset: var(--focus-offset);
  border-radius: var(--focus-radius);
}
.header__toggle .icon {
  width: 1.2em;
  height: 1.2em;
  color: currentColor;
}

/* Desktop layout */
@media (min-width: 48rem) {              /* 768px */
  .header__inner { gap: 1rem; }
  .header__nav { display: block; }
  .header__toggle { display: none; }
}

/* Variants (optional) */
.header--borderless { border-bottom: 0; }
.header--sticky    { position: sticky; top: 0; }
.header--compact   .header__inner { min-height: 3rem; }

/* Reduce motion niceties */
@media (prefers-reduced-motion: no-preference) {
  .header__toggle { transition: background var(--dur-100) var(--ease-standard); }
  .header__toggle:hover { background: var(--color-surface); }
}
