/* ============================================================
   T4n OS — SEARCH PAGE · TEMA EVERFOREST DARK
   ============================================================
   Dipakai oleh : site/{glibc,musl,server,security}.html
   Pasangan     : site/assets/script.js (search engine)
   Saudara      : assets/style.css (homepage — token warna sama)

   GAYA PENULISAN
   --------------
   Satu properti per baris, komentar dokumentasi di ATAS
   selector — bukan menumpuk di belakang deklarasi.

   DAFTAR ISI
   ----------
   1.  Token desain (:root)   — palet Everforest + font stack
   2.  Base & reset
   3.  Header / navbar
   4.  Hero                   — judul repo + search bar + tabs
   5.  Panel terminal         — window hasil (dot, title, count)
   6.  Hasil pencarian        — baris paket, chip, tombol copy
   7.  Skeleton loading
   8.  Pagination
   9.  Install list           — perintah pasang per-arch
   10. Footer & toast
   11. Responsive (<640px)
   12. Aksesibilitas          — prefers-reduced-motion

   CATATAN FONT:
   Serif "Cormorant Garamond" via Google Fonts (@import) — hanya
   untuk heading; data/terminal tetap mono. Hapus @import untuk
   mode offline penuh (fallback Georgia).
   ============================================================ */
@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:wght@500;600;700&display=swap');

/* ============================================================
   1. TOKEN DESAIN — identik dgn assets/style.css (homepage).
   Ganti tema seluruh situs cukup ubah token di sini + homepage.
   ============================================================ */
:root{
  --bg:#121816;
  --bg-deep:#0d1210;
  --bg-soft:#1a231f;
  --panel:#161d1a;
  --panel-2:#1b2420;
  --line:#242e29;
  --line-2:#38453e;
  --text:#d8e0d0;
  --muted:#9aa89b;
  --dim:#6e7d70;
  --accent:#a7c080;
  --accent-bright:#b6ce91;
  --accent-soft:rgba(167,192,128,.12);
  --green:#a7c080;
  --yellow:#dbbc7f;
  --red:#e67e80;
  --radius:12px;
  --sans:system-ui,-apple-system,"Segoe UI",Roboto,"Helvetica Neue",Arial,sans-serif;
  --serif:"Playfair Display",Georgia,"Times New Roman",serif;
  --mono:ui-monospace,"JetBrains Mono","Fira Code","Cascadia Code",Menlo,Consolas,monospace;
}

/* ============================================================
   2. BASE & RESET
   ============================================================ */
*{
  box-sizing:border-box
}
body{
  margin:0;
  /* glow hijau tipis di atas + latar everforest */
  background:radial-gradient(900px 400px at 50% -60px, rgba(167,192,128,.07), transparent 70%), var(--bg);
  color:var(--text);
  font-family:var(--sans);
  font-size:15px;
  line-height:1.6;
  -webkit-font-smoothing:antialiased
}
a{
  color:inherit;
  text-decoration:none
}
button{
  font:inherit;
  cursor:pointer
}
::selection{
  background:rgba(167,192,128,.3)
}
/* highlight kata kunci di hasil pencarian */
mark{
  background:rgba(167,192,128,.25);
  color:var(--text);
  border-radius:3px;
  padding:0 1px
}
.wrap{
  width:min(980px,92vw);
  margin-inline:auto
}
h2{
  font-family:var(--serif);
  font-size:17px;
  font-weight:600;
  letter-spacing:.18em;
  text-transform:uppercase;
  color:var(--text);
  margin:0 0 16px
}
h2::after{
  content:"";
  display:block;
  width:56px;
  height:1px;
  background:var(--accent);
  margin-top:8px;
  opacity:.7
}

/* ============================================================
   3. HEADER / NAVBAR
   sticky + blur; nav item uppercase letterspaced,
   halaman aktif (data-key) diberi underline via box-shadow inset
   ============================================================ */
header{
  position:sticky;
  top:0;
  z-index:50;
  background:rgba(13,18,16,.85);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--line)
}
.bar{
  display:flex;
  align-items:center;
  gap:18px;
  height:60px
}

/* ---------- brand: logo + wordmark ---------- */
/* font-variant-numeric: angka dirender "lining" (sejajar penuh),
   memperbaiki "4" Cormorant yang secara default old-style (turun) */
