/* --- JAMIT HEADER CSS --- */

.desktop-header {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  box-sizing: border-box;
  padding: 0 20px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  min-height: 88px;
  position: relative;
  z-index: 99;
}

.dark-theme .desktop-header {
  background: linear-gradient(135deg, #4a4d55, #b0b0b0) !important;
  color: #ffffff !important;
}
.matrix-mode .desktop-header {
  background-color: #000 !important;
  color: #96F447 !important;
  font-family: 'IBM Plex Mono', monospace !important;
}

.desktop-left-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  min-width: 100px;
  gap: 7px;
}
.logo {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 100px;
  height: 100px;
  padding-top: 10px;
}
.logo img {
  width: 100px;
  height: 100px;
  object-fit: contain;
  margin-bottom: 0;
}

.toggle-group {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-right: 0;
}

.desktop-center {
  flex: 1 1 0;
  min-width: 60px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.header-title {
  display: block;
  font-size: 2.2em;
  font-weight: bold;
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.desktop-right {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 60px;
}

.menu {
  display: block !important;
  font-size: 2em;
  cursor: pointer;
  margin-left: 24px;
  z-index: 2000;
}

nav {
  display: none;
  position: absolute;
  right: 10px;
  top: 50px;
  background-color: #fff;
  box-shadow: 0 2px 5px rgba(0,0,0,0.2);
  border-radius: 8px;
  overflow: hidden;
  width: 200px;
  z-index: 999;
}
nav a {
  display: block;
  padding: 10px;
  color: #333;
  text-decoration: none;
}
nav a:hover { background-color: #f0f0f0; }
.dark-theme nav, .dark-theme nav a {
  background-color: #4a4d55 !important;
  color: #fff !important;
}
.dark-theme nav a:hover { background-color: #96F447 !important; color: #000 !important; }

/* --- RESPONSIVE (shrink but never stack columns) --- */
@media (max-width: 1100px) {
  .desktop-header {
    padding: 10px 8px;
    min-height: 65px;
  }
  .logo,
  .logo img {
    width: 70px;
    height: 70px;
    max-width: 70px;
    max-height: 70px;
  }
  .desktop-left-stack { min-width: 70px; gap: 4px; }
  .header-title { font-size: 1.4em; }
}
@media (max-width: 900px) {
  .desktop-header {
    padding: 3px 3vw;
    min-height: 50px;
  }
  .logo,
  .logo img {
    width: 50px;
    height: 50px;
    max-width: 50px;
    max-height: 50px;
  }
  .desktop-left-stack { min-width: 50px; gap: 3px; }
  .header-title { font-size: 1.1em; }
}
@media (max-width: 650px) {
  .desktop-header {
    padding: 1px 1vw;
    min-height: 42px;
  }
  .desktop-left-stack {
    min-width: 38px;
    gap: 2px;
  }
  .logo,
  .logo img {
    width: 32px;
    height: 32px;
    max-width: 32px;
    max-height: 32px;
    padding-top: 5px;
  }
  .header-title { font-size: 0.95em; }
  .desktop-center {
    min-width: 40px;
  }
}

/* Prevents columns from collapsing/overlapping on mobile */
.desktop-header > .desktop-left-stack,
.desktop-header > .desktop-center,
.desktop-header > .desktop-right {
  flex-shrink: 0;
  flex-basis: auto;
}

/* Toggles (reuse for all switches/toggles) */
.theme-controls, .toggle-stack {
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.toggle-group {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin-right: 0;
}
.switch {
  position: relative;
  display: inline-block;
  width: 44px;
  height: 22px;
  margin-right: 4px;
}
.switch input { opacity: 0; width: 0; height: 0; }
.slider {
  position: absolute;
  cursor: pointer;
  top: 0; left: 0; right: 0; bottom: 0;
  background-color: #4a4d55;
  transition: 0.4s;
  border-radius: 34px;
}
.slider:before {
  position: absolute;
  content: "";
  height: 16px;
  width: 16px;
  left: 3px;
  bottom: 3px;
  background-color: #82008f;
  transition: 0.4s;
  border-radius: 50%;
}
input:checked + .slider { background-color: #96F447; }
input:checked + .slider:before { transform: translateX(20px); }
.toggle-label {
  font-weight: bold;
  font-size: 14px;
  margin-right: 8px;
}
@media (max-width: 700px) {
  .toggle-label { font-size: 12px; margin-right: 2px; }
  .switch { width: 34px; height: 18px; }
  .slider:before { height: 12px; width: 12px; }
}
.disabled-switch {
  opacity: 0.4;
  pointer-events: none;
  filter: grayscale(1);
}
.matrix-info {
  font-size: 1em;
  margin-left: 6px;
  color: #aaa;
  cursor: help;
  display: inline;
}


/* === Multiline header title (index.shtml) === */
.header-title.header-wrap {
  white-space: normal !important;
  word-break: break-word;
  hyphens: auto;
  text-align: center;
  line-height: 1.2;
  max-width: min(95vw, 1100px);
  margin: 0 auto;
  padding: 2px 6px;
}
.header-title.header-wrap .header-line-1 {
  display: block;
  font-weight: 800;
  font-size: clamp(1.1rem, 2.6vw, 2rem);
}
.header-title.header-wrap .header-line-2 {
  display: block;
  margin-top: 2px;
  font-weight: 600;
  font-size: clamp(0.85rem, 1.8vw, 1.25rem);
}
@media (max-width: 650px) {
  .desktop-header { flex-wrap: wrap; }
  .desktop-center { width: 100%; order: 3; padding: 4px 6px; }
  .header-title.header-wrap { max-width: 96vw; padding: 4px 6px; }
  .header-title.header-wrap .header-line-1 { font-size: clamp(1rem, 5.2vw, 1.35rem); }
  .header-title.header-wrap .header-line-2 { font-size: clamp(0.85rem, 3.9vw, 1.05rem); }
}
