/* ═══════════════════════════════════════════════════════════════════════════
   CTF WRITEUPS — Grid cards + platform badges + difficulty + filters
   ═══════════════════════════════════════════════════════════════════════════ */

.ctf-section {
  padding: 4rem 0 6rem;
}

/* ─── Filters ─── */
.ctf-filters {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 2rem;
}

.ctf-filter {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  padding: 0.4rem 1rem;
  border-radius: 6px;
  border: 1px solid rgba(139, 92, 246, 0.2);
  background: transparent;
  color: var(--text-secondary, #94a3b8);
  cursor: pointer;
  transition: all 0.2s;
}

.ctf-filter:hover {
  border-color: var(--purple);
  color: var(--text-primary);
}

.ctf-filter.active {
  background: rgba(139, 92, 246, 0.15);
  border-color: var(--purple);
  color: var(--purple);
}

/* ─── Cards Grid ─── */
.ctf-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(340px, 1fr));
  gap: 1.5rem;
}

.ctf-card {
  background: rgba(139, 92, 246, 0.03);
  border: 1px solid rgba(139, 92, 246, 0.1);
  border-radius: 12px;
  padding: 1.5rem;
  transition: all 0.3s ease;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.ctf-card:hover {
  border-color: rgba(139, 92, 246, 0.3);
  background: rgba(139, 92, 246, 0.06);
  transform: translateY(-3px);
}

.ctf-card.hidden {
  display: none;
}

/* ─── Card Header (platform + difficulty) ─── */
.ctf-card__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

/* ─── Platform Badges ─── */
.ctf-card__platform {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 600;
  padding: 0.2rem 0.6rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ctf-card__platform--htb {
  color: #9fef00;
  background: rgba(159, 239, 0, 0.1);
  border: 1px solid rgba(159, 239, 0, 0.25);
}

.ctf-card__platform--thm {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.ctf-card__platform--rootme {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.ctf-card__platform--ethernaut {
  color: #8b5cf6;
  background: rgba(139, 92, 246, 0.1);
  border: 1px solid rgba(139, 92, 246, 0.25);
}

/* ─── Difficulty Badges ─── */
.ctf-card__difficulty {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  font-weight: 600;
  padding: 0.15rem 0.5rem;
  border-radius: 4px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  white-space: nowrap;
}

.ctf-card__difficulty--easy {
  color: #22c55e;
  background: rgba(34, 197, 94, 0.1);
  border: 1px solid rgba(34, 197, 94, 0.25);
}

.ctf-card__difficulty--medium {
  color: #f59e0b;
  background: rgba(245, 158, 11, 0.1);
  border: 1px solid rgba(245, 158, 11, 0.25);
}

.ctf-card__difficulty--hard {
  color: #ef4444;
  background: rgba(239, 68, 68, 0.1);
  border: 1px solid rgba(239, 68, 68, 0.25);
}

.ctf-card__difficulty--insane {
  color: #ec4899;
  background: rgba(236, 72, 153, 0.1);
  border: 1px solid rgba(236, 72, 153, 0.25);
}

/* ─── Card Title ─── */
.ctf-card__title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1.3;
}

/* ─── Card Category Label ─── */
.ctf-card__category {
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  color: var(--purple, #8b5cf6);
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

/* ─── Card Description ─── */
.ctf-card__desc {
  font-size: 0.85rem;
  color: var(--text-secondary, #94a3b8);
  line-height: 1.6;
  flex: 1;
}

/* ─── Tags ─── */
.ctf-card__tags {
  display: flex;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.ctf-card__tag {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  padding: 0.1rem 0.45rem;
  border-radius: 3px;
  color: var(--text-secondary, #94a3b8);
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
}

/* ─── Writeup Button ─── */
.ctf-card__btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--purple, #8b5cf6);
  text-decoration: none;
  padding: 0.5rem 1rem;
  border-radius: 8px;
  border: 1px solid rgba(139, 92, 246, 0.25);
  background: rgba(139, 92, 246, 0.06);
  transition: all 0.2s ease;
  margin-top: 0.5rem;
  align-self: flex-start;
}

.ctf-card__btn:hover {
  background: rgba(139, 92, 246, 0.15);
  border-color: rgba(139, 92, 246, 0.5);
  transform: translateX(3px);
}

/* ─── Empty State ─── */
.ctf-empty {
  text-align: center;
  padding: 3rem;
  color: var(--text-secondary, #94a3b8);
  font-family: var(--font-mono);
  font-size: 0.9rem;
  grid-column: 1 / -1;
}

/* ─── Responsive ─── */
@media (max-width: 768px) {
  .ctf-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .ctf-filters {
    gap: 0.4rem;
  }
  .ctf-filter {
    font-size: 0.72rem;
    padding: 0.35rem 0.75rem;
  }
}
