/* =============================================
   MOBILE MENU — CSS-Only (Checkbox Hack)
   ============================================= */

/* --- Overflow Bug Fix --- */
html, body {
  overflow-x: hidden;
  max-width: 100%;
}

/* --- Hide the checkbox --- */
#menu-toggle {
  display: none;
}

/* --- Hamburger Button --- */
.hamburger {
  display: none;
  cursor: pointer;
  font-size: 28px;
  color: #1e3a8a;
  background: #eef2ff;
  border: none;
  border-radius: 10px;
  padding: 6px 12px;
  line-height: 1;
  z-index: 1001;
  position: relative;
  user-select: none;
  -webkit-user-select: none;
}

/* --- Language Dropdown --- */
.lang-switch {
  position: relative;
  margin-left: 8px;
  z-index: 1002;
}

.lang-switch summary {
  list-style: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  border-radius: 10px;
  border: 1px solid #e5e7eb;
  background: #fff;
  color: #334155;
  font-weight: 700;
  font-size: 13px;
  line-height: 1;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
}

.lang-switch summary::-webkit-details-marker {
  display: none;
}

.lang-switch summary::after {
  content: "▾";
  font-size: 12px;
  color: #64748b;
}

.lang-switch[open] summary::after {
  content: "▴";
}

.lang-switch ul {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  margin: 0;
  padding: 8px;
  list-style: none;
  min-width: 96px;
  border: 1px solid #e5e7eb;
  border-radius: 10px;
  background: #fff;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.12);
}

.lang-switch a {
  display: block;
  padding: 8px 10px;
  border-radius: 8px;
  color: #334155;
  font-weight: 600;
  font-size: 13px;
  text-decoration: none;
}

.lang-switch a:hover {
  background: #eff6ff;
  color: #2563eb;
}

.lang-switch a.active {
  background: #eff6ff;
  color: #2563eb;
}

/* --- Overlay (label wrapping the full screen) --- */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.45);
  z-index: 998;
  cursor: pointer;
}

/* --- Slide-in Panel --- */
.mobile-panel {
  position: fixed;
  top: 0;
  right: -280px;
  width: 280px;
  height: 100vh;
  background: #0f172a;
  z-index: 999;
  transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  display: flex;
  flex-direction: column;
  padding: 0;
  box-shadow: -4px 0 24px rgba(0, 0, 0, 0.25);
  overflow-y: auto;
}

/* --- Panel Header (Logo area) --- */
.mobile-panel-header {
  padding: 24px 22px 18px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}
.mobile-panel-header .mobile-brand {
  font-family: "Playfair Display", Georgia, serif;
  font-size: 28px;
  font-weight: 700;
  color: #fff;
  text-decoration: none;
  line-height: 1;
  letter-spacing: 0.3px;
}

/* --- Panel Nav Links --- */
.mobile-panel-nav {
  list-style: none;
  margin: 0;
  padding: 18px 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0;
}
.mobile-panel-nav li {
  margin: 0;
  padding: 0;
  width: 100%;
}
.mobile-panel-nav a,
.mobile-panel-nav label {
  display: block;
  padding: 14px 22px;
  color: #cbd5e1;
  font-weight: 600;
  font-size: 16px;
  text-decoration: none;
  text-align: left;
  cursor: pointer;
  border-left: 3px solid transparent;
  transition:
    border-left-color 0.25s ease,
    padding-left 0.25s ease,
    color 0.25s ease,
    background 0.25s ease;
}
.mobile-panel-nav a:hover,
.mobile-panel-nav label:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
  border-left-color: #2563eb;
  padding-left: 28px;
}
.mobile-panel-nav a.active {
  color: #60a5fa;
  border-left-color: #2563eb;
  background: rgba(37, 99, 235, 0.08);
}

/* --- Checkbox Checked States --- */

/* Show overlay when menu is open */
#menu-toggle:checked ~ .mobile-overlay {
  display: block;
}

/* Slide in panel when menu is open */
#menu-toggle:checked ~ .mobile-panel {
  right: 0;
}

/* Change hamburger icon from ☰ to ✕ */
.hamburger::before {
  content: "☰";
}
#menu-toggle:checked ~ header .hamburger::before,
#menu-toggle:checked ~ .site-header .hamburger::before {
  content: "✕";
}

/* --- Responsive: Only show on mobile --- */
@media (max-width: 768px) {
  .nav {
    gap: 8px;
  }

  .logo {
    min-width: 0;
  }

  .brand-word {
    font-size: 30px;
  }

  .lang-switch {
    margin-left: auto;
  }

  .lang-switch summary {
    padding: 7px 10px;
    font-size: 12px;
  }

  .lang-switch ul {
    top: calc(100% + 6px);
    min-width: 88px;
    padding: 6px;
  }

  .lang-switch a {
    padding: 7px 8px;
    font-size: 12px;
  }

  .hamburger {
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Hide the old menu-btn buttons */
  .menu-btn {
    display: none !important;
  }

  /* Hide the desktop nav */
  header nav,
  .site-header nav {
    display: none !important;
  }
}

/* --- Desktop: Ensure panel/overlay are hidden --- */
@media (min-width: 769px) {
  .mobile-panel,
  .mobile-overlay,
  .hamburger {
    display: none !important;
  }
}
