@charset "utf-8";

/* 基本設定：大きな文字と読みやすさ */
body {
    font-family: "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", Meiryo, sans-serif;
    font-size: 18px; /* 文字を大きめに設定 */
    line-height: 1.6;
    color: #333;
    background-color: #f4f7f8;
    margin: 0;
}

/* コンテナ設定 */
#container {
    max-width: 1100px;
    margin: 0 auto;
    background-color: #fff;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
}

/* ヘッダー：JRブルーを基調に */
header {
	background-color: #0067b0; /* JR四国に近いブルー */
	color: #fff;
	padding: 5px 20px;
	text-align: center;
	background-image: linear-gradient(rgba(0,103,176,0.8), rgba(0,103,176,0.8)), url('../index/ob_top.png'); /* 背景に鉄道写真を薄く敷く想定 */
	background-size: cover;
	background-position: center;
}

header h1 { margin: 0; font-size: 2.2rem; }

/* レイアウト：Flexbox */
.content-wrapper {
    display: flex;
    flex-wrap: wrap;
}

/* サイドナビゲーション */
.side-nav {
    flex: 0 0 180px;
    background-color: #f8f9fa;
    padding: 20px;
}

.side-nav ul { list-style: none; padding: 0; margin: 0; }
.side-nav li { margin-bottom: 5px; }

.side-nav a {
    display: block;
    padding: 12px 15px;
    background-color: #fff;
    color: #0067b0;
    text-decoration: none;
    border-radius: 4px;
    border: 1px solid #ddd;
    font-weight: bold;
    transition: 0.3s;
}

.side-nav a:hover, .side-nav a.active {
    background-color: #0067b0;
    color: #fff;
}

/* メインエリア */
main {
    flex: 1;
    padding: 10px 30px;
    min-width: 300px;
}

