/* ============================================================================
 * masthead.css — Shared header / nav / icon styles for every page.
 * Loaded AFTER each page's inline <style> so it overrides any duplicates.
 * Single source of truth — edit here, runs everywhere on next deploy.
 * ========================================================================== */

/* Header */
.masthead { padding: 32px 0 0; }
.masthead-top {
  display: flex;
  align-items: center;
  gap: 24px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.masthead-divider { border-top: 1px solid var(--border-light); }

/* Site title */
.site-title {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  letter-spacing: -0.5px;
  color: var(--text-primary);
  text-decoration: none;
  white-space: nowrap;
}
.site-title span { color: var(--gold); }

/* Desktop nav */
.nav-desktop {
  display: flex;
  gap: 20px;
  margin-left: auto;
}
.nav-desktop a {
  font-family: var(--font-body);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
  transition: color 0.2s;
  letter-spacing: 0.2px;
}
.nav-desktop a:hover,
.nav-desktop a.active { color: var(--gold); }

/* Mobile nav (hidden by default; expanded by hamburger) */
.nav-mobile { display: none; padding: 16px 0 24px; }
.nav-mobile.open { display: flex; flex-direction: column; gap: 16px; }
.nav-mobile a {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 500;
  color: var(--text-muted);
  text-decoration: none;
}
.nav-mobile a:hover,
.nav-mobile a.active { color: var(--gold); }

/* Icon row */
.nav-icons {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}

/* Individual icon button (account, X, RSS, theme toggle) */
.nav-icon {
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.2s;
  text-decoration: none;
  color: inherit;
}
.nav-icon:hover { border-color: var(--border-gold); }
.nav-icon svg {
  width: 16px;
  height: 16px;
  stroke: var(--text-muted);
  fill: none;
  transition: stroke 0.2s, fill 0.2s;
}
.nav-icon:hover svg { stroke: var(--gold); }
.nav-icon .icon-x {
  fill: var(--text-muted);
  stroke: none;
  width: 14px;
  height: 14px;
}
.nav-icon:hover .icon-x { fill: var(--gold); stroke: none; }

/* Theme toggle moon/sun visibility */
.nav-icon .icon-moon { display: block; }
.nav-icon .icon-sun  { display: none; }
body.light .nav-icon .icon-moon { display: none; }
body.light .nav-icon .icon-sun  { display: block; }

/* Hamburger button (mobile only — display:flex via media query below) */
.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  cursor: pointer;
  padding: 6px 8px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-muted);
  margin: 5px 0;
  transition: all 0.3s;
}
.nav-toggle.open span:nth-child(1) { transform: rotate(45deg)  translate(5px,  5px); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { transform: rotate(-45deg) translate(5px, -5px); }

/* Mobile breakpoint — collide-safe layout */
@media (max-width: 600px) {
  .nav-desktop { display: none; }
  .nav-toggle  { display: flex; }
  .site-title  { font-size: 28px; }
  .masthead-top { gap: 12px; }
  .nav-icons { margin-left: auto; }
}
