:root{
  --max: 1120px;
  --radius: 14px;
  --radius2: 18px;
  --shadow: 0 12px 30px rgba(0,0,0,.25);

  /* Dark */
  --bg:#0b0f17;
  --bg-grad-1: rgba(124,58,237,.35);
  --bg-grad-2: rgba(34,197,94,.25);
  --panel: rgba(17,24,39,.92);
  --panel2: rgba(15,23,42,.88);
  --text:#e5e7eb;
  --muted:#a3aab8;
  --line: rgba(255,255,255,.10);

  --accent:#7c3aed;
  --accent2:#22c55e;
  --amber:#f59e0b;

  --btn-bg: rgba(124,58,237,.18);
  --btn-border: rgba(124,58,237,.35);

  --ghost-bg: rgba(255,255,255,.03);
  --ghost-border: rgba(255,255,255,.10);

  --input-bg: rgba(255,255,255,.03);
  --topbar-bg: rgba(11,15,23,.72);
}

html[data-theme="light"]{
  --bg:#f7f8fb;
  --bg-grad-1: rgba(124,58,237,.12);
  --bg-grad-2: rgba(34,197,94,.10);
  --panel: rgba(255,255,255,.92);
  --panel2: rgba(255,255,255,.86);
  --text:#0f172a;
  --muted:#475569;
  --line: rgba(15,23,42,.12);

  --btn-bg: rgba(124,58,237,.10);
  --btn-border: rgba(124,58,237,.25);

  --ghost-bg: rgba(15,23,42,.03);
  --ghost-border: rgba(15,23,42,.12);

  --input-bg: rgba(15,23,42,.03);
  --topbar-bg: rgba(247,248,251,.70);

  --shadow: 0 12px 30px rgba(2,6,23,.10);
}

*{box-sizing:border-box}
body{
  margin:0;
  font-family: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial;
  background:
    radial-gradient(1000px 600px at 20% -10%, var(--bg-grad-1), transparent 60%),
    radial-gradient(900px 500px at 80% 0%, var(--bg-grad-2), transparent 55%),
    var(--bg);
  color:var(--text);
  line-height:1.5;
}
a{color:inherit; text-decoration:none}
.wrap{max-width:var(--max); margin:0 auto; padding:22px 18px 80px}

.topbar {
  position: relative;
}

.topbar-inner{
  max-width:var(--max); margin:0 auto; padding:14px 18px;
  display:flex; align-items:center; justify-content:space-between; gap:14px;
}
.brand{display:flex; align-items:center; gap:12px; min-width:220px}
.mark{
  width:36px; height:36px; border-radius:12px;
  background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(34,197,94,.85));
  box-shadow: 0 10px 20px rgba(124,58,237,.18);
  display:grid; place-items:center;
  border:1px solid rgba(255,255,255,.12);
  position:relative;
}
html[data-theme="light"] .mark{border:1px solid rgba(15,23,42,.12)}
.mark:before{
  content:"";
  width:16px; height:16px;
  border-radius:4px;
  background: rgba(255,255,255,.90);
  clip-path: polygon(0 70%, 70% 70%, 70% 0, 100% 0, 100% 100%, 0 100%);
  opacity:.95;
}
.brand h1{font-size:15px; margin:0; letter-spacing:.3px}
.brand p{margin:2px 0 0; font-size:12px; color:var(--muted)}

nav{display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end}
nav a{
  font-size:13px; color:var(--muted);
  padding:8px 10px; border-radius:12px;
  border:1px solid transparent;
}
nav a:hover{color:var(--text); border-color: var(--line); background: var(--ghost-bg)}
.nav-active{color:var(--text) !important; border-color: var(--line) !important; background: var(--ghost-bg) !important}

.btn{
  display:inline-flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:12px;
  background: var(--btn-bg);
  border: 1px solid var(--btn-border);
  color: var(--text);
  cursor:pointer;
}
.btn:hover{filter:brightness(1.05)}
.btn small{color:rgba(163,170,184,.95)}
html[data-theme="light"] .btn small{color:rgba(71,85,105,.95)}

.toggle{
  display:inline-flex; align-items:center; gap:10px;
  padding:10px 12px; border-radius:12px;
  background: var(--ghost-bg);
  border:1px solid var(--ghost-border);
  color: var(--text);
  cursor:pointer;
  font-size:13px;
}
.toggle:hover{filter:brightness(1.03)}
.toggle .icon{width:16px; height:16px; display:inline-block}

