/* 全体のスタイル */
:root {
    --max-width: 1000px;
    --primary-color: #333;
    --background-color: #F0F0F0;
    --light-gray: #d3d3d3;
    --link-color: #583822;
    --link-hover: #765c47;
    --link-visited: #765c47;
}

body {
    font-family: "Inter", "Roboto", "Arial", "Noto Sans JP", "Yu Gothic UI", "Meiryo", sans-serif;
    margin: 0;
    padding: 0;
    color: var(--primary-color);
    background-color: var(--light-gray);
    background-image: url(img/8.jpg);
    background-attachment: fixed;
    box-sizing: border-box;
}

*, *:before, *:after {
    box-sizing: inherit;
}

/* リンク */
a:link {
    color: var(--link-color);
}

a:hover {
    color: var(--link-hover);
}

a:visited {
    color: var(--link-visited);
}

/* 段落 */
p {
    margin: 10px 0;
    line-height: 140%;
    letter-spacing: 1px;
}

/* 見出し */
h1 {
    font-size: 0.8rem;
    margin: 0;
    padding: 0 0 3px 0;
    color: var(--primary-color);
}

h2 {
    margin: 0 0 5px 0;
    padding: 12px 0 5px 8px;
    line-height: 110%;
    font-size: 1rem;
    text-align: center;
    color: #333333;
    background-image: url(img/bar.jpg);
    background-repeat: no-repeat;
}

h3 {
    margin: 12px 5px 10px 6px;
    padding: 8px 5px 8px 8px;
    line-height: 110%;
    font-size: 1rem;
    color: #444444;
    border-left: solid 5px #aaaaaa;
    background-color: #eeeeee;
}

/* 画像 */
img {
    border-style: none;
    max-width: 100%;
    height: auto;
    display: block;
}

#main {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
    background-color: var(--background-color);
    font-size: 13px;
}

/* ヘッダー */
#header {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    background-color: var(--light-gray);
}

#header-inner {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
    color: #333333;
    height: auto;
    background-color: var(--light-gray);
}

.header-row {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

#table-left {
    text-align: left;
    padding: 5px;
    font-size: 0.75rem;
    color: #333333;
    line-height: 1.2;
    flex: 1;
}

#table-right {
    text-align: right;
    padding: 5px;
    font-size: 0.75rem;
    color: #333333;
    line-height: 1.2;
    flex: 1;
}

#table-left a,
#table-right a {
    color: #333333;
    text-decoration: none;
}

#table-left a:hover,
#table-right a:hover {
    color: #fffffc;
}

#header-img {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    height: 180px;
    background-image: url(img/naniwa2014.jpg);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

/* コンテナ */
#container {
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0;
    background-color: var(--background-color);
}

/* コンテンツ */
#contents {
    width: 100%;
    margin: 0;
    padding: 0 8px;
    line-height: 150%;
    letter-spacing: 1px;
    background-color: var(--background-color);
}

.centered-image {
    display: block;
    margin: 0 auto; /* 左右中央揃え */
    width: 550px; /* 固定幅を維持 */
    max-width: 100%; /* コンテナ幅を超えない */
    height: auto;
}

/* 既存の #contents img を調整 */
#contents img {
    display: block;
    max-width: 100%;
    height: auto;
    margin: 10px auto; /* PCでも中央揃えをデフォルトに */
}



.image-container {
    display: flex;
    justify-content: center; /* 中央揃え */
    align-items: center; /* 垂直方向の中央揃え */
    gap: 5px; /* PC表示で画像間の間隔を5pxに縮小 */
    max-width: 800px; /* 最大幅を制限 */
    width: 100%;
    flex-wrap: nowrap; /* PCでは横並びを強制 */
}

.image-container img {
    border-style: none;
    width: 280px; /* 既存の幅を維持 */
    height: 160px;
    object-fit: cover;
}


/* ニュースセクション */
#news {
    width: 100%;
    max-height: 400px;
    overflow: auto;
    background-color: #ffffff;
    padding: 5px;
    margin: 10px 0;
    border: 1px solid #999999;
    font-size: 13px;
    text-align: left;
}

/* メニュー */
#menu {
    width: 100%;
    margin: 0;
    padding: 8px;
    text-align: left;
    line-height: 150%;
    letter-spacing: 1px;
    background-color: var(--background-color);
    font-size: 12px;
}

#menu h2 {
    margin: 0;
    padding: 7px 0 0 3px;
    line-height: 120%;
    font-size: 1.2rem;
    text-align: center;
    color: #fffffc;
    background-image: url(img/sidebar.gif);
    background-repeat: repeat;
}

#menu p {
    margin: 10px 4px;
}

/* リスト */
li {
    list-style-image: url(img/mark.gif);
    margin: 0 0 5px 0;
    line-height: 150%;
}

/* フッター */
#footer {
    clear: both;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 0 10px 0;
    text-align: center;
    font-size: 10px;
    color: #8b4513;
    background-color: var(--light-gray);
}

#footer-img {
    clear: both;
    width: 100%;
    max-width: var(--max-width);
    margin: 0 auto;
    height: 180px;
    background-image: url(img/ame.jpg);
    background-size: cover;
    background-position: center;
}

/* テーブル */
table {
    width: 100%;
    margin: 0;
    padding: 0;
    font-size: 12px;
    color: #333333;
}

td {
    text-align: left;
    padding: 5px;
}

/* フォーム */
form {
    width: 100%;
}

textarea,
input[type="text"] {
    width: 70%;
    max-width: 500px;
    box-sizing: border-box;
    margin: 0 auto;
    padding: 5px;
}

/* カスタムクラス */
.notice {
    font-size: larger;
    font-weight: bold;
}

.small-text {
    font-size: 12px;
}

.medium-text {
    font-size: 14px;
}

.center-text {
    text-align: center;
}

.center-image {
    text-align: center;
}

/* モバイル用メディアクエリ */
@media screen and (max-width: 768px) {
    #header-img {
        height: 80px;
    }

    #contents,
    #menu {
        float: none;
        width: 100%;
        margin: 5px 0;
        padding: 5px;
    }

    #contents img,
    #menu img {
        display: block;
        margin: 10px auto;
    }

    .image-container {
        gap: 5px;
    }

    .image-container img {
        width: 180px;
        height: 130px;
    }

    #news {
        width: 100%;
    }

    form table {
        display: block;
    }

    form tr,
    form td {
        display: block;
        width: 100%;
    }

    form td:first-child {
        margin-bottom: 5px;
    }

    textarea,
    input[type="text"] {
        width: 95%;
        max-width: 300px;
    }

    #menu p:last-child {
        margin-bottom: 0;
    }

    #menu img {
        margin-bottom: 0;
    }

    #footer-img {
        margin-top: 0;
    }
}