/* single.php用スタイル（コラム詳細ページ） */


/* 共通スタイル */

img {
    max-width: 100%;
    height: auto;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

.btn {
    display: inline-block;
    background-color: var(--main-color);
    color: white;
    padding: 12px 24px;
    border-radius: 8px;
    font-weight: 600;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(170, 187, 204, 0.3);
}

.btn:hover {
    background-color: var(--main-dark);
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(170, 187, 204, 0.4);
}


/* 枠線 */

.post-main-content ul,
.post-main-content ol {
    text-align: left;
    margin-bottom: 40px;
    background-color: #f8f9ff;
    border: dashed 1px #4865b2;
    padding-top: 40px;
    padding-bottom: 36px;
    padding-right: 10px;
    padding-left: 40px;
    /* ここで枠内にインデント */
}

.post-main-content ul li,
.post-main-content ol li {
    margin-bottom: 10px;
    text-align: left;
}


/* パンくずリスト */

.breadcrumb {
    background-color: var(--bg-light);
    padding: 15px 0;
    border-bottom: 1px solid var(--border);
}

.breadcrumb-list {
    display: flex;
    align-items: center;
    list-style: none;
    font-size: 14px;
}

.breadcrumb-item {
    display: flex;
    align-items: center;
}

.breadcrumb-item:not(:last-child)::after {
    content: '/';
    margin: 0 10px;
    color: var(--text-light);
}

.breadcrumb-item a {
    color: var(--text-light);
}

.breadcrumb-item a:hover {
    color: var(--main-color);
}

.breadcrumb-item.active {
    color: var(--main-color);
    font-weight: 600;
}


/* 投稿詳細ページのメインレイアウト */

.single-post-layout {
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 40px;
    margin: 50px 0;
}


/* メインコンテンツ */

.post-main-content {
    background-color: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    overflow: hidden;
}

.post-header {
    padding: 30px;
}

.post-meta {
    margin-bottom: 15px;
    text-align: center;
}

.post-categories {
    display: flex;
    gap: 10px;
}

.post-category {
    background-color: var(--main-color);
    color: white;
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}

.post-date {
    color: var(--text-light);
    font-size: 14px;
    gap: 5px;
}

.post-title {
    font-size: 25px;
    font-weight: 700;
    color: var(--text);
    line-height: 1.4;
    text-align: center;
}

.post-author {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.author-avatar {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: var(--main-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    font-weight: 600;
    color: var(--main-dark);
    margin-right: 15px;
}

.author-info {
    display: flex;
    flex-direction: column;
}

.author-name {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
}

.author-role {
    color: var(--text-light);
    font-size: 14px;
}

.post-featured-image {
    width: 100%;
    height: auto;
    max-height: 600px;
    /* 画像の最大高さを増加 */
    object-fit: contain;
    /* 画像のアスペクト比を維持 */
}

.post-content-wrap {
    padding: 30px;
}


/* 5つ星評価 */

.post-rating {
    margin: 20px 0;
    text-align: center;
    background-color: var(--bg-alt);
    padding: 15px;
    border-radius: 8px;
}

.rating-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 10px;
}

.star-rating {
    display: inline-flex;
    direction: rtl;
}

.star-rating input {
    display: none;
}

.star-rating label {
    color: #ddd;
    font-size: 30px;
    padding: 0 5px;
    cursor: pointer;
}

.star-rating label:hover,
.star-rating label:hover~label,
.star-rating input:checked~label {
    color: #FFD700;
}

.rating-count {
    margin-top: 10px;
    font-size: 14px;
    color: var(--text-light);
}


/* 投稿コンテンツ */

.post-content {
    color: var(--text);
    font-size: 17px;
    font-family: Noto, Hiragino Sans, Helvetica, Arial, sans-serif;
    text-rendering: optimizeLegibility;
    background: transparent;
    -webkit-font-smoothing: antialiased;
    line-height: 2;
}

.post-content p {
    margin-bottom: 60px;
}

.post-content p:has(img),
.post-content p img {
    margin-bottom: 15px !important;
}

.post-content h2 {
    background: #f7f7f7;
    margin-bottom: 25px;
    padding: 20px 15px 18px;
    color: #333;
    border-left: 9px solid var(--main-light);
    line-height: 40px;
}

.post-content h3 {
    font-weight: 600;
    font-size: 20px;
    color: var(--text);
    letter-spacing: 1.6px;
    padding: 0px 15px 0px;
    border-left: 9px solid var(--text);
    color: #333;
    font-weight: 600;
    margin-top: 60px;
    margin-bottom: 20px;
}

.post-content img {
    border-radius: 8px;
    width: 100%;
    /* 画像を大きく表示 */
    height: auto;
}

.post-content blockquote {
    border-left: 4px solid var(--main-color);
    padding: 15px 20px;
    margin: 20px 0;
    background-color: var(--bg-alt);
    font-style: italic;
    color: var(--text-light);
}

.post-content code {
    background-color: var(--bg-alt);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: monospace;
}

.post-content pre {
    background-color: var(--bg-alt);
    padding: 15px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 20px 0;
    border: 1px solid var(--border);
}

.tips-box {
    border-left: 4px solid #4fc3f7;
    background: #f7fafd;
    padding: 1em 1.2em;
    margin: 1.5em 0;
    color: #333;
    font-style: italic;
}


/* 記事のタグ */

.post-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 40px;
    padding-top: 20px;
    border-top: 1px solid var(--border);
}

.post-tag {
    font-size: 12px;
    color: var(--main-dark);
    background-color: var(--main-light);
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.post-tag:hover {
    background-color: var(--main-color);
    color: white;
}


/* 記事のシェアボタン */

.post-share {
    margin-top: 30px;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.share-button {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
}

.share-button:hover {
    transform: translateY(-3px);
}

.share-twitter {
    background-color: #1DA1F2;
}

.share-facebook {
    background-color: #1877F2;
}

.share-line {
    background-color: #06C755;
}


/* 著者プロフィール */

.author-bio {
    background-color: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 30px;
    margin-top: 50px;
    display: flex;
}

.author-bio-avatar {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background-color: var(--main-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    font-weight: 600;
    color: var(--main-dark);
    margin-right: 20px;
    flex-shrink: 0;
}

.author-bio-content {
    flex-grow: 1;
}

.author-bio-name {
    font-size: 20px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 10px;
}

.author-bio-description {
    color: var(--text-light);
    font-size: 15px;
    line-height: 1.6;
    margin-bottom: 15px;
}

.author-social {
    display: flex;
    gap: 10px;
}

.author-social a {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background-color: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-light);
    transition: all 0.3s ease;
}

.author-social a:hover {
    background-color: var(--main-color);
    color: white;
}


/* 関連記事 */

.related-posts {
    margin-top: 50px;
}

.related-posts-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.related-posts-title:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--main-color);
}

.related-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
}

