/* =========================================================
   NIP JOURNAL — CUSTOM SIDEBAR BLOCKS
   Warna utama  : #073568
   Warna aksen  : #008dbb
   ========================================================= */

/* 1. KONTAINER SIDEBAR OJS
--------------------------------------------------------- */

.pkp_structure_sidebar {
  box-sizing: border-box;
}

.pkp_structure_sidebar .pkp_block {
  margin-bottom: 24px;
}

/* 2. SEMBUNYIKAN JUDUL OTOMATIS CUSTOM BLOCK
   Contoh: journal_information, downloads, editorial_team
--------------------------------------------------------- */

.pkp_structure_sidebar .pkp_block.block_custom > .title,
.pkp_structure_sidebar .pkp_block.block_custom > h2.title,
.pkp_structure_sidebar [id^="customblock-"] > .title {
  display: none !important;
}

/* 3. RESET KONTEN BAWAAN CUSTOM BLOCK
--------------------------------------------------------- */

.pkp_structure_sidebar .block_custom > .content,
.pkp_structure_sidebar [id^="customblock-"] > .content {
  margin: 0;
  padding: 0;
}

/* 4. KOTAK UTAMA SEMUA BLOK
--------------------------------------------------------- */

.nip-sidebar-box {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0 0 24px;
  padding: 0;
  border: 1px solid #d7e4ec;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(7, 53, 104, 0.08);
}

/* 5. JUDUL BLOK
--------------------------------------------------------- */

