﻿/* ============================
   tablet.css（769px〜1024px）
============================ */

/* ------------------------------
   ① PC幅縮小対応（1280px〜1024px）
------------------------------ */
@media (max-width: 1280px) and (min-width: 1024px) {
    body {
        grid-template-columns: 1fr 
                              minmax(0, calc(17.5rem * 0.9)) 
                              minmax(0, calc(62.5rem * 0.9)) 
                              1fr;
        grid-template-areas:
            "header header header header"
            ". nav main ."
            "footer footer footer footer";
    }

    #mainContent {
        width: 100%;
        max-width: calc(62.5rem * 0.9);
        margin-left: 0;
    }

    #sideMenu {
        width: 100%;
        max-width: calc(17.5rem * 0.9);
    }
}

/* ------------------------------
   ② タブレット対応（1024px以下）
------------------------------ */
@media (max-width: 1024px) {

    body {
        display: flex;
        flex-direction: column;
        align-items: center;
    }

    #headerContent,
    #footerContent {
        width: 100%;
    }

    #headerContent {
        order: 0;
    }

    #sideMenu {
        order: 1;
        width: 100%;
        background-color: #e9e9e9;
        display: flex;
        justify-content: space-around;
        flex-wrap: wrap;
        padding: 0.5rem 0;
        position: relative;
        overflow: visible !important;
    }

        #sideMenu ul.sidemenu {
            display: flex;
            flex-wrap: wrap;
            list-style: none;
            justify-content: center;
            gap: 1rem;
            padding: 0;
            margin: 0;
        }

        #sideMenu ul li ul {
            display: none;
            position: absolute;
            background-color: #e9e9e9;
            padding: 0.5rem;
        }

    #mainContent {
        order: 2;
        width: 100%;
        box-sizing: border-box;
        padding: 1rem;
    }

    #footerContent {
        order: 3;
        margin-top: auto;
    }

    pre.prettyprint {
        width: 100%;
        overflow-x: auto;
        box-sizing: border-box;
    }
}

/* ------------------------------
   ③ タブレット用プルダウンメニュー対応
   （1024px〜768px）
------------------------------ */
@media (max-width: 1024px) and (min-width: 768px) {

    #sideMenu {
        width: 100%;
        background-color: #e9e9e9;
        padding: 0.5rem 0;
        display: flex;
        justify-content: center;
        box-sizing: border-box;
        position: relative;
        z-index: 10000 !important
    }

        #sideMenu ul.sidemenu {
            display: flex;
            gap: 1.5rem;
            align-items: center;
            list-style: none;
        }

        #sideMenu li {
            position: relative;
            margin: 0;
            font-weight: bold;
        }

    #works {
        cursor: pointer;
    }

        #works ul {
            display: none;
            position: absolute;
            top: 100%;
            left: 0;
            background-color: #e9e9e9;
            border: 1px solid #ccc;
            padding: 0.5rem 0;
            width: 10rem;
            box-sizing: border-box;
            white-space: nowrap;
            z-index: 15000 !important;
        }

        #works.open ul {
            display: block !important;
        }

        #works ul li a {
            display: block;
            width: 100%;
            padding: 0.4rem 0.75rem;
            text-align: left;
            box-sizing: border-box;
        }

            #works ul li a:hover {
                background-color: #4a6aa4;
                color: #fff;
            }
}