@charset "UTF-8";

/* ========================================================= */
/* 共通スタイル（PCおよびモバイルの基本設定） */
/* ========================================================= */

/* 1. ヘッダーとナビゲーションの基本構造の修正 */
header {
    background-color: aqua; /* ヘッダー背景色 */
}

/* メインメニュー（#menu-mainmenu）の基本設定 - PCでは横並び */
#menu-mainmenu {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex; /* Flexboxで横並び */
    justify-content: space-around; 
    flex-wrap: wrap; /* 項目が多い場合に折り返しを許可 */
}

/* メインメニュー項目（li） */
#menu-mainmenu li {
    margin: 5px; 
}

/* リンク（a）の基本設定 */
#menu-mainmenu a {
    text-decoration: none;
    color: #333; 
    padding: 10px 15px; 
    display: block;
    border-radius: 5px;
}

/* 2. bodyのスタイル */
body {
    text-align: center;
    background-image: url(button/backdesign.png);
    background-repeat: no-repeat;
    background-position-x: center;
    background-size: cover;
    background-color: beige;
    color: blue;
}

/* 3. tableのスタイル */
table {
    /* PCでは中央配置を維持 */
    margin-left: auto;
    margin-right: auto;
    text-align: center;
    font-family: fantasy;
    font-size: large;
    /* モバイル用に罫線を調整するため、デフォルトのborderを調整 */
    border-collapse: collapse;
}
td {
    text-align: center;
}

/* 4. フッターと特定要素 */
footer {
    background-color: aliceblue;
}
#text-container {
    background-color: antiquewhite;
    font-size: 1.2rem;
    color: blueviolet;
}

/* 5. 画像サイズ設定 */
#resized-image { height: 90px; width: auto; }
#resized-image2 { height: 200px; width: auto; }
#resized-image3 { height: 500px; width: auto; }
#resized-image4 { width: 180px; height: 90px; }


/* ========================================================= */
/* スマートフォン対応 (画面幅600px以下で適用) */
/* ========================================================= */
@media screen and (max-width: 600px) {

    /* --- 1. メインメニュー（ULタグ）の調整 --- */
    #menu-mainmenu {
        flex-direction: column; /* 縦並びに変更 */
        align-items: center; 
        margin-bottom: 20px;
    }
    
    #menu-mainmenu li {
        width: 95%; /* 画面幅近くまで広げる */
        margin: 4px auto; /* 縦スペース */
    }
    
    #menu-mainmenu a {
        padding: 12px 10px; 
        border: 1px solid #ddd;
        /* モバイルでは幅100%は li で設定するため削除 */
        /* width: 100%; <- li が親要素の幅を制御するため不要 */ 
    }

    /* --- 2. コンテンツ内のテーブル（TABLEタグ）の調整 --- */
    table {
        width: 100%; /* 画面幅いっぱいに広げる */
        border: none !important; /* テーブルの罫線を非表示に（border="1"の上書き） */
    }
    
    /* trをブロック要素にし、各メニュー行を分離 */
    table tr {
        display: block; 
        width: 100%;
        margin-bottom: 15px;
        /* メニューの区切り線として利用 */
        border: 1px solid #ccc;
        border-radius: 8px;
        background-color: #ffffff;
    }
    
    /* tdを横並びに戻し、画像とテキストを左右に配置（2列レイアウト） */
    table td {
        display: inline-block; 
        width: 49%; /* ほぼ半分の幅 */
        vertical-align: middle; 
        border: none;
        padding: 10px 0;
    }
    
    /* HTMLで使われている画像 + テキストのペアを適切に表示 */
    table tr td:nth-child(2n+1) { /* 奇数番目のtd（画像）*/
        text-align: left;
        padding-left: 10px;
    }
    table tr td:nth-child(2n) { /* 偶数番目のtd（テキスト）*/
        text-align: right;
        padding-right: 10px;
    }

    /* --- 3. 画像サイズ（ID指定画像）の調整 --- */
    #resized-image { height: 60px; }
    #resized-image2 { height: 100px; }
    #resized-image3 { height: 300px; }
    #resized-image4 { width: 150px; height: 60px; }

    /* 動画のサイズ調整 */
    video {
        width: 100px !important; 
        height: 100px !important;
    }

    /* --- 4. フッターの調整 --- */
    footer h3 {
        text-align: center;
        margin: 5px auto;
        font-size: small;
    }
}
