/* ---------- Search Overlay ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.45);
  backdrop-filter: blur(2px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

.search-overlay.active {
  display: flex !important;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
  opacity: 1;
  pointer-events: auto;
}

/* ---------- Inner Panel ---------- */
.search-overlay-inner {
  position: relative;
  width: 100%;
  max-width: 640px;
  background: var(--bg-surface);
  border-radius: 16px;
  padding: 36px 28px 32px;
  box-shadow: var(--shadow-md);
  transform: translateY(-12px) scale(0.98);
  transition: transform 0.25s ease;
}

.search-overlay.active .search-overlay-inner {
  transform: translateY(0) scale(1);
}

/* ---------- Close Button ---------- */
.overlay-close {
  position: absolute;
  top: 0;
  right: 0;
  background: var(--bg-soft);
  padding: 8px;
  border-radius: 50%;
  cursor: pointer;
  color: var(--text-muted);
  box-shadow: var(--shadow-sm);
}
.search-overlay .overlay-close{
  transform: translate(10px, -10px);
}
.overlay-close:hover {
  color: var(--text-primary);
}

.overlay-close svg {
  width: 20px;
  height: 20px;
}

/* ---------- Accessibility ---------- */
.screen-reader-text {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- Search Form Layout ---------- */
.search-form-wrapper {
  display: flex;
  justify-content: center;
}

.search-form {
  display: flex;
  gap: 10px;
  width: 90%;
  max-width: 520px;
}

.search-form label {
  flex: 1;
  display: block;
}

/* ---------- Search Field ---------- */
.search-field {
  width: 100%;
  height: 48px;
  padding: 0 14px;
  font-family: var(--font-primary);
  font-size: var(--fs-base);
  color: var(--text-primary);
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  outline: none;
}

.search-field::placeholder {
  color: var(--input-placeholder);
}

.search-field:focus {
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- Submit Button ---------- */
.search-submit {
  height: 48px;
  padding: 0 18px;
  font-size: var(--fs-sm);
  font-weight: var(--fw-medium);
  border-radius: 12px;
  border: none;
  background: var(--accent-primary);
  color: #fff;
  cursor: pointer;
  transition: background 0.15s ease;
}

.search-submit:hover {
  background: var(--accent-hover);
}

/* ---------- Mobile ---------- */
@media (max-width: 480px) {
  .search-form {
    flex-direction: column;
    width: 100%;
  }

  .search-submit {
    width: 100%;
  }
}





/* ---------- Mobile Menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 1100;
  pointer-events: none;
}

.mobile-menu.active {
  display: block !important;
  pointer-events: auto;
}
.mobile-menu .offcanvas-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0.45);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.mobile-menu.active .offcanvas-backdrop {
  opacity: 1;
}
.offcanvas-panel {
  position: absolute;
  top: 0;
  right: 0;
  height: 100%;
  width: min(320px, 85%);
  background: var(--bg-surface);
  box-shadow: -8px 0 24px rgba(0,0,0,0.15);
  transform: translateX(100%);
  transition: transform 0.25s ease;
  padding: 24px 20px;
  display: flex;
  flex-direction: column;
}

.mobile-menu.active .offcanvas-panel {
  transform: translateX(0);
}
.mobile-menu .overlay-close {
  margin-bottom: 16px;
  top:12px;
  right:12px;
}
.mobile-navigation ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.mobile-navigation li {
  border-bottom: 1px solid var(--border-light);
}

.mobile-navigation a {
  display: block;
  padding: 14px 4px;
  font-size: var(--fs-md);
  font-weight: var(--fw-medium);
  color: var(--text-primary);
  text-decoration: none;
}

.mobile-navigation a:hover {
  color: var(--accent-primary);
}
.mobile-menu .menu-utilities {
  margin-top: auto;
  padding-top: 16px;
  border-top: 1px solid var(--border-light);
  display: flex;
  gap: 12px;
}

.mobile-menu .menu-utilities button {
  flex: 1;
  height: 44px;
  border-radius: 12px;
  background: var(--bg-soft);
  border: 1px solid var(--border-light);
}

/** Inline search in hamburger **/
/* Mobile Inline Search */
.mobile-search-wrapper {
  padding: 20px 20px 16px;
  border-top: 1px solid var(--border-light);
  margin-top: 16px;
}

.mobile-search-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.mobile-search-field {
  flex: 1;
  height: 44px;
  padding: 0 14px;
  background: var(--input-bg);
  border: 1px solid var(--input-border);
  border-radius: 12px;
  font-size: var(--fs-base);
  color: var(--text-primary);
}

.mobile-search-field::placeholder {
  color: var(--input-placeholder);
}

.mobile-search-field:focus {
  outline: none;
  border-color: var(--accent-primary);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.mobile-search-submit {
  width: 44px;
  height: 44px;
  background: var(--accent-primary);
  border: none;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
}

.mobile-search-submit:hover {
  background: var(--accent-hover);
}

.mobile-search-submit svg {
  width: 20px;
  height: 20px;
  fill: #fff;
}

/** Theme Toggle */
.mobile-menu .theme-toggle {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px;
  min-width: 60px;
}

.mobile-menu .theme-icon-wrapper {
  position: relative;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.mobile-menu .theme-sun,
.mobile-menu .theme-moon {
  position: absolute;
  width: 100%;
  height: 100%;
  top: 0;
  left: 0;
  transition: opacity 0.3s ease, transform 0.3s ease;
  color: var(--text-primary);
}

.mobile-menu .theme-sun {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.mobile-menu .theme-moon {
  opacity: 0;
  transform: rotate(-30deg) scale(0.8);
}

/* Dark mode: show moon, hide sun */
[data-theme="dark"] .mobile-menu .theme-sun {
  opacity: 0;
  transform: rotate(30deg) scale(0.8);
}

[data-theme="dark"] .mobile-menu .theme-moon {
  opacity: 1;
  transform: rotate(0deg) scale(1);
}

.mobile-menu .theme-toggle .utility-label {
  font-size: var(--fs-xs);
  font-weight: var(--fw-medium);
  color: var(--text-muted);
  margin-top: 2px;
}

/* Optional: hover effect */
.mobile-menu .theme-toggle:hover .theme-icon-wrapper {
  transform: scale(1.1);
}