@import url('https://fonts.googleapis.com/css2?family=Bitcount+Grid+Double&display=swap');
@import url('https://fonts.googleapis.com/css2?family=PT+Serif:wght@400;700&display=swap');

* {
    box-sizing: border-box;
}

body {
    margin: 0;
    background-image: url("images/more_clouds.jpeg");
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* NAVIGATION BAR STUFF */
.navbar {
    background-color: rgb(30, 30, 30, 0.5);
    display: flex;
    justify-content: space-between;
    align-items: center;

    position: relative;

    width: 100%;
    padding: 20px 40px;
}

.nav-links {
    display: flex;
    gap: 20px;
}

.nav-links a {
    display: flex;
    align-items: center;
    justify-content: center;

    width: 250px;
    height: 50px;

    color: white;
    text-decoration: underline;

    font-family: 'Bitcount Grid Double', sans-serif;
    font-weight: bold;
}

#heading {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);

    margin: 0;
    text-align: center;
    font-family: 'Bitcount Grid Double', sans-serif;
    font-size: 60px;
}


/* OPACITY TOGGLE */
.opacity-toggle {
    width: 70px;
    height: 36px;
    position: relative;
    display: inline-block;
}

.opacity-toggle input {
    display: none;
}

.slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background: rgb(146, 208, 255);
    border-radius: 40px;
    transition: 0.3s;
}

.slider::before {
    content: "";
    position: absolute;
    height: 28px;
    width: 28px;
    left: 4px;
    bottom: 4px;
    background: white;
    border-radius: 50%;
    transition: 0.3s;
}

.opacity-toggle input:checked + .slider {
    background: rgb(60, 160, 255);
}

.opacity-toggle input:checked + .slider::before {
    transform: translateX(34px);
}








/* IMAGE GRID */
.image-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0px 10px;

    width: 100%;
    height: calc(100vh - 220px);
    padding: 20px;
    margin: 190px auto 0 auto;
}

/* LINK BOX GROWS */
.image-link {
    display: flex;
    width: 75%;
    height: 150px;

    text-decoration: none;
    color: inherit;

    transition: transform 0.5s ease 1s;
}

/* .image-link:hover {
    width: 100%;
    height: 300px;
    transition: width 0.5s ease 0s, height 0.5s ease 0s;  
} */

.image-link:hover {
    /* transform: scale(1.25); */
    transform: scale(1.2, 1.3);
    transition: transform 0.5s ease 0s;
}




/* Left column grows toward the middle */
.image-link:nth-child(odd) {
    justify-self: start;
    transform-origin: left center;
}

/* Right column grows toward the middle */
.image-link:nth-child(even) {
    justify-self: end;
    transform-origin: right center;
}

.image-box {
    width: 100%;
    height: 100%;

    border: 2px solid white;
    position: relative;
    overflow: hidden;
}

.image-box img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;

    /* opacity: 1; */
    transition: opacity 1s ease 1s, transform 1s ease 1s;
    /* transition: transform 0.5s ease, opacity 0.5s ease; */
}

.image-text {
    position: absolute;
    top: 20px;
    left: 20px;
    margin: 0;

    max-width: 90%;
    overflow-wrap: break-word;
    word-wrap: break-word;

    color: white;
    font-size: 35px;
    font-family: 'PT Serif', serif;
    font-weight: bold;
    text-transform: uppercase;


    transition: transform 0.5s ease;
}

/* SMOOTH TEXT SWAP */
.normal-text,
.hover-text {
    position: absolute;
    top: 0;
    left: 0;
    white-space: nowrap;

    transition: opacity 0.5s ease 0.3s, transform 0.5s ease 0.3s;
}

.normal-text {
    opacity: 1;
    transform: translateY(0);
}

.hover-text {
    opacity: 0;
    /* display: none; */
    transform: translateY(10px);
    /* text-shadow:
        -2px -2px 0 black,
        2px -2px 0 black,
        -2px  2px 0 black,
        2px  2px 0 black; */
}

/* HOVER EFFECTS */


.image-link:hover img {
    transform: scale(1.15);
    /* opacity: 1; */
    transition: opacity 0.3s ease, transform 0.5s ease; /* showing up fast */

    
}

.image-link:hover .image-text {
    transform: scale(1.15);
    transform-origin: top left;
    
}

.image-link:hover .normal-text {
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity 0.5s ease 0s, transform 0.5s ease 0s;
}

.image-link:hover .hover-text {
    opacity: 1;
    transform: translateY(0);
}




/* MOBILE */
@media only screen and (max-width: 600px) {
    #heading {
        font-size: 38px;
        opacity: 0 !important;
    }

    .navbar {
        flex-direction: column;
        gap: 15px;
        padding: 15px;
    }

    .nav-links {
        gap: 10px;
    }

    .nav-links a {
        width: 120px;
        height: 45px;
        font-size: 11px;
        text-align: center;
    }

    .image-grid {
        height: calc(100vh - 190px);
        gap: 10px;
        padding: 10px;
        margin: 20px auto 0 auto;
    }

    .image-link {
        width: 100%;
    }

    .image-text {
        font-size: 25px;
        top: 10px;
        left: 10px;
    }

    .image-link:hover .image-text {
        transform: scale(1.1);
    }
}