.related-post-card {
    background-color: var(--bg);
    border-radius: var(--radius);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.related-post-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    border-color: var(--main-light);
}

.related-post-image {
    width: 100%;
    height: 150px;
    overflow: hidden;
}

.related-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: all 0.4s ease;
}

.related-post-card:hover .related-post-image img {
    transform: scale(1.05);
}

.related-post-content {
    padding: 15px;
}

.related-post-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 8px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}


/* 関連記事画像のスタイル（高解像度対応） */

.related-post-img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
    image-rendering: auto;
}


/* サイドバー */

.post-sidebar {
    position: sticky;
    top: 20px;
    align-self: flex-start;
}

.sidebar-section {
    background-color: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 25px;
    margin-bottom: 30px;
}

.sidebar-title {
    font-size: 18px;
    font-weight: 700;
    margin-bottom: 20px;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.sidebar-title:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--main-color);
}


/* 人気記事 */

.popular-post {
    display: flex;
    margin-bottom: 15px;
    padding-bottom: 15px;
    border-bottom: 1px solid var(--border);
}

.popular-post:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
    border-bottom: none;
}

.popular-post-image {
    width: 70px;
    height: 70px;
    border-radius: 8px;
    overflow: hidden;
    margin-right: 15px;
    flex-shrink: 0;
}

.popular-post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.popular-post-content {
    flex-grow: 1;
}

