/* ==========================================================
   AL-WAARITS (OJS 3.5) - Animasi menu v2
   Tempel di: Settings > Website > Appearance > Advanced
   > Journal style sheet.  HAPUS CSS versi pertama dulu,
   lalu ganti dengan isi file ini.
   ========================================================== */

:root {
  --aw-accent: #1f7a3f;                      /* warna aksen, ubah sesuka hati */
  --aw-accent-soft: rgba(31, 122, 63, .09);
  --aw-ease: cubic-bezier(.22, 1, .36, 1);   /* gerak halus, melambat di akhir */
}

/* ----------------------------------------------------------
   0. Hapus semua simbol/panah hitam di header
   (penyebab: garis bawah versi 1 menimpa panah dropdown bawaan OJS)
   ---------------------------------------------------------- */
.pkp_navigation_primary a::before,
.pkp_navigation_primary a::after,
.pkp_navigation_user a::before,
.pkp_navigation_user a::after {
  content: none !important;
  display: none !important;
  border: 0 !important;
}

/* ----------------------------------------------------------
   1. Menu utama & Register/Login
      garis bawah menyapu dari kiri ke kanan + sorotan lembut
   ---------------------------------------------------------- */
.pkp_navigation_primary > li > a,
.pkp_navigation_user > li > a {
  border-radius: 6px;
  background-image: linear-gradient(var(--aw-accent), var(--aw-accent));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 100% calc(100% - 4px);
  transition:
    background-size .45s var(--aw-ease),
    background-position .45s var(--aw-ease),
    background-color .3s ease,
    color .3s ease,
    transform .35s var(--aw-ease);
}

.pkp_navigation_primary > li:hover > a,
.pkp_navigation_primary > li:focus-within > a,
.pkp_navigation_user > li:hover > a,
.pkp_navigation_user > li:focus-within > a {
  color: var(--aw-accent);
  background-color: var(--aw-accent-soft);
  background-size: 100% 2px;
  background-position: 0% calc(100% - 4px);
  transform: translateY(-2px);
}

/* ----------------------------------------------------------
   2. Dropdown: muncul dari atas, item masuk satu per satu
   ---------------------------------------------------------- */
@media (min-width: 992px) {
  .pkp_navigation_primary > li > ul {
    left: 0 !important;                       /* bawaan OJS: left:-9999px */
    opacity: 0;
    visibility: hidden;
    transform: translateY(14px) scale(.97);
    transform-origin: top left;
    border-radius: 10px;
    box-shadow: 0 14px 30px rgba(0, 0, 0, .15);
    transition:
      opacity .3s ease,
      transform .4s var(--aw-ease),
      visibility 0s linear .4s;               /* tunda hidden sampai animasi tutup selesai */
  }

  .pkp_navigation_primary > li:hover > ul,
  .pkp_navigation_primary > li:focus-within > ul {
    opacity: 1;
    visibility: visible;
    transform: none;
    transition:
      opacity .3s ease,
      transform .4s var(--aw-ease),
      visibility 0s;
  }

  /* item dropdown masuk bergantian */
  .pkp_navigation_primary > li > ul > li {
    opacity: 0;
    transform: translateX(-12px);
    transition: opacity .3s ease, transform .4s var(--aw-ease);
  }

  .pkp_navigation_primary > li:hover > ul > li,
  .pkp_navigation_primary > li:focus-within > ul > li {
    opacity: 1;
    transform: none;
  }

  .pkp_navigation_primary > li:hover > ul > li:nth-child(1),
  .pkp_navigation_primary > li:focus-within > ul > li:nth-child(1) { transition-delay: .05s; }
  .pkp_navigation_primary > li:hover > ul > li:nth-child(2),
  .pkp_navigation_primary > li:focus-within > ul > li:nth-child(2) { transition-delay: .10s; }
  .pkp_navigation_primary > li:hover > ul > li:nth-child(3),
  .pkp_navigation_primary > li:focus-within > ul > li:nth-child(3) { transition-delay: .15s; }
  .pkp_navigation_primary > li:hover > ul > li:nth-child(4),
  .pkp_navigation_primary > li:focus-within > ul > li:nth-child(4) { transition-delay: .20s; }
  .pkp_navigation_primary > li:hover > ul > li:nth-child(5),
  .pkp_navigation_primary > li:focus-within > ul > li:nth-child(5) { transition-delay: .25s; }
}

/* link di dalam dropdown: geser + garis aksen di kiri */
.pkp_navigation_primary ul a {
  transition:
    transform .3s var(--aw-ease),
    background-color .3s ease,
    color .3s ease,
    box-shadow .3s ease;
}

.pkp_navigation_primary ul a:hover,
.pkp_navigation_primary ul a:focus {
  color: var(--aw-accent);
  background-color: var(--aw-accent-soft);
  box-shadow: inset 3px 0 0 var(--aw-accent);
  transform: translateX(6px);
}

/* ----------------------------------------------------------
   3. Sidebar: garis bawah menyapu + geser halus
   ---------------------------------------------------------- */
.pkp_structure_sidebar .pkp_block a {
  display: inline-block;
  background-image: linear-gradient(var(--aw-accent), var(--aw-accent));
  background-repeat: no-repeat;
  background-size: 0% 2px;
  background-position: 100% 100%;
  transition:
    background-size .4s var(--aw-ease),
    background-position .4s var(--aw-ease),
    transform .35s var(--aw-ease),
    color .3s ease;
}

.pkp_structure_sidebar .pkp_block a:hover,
.pkp_structure_sidebar .pkp_block a:focus {
  color: var(--aw-accent);
  background-size: 100% 2px;
  background-position: 0% 100%;
  transform: translateX(6px);
}

/* gambar sidebar (Submission, Template, dll.) */
.pkp_structure_sidebar .pkp_block a:has(img) {
  background-image: none;
}

.pkp_structure_sidebar .pkp_block img {
  transition: transform .4s var(--aw-ease), box-shadow .4s ease;
}

.pkp_structure_sidebar .pkp_block a:hover img {
  transform: translateY(-3px) scale(1.04);
  box-shadow: 0 10px 20px rgba(0, 0, 0, .18);
}

/* ----------------------------------------------------------
   4. Halaman depan: pengenalan jurnal di ATAS, Current Issue di bawah
   ---------------------------------------------------------- */
.page_index_journal {
  display: flex;
  flex-direction: column;
}

.page_index_journal > .homepage_image      { order: -3; }
.page_index_journal > .homepage_about      { order: -2; }
.page_index_journal > .additional_content  { order: -1; }
/* Announcements & Current Issue otomatis berada setelahnya */

/* ----------------------------------------------------------
   5. Hormati pengguna yang mematikan animasi
   ---------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  .pkp_navigation_primary *,
  .pkp_navigation_user *,
  .pkp_structure_sidebar .pkp_block * {
    transition: none !important;
    transform: none !important;
  }
}
