.portfolio-filters {
    text-align: center;
    margin: 2rem 0;
}

.portfolio-btn {
    background: linear-gradient(35deg, rgb(6,0,151) 0%, rgb(130,4,255) 73%, rgb(193,15,255) 100%);
    color: white;
    border: none;
    padding: 12px 44px;
    margin: 0 20px;
    border-radius: 5px;
    cursor: pointer;
    transition: opacity 0.3s ease;
}
/* Add this media query for mobile */
@media (max-width: 768px) {
    .portfolio-btn {
        margin: 10px 20px;  /* Adds vertical spacing when stacked */
    }
}
.portfolio-btn:hover {
    opacity: 0.9;
}

.portfolio-btn.active {
    box-shadow: 0 0 10px rgba(193,15,255,0.5);
}

.portfolio-section {
    opacity: 0;
    visibility: hidden;
    position: absolute;
    transition: opacity 0.4s ease;
    width: 100%;    /* Add this */
    height: 0;      /* Add this */
    overflow: hidden; /* Add this */
}

.portfolio-section.active {
    opacity: 1;
    visibility: visible;
    position: relative;
    height: auto;    /* Add this */
    overflow: visible; /* Add this */
}

/* Container to prevent layout shift */
.portfolio-container {
    position: relative;
    min-height: 400px; /* Adjust based on your content */
}

.work-portfolio-logo-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    justify-content: center;
    padding: 20px;
}

.work-portfolio-logo-item {
    flex: 0 0 calc(20% - 20px); /* 5 across */
    max-width: calc(20% - 20px);
    aspect-ratio: 1;
    background: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
	transition: transform 0.2s ease;
}
.work-portfolio-logo-item:hover {
    transform: scale(1.25);
    /* or */
    box-shadow: 0 0 15px rgba(193,15,255,0.3);
}

/* Responsive breakpoints */
@media (max-width: 1200px) {
    .work-portfolio-logo-item {
        flex: 0 0 calc(25% - 20px); /* 4 across */
        max-width: calc(25% - 20px);
    }
}

@media (max-width: 900px) {
    .work-portfolio-logo-item {
        flex: 0 0 calc(33.333% - 20px); /* 3 across */
        max-width: calc(33.333% - 20px);
    }
}

@media (max-width: 600px) {
    .work-portfolio-logo-item {
        flex: 0 0 calc(50% - 20px); /* 2 across */
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 400px) {
    .work-portfolio-logo-item {
        flex: 0 0 100%; /* 1 across */
        max-width: 100%;
    }
}

.work-portfolio-logo-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 10px;
}

.work-portfolio-graphics-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 30px;
    justify-content: center;
    padding: 20px;
}

.work-portfolio-graphics-item {
    flex: 0 0 calc(33.333% - 20px);
    max-width: calc(33.333% - 20px);
    aspect-ratio: 1;
    cursor: pointer;
    transition: transform 0.2s ease;
	 display: flex;          /* Add these */
    justify-content: center;
    align-items: center;
}
.work-portfolio-graphics-item img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;    /* This ensures image maintains aspect ratio */
}

/* Responsive grid */
@media (max-width: 900px) {
    .work-portfolio-graphics-item {
        flex: 0 0 calc(50% - 20px);
        max-width: calc(50% - 20px);
    }
}

@media (max-width: 600px) {
    .work-portfolio-graphics-item {
        flex: 0 0 100%;
        max-width: 100%;
    }
}

/* Modal styles */
.graphics-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
    z-index: 20000;
    justify-content: center;
    align-items: center;
}

.graphics-modal.active {
    display: flex;
}

.graphics-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: center;
}

.graphics-modal-content img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.graphics-modal-close {
    position: absolute;
    top: -40px;
    right: 0;
    color: white;
    font-size: 30px;
    cursor: pointer;
}

.portfolio-item {
    position: relative;
    overflow: hidden;
    cursor: pointer;
}

.portfolio-item figure {
    margin: 0;
    position: relative;
}

.portfolio-item img {
    display: block;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.overlay-hint {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 32px;
    height: 32px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 2;
}

.portfolio-item:hover .overlay-hint {
    opacity: 1;
}

.overlay-hint img {
    width: 100%;
    height: auto;
}

.site-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    overflow: auto;
}

.site-modal.active {
    display: flex;
}

.site-modal-content {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    justify-content: center;
    align-items: flex-start; /* Align to top */
    overflow-y: auto;
    overflow-x: hidden;
    scroll-behavior: smooth;
}

.site-modal-img {
    max-height: 90vh;
    width: auto;
    height: auto;
    cursor: zoom-in;
    transition: transform 0.3s ease;
    display: block;
    margin: 0 auto;
}

.site-modal-img.zoomed {
    width: 100%;
    height: auto;
    max-width: 100%;
    max-height: none;
    cursor: zoom-out;
    display: block;
}

.site-modal-close {
  all: unset;
  position: fixed;
  top: 30px;
  right: 60px;
  color: white;
  font-size: 24px;
  font-weight: bold;
  cursor: pointer;
  z-index: 10000;
  text-shadow: 0 0 2px black;
  border: 2px solid black;
  border-radius: 50%;
  width: 30px;
  height: 30px;
  line-height: 23px;
  text-align: center;
  background-color: rgba(255, 0, 0, 1);
}

@media (max-width: 600px) {
   .site-modal-close {
    top: 40px;
    right: 20px;
} 
}
.portfolio-btn:focus,
.graphics-modal-close:focus,
.site-modal-close:focus {
  outline: 2px solid #ffffff;
  outline-offset: 2px;
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}
