/* =====================================================
   AJIN HEADER v1.1
   Header only
   - Dropdown hover stability fixed
   ===================================================== */

.site-header {
  position: sticky;
  top: 0;
  background: #ffffff;
  border-bottom: 1px solid #e5e7eb;
  z-index: 999;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 12px 40px;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo a {
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 12px;
}

.logo-img {
  width: 44px;
  height: auto;
  display: block;
  flex-shrink: 0;
}

.logo-text {
  display: flex;
  flex-direction: column;
}

.logo-main {
  font-size: 18px;
  font-weight: 800;
  color: #0f172a;
  line-height: 1.2;
}

.logo-sub {
  margin-top: 3px;
  font-size: 11px;
  color: #64748b;
  font-weight: 700;
  letter-spacing: 1.2px;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 22px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-list a {
  text-decoration: none;
  color: #334155;
  font-weight: 700;
  font-size: 15px;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-list a:hover {
  color: #1d4ed8;
}

.highlight {
  background: #1d4ed8;
  color: #ffffff !important;
  padding: 9px 16px;
  border-radius: 8px;
}

.dropdown {
  position: relative;
  padding: 10px 0;
}

.dropdown > a {
  display: block;
}

/* 드롭다운 메뉴가 대메뉴와 바로 붙도록 수정 */
.dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #ffffff;
  border: 1px solid #e5e7eb;
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.14);
  flex-direction: column;
  min-width: 220px;
  padding: 8px 0;
  border-radius: 10px;
  z-index: 1000;
}

/* hover 유지 */
.dropdown:hover .dropdown-menu {
  display: flex;
}

.dropdown-menu a {
  display: block;
  padding: 12px 16px;
  white-space: nowrap;
  font-size: 14px;
  color: #334155;
}

.dropdown-menu a:hover {
  background: #eff6ff;
  color: #1d4ed8;
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
}

.menu-toggle span {
  width: 24px;
  height: 2px;
  background: #334155;
}

@media (max-width: 768px) {
  .header-inner {
    position: relative;
    padding: 10px 16px;
  }

  .logo a {
    gap: 8px;
  }

  .logo-img {
    width: 28px;
  }

  .logo-main {
    font-size: 14px;
  }

  .logo-sub {
    display: none;
  }

  .nav {
    display: none;
  }

  .site-header.menu-open .nav {
    display: block;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e5e7eb;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.12);
  }

  .site-header.menu-open .nav-list {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 8px 20px 14px;
  }

  .site-header.menu-open .nav-list li {
    width: 100%;
  }

  .site-header.menu-open .nav-list a {
    display: block;
    padding: 12px 0;
  }

  .site-header.menu-open .highlight {
    text-align: center;
    margin-top: 6px;
    padding: 10px 12px;
  }

  .dropdown {
    padding: 0;
  }

  .dropdown-menu {
    display: flex;
    position: static;
    min-width: 0;
    box-shadow: none;
    border: 0;
    padding: 0 0 4px 14px;
    background: #f8fafc;
    border-radius: 0;
  }

  .dropdown-menu a {
    padding: 9px 10px !important;
    color: #475569;
  }

  .menu-toggle {
    display: flex;
  }
}
