/* Variabel tema OPAC */
:root {
    --navy:#211d1a;
    --blue:#80583f;
    --blue-light:#f3e8d4;
    --gold:#c49a58;
    --ink:#292521;
    --muted:#827b73;
    --line:#ebe5dc;
    --bg:#f7f4ef;
    --white:#fff;
    --green:#37866b;
    --green-bg:#e8f3ed;
    --amber:#946a2c;
    --amber-bg:#f6ead7
}

/* Reset dan pengaturan dasar */
* {
    box-sizing:border-box
}

body {
    margin:0;
    background:var(--bg);
    color:var(--ink);
    font-family:Inter,"Segoe UI",Arial,sans-serif;
    line-height:1.5
}

a {
    color:inherit;
    text-decoration:none
}

/* Header dan identitas perpustakaan */
.site-header {
    background:var(--white);
    border-bottom:1px solid var(--line)
}

.header-inner {
    max-width:1180px;
    margin:auto;
    padding:15px 22px;
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:16px
}

.brand {
    display:flex;
    align-items:center;
    gap:11px;
    min-width:0
}

.brand-mark {
    width:43px;
    height:43px;
    display:grid;
    place-items:center;
    flex:0 0 auto;
    border-radius:12px;
    background:var(--gold);
    color:#241f19;
    font-weight:800;
    font-size:20px
}

.brand-name {
    font-size:15px;
    font-weight:800;
    color:var(--navy);
    line-height:1.25
}

.brand-sub {
    font-size:11px;
    color:var(--muted);
    margin-top:3px
}

.header-label {
    font-size:12px;
    color:var(--muted);
    text-align:right
}

