/* =========================================================
   DETAIL PUBLIKASI IPK + PDF PREVIEW
   detail-publikasi.css
========================================================= */

.detail-main {
    padding: 3.5rem 0 5rem;
}

.detail-layout {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 2.75rem;
    align-items: start;
}

@media (max-width: 991.98px) {
    .detail-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}

/* ---------------------------------------------------------
   PAGE HEADER
--------------------------------------------------------- */

.detail-page-header .detail-title {
    font-size: clamp(1.6rem, 3.5vw, 2.25rem);
    line-height: 1.35;
    max-width: 820px;
}

/* ---------------------------------------------------------
   COVER
--------------------------------------------------------- */

.detail-cover-img {
    display: block;
    width: 100%;
    max-width: 280px;
    margin: 0 auto;
    border-radius: 10px;
    box-shadow:
        0 12px 30px rgba(0, 0, 0, 0.12),
        0 4px 10px rgba(0, 0, 0, 0.06);
    object-fit: cover;
    aspect-ratio: 3 / 4;
    background: var(--bs-tertiary-bg);
}

.detail-cover-mobile .detail-cover-img {
    max-width: 200px;
}

.detail-cover-desktop {
    margin-bottom: 1.25rem;
}

.detail-cover-desktop .detail-cover-img {
    max-width: 100%;
}

/* ---------------------------------------------------------
   META CHIPS
--------------------------------------------------------- */

.detail-meta-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 0.6rem;
}

.detail-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
}

.detail-chip i {
    font-size: 0.85rem;
}

.detail-chip-type {
    color: var(--brand);
    background: rgba(184, 134, 11, 0.1);
    border-color: rgba(184, 134, 11, 0.25);
}

/* ---------------------------------------------------------
   SECTIONS
--------------------------------------------------------- */

.detail-section {
    margin-bottom: 2.25rem;
}

.detail-section-title {
    margin: 0 0 0.9rem;
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--bs-body-color);
    letter-spacing: -0.01em;
}

.detail-description {
    color: var(--bs-secondary-color);
    font-size: 0.95rem;
    line-height: 1.75;
}

/* ---------------------------------------------------------
   KEYWORDS
--------------------------------------------------------- */

.detail-keywords {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
}

.detail-keyword {
    display: inline-block;
    padding: 0.35rem 0.75rem;
    border-radius: 6px;
    font-size: 0.78rem;
    font-weight: 500;
    color: var(--bs-body-color);
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
}

/* ---------------------------------------------------------
   INFO GRID
--------------------------------------------------------- */

.detail-info-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

@media (min-width: 576px) {
    .detail-info-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

.detail-info-item {
    padding: 1rem;
    border-radius: 12px;
    background: var(--bs-tertiary-bg);
    border: 1px solid var(--bs-border-color);
}

.detail-info-label {
    display: block;
    margin-bottom: 0.3rem;
    font-size: 0.72rem;
    font-weight: 600;
    color: var(--bs-secondary-color);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.detail-info-value {
    font-size: 0.95rem;
    font-weight: 700;
    color: var(--bs-body-color);
}

/* ---------------------------------------------------------
   PDF PREVIEW
--------------------------------------------------------- */

.preview-toolbar {
    display: flex;
    gap: 0.5rem;
}

.btn-preview-tool {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.4rem 0.85rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 8px;
    background: var(--bs-body-bg);
    color: var(--bs-body-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-preview-tool:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: rgba(184, 134, 11, 0.06);
}

.pdf-preview-wrapper {
    position: relative;
    width: 100%;
    height: 640px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--bs-border-color);
    background: var(--bs-tertiary-bg);
}

.pdf-preview-frame {
    display: block;
    width: 100%;
    height: 100%;
    border: 0;
    opacity: 0;
    transition: opacity 0.35s ease;
}

.pdf-preview-frame.is-loaded {
    opacity: 1;
}

.pdf-preview-loading {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
    z-index: 1;
    background: var(--bs-tertiary-bg);
}

.pdf-preview-hint {
    font-size: 0.8rem;
    color: var(--bs-secondary-color);
    margin-bottom: 0;
}

.pdf-preview-hint i {
    color: var(--brand);
}

/* Empty state */
.pdf-preview-empty {
    text-align: center;
    padding: 3.5rem 1.5rem;
    border-radius: 14px;
    border: 1px dashed var(--bs-border-color);
    background: var(--bs-tertiary-bg);
}

.pdf-empty-icon {
    width: 64px;
    height: 64px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 1rem;
    border-radius: 50%;
    background: rgba(184, 134, 11, 0.1);
    color: var(--brand);
    font-size: 1.6rem;
}

.pdf-preview-empty h3 {
    margin: 0 0 0.4rem;
    font-size: 1.1rem;
}

.pdf-preview-empty p {
    margin: 0;
    color: var(--bs-secondary-color);
    font-size: 0.9rem;
}

/* Fullscreen modal */
.pdf-fullscreen-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    flex-direction: column;
    background: #111;
}

.pdf-fullscreen-modal[hidden] {
    display: none !important;
}

.pdf-fullscreen-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    padding: 0.75rem 1.25rem;
    background: #1a1a1a;
    color: #fff;
}

