﻿

/*** for PC Browser ***/
@media (min-width:401px)
{

body {
    font-family: Arial, sans-serif;
}
.container {
    display: flex;
    flex-wrap: wrap;
    width: 98%;
    max-width: 700px; /* サイト幅を700pxに設定 */
    margin: 0 auto;
    gap: 10px;
}

.box {
    flex: 1 1 calc(33.333% - 10px); /* 横3列に変更 */
    background-color: #fff;
    text-align: center;
    border: 1px solid #000;
    box-sizing: border-box;
    text-decoration: none;
    color: black;
    position: relative;
    padding: 0;
    height: 0;
    padding-bottom: calc(33.333% - 10px); /* 正方形を維持 */
    transition: background-color 0.3s; /* 背景色の変化をスムーズに */
}

.box::before {
    content: "";
    display: block;
    padding-top: 100%; /* 正方形を維持するためのパディング */
}

.box-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.box img {
    max-width: 100%; /* 画像の最大幅を100%に設定 */
    height: auto;
    background-color: transparent;
}

.box p {
    background-color: #eeeeee;
    padding: 10px 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.2; /* 行間を狭める */
    text-align: center; /* 中央揃え */
    border-radius: 5px; /* 角を丸くする */
    font-size: 14px; /* テキストサイズを小さくする */
}

.box:hover {
    background-color: rgba(103, 103, 103, 0.1); /* ホバー時に背景色を薄く変更 */
}

a.box {
    text-decoration: none; /* アンダーラインを削除 */
    color: black; /* リンクテキストの色を黒に設定 */
}


}
@media (max-width: 600px) {
    .box {
        flex: 1 1 calc(50% - 10px); /* 横2列に変更 */
        padding-bottom: calc(50% - 10px); /* 正方形を維持 */
    }
    .container::after {
        content: "";
        flex: 1 1 calc(50% - 10px); /* 空のボックスを追加してレイアウトを調整 */
    }
    .box img {
        max-width: 100%; /* スマホ時に画像サイズを縮小 */
    }
    .box p {
        font-size: 12px; /* スマホ時のテキストサイズを調整 */
        letter-spacing: 0.05em; /* 文字間のスペースを調整 */
        line-height: 1.4; /* スマホ時の行間を調整 */
    }
}

/*** for Smart Phone ***/
@media (max-width:400px)
{
body {
    font-family: Arial, sans-serif;
}
.container {
    display: flex;
    flex-wrap: wrap;
    width: 98%;
    max-width: 700px; /* サイト幅を700pxに設定 */
    margin: 0 auto;
    gap: 10px;
}

.box {
    flex: 1 1 calc(33.333% - 10px); /* 横3列に変更 */
    background-color: #fff;
    text-align: center;
    border: 1px solid #000;
    box-sizing: border-box;
    text-decoration: none;
    color: black;
    position: relative;
    padding: 0;
    height: 0;
    padding-bottom: calc(33.333% - 10px); /* 正方形を維持 */
    transition: background-color 0.3s; /* 背景色の変化をスムーズに */
}

.box::before {
    content: "";
    display: block;
    padding-top: 100%; /* 正方形を維持するためのパディング */
}

.box-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    align-items: center;
    padding: 10px;
    box-sizing: border-box;
}

.box img {
    max-width: 100%; /* 画像の最大幅を100%に設定 */
    height: auto;
    background-color: transparent;
}

.box p {
    background-color: #eeeeee;
    padding: 10px 0;
    margin: 0;
    width: 100%;
    box-sizing: border-box;
    line-height: 1.2; /* 行間を狭める */
    text-align: center; /* 中央揃え */
    border-radius: 5px; /* 角を丸くする */
    font-size: 14px; /* テキストサイズを小さくする */
}

.box:hover {
    background-color: rgba(103, 103, 103, 0.1); /* ホバー時に背景色を薄く変更 */
}

a.box {
    text-decoration: none; /* アンダーラインを削除 */
    color: black; /* リンクテキストの色を黒に設定 */
}


}
@media (max-width: 600px) {
    .box {
        flex: 1 1 calc(50% - 10px); /* 横2列に変更 */
        padding-bottom: calc(50% - 10px); /* 正方形を維持 */
    }
    .container::after {
        content: "";
        flex: 1 1 calc(50% - 10px); /* 空のボックスを追加してレイアウトを調整 */
    }
    .box img {
        max-width: 100%; /* スマホ時に画像サイズを縮小 */
    }
    .box p {
        font-size: 12px; /* スマホ時のテキストサイズを調整 */
        letter-spacing: 0.05em; /* 文字間のスペースを調整 */
        line-height: 1.4; /* スマホ時の行間を調整 */
    }
}