/* ----- ONLY HOMEPAGE STYLES ----- */

.container {
    grid-template-rows: 0.3fr 3fr 0.05fr;
    grid-template-areas:
        "header"
        "main"
        "footer";
}

.main {
    grid-area: main;
    display: flex;
    flex-flow: row wrap;
    justify-content: space-between;
}

/* --- link --- */

/* link to reference book topic */
.chapter {
    display: block;
    width: 22%;
    margin-top: 20px;
    border: 5px double rgb(0, 61, 23);
    border-radius: 5px;
    text-decoration: none;
    color: black;
    font-weight: 500;
    font-size: 16px;
    text-transform: uppercase;
    text-align: center;
    background: rgba(238, 238, 238, 0.5);
    opacity: 0.8;
}

.chapter:hover {
    transition: opacity 1s;
    opacity: 1;
}

/* container for img */
.scale {
    display: inline-block;
    overflow: hidden;
}

/* img in link */
.chapter img {
    width: 100%;
    height: 200px;
    transition: 1s;
    display: block;
}

.chapter:hover .scale img {
    transform: scale(1.2);
}

/* paragraph in link */
.chapter p {
    padding: 10px;
}

/* --- Media only home page styles --- */

@media screen and (min-width: 980px) and (max-width: 1200px) {
    .container {
        grid-template-columns: 1fr;
    }

    /* link to reference book topic */
    .chapter {
        width: 30%;
    }
}

@media screen and (min-width: 770px) and (max-width: 980px) {
    /* link to reference book topic */
    .chapter {
        width: 45%;
    }
}
