/* Projects page specific styles */
.projects-page {
  max-width: 1400px;
  margin: 96px auto;
  padding: 0 24px;
}

.projects-page__header {
  text-align: center;
  max-width: 700px;
  margin-left: auto;
  margin-right: auto;
}

.projects-page__header .lead {
  color: var(--muted);
  font-size: 1.1rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 24px;
  margin-top: 48px;
}

.project-card {
  position: relative;
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-md);
  overflow: hidden;
  color: #fff;
  text-decoration: none;
  display: block;
  box-shadow: 0 10px 25px rgba(0,0,0,0.1);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.project-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 20px 35px rgba(0,0,0,0.2);
}

.project-card__bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.project-card:hover .project-card__bg {
  transform: scale(1.05);
}

.project-card__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(0,0,0,0.8) 100%);
  display: flex;
  align-items: flex-end;
  padding: 24px;
}

.project-card__content {
  transform: translateY(20px);
  opacity: 0;
  transition: transform 0.4s ease, opacity 0.4s ease;
  width: 100%;
}

.project-card:hover .project-card__content {
  transform: translateY(0);
  opacity: 1;
}

.project-card__category {
  margin: 0 0 4px;
  font-size: 0.85rem;
  font-weight: 600;
  color: rgba(255,255,255,0.8);
  text-transform: uppercase;
  letter-spacing: 1px;
}

.project-card__title {
  margin: 0;
  font-size: 1.3rem;
  line-height: 1.3;
  font-weight: 600;
}

/* Responsive adjustments */
@media (max-width: 1200px) {
  .project-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (max-width: 992px) {
  .project-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 600px) {
  .projects-page {
    margin: 64px auto;
    padding: 0 16px;
  }
  .project-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }
}


/* Project Detail Page Layout (reuse from news.css) */
.post-layout {
  display: grid;
  grid-template-columns: 250px minmax(0, 800px) 250px;
  gap: 32px;
  max-width: 1500px;
  margin: 48px auto;
  padding: 0 24px;
  align-items: flex-start;
}

.post-main {
  width: 100%;
}

.post-sidebar-left, .post-sidebar-right {
  position: sticky;
  top: 96px;
  display: block;
}

.table-of-contents {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  min-height: 50px;
  margin-top: 16px;
}

.table-of-contents:empty {
  display: none;
}

.table-of-contents:not(:empty) {
  display: block !important;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 24px;
  transition: color 0.2s ease;
}

.back-link:hover {
  color: var(--primary);
}

.table-of-contents h3 {
  margin: 0 0 12px;
  font-size: 1rem;
  font-weight: 700;
}

.table-of-contents ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.table-of-contents a {
  display: block;
  padding: 10px 12px;
  color: var(--muted);
  border-left: 4px solid transparent;
  font-size: 0.9rem;
  transition: all 0.3s ease;
  border-radius: 6px;
  margin: 2px 0;
  cursor: pointer;
}

.table-of-contents a:hover {
  background-color: rgba(122, 80, 154, 0.05);
  color: var(--text);
}

.table-of-contents a.active {
  color: var(--primary);
  font-weight: 700;
  border-left-color: var(--primary);
  background-color: var(--bg-soft);
  padding-left: 10px;
  transform: translateX(2px);
}

.other-posts-title {
  font-size: 1.1rem;
  margin: 0 0 12px;
}

.other-posts-list a {
  display: block;
  padding: 10px 0;
  font-weight: 500;
  border-bottom: 1px solid #eee;
  line-height: 1.4;
}

.other-posts-list a:hover {
  color: var(--primary);
}

.post-header h1 {
  margin: 0 0 10px;
}

.post-meta {
  color: var(--muted);
  margin: 0 0 18px;
}

.post-cover {
  width: 100%;
  border-radius: 16px;
  object-fit: cover;
  max-height: 420px;
}

.post-content {
  margin-top: 22px;
  line-height: 1.75;
}

.post-content h1,
.post-content h2,
.post-content h3,
.post-content h4,
.post-content h5,
.post-content h6 {
  margin-top: 32px;
  margin-bottom: 16px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text);
}

.post-content h2 {
  font-size: 1.75rem;
  border-bottom: 2px solid var(--primary);
  padding-bottom: 8px;
  margin-top: 40px;
}

.post-content h3 {
  font-size: 1.5rem;
  color: var(--primary);
  margin-top: 32px;
}

.post-content h4 {
  font-size: 1.25rem;
}

.post-content img, 
.post-content video {
  display: block;
  margin: 24px auto;
  width: 100%;
  max-width: 820px;
  height: auto;
  border-radius: 12px;
  object-fit: contain;
}

.post-content img {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

@media (max-width: 1200px) {
  .post-layout {
    grid-template-columns: 200px 1fr;
  }
  .post-sidebar-right {
    display: none;
  }
}

@media (max-width: 992px) {
  .post-layout {
    grid-template-columns: 1fr;
  }
  .post-sidebar-left {
    display: none !important;
  }
  .back-link {
    display: inline-flex;
    position: absolute;
    top: -40px;
  }
  .post-main {
    position: relative;
  }
}

@media (min-width: 993px) {
  .post-sidebar-left {
    display: block !important;
  }
}