.pdf-fullscreen-title {
    font-size: 0.9rem;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.btn-close-fullscreen {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    cursor: pointer;
    transition: background 0.2s ease;
}

.btn-close-fullscreen:hover {
    background: rgba(255, 255, 255, 0.2);
}

.pdf-fullscreen-frame {
    flex: 1;
    width: 100%;
    border: 0;
    background: #222;
}

/* ---------------------------------------------------------
   SIDEBAR
--------------------------------------------------------- */

.detail-sidebar-card {
    padding: 1.35rem;
    border-radius: 16px;
    background: var(--bs-body-bg);
    border: 1px solid var(--bs-border-color);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.05);
}

.sticky-sidebar {
    position: sticky;
    top: 110px;
}

.detail-sidebar-actions {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    margin-bottom: 1.25rem;
}

.btn-download {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 48px;
    padding: 0 1.25rem;
    border: none;
    border-radius: 10px;
    background: var(--brand);
    color: #fff;
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
    transition: background 0.25s ease, transform 0.2s ease;
}

.btn-download:hover:not(:disabled) {
    background: var(--brand-light-1);
    color: #fff;
    transform: translateY(-1px);
}

.btn-download:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

.btn-outline-preview {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 44px;
    padding: 0 1.25rem;
    border: 1px solid var(--brand);
    border-radius: 10px;
    background: transparent;
    color: var(--brand);
    font-size: 0.875rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s ease, color 0.2s ease;
}

.btn-outline-preview:hover {
    background: rgba(184, 134, 11, 0.1);
    color: var(--brand);
}

.btn-outline-share {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    height: 44px;
    padding: 0 1.25rem;
    border: 1px solid var(--bs-border-color);
    border-radius: 10px;
    background: transparent;
    color: var(--bs-body-color);
    font-size: 0.875rem;
    font-weight: 600;
    transition: border-color 0.2s ease, color 0.2s ease, background 0.2s ease;
}

.btn-outline-share:hover {
    border-color: var(--brand);
    color: var(--brand);
    background: rgba(184, 134, 11, 0.06);
}

.detail-sidebar-meta {
    display: flex;
    flex-direction: column;
    gap: 0.65rem;
    padding-top: 1rem;
    border-top: 1px solid var(--bs-border-color);
}

.sidebar-meta-row {
    display: flex;
    align-items: center;
    gap: 0.65rem;
    font-size: 0.85rem;
    color: var(--bs-secondary-color);
}

.sidebar-meta-row i {
    color: var(--brand);
    font-size: 1rem;
    width: 1.1rem;
    text-align: center;
}

/* ---------------------------------------------------------
   RELATED
--------------------------------------------------------- */

.sidebar-related-title {
    margin: 0 0 1rem;
    font-size: 0.95rem;
    font-weight: 700;
}

.related-list {
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}

.related-card {
    display: flex;
    gap: 0.85rem;
    padding: 0.65rem;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    border: 1px solid transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}

.related-card:hover {
    background: var(--bs-tertiary-bg);
    border-color: var(--bs-border-color);
}

.related-card-cover {
    flex: 0 0 64px;
    width: 64px;
    height: 86px;
    overflow: hidden;
    border-radius: 6px;
    background: var(--bs-tertiary-bg);
}

.related-card-cover img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.related-card-cover-sm {
    flex: 0 0 52px;
    width: 52px;
    height: 70px;
}

.related-card-body {
    min-width: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.related-card-meta {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--brand);
    text-transform: uppercase;
    letter-spacing: 0.04em;
    margin-bottom: 0.2rem;
}

.related-card-title {
    margin: 0;
    font-size: 0.85rem;
    font-weight: 600;
    line-height: 1.4;
    color: var(--bs-body-color);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.related-card-compact .related-card-title {
    font-size: 0.8rem;
    -webkit-line-clamp: 3;
}

.sidebar-see-all {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    margin-top: 1rem;
    font-size: 0.82rem;
    font-weight: 600;
    color: var(--brand);
    text-decoration: none;
}

.sidebar-see-all:hover {
    color: var(--brand-light-1);
}

.sidebar-see-all i {
    transition: transform 0.2s ease;
}

.sidebar-see-all:hover i {
    transform: translateX(3px);
}

/* ---------------------------------------------------------
   RESPONSIVE
--------------------------------------------------------- */

@media (max-width: 767.98px) {
    .detail-main {
        padding: 2.5rem 0 4rem;
    }

    .detail-info-grid {
        grid-template-columns: 1fr 1fr;
    }

    .detail-sidebar-card {
        padding: 1.1rem;
    }

    .pdf-preview-wrapper {
        height: 420px;
    }
}
