.portfolio-bg {
    position: relative;
    z-index: 4;
    background-image: image-set(url('../../images/wallpaper.avif') type('image/avif'),
            url('../../images/wallpaper.webp') type('image/webp'),
            url('../../images/wallpaper.png') type('image/png'));
    background-repeat: repeat-x repeat-y;
    background-position: left top;
    background-size: auto 20%;
    height: auto;
    min-height: 90vh;
    width: 100%;
    margin-top: -24px;
}

#portfolios_header {
    top: 38px;
}

.sconce {
    position: absolute;
    width: 10%;
    top: 27%;
}

.sconce img {
    width: 100%;
    height: 100%;
}

.sconce.off {
    filter: drop-shadow(0px 3px 3px #00000080);
}

.sconce.on {
    filter: drop-shadow(2px -16px 51px #ffdd96a0) drop-shadow(0px 3px 3px #00000080);
}

#sconce_1 {
    right: 4%;
}

#sconce_2 {
    left: 4%;
}

#portfolio_container {
    width: 100%;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 40px 30px;
    box-sizing: border-box;
}


#other_projects_btn {
    font-size: 1.5rem;
    background: image-set(url('../../images/golden-frame.avif') type('image/avif'),
            url('../../images/golden-frame.webp') type('image/webp'),
            url('../../images/golden-frame.png') type('image/png'));
    background-size: 100% 100%;
    text-align: center;
    padding: 28px 20px;
    aspect-ratio: 1.8;
    display: flex;
    justify-content: center;
    align-items: center;
    width: 244px;
    font-family: 'vazirmatn';
    font-weight: bold;
    position: absolute;
    right: 100px;
    bottom: 38px;
    filter: drop-shadow(-1px 1px 1px rgba(0, 0, 0, 0.4));
}

#other_projects_btn a {
    color: black;
    text-decoration: none;
}

#other_projects_btn:hover a {
    color: red;
    text-decoration: underline;
}

.gallery-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    grid-auto-rows: minmax(70px, auto);
    gap: 12px 17px;
    align-items: center;
    justify-items: center;
    aspect-ratio: 1.7;
    margin-top: 100px;
}

.frame-wrapper {
    width: 100%;
    height: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    overflow: hidden;
    filter: drop-shadow(0px 1px 2px rgba(0, 0, 0, 0.4));
}

.frame-wrapper::after {
    content: "";
    display: block;
    width: 155px;
    height: 30px;
    margin-top: -52px;
    background-image: image-set(url('../../images/header-frame.avif') type('image/avif'),
            url('../../images/header-frame.webp') type('image/webp'),
            url('../../images/header-frame.png') type('image/png'));
    background-size: calc(100% - 52px) 100%;
    background-repeat: no-repeat;
    background-position: center;
    flex-shrink: 0;
    box-sizing: content-box;
    z-index: 2;
    filter: drop-shadow(0px 1px 1px rgba(145, 123, 3, 0.4));
}

.frame-item {
    width: 100%;
    height: 100%;
    box-sizing: border-box;

    border: 17px solid transparent;
    border-image-source: image-set(url('../../images/wooden-frame3.avif') type('image/avif'),
            url('../../images/wooden-frame3.webp') type('image/webp'),
            url('../../images/wooden-frame3.png') type('image/png'));
    border-image-slice: 50;
    border-image-repeat: stretch;

    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.frame-item::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: calc(100% - 34px);
    height: calc(100% - 34px);
    box-shadow: inset 0 0 20px rgba(0, 0, 0, 0.6);
    pointer-events: none;
    margin: 17px;
}

.frame-item picture {
    width: 100%;
    height: 100%;
}

.frame-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    position: relative;
}

.frame-text {
    font-family: 'lalezar';
    position: absolute;
    bottom: 24px;
    z-index: 3;
    color: black;
}

.frame-item:hover {
    cursor: pointer;
}

.frame-item:hover .frame-text {
    color: red;
}

.frame-1 {
    grid-column: 1 / 2;
    grid-row: 1 / 3;
    aspect-ratio: 1 / 1;
    width: 100%;
}

.frame-2 {
    grid-column: 2 / 3;
    grid-row: 1 / 4;
    aspect-ratio: 30 / 40;
    width: 100%;
    margin-top: -23px;
}

.frame-3 {
    grid-column: 3 / 4;
    grid-row: 1 / 3;
    aspect-ratio: 1 / 1;
    width: 100%;
    margin-top: -103px;
}

.frame-4 {
    grid-column: 4 / 6;
    grid-row: 1 / 3;
    aspect-ratio: 50 / 40;
    width: 100%;
}

.frame-5 {
    grid-column: 1 / 2;
    grid-row: 3 / 5;
    aspect-ratio: 30 / 20;
    width: calc(100% + 43px);
    margin-top: 23px;
    margin-left: 43px;
}

.frame-6 {
    grid-column: 2 / 3;
    grid-row: 4 / 6;
    aspect-ratio: 40 / 50;
    width: 100%;
}

.frame-7 {
    grid-column: 3 / 4;
    grid-row: 3 / 5;
    aspect-ratio: 30 / 20;
    width: 100%;
    margin-top: -71px;
}

.frame-8 {
    grid-column: 3 / 4;
    grid-row: 5 / 7;
    aspect-ratio: 1 / 1;
    width: 100%;
    margin-top: -40px;
}

.frame-9 {
    grid-column: 4 / 5;
    grid-row: 3 / 6;
    aspect-ratio: 30 / 40;
    width: 100%;
    height: calc(100% - 50px);
    margin-top: -14px;
    margin-left: -0px;
}

.frame-10 {
    grid-column: 5 / 6;
    grid-row: 3 / 5;
    aspect-ratio: 20 / 30;
    width: calc(100% + 60px);
    align-self: start;
    margin-top: 4px;
    margin-left: -60px;
}

