.project-card {
  display: flex;
  align-items: flex-start;       /* align top edges */
  justify-content: space-between;
  background-color: #1e1e1e;
  border-radius: 10px;
  margin-bottom: 20px;
  padding: 20px 30px;            /* balanced vertical and horizontal padding */
  gap: 20px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

/* Left content section */
.project-card-content {
  flex: 1 1 0;
  min-width: 0;
  color: #eee;
  padding-top: 0;                /* remove top internal padding */
}

/* Remove browser default top margins */
.project-card-content h3:first-child,
.project-card-content p:first-child {
  margin-top: 0;
}

/* Title */
.project-card-content h3 {
  font-size: 1.5em;
  margin-bottom: 10px;
  color: #fff;
}

/* Subtitle / role */
.project-card-content p {
  font-size: 1em;
  margin-bottom: 8px;            /* tighter spacing for flush chips */
  color: #ddd;
}

/* Bullet points (normal lists) */
.project-card-content ul {
  padding-left: 20px;
  margin-top: 0;
  margin-bottom: 0;
  line-height: 1.6;
}

/* Coursework chips â€" perfectly flush with text */
.project-card-content > ul.coursework-chips {
  margin: 6px 0 14px 0 !important;  /* no left margin */
  padding-left: 0 !important;       /* no left padding */
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
}

/* Chip appearance */
.coursework-chips li {
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(255,255,255,0.04);
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 0.9rem;
  white-space: nowrap;
  line-height: 1.4;
}

.coursework-chips li:hover {
  background: rgba(255,255,255,0.08);
  transition: background 0.2s ease-in-out;
}

/* Right image container */
.project-media {
  display: grid;
  place-items: center;     /* centers both axes */
  flex: 0 0 150px;         /* fixed column width */
  aspect-ratio: 1 / 1;     /* square box */
}

/* Image styling */
.project-media img,
.project-card-img {
  max-width: 120px;
  max-height: 120px;
  object-fit: contain;
  object-position: center;
  display: block;
  margin: auto;
  border-radius: 8px;
}

/* Responsive design for mobile */
@media (max-width: 768px) {
  .project-card {
    flex-direction: column;
    align-items: flex-start;
    text-align: left;
    padding: 20px;
  }

  .project-media {
    width: 100%;
    justify-content: flex-start;
    margin-top: 15px;
  }

  .project-media img {
    max-width: 80px;
  }
}

/* Link styling inside card */
.project-card a {
  color: #4CAF50;
  text-decoration: none;
}

.project-card a:hover {
  text-decoration: underline;
}

/* ================================
   Projects Grid (2x3) â€" Add-on
   ================================ */

/* ---------- Filter Buttons (single definition) ---------- */
.proj-filterbar {
  display: flex; gap: 10px; flex-wrap: wrap;
  margin: 8px 0 18px 0;
}
.pf-btn {
  background: #1e1e1e; color: #ddd;
  border: 1px solid rgba(255,255,255,0.14);
  border-radius: 8px; padding: 6px 12px;
  cursor: pointer; transition: all .2s ease;
}
.pf-btn:hover { background: rgba(255,255,255,0.06); color: #fff; }
.pf-btn.is-active { border-color: #4CAF50; color: #fff; }

/* ---------- Horizontal Rows List ---------- */
.projects-list {
  display: flex; flex-direction: column; gap: 16px;
}

/* Each row */
.project-row {
  background: #1e1e1e;
  border-radius: 10px;
  box-shadow: 0 2px 6px rgba(0,0,0,0.2);
  overflow: clip;
}
.project-row > summary { list-style: none; }
.project-row__summary::-webkit-details-marker { display: none; }

/* Row header: image | text | link | chevron */
.project-row__summary {
  display: grid;
  grid-template-columns: 160px 1fr auto 24px;
  align-items: center; gap: 16px;
  padding: 16px 20px; cursor: pointer;
  transition: background .2s ease;
}
.project-row__summary:hover { background: rgba(255,255,255,0.04); }

.project-row__image {
  width: 160px; height: 120px;
  object-fit: cover; object-position: center;
  border-radius: 8px; display: block; margin: 0;
}

.project-row__header { display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.project-row__title {
  margin: 0; font-size: 1.08rem; line-height: 1.3; color: #fff;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

/* Rectangular shields (single definition) */
.badge-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.badge-row img { height: 22px; display: block; border: 0; background: none; padding: 0; border-radius: 0; }

/* View Project link on the right */
.project-row__link {
  color: #4CAF50;
  text-decoration: none;
  font-weight: 500;
  font-size: 0.95rem;
  white-space: nowrap;
  padding: 8px 16px;
  border: 1px solid rgba(76, 175, 80, 0.3);
  border-radius: 6px;
  transition: all 0.2s ease;
  background: rgba(76, 175, 80, 0.05);
}
.project-row__link:hover {
  color: #66BB6A;
  background: rgba(76, 175, 80, 0.12);
  border-color: rgba(76, 175, 80, 0.5);
  text-decoration: none;
}

/* Chevron */
.project-row__chevron { width: 24px; height: 24px; position: relative; }
.project-row__chevron::before {
  content: ""; position: absolute; inset: 0; margin: auto;
  width: 9px; height: 9px;
  border-right: 2px solid #bbb; border-bottom: 2px solid #bbb;
  transform: rotate(-45deg); transition: transform .2s ease;
}
.project-row[open] .project-row__chevron::before { transform: rotate(45deg); }

/* Expanded body */
.project-row__body {
  padding: 12px 24px 18px 24px;
  border-top: 1px solid rgba(255,255,255,0.06);
  display: grid; gap: 10px;
  max-height: 0; overflow: clip; transition: max-height .25s ease;
}
.project-row[open] .project-row__body { max-height: 900px; }
.project-row__body ul { margin: 8px 0 0 18px; padding: 0; display: grid; gap: 8px; color: #ddd; }
.project-row__body a { color: #4CAF50; text-decoration: none; }
.project-row__body a:hover { text-decoration: underline; }

/* Mobile */
@media (max-width: 520px) {
  .project-row__summary {
    grid-template-columns: 120px 1fr 20px;
    gap: 12px; padding: 12px 14px;
  }
  .project-row__image { width: 120px; height: 90px; border-radius: 6px; }
  .project-row__title { font-size: 1rem; }
  .badge-row img { height: 20px; }
  
  /* Stack link below on mobile */
  .project-row__link {
    grid-column: 1 / -1;
    justify-self: start;
    margin-top: 8px;
  }
}