/* =========================================================================
   FILE: assets/css/diglib.css
   Digital Library — Daftar Dokumen + Modal Keterangan
   ========================================================================= */

/* ---------- Item Dokumen ---------- */
.dokumen__item {
   background: #fff;
   border: 1px solid #e5e5e5;
   border-radius: 10px;
   padding: 25px;
   margin-bottom: 20px;
   display: flex;
   gap: 20px;
   align-items: flex-start;
   transition: all 0.3s;
}

/* Icon file */
.dokumen__icon {
   flex-shrink: 0;
   width: 70px;
   height: 70px;
   background: #eef7e6;
   border-radius: 12px;
   display: flex;
   align-items: center;
   justify-content: center;
   font-size: 32px;
}

/* Body */
.dokumen__body {
   flex: 1;
   min-width: 0;
}

.dokumen__judul {
   font-size: 18px;
   font-weight: 700;
   margin: 0 0 8px 0;
   color: #333;
   line-height: 1.4;
}

.dokumen__judul a.link-detail-dok {
   color: #333;
   text-decoration: none;
   transition: color .2s;
}

.dokumen__judul a.link-detail-dok:hover {
   color: #7ac143;
}

.dokumen__kat {
   display: inline-block;
   background: #7ac14320;
   color: #7ac143;
   padding: 3px 12px;
   border-radius: 20px;
   font-size: 12px;
   font-weight: 600;
   margin-bottom: 10px;
}

/* Keterangan — dipotong 2 baris */
.dokumen__ket {
   color: #666;
   font-size: 14px;
   line-height: 1.6;
   margin: 10px 0;
   display: -webkit-box;
   -webkit-line-clamp: 2;
   -webkit-box-orient: vertical;
   overflow: hidden;
}

.dokumen__meta {
   display: flex;
   gap: 20px;
   flex-wrap: wrap;
   margin-top: 12px;
   font-size: 13px;
   color: #999;
}

/* Actions */
.dokumen__actions {
   flex-shrink: 0;
   display: flex;
   gap: 10px;
   align-items: center;
   flex-wrap: wrap;
}

.btn-unduh {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   background: #7ac143;
   color: #fff;
   padding: 12px 25px;
   border-radius: 8px;
   text-decoration: none;
   font-weight: 600;
   font-size: 14px;
   white-space: nowrap;
   border: none;
   cursor: pointer;
   transition: background .2s;
}

.btn-unduh:hover {
   background: #5a9c2f;
   color: #fff;
}

.btn-unduh-disabled {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   background: #c9c9c9;
   color: #fff;
   padding: 12px 25px;
   border: 1px solid #b5b5b5;
   border-radius: 8px;
   font-weight: 600;
   font-size: 14px;
   white-space: nowrap;
   cursor: not-allowed;
   opacity: .85;
}

.btn-login {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   background: #f0a71b;
   color: #fff;
   padding: 12px 22px;
   border-radius: 8px;
   text-decoration: none;
   font-weight: 600;
   font-size: 14px;
   white-space: nowrap;
   transition: background .2s;
   box-shadow: 0 2px 6px rgba(240, 167, 27, .35);
}

.btn-login:hover {
   background: #d9930f;
   color: #fff;
}

/* =========================================================================
   ★ MODAL DETAIL DOKUMEN
   ========================================================================= */
.dok-modal {
   display: none;
   position: fixed;
   inset: 0;
   background: rgba(0, 0, 0, 0.55);
   z-index: 9999;
   padding: 30px 15px;
   overflow-y: auto;
}

.dok-modal.is-open {
   display: flex;
   align-items: flex-start;
   justify-content: center;
}

.dok-modal__box {
   background: #fff;
   border-radius: 12px;
   max-width: 720px;
   width: 100%;
   margin: auto;
   position: relative;
   box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
   overflow: hidden;
   animation: dokFadeIn .25s ease;
}

@keyframes dokFadeIn {
   from {
      opacity: 0;
      transform: translateY(-15px);
   }

   to {
      opacity: 1;
      transform: translateY(0);
   }
}

.dok-modal__head {
   background: linear-gradient(135deg, #2b4eff, #4a7bff);
   color: #fff;
   padding: 22px 60px 22px 24px;
}

.dok-modal__head h3 {
   margin: 0 0 4px 0;
   font-size: 18px;
   font-weight: 600;
   line-height: 1.4;
   color: #fff;
}

.dok-modal__head .dok-modal__kat {
   display: inline-block;
   background: rgba(255, 255, 255, 0.2);
   color: #fff;
   padding: 3px 10px;
   border-radius: 20px;
   font-size: 12px;
   margin-top: 6px;
}

.dok-modal__close {
   position: absolute;
   top: 14px;
   right: 16px;
   background: rgba(255, 255, 255, 0.15);
   border: none;
   color: #fff;
   width: 34px;
   height: 34px;
   border-radius: 50%;
   cursor: pointer;
   font-size: 16px;
   transition: all .2s;
   z-index: 2;
   display: flex;
   align-items: center;
   justify-content: center;
}

.dok-modal__close:hover {
   background: rgba(255, 255, 255, 0.3);
   transform: rotate(90deg);
}

.dok-modal__body {
   padding: 24px;
   max-height: 60vh;
   overflow-y: auto;
   font-size: 14.5px;
   line-height: 1.75;
   color: #333;
   word-wrap: break-word;
}

.dok-modal__body p {
   margin: 0 0 12px 0;
}

.dok-modal__body em {
   color: #999;
}

.dok-modal__foot {
   padding: 16px 24px;
   background: #f7f8fa;
   border-top: 1px solid #eaeaea;
   display: flex;
   gap: 10px;
   justify-content: flex-end;
   flex-wrap: wrap;
}

/* Tombol Tutup — solid biru, teks putih */
.dok-modal__btn-tutup {
   display: inline-flex;
   align-items: center;
   gap: 6px;
   background: #2b4eff;
   border: 1px solid #2b4eff;
   color: #fff;
   padding: 10px 22px;
   border-radius: 6px;
   font-size: 14px;
   font-weight: 600;
   cursor: pointer;
   transition: all .2s ease;
   font-family: inherit;
}

.dok-modal__btn-tutup:hover {
   background: #1e3acb;
   border-color: #1e3acb;
   color: #fff;
}

/* =========================================================================
   RESPONSIVE
   ========================================================================= */
@media (max-width: 991px) {
   .dokumen__item {
      flex-direction: column;
      gap: 15px;
      padding: 20px;
   }

   .dokumen__icon {
      width: 55px;
      height: 55px;
      font-size: 24px;
   }

   .dokumen__judul {
      font-size: 16px;
   }

   .dokumen__meta {
      gap: 12px;
      font-size: 12px;
   }

   .dokumen__actions {
      width: 100%;
      flex-direction: column;
   }

   .dokumen__actions .btn-unduh,
   .dokumen__actions .btn-unduh-disabled,
   .dokumen__actions .btn-login {
      width: 100%;
      justify-content: center;
   }
}

@media (max-width: 576px) {
   .dok-modal__box {
      border-radius: 8px;
   }

   .dok-modal__head {
      padding: 18px 50px 18px 18px;
   }

   .dok-modal__head h3 {
      font-size: 16px;
   }

   .dok-modal__body {
      padding: 18px;
      font-size: 14px;
      max-height: 65vh;
   }

   .dok-modal__foot {
      padding: 14px 18px;
   }
}