/* Formula header: one stylesheet for formulacommons.com and blog.formulacommons.com.
   Markup lives in _partials/header.html; scripts/sync-header.py stamps it into every page. */

.fh-header {
  position: sticky; top: 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 12px 28px;
  border-bottom: 1px solid var(--cardb);
  background: var(--header-bg);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.fh-left { display: flex; align-items: center; gap: 12px; }
.fh-logo { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.fh-diamond { font: 700 13px/1 'Spline Sans Mono', monospace; color: var(--ac); }
.fh-name { font: 600 13px/1 'Spline Sans Mono', monospace; color: var(--hd); }
.fh-tagline {
  font: 400 11px/1 'Spline Sans Mono', monospace; letter-spacing: .02em;
  color: var(--faint); padding-left: 12px; border-left: 1px solid var(--cardb); white-space: nowrap;
}

.fh-nav { display: flex; gap: 24px; align-items: center; }
.fh-nav a {
  position: relative;
  font: 500 12px/1 'Spline Sans Mono', monospace; letter-spacing: .02em;
  color: var(--mut); text-decoration: none; transition: color .15s ease;
}
.fh-nav a:hover { color: var(--hd); }
.fh-nav a.active { font-weight: 600; color: var(--hd); }
/* underline as an absolute element so it never shifts the text baseline */
.fh-nav a.active::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -7px;
  height: 2px; background: var(--ac);
}

.fh-right { display: flex; align-items: center; gap: 10px; }

.fh-search {
  display: inline-flex; align-items: center; gap: 6px; height: 34px;
  padding: 0 9px; border: 1px solid var(--cardb); border-radius: 3px;
  background: var(--card);
  font: 400 11px/1 'Spline Sans Mono', monospace; letter-spacing: .02em;
  color: var(--faint); text-decoration: none;
  transition: color .15s ease, border-color .2s ease;
}
.fh-search:hover { color: var(--mut); border-color: var(--ac); }
.fh-search kbd {
  border: 1px solid var(--cardb); border-radius: 2px; padding: 1px 5px;
  color: var(--mut); font: inherit; background: none;
}

/* Square icon buttons: same as the theme switch on zheniavasiliev.com */
.fh-btn {
  height: 34px; min-width: 34px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--cardb); border-radius: 3px; background: var(--input-bg, var(--bg)); color: var(--hd);
  cursor: pointer; padding: 0; text-decoration: none;
  transition: border-color .2s, background .15s, transform .1s;
}
.fh-btn:hover { border-color: var(--ac); }
.fh-btn:active { transform: scale(.98); }
.fh-icon { width: 34px; }
#fh-theme .fh-sun, [data-theme="dark"] #fh-theme .fh-moon { display: none; }
[data-theme="dark"] #fh-theme .fh-sun { display: block; }

.fh-subscribe {
  display: inline-flex; align-items: center; height: 34px; padding: 0 14px;
  border-radius: 3px; background: var(--mint); color: #11141c;
  font: 600 11px/1 'Spline Sans Mono', monospace; letter-spacing: .02em;
  text-decoration: none; transition: opacity .15s ease;
}
.fh-subscribe:hover { opacity: .85; }

.fh-menu-btn { display: none; }
.fh-menu { position: fixed; inset: 0; background: var(--card); z-index: 200; display: flex; flex-direction: column; animation: fh-rise .2s ease; }
.fh-menu[hidden] { display: none; }
.fh-menu-head { display: flex; align-items: center; justify-content: space-between; padding: 12px 16px 12px 20px; font: 600 10px/1 'Spline Sans Mono', monospace; letter-spacing: .1em; text-transform: uppercase; color: var(--mut); border-bottom: 1px solid var(--cardb); }
.fh-menu-body { flex: 1; overflow-y: auto; padding: 8px 12px 24px; display: flex; flex-direction: column; }
.fh-menu-body a { display: flex; align-items: center; width: 100%; color: var(--tx); font: 400 15px/1.2 'Archivo', sans-serif; padding: 13px 8px; border-radius: 3px; text-decoration: none; }
.fh-menu-body a:hover { background: var(--tint); }
.fh-menu-body a.active { color: var(--ac); }
@keyframes fh-rise { from { transform: translateY(12px); opacity: 0; } to { transform: none; opacity: 1; } }

@media (max-width: 1100px) {
  .fh-tagline { display: none; }
}
@media (max-width: 860px) {
  .fh-header { padding: 12px 16px; }
  .fh-nav, .fh-search { display: none; }
  .fh-menu-btn { display: inline-flex; }
  .fh-btn, .fh-icon { height: 44px; min-width: 44px; }
  .fh-subscribe { height: 44px; }
}
