/*
Theme Name: GeneratePress Child (NepalTechHub)
Template: generatepress
Description: Final CSS with advanced styling, CLS-safe ads, and dark-mode polish
*/

/* ================== TOKENS & RESETS ================== */
:root{
  --gap: 12px;
  --radius: 12px;
  --card-bg: #ffffff;
  --muted-bg: #f8fafc;
  --border: #e5e7eb;
  --text: #0f172a;
  --brand: #2563eb;
  --accent: #22c55e;
}
img{ display:block; max-width:100%; height:auto; }

/* ================== COMMON ================== */
.nth-section{ margin:26px 0; }
.nth-section h2{
  font-size:22px; line-height:1.3; margin:0 0 12px; font-weight:800;
}
.nth-ul{ margin:0 0 0 20px; padding:0; }
.nth-ul li{ margin:6px 0; }
.muted{ color:#64748b; }
.muted.small{ font-size:13px; }

/* Generic buttons (reused in cards/hero) */
.btn{
  display:inline-block; padding:10px 14px; border-radius:12px;
  font-weight:700; text-decoration:none; outline:none;
  transition:transform .08s ease, box-shadow .2s ease, background-color .2s;
}
.btn-outline{ background:#fff; color:var(--brand); border:1px solid var(--brand); }
.btn-outline:hover{ background:var(--brand); color:#fff; transform:translateY(-1px); }
.btn-ghost{ background:#eef2ff; color:#1f2937; border:1px solid #e5e7eb; }
.btn-ghost:hover{ background:#e0e7ff; transform:translateY(-1px); }

/* ================== PROS & CONS ================== */
.nth-pros-cons .nth-cols{
  display:grid; grid-template-columns:1fr 1fr; gap:16px;
}
.nth-pros-cons .nth-cols > div{
  background:var(--muted-bg); border:1px solid var(--border);
  border-radius:14px; padding:12px;
}
.nth-pros-cons h3{ margin:0 0 8px; font-size:16px; }
@media (max-width:768px){
  .nth-pros-cons .nth-cols{ grid-template-columns:1fr; }
}

/* ================== GALLERY ================== */
.nth-gallery{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(200px,1fr));
  gap:12px; margin-top:12px;
}
.nth-gallery img{ width:100%; height:auto; border-radius:6px; }

/* ================== SELLER LINKS ================== */
.nth-seller-links a{
  display:inline-block; margin:0 12px 12px 0;
  color:#0b66c3; text-decoration:underline;
}

/* ================== FAQ ================== */
.nth-faq details{ margin-bottom:12px; }
.nth-faq summary{ font-weight:700; cursor:pointer; }

/* ================== PHONE HERO / HEADER ================== */
.phone-hero{
  display:grid; grid-template-columns:120px 1fr; gap:14px;
  align-items:center; margin:14px 0 22px;
}
.phone-hero img{
  width:120px; height:120px; object-fit:cover; aspect-ratio:1/1;
  border-radius:16px; box-shadow:0 6px 18px rgba(0,0,0,.08);
}
.phone-hero .title{ font-size:28px; font-weight:800; line-height:1.15; margin:0; }
.meta-badges{
  display:flex; flex-wrap:wrap; gap:8px; margin-top:6px;
}
.badge{
  font-size:12px; padding:6px 10px; border-radius:999px;
  background:#f4f6fb; border:1px solid #e8ebf6;
}
.badge.positive{ background:#e8f8ee; border-color:#ccefdc; }
.badge.neutral{ background:#eef2ff; border-color:#e0e7ff; }
.badge.danger{ background:#fee2e2; border-color:#fecaca; }
@media (max-width:720px){
  .phone-hero{ grid-template-columns:80px 1fr; }
  .phone-hero img{ width:80px; height:80px; border-radius:12px; }
  .phone-hero .title{ font-size:22px; }
}

/* ================== PRICE CARD / CTA ================== */
.price-card{
  display:flex; flex-wrap:wrap; gap:12px; align-items:center;
  background:#0f172a; color:#fff; border-radius:16px;
  padding:14px 16px; margin:16px 0;
}
.price-card strong{ font-size:18px; }
.price-card .btn{
  background:var(--accent); color:#072b1a; font-weight:700;
  padding:10px 14px; border-radius:12px; text-decoration:none; display:inline-block;
  transition:transform .08s ease, box-shadow .2s ease, background-color .2s;
  outline:none;
}
.price-card .btn.secondary{ background:#ffffff; color:#0f172a; }
.price-card .btn:hover{ transform:translateY(-1px); }
.price-card .btn:focus-visible{
  box-shadow:0 0 0 3px rgba(37,99,235,.25);
  outline:2px solid var(--brand); outline-offset:2px;
}

/* Small price row used on compare cards */
.price-row{
  display:grid; grid-template-columns:repeat(2, minmax(0,1fr)); gap:8px; margin:8px 0 6px;
}
.price-row .lbl{ display:block; font-size:12px; color:#64748b; }
.price-row .val{ font-weight:700; }

/* ================== STICKY CTA ================== */
.sticky-cta{
  position:sticky;
  bottom:calc(env(safe-area-inset-bottom, 0px) + 12px);
  z-index:30; display:flex; gap:10px; justify-content:flex-end;
}
.sticky-cta a{
  background:#2563eb; color:#fff; padding:10px 14px;
  border-radius:12px; text-decoration:none;
  transition:transform .08s ease, box-shadow .2s ease, background-color .2s;
  outline:none;
}
.sticky-cta a:hover{ transform:translateY(-1px); }
.sticky-cta a:focus-visible{
  box-shadow:0 0 0 3px rgba(37,99,235,.25);
  outline:2px solid var(--brand); outline-offset:2px;
}

/* ================== SPECS TABLE ================== */
.specs-table{
  width:100%; border-collapse:separate; border-spacing:0; margin-top:8px;
  overflow:hidden; border-radius:var(--radius);
}
.specs-table th, .specs-table td{
  padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:top;
}
.specs-table th{
  width:36%; background:#f9fafb; font-weight:600;
}
.specs-table tr:nth-child(even) td{ background:#fbfdff; }

/* ================== VARIANT TABLE ================== */
.variant-table{
  width:100%; border-collapse:separate; border-spacing:0;
  overflow:hidden; border-radius:var(--radius);
}
.variant-table thead th{ background:#f1f5f9; font-weight:700; }
.variant-table th, .variant-table td{
  padding:10px; border-bottom:1px solid #eef2f7;
}
.variant-table tr:nth-child(even) td{ background:#fbfdff; }

/* ================== COMPARE UI ================== */
.compare-wrapper{
  display:grid; grid-template-columns:repeat(auto-fill, minmax(240px,1fr));
  gap:var(--gap); margin:16px 0;
}
.compare-card{
  border:1px solid #eee; border-radius:10px; padding:12px; background:#fff;
  box-shadow:0 1px 3px rgba(0,0,0,.06); transition:box-shadow .25s ease;
}
.compare-card:hover{ box-shadow:0 6px 18px rgba(0,0,0,.12); }
.compare-card img{ width:100%; height:auto; border-radius:8px; }
.compare-card h2{ font-size:18px; margin:0 0 8px; line-height:1.3; }
.compare-card h2 a{ color:#111; text-decoration:none; }
.compare-card p{ margin:6px 0; font-size:15px; color:#444; }
.compare-card p strong{ color:#000; }

/* Highlight differences */
.is-diff{
  background:linear-gradient(90deg, rgba(99,102,241,.06), white);
  transition:background .3s ease;
}

/* Compare table (AJAX output) */
.nth-table-wrap{ overflow:auto; -webkit-overflow-scrolling:touch; }
.nth-compare-table{
  width:100%; border-collapse:separate; border-spacing:0; border-radius:12px; overflow:hidden;
}
.nth-compare-table th, .nth-compare-table td{
  padding:10px 12px; border-bottom:1px solid var(--border); vertical-align:top;
}
.nth-compare-table thead th{ background:#f1f5f9; font-weight:700; }
.nth-compare-table tbody tr:nth-child(even) td{ background:#fbfdff; }

/* Badges used on cards (new/trending/best) */
.nth-badges{ display:flex; gap:6px; margin-bottom:6px; }
.nth-badge{
  font-size:11px; padding:4px 8px; border-radius:999px; border:1px solid #e5e7eb; background:#fff;
}
.nth-badge.is-new{ background:#ecfeff; border-color:#cffafe; color:#0369a1; }
.nth-badge.is-hot{ background:#fff1f2; border-color:#ffe4e6; color:#be123c; }
.nth-badge.is-best{ background:#ecfdf5; border-color:#bbf7d0; color:#065f46; }

/* Toast used by compare.js */
.nth-toast{
  position:fixed; left:50%; bottom:18px; transform:translateX(-50%) translateY(12px);
  background:#111827; color:#fff; padding:10px 14px; border-radius:999px;
  opacity:0; pointer-events:none; transition:opacity .2s, transform .2s; z-index:9999;
}
.nth-toast.show{ opacity:1; transform:translateX(-50%) translateY(0); }
.nth-toast.is-err{ background:#991b1b; }

/* ================== SELECTS / BUTTON (Compare page) ================== */
.phone-select{
  padding:6px 12px; font-size:16px; border:1px solid #ccc; border-radius:4px;
}
#compare-btn{
  padding:8px 16px; font-size:16px; background:#0073aa; color:#fff;
  border:0; border-radius:4px; cursor:pointer;
  transition:transform .08s ease, box-shadow .2s ease;
  outline:none;
}
#compare-btn:hover{ background:#005f8d; transform:translateY(-1px); }
#compare-btn:focus-visible{
  box-shadow:0 0 0 3px rgba(37,99,235,.25);
  outline:2px solid var(--brand); outline-offset:2px;
}

/* ================== BASIC TABLE RESET INSIDE SECTIONS ================== */
.nth-section table{ width:100%; border-collapse:collapse; }
.nth-section th, .nth-section td{
  text-align:left; padding:8px; border-bottom:1px solid #ddd;
}
.nth-section th{ background:#f9f9f9; font-weight:600; }

/* GeneratePress: separate container हरू सेतो नदेखियोस् */
.separate-containers .inside-article,
.separate-containers .sidebar .widget,
.separate-containers .comments-area{ background:transparent; }

/* ================== ADS: LAYOUT STABILITY (CLS) ================== */
.ad-wrap{ display:block; margin:16px 0; }
.ad-wrap > ins.adsbygoogle{
  display:block;
  min-height:250px;
}
@media (min-width:768px){
  .ad-wrap > ins.adsbygoogle{ min-height:280px; }
}
.ad--labeled{ position:relative; }
.ad--labeled::before{
  content:"Advertisement";
  position:absolute; top:-10px; right:0;
  font-size:12px; color:#64748b; background:#fff;
  padding:2px 6px; border-radius:999px; border:1px solid var(--border);
}

/* ================== DARK MODE (auto) ================== */
@media (prefers-color-scheme: dark){
  :root{
    --card-bg:#0b1220; --muted-bg:#0e1627; --border:#21304a; --text:#e6edf7;
  }
  body{ color:var(--text); }
  .compare-card{ background:var(--card-bg); border-color:var(--border); }
  .nth-pros-cons .nth-cols > div{ background:var(--muted-bg); border-color:var(--border); }
  .specs-table th{ background:#0e172a; color:#e6edf7; }
  .nth-compare-table thead th{ background:#0e172a; color:#e6edf7; }
  .price-card{ background:#0b1220; color:#e6edf7; }
  .badge{ border-color:var(--border); }
  .btn-ghost{ background:#0e1627; border-color:#21304a; color:#e6edf7; }
}

/* --- Brand wise list page --- */
.nth-brand-index{
  display:flex; flex-wrap:wrap; gap:10px; margin:8px 0 16px;
}
.nth-brand-index a{
  display:inline-block; padding:8px 12px; border:1px solid #e5e7eb;
  border-radius:999px; text-decoration:none; color:#0f172a; background:#fff;
}
.nth-brand-index a:hover{ background:#f8fafc; }

.brand-section{ margin:22px 0; }
.brand-title{ font-size:22px; font-weight:800; margin:0 0 10px; }

.brand-list{ list-style:none; margin:0; padding:0; border:1px solid #eef2f7; border-radius:12px; overflow:hidden; }
.brand-list .brand-item,
.brand-list .ad-li{
  display:flex; justify-content:space-between; align-items:center;
  padding:10px 12px; border-bottom:1px solid #eef2f7; background:#fff;
}
.brand-list .brand-item a{ color:#111; text-decoration:none; }
.brand-list .brand-item:hover{ background:#fafafa; }
.brand-list .brand-item .price{ color:#0f172a; font-weight:600; }
.brand-list li:last-child{ border-bottom:0; }

.brand-list .ad-li{ background:#f9fafb; }
.brand-list .ad-li .nth-ad{ margin:8px auto; }