html {
    scroll-behavior: smooth;
}
body {
    background: #f4f5f7;
    color: #0f172a;
    font-family: "Plus Jakarta Sans", system-ui, sans-serif;
    -webkit-font-smoothing: antialiased;
}
.font-serif-title {
    font-family: "Lora", Georgia, serif;
}
::selection {
    background: #0f2942;
    color: #fff;
}

/* Fokus yang jelas untuk aksesibilitas */
input:focus,
select:focus,
button:focus-visible,
a:focus-visible,
textarea:focus {
    outline: none;
    box-shadow:
        0 0 0 2px #f4f5f7,
        0 0 0 4px #0f172a;
    border-radius: 6px;
}

/* Badge status ketersediaan */
.badge {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    font-size: 0.72rem;
    font-weight: 700;
    padding: 0.28rem 0.65rem;
    border-radius: 999px;
    letter-spacing: 0.02em;
    white-space: nowrap;
}
.badge-ada {
    background: #ecfdf5;
    color: #047857;
    border: 1px solid #a7f3d0;
}
.badge-pinjam {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}
.badge-ref {
    background: #f1f5f9;
    color: #475569;
    border: 1px solid #cbd5e1;
}
.badge-ebook {
    background: #eff6ff;
    color: #1d4ed8;
    border: 1px solid #bfdbfe;
}

.callno {
    font-family: "JetBrains Mono", monospace;
    font-size: 0.7rem;
    font-weight: 500;
    color: #334155;
    background: #f1f5f9;
    border: 1px solid #e2e8f0;
    padding: 0.2rem 0.5rem;
    border-radius: 6px;
    white-space: nowrap;
}

/* Sampul buku buatan (editorial, tanpa gambar stok) */
.cover {
    aspect-ratio: 3/4;
    border-radius: 4px 10px 10px 4px;
    position: relative;
    overflow: hidden;
    box-shadow:
        inset 4px 0 0 rgba(255, 255, 255, 0.25),
        0 1px 3px rgba(15, 23, 42, 0.18);
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    padding: 0.9rem;
    color: #fff;
}
.cover::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        rgba(255, 255, 255, 0.1),
        transparent 45%
    );
}
.cover-judul {
    font-family: "Lora", serif;
    font-weight: 600;
    font-size: 0.92rem;
    line-height: 1.3;
    position: relative;
}
.cover-penulis {
    font-size: 0.62rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    opacity: 0.85;
    position: relative;
}

/* Tabel tampilan daftar */
.tabel-katalog th {
    font-size: 0.68rem;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: #64748b;
    font-weight: 700;
    text-align: left;
    padding: 0.65rem 0.9rem;
    border-bottom: 2px solid #0f172a;
    white-space: nowrap;
}
.tabel-katalog td {
    padding: 0.75rem 0.9rem;
    border-bottom: 1px solid #e2e8f0;
    font-size: 0.85rem;
    vertical-align: top;
}
.tabel-katalog tbody tr {
    transition: background 0.15s ease;
    cursor: pointer;
}
.tabel-katalog tbody tr:hover {
    background: #f8fafc;
}

/* Laci detail (drawer) */
.drawer {
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.overlay {
    transition: opacity 0.25s ease;
}

/* Lembar bawah filter mobile */
.bottomsheet {
    transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}

/* Toast */
.toast {
    transition:
        transform 0.25s ease,
        opacity 0.25s ease;
}

/* Line-clamp aman */
.clamp-2 {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.clamp-3 {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* Cetakan QR sederhana */
.qr-grid {
    display: grid;
    grid-template-columns: repeat(21, 1fr);
    gap: 1px;
    background: #0f172a;
    padding: 6px;
    border-radius: 6px;
    width: 96px;
    height: 96px;
}
.qr-grid i {
    background: #fff;
}
.qr-grid i.on {
    background: #0f172a;
}

/* Tab sitasi */
.tab-sitasi.active {
    background: #0f2942;
    color: #fff;
}

/* Skeleton halus saat pencarian */
.fade-in {
    animation: fadeIn 0.3s ease both;
}
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(6px);
    }
    to {
        opacity: 1;
        transform: none;
    }
}
