/* ========================================
   記事エリアの基本スタイル
======================================== */


/* ========================================
   メタ情報（改善版）
======================================== */
.post-meta {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 20px;

    padding: 0px 15px 15px;
margin-bottom: 0px;
    /* border-bottom: 2px solid #f0f0f0; */
    font-size: 0.9rem;
justify-content: flex-end; /* 右寄せ */
}

.post-meta > * {
    display: flex;
    align-items: center;
    gap: 6px;
    color: #666;
text-align :right;
}

.meta-icon {
    width: 16px;
    height: 16px;
    opacity: 0.7;
}

.meta-date {
    font-weight: 500;
    color: #333;
}

.meta-updated {
    font-size: 0.85rem;
    color: #999;
}

.meta-category a {
    color: #007bff;
    font-weight: 500;
}

.meta-category a:hover {
    text-decoration: underline;
}


/* ========================================
   本文エリア
======================================== */

.post-content {
    margin-bottom: 40px;
}

/* 段落 */
.post-content p {
    margin-bottom: 1.5em;
    font-size: 1rem;
    line-height: 1.8;
}

/* 見出し */

.post-content p {
    margin-bottom: 1.5em;
    font-size: 1rem;
    line-height: 1.8;
}

/* カスタムクラス: section-title */

.post-content-h2,.post-content h2 {

/* 
    font-size: 1.75rem;
    font-weight: bold;
    margin: 20px 0;
    padding: 0.5em;

    color: #fff;
background:var(--primary-color);
 */
    font-size: 1.6rem;
    font-weight: 700;
    margin: 2.5rem 0 1.5rem;
    padding: 0.6em 0.8em;

    color: #fff;
    background: var(--primary-color);

    border-radius: 6px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.post-content-h2 {
margin: 1.2rem 0 1.5rem;
}

.post-content h3 {
    font-size: 1.5rem;
    font-weight: bold;
    margin: 2em 0 0.8em;
/* 
    margin-bottom: 1.5rem;
    padding-left: 12px;
    border-left: 4px solid #007bff;
    color: #333;
 */
    color: var(--primary-color);
    border-left: 5px solid var(--primary-color);
    padding-left: 1rem;

}


.post-content h4 {
    font-size: 1.25rem;
    font-weight: bold;
    margin: 1.8em 0 0.8em;
    color: #444;
}

.post-content a {
    color: #007bff;
    border-bottom: 1px solid transparent;
    transition: all 0.2s;
}

.post-content a:hover {
    border-bottom-color: #007bff;
}

/* リスト */
.post-content ul,
.post-content ol {
    margin: 1.5em 0;
    padding-left: 2em;
}

.post-content li {
    margin-bottom: 0.5em;
    line-height: 1.8;
}

/* 画像 */
.post-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.post-content figure {
    margin: 2em 0;
    text-align: center;
}

.post-content figcaption {
    margin-top: 10px;
    font-size: 0.9rem;
    color: #666;
    font-style: italic;
}

/* 引用 */
.post-content blockquote {
    margin: 1.5em 0;
    padding: 1em 1.5em;
    background: #f9f9f9;
    border-left: 4px solid #007bff;
    color: #555;
    font-style: italic;
}

/* コード */
.post-content code {
    padding: 2px 6px;
    background: #f5f5f5;
    border-radius: 3px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
    color: #c7254e;
}

.post-content pre {
    margin: 1.5em 0;
    padding: 1.5em;
    background: #2d2d2d;
    border-radius: 8px;
    overflow-x: auto;
}



/* テーブル */
.post-content table {
    width: 100%;
    margin: 1.5em 0;
    border-collapse: collapse;
}

.post-content th,
.post-content td {
    padding: 12px;
    border: 1px solid #ddd;
    text-align: left;
}

.post-content th {
    background: #f8f9fa;
    font-weight: bold;
}

/* 区切り線 */
.post-content hr {
    margin: 2em 0;
    border: none;
    border-top: 1px solid #e0e0e0;
}



/* ========================================
   SNSシェアボタン
======================================== */


.share-buttons {
    margin: 30px 0;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
}

.share-title {
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    margin-bottom: 15px;
    text-align: center;
}

.share-button-list {
    display: flex;
    justify-content: center;
    gap: 10px;
    flex-wrap: wrap;
}

.share-button {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 10px 16px;
    border-radius: 6px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 600;
    color: white;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}

.share-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.15);
}

.share-button svg {
    width: 20px;
    height: 20px;
}

.share-button span {
    font-size: 0.85rem;
}

/* 各SNSのブランドカラー */
.share-button.twitter {
    background: #000000;
}

.share-button.twitter:hover {
    background: #333333;
}

.share-button.facebook {
    background: #1877f2;
}

.share-button.facebook:hover {
    background: #0d65d9;
}

.share-button.hatena {
    background: #00a4de;
}

.share-button.hatena:hover {
    background: #008fc7;
}

