@charset "UTF-8";

/* =========================================
   パンくずリスト
   ========================================= */
.breadcrumb {
    padding: 15px 0;
    background-color: #fff;
    border-bottom: 1px solid #eee;
}
.breadcrumb ul {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    font-size: 13px;
    color: #666;
}
.breadcrumb li {
    display: flex;
    align-items: center;
    gap: 10px;
}
.breadcrumb li:not(:last-child)::after {
    content: '>';
    color: #ccc;
    font-size: 12px;
}
.breadcrumb a {
    color: #666;
    display: flex;
    align-items: center;
}
.breadcrumb a:hover {
    color: var(--primary-color);
}

/* =========================================
   レイアウト
   ========================================= */
.single-page-wrapper {
    padding: 40px 0 80px;
    background-color: #F9F9F9; /* うっすらグレーの背景 */
}
.single-layout {
    display: flex;
    gap: 40px;
    align-items: flex-start;
}

/* =========================================
   メインコンテンツ (左側)
   ========================================= */
.single-main {
    flex-grow: 1;
    background-color: #fff;
    padding: 50px;
    border: 1px solid #ddd;
    box-shadow: 0 5px 20px rgba(0,0,0,0.02);
    /* ▼ はみ出し防止（Flexbox内の要素が広がりすぎるのを防ぐ） */
    min-width: 0;
    max-width: 100%;
}

/* タイトル */
.single-title-area {
    margin-bottom: 30px;
    border-left: 5px solid var(--primary-color);
    padding-left: 15px;
}
.single-title {
    font-size: 26px;
    font-weight: bold;
    color: #333;
    line-height: 1.5;
}

/* アイキャッチ画像＆カテゴリラベル */
.single-eyecatch {
    border: 1px solid #eee;
    padding: 10px;
    background: #fff;
    margin-bottom: 25px;
}
.single-eyecatch img {
    width: 100%;
    /* ▼ 変更: 縦横比を16:9に固定し、はみ出した部分を綺麗に切り取る */
    aspect-ratio: 16 / 9;
    object-fit: cover;
    display: block;
}
.single-category-bar {
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 12px;
    font-size: 16px;
    font-weight: bold;
    margin-top: 10px;
}

/* メタ情報 (日付など) */
.single-meta {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 40px;
    font-size: 14px;
    color: #666;
    flex-wrap: wrap;
    border-bottom: 1px solid #eee;
    padding-bottom: 20px;
}
.meta-date {
    display: flex;
    align-items: center;
    gap: 5px;
    color: var(--primary-color);
}
.meta-new {
    color: #d32f2f; /* NEWの文字は目を引く赤に */
    font-weight: bold;
    font-style: italic;
}
.meta-update {
    display: flex;
    align-items: center;
    gap: 5px;
}

/* 本文スタイル */
.single-content {
    font-size: 15px;
    line-height: 1.8;
    color: #333;
    /* ▼ テキストの右端突き抜け防止 */
    word-break: break-word;
    overflow-wrap: break-word;
}
:where(.single-content) p {
    margin-bottom: 25px;
}
.single-content a {
    color: var(--primary-color);
    text-decoration: underline;
}
.single-content a:hover {
    text-decoration: none;
}

/* テーブルスタイル */
.single-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 30px 0;
}
.single-content th, 
.single-content td {
    border: 1px solid #ddd;
    padding: 15px 12px;
    text-align: center;
    font-size: 14px;
}
.single-content th {
    background-color: #f5f5f5;
    color: #333;
    font-weight: bold;
}


.single-content .wp-block-table thead,
.single-content .wp-block-table tbody,
.single-content .wp-block-table tfoot {
    border: none !important;
}
.single-content .wp-block-table {
    margin: 0; 
}



/* スマホでテーブルがはみ出さないように横スクロールさせるためのクラス */
.table-responsive {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    margin: 30px 0;
}
.table-responsive table {
    margin: 0;
    min-width: 600px; /* スマホで縮みすぎないように制限 */
}

/* =========================================
   前後記事ナビゲーション
   ========================================= */
