/*
  Single site-wide header. Marketing-style bar (Montserrat brand, translucent
  sticky bar, pill buttons) shared by every page; only the nav links and
  right-side actions differ between the 'app' and 'marketing' variants.
*/

.ah {
  --ah-red: var(--layermatix-red, #b75a5a);
  --ah-red-dark: #a04c4c;
  --ah-red-soft: #f7eeee;
  --ah-ink: #17171f;
  --ah-ink-2: #33333f;
  --ah-line: #ececef;

  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.86);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
  border-bottom: 1px solid var(--ah-line);
  font-family: var(--font-body, 'Inter', sans-serif);
}

/* The app renders one anchor here (the Blog link); the blog renders this whole
   bar statically with <a> brand/nav/button. Drop the default underline (colors
   come from the specific .ah-* classes, so only text-decoration needs a reset). */
.ah a { text-decoration: none; }

.ah-inner {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 28px;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

/* Brand */
.ah-brand {
  display: flex;
  align-items: center;
  gap: 9px;
  cursor: pointer;
  flex: 0 0 auto;
}
.ah-logo {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  display: block;
  flex: 0 0 auto;
}
.ah-brand-name {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 1.32rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--ah-ink);
}
.ah-dot {
  color: var(--ah-red);
}
.ah-beta {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.1em;
  color: var(--ah-red);
  background: var(--ah-red-soft);
  padding: 3px 7px;
  border-radius: 6px;
  margin-left: 2px;
}

/* Nav links */
.ah-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}
.ah-nav-link {
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 0.82rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--ah-ink-2);
  cursor: pointer;
  transition: color 0.15s ease;
  white-space: nowrap;
}
.ah-nav-link:hover {
  color: var(--ah-red);
}

/* Right-side actions */
.ah-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}
.ah-actions-inline {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* Pill buttons */
.ah-btn {
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 1.4rem;
  border-radius: 999px;
  border: 2px solid transparent;
  font-family: var(--font-display, 'Montserrat', sans-serif);
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, border-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
  white-space: nowrap;
}
.ah-btn--sm {
  height: 40px;
  padding: 0 1.1rem;
}
.ah-btn--primary {
  background: var(--ah-red);
  color: #fff;
}
.ah-btn--primary:hover {
  background: var(--ah-red-dark);
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(183, 90, 90, 0.28);
}
.ah-btn--ghost {
  background: transparent;
  border-color: var(--ah-line);
  color: var(--ah-ink-2);
}
.ah-btn--ghost:hover {
  border-color: var(--ah-red);
  color: var(--ah-red);
}

/* Credits chip (logged in) */
.ah-credits {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 42px;
  padding: 0 14px 0 6px;
  border-radius: 999px;
  border: 1px solid var(--ah-line);
  background: #fff;
  cursor: pointer;
  font-family: var(--font-display, 'Montserrat', sans-serif);
  transition: border-color 0.15s ease;
}
.ah-credits:hover {
  border-color: var(--ah-red);
}
/* Google avatar (falls back to a bundled user glyph) is the "this is your
   account" cue; the credit count sits beside it. */
.ah-credits-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  background: var(--ah-red-soft);
  flex-shrink: 0;
}
.ah-credits-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  line-height: 1;
}
.ah-credits-value {
  font-size: 0.95rem;
  font-weight: 800;
  line-height: 1.1;
  color: var(--ah-ink);
}
.ah-credits-label {
  margin-top: 2px;
  font-size: 0.56rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ah-ink-2);
  opacity: 0.6;
}

/* Burger (mobile only) */
.ah-burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 9px;
  background: transparent;
  border: 1px solid var(--ah-line);
  border-radius: 10px;
  cursor: pointer;
}
.ah-burger span {
  display: block;
  height: 2px;
  background: var(--ah-ink);
  border-radius: 2px;
}

/* Mobile dropdown menu */
.ah-mobile {
  display: none;
  flex-direction: column;
  gap: 18px;
  padding: 22px 28px 28px;
  border-bottom: 1px solid var(--ah-line);
  background: #fff;
}
.ah-mobile-nav {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.ah-mobile-nav .ah-nav-link {
  font-size: 0.95rem;
}
.ah-mobile-actions {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-top: 18px;
  border-top: 1px solid var(--ah-line);
}
.ah-mobile-actions .ah-btn,
.ah-mobile-actions .ah-credits {
  width: 100%;
}

/* Collapse nav + inline actions into the burger menu on narrow screens */
@media (max-width: 860px) {
  .ah-nav {
    display: none;
  }
  .ah-actions-inline {
    display: none;
  }
  .ah-burger {
    display: flex;
  }
  .ah-mobile {
    display: flex;
  }
}


/* --- Blog-only overrides (see scripts/build-blog.mjs) ----------------------- */
@media (max-width: 860px) {
  .ah-inner { height: auto; flex-wrap: wrap; gap: 12px; padding-top: 12px; padding-bottom: 12px; }
  .ah-nav { display: flex; gap: 18px; }
  .ah-actions-inline { display: flex; }
}