/* Banner utama katalog */
.hero {
    background:linear-gradient(125deg,#39291f,#80583f);
    color:#fff
}

.hero-inner {
    max-width:1180px;
    margin:auto;
    padding:44px 22px 62px
}

.eyebrow {
    display:inline-block;
    margin-bottom:10px;
    padding:5px 9px;
    border:1px solid rgba(196,154,88,.55);
    border-radius:30px;
    font-size:10px;
    font-weight:800;
    letter-spacing:1px;
    color:#e8d5b5
}

.hero h1 {
    max-width:700px;
    margin:0;
    font-size:clamp(28px,4vw,42px);
    line-height:1.15;
    letter-spacing:-.8px
}

.hero p {
    max-width:630px;
    margin:13px 0 0;
    color:#d8cfc4;
    font-size:14px
}

/* Form pencarian dan filter */
.search-wrap {
    max-width:1180px;
    margin:-28px auto 0;
    padding:0 22px;
    position:relative
}

.search-panel {
    background:#fff;
    padding:18px;
    border:1px solid var(--line);
    border-radius:15px;
    box-shadow:0 12px 28px rgba(33,29,26,.08)
}

.search-form {
    display:grid;
    grid-template-columns:minmax(0,1.8fr) minmax(160px,1fr) minmax(150px,.8fr) auto;
    gap:10px;
    align-items:end
}

.field label {
    display:block;
    margin-bottom:6px;
    font-size:11px;
    font-weight:700;
    color:#475363
}

.field input,.field select {
    width:100%;
    height:43px;
    padding:10px 12px;
    border:1px solid #d9e0e7;
    border-radius:9px;
    background:#fff;
    color:var(--ink);
    font:inherit;
    font-size:13px;
    min-width:0
}

.field input:focus,.field select:focus {
    outline:2px solid #e8d5b5;
    outline-offset:1px;
    border-color:var(--gold)
}

/* Tombol pencarian */
.btn {
    display:inline-flex;
    align-items:center;
    justify-content:center;
    gap:7px;
    min-height:43px;
    padding:10px 17px;
    border:0;
    border-radius:9px;
    background:var(--gold);
    color:#241f19;
    font:inherit;
    font-size:12px;
    font-weight:800;
    cursor:pointer;
    white-space:nowrap
}

.btn:hover {
    background:#b58a49
}

.btn-reset {
    background:#f1ede7;
    color:#51483e
}

/* Konten utama dan ringkasan koleksi */
.page-content {
    max-width:1180px;
    margin:27px auto 0;
    padding:0 22px 44px
}

.stats {
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:13px;
    margin-bottom:30px
}

.stat {
    display:flex;
    align-items:center;
    gap:13px;
    padding:16px;
    background:#fff;
    border:1px solid var(--line);
    border-radius:12px;
    min-width:0
}

.stat-icon {
    display:grid;
    place-items:center;
    width:42px;
    height:42px;
    flex:0 0 auto;
    background:var(--blue-light);
    border-radius:11px;
    color:#80583f;
    font-size:20px
}

.stat-number {
    font-size:23px;
    font-weight:800;
    line-height:1.1
}

.stat-label {
    margin-top:4px;
    color:var(--muted);
    font-size:11px
}

/* Judul bagian katalog */
.section-head {
    display:flex;
    justify-content:space-between;
    align-items:flex-end;
    gap:15px;
    margin-bottom:15px
}

.section-head h2 {
    margin:0;
    color:var(--navy);
    font-size:21px;
    letter-spacing:-.3px
}

.section-head p {
    margin:4px 0 0;
    color:var(--muted);
    font-size:12px
}

.result-count {
    font-size:12px;
    color:var(--muted);
    white-space:nowrap
}

/* Kartu dan daftar buku */
.book-grid {
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:16px
}

.book-card {
    display:flex;
    flex-direction:column;
    min-width:0;
    overflow:hidden;
    background:#fff;
    border:1px solid var(--line);
    border-radius:13px;
    transition:transform .15s,box-shadow .15s
}

.book-card:hover {
    transform:translateY(-2px);
    box-shadow:0 9px 22px rgba(33,29,26,.07)
}

.cover {
    height:190px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    background:linear-gradient(135deg,#f7f2e9,#eee5d7);
    padding:15px
}

.cover img {
    width:100%;
    height:100%;
    object-fit:contain
}

.cover-placeholder {
    display:flex;
    flex-direction:column;
    align-items:center;
    gap:7px;
    color:#a18a65
}

.cover-placeholder svg {
    width:56px;
    height:56px
}

.cover-placeholder span {
    font-size:10px;
    letter-spacing:1px;
    font-weight:800
}

.book-info {
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:7px;
    padding:14px;
    flex:1
}

.category {
    font-size:10px;
    font-weight:800;
    color:var(--blue);
    text-transform:uppercase;
    letter-spacing:.4px
}

/* Label kategori dan peringkat buku populer */
.book-card-labels {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px;
    width: 100%;
}

.popular-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 7px;
    border-radius: 20px;
    background: #f6ead7;
    color: #805a32;
    font-size: 9px;
    font-weight: 800;
    white-space: nowrap;
}

/* Judul buku pada kartu katalog */

.book-title {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;

    color: var(--ink);
    font-size: 14px;
    font-weight: 800;
    line-height: 1.4;
}

.book-author {
    font-size:11px;
    color:var(--muted);
    min-height:17px
}

.book-meta {
    font-size:10px;
    color:var(--muted)
}

.availability {
    display:inline-flex;
    align-items:center;
    gap:5px;
    margin-top:2px;
    padding:5px 8px;
    border-radius:30px;
    font-size:10px;
    font-weight:800
}

.available {
    background:var(--green-bg);
    color:var(--green)
}

.unavailable {
    background:var(--amber-bg);
    color:var(--amber)
}

.book-link {
    width:100%;
    margin-top:auto;
    padding-top:7px
}

.book-link a {
    display:flex;
    justify-content:center;
    align-items:center;
    width:100%;
    min-height:36px;
    border:1px solid #e8d5b5;
    border-radius:8px;
    color:#80583f;
    font-size:11px;
    font-weight:800
}

.book-link a:hover {
    background:var(--blue-light)
}

/* Pesan kosong dan galat */
.empty {
    grid-column:1/-1;
    padding:44px 20px;
    text-align:center;
    background:#fff;
    border:1px dashed #cbd5df;
    border-radius:13px
}

.empty strong {
    display:block;
    margin-bottom:6px;
    color:var(--navy)
}

.empty p {
    margin:0;
    color:var(--muted);
    font-size:12px
}

.alert {
    margin-bottom:18px;
    padding:13px 15px;
    border-radius:10px;
    background:#fff0ed;
    border:1px solid #f0d0ca;
    color:#9c3026;
    font-size:12px
}

/* Navigasi halaman dan footer */
.pagination {
    display:flex;
    flex-wrap:wrap;
    justify-content:center;
    gap:7px;
    margin-top:24px
}

.pagination a,.pagination span {
    display:grid;
    place-items:center;
    min-width:36px;
    height:36px;
    padding:0 10px;
    border:1px solid var(--line);
    border-radius:8px;
    background:#fff;
    color:#475363;
    font-size:12px;
    font-weight:700
}

.pagination .current {
    background:var(--navy);
    color:#fff;
    border-color:var(--navy)
}

.site-footer {
    border-top:1px solid var(--line);
    background:#fff
}

.footer-inner {
    max-width:1180px;
    margin:auto;
    padding:20px 22px;
    display:flex;
    justify-content:space-between;
    gap:12px;
    color:var(--muted);
    font-size:11px
}

@media (max-width:1000px) {
    .book-grid {
        grid-template-columns:repeat(3,minmax(0,1fr))
    }

    .search-form {
        grid-template-columns:repeat(2,minmax(0,1fr))
    }

    .search-form .search-actions {
        grid-column:1/-1;
        display:flex;
        gap:8px
    }

    .search-actions .btn {
        flex:1
    }

}

@media (max-width:650px) {
    .header-inner {
        padding:12px 16px
    }

    .header-label {
        display:none
    }

    .brand-mark {
        width:39px;
        height:39px
    }

    .hero-inner {
        padding:33px 16px 51px
    }

    .hero p {
        font-size:13px
    }

    .search-wrap {
        padding:0 13px
    }

    .search-panel {
        padding:13px;
        border-radius:12px
    }

    .search-form {
        grid-template-columns:1fr;
        gap:11px
    }

    .search-form .search-actions {
        grid-column:auto
    }

    .page-content {
        padding:0 13px 30px;
        margin-top:22px
    }

    .stats {
        gap:8px;
        margin-bottom:24px
    }

    .stat {
        padding:11px;
        gap:9px
    }

    .stat-icon {
        width:34px;
        height:34px;
        font-size:17px
    }

    .stat-number {
        font-size:20px
    }

    .stat-label {
        font-size:10px
    }

    .book-grid {
        grid-template-columns:repeat(2,minmax(0,1fr));
        gap:10px
    }

    .cover {
        height:145px;
        padding:11px
    }

    .book-info {
        padding:11px;
        gap:6px
    }

    .book-title {
        font-size:12px
    }

    .book-author {
        font-size:10px
    }

    .section-head {
        align-items:flex-start;
        flex-direction:column;
        gap:4px
    }

    .section-head h2 {
        font-size:19px
    }

    .result-count {
        white-space:normal
    }

    .footer-inner {
        padding:18px 16px;
        flex-direction:column;
        gap:4px
    }

}

@media (max-width:360px) {
    .book-grid {
        grid-template-columns:1fr
    }

    .cover {
        height:180px
    }

    .stats {
        grid-template-columns:1fr
    }

    .stat {
        padding:12px
    }

}