.card{
  background: linear-gradient(180deg, var(--panel), var(--panel2));
  border:1px solid var(--line);
  border-radius: var(--radius2);
  box-shadow: var(--shadow);
}

.hero{
  margin-top:18px;
  display:grid; grid-template-columns: 1.25fr .75fr;
  gap:18px;
  align-items:stretch;
}
@media (max-width: 960px){ .hero{grid-template-columns: 1fr;} }
.hero-main{padding:26px}
.kicker{
  display:inline-flex; align-items:center; gap:10px;
  font-size:12px; border:1px solid var(--line);
  background: var(--ghost-bg);
  padding:8px 10px; border-radius:999px;
  color: var(--muted);
}
.dot{
  width:8px; height:8px; border-radius:999px;
  background: var(--accent2);
  box-shadow: 0 0 0 4px rgba(34,197,94,.12);
}
.hero h2{margin:14px 0 10px; font-size:36px; line-height:1.08; letter-spacing:-.5px}
.hero p.lead{margin:0 0 18px; color: var(--muted); font-size:15px; max-width:68ch}
.hero-actions{display:flex; gap:10px; flex-wrap:wrap; margin-top:16px}
.primary{
  background: linear-gradient(135deg, rgba(124,58,237,.95), rgba(124,58,237,.60));
  border: 1px solid rgba(255,255,255,.12);
  color:#fff;
}
html[data-theme="light"] .primary{border:1px solid rgba(124,58,237,.18)}
.ghost{background: var(--ghost-bg); border:1px solid var(--ghost-border); color:var(--text)}
.hero-aside{padding:18px}
.aside-grid{display:grid; gap:12px}
.mini{
  padding:14px; border-radius: var(--radius);
  border:1px solid var(--line);
  background: var(--ghost-bg);
}
.mini h3{margin:0 0 6px; font-size:13px}
.mini p{margin:0; font-size:12px; color:var(--muted)}
.badge-row{display:flex; gap:8px; flex-wrap:wrap; margin-top:10px}
.badge{
  font-size:11px; padding:6px 8px; border-radius:999px;
  border:1px solid var(--line);
  background: var(--ghost-bg);
  color: var(--muted);
}

section{margin-top:22px}
.section-head{display:flex; align-items:flex-end; justify-content:space-between; gap:12px; margin: 6px 2px 12px}
.section-head h3{margin:0; font-size:16px; letter-spacing:.2px}
.section-head p{margin:0; color:var(--muted); font-size:12px}

.grid3{display:grid; grid-template-columns: repeat(3, 1fr); gap:12px}
@media (max-width: 960px){ .grid3{grid-template-columns: 1fr} }

.item{
  padding:16px;
  border-radius: var(--radius2);
  border:1px solid var(--line);
  background: var(--ghost-bg);
}
.item-top{display:flex; align-items:flex-start; justify-content:space-between; gap:10px; margin-bottom:10px}
.tag{
  font-size:11px; padding:6px 8px; border-radius:999px;
  border:1px solid var(--line);
  color: var(--muted);
  background: var(--ghost-bg);
  white-space:nowrap;
}
.tag.green{border-color: rgba(34,197,94,.35); background: rgba(34,197,94,.12); color: var(--text)}
.tag.purple{border-color: rgba(124,58,237,.35); background: rgba(124,58,237,.12); color: var(--text)}
.tag.amber{border-color: rgba(245,158,11,.35); background: rgba(245,158,11,.12); color: var(--text)}
.item h4{margin:0; font-size:14px}
.meta{margin:8px 0 0; font-size:12px; color: var(--muted)}
.meta strong{color: var(--text); font-weight:600}
.item p{margin:10px 0 0; font-size:13px; color: var(--muted)}
.links{display:flex; gap:10px; flex-wrap:wrap; margin-top:12px}
.link{
  font-size:12px;
  padding:8px 10px; border-radius:12px;
  border:1px solid var(--ghost-border);
  background: var(--ghost-bg);
  color: var(--text);
  display:inline-flex; align-items:center; gap:8px;
}
.link:hover{filter:brightness(1.03)}

.split{display:grid; grid-template-columns: 1fr 1fr; gap:12px}
@media (max-width: 960px){ .split{grid-template-columns: 1fr} }

