/*
Theme Name: PureAPK Clone Lite
Theme URI: https://example.com/
Author: ChatGPT
Description: A lightweight PureAPK-style WordPress theme with header search, trending/featured/recent sections and a right sidebar.
Version: 1.0.2
License: GPLv2 or later
Text Domain: pureapk-clone
*/

:root{
  --bg:#f6f8fb;
  --card:#ffffff;
  --text:#1f2937;
  --muted:#6b7280;
  --border:#e5e7eb;
  --brand:#2b7cff;
  --brand2:#00a3ff;
  --green:#22c55e;
}

*{box-sizing:border-box}
html,body{margin:0;padding:0}
body{
  font-family: system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
  color:var(--text);
  background:var(--bg);
  line-height:1.35;
}

a{color:inherit;text-decoration:none}
a:hover{color:var(--brand)}

.container{max-width:1180px;margin:0 auto;padding:0 14px}

.site-header{
  position:sticky; top:0; z-index:50;
  background:#fff;
  border-bottom:1px solid var(--border);
}

.header-inner{
  display:flex; align-items:center; gap:16px;
  padding:10px 0;
}

.site-brand{
  display:flex; align-items:center; gap:10px; min-width:160px;
  font-weight:800; letter-spacing:.3px;
}
.site-brand .brand-text{font-size:22px}
.site-brand .brand-text span{color:var(--brand)}

.site-search{flex:1}
.site-search form{margin:0}
.site-search input[type="search"]{
  width:100%;
  padding:10px 14px;
  border:1px solid var(--border);
  border-radius:999px;
  outline:none;
  background:#fbfbfc;
}
.site-search input[type="search"]:focus{
  border-color:rgba(43,124,255,.55);
  box-shadow:0 0 0 3px rgba(43,124,255,.12);
  background:#fff;
}

.header-actions{
  display:flex; align-items:center; gap:18px;
}
.header-actions a{
  color:var(--brand);
  font-weight:600;
  font-size:14px;
  display:flex; align-items:center; gap:7px;
}
.header-actions .menu-btn{
  display:none;
  width:40px;height:42px;
  border:1px solid var(--border);
  background:#fff;
  border-radius:10px;
  cursor:pointer;
}

.nav{
  display:flex; gap:14px; align-items:center;
}
.nav a{
  padding:8px 10px;
  border-radius:10px;
}
.nav a:hover{background:rgba(43,124,255,.08)}

.layout{
  display:grid;
  grid-template-columns: 1fr 320px;
  gap:16px;
  padding:14px 0 24px;
}

@media (max-width: 980px){
  .layout{grid-template-columns:1fr}
  .header-inner{gap:10px}
  .site-brand{min-width:auto}
  .header-actions .menu-btn{display:inline-flex;align-items:center;justify-content:center}
  .nav{display:none}
  .nav.is-open{display:flex; flex-direction:column; align-items:flex-start; gap:8px; padding:10px 0}
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  box-shadow:0 1px 0 rgba(17,24,39,.04);
}

.section{
  margin-bottom:14px;
}
.section-header{
  display:flex; align-items:center; justify-content:space-between;
  padding:10px 12px;
  border-bottom:1px solid var(--border);
}
.section-title{
  display:flex; align-items:center; gap:8px;
  font-weight:800;
  font-size:13px;
  color:#ef4444;
  text-transform:capitalize;
}
.section-title .dot{
  width:18px;height:18px;border-radius:6px;background:#fee2e2;
  display:inline-flex;align-items:center;justify-content:center;
  font-size:12px;
}
.section-actions a{
  font-size:11px;
  font-weight:800;
  color:#ef4444;
  padding:6px 10px;
  border:1px solid #fecaca;
  border-radius:999px;
  background:#fff;
}

.section-body{padding:12px}

