:root{
  --bg:#ffffff;
  --text:#0f172a;
  --muted:#475569;
  --brand:#111827;
  --accent:#0ea5e9;
  --card:#ffffff;
  --border:#e5e7eb;
  --shadow:0 1px 2px rgba(0,0,0,.06), 0 2px 8px rgba(0,0,0,.04);
}

*{box-sizing:border-box}
html,body{margin:0;padding:0;background:var(--bg);color:var(--text);font-family: ui-sans-serif,system-ui,-apple-system,Segoe UI,Roboto,Arial}
img{max-width:100%;display:block}
a{text-decoration:none}

/* Header */
.site-header{
  display:grid;grid-template-columns: 1fr auto 1fr;align-items:center;
  padding:12px 18px;border-bottom:1px solid var(--border);background:#fff;
  position:sticky;top:0;z-index:50;gap:12px
}
.brand{justify-self:start}
.brand-link{display:flex;align-items:center;gap:10px}
.brand-logo{height:28px;width:auto;display:block}
.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}

.main-nav{justify-self:center;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.nav-btn{border:1px solid var(--border);background:#f8fafc;padding:6px 10px;border-radius:8px;cursor:pointer;color:var(--text);white-space:nowrap}
.nav-btn.active{background:var(--accent);color:#fff;border-color:var(--accent)}

.actions{justify-self:end;display:flex;gap:8px;align-items:center}
.nav-link{color:var(--text);border:1px solid var(--border);padding:6px 10px;border-radius:8px;background:#fff}
.nav-link:hover{text-decoration:underline}
.actions button{border:1px solid var(--border);background:#f8fafc;padding:6px 10px;border-radius:8px;cursor:pointer}

/* Optional: tiny accent for Dexscreener button (same style) */
.actions .dexscreener{
  border-color:#0ea5e9;
}
.actions .dexscreener:hover{
  background:#0ea5e9;color:#fff;
}

/* Mobile header stacking */
@media (max-width: 720px){
  .site-header{
    grid-template-columns: 1fr;
    grid-auto-rows: min-content;
    gap:10px;
  }
  .brand{justify-self:start}
  .main-nav{
    overflow-x:auto;white-space:nowrap;padding-bottom:4px;margin:0 -6px;padding:0 6px 4px;
    -webkit-overflow-scrolling: touch;scrollbar-width: thin;
  }
  .nav-btn{display:inline-block}
  .actions{justify-self:stretch;justify-content:flex-end}
}

/* Layout */
.container{max-width:1150px;margin:20px auto;padding:0 16px}
.notice{background:#fff7ed;border:1px solid #fed7aa;color:#9a3412;padding:8px 10px;border-radius:8px;margin-bottom:14px}

/* Grid cards */
.grid{
  display:grid;gap:18px;
  grid-template-columns:repeat(auto-fill,minmax(300px,1fr));
}
.card{
  background:var(--card);border:1px solid var(--border);border-radius:12px;overflow:hidden;box-shadow:var(--shadow);
  transition:transform .12s ease-in-out
}
.card:hover{transform:translateY(-2px)}
.thumb{display:block;width:100%;aspect-ratio:3/2;background:#f1f5f9}
.thumb img{width:100%;height:100%;object-fit:cover}

/* Meta */
.meta{padding:14px;display:flex;flex-direction:column;gap:8px}
.title{color:var(--text);font-weight:800;text-decoration:none;line-height:1.22;font-size:18px}
.title:hover{text-decoration:underline}
.byline{color:var(--muted);font-size:12.5px;display:flex;align-items:center;gap:6px}
.summary{color:var(--text);font-size:14.5px;line-height:1.35;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
.empty{padding:24px;color:var(--muted);border:1px dashed var(--border);border-radius:12px;text-align:center}

/* Article view */
.article-view .a-title{font-size:30px;line-height:1.15;margin:6px 0 8px;font-weight:800}
.article-view .byline{color:var(--muted);font-size:13.5px;margin-bottom:12px}
.hero{width:100%;max-width:920px;margin:0 auto 14px;border-radius:12px;overflow:hidden;border:1px solid var(--border);background:#f1f5f9}
.hero img{width:100%;height:auto;object-fit:contain}

.summary-block,.debate{
  background:#fff;border:1px solid var(--border);border-radius:12px;padding:14px;margin:16px 0;box-shadow:var(--shadow)
}
.summary-block h2,.debate h2{margin:0 0 10px;font-size:18px}
.voices{display:grid;gap:12px;grid-template-columns:repeat(auto-fit,minmax(260px,1fr))}
.voice h3{margin:0 0 6px;font-size:16px}
.voice p{margin:0;white-space:pre-wrap}

/* Page content (About) */
.page{background:#fff;border:1px solid var(--border);border-radius:12px;padding:16px;box-shadow:var(--shadow)}
.page h1{margin:0 0 10px}

/* Footer */
.site-footer{display:flex;justify-content:space-between;align-items:center;padding:12px 18px;background:#fff;border-top:1px solid var(--border)}

/* Share row under the image */
.share-row{
  display:flex;
  align-items:center;
  gap:10px;
  margin:10px 0 18px;
  flex-wrap:wrap;
}
.share-label{color:#475569}
.share-btn{
  border:1px solid var(--border);
  background:#f8fafc;
  padding:6px 10px;
  border-radius:8px;
  color:var(--text);
}
.share-btn:hover{text-decoration:underline}

/* Full article button under hero */
.full-article-row{
  max-width:920px;
  margin:0 auto 12px;
  display:flex;
  justify-content:flex-start;
}
.full-link{
  display:inline-block;
  border:1px solid var(--border);
  background:#f8fafc;
  padding:8px 12px;
  border-radius:10px;
  color:var(--text);
}
.full-link:hover{text-decoration:underline}

/* ===== Force single-row header on desktop ===== */
@media (min-width: 980px){
  /* 3 columns: brand | categories (center) | actions (right) */
  .site-header{
    display: grid;
    grid-template-columns: 220px 1fr 340px;
    grid-auto-rows: auto;
    align-items: center;
    gap: 12px;
  }

  .brand{ justify-self: start; }
  .main-nav{
    justify-self: center;
    justify-content: center;
    flex-wrap: nowrap;   /* keep categories on one line */
    overflow: visible;
  }
  .actions{
    justify-self: end;
    flex-wrap: nowrap;   /* keep buttons on one line */
  }

  /* prevent label text from wrapping and pushing to new lines */
  .actions .nav-link,
  .actions button{
    white-space: nowrap;
  }
}

/* Mobile header tidy: center logo, hide header actions & Refresh */
@media (max-width: 720px){
  .site-header{
    grid-template-columns: 1fr;
    text-align: center;
  }
  .brand{ justify-self: center; }
  .brand-link{ display:flex; justify-content:center; }
  .actions{ display: none; }    /* hides About / X / Dexscreener row on mobile */
  #refreshBtn{ display: none; } /* hides refresh on mobile */
}