.brand{
  display:inline-flex;
  align-items:center;
  gap:10px;
  font-family:var(--serif);
  font-weight:600;
  font-size:21px;
  letter-spacing:.05em;
  font-variant-numeric:lining-nums;
  font-feature-settings:"lnum" 1,"onum" 0 /* fallback engine lama */
}
.brand-logo{
  width:30px;
  height:30px;
  object-fit:contain; /* logo ikut rata vertikal */
  flex:none;
  border-radius:7px   /* hapus jika logo sudah bulat/kotak */
}
/* "OS" berwarna aksen */
.brand b{
  color:var(--accent);
  font-weight:600
}
.bar nav{
  display:flex;
  gap:6px;
  margin-left:auto;
  align-items:center
}
.bar nav a{
  font-size:12px;
  letter-spacing:.12em;
  text-transform:uppercase;
  padding:6px 12px;
  border-radius:8px;
  color:var(--muted);
  border:1px solid transparent;
  transition:.15s;
  white-space:nowrap
}
.bar nav a:hover{
  color:var(--text);
  background:var(--bg-soft);
  border-color:var(--line-2)
}
/* underline aktif — link dengan data-key = body[data-repo] */
.bar nav a.active{
  color:var(--accent);
  box-shadow:inset 0 -2px 0 var(--accent)
}

/* Tombol GitHub: logo inline SVG mengikuti warna teks (currentColor) */
.bar nav a.gh{
  display:inline-flex;
  align-items:center;
  gap:7px;
  border-color:var(--line-2)
}
.bar nav a.gh svg{
  width:15px;
  height:15px;
  fill:currentColor;
  flex:none
}
.bar nav a.gh:hover{
  color:var(--accent);
  border-color:var(--accent)
}

/* ============================================================
   4. HERO — breadcrumb (← home / site / repo), judul serif,
   search bar & tab arch di bawahnya
   ============================================================ */
.hero{
  padding:44px 0 8px
}
.crumb{
  font-family:var(--mono);
  color:var(--accent);
  font-size:13px;
  margin:0 0 10px
}
.back{
  color:var(--dim)
}
.back:hover{
  color:var(--accent)
}
.hero h1{
  font-family:var(--serif);
  font-weight:600;
  font-size:clamp(32px,5vw,46px);
  margin:0 0 8px;
  letter-spacing:.01em
}
/* label repo (repo-<em>xxx</em>) berwarna aksen */
.hero h1 em{
  font-style:normal;
  font-synthesis:none;
  color:var(--accent)
}
.sub{
  color:var(--muted);
  margin:0 0 24px
}
.sub b{
  color:var(--text)
}

/* Search bar — fokus: border aksen + ring lembut (focus-within) */
.search{
  display:flex;
  align-items:center;
  gap:12px;
  background:var(--panel);
  border:1px solid var(--line-2);
  border-radius:var(--radius);
  padding:13px 16px;
  transition:.15s;
  box-shadow:0 8px 30px rgba(0,0,0,.25)
}
.search:focus-within{
  border-color:var(--accent);
  box-shadow:0 0 0 4px var(--accent-soft)
}
.search .pipe{
  font-family:var(--mono);
  color:var(--accent);
  font-weight:800;
  user-select:none
}
.search input{
  font-family:var(--mono);
  flex:1;
  background:none;
  border:0;
  outline:0;
  color:var(--text);
  font-size:16px;
  min-width:0
}
.search input::placeholder{
  color:var(--dim)
}
/* tombol ✕ bawaan disembunyikan — "Esc" adalah shortcut bersihkan */
.search input::-webkit-search-cancel-button{
  -webkit-appearance:none
}
/* hint keyboard "/" untuk fokus ke search */
.search kbd{
  font-family:var(--mono);
  border:1px solid var(--line-2);
  border-bottom-width:2px;
  border-radius:6px;
  padding:1px 8px;
  color:var(--dim);
  font-size:12px
}

/* Tabs arch — .active terisi aksen; counter (.n) opacity turun */
.tabs{
  display:flex;
  flex-wrap:wrap;
  gap:8px;
  margin-top:18px
}
.tab{
  font-family:var(--mono);
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:999px;
  color:var(--muted);
  padding:7px 15px;
  font-size:12.5px;
  transition:.15s
}
.tab:hover{
  color:var(--text);
  border-color:var(--line-2)
}
.tab.active{
  background:var(--accent);
  border-color:var(--accent);
  color:#18211b;
  font-weight:700
}
.tab .n{
  font-size:11px;
  opacity:.65;
  margin-left:5px
}

/* ============================================================
   5. PANEL TERMINAL — window hasil pencarian
   .panel-bar     : dot r/y/g + judul perintah + counter
   .panel         : scroll-margin-top agar tak tertutup navbar
                    saat scrollIntoView() dari pagination
   #notice/#status: banner peringatan & empty/error state
                    (:empty → otomatis tak memakan ruang)
   ============================================================ */