.quote{
  padding:18px;
  border-radius: var(--radius2);
  border:1px solid rgba(124,58,237,.25);
  background: linear-gradient(180deg, rgba(124,58,237,.12), var(--ghost-bg));
}
.quote blockquote{margin:0; font-size:14px; color: var(--text)}
.quote footer{margin-top:10px; color: var(--muted); font-size:12px}

.filters{display:flex; gap:10px; flex-wrap:wrap; margin: 10px 0 12px}
.pill{
  font-size:12px;
  padding:8px 10px;
  border-radius:999px;
  border:1px solid var(--ghost-border);
  background: var(--ghost-bg);
  color: var(--muted);
  cursor:pointer;
  user-select:none;
}
.pill.active{
  border-color: rgba(124,58,237,.35);
  background: rgba(124,58,237,.12);
  color: var(--text);
}

input[type="search"], input[type="email"], select{
  padding:12px 12px;
  border-radius: 12px;
  border:1px solid var(--ghost-border);
  background: var(--input-bg);
  color: var(--text);
  outline:none;
}
input::placeholder{color: rgba(163,170,184,.95)}
html[data-theme="light"] input::placeholder{color: rgba(71,85,105,.9)}

.toolbar{display:flex; gap:10px; flex-wrap:wrap; align-items:center}
.toolbar .grow{flex:1 1 260px}

.footer{
  margin-top:28px;
  padding:18px;
  border-top:1px solid var(--line);
  color: var(--muted);
  font-size:12px;
  display:flex; gap:10px; flex-wrap:wrap;
  justify-content:space-between; align-items:center;
}
.footer a:hover{text-decoration:underline}

@media (prefers-reduced-motion: reduce){
  *{scroll-behavior:auto !important; transition:none !important}
}

.hero-actions { display:flex; gap:12px; flex-wrap:wrap; margin-top:14px; }

/* Resources section layout (headers + card grid) */
.section-stack{
  display:flex;
  flex-direction:column;
  gap:16px;
}

.res-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap:14px;
}

.res-head{
  display:flex;
  align-items:baseline;
  justify-content:space-between;
  gap:12px;
  margin-bottom:10px;
}

.res-head h3{ margin:0; }
.res-sub{ margin:0; opacity:.8; }

@media (max-width: 980px){
  .res-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .res-grid{ grid-template-columns: 1fr; }
}

/* Resources: section headers + grid like tools page */
.res-section{
  margin-top: 6px;
}

.res-section + .res-section{
  margin-top: 18px;
}

.res-section-head{
  display:flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin: 6px 0 12px;
}

.res-h3{
  margin: 0;
}

.res-sub{
  margin: 4px 0 0;
  opacity: .85;
}

.res-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

/* Responsive */
@media (max-width: 980px){
  .res-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px){
  .res-grid{ grid-template-columns: 1fr; }
}

/* Voices page polish */
.voices-form{
  display:grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 16px;
  align-items:start;
}

.voices-form .field{ display:flex; flex-direction:column; gap:8px; }
.voices-form .field.full{ grid-column: 1 / -1; }

.voices-form label{
  font-weight: 700;
  font-size: 0.95rem;
  opacity: .95;
}

.voices-form input{
  width: 100%;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(255,255,255,.12);
  background: rgba(0,0,0,.25);
  color: inherit;
}

.voices-form .actions{
  grid-column: 1 / -1;
  display:flex;
  gap: 10px;
  justify-content:flex-end;
  padding-top: 6px;
}

/* Latest voices styling */
.voices-feed{ display:flex; flex-direction:column; gap: 12px; }

.voice-post{
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  border-radius: 14px;
  padding: 14px 14px 12px;
}

.voice-post h3{ margin: 0 0 6px; }
.voice-post .meta{
  display:flex;
  gap:10px;
  opacity:.8;
  font-size: .9rem;
  margin-bottom: 10px;
}

.voice-post .content :first-child{ margin-top: 0; }
.voice-post .content :last-child{ margin-bottom: 0; }

/* Responsive */
@media (max-width: 820px){
  .voices-form{ grid-template-columns: 1fr; }
  .voices-form .actions{ justify-content:stretch; }
  .voices-form .actions .btn{ flex:1; }
}

.prompt-panel{
  margin: 10px 0 16px;
  padding: 14px;
  border-radius: 14px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.15);
}