.single-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 60px;
    gap: 20px;
}
.nav-link-box {
    flex: 1;
    background-color: #f9f9f9;
    padding: 20px;
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: background-color 0.3s;
}
.nav-link-box:hover {
    background-color: #f0f0f0;
}
.nav-link-box.prev {
    border-left: 5px solid #ddd;
    justify-content: flex-start;
}
.nav-link-box.next {
    border-right: 5px solid #ddd;
    justify-content: flex-end;
    text-align: right;
}
.nav-text-wrapper {
    display: flex;
    flex-direction: column;
}
.nav-label {
    font-size: 12px;
    color: #666;
    margin-bottom: 8px;
}
.nav-title {
    font-size: 14px;
    color: var(--primary-color);
    font-weight: bold;
    line-height: 1.4;
}
.single-nav-arrow {
    font-size: 14px;
    color: var(--primary-color);
    margin: 0 15px;
}

/* =========================================
   最近のお知らせ (関連記事)
   ========================================= */
.recent-section {
    margin-top: 80px;
}
.recent-title {
    font-size: 20px;
    font-weight: bold;
    color: #333;
    padding-bottom: 12px;
    border-bottom: 2px solid var(--primary-color);
    margin-bottom: 30px;
}
.recent-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 30px;
}
.recent-card {
    border: 1px solid #ddd;
    background: #fff;
}
.recent-card__img {
    /* padding: 10px; */
    border-bottom: 1px solid #eee;
}
.recent-card__img img {
    width: 100%;
    aspect-ratio: 16/9;
    object-fit: cover;
    display: block;
}
.recent-card__cat {
    background-color: var(--primary-color);
    color: #fff;
    text-align: center;
    padding: 10px;
    font-size: 14px;
    font-weight: bold;
    margin-top: 10px;
}
.recent-card__date {
    padding: 15px 20px;
    font-size: 16px;
    color: var(--primary-color);
    font-weight: 500;
}

/* =========================================
   サイドバー (右側)
   ========================================= */
.single-sidebar {
    width: 260px;
    flex-shrink: 0;
}
.sidebar-menu {
    background: #fff;
    border: 1px solid #ddd;
}
.sidebar-header {
    background-color: var(--primary-color); 
    color: #fff;
    padding: 20px 15px;
    font-size: 16px;
    font-weight: bold;
    text-align: center;
}
.sidebar-list li {
    border-bottom: 1px solid #eee;
}
.sidebar-list li:last-child {
    border-bottom: none;
}
.sidebar-list a {
    display: flex;
    align-items: center;
    padding: 18px 20px;
    font-size: 14px;
    color: var(--primary-color);
    font-weight: 500;
}
.sidebar-arrow {
    margin-right: 12px;
    flex-shrink: 0; 
    color: var(--primary-color); 
}
.sidebar-list a:hover {
    background-color: #f5f5f5;
}




/* =========================================
   WordPress 標準ブロック (Gutenberg) & 見出し スタイル
   ========================================= */

/* -----------------------------------------
   見出しスタイル (H2, H3)
   ----------------------------------------- */
/* 中見出し (H2) */
.single-content h2 {
    background-color: #f5f5f5;
    border-left: 5px solid var(--primary-color);
    padding: 15px 20px;
    font-size: 20px;
    font-weight: bold;
    color: #333;
    margin: 50px 0 25px;
}

/* 小見出し (H3) */
.single-content h3 {
    position: relative;
    padding-left: 20px;
    font-size: 18px;
    font-weight: bold;
    color: #333;
    margin: 40px 0 20px;
}
.single-content h3::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 7px solid var(--primary-color);
}

/* -----------------------------------------
   各種ブロック
   ----------------------------------------- */
/* 引用ブロック (blockquote) */
.single-content .wp-block-quote {
    margin: 30px 0;
    padding: 20px 30px;
    background-color: #f9f9f9;
    border-left: 5px solid var(--primary-color); 
    font-style: normal;
    color: #555;
}
.single-content .wp-block-quote p {
    margin-bottom: 10px;
}
.single-content .wp-block-quote cite {
    font-size: 13px;
    color: #999;
    display: block;
    margin-top: 10px;
    text-align: right;
}

/* ボタンブロック */
.single-content .wp-block-button__link {
    background-color: var(--primary-color);
    color: #fff;
    border-radius: 30px;
    padding: 12px 30px;
    text-decoration: none;
    display: inline-block;
    font-weight: bold;
    transition: opacity 0.3s;
    border: none;
}
.single-content .wp-block-button__link:hover {
    opacity: 0.9;
    color: #fff;
    text-decoration: none;
}

