/* --- ページ全体の基本設定 --- */
.news-page-container {
    width: 100%;           /* 親は100%に */
    max-width: 800px;      /* 500pxだとカードが並びにくいので少し広げますが、お好みで */
    margin: 0 auto !important;
    padding: 0 20px;
    font-family:
            "Zen Maru Gothic",
            /* 1. 第一優先：Google Fonts（要読み込み） */
            "Hiragino Maru Gothic ProN",
            /* 2. Mac/iPhone用：ヒラギノ丸ゴ */
            "HG丸ｺﾞｼｯｸM-PRO",
            /* 3. Windows用：標準的な丸ゴシック */
            "Meiryo",
            /* 4. 予備：メイリオ */
            sans-serif;
    box-sizing: border-box;
}

/* 内枠：二重に制限がかからないよう調整 */
.news-wrapper {
    width: 100%;
    margin: 0 auto;
}

.page-title {
    text-align: center !important;
    color: #004e54;
    margin-bottom: 40px;
    position: relative;
    padding-bottom: 15px;
    display: block;        /* 確実にブロック化 */
}

.page-title::after {
    content: "";
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: #004e54;
}

/* --- 最新投稿のレイアウト（修正ポイント） --- */
.news-grid {
    display: flex;         /* flexを使用 */
    flex-wrap: nowrap;       /* 折り返しを許可 */
    gap: 30px;
    justify-content: center; /* ★中身（カード）を水平方向の中央に寄せる */
    align-items: stretch;    /* カードの高さを揃える */
}

.news-card {
    background: #fff;
    border: 1px solid #eee;
    border-radius: 10px;
    padding: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    position: relative;
    box-shadow: 0 4px 6px rgba(0,0,0,0.05);
    
    /* カードの幅設定 */
    flex: 0 0 300px;
    max-width: 300px;      /* ★カードが広がりすぎないように制限 */
    box-sizing: border-box;
    text-align: left;      /* カード内の文字は左寄せ */
}

.news-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
}

/* スマホ表示（画面が狭い時）の調整 */
@media (max-width: 920px) {
    .news-grid {
        display: flex;
        flex-direction: column;
        /* 強制的に縦一列にする */
        align-items: center;
        /* カードを中央に寄せる */
        gap: 25px;
        /* カード同士の上下間隔 */
        padding: 10px;
        /* 画面端との余白 */
    }

    .news-card {
        width: 100%;
        /* 画面幅いっぱい（padding除く）にする */
        max-width: 100%;
        /* 制限を解除 */
        flex: none;
        /* PC版のflex設定をリセット */
        box-sizing: border-box;
        /* paddingを含めた幅計算にする */
        margin: 0 auto;
        /* 中央配置を確実にする */
    }

    /* 画像の幅を強制的にカードと同期させる */
    .news-card img {
        width: 100%;
        /* カードの端から端まで広げる */
        height: auto;
        /* 高さは自動調整 */
        aspect-ratio: 16 / 9;
        /* 画像の比率を統一するとさらに洗練されます */
        object-fit: cover;
        /* 比率が違う画像も綺麗に収める */
        display: block;
    }
}

.label {
    display: inline-block;
    background-color: #b2ebf2;
    /* 塗りつぶしの色 */
    color: #ffffff;
    font-size: 0.7rem;
    font-weight: bold;
    padding: 3px 12px;
    margin-bottom: 15px;
    /* 下のデータとの隙間 */
    letter-spacing: 0.05em;
    border-radius: 50px;
}
/* NEWと日付を横に並べる */
.card-header {
    display: flex;
    align-items: center;
    /* 垂直方向の中央揃え */
    gap: 10px;
    /* NEWと日付の間の隙間 */
    margin-bottom: 10px;
    /* 下のタイトルセクションとの間隔 */
}

.card-tag {
    display: inline-block;
    background: #e63946;
    color: #fff;
    font-size: 0.7rem;
    padding: 2px 8px;
    border-radius: 4px;
    margin-bottom: 10px;
    font-weight: bold;
}