@media (min-width: 2000px) {
    #portfolio_container {
        width: 60%;
        max-width: unset;
        padding-bottom: 10px;
    }
}

@media (max-width: 1600px) {
    #sconce_1 {
        right: 2%;
    }

    #sconce_2 {
        left: 2%;
    }
}

@media (max-width: 1400px) {
    #sconce_1 {
        right: 2px;
    }

    #sconce_2 {
        left: 2px;
    }
}

@media (max-width: 1350px) {
    .portfolio-bg {
        height: auto;
    }

    #portfolio_container {
        max-width: 950px;
        padding: 30px 20px 60px;
    }

    .gallery-grid {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: minmax(60px, auto);
        gap: 15px 20px;
        margin-top: 40px;
        aspect-ratio: auto;
    }

    .frame-wrapper {
        margin: 0 !important;
        width: 100% !important;
        height: auto !important;
    }

    .frame-4 {
        grid-column: 1 / 3;
        grid-row: 1 / 3;
        aspect-ratio: 50 / 35;
    }

    .frame-3 {
        grid-column: 3 / 4;
        grid-row: 1 / 3;
        aspect-ratio: 1 / 1;
    }

    .frame-2 {
        grid-column: 4 / 5;
        grid-row: 1 / 4;
        aspect-ratio: 30 / 42;
    }

    .frame-10 {
        grid-column: 1 / 2;
        grid-row: 3 / 5;
        aspect-ratio: 40 / 30;
    }

    .frame-9 {
        grid-column: 2 / 3;
        grid-row: 3 / 6;
        aspect-ratio: 30 / 42;
    }

    .frame-7 {
        grid-column: 3 / 4;
        grid-row: 3 / 5;
        aspect-ratio: 1 / 1;
    }

    .frame-6 {
        grid-column: 4 / 5;
        grid-row: 4 / 6;
        aspect-ratio: 40 / 32;
    }

    .frame-1 {
        grid-column: 1 / 2;
        grid-row: 5 / 7;
        aspect-ratio: 1 / 1;
    }

    .frame-5 {
        grid-column: 2 / 4;
        grid-row: 6 / 8;
        aspect-ratio: 50 / 30;
    }

    .frame-8 {
        grid-column: 4 / 5;
        grid-row: 6 / 8;
        aspect-ratio: 40 / 28;
    }
}

@media (max-width: 1200px) {
    #portfolio_container {
        padding: 20px 100px;
    }

    #other_projects_btn {
        right: 10px;
        bottom: 10px;
        font-size: 1.2rem;
        width: 180px;
    }
}

@media (max-width: 800px) {
    .portfolio-bg {
        background-size: auto 5%;
    }

    .sconce,
    #light_switch_3 {
        display: none;
    }

    #portfolio_container {
        padding: 40px 10px 50px;
    }

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: auto;
        gap: 15px 12px;
        margin-top: 20px;
        aspect-ratio: auto;
    }

    .frame-wrapper {
        margin: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    .frame-item {
        border-width: 10px !important;
        border-image-slice: 35 !important;
    }

    .frame-item::after {
        width: calc(100% - 20px);
        height: calc(100% - 20px);
        margin: 10px;
    }

    .frame-wrapper::after {
        width: 199px;
        height: 38px;
        margin-top: -53px;
        background-size: 100% 100%;
    }

    .frame-text {
        font-size: 27px;
        bottom: 12px;
    }

    .frame-2 {
        grid-column: 1 / 2;
        grid-row: 1 / 3;
        aspect-ratio: 3 / 4;
    }

    .frame-3 {
        grid-column: 2 / 3;
        grid-row: 1 / 3;
        align-self: center;
        aspect-ratio: 1 / 1;
        padding: 15% 0;
    }

    .frame-3 .frame-item::after {
        height: calc(70%);
        margin: 10px;
        margin-top: calc(15% + 10px);
    }

    .frame-3 .frame-text {
        bottom: calc(15% + -3px);
    }

    .frame-4 {
        grid-column: 1 / 3;
        grid-row: 3 / 4;
        aspect-ratio: 16 / 9;
    }

    .frame-9 {
        grid-column: 1 / 2;
        grid-row: 4 / 6;
        aspect-ratio: 3 / 4;
    }

    .frame-10 {
        grid-column: 2 / 3;
        grid-row: 4 / 5;
        aspect-ratio: 4 / 3;
    }

    .frame-1 {
        grid-column: 2 / 3;
        grid-row: 5 / 6;
        aspect-ratio: 1 / 1;
    }

    .frame-8 {
        grid-column: 1 / 3;
        grid-row: 6 / 7;
        aspect-ratio: 4 / 3;
        padding: 0 60px;
    }

    .frame-8 .frame-item::after {
        width: calc(100% - 140px);
        margin-left: 70px;
    }

    .frame-5 {
        grid-column: 1 / 3;
        grid-row: 7 / 8;
        aspect-ratio: 16 / 9;
    }

    .frame-6 {
        grid-column: 1 / 2;
        grid-row: 8 / 9;
        aspect-ratio: 4 / 3;
    }

    .frame-7 {
        grid-column: 2 / 3;
        grid-row: 8 / 9;
        aspect-ratio: 1 / 1;
    }

    .frame-wrapper img {
        scale: 1 !important;
        top: 0 !important;
        bottom: 0 !important;
    }

    #other_projects_btn {
        position: initial;
        margin: 10px auto;
    }
}

@media (max-width: 500px) {
    .frame-wrapper::after {
        width: 130px;
    }

    .frame-text {
        font-size: 23px;
        bottom: 16px;
    }

    .frame-3 .frame-text {
        bottom: calc(15% + 4px);
    }
}