.nip-sidebar-title {
  display: block;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 16px;
  border: 0;
  background: #073568;
  color: #ffffff;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

/* 6. MENU/DAFTAR TAUTAN
--------------------------------------------------------- */

.nip-sidebar-menu {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.nip-sidebar-menu li {
  position: relative;
  box-sizing: border-box;
  margin: 0 !important;
  padding: 0 !important;
  border-bottom: 1px solid #d7e4ec;
  list-style: none !important;
}

.nip-sidebar-menu li:last-child {
  border-bottom: 0;
}

.nip-sidebar-menu a {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 13px 36px 13px 16px;
  color: #073568;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none;
  overflow-wrap: break-word;
  transition:
    padding-left 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

/* Simbol panah */
.nip-sidebar-menu a::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: 16px;
  color: #008dbb;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
  transition: right 0.2s ease;
}

.nip-sidebar-menu a:hover,
.nip-sidebar-menu a:focus {
  padding-left: 21px;
  background: #f2f8fc;
  color: #008dbb;
  text-decoration: none;
}

.nip-sidebar-menu a:hover::after,
.nip-sidebar-menu a:focus::after {
  right: 12px;
}

.nip-sidebar-menu a:focus-visible {
  outline: 3px solid rgba(0, 141, 187, 0.35);
  outline-offset: -3px;
}

/* 7. KONTEN TEKS BIASA
   Cocok untuk Contact, Editorial Team, Announcement
--------------------------------------------------------- */

.nip-sidebar-content {
  box-sizing: border-box;
  padding: 16px;
  color: #333333;
  font-size: 14px;
  line-height: 1.65;
}

.nip-sidebar-content p {
  margin: 0 0 12px;
}

.nip-sidebar-content p:last-child {
  margin-bottom: 0;
}

.nip-sidebar-content strong {
  color: #073568;
  font-weight: 700;
}

.nip-sidebar-content a {
  color: #0077a3;
  font-weight: 500;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.nip-sidebar-content a:hover,
.nip-sidebar-content a:focus {
  color: #073568;
  text-decoration: underline;
}

/* 8. GAMBAR, LOGO, DAN BADGE DALAM SIDEBAR
--------------------------------------------------------- */

.nip-sidebar-image {
  box-sizing: border-box;
  padding: 16px;
  text-align: center;
}

.nip-sidebar-image img,
.nip-sidebar-content img {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 0 auto;
  border: 0;
}

/* 9. TOMBOL DOWNLOAD
--------------------------------------------------------- */

.nip-download-list {
  margin: 0;
  padding: 16px;
  list-style: none;
}

.nip-download-list li {
  margin: 0 0 10px;
  padding: 0;
  list-style: none;
}

.nip-download-list li:last-child {
  margin-bottom: 0;
}

.nip-download-button {
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 11px 14px;
  border: 1px solid #073568;
  border-radius: 5px;
  background: #ffffff;
  color: #073568;
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  transition:
    color 0.2s ease,
    background-color 0.2s ease;
}

.nip-download-button:hover,
.nip-download-button:focus {
  background: #073568;
  color: #ffffff;
  text-decoration: none;
}

/* 10. IDENTITAS EDITORIAL/PROFIL
--------------------------------------------------------- */

.nip-person {
  padding: 14px 16px;
  border-bottom: 1px solid #d7e4ec;
}

.nip-person:last-child {
  border-bottom: 0;
}

.nip-person-name {
  display: block;
  margin-bottom: 3px;
  color: #073568;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
}

.nip-person-role,
.nip-person-affiliation {
  display: block;
  color: #555555;
  font-size: 13px;
  line-height: 1.5;
}

/* 11. LABEL/BADGE STATUS
--------------------------------------------------------- */

.nip-sidebar-badge {
  display: inline-block;
  margin: 3px 3px 3px 0;
  padding: 4px 9px;
  border-radius: 20px;
  background: #eaf6fa;
  color: #073568;
  font-size: 12px;
  font-weight: 600;
}

/* 12. BLOK INFORMASI PENTING
--------------------------------------------------------- */

.nip-sidebar-notice {
  margin: 16px;
  padding: 12px 14px;
  border-left: 4px solid #008dbb;
  border-radius: 4px;
  background: #f2f8fc;
  color: #333333;
  font-size: 13px;
  line-height: 1.55;
}

/* 13. RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 991px) {
  .nip-sidebar-box {
    max-width: 100%;
    margin-bottom: 20px;
  }

  .nip-sidebar-title {
    padding: 13px 15px;
    font-size: 17px;
  }

  .nip-sidebar-menu a {
    padding: 12px 34px 12px 15px;
    font-size: 14px;
  }
}

/* 14. MODE CETAK
--------------------------------------------------------- */

@media print {
  .nip-sidebar-box {
    border: 1px solid #999999;
    box-shadow: none;
  }

  .nip-sidebar-title {
    border-bottom: 1px solid #999999;
    background: #ffffff !important;
    color: #000000 !important;
  }

  .nip-sidebar-menu a,
  .nip-sidebar-content a {
    color: #000000 !important;
  }
}

/* =========================================================
   KOMPATIBILITAS BLOK LAMA DAN BARU
   ========================================================= */

/* Kotak utama */
.nip-info-box,
.nip-sidebar-box {
  width: 100%;
  box-sizing: border-box;
  overflow: hidden;
  margin: 0 0 24px;
  padding: 0;
  border: 1px solid #d7e4ec !important;
  border-radius: 8px;
  background: #ffffff;
  box-shadow: 0 3px 12px rgba(7, 53, 104, 0.08);
}

/* Judul kotak */
.nip-info-title,
.nip-sidebar-title {
  display: block;
  box-sizing: border-box;
  margin: 0;
  padding: 14px 16px;
  background: #073568 !important;
  color: #ffffff !important;
  font-size: 18px;
  font-weight: 700;
  line-height: 1.35;
}

/* Daftar menu */
.nip-info-menu,
.nip-sidebar-menu {
  margin: 0 !important;
  padding: 0 !important;
  list-style: none !important;
}

.nip-info-menu li,
.nip-sidebar-menu li {
  position: relative;
  margin: 0 !important;
  padding: 0 !important;
  border-bottom: 1px solid #d7e4ec;
  list-style: none !important;
}

.nip-info-menu li:last-child,
.nip-sidebar-menu li:last-child {
  border-bottom: 0;
}

/* Tautan menu */
.nip-info-menu a,
.nip-sidebar-menu a {
  position: relative;
  display: block;
  box-sizing: border-box;
  width: 100%;
  padding: 13px 36px 13px 16px;
  color: #073568 !important;
  font-size: 15px;
  font-weight: 500;
  line-height: 1.45;
  text-decoration: none !important;
  overflow-wrap: break-word;
  transition:
    padding-left 0.2s ease,
    color 0.2s ease,
    background-color 0.2s ease;
}

/* Panah di sebelah kanan */
.nip-info-menu a::after,
.nip-sidebar-menu a::after {
  content: "›";
  position: absolute;
  top: 50%;
  right: 16px;
  color: #008dbb;
  font-size: 20px;
  font-weight: 700;
  line-height: 1;
  transform: translateY(-50%);
}

/* Efek saat disentuh kursor */
.nip-info-menu a:hover,
.nip-info-menu a:focus,
.nip-sidebar-menu a:hover,
.nip-sidebar-menu a:focus {
  padding-left: 21px;
  background: #f2f8fc;
  color: #008dbb !important;
}

/* Hilangkan judul otomatis bawaan OJS */
#customblock-journal_information > .title,
#customblock-downloads > .title,
.pkp_structure_sidebar [id^="customblock-"] > .title {
  display: none !important;
}

/* =========================================================
   MENGATUR JARAK ANTAR BLOK SIDEBAR
   ========================================================= */

/* Hilangkan jarak besar bawaan OJS */
.pkp_structure_sidebar .pkp_block,
.pkp_structure_sidebar .block_custom,
.pkp_structure_sidebar [id^="customblock-"] {
  box-sizing: border-box;
  margin: 0 0 16px !important;
  padding: 0 !important;
}

/* Jarak antarkotak cukup 16px */
.nip-info-box,
.nip-sidebar-box {
  margin: 0 0 16px !important;
}

/* Hindari jarak ganda pada kotak terakhir di setiap blok */
.pkp_structure_sidebar .pkp_block .nip-info-box,
.pkp_structure_sidebar .pkp_block .nip-sidebar-box {
  margin-bottom: 0 !important;
}

/* Hilangkan paragraf kosong yang mungkin dibuat editor OJS */
.pkp_structure_sidebar .block_custom > .content > p:empty,
.pkp_structure_sidebar .block_custom > .content > p:has(> br:only-child),
.pkp_structure_sidebar [id^="customblock-"] > .content > p:empty {
  display: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

/* Pastikan pembungkus konten tidak menambah jarak */
.pkp_structure_sidebar .block_custom > .content,
.pkp_structure_sidebar [id^="customblock-"] > .content {
  margin: 0 !important;
  padding: 0 !important;
}

/* =========================================================
   JARAK SIDEBAR DARI KONTEN UTAMA
   ========================================================= */

@media (min-width: 992px) {
  .pkp_structure_sidebar .pkp_block,
  .pkp_structure_sidebar .block_custom,
  .pkp_structure_sidebar [id^="customblock-"] {
    width: calc(100% - 24px) !important;
    margin-left: 24px !important;
    margin-right: 0 !important;
  }
}

/* Pada tablet dan HP tidak menggunakan jarak tambahan */
@media (max-width: 991px) {
  .pkp_structure_sidebar .pkp_block,
  .pkp_structure_sidebar .block_custom,
  .pkp_structure_sidebar [id^="customblock-"] {
    width: 100% !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
  }
}

/* =========================================================
   JARAK HOMEPAGE IMAGE DARI MENU NAVIGASI
   ========================================================= */

.page_index_journal .homepage_image,
.pkp_structure_main .homepage_image {
  box-sizing: border-box;
  margin-top: 6px !important;
}

/* Menjaga gambar tetap responsif */
.page_index_journal .homepage_image img,
.pkp_structure_main .homepage_image img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Jarak lebih kecil pada layar HP */
@media (max-width: 767px) {
  .page_index_journal .homepage_image,
  .pkp_structure_main .homepage_image {
    margin-top: 16px !important;
  }
}

/* =========================================================
   NIP JOURNAL — HEADER & NAVIGASI MODERN COMPACT
   ========================================================= */

@media (min-width: 992px) {
  /* 1. STRUKTUR HEADER
  --------------------------------------------------------- */

  .pkp_structure_head {
    min-height: 0 !important;
    height: auto !important;
  }

  .pkp_head_wrapper {
    min-height: 0 !important;
    height: auto !important;
    padding-bottom: 0 !important;
  }

  /* 2. BARIS NAVIGASI
  --------------------------------------------------------- */

  .pkp_navigation_primary_wrapper {
    position: relative !important;
    box-sizing: border-box;
    min-height: 0 !important;
    height: 42px !important;
    margin: 6px 0 0 !important;
    padding: 0 !important;
  }

  .pkp_navigation_primary {
    display: flex !important;
    align-items: center !important;
    gap: 7px !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .pkp_navigation_primary > li {
    margin: 0 !important;
    padding: 0 !important;
  }

  /* 3. TOMBOL MENU MODERN
  --------------------------------------------------------- */

  .pkp_navigation_primary > li > a {
    position: relative;
    display: flex !important;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;

    min-height: 0 !important;
    height: 32px !important;
    margin: 0 !important;
    padding: 5px 14px !important;

    overflow: hidden;

    border: 1px solid rgba(255, 255, 255, 0.34);
    border-radius: 7px;

    background: linear-gradient(
      135deg,
      rgba(255, 255, 255, 0.14),
      rgba(255, 255, 255, 0.06)
    );

    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, 0.14),
      0 2px 6px rgba(0, 0, 0, 0.08);

    color: #ffffff !important;
    font-size: 13px !important;
    font-weight: 600;
    line-height: 1 !important;
    letter-spacing: 0.15px;
    text-decoration: none !important;

    transition:
      color 0.2s ease,
      border-color 0.2s ease,
      background 0.2s ease,
      box-shadow 0.2s ease,
      transform 0.2s ease;
  }

  /* 4. EFEK KILAUAN
  --------------------------------------------------------- */

  .pkp_navigation_primary > li > a::before {
    content: "";
    position: absolute;
    top: 0;
    left: -80%;
    width: 45%;
    height: 100%;

    pointer-events: none;

    background: linear-gradient(
      90deg,
      transparent,
      rgba(255, 255, 255, 0.2),
      transparent
    );

    transform: skewX(-20deg);
    transition: left 0.45s ease;
  }

  /* 5. HOVER DAN FOCUS
  --------------------------------------------------------- */

  .pkp_navigation_primary > li > a:hover,
  .pkp_navigation_primary > li > a:focus {
    border-color: rgba(0, 215, 240, 0.85);

    background: linear-gradient(135deg, #009fc4, #007fa8);

    box-shadow:
      0 5px 14px rgba(0, 141, 187, 0.26),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);

    color: #ffffff !important;
    text-decoration: none !important;
    transform: translateY(-2px);
  }

  .pkp_navigation_primary > li > a:hover::before,
  .pkp_navigation_primary > li > a:focus::before {
    left: 135%;
  }

  /* 6. MENU AKTIF
  --------------------------------------------------------- */

  .pkp_navigation_primary > li > a[aria-current="page"] {
    border-color: #10cbe5;

    background: linear-gradient(135deg, #00a6c8, #0083aa);

    box-shadow:
      0 4px 12px rgba(0, 166, 200, 0.24),
      inset 0 1px 0 rgba(255, 255, 255, 0.22);

    color: #ffffff !important;
  }

  /* 7. AKSESIBILITAS KEYBOARD
  --------------------------------------------------------- */

  .pkp_navigation_primary > li > a:focus-visible {
    outline: 2px solid rgba(40, 220, 240, 0.85);
    outline-offset: 2px;
  }

  /* 8. HILANGKAN DEKORASI BAWAAN OJS
  --------------------------------------------------------- */

  .pkp_navigation_primary > li > a::after {
    display: none !important;
  }

  /* 9. POSISI SEARCH
  --------------------------------------------------------- */

  .pkp_navigation_search_wrapper {
    position: absolute !important;
    top: 0 !important;
    right: 0 !important;
    bottom: auto !important;

    height: 32px !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .pkp_navigation_search_wrapper a {
    display: flex !important;
    align-items: center;

    height: 32px !important;
    margin: 0 !important;
    padding: 0 10px !important;

    color: #ffffff !important;
    line-height: 1 !important;
    text-decoration: none !important;
    transition:
      color 0.2s ease,
      opacity 0.2s ease;
  }

  .pkp_navigation_search_wrapper a:hover,
  .pkp_navigation_search_wrapper a:focus {
    color: #20d7ed !important;
    text-decoration: none !important;
  }
}

/* =========================================================
   PENGGUNA DENGAN PREFERENSI ANIMASI MINIMAL
   ========================================================= */

@media (prefers-reduced-motion: reduce) {
  .pkp_navigation_primary > li > a,
  .pkp_navigation_primary > li > a::before {
    transition: none !important;
  }

  .pkp_navigation_primary > li > a:hover,
  .pkp_navigation_primary > li > a:focus {
    transform: none !important;
  }
}
