@charset "UTF-8";

/* --- スライドショーエリア（新しい記述） --- */
#header {
    width: 900px;
    height: 300px;
    position: relative;
    overflow: hidden;
    margin: 0 auto;
}

/* スライドショーの画像設定 */
.slide-img {
    width: 900px;
    height: 300px;
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0; /* 最初は隠しておく */
    animation: slideAnimation 20s infinite; /* 20秒でループ */
}

/* 4枚の画像を順番に表示させるタイミング調整 */
.slide-img:nth-child(1) { animation-delay: 0s; }
.slide-img:nth-child(2) { animation-delay: 5s; }
.slide-img:nth-child(3) { animation-delay: 10s; }
.slide-img:nth-child(4) { animation-delay: 15s; }

/* ふわっと切り替わるアニメーションの定義 */
@keyframes slideAnimation {
    0% { opacity: 0; }
    5% { opacity: 1; }  /* 1秒かけて表示 */
    25% { opacity: 1; } /* 4秒間表示し続ける */
    30% { opacity: 0; } /* 1秒かけて消える */
    100% { opacity: 0; }
}

/* --- コンテンツエリア（既存のデザイン維持） --- */
#contents {
    /* height: 1000px; ←固定の高さを削除（自動調整へ） */
    width: 580px;
    background-image: url('../img/home/message2.jpg');
    background-repeat: no-repeat;
    float: left;
    text-align: left;
    display: inline;
    padding-left: 20px;
    margin-left: 30px;
    margin-top: 20px;
    margin-bottom: 40px; /* 下に少し余白を追加 */
}

/* --- 画像を右側に配置する設定 --- */
.pc-side-photo {
    float: right;       /* 画像を右に寄せる */
    margin-left: 20px;  /* 文章との間に隙間を空ける */
	margin-bottom: 10px;/* 下にも少し隙間を */
	margin-right: 15px;
    width: 220px;       /* ★画像の横幅（お好みで調整してください） */
    height: auto;       /* 高さは自動調整 */
}

h2 {
    color: #FF9900;
    margin-top: 30px;
    margin-bottom: 25px;
    font-size: 20px;
}

.message {
    margin-top: 10px;
    margin-bottom: 0;
    font-size: 14px;
    line-height: 2;
    color: #666;
}

#name {
    margin-top: 5px;
    margin-bottom: 0;
    color: #FF9900;
    font-size: 20px;
}

#importantnews {
    width: 470px;
    padding: 30px;
    margin-top: 50px;
    margin-bottom: 20px;
    margin-left: 0;
    border: solid thin #FF9900;
    text-align: left;
}

#copyright a {
    text-decoration: none;
    color: #666;
}

/* --- ▼▼▼ スマホ表示の修正（トップページ専用） ▼▼▼ --- */

@media screen and (max-width: 640px) {
  
  /* 1. トップページのスライドショー比率維持 */
  #header, .slide-img {
    aspect-ratio: 3 / 1;
    margin-bottom: 20px !important;
  }

  /* 2. メインコンテンツの余白確保（★ここを追加！） */
  div#contents {
    display: block !important;
    width: 100% !important;
    float: none !important;
    margin: 0 !important;
    padding: 30px 25px !important; /* 左右に25pxの余白 */
    box-sizing: border-box !important;
    /*background-image: none !important;  背景画像を消して読みやすく */
    height: auto !important;
	}
	
/* ★変更：スマホでも表示し、サイズと位置を調整 */
  .pc-side-photo {
      display: block !important;      /* 表示させる */
      float: none !important;         /* 右寄せ（回り込み）を解除 */
      width: 200px !important;        /* ★幅を小さく（数字を変えれば調節可能） */
      margin: 0 auto 20px !important; /* 左右中央寄せ・下に20pxの余白 */
      height: auto !important;        /* 高さは自動 */
  }
}
/* --- レイアウト調整（他のページと合わせる設定） --- */
.layout-wrapper {
    display: flex;
    justify-content: space-between; /* 左右の端に振り分ける */
    align-items: flex-start;        /* 上端を揃える */
    width: 900px;
    margin: 0 auto;
    box-sizing: border-box;
}

/* メイン部分の幅を調整して、サイドバーとの間に隙間を作る */
#contents {
    width: 650px; /* サイドバー(210px)を除いた残り幅 */
}

/* --- スマホ対応（縦並びに戻す） --- */
@media screen and (max-width: 640px) {
    .layout-wrapper {
        width: 100% !important;
        flex-direction: column;
        padding: 0;
    }
    #contents {
        width: 100% !important;
        padding: 20px !important;
    }
}