.prompt-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:12px;
  margin-bottom: 10px;
}

.prompt-head h4{ margin:0; }

.prompt-grid{
  display:grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
}

.prompt-card{
  text-align:left;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(0,0,0,.18);
  cursor:pointer;
}

.prompt-card:hover{
  border-color: rgba(255,255,255,.18);
  background: rgba(0,0,0,.24);
}

.prompt-card .tag{
  display:inline-block;
  font-size: .8rem;
  opacity: .8;
  margin-bottom: 6px;
}

.prompt-card .title{
  font-weight: 800;
  margin: 0 0 6px;
}

.prompt-card .desc{
  margin: 0;
  opacity: .9;
  font-size: .95rem;
}

@media (max-width: 900px){
  .prompt-grid{ grid-template-columns: 1fr; }
}

/* News Feed */
.page-hero { padding: 24px 0 10px; }
.muted { opacity: .8; }

.news-controls{
  display:flex;
  gap:12px;
  align-items:center;
  justify-content:space-between;
  flex-wrap:wrap;
  margin-top:14px;
}

.news-search input{
  min-width: 280px;
  width: min(520px, 100%);
  padding: 10px 12px;
  border-radius: 12px;
}

.news-actions{
  display:flex;
  gap:10px;
  align-items:center;
}

.select{
  padding: 10px 12px;
  border-radius: 12px;
}

.news-grid{
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px 0 22px;
}

@media (max-width: 900px){
  .news-grid{ grid-template-columns: 1fr; }
}

.news-card-head{
  display:flex;
  align-items:center;
  justify-content:space-between;
  gap:10px;
  margin-bottom: 10px;
}

.news-source{
  display:flex;
  align-items:center;
  gap:8px;
}

.news-source-link{ font-weight: 700; text-decoration: none; }
.news-date{ opacity: .75; font-size: .9rem; }
.news-title{ margin: 8px 0; }
.news-title a{ text-decoration: none; }
.news-desc{ margin: 0; opacity: .9; line-height: 1.35; }

.btn.small{
  padding: 8px 10px;
  border-radius: 10px;
  font-size: .9rem;
}
/* ==============================
   Uniform News Feed Cards
   ============================== */

.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  .news-grid {
    grid-template-columns: 1fr;
  }
}

/* Force identical card height */
.news-card {
  height: 340px;                 /* Adjust if you want taller/shorter */
  display: flex;
  flex-direction: column;
  padding: 18px;
}

/* Keep header tight */
.news-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.9rem;
}

/* Clamp title to 2 lines */
.news-title {
  margin: 10px 0 8px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Clamp description to 4 lines */
.news-desc {
  flex-grow: 1;                  /* Pushes footer down */
  display: -webkit-box;
  -webkit-line-clamp: 4;         /* Controls how much preview text */
  -webkit-box-orient: vertical;
  overflow: hidden;
  opacity: 0.9;
  line-height: 1.35;
}

/* Keep footer pinned to bottom */
.news-footer {
  margin-top: 14px;
}

/* ===== Force uniform News Feed cards (override-safe) ===== */

/* Make sure the grid behaves consistently */
#newsGrid.news-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

@media (max-width: 900px) {
  #newsGrid.news-grid { grid-template-columns: 1fr; }
}

/* Force every rendered article card to the same height */
#newsGrid.news-grid > article.news-card.card {
  height: 320px !important;          /* change to 340/360 if you want taller */
  display: flex !important;
  flex-direction: column !important;
  overflow: hidden !important;       /* critical: prevents long text from expanding card */
}

/* Title: clamp to 2 lines */
#newsGrid.news-grid > article.news-card.card .news-title {
  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 2 !important;
  overflow: hidden !important;
}

/* Description: clamp to 4 lines */
#newsGrid.news-grid > article.news-card.card .news-desc {
  flex: 1 1 auto !important;
  margin: 0 !important;

  display: -webkit-box !important;
  -webkit-box-orient: vertical !important;
  -webkit-line-clamp: 4 !important;

  overflow: hidden !important;
  text-overflow: ellipsis !important;

  /* Helps prevent weird long-word overflow */
  word-break: break-word !important;
  overflow-wrap: anywhere !important;
}

/* Keep footer pinned */
#newsGrid.news-grid > article.news-card.card .news-footer {
  margin-top: 12px !important;
  flex: 0 0 auto !important;
}


