* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  background: #090d16;
  color: #f8fafc;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.resize-wrapper {
  width: 100%;
  max-width: 600px;
  resize: horizontal;
  overflow: auto;
  padding: 16px;
  background: #0f172a;
  border: 1px dashed #38bdf8;
  border-radius: 16px;
}

/* 1. Define container context */
.card-container {
  container-type: inline-size;
  container-name: cardbox;
}

/* Base Card Style (Vertical layout for small container) */
.card {
  display: flex;
  flex-direction: column;
  background: #1e293b;
  border-radius: 12px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
}

.card-media {
  background: linear-gradient(135deg, #0284c7, #38bdf8);
  font-size: 3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 120px;
}

.card-content {
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.badge {
  align-self: flex-start;
  background: rgba(56, 189, 248, 0.2);
  color: #38bdf8;
  font-size: 0.72rem;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 9999px;
  text-transform: uppercase;
}

h3 {
  font-size: 1.1rem;
}

p {
  font-size: 0.85rem;
  color: #94a3b8;
  line-height: 1.5;
}

.btn {
  margin-top: 8px;
  background: #38bdf8;
  color: #0f172a;
  border: none;
  padding: 8px 14px;
  border-radius: 8px;
  font-weight: 700;
  cursor: pointer;
  align-self: flex-start;
}

/* 2. Container Query for larger container width */
@container cardbox (min-width: 420px) {
  .card {
    flex-direction: row;
    align-items: center;
  }
  .card-media {
    width: 140px;
    min-height: 140px;
    flex-shrink: 0;
  }
}

