/* ── Header ── */
#site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--header-height);
  display: flex;
  align-items: center;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  z-index: 100;
  padding: 0 1rem 0 1.25rem;
  gap: 1.5rem;
}

#site-name {
  font-family: 'Franklin Gothic Medium', 'Franklin Gothic', 'ITC Franklin Gothic', Arial, sans-serif;
  font-size: 1.5rem;
  font-weight: normal;
  letter-spacing: 0.01em;
  white-space: nowrap;
  flex-shrink: 0;
  color: var(--color-text);
  text-decoration: none;
}

/* ── Desktop Tab Bar ── */
#tab-bar {
  display: flex;
  align-items: stretch;
  margin-left: auto;
  overflow-x: auto;
  scrollbar-width: none;
  height: 100%;
}
#tab-bar::-webkit-scrollbar { display: none; }

.tab-item {
  position: relative;
  display: flex;
  align-items: center;
  height: 100%;
}

.tab-item a,
.tab-item .tab-label {
  display: flex;
  align-items: center;
  height: 100%;
  padding: 0 1rem;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  white-space: nowrap;
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  user-select: none;
}

.tab-item a:hover,
.tab-item .tab-label:hover {
  color: var(--color-text);
}

.tab-item a.active,
.tab-item.active > .tab-label {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

/* Non-navigable parent tab label */
.tab-label {
  cursor: pointer;
}

/* Floating dropdown menu (appended to body, fixed-positioned) */
#tab-dropdown-menu {
  position: fixed;
  top: 0;
  left: 0;
  display: none;
  flex-direction: column;
  background: var(--color-bg);
  border: 1px solid var(--color-border);
  border-top: none;
  min-width: 160px;
  z-index: 200;
}

#tab-dropdown-menu.visible {
  display: flex;
}

#tab-dropdown-menu a {
  padding: 0.6rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
  white-space: nowrap;
}

#tab-dropdown-menu a:hover {
  color: var(--color-text);
  background: rgba(0,0,0,0.04);
}

#tab-dropdown-menu a.active {
  color: var(--color-text);
  font-weight: 600;
}

/* ── Subtab bar (inside content area) ── */
.subtab-bar {
  position: sticky;
  top: 0;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  display: flex;
  gap: 0;
  margin: -2.5rem -2.5rem 2rem calc(-1 * var(--content-left-pad));
  padding: 0 2.5rem 0 var(--content-left-pad);
  z-index: 10;
}

.subtab-bar a {
  padding: 0.75rem 1rem;
  font-family: var(--font-ui);
  font-size: 0.75rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
}

.subtab-bar a:hover { color: var(--color-text); }
.subtab-bar a.active {
  color: var(--color-text);
  border-bottom-color: var(--color-text);
}

@media (max-width: 768px) {
  .subtab-bar {
    margin: -1.5rem -1.25rem 1.5rem -1.25rem;
    padding: 0 1.25rem;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .subtab-bar::-webkit-scrollbar { display: none; }
}

/* ── Social Links (Desktop — fixed left) ── */
#social-desktop {
  position: fixed;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  padding: 0.5rem 0.5rem;
  z-index: 100;
}

#social-desktop a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  color: var(--color-text-muted);
  transition: color 0.15s;
}

#social-desktop a:hover { color: var(--color-text); }

#social-desktop svg {
  width: 18px;
  height: 18px;
  fill: currentColor;
}

/* ── Hamburger ── */
#hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  padding: 8px;
  margin-left: auto;
  width: 40px;
  height: 40px;
}

#hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--color-text);
  transition: transform 0.2s, opacity 0.2s;
}

#hamburger[aria-expanded="true"] span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
#hamburger[aria-expanded="true"] span:nth-child(2) {
  opacity: 0;
}
#hamburger[aria-expanded="true"] span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Mobile Overlay ── */
#mobile-overlay {
  position: fixed;
  inset: 0;
  background: var(--color-bg);
  z-index: 300;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.3s ease;
  padding: calc(var(--header-height) + 1rem) 1.5rem 2rem;
  overflow-y: auto;
}

#mobile-overlay.open {
  transform: translateX(0);
}

#overlay-close {
  position: absolute;
  top: 0.75rem;
  right: 1rem;
  font-size: 1.75rem;
  line-height: 1;
  color: var(--color-text);
  padding: 0.25rem;
}

#mobile-nav {
  flex: 1;
  display: flex;
  flex-direction: column;
}

.mobile-tab-item {
  border-bottom: 1px solid var(--color-border);
}

.mobile-tab-item a,
.mobile-tab-toggle {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 1rem 0;
  font-family: var(--font-ui);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--color-text);
  text-decoration: none;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
}

.mobile-tab-toggle .chevron {
  font-size: 0.7rem;
  transition: transform 0.2s;
}

.mobile-tab-item.expanded .chevron {
  transform: rotate(180deg);
}

.mobile-subtabs {
  display: none;
  flex-direction: column;
  padding: 0 0 0.5rem 1rem;
}

.mobile-tab-item.expanded .mobile-subtabs {
  display: flex;
}

.mobile-subtabs a {
  padding: 0.5rem 0;
  font-family: var(--font-ui);
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--color-text-muted);
  text-decoration: none;
}

.mobile-subtabs a.active,
.mobile-tab-item a.active {
  color: var(--color-text);
  font-weight: 600;
}

#mobile-social {
  display: flex;
  gap: 1.25rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--color-border);
  margin-top: 1rem;
}

#mobile-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  color: var(--color-text);
}

#mobile-social svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}

/* ── Responsive ── */
@media (max-width: 768px) {
  #tab-bar { display: none; }
  #hamburger { display: flex; }
  #social-desktop { display: none; }
}

@media (min-width: 769px) {
  #hamburger { display: none; }
  #mobile-overlay { display: none !important; }
}
