/* ==========================================================================
   Sponsored placements — shared by public site and student panel.
   Requires nepa-tokens.css. Advertiser colour: kun.college logo violet #4840E0.
   Contrast: logo (black lettering) always on white; CTA = white on violet (7.1:1);
   body text uses --text / --muted on white.
   ========================================================================== */
:root { --ad-kun: 243 72% 56%; --ad-kun-hover: 243 72% 46%; --ad-kun-soft: 243 90% 97%; }

.nx-ad {
  position: relative; background: hsl(var(--background)); border: 1px solid hsl(var(--border));
  border-left: 4px solid hsl(var(--ad-kun)); border-radius: var(--radius-lg); box-shadow: var(--shadow-sm);
  transition: var(--transition-smooth); margin: 0 0 var(--space-3);
}
.nx-ad:hover { box-shadow: var(--shadow-md); border-color: hsl(var(--ad-kun) / .45); border-left-color: hsl(var(--ad-kun)); }
.nx-ad__label {
  position: absolute; top: 8px; right: 12px; font-size: .68rem; font-weight: 700; letter-spacing: .08em;
  text-transform: uppercase; color: hsl(var(--muted)); background: hsl(var(--surface)); padding: 2px 8px; border-radius: var(--radius-sm);
}
.nx-ad__link { display: flex; align-items: center; gap: var(--space-3); padding: var(--space-3); color: hsl(var(--text)) !important; text-decoration: none !important; }
.nx-ad__logo {
  flex: 0 0 auto; display: flex; align-items: center; justify-content: center;
  background: hsl(var(--background)); border-radius: var(--radius); padding: var(--space-1);
}
.nx-ad__logo img { display: block; height: 52px; width: auto; max-width: 210px; }
.nx-ad__body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.nx-ad__headline { color: hsl(var(--foreground)); font-size: 1.12rem; font-weight: 800; line-height: 1.3; }
.nx-ad__text { color: hsl(var(--muted)); font-size: .92rem; line-height: 1.55; }
.nx-ad__points { display: flex; flex-wrap: wrap; gap: 4px var(--space-2); margin-top: 4px; }
.nx-ad__points span { font-size: .84rem; font-weight: 600; color: hsl(var(--text)); }
.nx-ad__points .fa { color: hsl(var(--ad-kun)); margin-right: 2px; }
.nx-ad__cta {
  flex: 0 0 auto; display: inline-flex; align-items: center; gap: 8px; white-space: nowrap;
  background: hsl(var(--ad-kun)); color: hsl(var(--primary-foreground)) !important; font-weight: 700; font-size: .92rem;
  padding: 10px var(--space-2); border-radius: var(--radius); transition: var(--transition-fast);
}
.nx-ad__cta .fa { transition: var(--transition-fast); }
.nx-ad:hover .nx-ad__cta { background: hsl(var(--ad-kun-hover)); }
.nx-ad:hover .nx-ad__cta .fa { transform: translateX(3px); }
.nx-ad__link:focus-visible { outline: 0; box-shadow: var(--focus-ring); border-radius: var(--radius-lg); }

/* Compact card — sidebars / narrow columns */
.nx-ad--card .nx-ad__link { flex-direction: column; align-items: stretch; gap: 12px; padding: var(--space-3) var(--space-2) var(--space-2); }
.nx-ad--card .nx-ad__logo { justify-content: flex-start; padding: 0; }
.nx-ad--card .nx-ad__logo img { height: 40px; }
.nx-ad--card .nx-ad__headline { font-size: 1rem; }
.nx-ad--card .nx-ad__text { font-size: .86rem; }
.nx-ad--card .nx-ad__cta { justify-content: center; }

/* Banner on small screens stacks */
@media (max-width: 767.98px) {
  .nx-ad--banner .nx-ad__link { flex-direction: column; align-items: stretch; gap: var(--space-2); padding: var(--space-3) var(--space-2) var(--space-2); }
  .nx-ad--banner .nx-ad__logo { justify-content: flex-start; padding: 0; }
  .nx-ad--banner .nx-ad__logo img { height: 42px; }
  .nx-ad--banner .nx-ad__cta { justify-content: center; }
}

/* Section wrapper for public pages */
.nx-ad-slot { padding: var(--space-4) 0 0; }
.nx-ad-slot .nx-ad { margin: 0; }