.panel{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  margin-top:24px;
  overflow:hidden;
  box-shadow:0 14px 40px rgba(0,0,0,.35);
  scroll-margin-top:76px
}
.panel-bar{
  display:flex;
  align-items:center;
  gap:7px;
  padding:10px 14px;
  background:var(--panel-2);
  border-bottom:1px solid var(--line)
}
.dot{
  width:11px;
  height:11px;
  border-radius:50%;
  flex:none
}
.dot.r{
  background:var(--red)
}
.dot.y{
  background:var(--yellow)
}
.dot.g{
  background:var(--accent)
}
.panel-title{
  font-family:var(--mono);
  margin-left:8px;
  color:var(--dim);
  font-size:12.5px;
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis
}
.panel-count{
  font-family:var(--mono);
  margin-left:auto;
  color:var(--accent);
  font-size:12.5px;
  flex:none
}

#notice{
  padding:10px 16px;
  background:rgba(219,188,127,.08);
  border-bottom:1px solid var(--line);
  color:var(--muted);
  font-size:12.5px
}
#notice:empty{
  display:none
}
#status:empty{
  display:none
}
.status{
  padding:40px 20px;
  text-align:center;
  color:var(--muted)
}
/* glyph besar: ∅ / ⌕ / ! */
.status .big{
  font-family:var(--mono);
  font-size:30px;
  color:var(--accent);
  margin-bottom:8px
}
.status code{
  font-family:var(--mono);
  background:var(--bg-soft);
  border:1px solid var(--line);
  border-radius:6px;
  padding:1px 6px;
  font-size:12.5px
}
.status.err{
  color:var(--red)
}

/* ============================================================
   6. HASIL PENCARIAN — max-height 540px + scroll internal
   (di mobile dimatikan oleh media query §11)
   .row-link : nama + versi + desc(elipsis) + chip arch + size
   .copy     : salin "xbps-install <pkg>"
   ============================================================ */
.results{
  list-style:none;
  margin:0;
  padding:0;
  max-height:540px;
  overflow-y:auto
}
.results:empty{
  display:none
}
.results::-webkit-scrollbar{
  width:10px
}
.results::-webkit-scrollbar-thumb{
  background:var(--line-2);
  border-radius:6px
}
.row{
  display:flex;
  align-items:center;
  gap:10px;
  border-bottom:1px solid var(--line);
  padding-right:10px
}
.row:last-child{
  border-bottom:0
}
.row-link{
  flex:1;
  display:flex;
  align-items:center;
  gap:12px;
  min-width:0;
  padding:11px 16px;
  transition:background .12s
}
.row-link:hover{
  background:var(--accent-soft)
}
.row-link .name{
  font-family:var(--mono);
  font-weight:700;
  white-space:nowrap;
  overflow-wrap:anywhere
}
.row-link .ver{
  font-family:var(--mono);
  color:var(--muted);
  font-size:12.5px;
  white-space:nowrap
}
.row-link .desc{
  flex:1;
  color:var(--dim);
  font-size:12.5px;
  overflow:hidden;
  text-overflow:ellipsis;
  white-space:nowrap;
  min-width:20px
}
.chip{
  font-family:var(--mono);
  font-size:11px;
  padding:2px 9px;
  border-radius:999px;
  border:1px solid var(--line-2);
  color:var(--muted);
  white-space:nowrap;
  flex:none
}
.chip.arch{
  color:var(--accent);
  border-color:rgba(167,192,128,.35)
}
.size{
  font-family:var(--mono);
  color:var(--dim);
  font-size:11.5px;
  white-space:nowrap;
  flex:none
}
.copy{
  font-family:var(--mono);
  background:var(--bg-soft);
  border:1px solid var(--line-2);
  color:var(--muted);
  border-radius:8px;
  padding:4px 9px;
  font-size:11.5px;
  transition:.15s;
  flex:none
}
.copy:hover{
  color:var(--accent);
  border-color:var(--accent)
}
.more{
  padding:12px 16px;
  color:var(--dim);
  font-size:12px;
  text-align:center
}

/* ============================================================
   7. SKELETON — placeholder shimmer saat fetch berjalan
   ============================================================ */
.sk{
  padding:14px 16px;
  border-bottom:1px solid var(--line)
}
.sk:last-child{
  border:0
}
.sk-line{
  height:13px;
  border-radius:6px;
  background:linear-gradient(90deg,var(--line) 25%,var(--line-2) 50%,var(--line) 75%);
  background-size:200% 100%;
  animation:shine 1.1s linear infinite
}
@keyframes shine{
  to{
    background-position:-200% 0
  }
}

/* ============================================================
   8. PAGINATION — [‹][1][2]…[Last][›]
   container disuntik JS setelah #results; :empty = sembunyi
   ============================================================ */
