/* Force page layout even if base.css makes #middle flex */
#middle.projects-page {
  background: #000;
  display: block !important;
  width: 100%;
  padding-top: var(--header-h, 80px);
  padding-bottom: var(--footer-h, 55px);
}

.proj-wrap {
  padding-top: 38px;
  padding-bottom: 28px;
}

/* Title */
.proj-title {
  font-size: 72px;
  letter-spacing: -1px;
  margin: 10px 0 26px;
}

/* Grid like screenshot */
.projects-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

/* Card */
.proj-card {
  position: relative;
  background: #2b2b2b;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  overflow: hidden;
  box-shadow: 0 18px 30px rgba(0, 0, 0, 0.35);

  display: flex;
  flex-direction: column;

  /* fixed height like original */
  height: 560px;

  transition:
    transform 180ms ease,
    box-shadow 180ms ease,
    border-color 180ms ease;
}

.proj-card:hover {
  transform: translateY(-8px);
  border-color: rgba(255, 128, 0, 0.55);
  box-shadow: 0 28px 50px rgba(0, 0, 0, 0.55);
}

/* Image */
.proj-thumb {
  height: 150px;
  background: rgba(255, 255, 255, 0.06);
}

.proj-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.proj-thumb-fallback {
  height: 100%;
  display: grid;
  place-items: center;
  opacity: 0.75;
  font-size: 16px;
}

/* Body */
.proj-body {
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.proj-name {
  font-size: 18px;
  line-height: 1.15;
  margin-bottom: 10px;
}

/* Truncated preview (keeps all cards same height) */
.proj-preview {
  color: rgba(255, 255, 255, 0.78);
  font-size: 15px;
  line-height: 1.55;
  margin-bottom: 14px;
}

/* Tags (pills) */
.proj-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
}

.tag {
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 4px 10px;
  border-radius: 7px;
  font-size: 11px;
  color: rgba(255, 255, 255, 0.9);
}

/* Buttons */
.proj-actions {
  display: flex;
  gap: 10px;
  margin-top: auto;
}

.btn {
  display: inline-block;
  text-align: center;
  padding: 8px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  min-width: 110px;
  user-select: none;
}

/* Blue buttons like screenshot */
.btn-demo,
.btn-code {
  background: #6c7bd8;
  color: #fff;
}

.btn:hover {
  filter: brightness(1.06);
}

.btn.disabled {
  opacity: 0.4;
  pointer-events: none;
}

/* =========================
   HOVER OVERLAY (FULL TEXT)
   Pops up orange like original
========================= */
.proj-overlay {
  position: absolute;
  inset: 0;
  background: #ff8000;
  color: #fff;

  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;

  transition:
    opacity 180ms ease,
    transform 180ms ease;
}

.proj-card:hover .proj-overlay {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* Hide the default body content under overlay */
.proj-card:hover .proj-body {
  opacity: 0;
}

.overlay-inner {
  height: 100%;
  padding: 18px 18px 16px;
  display: flex;
  flex-direction: column;
}

.overlay-title {
  font-size: 18px;
  margin-bottom: 10px;
}

/* Scrollable full description if long */
.overlay-desc {
  font-size: 15px;
  line-height: 1.55;
  overflow: auto;
  padding-right: 6px;
}

.overlay-desc p {
  margin-bottom: 10px;
}

/* Nice scrollbar (optional) */
.overlay-desc::-webkit-scrollbar {
  width: 8px;
}
.overlay-desc::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.25);
  border-radius: 10px;
}

/* Responsive */
@media (max-width: 1300px) {
  .projects-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 1000px) {
  .proj-title {
    font-size: 56px;
  }
  .projects-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 600px) {
  .proj-title {
    font-size: 42px;
  }
  .projects-grid {
    grid-template-columns: 1fr;
  }
  .proj-card {
    height: 580px;
  }
}
