/* Projects page layout */
.projects-content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  max-width: 1100px;
  padding: 0rem var(--side-padding) 4rem;
  box-sizing: border-box;
}

.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.8rem;
  margin-top: 1.2rem;
}

.project-thumb {
  margin: 0 0 0.5rem 0;
  width: 100%;
  aspect-ratio: 4 / 3;
  border-radius: 12px;
  overflow: hidden;
  background: var(--color-hover-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.project-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: filter 0.2s ease;
}
.project-thumb.placeholder {
  background: var(--color-border);
}

.project-card {
  border: none;
  border-radius: 18px;
  padding: 1px;
  background: transparent;
  display: flex;
  flex-direction: column;
  min-height: 240px;
}

.project-card-content {
  padding: 0.9rem;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.project-title {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  margin: 0;
  line-height: 1.35;
}

.project-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.35rem;
  margin-bottom: 0.1rem;
}


.project-card-link {
  text-decoration: none;
  color: inherit;
}

.project-card-link img {
  width: 18px;
  height: 18px;
  filter: var(--link-icon-filter);
}

.project-card-link:hover,
.project-card-link:focus-visible {
  text-decoration: none;
}
.project-title-link {
  display: inline-flex;
  width: 18px;
  height: 18px;
  flex-shrink: 0;
  opacity: 0.85;
}

.project-title-link img {
  width: 100%;
  height: 100%;
  filter: var(--link-icon-filter);
}

.project-category {
  font-size: 0.9rem;
  color: var(--color-meta);
  font-style: italic;
  margin: 0;
  line-height: 1.1;
}

.project-description {
  font-size: 1rem;
  line-height: 1.5;
  color: #ffffff;
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: rgba(0, 0, 0, 0);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 1;
}

.project-card:hover .project-thumb img,
.project-card:focus-within .project-thumb img,
.project-card:active .project-thumb img {
  filter: blur(3px) brightness(0.3);
}

.project-card:hover .project-thumb .project-description,
.project-card:focus-within .project-thumb .project-description,
.project-card:active .project-thumb .project-description {
  opacity: 1;
}

@media (max-width: 900px) {
  .projects-content {
    width: calc(100% - 170px);
    padding: 2.5rem 1.5rem 3rem;
  }
}

@media (max-width: 768px) {
  .projects-content {
    margin-left: 160px;
    margin-left: 170px;
    width: calc(100% - 160px);
    padding: 2rem 1.2rem 2.5rem;
  }

  .projects-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px), (hover: none) and (pointer: coarse) and (orientation: landscape) and (max-height: 500px) {
  .projects-content {
    margin: 0 auto;
    width: 100%;
    max-width: 95%;
    padding: 1.5rem 1rem calc(4.75rem + env(safe-area-inset-bottom, 0px));
  }

  .social-links .projects-nav-icon {
    display: inline-flex;
  }
}