.popular-post-title {
    font-size: 14px;
    font-weight: 600;
    line-height: 1.4;
    margin-bottom: 5px;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.popular-post-meta {
    font-size: 12px;
    text-align: center;
    color: var(--text-light);
}


/* カテゴリー一覧 */

.sidebar-categories {
    list-style: none;
}

.sidebar-category-item {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.sidebar-category-link {
    color: var(--text);
    transition: all 0.3s ease;
    font-size: 15px;
    display: flex;
    align-items: center;
}

.sidebar-category-link:before {
    content: '›';
    margin-right: 8px;
    color: var(--main-color);
    font-size: 18px;
    font-weight: 600;
}

.sidebar-category-link:hover {
    color: var(--main-color);
    padding-left: 5px;
}

.sidebar-category-count {
    background-color: var(--bg-alt);
    color: var(--text-light);
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 12px;
}


/* タグクラウド */

.sidebar-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.sidebar-tag {
    font-size: 12px;
    color: var(--text);
    background-color: var(--bg-alt);
    padding: 5px 10px;
    border-radius: 4px;
    transition: all 0.3s ease;
    border: 1px solid var(--border);
}

.sidebar-tag:hover {
    background-color: var(--main-light);
    color: var(--main-dark);
    border-color: var(--main-light);
}


/* CTAバナー */

.sidebar-cta {
    background-color: var(--main-light);
    border-radius: var(--radius);
    padding: 25px;
    text-align: center;
    border: none;
}

.sidebar-cta-title {
    font-size: 20px;
    font-weight: 700;
    color: var(--main-dark);
    margin-bottom: 15px;
}

.sidebar-cta-description {
    font-size: 14px;
    color: var(--text);
    margin-bottom: 20px;
    line-height: 1.6;
}


/* コメント */

.comments-section {
    margin-top: 50px;
}

.comments-title {
    font-size: 24px;
    font-weight: 700;
    margin-bottom: 30px;
    color: var(--text);
    position: relative;
    display: inline-block;
}

.comments-title:after {
    content: '';
    position: absolute;
    bottom: -6px;
    left: 0;
    width: 40px;
    height: 3px;
    background-color: var(--main-color);
}

.comment-form-input {
    width: 100%;
    padding: 12px 15px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background-color: var(--bg);
    color: var (--text);
    margin-bottom: 15px;
}

textarea.comment-form-input {
    min-height: 150px;
    resize: vertical;
}

.comment-form-submit {
    background-color: var(--main-color);
    color: white;
    border: none;
    padding: 12px 25px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.comment-form-submit:hover {
    background-color: var(--main-dark);
}

.comment {
    border-bottom: 1px solid var(--border);
    padding: 20px 0;
}

.comment:last-child {
    border-bottom: none;
}

.comment-author {
    display: flex;
    align-items: center;
    margin-bottom: 10px;
}

.comment-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--bg-alt);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 15px;
    font-size: 16px;
    font-weight: 600;
    color: var(--text);
}

.comment-author-name {
    font-weight: 600;
    color: var(--text);
    font-size: 16px;
}

.comment-date {
    font-size: 12px;
    color: var (--text-light);
    margin-left: 10px;
}

.comment-content {
    color: var(--text);
    font-size: 15px;
    line-height: 1.6;
    margin-left: 55px;
}

.comment-reply {
    margin-left: 55px;
    margin-top: 10px;
}

.comment-reply-link {
    color: var(--main-color);
    font-size: 14px;
    font-weight: 600;
}


/* ページナビゲーション */

.post-navigation {
    display: flex;
    justify-content: space-between;
    margin-top: 50px;
}

.post-nav-link {
    background-color: var(--bg);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border);
    padding: 15px;
    width: 48%;
    transition: all 0.3s ease;
}

.post-nav-link:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 15px rgba(0, 0, 0, 0.05);
    border-color: var(--main-light);
}

.post-nav-label {
    font-size: 12px;
    color: var(--text-light);
    margin-bottom: 5px;
    display: block;
}

.post-nav-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.post-nav-previous {
    text-align: left;
}

.post-nav-next {
    text-align: right;
}


/* フォローフローティングボタン */

.floating-share {
    position: fixed;
    left: 20px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    gap: 15px;
    z-index: 99;
}

.floating-share-button {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.floating-share-button:hover {
    transform: scale(1.1);
}

div.pre {
    padding: 20px;
    background-color: #fafafa;
    outline: 1px solid #f0f0f0;
    border-color: #f0f0f0;
    text-align: left;
    margin-bottom: 60px;
    margin-top: 15px;
}


/* レスポンシブ調整 */

@media (max-width: 1400px) {
    .floating-share {
        display: none;
    }
}

@media (max-width: 991px) {
    .single-post-layout {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 768px) {
    .container {
        padding: 0px 10px;
    }
    .post-content h2 {
        font-size: 18px;
        padding: 10px 15px 10px;
    }
    .post-content h3 {
        font-size: 18px;
    }
    .post-content p {
        font-size: 17px;
    }
    .related-posts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .post-header {
        padding: 20px;
    }
    .post-content-wrap {
        padding: 15px;
    }
    .post-title {
        font-size: 20px;
    }
    .author-bio {
        padding: 20px;
    }
    .author-bio-avatar {
        width: 80px;
        height: 80px;
        font-size: 30px;
    }
    .related-posts-grid {
        grid-template-columns: 1fr 1fr;
    }
    .author-bio {
        flex-direction: column;
    }
}

@media (max-width: 576px) {
    .related-posts-grid {
        grid-template-columns: 1fr;
    }
}


/* パンくずリストのスマホ対応 */

@media (max-width: 480px) {
    .breadcrumb-list {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }
    .breadcrumb-item:not(:last-child)::after {
        display: none;
    }
    .breadcrumb-item {
        font-size: 15px;
        word-break: break-all;
        line-height: 1.5;
    }
}


/* Retina・高解像度ディスプレイ対応 */

@media (-webkit-min-device-pixel-ratio: 2),
(min-resolution: 192dpi) {
    .related-post-img {
        image-rendering: crisp-edges;
    }
}