@import "./breakpoints.css";

/* Grid Container */

.grid-container {
    width: 100%;
    font-size: 1rem;
    margin: 0 1%;
    overflow: hidden;
    overflow-x: scroll; 
    padding-bottom: 1rem; 
    scroll-snap-type: x mandatory;

    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
    -webkit-scrollbar: none; /* Chrome, Safari and Opera */
}

.grid {
    display: inline-flex;
    gap: 1rem; 
    padding-left: 100%;
    padding-right: 100%;
}


.grid-item {
    display: flex;
    width: 30rem;
    flex: 0 1 auto;
    position: relative;
    aspect-ratio: 1;
    transform-style: preserve-3d;
    transition: transform 0.6s;
    perspective: 1000px;
    margin: 0 1rem;
    scroll-snap-align: center;
    scroll-snap-stop: always;
    overflow-wrap: anywhere;
}

.grid-item h2 {
    font-size: 2em;
    transition: transform 0.3s ease, filter 0.3s ease;
    margin: 0;
}

.grid-item a {
    text-decoration: none;
}

.grid-item h2:hover {
    transform: scale(1.02);
    filter: brightness(1.15);
}

@keyframes grow-font {
    from {font-size: 2rem;}
    to {font-size: 2.1rem;}
}

.grid-item h3 {
    font-size: 1em;
    margin: 0 0 0 0;
}


.grid-item .back p {
    font-size: 1.5em;
    padding: 1em;
}

.front, .back {
    width: 100%;
    height: 100%;
    position: absolute;
    top: 0;
    left: 0;
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    
    -webkit-box-shadow:inset 0px 0px 0px 1rem var(--primary-color);
    -moz-box-shadow:inset 0px 0px 0px 1rem  var(--primary-color);
    box-shadow:inset 0px 0px 0px 1rem  var(--primary-color);
    border-radius: 1rem;
}

/* don't mess with z-index! it'll cause text to show up no matter what rotation it's on." */

.back {
    background-color: var(--bg-color);
    color: var(--primary-color);
    transform: rotateY(180deg); /* initially backwards */
}


.grid-item.flipped {
    transform: rotateY(180deg);
}

.button-div {
    position: absolute; 
    top: 0; 
    right: 0;  
}

.button-flipper {
    background-color: var(--tertiary-color);
    padding: 0.4rem;
    border-radius: 1rem;
    font-size: 1em;
    border: transparent;
    color: var(--primary-color);
    cursor: pointer;
}

.button-flipper:hover {
    transform: scale(1.02);
    filter: brightness(1.15);
}

.text-box {
    text-align: center;
    padding: 3%;
}

.background-overlay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    background-color: #212121dc;
    width: 100%;
    height: 100%;  
}

.scroll-button {
    background-color: var(--tertiary-color);
    padding: 0.1rem;
    border-radius: 1rem;
    border: transparent;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1rem;
    width: 3rem;
    height: 3rem;
}

.scroll-button:hover {
    transform: scale(1.06);
    transform-origin: center;
    filter: brightness(1.15);
}

.scroll-button-nav {
    display: flex;
    justify-content: center;
}

.scroll-button-nav div {
    display: flex;
    justify-content: space-between;
    gap: 2rem;
}
