/* ===========================================================
   FILE: css/komponen-header-navigasi.css
   ISI   : Bar atas (logo POLMED, menu, dropdown, tombol Sistem Akademik, tombol hamburger di HP).
   JS    : js/komponen-header.js
   =========================================================== */

header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #ffffffef;
  backdrop-filter: blur(14px);
  border-bottom: 1px solid #e8edf5;
}

.navwrap {
  max-width: 1240px;
  min-height: 82px;
  margin: auto;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  gap: 20px;
  position: relative;
}

.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 245px;
}

.crest {
  width: 48px;
  height: 48px;
  border-radius: 14px;
  background: linear-gradient(145deg, #0873e8, #063c9a);
  display: grid;
  place-items: center;
  color: white;
  font-size: 25px;
}

.brand strong {
  display: block;
  font-size: 12px;
  letter-spacing: .2px;
}

.brand small {
  display: block;
  font-size: 10px;
  color: #5e6b7d;
  margin-top: 4px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 15px;
  flex: 1;
}

.nav > a, .dropbtn {
  font-size: 12px;
  font-weight: 650;
  color: #26354b;
  padding: 10px 0;
  white-space: nowrap;
  background: none;
  border: 0;
}

.nav > a:hover, .dropbtn:hover, .nav > a.active {
  color: var(--blue);
}

.dropdown {
  position: relative;
}

.dropmenu {
  display: none;
  position: absolute;
  top: 100%;
  left: -15px;
  min-width: 205px;
  background: white;
  border: 1px solid var(--line);
  box-shadow: 0 14px 35px #13284b1a;
  border-radius: 12px;
  padding: 8px;
}

.dropdown.open .dropmenu {
  display: block;
}

.dropmenu a {
  display: block;
  padding: 11px 12px;
  border-radius: 8px;
  font-size: 12px;
}

.dropmenu a:hover {
  background: #edf5ff;
  color: var(--blue);
}

.navtools {
  display: flex;
  align-items: center;
  gap: 9px;
}

.iconbtn {
  border: 0;
  background: #f0f5fc;
  border-radius: 11px;
  width: 39px;
  height: 39px;
  color: #1a365d;
}

.portal {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--blue);
  color: white;
  padding: 12px;
  border-radius: 11px;
  font-size: 11px;
  font-weight: 750;
  white-space: nowrap;
}

.portal:hover {
  transform: translateY(-2px);
}

.hamb {
  display: none;
}

img.crest {
  background: none;
  border-radius: 0;
  object-fit: contain;
  display: block;
  width: 50px;
  height: 50px;
}

@media (max-width: 1050px) {
  .brand {
    min-width: 200px;
  }

  .nav {
    gap: 10px;
  }

  .nav > a, .dropbtn {
    font-size: 10px;
  }

  .navwrap {
    gap: 12px;
  }

  .portal {
    padding: 11px;
  }
}

@media (max-width: 850px) {
  .navwrap {
    min-height: 72px;
  }

  .hamb {
    display: grid;
    place-items: center;
  }

  .nav {
    display: none;
    position: absolute;
    left: 12px;
    right: 12px;
    top: 70px;
    background: white;
    border: 1px solid var(--line);
    border-radius: 14px;
    padding: 14px;
    box-shadow: 0 18px 40px #0a244322;
    align-items: stretch;
    flex-direction: column;
    gap: 2px;
  }

  .nav.mobileopen {
    display: flex;
  }

  .nav > a, .dropbtn {
    display: block;
    text-align: left;
    padding: 12px;
    font-size: 13px;
    width: 100%;
  }

  .dropmenu {
    position: static;
    box-shadow: none;
    border: 0;
    background: #f6f9fd;
    margin: 0 8px;
  }

  .navtools {
    margin-left: auto;
  }
}

@media (max-width: 560px) {
  .brand {
    min-width: 0;
    gap: 8px;
  }

  .crest {
    width: 40px;
    height: 40px;
    font-size: 21px;
  }

  .brand strong {
    font-size: 9px;
  }

  .brand small {
    font-size: 8px;
  }

  .navwrap {
    padding: 10px 13px;
    gap: 8px;
  }

  .portal {
    font-size: 0;
    padding: 11px;
  }

  .portal:first-letter {
    font-size: 17px;
  }
}

@media(max-width:560px) {
  .portal .ptext {
    display: none;
  }

  .portal {
    font-size: 17px;
  }

  img.crest {
    width: 42px;
    height: 42px;
  }
}

/* Menu induk dropdown ikut biru saat halamannya sedang dibuka */
.dropbtn.active {
  color: var(--blue);
}
