/* ============================================================
   site-header.css — scoped styles for the shared site header
   (#site-header rendered by components.min.js renderHeader)
   and #site-footer (renderFooter).

   Used by pages that do NOT load shared.min.css (legacy pages
   with their own body styles). All values are baked in so the
   page's own CSS variables can never break the chrome.
   ============================================================ */

#site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 28px 0 20px;
  border-bottom: 1px solid rgba(138, 104, 32, 0.1);
  background: transparent;
  height: auto;
  min-height: 0;
  position: static;
  z-index: auto;
}

/* Direct child of body: align with a 1120px content column,
   same formula as .guide-wrap. Pages with narrower columns
   override the width inline on the <header> tag. */
body > #site-header {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
}

#site-header .logo {
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-decoration: none;
}
#site-header .logo-main {
  font-family: Georgia, 'Times New Roman', serif;
  font-size: 20px;
  font-weight: 600;
  color: #8a6820;
  letter-spacing: 0.15em;
}
#site-header .logo-sub {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #9a8a6a;
  letter-spacing: 0.28em;
  font-style: italic;
}

#site-header nav.site-nav {
  display: flex;
  align-items: center;
  gap: 16px;
}
#site-header .nav-link {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 13px;
  color: #5a4020;
  text-decoration: none;
  letter-spacing: 0.04em;
  transition: color 0.2s;
  cursor: pointer;
}
#site-header .nav-link:hover { color: #8a6820; }

#site-header #lang-switcher {
  position: relative;
  display: inline-block;
}

/* ── Guides menu — mobile expands inline (no hover dependency) ── */
@media (max-width: 680px) {
  #site-header {
    flex-wrap: wrap;
    justify-content: center;
    row-gap: 8px;
    padding: 12px 0 10px;
  }
  #site-header > .logo {
    flex: 1 1 100%;
    align-items: center;
  }
  #site-header > .site-nav {
    order: 3;
    flex: 1 1 100% !important;
    width: 100%;
    padding: 2px 0 0 !important;
    gap: 4px !important;
    justify-content: center;
    flex-wrap: nowrap !important;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }
  #site-header > .site-nav::-webkit-scrollbar { display: none; }
  #site-header .nav-guides-wrap { flex: 0 0 auto; width: auto; }
  #site-header #nav-dropdown.nav-dropdown {
    position: absolute !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: min(88vw, 280px);
    min-width: 0 !important;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12) !important;
    border-radius: 12px !important;
    margin-top: 4px;
  }
  #site-header .nav-guide-item { white-space: normal !important; }
  #site-header .nav-link,
  #site-header #nav-guides-btn {
    font-size: 12px !important;
    padding: 5px 8px !important;
  }
}

/* ── Footer (only pages that call renderFooter) ── */
#site-footer {
  text-align: center;
  padding: 40px 0 20px;
  border-top: 1px solid rgba(138, 104, 32, 0.1);
  margin-top: 60px;
}
#site-footer p {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 11px;
  color: #9a8a6a;
  letter-spacing: 0.2em;
}
#site-footer a { color: #9a8a6a; text-decoration: none; }
#site-footer a:hover { color: #a07828; }
