/* =========================================================================
   JURNAL NALAR — Tampilan Modern untuk Daftar Jurnal (Halaman Site Index)
   Versi 3.1 — Thumbnail contain di semua kartu termasuk hero
   =========================================================================
   CARA PAKAI:
   1. Login sebagai Site Administrator.
   2. Buka menu Administration > Site Settings > Appearance.
   3. Tempel/upload SELURUH isi file ini ke field "Site Stylesheet (CSS)"
      (ganti total isi sebelumnya, jangan ditambahkan di belakang saja).
   4. Save, lalu clear cache OJS kalau perubahan belum terlihat.
   ========================================================================= */

/* === PERBAIKAN STICKY HEADER === */
html,
body {
    overflow-x: hidden !important;
    overflow-y: visible !important;
}

.pkp_structure_page {
    overflow: visible !important;
}

.hs-header {
    position: sticky;
    top: 0;
    z-index: 1000;
}

.hs-header-inner {
    position: sticky !important;
    top: 0 !important;
    z-index: 999 !important;
}

/* === WARNA BACKGROUND UTAMA OJS === */
html,
body,
.pkp_structure_page,
.pkp_structure_content,
#pkp_content_main,
.pkp_page_index {
    background-color: #f4f8fb !important;
}

.pkp_structure_content,
.pkp_page_index,
.page_index_site {
    background-color: #f4f8fb !important;
}

.pkp_content_wrapper,
.pkp_structure_main,
.pkp_page_content {
    background-color: transparent !important;
}

.page_index_site .journals {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  background-color: #f4f8fb;
  padding: 20px 0;
}

/* -------------------------------------------------------------------------
   1. TIMPA ATURAN BAWAAN TEMA DEFAULT
   ------------------------------------------------------------------------- */
.page_index_site .journals > ul > li {
  margin: 0 !important;
  padding: 0 !important;
  border: none !important;
  background-color: #ffffff !important;
}

.page_index_site .journals .thumb {
  float: none !important;
  width: 100% !important;
  padding-right: 0 !important;
  position: relative;
  overflow: hidden;
  background: #f1f5f9;
}

.page_index_site .journals .thumb + .body {
  float: none !important;
  width: 100% !important;
}

.page_index_site .journals .links li {
  margin: 0 !important;
}

.page_index_site .journals h2 {
  position: relative !important;
  width: auto !important;
  height: auto !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
  margin: 2.5rem 0 1.75rem;
  padding-bottom: 0.75rem;
}

.page_index_site .journals h2::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 56px;
  height: 4px;
  background: linear-gradient(90deg, #1e3a8a, #3b82f6);
  border-radius: 4px;
}

/* -------------------------------------------------------------------------
   2. GRID KARTU MAJALAH
   ------------------------------------------------------------------------- */
.page_index_site .journals > ul {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.75rem;
  list-style: none;
  margin: 0 !important;
  padding: 0;
}

.page_index_site .journals > ul > li {
  position: relative;
  background: #ffffff;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.06), 0 1px 2px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  display: flex;
  flex-direction: column;
}

.page_index_site .journals > ul > li:hover {
  transform: translateY(-6px);
  box-shadow: 0 22px 32px -12px rgba(15, 23, 42, 0.18);
}

/* ---------- Kartu "Sorotan" (jurnal pertama dibuat besar/hero) ---------- */
.page_index_site .journals > ul > li:nth-child(1) {
  grid-column: 1 / -1;
  flex-direction: row !important;
  min-height: 260px;
}

.page_index_site .journals > ul > li:nth-child(1) .thumb {
  width: 42% !important;
  flex: 0 0 42%;
  background: #f1f5f9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.page_index_site .journals > ul > li:nth-child(1) .thumb img {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: contain !important;  /* ← Hero card juga contain */
  padding: 20px;
  box-sizing: border-box;
  background: #f1f5f9;
}

.page_index_site .journals > ul > li:nth-child(1) .body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 2.25rem 2.5rem;
}