/* 白抜きボタン (アウトライン) */
.single-content .wp-block-button.is-style-outline .wp-block-button__link {
    background-color: transparent;
    color: var(--primary-color);
    border: 2px solid var(--primary-color);
}
.single-content .wp-block-button.is-style-outline .wp-block-button__link:hover {
    background-color: var(--primary-color);
    color: #fff;
}

/* アコーディオン (詳細ブロック) */
.single-content .wp-block-details {
    margin: 30px 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
}
.single-content .wp-block-details summary {
    padding: 15px 20px;
    font-weight: bold;
    cursor: pointer;
    background: #f5f5f5;
    outline: none;
    list-style-position: inside; 
}
.single-content .wp-block-details summary:hover {
    background: #eee;
}
.single-content .wp-block-details > *:not(summary) {
    padding: 20px;
    margin: 0;
    border-top: 1px solid #ddd;
}

/* ギャラリーブロック */
.single-content .wp-block-gallery {
    margin: 30px 0;
}

/* カバーブロック */
.single-content .wp-block-cover {
    margin: 30px 0;
    padding: 40px 20px;
}

/* カラムブロックのスマホ調整 */
@media (max-width: 600px) {
    .single-content .wp-block-columns:not(.is-not-stacked-on-mobile) {
        display: block;
    }
    .single-content .wp-block-column {
        margin-bottom: 20px;
    }
}




/* =========================================
   目次 (TOC) スタイル
   ========================================= */
.toc-box {
    margin: 40px 0;
    background: #fff;
    border: 1px solid #ddd;
    max-width: 600px;
}
.toc-header {
    background-color: #f5f5f5;
    padding: 15px 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-bottom: 1px solid #ddd;
    cursor: pointer;
    position: relative;
    transition: background-color 0.3s;
}
.toc-header:hover {
    background-color: #eee;
}
.toc-title {
    font-size: 16px;
    color: #555;
    font-weight: 500;
}
.toc-toggle {
    position: absolute;
    right: 20px;
    font-size: 14px;
    color: #666;
}
/* ▼ アニメーションを追加 ▼ */
.toc-body {
    padding: 30px;
    display: grid;
    grid-template-rows: 1fr;
    transition: grid-template-rows 0.3s ease, padding 0.3s ease, opacity 0.3s ease;
}
/* ▼ 閉じた時の状態を追加 ▼ */
.toc-body.is-closed {
    grid-template-rows: 0fr;
    padding-top: 0;
    padding-bottom: 0;
    opacity: 0;
}
.toc-list {
    list-style: none;
    padding: 0;
    margin: 0;
    overflow: hidden; /* ▼ アニメーション中はみ出さないように追加 */
}
/* ▼ 余白を15pxに縮小 */
.toc-list li {
    margin-bottom: 15px; 
}
.toc-list li:last-child {
    margin-bottom: 0;
}

/* 見出し2（H2）のスタイル */
.toc-item-h2 a {
    font-size: 16px;
    font-weight: 500;
    color: var(--primary-color);
    text-decoration: none;
    display: flex;
    align-items: flex-start;
    line-height: 1.4;
    transition: opacity 0.3s;
}
/* 矢印アイコン（CSSで太めの矢印を作成） */
.toc-item-h2 a::before {
    content: '';
    display: inline-block;
    width: 5px;
    height: 5px;
    border-top: 1px solid var(--primary-color);
    border-right: 1px solid var(--primary-color);
    transform: rotate(45deg);
    margin-right: 12px;
    /* ▼ margin-topを調整してテキストの中央にピッタリ合わせる */
    margin-top: 9px; 
    flex-shrink: 0;
}

/* 見出し3（H3）のスタイル */
.toc-item-h3 a {
    font-size: 14px;
    color: #333;
    text-decoration: none;
    display: block;
    padding-left: 25px;
    position: relative;
    line-height: 1.4;
    transition: opacity 0.3s;
}
.toc-item-h3 a::before {
    content: '-';
    position: absolute;
    left: 10px;
    /* ▼ H3のハイフンもテキストに揃うように位置調整 */
    top: 0; 
    line-height: 1.4;
    color: #999;
}
.toc-list a:hover {
    opacity: 0.7;
}