.pagination{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  flex-wrap:wrap;
  padding:12px 16px;
  border-top:1px solid var(--line);
  background:var(--panel-2)
}
.pagination:empty{
  display:none
}
.pg-info{
  font-family:var(--mono);
  color:var(--dim);
  font-size:12px
}
.pg-info b{
  color:var(--muted)
}
.pg-pages{
  display:flex;
  align-items:center;
  gap:6px;
  flex-wrap:wrap
}
.pg{
  font-family:var(--mono);
  min-width:34px;
  height:34px;
  padding:0 10px;
  border-radius:9px;
  border:1px solid var(--line-2);
  background:var(--panel);
  color:var(--muted);
  font-size:13px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  transition:.15s
}
.pg:hover:not(:disabled):not(.active){
  color:var(--accent);
  border-color:var(--accent)
}
.pg.active{
  background:var(--accent);
  border-color:var(--accent);
  color:#18211b;
  font-weight:700;
  cursor:default
}
.pg:disabled{
  opacity:.35;
  cursor:not-allowed
}
/* tanda "…" antar jendela nomor */
.pg-dots{
  color:var(--dim);
  padding:0 2px;
  user-select:none
}

/* ============================================================
   9. INSTALL LIST — perintah pasang per-arch (buildInstall())
   ============================================================ */
.howto{
  margin-top:34px
}
.inst{
  background:var(--panel);
  border:1px solid var(--line);
  border-radius:var(--radius);
  padding:14px 16px
}
.inst-line{
  display:flex;
  align-items:center;
  gap:10px;
  padding:6px 0
}
.inst-line + .inst-line{
  border-top:1px solid var(--line)
}
.inst-line .chip.arch{
  min-width:70px;
  text-align:center
}
.inst-line code{
  font-family:var(--mono);
  flex:1;
  color:var(--muted);
  font-size:12px;
  overflow-x:auto;
  white-space:nowrap;
  scrollbar-width:none
}
.inst-note{
  margin:12px 0 0;
  color:var(--dim);
  font-size:12px
}
.inst-note code{
  font-family:var(--mono);
  background:var(--bg-soft);
  border:1px solid var(--line);
  border-radius:6px;
  padding:1px 6px
}

/* ============================================================
   10. FOOTER & TOAST
   footer : latar paling gelap (bg-deep) + garis atas
   .toast : notifikasi copy — muncul via .show (dari script.js)
   ============================================================ */
footer{
  background:var(--bg-deep);
  border-top:1px solid var(--line);
  margin-top:52px;
  padding:20px 0;
  color:var(--dim);
  font-size:12.5px
}
.foot{
  display:flex;
  justify-content:space-between;
  gap:10px;
  flex-wrap:wrap
}
.foot p{
  margin:0
}
.foot a:hover{
  color:var(--accent)
}
.toast{
  font-family:var(--mono);
  position:fixed;
  left:50%;
  bottom:26px;
  transform:translate(-50%,16px);
  background:var(--bg-soft);
  border:1px solid var(--accent);
  color:var(--text);
  padding:9px 16px;
  border-radius:10px;
  font-size:13px;
  opacity:0;
  pointer-events:none;
  transition:.25s;
  z-index:99;
  max-width:90vw
}
.toast.show{
  opacity:1;
  transform:translate(-50%,0)
}

/* ============================================================
   11. RESPONSIVE — layar ≤ 640px
   - hint kbd disembunyikan (HP tidak punya keyboard "/")
   - kolom desc & size dihilangkan → baris hasil ringkas
   - baris hasil wrap: tombol copy pindah ke bawah
   - pagination rata tengah
   ============================================================ */
@media(max-width:640px){
  .search kbd{
    display:none
  }
  .row-link .desc,
  .size{
    display:none
  }
  .row{
    flex-wrap:wrap;
    padding-right:0
  }
  .row-link{
    flex:1 1 100%
  }
  .copy{
    margin:0 0 10px 16px
  }
  .inst-line{
    flex-wrap:wrap
  }
  .inst-line code{
    flex:1 1 100%
  }
  .pagination{
    justify-content:center
  }
  .pg-info{
    width:100%;
    text-align:center
  }
  /* nav bisa digeser horizontal di layar sempit */
  .bar nav{
    overflow-x:auto;
    scrollbar-width:none
  }
}

/* ============================================================
   12. AKSESIBILITAS — hormati reduce motion:
   matikan shimmer, blink, transisi hover & toast
   ============================================================ */
@media (prefers-reduced-motion:reduce){
  *{
    animation:none!important;
    transition:none!important
  }
}