.page_index_site .journals > ul > li:nth-child(1) .body h3 a {
  font-size: 1.65rem;
}

.page_index_site .journals > ul > li:nth-child(1) .description {
  -webkit-line-clamp: 4;
  font-size: 0.95rem;
}

/* ---------- Thumbnail - SEMUA GAMBAR UTUH TIDAK TERPOTONG ---------- */
.page_index_site .journals .thumb img {
  width: 100%;
  height: 190px;
  object-fit: contain;
  display: block;
  background: #f1f5f9;
  padding: 10px;
  box-sizing: border-box;
  filter: grayscale(100%);
  transition:
    transform .45s ease,
    filter .45s ease,
    opacity .45s ease;
}

/* Saat hover kembali berwarna */
.page_index_site .journals > ul > li:hover .thumb img {
  transform: scale(1.06);
  filter: grayscale(0%);
}

/* ---------- Isi teks kartu ---------- */
.page_index_site .journals .body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.page_index_site .journals .body h3 {
  margin: 0 0 0.6rem;
}

.page_index_site .journals .body h3 a {
  font-size: 1.15rem;
  font-weight: 700;
  color: #111827;
  text-decoration: none;
  line-height: 1.35;
}

.page_index_site .journals .body h3 a:hover {
  color: #1e3a8a;
}

.page_index_site .journals .description {
  font-size: 0.9rem;
  line-height: 1.55;
  color: #4b5563;
  margin-bottom: 1.1rem;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- Tombol aksi (View Journal / Current Issue) ---------- */
.page_index_site .journals .links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: auto 0 0 !important;
  padding: 0;
}

.page_index_site .journals .links li a {
  display: inline-block;
  white-space: nowrap;
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.5rem 1rem;
  border-radius: 10px;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.page_index_site .journals .links .view a {
  background: #1e3a8a;
  color: #f4f8fb;
}
.page_index_site .journals .links .view a:hover {
  background: #1e2f6e;
}

.page_index_site .journals .links .current a {
  background: #f1f5f9;
  color: #1e293b;
}
.page_index_site .journals .links .current a:hover {
  background: #e2e8f0;
}

/* ---------- Responsif ---------- */
@media (max-width: 1024px) {
  .page_index_site .journals > ul {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 768px) {
  .page_index_site .journals > ul {
    grid-template-columns: 1fr;
  }
  .page_index_site .journals > ul > li:nth-child(1) {
    flex-direction: column !important;
  }
  .page_index_site .journals > ul > li:nth-child(1) .thumb {
    width: 100% !important;
    flex: none;
  }
  .page_index_site .journals > ul > li:nth-child(1) .thumb img {
    height: 200px;
    min-height: unset;
    padding: 15px;
  }
}

@media (max-width: 480px) {
  .page_index_site .journals > ul {
    gap: 1rem;
  }
  
  .page_index_site .journals .body {
    padding: 1rem;
  }
  
  .page_index_site .journals .body h3 a {
    font-size: 1rem;
  }
  
  .page_index_site .journals .links li a {
    font-size: 0.75rem;
    padding: 0.4rem 0.8rem;
  }
  
  .page_index_site .journals h2 {
    font-size: 1.5rem;
    margin: 1.5rem 0 1rem;
  }

  .page_index_site .journals .thumb img {
    height: 160px;
    padding: 8px;
  }

  .page_index_site .journals > ul > li:nth-child(1) .thumb img {
    height: 180px;
    padding: 12px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .page_index_site .journals > ul > li,
  .page_index_site .journals .thumb img {
    transition: none;
  }
}

/* Sembunyikan header bawaan OJS */
.pkp_head_wrapper {
    display: none !important;
}

/* Sembunyikan judul h2 bawaan OJS */
h2 {
    display: none;
}

/* Sembunyikan footer bawaan OJS */
.pkp_structure_footer_wrapper,
footer.pkp_structure_footer,
.pkp_footer,
#pkp_content_footer {
    display: none !important;
}