/* works grid — shared across all pages */

.works {
    padding: 150px 0;
    margin-bottom: 70px;
}

.grid {
    text-align: center;
}

/* clearfix */
.grid:after {
    content: '';
    display: block;
    clear: both;
}

/* ---- grid-item ---- */

.grid-item {
    /* vertical gutter */
    margin-bottom: 20px;
    border-color: hsla(0, 0%, 0%, 0.5);
    float: right;
    position: relative;
}
.grid-sizer, .grid-item{
    width: calc(25% - 15px);
}
.grid-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.stamp {
    position: absolute;
    background: white;
}
.stamp1 {
    left: 28%;
    top: 10px;
    width: 20%;
    height: 100px;
}
.stamp2 {
    right: 2%;
    top: 10px;
    width: 20%;
    height: 100px;
}
.grid-wrap{
    position: relative;
    overflow: hidden;
    aspect-ratio: 1 / 1;
}
.hover-on{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    opacity: 0;
    z-index: 10;
    background: #001ea0;
    overflow: hidden;
    cursor: pointer;
}
.touched{
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: block;
    opacity: 1;
    z-index: 10;
    background: #001ea0;
    transition: all 0.3s ease;
    overflow: hidden;
    cursor: pointer;
}
.project-details{
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    color: #fff;
    text-align: center;
}
.project-details .year{
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 2px;
    font-variant: small-caps;
    position: absolute;
    left: 0;
    right: 0;
    top: 4%;
    bottom: auto;
}
.project-details .project-name{
    font-size: 60px;
    font-weight: 700;
    letter-spacing: 3px;
    position: absolute;
    left: 0;
    right: 0;
    top: 43%;
    bottom: auto;
}
.project-details .double-line{
    position: absolute;
    left: 0;
    right: 0;
    top: 33%;
    bottom: auto;
}
.project-details .project-category{
    font-size: 22px;
    font-weight: 400;
    letter-spacing: 2px;

    position: absolute;
    left: 0;
    right: 0;
    top: 89%;
    bottom: auto;
}
@media (hover: hover) and (pointer: fine) {
    .grid-wrap:hover .hover-on{
        opacity: 1;
        animation: touched-slide-in ease 0.2s both;
    }
}

@keyframes touched-slide-in {
    from {
        transform: translateX(-100%);
    }
    to {
        transform: translateX(0);
    }
}


/* responsive grid rules */
@media (max-width: 1512px) {
    .project-details{
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    color: #fff;
    text-align: center;
}
.project-details .year{
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 2px;
    font-variant: small-caps;
    position: absolute;
    left: 0;
    right: 0;
    top: 4%;
    bottom: auto;
}
.project-details .project-name{
    font-size: 48px;
    font-weight: 700;
    letter-spacing: 2px;
    position: absolute;
    left: 0;
    right: 0;
    top: 42%;
    bottom: auto;
}
.project-details .double-line{
    position: absolute;
    left: 0;
    right: 0;
    top: 31%;
    bottom: auto;
}
.project-details .project-category{
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 2px;

    position: absolute;
    left: 0;
    right: 0;
    top: 89%;
    bottom: auto;
}
}

@media (max-width: 1024px) {
    .works {
        padding: 80px 0;
    }
    /* exact thirds with 20px gutter: 3*(33.333% - 13.333px) + 2*20px = 100% */
    .grid-sizer, .grid-item {
        width: calc(33.333% - 13.333px);
    }
    .grid {
        margin-top: 50px;
    }
    .stamp2 {
        display: none;
    }
    .stamp1 {
        left: 40%;
    }
    .hover-on .project-details .year{
        font-size: 20px;
        font-weight: 400;
        letter-spacing: 2px;
    }
    .project-details .project-name{
        font-size: 44px;
        font-weight: 600;
        letter-spacing: 3px;
        position: absolute;
        left: 0;
        right: 0;
        top: 41%;
        bottom: auto;
    }
    .project-details .double-line{
    position: absolute;
    left: 0;
    right: 0;
    top: 33%;
    bottom: auto;
}
    .project-details .project-category{
        font-size: 20px;
        font-weight: 400;
        letter-spacing: 2px;       
        position: absolute;
        left: 0;
        right: 0;
        top: 87%;
    }
}

@media (max-width: 947px){
    .hover-on .project-details .year{
        font-size: 16px;
        font-weight: 400;
        letter-spacing: 2px;
    }
    .project-details .project-name{
        font-size: 34px;
        font-weight: 600;
        letter-spacing: 2px;
    }
    .project-details .project-category{
        font-size: 16px;
        font-weight: 400;
        letter-spacing: 2px;       
        position: absolute;
        left: 0;
        right: 0;
        top: 87%;
    }
    .grid {
        margin-top: 50px;
    }
    /* exact thirds with 22px gutter (loader bumps gutter below 947px):
       3*(33.333% - 14.667px) + 2*22px = 100% */
    .grid-item {
        width: calc(33.333% - 14.667px);
    }
    .grid-sizer {
        display: none;
    }
}

/* tablet tuning — slightly larger hover text than phone 
@media (max-width: 947px) and (min-width: 600px) {
    .hover-on .project-details .year {
        font-size: 18px;
    }
    .project-details .project-name {
        font-size: 32px;
    }
    .project-details .project-category {
        font-size: 20px;
    }
}*/
/* smartphone */
@media (max-width: 500px) {
    .grid-item{
        width: 100%;
    }
    .grid-item a img{
        width: 100%;
    }
    .grid-sizer, .stamp{
        display: none;
    }
    .grid {
        margin-top: 90px;
    }
    .hover-on .project-details .year{
        font-size: 18px;
        font-weight: 400;
        letter-spacing: 2px;
        position: absolute;
        left: 0;
        right: 0;
        top: 4%;
    }
    .project-details .project-name{
        font-size: 50px;
        font-weight: 700;
        letter-spacing: 2px;
        position: absolute;
        left: 0;
        right: 0;
        top: 42%;
    }
    .project-details .double-line{
        position: absolute;
        left: 0;
        right: 0;
        top: 33%;
        bottom: auto;
    }
    .project-details .project-category{
        font-size: 18px;
        font-weight: 400;
        letter-spacing: 2px;
        position: absolute;
        left: 0;
        right: 0;
        top: 89%;
    }
}
