/* --- MEDIA STYLES --- */

/* for screen 640px -  769px */
@media screen and (min-width: 640px) and (max-width: 769px) {
    .container {
        grid-template-rows: 0.3fr 3fr 0.1fr;
        grid-template-columns: 100%;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

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

    /* all menus */
    .menu,
    .item-menu {
        display: none;
    }

    /* dropdown menu button */
    #nav-toggle {
        display: inline-block;
    }

    /* dropdown menu content */
    .dropdown-content {
        top: 250px;
        width: 75%;
    }
}

/* for screen 510px -  640px */
@media screen and (min-width: 510px) and (max-width: 640px) {
    .container {
        grid-template-rows: 0.01fr 1fr 0.01fr;
        grid-template-columns: 100%;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

    /* title of page */
    .title {
        font-size: 28px;
    }

    /* subtitle of page */
    .subtitle {
        font-size: 24px;
    }

    /* footer of page */
    .footer {
        font-size: 18px;
    }

    /* main content of page */
    .main {
        justify-content: center;
    }

    /* link to reference book topic */
    .chapter {
        display: flex;
        width: 85%;
    }

    /* container for img */
    .scale {
        width: 60%;
    }

    /* paragraph in link */
    .chapter p {
        width: 40%;
    }

    /* all menus */
    .menu,
    .item-menu {
        display: none;
    }

    /* dropdown menu button */
    #nav-toggle {
        display: inline-block;
    }

    /* dropdown menu img (at button#nav-toggle) */
    .menu-icon {
        height: 40px;
    }

    /* dropdown menu content */
    .dropdown-content {
        top: 225px;
        width: 75%;
    }
}

/* for screen 355px -  510px */
@media screen and (min-width: 355px) and (max-width: 510px) {
    .container {
        grid-template-rows: 0.01fr 1fr 0.01fr;
        grid-template-columns: 100%;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

    /* title of page */
    .title {
        font-size: 24px;
    }

    /* subtitle of page */
    .subtitle {
        font-size: 18px;
    }

    /* footer of page */
    .footer {
        font-size: 16px;
    }

    /* main content of page */
    .main {
        justify-content: center;
    }

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

    /* all menus */
    .menu,
    .item-menu {
        display: none;
    }

    /* dropdown menu button */
    #nav-toggle {
        display: inline-block;
    }

    /* dropdown menu img (at button#nav-toggle) */
    .menu-icon {
        height: 35px;
    }

    /* dropdown menu content */
    .dropdown-content {
        top: 31%;
        width: 75%;
    }
}

/* for screen 0 - 355px */
@media screen and (max-width: 355px) {
    .container {
        grid-template-rows: 0.01fr 1fr 0.01fr;
        grid-template-columns: 100%;
        grid-template-areas:
            "header"
            "main"
            "footer";
    }

    /* title of page */
    .title {
        font-size: 24px;
    }

    /* subtitle of page */
    .subtitle {
        font-size: 18px;
    }

    /* footer of page */
    .footer {
        font-size: 16px;
    }

    /* main content of page */
    .main {
        justify-content: center;
    }

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

    /* all menus */
    .menu,
    .item-menu {
        display: none;
    }

    /* dropdown menu button */
    #nav-toggle {
        display: inline-block;
    }

    /* dropdown menu img (at button#nav-toggle) */
    .menu-icon {
        height: 35px;
    }

    /* dropdown menu content */
    .dropdown-content {
        top: 40%;
        width: 75%;
    }
}

/* dropdown menu content */
.dropdown-content {
    display: none;
    position: absolute;
    background-color: #f1f1f1;
    min-width: 160px;
    box-shadow: 0px 8px 16px 0px rgba(0, 0, 0, 0.2);
    z-index: 1;
}

/* item of dropdown menu content */
.dropdown-content a {
    color: black;
    padding: 12px 16px;
    text-decoration: none;
    display: block;
}

.dropdown-content a:hover {
    background-color: #ddd;
}

/* open dropdown menu */
.show {
    display: block;
}
