/* ============================================================
   Featured section — Symmetrical Image Cards
   ============================================================ */

.featured-section {
  padding: 30px 0;
  border-bottom: 1px solid rgba(57, 113, 177, 0.16);
}

.view-projects { 
  color: var(--blue); 
  font-size: 14px; 
  font-weight: 600; 
}

.featured-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 18px;
  /* align-items: stretch is default, this makes all cards the same height */
}

/* ---------- Card Container ---------- */
.featured-item {
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%; /* Forces all cards in the row to match heights */
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(6, 18, 32, 0.95), rgba(3, 10, 19, 0.98));
  transition: transform 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease;
}

.featured-item:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow:
    0 18px 40px rgba(0, 0, 0, 0.5),
    0 0 50px rgba(0, 140, 255, 0.18);
}

/* subtle glow line on top of each card */
.featured-item::before {
  content: "";
  position: absolute;
  top: 0;
  left: 15%;
  right: 15%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(22, 162, 255, 0.6) 50%, transparent 100%);
  z-index: 3;
  pointer-events: none;
}

/* ---------- Clickable Wrapper ---------- */
.featured-link {
  display: flex;
  flex-direction: column;
  height: 100%; /* Forces the link to fill the card */
  width: 100%;
  text-decoration: none;
  color: inherit;
}

/* ---------- Image Wrapper ---------- */
.featured-image {
  flex-grow: 1; /* 🔥 Makes the image take up ALL remaining space */
  min-height: 240px; /* Base height so it doesn't get too small */
  width: 100%;
  overflow: hidden;
  background: #07131f;
  position: relative;
}

.featured-image img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover; /* Crops the image to fill the box, keeping proportions */
  object-position: center;
  transition: transform 0.5s ease;
}

.featured-item:hover .featured-image img {
  transform: scale(1.05); /* Slight zoom effect on hover */
}

/* ---------- Placeholder (If no image exists) ---------- */
.featured-placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  flex-grow: 1;
  min-height: 240px;
  font-size: 80px;
  font-weight: 800;
  color: rgba(22, 162, 255, 0.2);
  background: radial-gradient(circle at center, rgba(14, 111, 255, 0.1), #07131f 70%);
}

/* ---------- Caption Bar ---------- */
.featured-caption {
  flex-shrink: 0; /* 🔥 Prevents the caption from shrinking or growing */
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 16px;
  background: rgba(3, 10, 19, 0.85);
  border-top: 1px solid rgba(56, 129, 210, 0.18);
  transition: background 0.25s ease;
}

.featured-caption:hover {
  background: rgba(22, 162, 255, 0.08);
}

.featured-tag {
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--blue);
  padding: 4px 10px;
  border: 1px solid rgba(22, 162, 255, 0.30);
  border-radius: 999px;
  background: rgba(22, 162, 255, 0.08);
  white-space: nowrap;
}

.featured-name {
  font-size: 13px;
  font-weight: 600;
  color: #dcedfc;
  text-align: right;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis; /* Adds "..." if text is too long */
}

/* ---------- Responsive ---------- */
@media (max-width: 1100px) {
  .featured-grid { grid-template-columns: repeat(2, 1fr); }
  .featured-image, .featured-placeholder { min-height: 220px; }
}

@media (max-width: 620px) {
  .featured-grid { grid-template-columns: 1fr; }
  .featured-image, .featured-placeholder { min-height: 250px; }
}

/* respect reduced motion */
@media (prefers-reduced-motion: reduce) {
  .featured-item,
  .featured-image img {
    animation: none !important;
    transition: none !important;
  }
}