.share-button.line {
    background: #00B900;
}

.share-button.line:hover {
    background: #009900;
}





/* ========================================
   関連記事
======================================== */

.related-posts {
    margin: 50px 0 20px;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
    border-top: 4px solid var(--primary-color);
}

.related-posts-title {
    font-size: 1.25rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 25px;
}

.related-posts-list {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 15px;
}

.related-post-item {
    background: white;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.2s;
    border: 1px solid #e0e0e0;
}

.related-post-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
    border-color: #007bff;
}

.related-post-link {
    display: flex;
    gap: 15px;
    padding: 15px;
    text-decoration: none;
    color: inherit;
    align-items: flex-start;
}

/* サムネイル画像（80×80） */
.related-post-thumbnail {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    overflow: hidden;
    background: #f0f0f0;
    border-radius: 6px;
}

.related-post-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.related-post-item:hover .related-post-thumbnail img {
    transform: scale(1.1);
}

/* 画像がない場合のプレースホルダー */
.no-image {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #e0e0e0 0%, #f0f0f0 100%);
    font-size: 32px;
    opacity: 0.5;
}

/* コンテンツエリア */
.related-post-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0; /* テキストの省略を機能させるため */
}

.related-post-title {
    font-size: 0.95rem;
    font-weight: 600;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.related-post-item:hover .related-post-title {
    color: #007bff;
}

.related-post-excerpt {
    font-size: 0.8rem;
    color: #666;
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    margin: 0;
}

.related-post-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.75rem;
    color: #999;
    flex-wrap: wrap;
    margin-top: auto;
}

.related-post-date {
    display: inline-block;
}

.related-post-category {
    display: inline-block;
    padding: 2px 8px;
    background: #e7f3ff;
    color: #0056b3;
    border-radius: 4px;
    font-size: 0.75rem;
}

.related-score {
    display: inline-block;
    padding: 2px 6px;
    background: #fff3cd;
    color: #856404;
    border-radius: 4px;
    font-size: 0.7rem;
}

/* レスポンシブ対応 */
@media (max-width: 768px) {
    .related-posts {
        padding: 20px;
    }
    
    .related-posts-list {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .related-post-link {
        padding: 12px;
        gap: 12px;
    }
    
    .related-post-thumbnail {
        width: 70px;
        height: 70px;
    }
    
    .no-image {
        font-size: 28px;
    }
}



/* ========================================
   ページネーション
======================================== */


.post-navigation {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin: 40px 0;
    padding: 0;
}

.navi-link {
    display: flex;
    flex-direction: column;
    padding: 20px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-decoration: none;
    color: inherit;
    transition: all 0.2s;
    background: white;
}

.navi-link:not(.navi-disabled):hover {
    border-color: #007bff;
    background: #f8f9fa;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.navi-link.navi-disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.navi-prev {
    text-align: left;
}

.navi-next {
    text-align: right;
}

.navi-label {
    display: block;
    font-size: 0.85rem;
    font-weight: 600;
    color: #007bff;
    margin-bottom: 8px;
}

.navi-link.navi-disabled .navi-label {
    color: #999;
}

.navi-title {
    display: block;
    font-size: 0.95rem;
    font-weight: 500;
    color: #333;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.navi-link:not(.navi-disabled):hover .navi-title {
    color: #007bff;
}





/* ========================================
   レスポンシブ対応
======================================== */
@media (max-width: 768px) {
    .post-article {
        padding: 20px 15px;
    }
    
    .post-title {
        font-size: 1.5rem;
    }
    
    .post-meta {
        gap: 10px;
        font-size: 0.85rem;
    }
    
    .post-content h2 {
        font-size: 1.5rem;
    }
    
    .post-content h3 {
        font-size: 1.25rem;
    }
    
    .tag-group {
        flex-direction: column;
        gap: 8px;
    }
    
    .tag-type-label {
        min-width: auto;
    }
    
    .related-posts {
        padding: 20px 15px;
    }
    
    .related-posts-list {
        grid-template-columns: 1fr;
    }
    
    .post-navigation {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .navi-prev,
    .navi-next {
        text-align: left;
    }
    
    .share-button {
        padding: 8px 12px;
        font-size: 0.85rem;
    }
}


/* ========================================
   サムネイル画像用
======================================== */

.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    cursor: pointer;
}

.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
}

.lightbox-content img {
    max-width: 100%;
    max-height: 90vh;
    object-fit: contain;
}

.lightbox-close {
    position: absolute;
    top: -40px;
    right: 0;
    font-size: 40px;
    color: white;
    cursor: pointer;
    font-weight: bold;
    z-index: 10000;
}

.lightbox-close:hover {
    color: #ccc;
}

a.image-lightbox {
    display: inline-block;
    cursor: pointer;
}

a.image-lightbox img {
    transition: opacity 0.3s;
}

