/*
Theme Name: TACHY Micro (DB)
Theme URI: https://tachy.in/tools/micro
Author: TACHY
Author URI: https://tachy.in
Description: Mobile-first, Twitter-like news feed using core WP posts/categories/tags (+ optional State/City taxonomies). Includes Top Stories, Trending, Most Read, Live Feed. No heavy CSS/JS.
Version: 1.1.1
License: MIT
Text Domain: tachy-micro
*/

:root {
  --brand: #0d47a1;
  --ink: #0f172a;
  --muted: #6b7280;
  --bg: #f6f7fb;
  --card: #ffffff;
  --border: #e5e7eb;
  --chip: #eef2ff;
  --shadow: 0 8px 24px rgba(2, 6, 23, .06);
  --rad: 14px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.55 system-ui, -apple-system, Segoe UI, Roboto, Ubuntu, Helvetica Neue, Arial, Noto Sans, sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a { color: inherit; text-decoration: none; }

.header {
  position: sticky; top: 0; z-index: 999;
  background: linear-gradient(90deg, var(--brand), #2563eb);
  color: #fff;
  border-bottom: 1px solid rgba(255,255,255,.15);
}
.header .bar {
  max-width: 1200px; margin: 0 auto; padding: 10px 14px;
  display: grid; grid-template-columns: auto 1fr auto; gap: 10px; align-items: center;
}
.brand a { display: inline-flex; align-items: center; gap: 8px; font-weight: 900; letter-spacing: .2px; }
.brand small { opacity: .9; font-weight: 600; }
.header .search { display: flex; gap: 8px; align-items: center; justify-self: center; }
.header .search input { width: 100%; max-width: 560px; border: 0; border-radius: 999px; padding: 10px 12px; }
.header .actions { display:flex; gap:8px; justify-self:end; align-items:center; }
.badge-btn { background:#fff; color:#111; padding:8px 12px; border-radius:999px; border:0; box-shadow: var(--shadow); font-weight:600; cursor:pointer; }

.menu-toggle { display:none; background:#fff; border:0; border-radius:10px; padding:6px 10px; }
.nav { display:flex; gap:14px; align-items:center; }
.nav a { color:#fff; opacity:.95; }
.nav a:hover { opacity: 1; text-decoration: underline; }

@media (max-width: 768px) {
  .header .bar { grid-template-columns: auto auto 1fr; }
  .header .search { display:none; }
  .menu-toggle { display:inline-block; }
}

.mobile-menu { display:none; background:#0b3fa1; }
.mobile-menu.open { display:block; }
.mobile-menu .wrap { max-width:1200px; margin:0 auto; padding:10px 14px; }
.mobile-menu a { display:inline-block; margin:6px 10px 6px 0; color:#fff; background:rgba(255,255,255,.12); padding:6px 10px; border-radius:999px; }

.container { max-width: 1200px; margin: 0 auto; padding: 0 14px; }
.layout { display: grid; grid-template-columns: 1fr; gap: 12px; margin-top: 12px; }
@media (min-width: 1024px) { .layout { grid-template-columns: 260px 1fr 260px; } }

.sidebar .box, .card, .post-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--rad);
  box-shadow: var(--shadow);
}
.box { padding: 10px 12px; }
.box h3 { margin:.1rem 0 .35rem; font-size:1.02rem; }

.list { display:flex; flex-direction:column; gap:6px; }
.list a { display:flex; justify-content:space-between; align-items:center; padding:6px 8px; border-radius:10px; }
.list a:hover { background:#f1f5f9; }
.count { color:#64748b; font-variant-numeric: tabular-nums; }

.chips { display:flex; gap:10px; flex-wrap:wrap; }
.chip { background: var(--chip); border:1px solid var(--border); padding:6px 10px; border-radius:999px; font-size:.95rem; }

.feed { display:flex; flex-direction:column; gap:10px; }
.post-card { padding: 10px 12px; border-left:3px solid var(--brand); }
.post-card .row { display:flex; gap:10px; align-items:center; flex-wrap:wrap; }
.avatar { width:36px; height:36px; border-radius:999px; background:#eff6ff; border:1px solid #dbeafe; display:flex; align-items:center; justify-content:center; font-weight:800; color:#1d4ed8; }
.post-card .title { font-weight:700; }
.post-card .desc { color: var(--muted); margin-top: 2px; }
.post-card .meta { display:flex; gap:8px; align-items:center; flex-wrap:wrap; margin-top:6px; }

.section { background: var(--card); border:1px solid var(--border); border-radius: var(--rad); box-shadow: var(--shadow); }
.section .head { padding: 10px 12px; border-bottom:1px solid var(--border); display:flex; align-items:center; justify-content:space-between; }
.section .grid { padding:10px 12px; display:grid; gap:10px; grid-template-columns:1fr; }
@media (min-width: 640px) { .section .grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1024px) { .section .grid { grid-template-columns: 1fr 1fr; } }

.top-story { padding:10px 12px; border-left:3px solid var(--brand); }
.top-story h4 { margin:.2rem 0 .1rem; font-size:1.02rem; }
.top-story p { margin:.1rem 0 0; color: var(--muted); }

.footer { padding: 22px 0; margin-top: 14px; color: #233; border-top:1px solid var(--border); }
.footer a { color:#0b53b7; font-weight:600; }

.sticky { position: sticky; top: 72px; }
@media(max-width:1023px) { .sticky { position: static; } }

.notice-bar {
  background: var(--card); border:1px solid var(--border); border-radius: var(--rad); box-shadow:var(--shadow);
  display:flex; gap:10px; align-items:center; justify-content:space-between; padding:10px 12px; margin-bottom:8px;
}
