* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  
}

body {
  background-color: #000000; 
  color: #e0e0e0;
  min-height: 100vh; 
}




.headin {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  width: 100%;
  margin-bottom: 50px;
  padding-left: 40px; 
}

.sortbuttons {
  display: flex;
  gap: 30px;
}

button {
  border: none;
  background: none;
  font-weight: bold;
  color: #e0e0e0;
  cursor: pointer; 
  font-size: 13px;
  transition: color 0.3s ease-in-out;
  text-transform: uppercase;
}

button:active, button:hover, button.active {
  color: var(--primary, red);
}

.wrapper {
  margin-top: 0px;
}

.projects {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(400px, 1fr));
  gap: 20px;
  justify-content: center;
  padding: 50px 20px 50px 20px;
  align-items: center;
}



.post {
  position: relative;
  opacity: 1 !important;
  transform: none !important;
  animation: none !important;
  visibility: visible !important;
  
  
  display: flex;
  justify-content: center;
  align-items: center;
}


.post a {
  position: relative; 
  display: flex;
  max-width: 100%;
  text-decoration: none;
}

.post img {
  display: block;
  
  width: auto; 
  max-width: 100%;
  height: auto; 
  max-height: 400px; 
  object-fit: contain;
  transition: transform 0.3s;
  
  
  opacity: 1 !important; 
  transform: none !important;
  animation: none !important;
}

.post .overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: rgba(255, 0, 0, 0.9);
  opacity: 0;
  transition: opacity 0.3s;
  cursor: pointer;
}

img:hover {
  opacity: 0.5;
}

.post:hover .overlay {
  opacity: 1;
}

.post .overlay h3 {
  color: antiquewhite;
  font-size: 20px;
  text-align: center;
  margin: 0;
  padding: 0 15px; 
}

.post .image-container {
  position: relative;
  width: 100%;
  height: 400px;
  
}

.post .image-container img {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
}

.post img.landscape {
  width: auto;
  max-height: 100%;
}


html { scrollbar-width: none; } 
body { -ms-overflow-style: none; } 
body::-webkit-scrollbar, body::-webkit-scrollbar-button { display: none; } 


::view-transition-group(*) {
  animation-duration: 0.6s;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}



@media (max-width: 768px) {
  
  .headin {
    margin-top: 40px; /* CHANGED: Increases the gap at the top just for phones */
    padding: 0;       /* CHANGED: Strips away the desktop left-padding so it can mathematically center */
    justify-content: center; /* Forces the flexbox to center */
    margin-bottom: 15px;
    }

  /* 2. The Buttons: Keeps them centered if they wrap to a second line */
  .sortbuttons {
    gap: 15px;
    flex-wrap: wrap;
    justify-content: center; 
    padding: 0; /* Keeps the spacing equal on left and right */
  }
  button {
    font-size: 13px; 
  }

  
  .projects {
    grid-template-columns: 1fr;
    padding: 30px 15px 30px 15px;
    gap: 30px; 
  }

  
  
  .post .image-container, 
  .post img {
    height: 450px; 
    width: auto;
    max-width: 100%; 
  }
  
  .post .overlay h3 {
    font-size: 18px;
  }

  
}