/* Site header. Light theme only. Spacing uses the shared step scale from tokens.css (--space-1 4px ... --space-9 80px), with the
   same pixel value as each fallback so the file still works if tokens.css is missing. Load tokens.css first. */
:root {
  --color-accent: #A7410E;
  --color-text: #2B2623;
  --color-text-muted: #5E5853;
  --color-surface: #F7F4EF;
  --color-surface-raised: #FFFFFF;
  --color-border: #7A736C;
  --font-display: "Rubik", system-ui, sans-serif;
  --font-body: "Source Sans 3", system-ui, sans-serif;
}

.site-header {
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
  font-family: var(--font-body);
  color: var(--color-text);
}
.site-header *, .site-header *::before, .site-header *::after { box-sizing: border-box; }

.site-header__inner {
  max-width: 1200px;
  margin: 0 auto;
  padding: var(--space-2, 8px) var(--space-5, 24px);
  display: flex;
  align-items: center;
  gap: var(--space-5, 24px);
  min-height: 64px;
}

/* One focus treatment everywhere */
.site-header a:focus-visible,
.site-header button:focus-visible {
  outline: 3px solid var(--focus-ring-color);
  outline-offset: 2px;
}

/* Logo (text wordmark) */
.site-header__logo {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 24px;
  line-height: 1;
  color: var(--color-text);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  gap: var(--space-2, 8px);
  flex: none;                 /* the logo never shrinks, so its words can never run under the nav links */
  white-space: nowrap;
}
/* Logo mark: decorative (the link's accessible name is the wordmark), transparent SVG, sized to sit with the text */
.site-header__logo::before {
  content: "";
  flex: none;
  height: 32px;
  width: 14px;
  background: url("../images/museum-vendors-mark.svg") center / contain no-repeat;
}

/* Main nav */
.site-header__nav { flex: 1 1 auto; }
.site-header__links { list-style: none; margin: 0; padding: 0; display: flex; gap: var(--space-2, 8px); }
.nav-link {
  white-space: nowrap;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-3, 12px);
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
}
.nav-link:hover { text-decoration: underline; text-underline-offset: 4px; }
.nav-link[aria-current="page"] { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }

/* Signed in: who, and Sign out (css/header-session.js) */
.site-header__who { display: none; max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 14px; color: var(--color-text-muted); }
@media (min-width: 1440px) { .site-header__who { display: block; } }   /* the single header row has no room for it below this; "Sign out" and the mobile menu still say you are signed in */
.mobile-menu__who { margin: 0; padding: var(--space-3, 12px) 0; font-size: 14px; color: var(--color-text-muted); overflow-wrap: anywhere; border-bottom: 1px solid #D8D2CA; }

/* Actions */
.site-header__actions { display: flex; align-items: center; gap: var(--space-2, 8px); margin-left: auto; }

/* Buttons (header subset of the button standard) */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  min-width: 44px;
  padding: 0 var(--space-4, 16px);
  border: 2px solid transparent;
  border-radius: 4px;
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 600;
  line-height: 1.2;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
}
.btn--primary { background: var(--color-accent); color: #FFFFFF; border-color: var(--color-accent); }
.btn--primary:hover { background: #8F3809; border-color: #8F3809; }
.btn--secondary { background: transparent; color: var(--color-text); border-color: var(--color-border); }
.btn--secondary:hover { background: var(--color-surface-raised); }
.btn--tertiary { background: transparent; color: var(--color-text); padding: 0 var(--space-3, 12px); }
.btn--tertiary:hover { text-decoration: underline; text-underline-offset: 4px; }

/* Icon-only button, 44 x 44 */
.icon-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  padding: 0;
  background: transparent;
  color: var(--color-text);
  border: 2px solid var(--color-border);
  border-radius: 4px;
  cursor: pointer;
}
.icon-btn .icon--close { display: none; }
.icon-btn[aria-expanded="true"] .icon--open { display: none; }
.icon-btn[aria-expanded="true"] .icon--close { display: block; }

/* Mobile menu panel */
.mobile-menu { background: var(--color-surface); border-top: 1px solid var(--color-border); }
.mobile-menu[hidden] { display: none; }
.mobile-menu__list { list-style: none; margin: 0 auto; padding: 0 var(--space-4, 16px); max-width: 1200px; }
.mobile-menu__link {
  display: flex;
  align-items: center;
  min-height: 52px;                      /* rows are 52px (48 to 56 allowed); every row is a full-width tap target, never under 44 */
  padding: 0;                            /* the text starts at the list's 16px gutter, the same left edge as the logo */
  font-size: 18px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 1px solid #D8D2CA;
}
.mobile-menu__list li:last-child .mobile-menu__link { border-bottom: 0; }
.mobile-menu__link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* 761 to 1139: links drop to a second row so nothing is cut off (the five header links plus three actions need about 1120px) */
@media (min-width: 761px) and (max-width: 1139px) {
  .site-header__inner { flex-wrap: wrap; row-gap: 0; }
  .site-header__nav { order: 3; flex: 0 0 100%; margin-left: calc(var(--space-3, 12px) * -1); }
}
/* The same two rows at any wider width where the single row would not fit. header.js adds .is-stacked after measuring, which covers
   fonts wider than Rubik (when the web font hasn't loaded or is blocked) and larger text sizes, so the logo never meets the nav links. */
@media (min-width: 761px) {
  .site-header.is-stacked .site-header__inner { flex-wrap: wrap; row-gap: 0; }
  .site-header.is-stacked .site-header__nav { order: 3; flex: 0 0 100%; margin-left: calc(var(--space-3, 12px) * -1); }
}

/* Phone and small tablet, 760 and under: logo, Post an RFP, menu icon */
@media (max-width: 760px) {
  .site-header__inner { padding: var(--space-2, 8px) var(--space-4, 16px); gap: var(--space-2, 8px); }
  .site-header__nav,
  .site-header__desktop-only { display: none; }
  .icon-btn { display: inline-flex; }
  .site-header__logo { flex: 0 1 auto; white-space: normal; }   /* on phones the wordmark may wrap to two lines beside the buttons */
}

/* Desktop never shows the panel even if left open */
@media (min-width: 761px) { .mobile-menu { display: none; } }

@media (max-width: 380px) {
  /* "Museum Vendors" wraps onto two lines on the smallest phones; keep it clear of the Post an RFP button */
  .site-header__logo { font-size: 18px; line-height: 1.1; min-width: 0; }
  .site-header__logo::before { height: 28px; width: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .site-header * { transition: none !important; animation: none !important; }
}

@media print {
  .site-header { border-bottom: 1px solid #000; }
  .btn--primary { background: #fff; color: #000; border: 2px solid #000; }
  .icon-btn, .mobile-menu { display: none; }
}
