/* ClickLoom Demo Media Space — publisher site styles */
:root {
  --brand: #0ea5e9;
  --brand-2: #10b981;
  --ink: #0f172a;
  --ink-soft: #475569;
  --paper: #ffffff;
  --paper-soft: #f8fafc;
  --line: #e2e8f0;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
  background: var(--paper-soft);
  color: var(--ink);
  line-height: 1.8;
}

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

/* Top bar */
.site-top {
  background: linear-gradient(90deg, #0ea5e9, #10b981);
  color: #fff;
  padding: 14px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.site-top .logo { font-weight: 800; font-size: 18px; }
.site-top .tagline { font-size: 12px; opacity: .9; }
.site-top nav { display: flex; gap: 14px; font-size: 13px; }
.site-top nav a { color: #fff; opacity: .9; font-weight: 600; }
.site-top nav a:hover { opacity: 1; }

/* Demo badge */
.demo-badge {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff; color: #0f172a;
  border-radius: 999px; padding: 4px 12px; font-size: 11px; font-weight: 700;
}

/* Layout */
.page { max-width: 1080px; margin: 0 auto; padding: 20px 24px 120px; }
.leaderboard-slot { display: flex; justify-content: center; margin-bottom: 20px; }
.grid-main { display: grid; grid-template-columns: 1fr 320px; gap: 24px; }
.grid-main.single { grid-template-columns: 1fr; }

/* Article */
h1.title { font-size: 26px; line-height: 1.5; margin-bottom: 6px; }
.meta { color: var(--ink-soft); font-size: 12px; margin-bottom: 18px; }
.article-body { font-size: 15px; color: var(--ink-soft); }
.article-body p { margin-bottom: 14px; }
.article-body h2 { color: var(--ink); font-size: 19px; margin: 22px 0 10px; }

/* Sidebar */
.sidebar { display: flex; flex-direction: column; gap: 20px; }
.card {
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px;
}
.card h3 { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; }

/* Zone label */
.zone-label {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 10px; color: #94a3b8; margin: 0 0 4px;
  letter-spacing: .4px;
}
.zone-label .dot { width: 7px; height: 7px; border-radius: 50%; background: #cbd5e1; }
.zone-label .dot.live { background: #22c55e; }
.zone-label .dot.fallback { background: #f59e0b; }
.zone-label .dot.error { background: #ef4444; }
.zone-box { background: var(--paper); border: 1px dashed var(--line); border-radius: 14px; min-height: 40px; }

/* Native feed */
.feed-item {
  display: flex; gap: 14px; align-items: center;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 14px; padding: 12px; margin-bottom: 14px;
}
.feed-item img { width: 92px; height: 92px; border-radius: 10px; object-fit: cover; }
.feed-item .title { font-weight: 700; font-size: 14px; margin-bottom: 4px; }
.feed-item .excerpt { font-size: 12px; color: var(--ink-soft); }

/* Rewards page */
.reward-card {
  max-width: 420px; margin: 0 auto; text-align: center;
  background: var(--paper); border: 1px solid var(--line);
  border-radius: 20px; padding: 24px;
}
.reward-card .coins { font-size: 40px; margin-bottom: 8px; }
.reward-card .desc { font-size: 13px; color: var(--ink-soft); margin-bottom: 16px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--line); background: var(--paper);
  padding: 18px 24px; text-align: center; font-size: 12px; color: var(--ink-soft);
}

/* ── Diagnostics panel (bottom-right) ─────────────────────── */
.diag-toggle {
  position: fixed; right: 16px; bottom: 16px; z-index: 100;
  background: var(--ink); color: #fff; border: 0; border-radius: 999px;
  padding: 10px 16px; font-size: 12px; font-weight: 700; cursor: pointer;
  box-shadow: 0 8px 24px rgba(15,23,42,.25); font-family: inherit;
}
.diag-panel {
  position: fixed; right: 16px; bottom: 64px; z-index: 99;
  width: 400px; max-width: calc(100vw - 32px); max-height: 60vh;
  background: #0f172a; color: #e2e8f0; border-radius: 16px;
  box-shadow: 0 20px 60px rgba(15,23,42,.4);
  display: flex; flex-direction: column; overflow: hidden;
  font-family: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
}
.diag-panel.hidden { display: none; }
.diag-head { padding: 12px 14px; border-bottom: 1px solid #1e293b; font-size: 13px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.diag-head small { color: #64748b; font-weight: 400; }
.diag-health { display: flex; gap: 8px; padding: 10px 14px; border-bottom: 1px solid #1e293b; flex-wrap: wrap; }
.health-chip {
  display: flex; align-items: center; gap: 6px;
  background: #1e293b; border-radius: 999px; padding: 4px 10px; font-size: 11px;
}
.health-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: #64748b; }
.health-chip .dot.ok { background: #22c55e; }
.health-chip .dot.bad { background: #ef4444; }
.health-chip .dot.checking { background: #f59e0b; }
.diag-zones { padding: 8px 14px; border-bottom: 1px solid #1e293b; font-size: 11px; }
.diag-zones .zrow { display: flex; justify-content: space-between; padding: 2px 0; color: #94a3b8; }
.diag-zones .zrow .ok { color: #22c55e; }
.diag-zones .zrow .bad { color: #ef4444; }
.diag-zones .zrow .warn { color: #f59e0b; }
.diag-log { flex: 1; overflow-y: auto; padding: 8px 14px 12px; font-size: 11px; font-family: Consolas, Menlo, monospace; direction: ltr; text-align: left; }
.diag-log .entry { padding: 3px 0; border-bottom: 1px solid #16202e; color: #94a3b8; word-break: break-all; }
.diag-log .entry .t { color: #475569; margin-right: 6px; }
.diag-log .entry.bid-req { color: #38bdf8; }
.diag-log .entry.bid-res { color: #4ade80; }
.diag-log .entry.render { color: #c084fc; }
.diag-log .entry.impression { color: #fbbf24; }
.diag-log .entry.click { color: #fb7185; }
.diag-log .entry.error { color: #f87171; }