/* ▼ 目次のスマホ表示調整 ▼ */
@media (max-width: 900px) {
    .toc-box {
        max-width: 100%;
        margin: 30px 0;
    }
    .toc-header {
        padding: 12px 15px;
        justify-content: space-between;
    }
    .toc-title {
        font-size: 13px;
        text-align: left;
        flex-grow: 1;
        padding-right: 10px;
        line-height: 1.4;
    }
    .toc-toggle {
        position: static;
        flex-shrink: 0;
        font-size: 12px;
    }
    .toc-body {
        padding: 20px 15px;
    }
    .toc-body.is-closed {
        padding-top: 0;
        padding-bottom: 0;
    }
    /* ▼ スマホ時の余白を13pxに縮小 */
    .toc-list li {
        margin-bottom: 13px;
    }
    .toc-item-h2 a {
        font-size: 14px; 
    }
    .toc-item-h2 a::before {
        width: 4px;
        height: 4px;
        border-top-width: 1px;
        border-right-width: 1px;
        /* ▼ スマホ時の矢印もテキストの中央にピッタリ合わせる */
        margin-top: 8px; 
        margin-right: 10px;
    }
    .toc-item-h3 a {
        font-size: 13px; 
        padding-left: 20px;
    }
    .toc-item-h3 a::before {
        left: 5px;
    }
}



/* =========================================
   レスポンシブ対応 (スマホ用)
   ========================================= */
@media (max-width: 900px) {

    /* ▼ パンくずリストの横スクロール対応 ▼ */
    .breadcrumb {
        padding: 10px 0;
        overflow: hidden;
    }
    .breadcrumb .container {
        padding-right: 0; /* 右端までスクロールさせるための調整 */
    }
    .breadcrumb ul {
        flex-wrap: nowrap;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        padding-bottom: 10px; /* スクロールバー用の余裕 */
        margin-bottom: -10px; /* 見た目の相殺 */
        /* スクロールバーを隠す設定 */
        scrollbar-width: none; 
        -ms-overflow-style: none;
    }
    .breadcrumb ul::-webkit-scrollbar {
        display: none; 
    }
    .breadcrumb li {
        white-space: nowrap; /* ▼ テキストの折り返しを防止 */
        flex-shrink: 0; /* ▼ 縮むのを防止 */
    }
    .breadcrumb li:last-child {
        padding-right: 20px; /* 一番右まで行ったときの余白 */
    }

    /* ラッパーの余白縮小 */
    .single-page-wrapper {
        padding: 0 0 60px;
    }
    
    .single-layout {
        flex-direction: column;
        gap: 0;
    }

    .single-layout.container {
        padding: 0;
    }
    
    /* ▼ メインコンテンツのスマホ調整 */
    .single-main {
        padding: 25px 20px;
        order: 1; 
        border: none; 
        box-shadow: 0 2px 10px rgba(0,0,0,0.05); 
        border-radius: 4px;
        /* ▼ 万が一のはみ出しを強制カット（画面幅オーバー対策） */
        width: 100%;
        max-width: 100%;
        box-sizing: border-box;
    }
    
    /* タイトル周り */
    .single-title-area {
        margin-bottom: 20px;
        padding-left: 12px;
        border-left-width: 4px;
    }
    .single-title {
        font-size: 20px; 
        line-height: 1.4;
    }
    
    /* メタ情報 */
    .single-meta {
        gap: 10px 15px;
        margin-bottom: 25px;
        padding-bottom: 15px;
        font-size: 13px;
    }
    
    /* 本文 */
    .single-content {
        font-size: 14px; 
    }
    .single-content p {
        margin-bottom: 20px;
    }

    /* 前後記事ナビゲーション */
    .single-navigation {
        flex-direction: column;
        gap: 15px;
        margin-top: 40px;
    }
    .nav-link-box {
        padding: 15px;
    }
    
    /* 最近の記事 */
    .recent-section {
        margin-top: 50px;
    }
    .recent-title {
        font-size: 18px;
        margin-bottom: 20px;
    }
    .recent-grid {
        grid-template-columns: 1fr;
        gap: 20px; 
    }

    /* サイドバー */
    .single-sidebar {
        width: 100%;
        order: 2; 
        margin-top: 0;
        padding: 25px 20px;
    }
    .sidebar-header {
        font-size: 15px;
        padding: 15px;
    }
    .sidebar-list a {
        padding: 15px; 
    }
}