/* project cards, popup and screenshot lightbox — driven by projects.js */

#projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-top: 8px;
}

.project-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 10px;
  border-radius: 10px;
  background: rgba(15, 15, 15, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  cursor: pointer;
  text-align: left;
  transition: border-color 0.15s, background 0.15s, transform 0.15s;
}

.project-card:hover,
.project-card:focus-visible {
  background: rgba(25, 25, 25, 0.6);
  border-color: rgba(255, 255, 255, 0.2);
  transform: translateY(-2px);
  outline: none;
}

.project-card-title {
  color: #ddd;
  font-weight: 600;
  font-size: 0.82rem;
}

.project-card-tag {
  color: #888;
  font-size: 0.68rem;
}

/* ── popup ────────────────────────────────────────────────────────── */
#project-modal {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}

#project-modal.open {
  opacity: 1;
  pointer-events: auto;
}

#project-modal-box {
  position: relative;
  width: 100%;
  max-width: 460px;
  max-height: 80vh;
  overflow-y: auto;
  padding: 22px 24px;
  border-radius: 14px;
  background: rgba(17, 17, 17, 0.96);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #bbb;
  text-align: left;
  transform: translateY(12px) scale(0.98);
  transition: transform 0.25s ease;
}

#project-modal.open #project-modal-box {
  transform: none;
}

#project-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 28px;
  height: 28px;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #ccc;
  font-size: 1rem;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

#project-modal-close:hover {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

#project-modal-title {
  margin: 0 30px 4px 0;
  color: #fff;
  font-size: 1.15rem;
  font-weight: 700;
}

#project-modal-tag {
  margin-bottom: 14px;
  color: #888;
  font-size: 0.75rem;
}

#project-modal-desc {
  font-size: 0.85rem;
  line-height: 1.7;
  color: #b0b0b0;
  white-space: pre-line; /* keeps \n breaks from the desc string */
}

#project-modal-images {
  display: flex;
  gap: 8px;
  margin-top: 14px;
}

#project-modal-images:empty { display: none; }

.project-modal-img {
  flex: 1 1 0;
  min-width: 0;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  background: #1a1a1a;
  border: 1px solid rgba(255, 255, 255, 0.1);
  cursor: zoom-in;
  transition: border-color 0.15s, transform 0.15s;
}

.project-modal-img:hover {
  border-color: rgba(255, 255, 255, 0.3);
  transform: scale(1.02);
}

#project-modal-tech {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.project-tech-pill {
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #aaa;
  font-size: 0.68rem;
}

#project-modal-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.project-modal-link {
  padding: 7px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: #ddd;
  font-size: 0.78rem;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}

.project-modal-link:hover {
  background: rgba(255, 255, 255, 0.16);
  color: #fff;
}

/* ── lightbox ─────────────────────────────────────────────────────── */
#image-lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 28px;
  background: rgba(0, 0, 0, 0.88);
  backdrop-filter: blur(6px);
  cursor: zoom-out;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

#image-lightbox.open {
  opacity: 1;
  pointer-events: auto;
}

#image-lightbox-img {
  max-width: 100%;
  max-height: 100%;
  border-radius: 10px;
  transform: scale(0.96);
  transition: transform 0.2s ease;
}

#image-lightbox.open #image-lightbox-img {
  transform: none;
}

@media screen and (max-width: 420px) {
  #projects-grid { grid-template-columns: 1fr; }
  #project-modal-images { flex-direction: column; }
}
