﻿/* ================================================
   かてきちの家庭科先生！教えてください
   style.css
   ================================================ */

*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Meiryo", "Yu Gothic", sans-serif;
    font-size: 16px;
    line-height: 1.85;
    color: #333;
    background-color: #fff;
}

/* ---- パンくずリスト ---- */
.breadcrumb {
    position: sticky;
    top: 0;
    z-index: 100;
    background-color: #fff;
    font-size: 13px;
    color: #666;
    padding: 8px 0;
    margin-bottom: 16px;
    line-height: 1.5;
    border-bottom: 1px solid #eee;
}

.breadcrumb a {
    color: #5a9e2f;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

.breadcrumb-sep {
    margin: 0 6px;
    color: #999;
}

/* ---- レイアウト ---- */
.column-wrap {
    max-width: 820px;
    margin: 0 auto;
    padding: 0 24px 80px;
}

/* ---- トップ画像 ---- */
.top-image {
    margin-bottom: 28px;
    position: relative; /* 文字を重ねるための基準 */
}

.top-image img {
    width: 100%;
    height: auto;
    display: block;
}

/* 上に重ねる文字のデザインと位置（パソコン用） */
.overlay-text {
    position: absolute;
    top: 50%;
    left: 24px;
    transform: translateY(-50%);
    
    color: #333;
    background-color: #ffffff;
    padding: 8px 24px;
    
    font-size: 24px;
    font-weight: bold;
    max-width: calc(100% - 48px);
    text-align: left;
}

/* ---- リード文ボックス ---- */
.lead-box {
    background-color: #fce8e8;
    border-radius: 12px;
    padding: 20px 26px;
    margin-bottom: 32px;
    font-size: 15px;
    line-height: 1.9;
}

.lead-box strong {
    font-weight: bold;
}

.lead-box em {
    font-style: normal;
    font-weight: bold;
}

/* ---- 対談イラスト ---- */
.taidan-image {
    margin-bottom: 36px;
    text-align: center;
}

.taidan-image img {
    width: 100%;
    max-width: 720px;
    height: auto;
}

/* ---- 会話セクション ---- */
.dialogue-section {
    display: flex;
    flex-direction: column;
    gap: 0;
}

/* ---- 各発言ブロック ---- */
.dialogue {
    display: flex;
    align-items: flex-start;
    gap: 14px;
    margin-bottom: 20px;
}

/* ---- アバター ---- */
.avatar {
    flex-shrink: 0;
    width: 72px;
}

.avatar img {
    width: 68px;
    height: 68px;
    border-radius: 50%;
    object-fit: cover;
    display: block;
    border: 3px solid #ccc;
}

/* アバター枠線カラー */
.katekichi .avatar img {
    border-color: #8bc34a;
}

.horiuchi .avatar img {
    border-color: #64b5f6;
}

.watahiki .avatar img {
    border-color: #ce93d8;
}

/* ---- スピーチ ---- */
.speech {
    flex: 1;
    padding-top: 8px;
}

.speech p {
    font-size: 15px;
    line-height: 1.9;
    color: #333;
}

/* ---- 発言者名（インライン） ---- */
.name {
    font-weight: bold;
    font-size: 15px;
}

.katekichi-name {
    color: #5a9e2f;
}

.horiuchi-name {
    color: #c0392b;
}

.watahiki-name {
    color: #2562a8;
}

/* ---- 教科書写真 ---- */
.book-image {
    margin: 10px auto 28px;
    text-align: center;
}

.book-image img {
    width: 100%;
    max-width: 600px;
    height: auto;
    border-radius: 6px;
    display: inline-block;
}

/* ---- 教科書写真（横並び用） ---- */
.book-image-row {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin: 10px auto 28px;
}

/* ★変更：横並び時の「枠」の設定 */
.book-image-row .book-image {
    margin: 0;
    width: auto; /* 横幅の割合指定を解除します */
    max-width: none; /* 最大幅の制限も解除します */
}

/* ★追加：横並び時の「画像そのもの」の高さを揃える */
.book-image-row .book-image img {
    height: 250px; /* ここで縦幅（高さ）を揃えます */
    width: auto; /* 高さに合わせて横幅の比率を自動で保ちます */
}

/* ---- 次回予告 ---- */
.next-episode {
    margin-top: 44px;
    padding-top: 20px;
    border-top: 2px dashed #ccc;
}

.next-label {
    font-size: 14px;
    color: #888;
    margin-bottom: 6px;
}

.next-text {
    font-size: 15px;
    color: #333;
    line-height: 1.8;
}

.next-text strong {
    font-weight: bold;
}

/* ---- 記事ナビゲーション ---- */
.article-nav {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 40px;
    gap: 12px;
}

.article-nav-btn {
    display: inline-block;
    padding: 10px 24px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: bold;
    text-decoration: none;
    transition: background-color 0.2s, color 0.2s;
}

.article-nav-btn.prev.disabled {
    background-color: #e0e0e0;
    color: #aaa;
    cursor: default;
    pointer-events: none;
}

.article-nav-btn.next.disabled {
    background-color: #e0e0e0;
    color: #aaa;
    cursor: default;
    pointer-events: none;
}

.article-nav-btn.next:not(.disabled) {
    background-color: #5a9e2f;
    color: #fff;
}

.article-nav-btn.next:not(.disabled):hover {
    background-color: #478526;
}
.article-nav-btn.prev:not(.disabled) {
    background-color: #5a9e2f;
    color: #fff;
}

.article-nav-btn.prev:not(.disabled):hover {
    background-color: #478526;
}

/* ================================================
   レスポンシブ（スマートフォン用）
   ※画面幅が600px以下の場合に適用されるスタイル
   ================================================ */
@media (max-width: 600px) {

    /* パンくずリスト */
    .breadcrumb {
        font-size: 12px;
        padding: 7px 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }

    /* レイアウト */
    .column-wrap {
        padding: 0 14px 56px;
    }

    /* トップ画像 */
    .top-image {
        margin-bottom: 18px;
    }

    /* ★上に重ねる文字のデザインと位置（スマホ用） */
    .overlay-text {
        font-size: 13px;
        left: 16px;
        padding: 6px 16px;
        max-width: calc(100% - 32px);
        line-height: 1.4;
    }

    /* リード文 */
    .lead-box {
        font-size: 14px;
        padding: 14px 16px;
        border-radius: 10px;
        margin-bottom: 22px;
        line-height: 1.8;
    }

    /* 対談イラスト */
    .taidan-image {
        margin-bottom: 22px;
    }

    /* 会話ブロック */
    .dialogue {
        gap: 10px;
        margin-bottom: 18px;
    }

    /* アバター */
    .avatar {
        width: 46px;
    }

    .avatar img {
        width: 42px;
        height: 42px;
        border-width: 2px;
    }

    /* スピーチ */
    .speech {
        padding-top: 2px;
    }

    .speech p {
        font-size: 14px;
        line-height: 1.8;
    }

    .name {
        font-size: 14px;
    }

    /* 教科書写真 */
    .book-image {
        margin: 6px auto 20px;
    }

/* ★教科書写真（横並び用）のスマホ対応 */
    .book-image-row {
        flex-direction: column; /* ★横並びを「縦積み」に変更する魔法です */
        align-items: center; /* ★縦に並んだ画像を中央に揃えます */
        gap: 20px; /* 上下の画像の間の隙間です */
        margin-bottom: 20px;
    }

    /* ★スマホ画面での画像のサイズ調整 */
    .book-image-row .book-image img {
        height: auto; /* ★縦幅の固定を解除して、自然な比率に戻します */
        width: 100%; /* 横幅を基準にします */
        max-width: 200px; /* 縦積みしたときに画像が大きくなりすぎないように制限します */
    }

    /* 次回予告 */
    .next-episode {
        margin-top: 32px;
    }

    .next-label,
    .next-text {
        font-size: 14px;
    }

    /* 記事ナビゲーション */
    .article-nav {
        margin-top: 28px;
        gap: 8px;
    }

    .article-nav-btn {
        flex: 1;
        text-align: center;
        padding: 12px 8px;
        font-size: 13px;
    }
}