:root {
  --font-main: "Montserrat", sans-serif;
  --font-heading: "Francois One", sans-serif;
  --color-dark: #212732;
  --color-silver: #c7c9cc;
  --color-gold: #fbd216;
  --color-white: #e8e9eb;
  --fs-base: 1rem;
  --fs-md: 1.25rem;
}

main {
  margin-top: 100px;
}

/* General Layout */
.project-wrapper {
  display: flex;
  flex-direction: column;
  gap: 2rem;
}

.project-sidebar {
  padding: 1.5rem;
  border-radius: 1rem;
  font-family: var(--font-main);
  max-height: 80vh;
  overflow-y: auto;
  padding-right: 1rem;
  scrollbar-width: thin;
  scrollbar-color: #ccc transparent;
  position: sticky;
  top: 100px;
}

.project-sidebar::-webkit-scrollbar {
  width: 6px;
}

.project-sidebar::-webkit-scrollbar-thumb {
  background-color: #ccc;
  border-radius: 4px;
}

.sidebar-heading {
  font-size: var(--fs-md);
  font-family: var(--font-heading);
  font-weight: 600;
  margin-bottom: 1rem;
  color: var(--color-dark);
}

.project-nav {
  list-style: none;
  padding: 0;
  margin: 0;
}

.project-nav li {
  margin-bottom: 0.75rem;
  position: relative;
}

.project-nav li:not(:last-child)::after {
  content: "";
  position: absolute;
  bottom: -5px;
  left: 0;
  width: 100%;
  height: 1px;
  background-color: rgba(251, 210, 22, 0.2);
}

.project-nav a {
  display: block;
  padding: 0.75rem 1rem;
  border-radius: 0.75rem;
  text-decoration: none;
  color: var(--color-silver);
  background-color: transparent;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.03);
  font-weight: 500;
  font-size: var(--fs-base);
  transition: all 0.3s ease;
  position: relative;
  overflow: hidden;
}

.project-nav a:hover {
  background-color: rgba(251, 210, 22, 0.05);
  color: var(--color-gold);
}

.project-nav a.active {
  background-color: rgba(251, 210, 22, 0.1);
  color: var(--color-gold);
  font-weight: 600;
}

.project-nav a.active::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  height: 100%;
  width: 4px;
  background-color: var(--color-gold);
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)) !important;
  grid-auto-rows: 200px;
  gap: 1rem;
  margin-top: 2rem;
  margin-bottom: 2rem;
}

.gallery-item {
  cursor: pointer;
  overflow: hidden;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
  position: relative;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
}

.gallery-item img:hover {
  transform: scale(1.05);
}

.project-gallery-wrapper {
  display: flex;
  justify-content: center;
  padding: 2rem;
  margin-top: 100px;
}

.project-gallery-content {
  max-width: 800px;
  width: 100%;
  text-align: center;
}

.lightbox {
  display: none;
  position: fixed;
  z-index: 9999;
  padding-top: 60px;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  overflow: auto;
  background-color: rgba(0, 0, 0, 0.9);
}

.lightbox-content {
  margin: auto;
  display: block;
  max-width: 90%;
  max-height: 80vh;
  border-radius: 10px;
  border: 3px solid var(--color-gold);
}

.close {
  position: absolute;
  top: 30px;
  right: 40px;
  color: var(--color-white);
  font-size: 40px;
  font-weight: bold;
  cursor: pointer;
}

/* --- Responsive Styles --- */

@media (max-width: 576px) {
  .project-wrapper {
    flex-direction: column;
    align-items: center;
  }

  .project-sidebar {
    width: 100%;
    margin-bottom: 2rem;
    margin-top: 100px;
    padding: 1rem;
  }

  .project-gallery-content {
    width: 100%;
  }

  .gallery-grid {
    grid-template-columns: repeat(1, 1fr);
  }
}

@media (min-width: 640px) {
  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .project-sidebar {
    width: 100%;
    margin-bottom: 2rem;
    margin-top: 100px;
    padding: 1rem;
  }
}

@media (min-width: 768px) {
  .project-wrapper {
    flex-direction: row;
    align-items: flex-start;
  }

  .project-sidebar {
    width: 300px;
    margin-right: 2rem;
    margin-top: 2rem;
    padding: 1.5rem;
  }

  .project-gallery-content {
    flex: 1;
  }

  .gallery-grid {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (min-width: 1024px) {
  .gallery-grid {
    grid-template-columns: repeat(3, 1fr);
  }
}

@media (min-width: 1280px) {
  .gallery-grid {
    grid-template-columns: repeat(4, 1fr);
  }
}
