/* READ ME */

.read-me .overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgb(0, 0, 0);
    opacity: 0.7;
    z-index: 1;
    display: none;
}

.read-me .content {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0);
    background: rgb(220, 220, 220);
    width: 500px;
    height: fit-content;
    z-index: 2;
    text-align: center;
    padding: 20px;
    box-sizing: border-box;
    border-radius: 0.8em;
}

.read-me .close-btn {
    position: absolute;
    right: 20px;
    top: 15px;
    width: 30px;
    height: 30px;
}

.read-me.active .overlay {
    display: block;
    /* add fading effect */
}

.read-me.active .content {
    transition: all 300ms ease-in-out;
    transform: translate(-50%, -50%) scale(1);
}

.read-me .title {
    font-size: 1.8em;
}

.read-me .text {
    margin-top: 1em;
    font-size: 1.1em;
}

.read-me-btn-wrapper {
    text-align: center;
    margin-top: 1.5em;
}

.read-me-btn {
    position: relative;
    font-size: 1.2rem;
    width: 8em;
    height: 3.5em;
    border: 1px solid rgb(100, 100, 100);
    background-color: aliceblue;
    z-index: 0;
}

.read-me-btn::after {
    content: '';
    position: absolute;
    width: 100%;
    height: 100%;
    top: 0;
    left: 0;
    background-color: rgba(0, 0, 0, 0.2);
    z-index: -1;
    transition: transform 200ms ease-in;
    transform: scaleX(0);
    transform-origin: right;
}

.read-me-btn:hover::after {
    transform: scaleX(1);
    transform-origin: left;
}

/* SHEET */

.table-wrapper {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    margin: 2em auto;
    /* width: 45%; */
    max-width: fit-content;
    height: auto;
}

.set-name {
    border: 2px solid black;
    text-align: center;
    grid-column: 1 / -1;
    font-size: 1.5em;
    line-height: 2em;
}

.image-container {
    display: flex;
    justify-content: center;
    align-items: center;
    border-left: 2px solid black;
    border-bottom: 2px solid black;
    border-right: 2px solid black;
}

.image {
    width: 10em;
    margin: 1em;
    outline: 1px solid black;
    -moz-outline-radius: 0.2em;
    transition-duration: 150ms;
}

.image:hover {
    transform: translateY(-3px);
}

.algorithm {
    display: flex;
    justify-content: center;
    align-items: center;
    border-right: 2px solid black;
    border-bottom: 2px solid black;
    grid-column: 2 / -1;
    font-size: 1.4em;
    line-height: 2;
}

/* PHONE LAYOUT */

@media only screen and (max-width: 700px) {
    /* MENU */

    header {
        height: 5em;
    }
    
    .menu {
        height: 5em; /* same as the height of header */
        justify-content: space-between;
    }
    
    .menu ul li {
        line-height: 5em; /* same as the height of header */
        display: none;
    }

    .brand-title {
        display: inline-block;
    }

    .toggle-button {
        display: flex;
    }

    /* READ ME */

    .read-me .content {
        max-width: 80%;
        height: fit-content;
    }

    .read-me .close-btn {
        right: 15px;
        top: 10px;
        width: 20px;
        height: 20px;
    }

    .read-me .title {
        font-size: 1.2em;
    }

    .read-me .text {
        font-size: 0.8em;
    }

    .read-me-btn {
        font-size: 0.8rem;
        width: 7em;
        height: 3em;
    }

    /* SHEET */

    .table-wrapper {
        margin-top: 1.5rem;
        max-width: 90%;
    }

    .set-name {
        font-size: 0.8em;
        line-height: 1.8em;
    }

    .image {
        width: 5.5rem;
        margin: .5rem;
    }

    .algorithm {
        font-size: 1rem;
        line-height: 2;
        padding: 0;
    }
}

@media only screen and (max-width:414px) {
    header {
        height: 4em;
    }
    
    .menu {
        height: 4em;
    }
    
    .menu ul li {
        line-height: 4em; /* same as the height of header */
    }
}