/*
  Shared header & nav styles used across all pages.
  Imported by index.css (builder) and linked directly from standalone HTML pages.
*/

/* ─── Header ─── */
.site-header {
  background: var(--secondary-color);
  border-bottom: 1px solid var(--quaternary-color);
  padding: 1em 0;
}

.header-inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 1.5rem;
  min-height: 3.5rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.header-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  font-weight: 700;
  font-size: 1.125rem;
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
  flex-shrink: 0;
}

.header-logo {
  font-size: 1.3rem;
  line-height: 1;
}

.header-primary {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  justify-content: space-between;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: nowrap;
  position: relative;
}

/* ─── Buttons ─── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.4rem 0.85rem;
  font-size: 0.875rem;
  font-family: inherit;
  font-weight: 500;
  border: 1.5px solid transparent;
  border-radius: 0.375rem;
  cursor: pointer;
  background: none;
  text-decoration: none;
  color: inherit;
  transition: opacity 0.15s;
}

.btn-icon {
  line-height: 1;
}

.btn-label {
  line-height: 1;
}

.btn:hover {
  opacity: 0.8;
}

.btn-primary {
  background: var(--foreground-color);
  color: var(--background-color);
  border-color: var(--foreground-color);
}

.btn-secondary {
  background: var(--secondary-color);
  border-color: var(--quaternary-color);
  color: var(--foreground-color);
}

.btn-secondary:hover {
  border-color: var(--trinary-color);
  opacity: 1;
}

.btn-back,
.btn-back-header {
  background: var(--secondary-color);
  border-color: var(--quaternary-color);
  color: var(--foreground-color);
}

.btn-back:hover,
.btn-back-header:hover {
  border-color: var(--foreground-color);
  opacity: 1;
}

/* ─── Header-specific button sizing ─── */
.header-actions .btn {
  white-space: nowrap;
  line-height: 1;
  flex-shrink: 0;
}

/* ─── Hamburger ─── */
.hamburger-btn {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 2.5rem;
  height: 2.5rem;
  padding: 0.4rem;
  gap: 0.25rem;
  background: none;
  border: 1.5px solid var(--quaternary-color);
  border-radius: 0.375rem;
  cursor: pointer;
  flex-shrink: 0;
}

.hamburger-btn span {
  display: block;
  width: 1.25rem;
  height: 2px;
  background: var(--foreground-color);
  border-radius: 1px;
  transition: transform 0.2s, opacity 0.2s;
}

.hamburger-menu {
  display: none;
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 220px;
  background: var(--secondary-color);
  border: 1.5px solid var(--quaternary-color);
  border-radius: 0.5rem;
  padding: 0.5rem;
  z-index: 100;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.hamburger-menu.open {
  display: block;
}

.hamburger-menu-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem 0.75rem;
  border-radius: 0.375rem;
  text-decoration: none;
  color: inherit;
  font-size: 0.9rem;
  font-weight: 500;
  cursor: pointer;
  background: none;
  border: none;
  width: 100%;
  text-align: left;
  font-family: inherit;
  white-space: nowrap;
}

.hamburger-menu-item:hover {
  background: var(--quaternary-color);
}

.hamburger-menu-item .btn-icon {
  font-size: 1.1rem;
  line-height: 1;
  flex-shrink: 0;
}

.hamburger-menu-item .btn-label {
  line-height: 1;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .header-title {
    display: none;
  }

  .hamburger-menu {
    right: 0;
    left: auto;
    min-width: 220px;
    width: auto;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0.5rem 0.75rem;
    gap: 0.5rem;
  }

  .header-title {
    display: none;
  }

  .header-primary {
    flex: 1 1 100%;
  }

  .header-actions {
    flex: 0 0 auto;
    flex-wrap: nowrap;
    justify-content: flex-end;
  }

}