/* カード内の画像コンテナ */
.card-image {
    width: 100%;
    /* 横幅いっぱい */
    height: 180px;
    /* 高さを固定（お好みで調整） */
    overflow: hidden;
    /* はみ出た分を隠す */
    margin: 10px 0;
    /* 前後の余白 */
    background-color: #f0f0f0;
    /* 画像がない時や読み込み中の背景色 */
    border-radius: 4px;
}

/* 中の画像自体の設定 */
.card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* ★重要：アスペクト比を維持したまま枠いっぱいに広げる（余った分はトリミング） */
    object-position: center;
    /* 中央合わせ */
    display: block;
}

.news-card time {
    display: block;
    font-size: 0.9rem;
    color: #888;
    margin-bottom: 10px;
}

.news-card h3 {
    font-size: 1.2rem;
    margin: 0 0 15px 0;
    line-height: 1.4;
}

.news-card p {
    font-size: 0.95rem;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.6;
}

.read-more {
    color: #004e54;
    text-decoration: none;
    font-weight: bold;
    font-size: 0.9rem;
}

/* --- 過去一覧のリストスタイル --- */
.archive-section {
    max-width: 600px;      /* リストが広がりすぎないよう制限 */
    margin: 0 auto 60px;   /* セクション自体を中央寄せ */
}

.archive-section h1 {
    text-align: center;
    font-size: 1.9rem;
    color: #004e54;
    position: relative;
    /* 装飾の左線は中央寄せだとバランスが難しいので、下線にするか左右対称にするのが一般的です */
    width: 100%;
    padding-bottom: 10px;
    margin-bottom: 30px;
}
.archive-section h1::after {
    content: "";
    /* 空の要素を作る */
    position: absolute;
    bottom: 0;
    /* 一番下に配置 */
    left: 50%;
    /* 左から50%の位置へ */
    transform: translateX(-50%);
    /* 自分の幅の半分だけ戻して中央へ */

    width: 60px;
    /* 線の長さ（pxでも%でも可） */
    height: 2px;
    /* 線の太さ */
    background-color: #004e54;
    /* 線の色 */
}

.archive-list {
    list-style: none;
    padding: 0;
    margin: 40px 0 0 0;
}

.archive-list li {
    display: flex;
    padding: 15px 0;
    border-bottom: 1px solid #90a4ae;
    align-items: center;
}

.archive-list time {
    min-width: 120px;
    color: #888;
    font-size: 0.9rem;
}

.archive-list a {
    color: #333;
    text-decoration: none;
    flex: 1;               /* タイトル部分を広げる */
}

/* モーダル本体（最初は非表示） */
.modal {
    display: none; 
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0,0,0,0.7); /* 背景を暗く */
    overflow-y: auto; /* 長い文章の時にスクロール可能に */
}

/* モーダルの中身（白い箱） */
.modal-content {
    background-color: #fff;
    margin: 5% auto;
    padding: 30px;
    border-radius: 10px;
    width: 90%;
    max-width: 700px;
    position: relative;
    animation: modalOpen 0.3s ease;
}

/* モーダル内のラベル設定 */
.modal-label {
    display: block;
    font-size: 0.8rem;
    color: #004e54;
    font-weight: bold;
    margin-bottom: 5px;
    border-left: 3px solid #004e54;
    padding-left: 8px;
}

.modal-item {
    margin-bottom: 15px;
    padding-bottom: 15px;
}

#modalTitle {
    font-size: 1.4rem;
    color: #333;
    margin: 0;
}

#modalMessage {
    line-height: 1.8;
    color: #444;
    white-space: pre-wrap; /* 改行をそのまま表示させる */
}

@keyframes modalOpen {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* 閉じるボタン */
.close-button {
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 30px;
    cursor: pointer;
}

.open-modal {
    background: none;
    border: none;
    cursor: pointer;
    padding: 0;
    color: #004e54;
    font-weight: bold;
}

/* --- スマホ対応 --- */
@media (max-width: 600px) {
    .news-grid {
        flex-direction: column; /* スマホでは縦一列 */
        align-items: center;
    }
    
    .archive-list li {
        flex-direction: column;
        align-items: flex-start;
    }
    .archive-list time {
        margin-bottom: 5px;
    }
}