a.image-lightbox:hover img {
    opacity: 0.8;
}




/* ========================================
関連リンクのスタイル
======================================== */
.related-links {
    margin: 30px 0;
    padding: 30px;
    background: #f8f9fa;
    border-radius: 8px;
}

.related-links-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 2px solid var(--primary-color);
    color: #333;
}

.related-links-list {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.related-link-item {
    background: white;
    border-radius: 6px;
    border: 1px solid #dee2e6;
    transition: all 0.2s ease;
}

.related-link-item:hover {
    border-color: #007bff;
    box-shadow: 0 2px 8px rgba(0, 123, 255, 0.1);
}

.related-link {
    display: block;
    padding: 15px;
    text-decoration: none;
    color: inherit;
}

.related-link-title {
    font-size: 16px;
    font-weight: 600;
/* color: #007bff; */    
    margin-bottom: 8px;
    display: flex;
    align-items: center;
    gap: 6px;
}

.external-icon {
    font-size: 14px;
    color: #6c757d;
}

.related-link-description {
    font-size: 14px;
    color: #666;
    line-height: 1.6;
    margin-bottom: 10px;
}

.related-link-meta {
    font-size: 12px;
    color: #6c757d;
    display: flex;
    align-items: center;
    gap: 10px;
}

.related-link-tags {
    display: inline-block;
}

.related-score {
    font-weight: 500;
    color: #28a745;
}

@media (max-width: 600px) {
    .related-links {
        padding: 20px 15px;
    }
    
    .related-link-title {
        font-size: 15px;
    }
    
    .related-link-description {
        font-size: 13px;
    }
}



/* ========================================
目次のスタイル
======================================== */

.table-of-contents {
    background: #f8f9fa;
    border: 1px solid #dee2e6;
    border-radius: 8px;
    padding: 20px;
    margin: 0px 0 20px;
}

.toc-title {
    font-size: 1.2rem;
    font-weight: 600;
    margin: 0 0 15px 0;
    color: #333;
}

.toc-list {
    margin: 0;
    padding-left: 20px;
    line-height: 1.8;
}

.toc-list li {
    margin-bottom: 8px;
}

.toc-list a {
    color: #007bff;
    text-decoration: none;
    transition: color 0.2s;
}

.toc-list a:hover {
    color: #0056b3;
    text-decoration: underline;
}

/* スムーススクロール */
html {
    scroll-behavior: smooth;
}

/* ジャンプ先の位置調整（固定ヘッダー対応） */
.post-content h3 {
    scroll-margin-top: 20px;
}

@media (max-width: 768px) {
    .table-of-contents {
        padding: 15px;
    }
    
    .toc-title {
        font-size: 1.1rem;
    }
    
    .toc-list {
        font-size: 0.9rem;
    }
}



/* ========================================
   タグエリア
======================================== */

.post-tags {
    margin: 40px 0;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.tags-title {
    font-size: 1.1rem;
    font-weight: 600;
    color: #333;
    margin-bottom: 20px;
}

.tags-container {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.tag-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}

.tag-type-label {
    display: inline-block;
    min-width: 80px;
    font-size: 0.9rem;
    font-weight: 600;
    color: #666;
    padding: 6px 0;
}

.tag-list {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex: 1;
}

.tag-item {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.2s;
    border: 1px solid transparent;
}

/* タイプ別のカラー */

/* 
.tag-item.tag-sizen {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.tag-item.tag-sizen:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
}
 */
.tag-item.tag-area {
    background: #d4edda;
    color: #155724;
    border-color: #c3e6cb;
}

.tag-item.tag-area:hover {
    background: #28a745;
    color: white;
    border-color: #28a745;
}


.tag-item.tag-person {
    background: #80404022;
    color: #804040;
    border-color: #80404055;
}

.tag-item.tag-person:hover {
    background: #804040;
    color: white;
    border-color: #804040;
}


.tag-item.tag-era {
    background: #d1ecf1;
    color: #0c5460;
    border-color: #bee5eb;
}

.tag-item.tag-era:hover {
    background: #17a2b8;
    color: white;
    border-color: #17a2b8;
}

.tag-item.tag-sizen {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.tag-item.tag-sizen:hover {
    background: #ffc107;
    color: #333;
    border-color: #ffc107;
}

.tag-item.tag-theme {
    background: #f8d7da;
    color: #721c24;
    border-color: #f5c6cb;
}

.tag-item.tag-theme:hover {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

/* 
.tag-item.tag-other {
    background: #fff3cd;
    color: #856404;
    border-color: #ffeaa7;
}

.tag-item.tag-other:hover {
    background: #ffc107;
    color: #333;
    border-color: #ffc107;
}
 */
.tag-item.tag-other {
    background: #6c757d22;
    color: #6c757d;
    border-color: #6c757d55;
}

.tag-item.tag-other:hover {
    background: #6c757d;
    color: white;
    border-color: #6c757d;
}
