/* ============================================================
   CardPlus News — dark/gold card grid
   Matches the demo News & Guides look. Uses the theme's tokens
   where present, with safe fallbacks so it works standalone.
   ============================================================ */

.cpn-wrap{
  --cpn-bg:#0B0E13;
  --cpn-surface:#171C25;
  --cpn-surface2:#1E2430;
  --cpn-border:rgba(255,255,255,.08);
  --cpn-text:#EAECF0;
  --cpn-muted:#8B93A1;
  --cpn-accent:#D4AF5A;
  --cpn-cols:3;
  max-width:1200px;
  margin:0 auto;
  padding:8px 0 32px;
  color:var(--cpn-text);
}

.cpn-head{ margin:0 0 20px; }
.cpn-heading{
  font-size:22px;
  font-weight:700;
  letter-spacing:-.01em;
  margin:0 0 4px;
  color:var(--cpn-text);
}
.cpn-subhead{
  margin:0;
  font-size:13px;
  color:var(--cpn-muted);
}

.cpn-grid{
  display:grid;
  grid-template-columns:repeat(var(--cpn-cols), 1fr);
  gap:18px;
}

/* Card */
.cpn-card{
  display:flex;
  flex-direction:column;
  background:var(--cpn-surface);
  border:1px solid var(--cpn-border);
  border-radius:12px;
  overflow:hidden;
  text-decoration:none;
  color:inherit;
  transition:transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.cpn-card:hover{
  transform:translateY(-3px);
  border-color:rgba(212,175,90,.4);
  box-shadow:0 10px 30px rgba(0,0,0,.35);
}

/* Thumbnail area — fixed ratio so every card matches height */
.cpn-thumb{
  position:relative;
  aspect-ratio:16 / 10;
  overflow:hidden;
  background:#0F131A;
}
.cpn-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
  display:block;
  transition:transform .35s ease;
}
.cpn-card:hover .cpn-thumb img{ transform:scale(1.04); }

/* Placeholder state — contain the logo on a subtle gradient, not cover */
.cpn-thumb-ph{
  background:radial-gradient(circle at 50% 40%, #1c2230 0%, #0F131A 70%);
}
.cpn-thumb-ph img{
  object-fit:contain;
  padding:22px;
  opacity:.85;
}

/* Body */
.cpn-body{
  display:flex;
  flex-direction:column;
  gap:8px;
  padding:14px 14px 16px;
  flex:1;
}
.cpn-tags{
  display:flex;
  flex-wrap:wrap;
  gap:6px;
  align-items:center;
}
.cpn-tag{
  font-size:10px;
  font-weight:700;
  letter-spacing:.08em;
  text-transform:uppercase;
  color:var(--cpn-accent);
  background:rgba(212,175,90,.10);
  border:1px solid rgba(212,175,90,.25);
  padding:3px 8px;
  border-radius:999px;
  line-height:1;
}
.cpn-tag-src{
  color:var(--cpn-muted);
  background:transparent;
  border-color:var(--cpn-border);
}
.cpn-title{
  font-size:14px;
  font-weight:600;
  line-height:1.35;
  color:var(--cpn-text);
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
.cpn-meta{
  font-size:12px;
  color:var(--cpn-muted);
}
.cpn-readmore{
  margin-top:auto;
  font-size:12px;
  font-weight:600;
  color:var(--cpn-accent);
}
.cpn-card:hover .cpn-readmore{ color:#E8C87A; }

.cpn-empty{
  color:var(--cpn-muted);
  padding:24px 0;
}
.cpn-attribution{
  margin:18px 0 0;
  font-size:11px;
  color:var(--cpn-muted);
  opacity:.8;
}

/* Light mode (theme toggles body.cp-light) */
body.cp-light .cpn-wrap{
  --cpn-bg:#ffffff;
  --cpn-surface:#ffffff;
  --cpn-surface2:#f6f6f6;
  --cpn-border:#e5e5e5;
  --cpn-text:#14181F;
  --cpn-muted:#6b7280;
}
body.cp-light .cpn-thumb{ background:#eef0f3; }
body.cp-light .cpn-thumb-ph{
  background:radial-gradient(circle at 50% 40%, #f3f4f6 0%, #e5e7eb 75%);
}

/* Responsive */
@media (max-width:900px){
  .cpn-grid{ grid-template-columns:repeat(2, 1fr); }
}
@media (max-width:560px){
  .cpn-grid{ grid-template-columns:1fr; }
}
