/* =================================================
   個別投稿ページ専用スタイル
   ================================================= */

/* ===================================
   1. 投稿ページヒーローセクション
   （page-sec-titleテンプレートを使用）
   =================================== */

/* 投稿ページでのpage-sec-title調整 */
.single-post-page .sec-hero {
    margin-bottom: 0;
}

/* ===================================
   2. 投稿タイトルエリア
   =================================== */

.single-post-header {
    padding: 60px 0 40px;
    border-bottom: 1px solid var(--border-light);
}

.single-post-meta {
    display: flex;
    align-items: center;
    gap: 20px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

.single-post-date {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.single-post-categories {
    display: flex;
    align-items: center;
    gap: 10px;
}

.single-post-category {
    display: inline-block;
    background: var(--primary-color);
    color: var(--white);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    text-decoration: none;
    transition: all 0.3s ease;
}

.single-post-category:hover {
    background: var(--primary-hover);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
}

.single-post-title {
    font-size: 2rem;
    font-weight: bold;
    line-height: 1.4;
    color: var(--text-color);
    margin-bottom: 1rem;
    word-wrap: break-word;
}

/* ===================================
   SDGsバッジ（CSRカテゴリ投稿用）
   =================================== */

.single .sdgs-badges {
    margin: 16px 0 0;
}

.sdgs-badges__list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    list-style: none;
    padding: 0;
    margin: 0;
}

.sdgs-badges__item {
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.sdgs-badges__icon {
    width: 60px;
    height: 60px;
    object-fit: contain;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.sdgs-badges__fallback {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 60px;
    height: 60px;
    background: var(--primary-color);
    color: #fff;
    font-size: 0.65rem;
    font-weight: bold;
    text-align: center;
    line-height: 1.2;
}

/* SDGsバッジ レスポンシブ */
@media (max-width: 767.98px) {
    .sdgs-badges__icon {
        width: 36px;
        height: 36px;
    }
    
    .sdgs-badges__fallback {
        width: 36px;
        height: 36px;
        font-size: 0.6rem;
    }
}

@media (max-width: 575.98px) {
    .sdgs-badges__list {
        gap: 4px;
    }
    
    .sdgs-badges__icon {
        width: 32px;
        height: 32px;
    }
    
    .sdgs-badges__fallback {
        width: 32px;
        height: 32px;
        font-size: 0.55rem;
    }
}

/* ===================================
   3. 本文エリア
   =================================== */

.single-post-content {
    padding: 40px 0 60px;
}

/* JSアニメーション未適用時でも投稿内容を非表示にしない */
.single-post-page .fade-in-up,
.single-post-page .fade-in-left,
.single-post-page .fade-in-right {
    opacity: 1;
    transform: none;
}

.single-post-content .container {
    max-width: 1024px;
}

.entry-content {
    font-size: 1.1rem;
    line-height: 1.8;
    color: var(--text-color);
}

.entry-content p {
    margin-bottom: 1.5rem;
}

/* 本文先頭の見出しは上余白をリセットして過剰な余白を防ぐ */
.entry-content > *:first-child {
    margin-top: 0;
}

/* H2: 左アクセントバー＋下線＋薄背景でセクションの区切りを強調 */
.entry-content h2 {
    font-size: 1.6rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 64px 0 16px;
    padding: 12px 16px 12px 20px;
    background: var(--bg-light-gray);
    border-left: 6px solid var(--primary-color);
    border-bottom: 3px solid var(--accent-gold);
}

/* H3: 左の縦バー＋下の区切り線 */
.entry-content h3 {
    font-size: 1.35rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 48px 0 16px;
    position: relative;
    padding: 0 0 8px 20px;
    border-bottom: 1px solid var(--border-light);
}

.entry-content h3::before {
    content: '';
    position: absolute;
    left: 0;
    top: 4px;
    width: 4px;
    height: 1.35rem;
    background: var(--primary-color);
}

/* H4: 下線のみのシンプルな装飾 */
.entry-content h4 {
    font-size: 1.2rem;
    font-weight: bold;
    color: var(--text-color);
    margin: 40px 0 8px;
    padding-bottom: 6px;
    border-bottom: 2px solid var(--accent-warm);
}

/* H5: primaryカラー＋頭の四角マーカー */
.entry-content h5 {
    font-size: 1.1rem;
    font-weight: bold;
    color: var(--primary-color);
    margin: 32px 0 8px;
    position: relative;
    padding-left: 18px;
}

.entry-content h5::before {
    content: '';
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 10px;
    height: 10px;
    background: var(--accent-warm);
}

/* H6: muted・letter-spacingでラベル的な小見出し */
.entry-content h6 {
    font-size: 1rem;
    font-weight: bold;
    color: var(--text-muted);
    margin: 24px 0 8px;
    letter-spacing: 0.08em;
}

.entry-content ul,
.entry-content ol {
    margin: 1.5rem 0;
    padding-left: 2rem;
}

.entry-content li {
    margin-bottom: 0.5rem;
}

.entry-content blockquote {
    background: var(--bg-light-gray);
    border-left: 4px solid var(--primary-color);
    padding: 1.5rem;
    margin: 2rem 0;
    font-style: italic;
}

.entry-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 1.5rem auto;
    display: block;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

/* ===================================
   4. 本文エリア下部
   =================================== */

.single-post-footer {
    background: var(--bg-light-gray);
    padding: 40px 0;
    border-top: 1px solid var(--border-light);
}

/* タグセクション */
.single-post-tags {
    margin-bottom: 40px;
}

.single-post-tags h4 {
    font-size: 1rem;
    color: var(--text-color);
    margin-bottom: 15px;
    font-weight: 600;
}

.post-tags-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.post-tag {
    display: inline-block;
    background: var(--white);
    color: var(--text-color);
    padding: 6px 15px;
    border-radius: 25px;
    text-decoration: none;
    font-size: 0.9rem;
    border: 1px solid var(--border-light);
    transition: all 0.3s ease;
}

.post-tag::before {
    content: '#';
    color: var(--primary-color);
    margin-right: 2px;
}

.post-tag:hover {
    background: var(--primary-color);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(29, 32, 137, 0.2);
}

/* 記事一覧ボタン */
.back-to-posts {
    text-align: center;
    margin-bottom: 40px;
}

.btn-back-to-posts {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    background: var(--primary-color);
    color: var(--white);
    padding: 12px 30px;
    text-decoration: none;
    border-radius: 30px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    font-size: 1rem;
}

.btn-back-to-posts::before {
    content: '←';
    font-size: 1.2rem;
}

.btn-back-to-posts:hover {
    background: var(--primary-hover);
    color: var(--white);
    text-decoration: none;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(29, 32, 137, 0.3);
}

/* 前後記事ナビゲーション */
.post-navigation {
    margin-top: 20px;
}

.post-navigation .nav-links {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
    background: var(--white);
    border: 1px solid var(--border-light);
    border-radius: 12px;
    padding: 20px;
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
    display: block;
}

.post-navigation .nav-previous:hover,
.post-navigation .nav-next:hover {
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.1);
    transform: translateY(-2px);
    text-decoration: none;
    color: var(--text-color);
}

.post-navigation .nav-subtitle {
    display: block;
    font-size: 0.8rem;
    color: var(--text-muted);
    margin-bottom: 5px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.post-navigation .nav-title {
    display: block;
    font-weight: 600;
    line-height: 1.3;
}

.post-navigation .nav-previous .nav-subtitle::before {
    content: '← ';
}

.post-navigation .nav-next .nav-subtitle::after {
    content: ' →';
}

.post-navigation .nav-next {
    text-align: right;
}

/* ===================================
   5. レスポンシブ対応
   =================================== */

/* タブレット */
@media (max-width: 991.98px) {
    .single-post-title-section .title-en {
        font-size: 2.5rem;
    }
    
    .single-post-title {
        font-size: 1.8rem;
    }
    
    .single-post-hero::before {
        width: 50%;
    }
}

/* スマートフォン */
@media (max-width: 767.98px) {
    .single-post-hero {
        padding: 40px 0 30px;
    }
    
    .single-post-hero::before {
        display: none;
    }
    
    .single-post-title-section .title-en {
        font-size: 2rem;
    }
    
    .single-post-title {
        font-size: 1.5rem;
    }
    
    .single-post-header {
        padding: 40px 0 30px;
    }
    
    .single-post-meta {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    
    .entry-content {
        font-size: 1rem;
    }
    
    /* スマホ: 見出しのfont-sizeとmargin-topを8の倍数で縮小 */
    .entry-content h2 {
        font-size: 1.35rem;
        margin-top: 40px;
    }
    
    .entry-content h3 {
        font-size: 1.2rem;
        margin-top: 32px;
    }
    
    .entry-content h4 {
        font-size: 1.1rem;
        margin-top: 32px;
    }
    
    .entry-content h5 {
        font-size: 1.05rem;
        margin-top: 24px;
    }
    
    .entry-content h6 {
        font-size: 0.95rem;
        margin-top: 24px;
    }
    
    .post-navigation .nav-links {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .post-navigation .nav-next {
        text-align: left;
    }
}

/* 極小デバイス */
@media (max-width: 575.98px) {
    .single-post-title-section .title-en {
        font-size: 1.8rem;
    }
    
    .single-post-title {
        font-size: 1.3rem;
    }
    
    .single-post-content {
        padding: 30px 0 40px;
    }
    
    .single-post-footer {
        padding: 30px 0;
    }
    
    .post-tags-list {
        gap: 8px;
    }
    
    .post-tag {
        font-size: 0.8rem;
        padding: 4px 12px;
    }
}