.trending-row{
  display:flex;
  gap:10px;
  overflow:auto;
  padding-bottom:6px;
  scroll-snap-type:x mandatory;
}
.trending-row::-webkit-scrollbar{height:8px}
.trending-row::-webkit-scrollbar-thumb{background:#dbe4f2;border-radius:999px}

.app-card{
  width:160px;
  flex:0 0 auto;
  scroll-snap-align:start;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
  padding:10px;
}
.app-card .thumb{
  width:54px;height:54px;border-radius:14px; overflow:hidden;
  border:1px solid var(--border);
}
.app-card .thumb img{width:100%;height:100%;object-fit:cover}
.app-card h3{
  font-size:12px;
  margin:8px 0 4px;
  font-weight:800;
  height:32px;
  overflow:hidden;
}
.app-card .meta{font-size:11px;color:var(--muted)}
.btn{
  display:inline-flex;align-items:center;justify-content:center;
  gap:6px;
  padding:8px 10px;
  border-radius:10px;
  font-size:12px;
  font-weight:800;
  border:1px solid var(--border);
  background:#f8fafc;
  width:100%;
  margin-top:8px;
}
.btn:hover{background:#eef2ff;border-color:#c7d2fe}
.btn .dl{color:var(--brand)}

.grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:10px;
}
@media (max-width: 720px){
  .grid{grid-template-columns: repeat(2, minmax(0, 1fr))}
}
@media (max-width: 420px){
  .grid{grid-template-columns: 1fr}
}

.post-tile{
  display:flex; gap:10px; align-items:flex-start;
  padding:10px;
  border:1px solid var(--border);
  border-radius:12px;
  background:#fff;
}
.post-tile .thumb{
  width:48px;height:48px;border-radius:12px; overflow:hidden;
  border:1px solid var(--border);
  flex:0 0 auto;
}
.post-tile .thumb img{width:100%;height:100%;object-fit:cover}
.post-tile h3{margin:0 0 4px;font-size:12px;font-weight:900}
.post-tile .meta{font-size:11px;color:var(--muted)}
.post-tile .actions{margin-top:6px}
.post-tile .actions .btn{width:auto;padding:7px 10px;margin:0}

.sidebar .widget{margin-bottom:14px}
.widget-title{
  padding:10px 12px;
  border-bottom:1px solid var(--border);
  font-weight:900;
  font-size:12px;
  color:#111827;
  text-transform:uppercase;
  letter-spacing:.5px;
}
.widget-body{padding:12px}
.widget a{color:var(--brand)}
.widget ul{list-style:none;padding:0;margin:0;display:grid;gap:8px}
.tagcloud a{
  display:inline-block;
  margin:0 6px 6px 0;
  padding:6px 10px;
  border:1px solid var(--border);
  border-radius:999px;
  font-size:12px !important;
  background:#fff;
}

.single-wrap .entry-title{margin:0 0 10px}
.single-wrap .entry-meta{color:var(--muted);font-size:12px;margin-bottom:14px}
.single-wrap .entry-content img{max-width:100%;height:auto;border-radius:12px}
.footer{
  padding:20px 0;
  border-top:1px solid var(--border);
  color:var(--muted);
  background:#fff;
  font-size:12px;
}

/* ===== Header: PureAPK style (updated) ===== */
.pureapk-header{
  position:sticky; top:0; z-index:9999;
  background:#fff;
  border-bottom:1px solid var(--border);
}
.pureapk-header .container{padding-left:0; padding-right:0;}
.pureapk-header .ph-wrap{
  max-width:1180px;
  margin:0 auto;
  padding:10px 14px;
  display:grid;
  grid-template-columns:auto 1fr auto;
  grid-template-areas:"logo search right";
  gap:14px;
  align-items:center;
}
.ph-logo{grid-area:logo; display:flex; align-items:center; justify-content:flex-start; min-width:140px;}
.ph-search{grid-area:search;}
.ph-right{grid-area:right;}
.ph-logo .custom-logo{
  height:clamp(26px, 2.2vw, 34px);
  width:auto;
}
.ph-logo a{display:flex; align-items:center; text-decoration:none; color:inherit;}

.ph-search{position:relative; display:flex; align-items:center;}
.ph-search form{width:100%; margin:0;}
.ph-search-icon{position:absolute; left:14px; opacity:.55; pointer-events:none;}
.ph-search input[type="search"]{
  width:100%;
  height:clamp(36px, 2.6vw, 42px);
  padding:0 14px 0 42px;
  border:1px solid var(--border);
  border-radius:999px;
  outline:none;
  background:#fff;
}
.ph-search input[type="search"]:focus{
  border-color:rgba(43,124,255,.55);
  box-shadow:0 0 0 3px rgba(43,124,255,.12);
}

.ph-right{
  display:flex;
  align-items:center;
  gap:0;
  border-left:1px solid var(--border);
}
.ph-toplink{
  display:flex;
  align-items:center;
  gap:8px;
  padding:0 20px;
  height:clamp(42px, 3vw, 48px);
  color:var(--brand);
  text-decoration:none;
  font-weight:600;
  border-right:1px solid var(--border);
  white-space:nowrap;
}
.ph-burger{
  width:clamp(46px, 4vw, 56px);
  height:clamp(42px, 3vw, 48px);
  border:0;
  background:transparent;
  cursor:pointer;
  display:flex;
  align-items:center;
  justify-content:center;
  font-size:clamp(20px, 2.2vw, 22px);
  color:var(--text);
}

/* ==========================
   Mobile: same elements, different sizing + search goes to 2nd row
   ========================== */
@media (max-width: 980px){
  .pureapk-header .ph-wrap{
    padding:8px 10px;
    gap:10px;
    grid-template-columns:auto 1fr auto;
    grid-template-areas:
      "logo right right"
      "search search search";
  }

  .ph-logo{min-width:auto;}

  /* smaller UI on phones/tablets */
  .ph-logo .custom-logo,
  .ph-logo .custom-logo-link img{height:28px; width:auto;}
  .ph-search input[type="search"]{height:38px;}
  .ph-toplink{height:42px;}
  .ph-burger{height:42px;}

  .ph-right{
    border-left:0;
    justify-content:flex-end;
  }
  .ph-toplink{padding:0 10px; font-size:13px; border-right:0;}
}

/* Small mobile: show only icons for Application/Games to avoid breaking */
@media (max-width: 420px){
  .ph-toplink{padding:0 8px; gap:0;}
  .ph-toplink .ph-label{display:none;}
}

/* Drawer */
.ph-backdrop{
  position:fixed; inset:0;
  background:rgba(0,0,0,.28);
  opacity:0;
  pointer-events:none;
  transition:opacity .2s ease;
  z-index:9999;
}
.ph-backdrop.open{opacity:1; pointer-events:auto;}

.ph-drawer{
  position:fixed;
  top:0; right:-320px;
  width:320px; height:100vh;
  background:#fff;
  border-left:1px solid var(--border);
  box-shadow:-10px 0 30px rgba(0,0,0,.08);
  transition:right .25s ease;
  z-index:10000;
  padding:16px;
  overflow:auto;
}
.ph-drawer.open{right:0;}
.ph-drawer-head{display:flex; align-items:center; justify-content:space-between; margin-bottom:10px;}
.ph-close{border:0; background:transparent; font-size:22px; cursor:pointer;}

/* WP menu inside drawer */
.ph-drawer ul{list-style:none; padding:0; margin:10px 0 0;}
.ph-drawer li{border-bottom:1px solid var(--border);}
.ph-drawer a{display:block; padding:12px 8px; text-decoration:none; color:#111827; font-weight:600;}

/* Footer center */
.footer, .footer-inner{ text-align:center; }

/* Responsive: keep same structure */
@media (max-width:768px){
  /* Mobile/tablet: SAME look, but responsive sizing + search goes to 2nd row */
  .pureapk-header .ph-wrap{
    gap:10px;
    padding:8px 10px;
    grid-template-columns: 1fr auto;
    grid-template-areas:
      "logo right"
      "search search";
  }
  .ph-logo{min-width:auto;}
  .ph-logo .custom-logo{height:28px;}
  .ph-search{width:100%;}
  .ph-search input[type="search"]{height:38px;}
  .ph-toplink{padding:0 10px; height:42px;}
  .ph-burger{width:48px; height:42px; font-size:22px;}
  .ph-right{border-left:0;}
}

/* Small mobile: labels hide, only icons remain */
@media (max-width:480px){
  .ph-toplink{padding:0 10px; gap:0;}
  .ph-toplink .ph-label{display:none;}
  .ph-toplink .ph-ico{font-size:18px;}
}