/* ピックアップ強調エリア */
.pickup-section { margin-bottom: 30px; }
.pickup-item {
    background-color: #fff4e6; /* 薄いオレンジ */
    border-left: 5px solid #f08000;
    padding: 15px;
    margin-bottom: 10px;
    font-weight: bold;
}
.pickup-item a { color: #d35400; text-decoration: none; }

/* 新着情報リスト */
.news-section h2 { border-bottom: 2px solid #0067b0; padding-bottom: 10px; }
.news-row {
    display: flex;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
}
.news-row .date { flex: 0 0 130px; font-weight: bold; color: #666; }
.news-row a { color: #0067b0; text-decoration: none; }
.news-row a:hover { text-decoration: underline; }

/* バックナンバーボタン */
.news-archive { margin-top: 20px; }
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: #666;
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    margin-right: 10px;
    font-size: 0.9rem;
}

/* フッター */
footer {
	background-color: #333;
	color: #fff;
	padding: 10px;
	text-align: center;
}
.footer-links a { color: #fff; margin: 0 15px; text-decoration: none; }
.address { margin-top: 20px; font-size: 0.9rem; }

/* レスポンシブ対応：スマホ表示 */
@media (max-width: 768px) {
    .content-wrapper { flex-direction: column; }
    .side-nav { flex: none; width: 100%; order: 2; }
    main { order: 1; }
    .news-row { flex-direction: column; }
    .news-row .date { margin-bottom: 5px; }
}

/* コンテンツセクション */
.content-section {
    padding: 15px 0;
    border-bottom: 1px dashed #ccc;
}

/* 新聞ページナビゲーション */
.news-page-nav ul {
	display: flex;
	flex-wrap: wrap;
	list-style: none;
	margin-bottom: 20px;
	gap: 5px;
	padding-top: 0;
	padding-right: 0;
	padding-bottom: 0;
	padding-left: 10px;
}
.news-page-nav li a {
    display: block;
    padding: 8px 12px;
    background: #eee;
    color: #333;
    text-decoration: none;
    border-radius: 4px;
    font-size: 0.9rem;
}
.news-page-nav li a.current {
    background: #0067b0;
    color: #fff;
}

/* 1枚画像表示用のコンテナ */
.newspaper-single-page {
    background: #fff;
    border: 1px solid #ccc;
    padding: 5px; /* 外側の白い縁取り */
    display: flex;
    justify-content: center;
}

.news-image-wrapper {
    width: 100%;
    max-width: 1020px; /* 元の画像サイズを最大幅に設定 */
}

/* 画像をレスポンシブ化（画面に合わせて伸縮） */
.responsive-full-img {
    width: 100%;
    height: auto;
    display: block;
    box-shadow: 0 0 5px rgba(0,0,0,0.2); /* 紙面らしく少し影をつける */
}

/* 見出しのデザイン：左側にオレンジの縦棒 */
.section-title h2 {
	border-left: 8px solid #f08000;              /* 線の内側の余白 */
	margin-left: 10px;                 /* 左端に寄せる */
	color: #333;                    /* 文字色 */
	font-size: 1.8rem;              /* 文字の大きさ */
	line-height: 1.2;               /* 行の高さ */
	display: flex;
	align-items: center;
	padding-right: 15px;
	padding-left: 10px;
	margin-top: 0;      /* 上の余白をゼロに */
	margin-bottom: 10px; /* 下の説明文との間隔 */
}

/* 画像を画面幅に合わせて自動伸縮させる設定 */
.responsive-full-img {
    width: 100%;      /* 親要素の幅いっぱいに広がる */
    max-width: 1020px; /* 元のサイズ以上には大きくならない */
    height: auto;     /* 縦横比を維持して伸縮する */
    display: block;   /* 下に余計な隙間を作らない */
    margin: 0 auto;   /* 中央に配置 */
}

/* 画像を包む枠も、画面幅に合わせて縮むように設定 */
.news-image-wrapper {
    width: 100%;
    max-width: 1020px;
    margin: 0 auto;
}

/* テーブルを画面幅に合わせて強制的に縮小させる */
.responsive-table-container table {
    width: 100% !important;
    max-width: 1020px;
    height: auto !important;
    table-layout: fixed; /* セルの比率を維持 */
}

.responsive-table-container img {
    width: 100% !important;
    height: auto !important;
}

/* Lightboxの拡大画像をスマホ画面に収める */
#lightboxImage {
    max-width: 90vw !important;  /* 画面幅の90%を上限にする */
    max-height: 80vh !important; /* 画面高さの80%を上限にする */
    width: auto !important;
    height: auto !important;
}

/* 拡大画像の外枠も調整 */
#outerImageContainer, #lightbox {
    max-width: 95vw !important;
    width: auto !important;
    height: auto !important;
}

.responsive-table {
    width: 100% !important;
    max-width: 1020px;
    height: auto !important;
    border-collapse: collapse;
}
.responsive-table img {
    width: 100% !important;
    height: auto !important;
    display: block;
}
.link-list {
	font-size: 20px;
	color: #39F;
	background-color: #D5D5D5;
	font-weight: bold;
}

/* 写真を並べるための設定 */
.photo-row {
    display: flex;
    flex-wrap: wrap; /* スマホで入り切らない時に自動で折り返す */
    justify-content: space-around;
    gap: 10px;
    margin-bottom: 20px;
}

.photo-item {
    flex: 1; /* 横幅を均等にする */
    min-width: 150px; /* これより狭くなると縦に並ぶ */
    text-align: center;
}

.photo-item img, .photo-winner img {
    max-width: 100%; /* 親要素からはみ出さない */
    height: auto;
    border: 1px solid #ccc;
    padding: 5px;
    background: #fff;
}

.photo-winner {
    text-align: center;
    margin: 20px 0;
}

/* 本文の読みやすさ */
.report-text {
    background: #fff;
    padding: 20px;
    border: 1px solid #ccc;
    line-height: 1.8;
}

/* --- 1枚表示のスライドショー設定 --- */

.single-slider-container {
    width: 100%;
    max-width: 620px;   /* ご希望の幅 */
    height: 450px;      /* ご希望の高さ */
    margin: 30px auto;  /* 中央配置 */
    position: relative;
    overflow: hidden;
    border: 5px solid #fff;
    box-shadow: 0 0 15px rgba(0,0,0,0.2);
}

.single-slider {
    width: 100%;
    height: 100%;
    position: relative;
}

.single-slide {
	width: 100%;
	height: 100%;
	position: absolute;
	top: 0;
	left: -1px;
	opacity: 0; /* 最初は透明 */
	animation: fadeSlider 52s infinite; /* 20秒で1周（枚数に合わせて調整） */
}

.single-slide img {
    width: 100%;
    height: 100%;
    object-fit: contain; /* 画像を切らずに収める */
    background-color: #333; /* 余白を暗くして写真を引き立てる */
}

/* --- 14枚それぞれの開始タイミングを 4秒ずつずらす --- */
.single-slide:nth-child(1) { animation-delay: 0s; }
.single-slide:nth-child(2) { animation-delay: 4s; }
.single-slide:nth-child(3) { animation-delay: 8s; }
.single-slide:nth-child(4) { animation-delay: 12s; }
.single-slide:nth-child(5) { animation-delay: 16s; }
.single-slide:nth-child(6) { animation-delay: 20s; }
.single-slide:nth-child(7) { animation-delay: 24s; }
.single-slide:nth-child(8) { animation-delay: 28s; }
.single-slide:nth-child(9) { animation-delay: 32s; }
.single-slide:nth-child(10) { animation-delay: 36s; }
.single-slide:nth-child(11) { animation-delay: 40s; }
.single-slide:nth-child(12) { animation-delay: 44s; }
.single-slide:nth-child(13) { animation-delay: 48s; }
.single-slide:nth-child(14) { animation-delay: 52s; }

/* フェードアニメーション */
@keyframes fadeSlider {
    0% { opacity: 0; }
    2% { opacity: 1; }   /* 5%の地点でパッと表示 */
    7.6% { opacity: 1; }  /* 20%まで表示維持 */
    9.6% { opacity: 0; }  /* 消える */
    100% { opacity: 0; }
}

/* スマホ対応：画面が狭いときは高さを自動にして比率を保つ */
@media (max-width: 620px) {
    .single-slider-container {
        height: auto;
        aspect-ratio: 620 / 450; /* 比率を維持 */
    }
}
/* --- キャプション（説明文）の装飾 --- */
.slide-caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.7); /* 半透明の黒背景 */
    color: #fff;
    text-align: center;
    padding: 10px 0;
    font-size: 14px;
    /* 画像と一緒に表示されるよう、親の.single-slideに含まれているため自動でフェードします */
}

