/* Gallery Page Specific Styles */

.header-section {
    display: flex;
    flex-direction: column;
    width: 100%;
    margin: 0 auto;
}

.work-header {
    grid-column: 1 / -1;
    grid-row: 1;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    margin-bottom: 20px;
}

.work-header img {
    width: 67%;
    height: auto;
    max-width: 100%;
    object-fit: contain;
    display: flex;
    align-items: flex-start;
    padding-top: 28px;
}

.work-text {
    grid-row: 2;
    grid-column: 1 / -1;
    text-align: center;
    width: 63%;
    margin: 0 auto;
    padding-bottom: 28px;
}

.gallery-section {
    grid-column: 1 / -1;
    display: flex;
    flex-direction: column;
    width: 60%;
    margin: 0 auto;
}

.social-media-work {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin: 0 15%;
    padding-bottom: 10px;
    min-height: calc(var(--scale-factor) * 50px);
}

.social-media-work a {
    display: flex;
    align-items: center;
    justify-content: center;
    width: calc(var(--scale-factor) * 22.5px);
    height: calc(var(--scale-factor) * 22.5px);
    /* aspect-ratio: 1/1; */
}

.social-media-work .icon {
    width: 100%;
    height: 100%;
    background-color: rgba(255,121,205,1);
    -webkit-mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

.gallery-container {
    display: flex;
    flex-direction: column;
    gap: 60px;
    z-index: 10;
    width: 100%;
    background: none !important;
    border-radius: 0 !important;
}

.social-text {
    font-size: calc(var(--text-scale-factor) * 16px);
    text-align: center;
    z-index: 10;
    padding: 10px;
    background: rgba(255, 121, 205, 1);
    border-radius: 0;
}

.gallery-group {
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-bottom: 40px;
}

.gallery-row {
    display: flex;
    gap: 1px;
    justify-content: center;
    width: 100%;
    max-width: 100%;
}

.gallery-image {
    width: 33%;
    min-width: 0;
    height: auto;
    aspect-ratio: 1/1;
    object-fit: cover;
    display: block;
    border: none !important;
    border-radius: 0 !important;
    background: #eee;
}

.image-modal {
    display: flex;
    align-items: center;
    justify-content: center;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0,0,0,0.85);
    flex-direction: column;
    transition: opacity 0.3s;
}

.image-modal .modal-content {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 10px;
    box-shadow: 0 0 30px #000a;
    margin-bottom: 20px;
    background: #fff;
}

.close-modal {
    position: absolute;
    top: 30px;
    right: 40px;
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    z-index: 1010;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-modal:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: scale(1.1);
}

.close-modal svg {
    width: 32px;
    height: 32px;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.5));
}

.modal-prev, .modal-next {
    position: absolute;
    top: 50%;
    color: #fff;
    font-size: 60px;
    cursor: pointer;
    z-index: 1010;
    user-select: none;
    text-shadow: 0 2px 8px #000;
    transform: translateY(-50%);
}

.modal-prev {
    left: 40px;
}

.modal-next {
    right: 40px;
}

.work-grid {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    grid-template-rows: auto auto auto auto;
    width: 90%;
    max-width: 100vw;
    margin: 0 auto;
    position: relative;
    gap: 20px;
    box-sizing: border-box;
}

.outer-wrapper {
    width: calc(var(--scale-factor) * 375px);
    max-width: 100vw;
    margin: 0 auto;
}

/* Responsive Media Queries */
@media (max-width: 768px) {
    .work-grid, .gallery-grid {
        width: 100vw;
        max-width: 100vw;
        gap: 0;
        height: auto;
    }
    
    .gallery-section {
        width: 90%;
        max-width: 100vw;
    }
    
    .work-text {
        font-size: max(16px, calc(var(--text-scale-factor) * 18.1px));
    }
    
    .social-media-work a {
        width: 12%;
        max-width: 45px;
    }
    
    .gallery-container {
        padding: 10px;
        gap: 30px;
    }
    
    .gallery-image {
        width: 32%;
    }
    
    .outer-wrapper {
        width: 100vw;
        max-width: 100vw;
    }
}

@media (max-width: 480px) {
    .social-media-work .icon {
        width: 30px;
        height: 30px;
    }
}

@media (max-width: 600px) {
    .gallery-image {
        width: 90px;
        height: 90px;
    }
    
    .image-modal .modal-content {
        max-width: 98vw;
        max-height: 60vh;
    }
    
    .close-modal {
        top: 20px;
        right: 20px;
        padding: 6px;
    }
    
    .close-modal svg {
        width: 24px;
        height: 24px;
    }
    
    .modal-prev, .modal-next {
        font-size: 36px;
    }
    
    .modal-prev {
        left: 16px;
    }
    
    .modal-next {
        right: 16px;
    }
}