:root{
  --bg:#f6f7fb;
  --card:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --brand:#0ea5e9;
  --border:rgba(15,23,42,.12);
  --header-bg:rgba(255,255,255,.85);
  --input-bg:rgba(15,23,42,.04);
  --badge-bg:rgba(15,23,42,.04);
  --shadow:0 8px 30px rgba(15,23,42,.06);
}

body[data-theme="dark"]{
  --bg:#0b0f19;
  --card:#0f172a;
  --text:#e5e7eb;
  --muted:#94a3b8;
  --brand:#38bdf8;
  --border:rgba(148,163,184,.2);
  --header-bg:rgba(11,18,32,.85);
  --input-bg:rgba(255,255,255,.04);
  --badge-bg:rgba(255,255,255,.03);
  --shadow:none;
}

*{box-sizing:border-box}
html,body{
  margin:0;
  padding:0;
  font-family:system-ui,-apple-system,Segoe UI,Roboto,Arial,'Tajawal',sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.7
}
a{color:var(--brand);text-decoration:none}
a:hover{text-decoration:underline}

.container{max-width:1100px;margin:0 auto;padding:16px}

.header{
  position:sticky;
  top:0;
  background:var(--header-bg);
  backdrop-filter:blur(10px);
  border-bottom:1px solid var(--border);
  z-index:10
}

.header-inner{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  padding:10px 0
}

/* Brand / Logo */
.brand{
  display:flex;
  align-items:center;
  gap:10px;
  font-weight:800;
  text-decoration:none;
}

.logo{
  height:44px;
  width:auto;
  max-width:220px;
  object-fit:contain;
  display:block;
}

/* Modes */
.brand--logo_only .brand-name{display:none;}
.brand--text_only .logo{display:none;}

.brand-name{
  font-size:18px;
  font-weight:800;
  line-height:1;
}

.sr-only{
  position:absolute;
  width:1px;
  height:1px;
  padding:0;
  margin:-1px;
  overflow:hidden;
  clip:rect(0,0,0,0);
  white-space:nowrap;
  border:0;
}

.search{display:flex;gap:8px;align-items:center}
.search input{
  width:260px;
  max-width:50vw;
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:var(--input-bg);
  color:var(--text)
}
.search button{
  padding:10px 12px;
  border-radius:12px;
  border:1px solid var(--border);
  background:rgba(56,189,248,.15);
  color:var(--text);
  cursor:pointer
}

.grid{display:grid;grid-template-columns:1fr 320px;gap:16px}
@media(max-width:920px){
  .grid{grid-template-columns:1fr}
  .search input{width:180px}
}

.card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:18px;
  padding:16px;
  box-shadow:var(--shadow)
}

.post-title{margin:0 0 8px 0;font-size:22px}
.meta{color:var(--muted);font-size:13px}
.post-excerpt{color:var(--text);opacity:.9;margin:10px 0 0 0}

.badges{display:flex;flex-wrap:wrap;gap:8px}
.badge{
  display:inline-block;
  padding:6px 10px;
  border-radius:999px;
  border:1px solid var(--border);
  background:var(--badge-bg);
  color:var(--text);
  font-size:13px
}

.footer{border-top:1px solid var(--border);margin-top:30px;padding:20px 0;color:var(--muted);font-size:13px}

@media (max-width: 640px){
  .logo{height:38px;max-width:160px;}
  .brand-name{font-size:18px;}
}