/* 画像の高さをテキスト分だけ少し確保するために調整（任意） */
.single-slider-container {
    height: 500px; /* テキストが入る分、少し高く（450pxから500pxへ）すると余裕が出ます */
}

/* --- トップページ専用スタイル --- */

/* スライドショーの幅調整（9枚×2セット = 18枚の場合） */
/* 280px * 18 = 5040px */
.slider-inner {
    display: flex !important;
    width: 5040px !important; 
    animation: marquee-top 40s linear infinite !important;
}

/* 9枚分（280px * 9 = 2520px）動いたら戻す設定 */
@keyframes marquee-top {
    0% { transform: translateX(0); }
    100% { transform: translateX(-2520px); }
}

/* スライドショーを包む枠 */
.slideshow-container {
    width: 100% !important;  /* 親要素いっぱいに広げる */
    max-width: 800px;        /* PCでの最大幅（お好みで調整） */
    margin: 0 auto;          /* 中央寄せ */
    overflow: hidden;        /* はみ出た部分を隠して、横揺れを防ぐ */
}

/* スライドショーの中の各スライド */
.single-slide img {
    width: 100% !important;  /* ★重要：画像の幅を画面幅に強制的に合わせる */
    height: auto !important; /* ★重要：高さは比率を保って自動調整 */
    display: block;
}

/* スマホ用の微調整（メディアクエリ） */
@media screen and (max-width: 640px) {
    #container {
        width: 100% !important;
    }
    
    /* スライドショーの左右に余白がある場合はここでリセット */
    .content-section {
        padding-left: 10px;
        padding-right: 10px;
        box-sizing: border-box;
    }
}

/* スライドショーの幅調整（例：画像が計14枚の場合） */
/* 1枚 800px として 800px * 14枚 = 11200px */
.slider-inner {
    display: flex !important;
    width: 11200px !important; /* 枚数に合わせて増やす */
    animation: marquee-top 40s linear infinite !important;
}

/* アニメーションの移動距離も枚数分に合わせる */
@keyframes marquee-top {
    0% { transform: translateX(0); }
    100% { transform: translateX(-3920px); } /* 1周分の長さをマイナス指定 */
}

/* コンテナの高さを固定せず、中身に合わせる設定 */
.single-slider-container {
    height: auto !important; /* 固定値（500pxなど）があれば auto に変更 */
    min-height: 500px; /* 必要最低限の高さだけ確保 */
}

/* 画像が親要素からはみ出さないようにする */
.single-slide img {
    width: 100% !important;
    max-width: 100% !important;
    height: auto !important; /* 高さを自動調整に */
    display: block;
}

/* スライドショーの幅調整（14枚の場合） */
.slider-inner {
    display: flex !important;
    width: calc(100% * 14) !important; /* 枚数に合わせて自動計算 */
    animation: marquee-top 50s linear infinite !important; /* 枚数が増えた分、少しゆっくり(50s)に */
}

