.section_6 {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 100vh;
  padding: 3rem clamp(1.5rem, 5vw, 4.5rem);
  gap: 3rem;
}

/* ============================================= */
/* ARTICLE CARD                                   */
/* ============================================= */

.article_card {
  width: 100%;
  height: auto;
  color: var(--text-main);
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  padding: clamp(1rem, 3vw, 1.35rem);
  box-sizing: border-box;
}

/* Tag */
.article_card_tag {
  align-self: flex-start;
  font-size: 0.68rem;
  font-weight: 600;
  color: var(--color-primary);
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.03);
  padding: 0.3rem 0.65rem;
  border-radius: 999px;
  line-height: 1;
}

/* Headline */
.article_card_headline {
  margin: 0;
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
  color: var(--text-main);
}

/* Sub headline */
.article_card_subheadline {
  margin: 0;
  font-size: clamp(0.8rem, 1.4vw, 0.875rem);
  color: var(--muted);
  line-height: 1.55;
  /* keep card height predictable regardless of copy length */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* Divider */
.article_card_divider {
  width: 100%;
  height: 1px;
  background-color: var(--line);
  margin: 0.2rem 0;
  flex-shrink: 0;
}

/* Footer: author left, date right */
.article_card_footer {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
}

.article_card_author {
  font-size: 0.78rem;
  font-weight: 500;
  color: var(--color-secondary);
}

.article_card_date {
  font-size: 0.75rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

.cs-view-all {
  display: flex;
  align-items:end;
  gap: 0.5rem;
  font-family: var(--mono);
  font-size: clamp(0.7rem, 0.3vw + 0.62rem, 0.78rem);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.1rem;
}

/* Container Layout: Flexbox wrapping mechanism */

.boxes {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between; /* space-between looks uneven with wrap + gap */
  gap: clamp(30px, 4vw, 50px);

  width: 100%;
  margin: 0 auto;
  box-sizing: border-box;
}

/* override the card's own width:100% just inside this layout */
.boxes .article_card {
  flex: 1 1 300px;   /* grow/shrink, but prefer 300px */
  width: auto;
  max-width: 400px;  /* stop cards from stretching too wide when few per row */
}

/* Base Dark Theme Card Container */
.sec6-boxes {
  position: relative;
  /* Flex-basis controls the initial target width; flex-grow lets it expand when wrapping */
  flex: 1 1 clamp(280px, 30vw, 350px);
  max-width: 100%;
  
  /* Fluid height based on viewport */
  min-height: clamp(360px, 45vh, 440px);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.sec6-boxes:hover {
  transform: translateY(-6px);
  border-color: rgba(99, 102, 241, 0.4);
}

/* "CASE STUDY" Badge on Top Left */
.badge {
  position: absolute;
  top: clamp(8px, 1.5vw, 12px);
  left: clamp(8px, 1.5vw, 12px);
  z-index: 2;
  background-color: rgba(15, 23, 42, 0.85);
  backdrop-filter: blur(4px);
  color: #94a3b8;
  font-size: clamp(0.65rem, 0.8vw, 0.75rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  padding: 4px clamp(8px, 1vw, 10px);
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Upper Half: Image */
.image-wrapper {
  width: 100%;
  height: clamp(160px, 20vh, 210px);
  overflow: hidden;
  background-color: #0f172a;
}

.image-wrapper img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.sec6-boxes:hover .image-wrapper img {
  transform: scale(1.05);
}

/* Bottom Half: Content */
.card-content {
  padding: clamp(14px, 2vw, 20px);
  display: flex;
  flex-direction: column;
  gap: clamp(6px, 1vw, 10px);
  flex: 1;
}

/* Industry Tag */
.tag {
  color: #6366f1;
  font-size: clamp(0.68rem, 0.8vw, 0.78rem);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Responsive 1-Line Headline Truncation */
.headline {
  color: #f8fafc;
  /* Fluid font scaling: min 0.95rem, scaling with viewport, max 1.2rem */
  font-size: clamp(0.95rem, 1.1vw + 0.5rem, 1.2rem);
  font-weight: 700;
  line-height: 1.3;
  margin: 0;

  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Responsive 2-Line Sub-Headline Truncation */
.sub-headline {
  color: #94a3b8;
  /* Fluid font scaling: min 0.8rem, scaling with viewport, max 0.9rem */
  font-size: clamp(0.8rem, 0.7vw + 0.5rem, 0.9rem);
  line-height: 1.45;
  margin: 0;

  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Extra optimization for mobile viewports */
@media (max-width: 480px) {
  .sec6-boxes {
    flex: 1 1 100%; /* Forces cards to take full width on small mobile screens */
  }
}

/* Extra optimization for mobile viewports */
@media (max-width: 480px) {
  .top_half {
    flex-direction: column; /* Forces cards to take full width on small mobile screens */
    gap: 1rem;
  }
}