/* header.css — the ONE shared top header for every page.
   Load this AFTER the page's own stylesheet (style.css / op.css) so it wins
   and the header renders identically everywhere. Self-contained: font + sizes
   are fixed here; only the background follows the page's own colour token. */

:root { --header-h: 60px; }

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  height: var(--header-h);
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: 0 clamp(1.25rem, 3vw, 2.5rem);
  background: var(--cream, var(--bg, #111110));   /* page background */
  font-family: 'Sanjan', 'Space Mono', 'Courier New', monospace;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: #E7E6E1;
}

/* brand — "STstudio" wordmark in EN, 생태제작소 logo in KO */
.site-header .brand { font-weight: 400; font-size: 15px; letter-spacing: 0.02em; text-transform: none; }
.site-header .brand a { display: inline-flex; align-items: center; color: inherit; text-decoration: none; }
.site-header .brand-text { color: inherit; }
.site-header .brand-logo {
  height: 20px; width: auto; display: none;
  filter: brightness(0) invert(1);   /* source colour → white for the dark header */
}
html[lang^="ko"] .site-header .brand:not(.no-logo) .brand-logo { display: block; }
html[lang^="ko"] .site-header .brand:not(.no-logo) .brand-text { display: none; }

/* nav (centre) */
.site-header .site-nav {
  grid-column: 2;
  display: flex; justify-content: center; align-items: center;
  gap: clamp(16px, 2.4vw, 30px);
  font-family: inherit; font-size: 12px; letter-spacing: 0.06em; text-transform: none;
}
.site-header .site-nav a { color: #E7E6E1; text-decoration: none; transition: opacity 0.2s ease; }
.site-header .site-nav a:hover { opacity: 0.55; }
.site-header .site-nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 4px; }

/* right (email + hamburger) */
.site-header .right {
  grid-column: 3;
  display: flex; justify-content: flex-end; align-items: center;
  gap: clamp(14px, 2vw, 24px);
}
.site-header .header-contact { font-family: inherit; font-size: 12px; letter-spacing: 0.06em; text-transform: none; color: inherit; text-decoration: none; }

/* hamburger — two bars that cross into an X */
.site-header .menu-btn {
  display: none; flex-direction: column; justify-content: center;
  gap: 6px; width: 22px; height: 22px; padding: 0;
  background: none; border: 0; cursor: pointer;
}
.site-header .menu-btn span {
  display: block; flex: none; width: 100%; height: 2px;
  background: #E7E6E1; transition: transform 220ms ease;
}
body.menu-open .site-header .menu-btn span:first-child { transform: translateY(5px) rotate(45deg); }
body.menu-open .site-header .menu-btn span:last-child  { transform: translateY(-5px) rotate(-45deg); }

/* detail panel open → header shrinks to the left half (desktop split view) */
@media (min-width: 1024px) {
  body.detail-open .site-header { right: auto; width: 50vw; }
}

/* the long email crowds the header at laptop widths — drop it early */
@media (max-width: 1280px) {
  .site-header .header-contact { display: none; }
}

/* phones: inline nav → hamburger dropdown */
@media (max-width: 640px) {
  .site-header .menu-btn { display: inline-flex; }
  .site-header .brand-logo { height: 1rem; }
  .site-header .site-nav {
    position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 59;
    display: none; flex-direction: column; align-items: stretch; gap: 0;
    background: var(--cream, var(--bg, #111110));
    border-top: 1px solid var(--rule, #282826);
    border-bottom: 1px solid var(--rule, #282826);
    padding: 0 clamp(1.25rem, 6vw, 2.5rem); font-size: 14px;
  }
  body.menu-open .site-header .site-nav { display: flex; }
  .site-header .site-nav a { padding: 15px 0; border-bottom: 1px solid var(--rule, #282826); }
  .site-header .site-nav a:last-child { border-bottom: 0; }
}