/* 11枚分をスムーズに流す設定 */
@keyframes marquee-top {
    0% { transform: translateX(0); }
    100% { transform: translateX(calc(-100% * 11 / 2)); } 
    /* ループさせる場合は、全枚数の半分、または全枚数分で調整 */
}

/* PCで下が欠けるのを防ぐ「高さ」の確保 */
.single-slider-container {
    width: 100% !important;
    height: auto !important; /* 高さを固定せず、中身の画像に合わせる */
    min-height: 400px;      /* 最低限の高さは確保 */
    overflow: hidden;
}

.single-slide img {
    width: 100% !important;
    height: auto !important; /* 比率を維持して、下まで表示させる */
    object-fit: contain;     /* 画像全体が枠に収まるようにする */
}

/* 1. スライドショーの枠を「独立した車両」として切り離す */
.single-slider-container {
    position: relative !important;
    width: 100% !important;
    max-width: 100% !important; /* はみ出し防止 */
    height: 450px !important;    /* PCでの高さ。ここから下にはみ出させない */
    overflow: hidden !important;
    margin: 0 0 40px 0 !important; /* 下のテキストとの間にしっかり安全距離（40px）を作る */
    display: block !important;
    clear: both !important;
}

/* 2. 下に続くテキストエリアを「正しい軌道」に戻す */
main, .tass-intro, .section-title, .content-section {
    position: relative !important;
    display: block !important;
    clear: both !important;      /* 前の要素（スライドショー）の影響を完全に遮断する */
    width: 100% !important;
    padding: 10px !important;
    box-sizing: border-box !important;
}

/* 3. 画像が横に飛び出さないよう、車庫（スライド）を固定 */
.single-slide {
    width: 100% !important;
    left: 0 !important;
}

/* 座標リンクを透明な「面」にする設定 */
.coordinate-link {
    position: absolute;
    display: block;
    z-index: 10;
    /* 点検用：以下の1行の先頭の「/*」を消すと、
       どこにリンクがあるか赤い枠が表示されます。
       位置の最終確認が終わったら、また「/*」を付けて隠してください。
    */
    /* border: 1px solid red; */
}

.coordinate-link {
    /* 中略 */
    border: 2px solid red !important; /* ★これを追加すると、画面に「赤い枠」が出ます */
}


/* ======================================================
   まさちゃん様専用：新聞レスポンシブ 最終解決コード
   ※これ以外の新聞用CSSはすべて削除してください
   ====================================================== */

/* PC表示：幅を1020pxに固定し、崩れを物理的に防ぐ */
@media screen and (min-width: 1021px) {
    .news-wrap, .newspaper-responsive-container {
        width: 1020px !important;
        margin: 0 auto !important;
        display: block !important;
    }
    .news-wrap table, .newspaper-responsive-container table {
        width: 1020px !important;
    }
}

/* スマホ・縮小表示：1020px以下の時に発動 */
@media screen and (max-width: 1020px) {
    /* 外枠の設定 */
    .news-wrap, .newspaper-responsive-container {
        width: 100% !important;
        overflow: hidden !important;
        line-height: 0 !important;
        font-size: 0 !important;
    }

    /* テーブルの設定：ここを「auto」に戻して画像優先にします */
    .news-wrap table, .newspaper-responsive-container table {
        width: 100% !important;
        height: auto !important;
        border-collapse: collapse !important;
        border-spacing: 0 !important;
        table-layout: auto !important; 
    }

    /* セルの設定 */
    .news-wrap td, .newspaper-responsive-container td {
        padding: 0 !important;
        margin: 0 !important;
        line-height: 0 !important;
        font-size: 0 !important;
    }

    /* 画像の設定：隙間を作らせない */
    .news-wrap img, .newspaper-responsive-container img {
        width: 100% !important;
        height: auto !important;
        display: block !important;
        margin: 0 !important;
        padding: 0 !important;
        /* スマホの計算誤差を埋めるための「微拡大」 */
        transform: scale(1.002);
        transform-origin: top left;
    }

    /* 崩れの原因となるspacer.gifをスマホ時のみ無効化 */
    img[src*="spacer.gif"] {
        display: none !important;
    }
}

.responsive-img {
    width: 100% !important;
    height: auto !important;
    display: block !important;
    /* 画像同士のわずかな隙間を埋めるため、0.5%だけ拡大 */
    transform: scale(1.005);
    transform-origin: top left;
}
   




