/* Hidayah — 헤더·내비게이션 */

.header {
  --background-color: rgba(0, 0, 0, 0);
  --default-color: #ffffff;
  --heading-color: #ffffff;
  color: var(--default-color);
  background-color: var(--background-color);
  padding: 15px 0;
  transition: all 0.5s;
  z-index: 997;
}

.header.header-light {
  --background-color: rgba(255, 255, 255, 0.94);
  --default-color: #1b2a46;
  --heading-color: #1b2a46;
  --nav-color: #1b2a46;
  backdrop-filter: blur(6px);
  border-bottom: 1px solid rgba(19, 36, 67, 0.08);
  box-shadow: 0 8px 22px rgba(20, 35, 64, 0.08);
}

.header .logo {
  line-height: 1;
}

.header .logo img {
  max-height: 64px;
  margin-right: 8px;
}

.header .header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

.scrolled .header {
  box-shadow: 0 0 18px rgba(0, 0, 0, 0.1);
  --background-color: rgba(0, 0, 0, 0.85);
}

.scrolled .header.header-light {
  --background-color: rgba(255, 255, 255, 0.98);
}

.header-auth {
  width: fit-content;
  flex-shrink: 0;
  gap: 0.35rem !important;
}

.header-auth a {
  color: #fff !important;
  transition: color 0.25s ease;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.header.header-light .header-auth a {
  color: #1b2a46 !important;
}

.header-auth a:hover {
  color: #2d8fe3 !important;
  opacity: 1;
}

.header.header-light .header-auth a:hover {
  color: #2d8fe3 !important;
}

@media (min-width: 1200px) {
  .header .header-inner {
    display: grid;
    grid-template-columns: auto 1fr max-content;
    align-items: center;
    column-gap: 1rem;
  }

  .header .logo {
    justify-self: start;
    grid-column: 1;
  }

  .header .navmenu {
    justify-self: center;
    grid-column: 2;
    width: auto;
  }

  .header .header-auth {
    justify-self: end;
    grid-column: 3;
    margin-left: 0 !important;
  }

  .navmenu {
    padding: 0;
  }

  .navmenu ul {
    margin: 0;
    padding: 0;
    display: flex;
    list-style: none;
    align-items: center;
  }

  .navmenu li {
    position: relative;
  }

  .navmenu a,
  .navmenu a:focus {
    color: var(--nav-color);
    padding: 18px 24px;
    font-size: 16px;
    font-family: var(--nav-font);
    text-transform: uppercase;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    transition: 0.3s;
  }

  .navmenu a i,
  .navmenu a:focus i {
    font-size: 12px;
    line-height: 0;
    margin-left: 5px;
    transition: 0.3s;
  }

  .navmenu li:last-child a {
    padding-right: 0;
  }

  .navmenu li:hover > a,
  .navmenu .active,
  .navmenu .active:focus {
    color: var(--nav-hover-color);
  }

  .navmenu .dropdown ul {
    margin: 0;
    padding: 10px 0;
    background: var(--nav-dropdown-background-color);
    display: block;
    position: absolute;
    visibility: hidden;
    left: 14px;
    top: 130%;
    opacity: 0;
    transition: 0.3s;
    border-radius: 4px;
    z-index: 99;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  }

  .navmenu .dropdown ul li {
    min-width: 200px;
  }

  .navmenu .dropdown ul a {
    padding: 10px 20px;
    font-size: 15px;
    text-transform: none;
    color: var(--nav-dropdown-color);
  }

  .navmenu .dropdown ul a:hover,
  .navmenu .dropdown ul li:hover > a {
    color: var(--nav-dropdown-hover-color);
  }

  .navmenu .dropdown:hover > ul {
    opacity: 1;
    top: 100%;
    visibility: visible;
  }

  .navmenu .toggle-dropdown {
    pointer-events: none;
  }
}

@media (max-width: 1199.98px) {
  .mobile-nav-active #header {
    position: fixed;
    inset: 0 0 auto 0;
    z-index: 2147483000;
  }

  .mobile-nav-toggle {
    color: var(--nav-color);
    font-size: 28px;
    line-height: 0;
    margin-left: 12px;
    cursor: pointer;
    transition: color 0.3s;
  }

  .header.header-light .mobile-nav-toggle {
    color: #1b2a46;
  }

  .navmenu {
    padding: 0;
    z-index: 9997;
    display: flex;
    align-items: center;
  }

  .navmenu ul {
    display: none;
    list-style: none;
    position: absolute;
    inset: 60px 20px 20px 20px;
    padding: 10px 0;
    margin: 0;
    border-radius: 6px;
    background-color: var(--nav-mobile-background-color);
    overflow-y: auto;
    transition: 0.3s;
    z-index: 9998;
    box-shadow: 0 0 30px rgba(0, 0, 0, 0.1);
  }

  .navmenu a,
  .navmenu a:focus {
    color: var(--nav-dropdown-color);
    padding: 10px 20px;
    font-family: var(--nav-font);
    font-size: 17px;
    font-weight: 500;
    display: flex;
    align-items: center;
    justify-content: space-between;
    white-space: nowrap;
    transition: 0.3s;
  }

  .navmenu a i,
  .navmenu a:focus i {
    font-size: 12px;
    line-height: 0;
    margin-left: 5px;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: 0.3s;
    background-color: rgba(66, 139, 202, 0.1);
  }

  .navmenu a:hover,
  .navmenu .active,
  .navmenu .active:focus {
    color: var(--nav-dropdown-hover-color);
  }

  .navmenu .dropdown ul {
    position: static;
    display: none;
    z-index: 99;
    padding: 10px 0;
    margin: 10px 20px;
    background-color: var(--nav-dropdown-background-color);
    border: 1px solid rgba(68, 68, 68, 0.12);
    box-shadow: none;
    transition: all 0.5s ease-in-out;
  }

  .navmenu .dropdown ul a,
  .navmenu .dropdown ul a:focus {
    font-size: 14px;
    font-weight: 400;
    padding: 8px 16px;
  }

  .navmenu .dropdown > ul.dropdown-active {
    display: block;
    background-color: rgba(33, 37, 41, 0.03);
  }

  .navmenu .dropdown.active > a i.toggle-dropdown {
    transform: rotate(180deg);
  }

  .navmenu .mobile-lang-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    margin: 12px 20px 6px;
    padding-top: 12px;
    border-top: 1px solid rgba(68, 68, 68, 0.12);
  }

  .navmenu a.mobile-lang-link,
  .navmenu a.mobile-lang-link:focus {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 54px;
    padding: 7px 12px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 600;
    letter-spacing: 0.02em;
    color: #2d3b54;
    background: #f5f8fd;
  }

  .mobile-nav-active {
    overflow: hidden;
  }

  .mobile-nav-active .mobile-nav-toggle {
    color: #fff;
    position: fixed;
    font-size: 32px;
    top: 15px;
    right: 15px;
    margin-left: 0;
    z-index: 2147483003;
  }

  .mobile-nav-active .navmenu {
    position: fixed;
    overflow: hidden;
    inset: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    z-index: 2147483001;
    background: transparent;
    transition: 0.3s;
    align-items: flex-start;
    justify-content: center;
    padding-top: 70px;
  }

  @supports (-webkit-touch-callout: none) {
    .mobile-nav-active .navmenu {
      height: -webkit-fill-available;
    }

    .mobile-nav-active .navmenu > ul {
      max-height: calc(-webkit-fill-available - 100px);
    }
  }

  .mobile-nav-active .navmenu::before {
    content: "";
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    height: 100dvh;
    background: rgba(33, 37, 41, 0.8);
    z-index: 0;
  }

  .mobile-nav-active .navmenu > ul {
    display: block;
    position: relative;
    z-index: 1;
    inset: auto;
    width: calc(100% - 40px);
    max-height: calc(100vh - 100px);
    max-height: calc(100dvh - 100px);
    overflow-y: auto;
  }
}
