/* よく使うスタイル */
:root {
    --neumorphism-shadow: 5px 5px 10px #c6c9cc, -5px -5px 8px #fff;
    --main-content-color: #f7f7f7;
    --font-big-title-size: 2.5rem;
    --font-medium--size: 1.5rem;
    --font-small-size: 0.8rem;
    --border-color: #ddd;
    --bg-color: #fff;
    --hover-box-shadow:
        inset 2px 2px 4px var(--shadow-darkcolor),
        inset -2px -2px 4px var(--shadow-brightcolor);
    --active-box-shadow:
        inset 0 4px 6px var(--dark-color),
        inset 0 1px 8px var(--dark-color);
}

[data-hover-effect]:hover {
    background: none;
    box-shadow: var(--hover-box-shadow) !important;
    filter: brightness(0.9) contrast(1.05);
}

[data-active-effect]:active {
    box-shadow: var(--active-box-shadow) !important;
    transform: scale(0.95);
}


/* ニュース一覧・詳細ページ共通 */
.content-wrapper {
    max-width: 1350px;
    margin: 0 auto 8rem auto;
    padding: 0 8%;
}

.detail_page {
    display: grid;
    grid-template-columns: 7fr 3fr;
    gap: 3rem;
    max-width: 1350px;
    margin: 0 auto 8rem auto;
    padding: 0 8%;
}

/* ニュースの記事部分 */
.main-content {
    padding: 3rem 4.5rem 7rem 4.5rem;
    line-height: 2;
    border-radius: 10px;
    background: var(--main-content-color);
    border: 1px solid var(--border-color);
}

/* ニュース記事内のスタイル */

.main-content .post-meta {
    display: flex;
    flex-direction: column;
    gap: 2rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
}

.main-content .post-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.main-content .post-info .post-date {
    font-size: 0.8rem;
    color: var(--submenu-color);
    text-align: right;
}

.main-content .post-author {
    display: flex;
    align-items: center;
}

.main-content .post-author img {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    margin-right: 1rem;
}

.main-content .entry-content .image-wrapper {
    width: fit-content;
    height: fit-content;
}

.main-content .entry-content img {
    width: 100%;
    height: auto;
    border-radius: 20px;
    box-shadow: var(--neumorphism-shadow);
}

.main-content .sns-share-buttons {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 2rem;
}

/* ニュースタイトル */
.blog-title {
    font-size: 2.5rem;
    line-height: 1.5;
}

/* SNSアイコン */
.sns-icon {
    width: 30px;
    height: 30px;
}

/* ニュース一覧ページのカテゴリタイトル部分 */
.top-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* サイドバー */
.sidebar {
    display: flex;
    flex-direction: column;
    flex: 1;
    gap: 2rem;
}

/* サイドバータイトル */
.sidebar .recent-posts h2,
.sidebar .categories h2,
.sidebar .ranking h2,
.sidebar .tag-cloud h2 {
    font-size: 22px;
    font-weight: 500;
    /* margin: 25px 0 30px; */
    width: fit-content;
    line-height: 1.8;
    border-bottom: 2px solid var(--main-color);
}

/* サイドバー記事タイトル文言 */
.sidebar .recent-posts ul li a,
.sidebar .ranking ul li a {
    display: flex;
    flex-direction: column;
    line-height: 1.5;
    gap: 0.5rem;
    padding: 0.5rem;
    border-radius: 10px;
    background: var(--base-color);
    border: 1px solid #e1e1e1;
    transition: filter 0.3s ease, box-shadow 0.3s ease;
}

.sidebar .recent-posts ul li a .new-articles-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.8rem;
}

.sidebar .recent-posts ul li a .post-info {
    display: flex;
    justify-content: space-between;
}

.sidebar .post-thumbnail {
    flex: auto;
}

.sidebar .post-thumbnail img {
    width: 100%;
    height: 100%;
    border-radius: 10px;
    object-fit: cover;
}

.sidebar .post-date {
    font-size: 0.7rem;
    color: var(--submenu-color);
}

/* サイドバー 記事カテゴリー部分 */
.sidebar .recent-posts,
.sidebar .categories,
.sidebar .tag-cloud,
.sidebar .ranking {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    line-height: 1.5;
    padding: 1rem;
    border-radius: 10px;
    border: 1px solid #e1e1e1;
}

.sidebar .category-title-filter {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.sidebar .category-list,
.sidebar .recent-posts-list {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar .cat-item a {
    line-height: 1.5;
    padding: 0.5rem 1rem;
    border-radius: 10px;
    background: var(--base-color);
    border: 1px solid #e1e1e1;
    transition: filter 0.3s ease, box-shadow 0.3s ease;
}

.sidebar .cat-item a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--text-color);
    font-size: 0.8rem;
}

.sidebar .recent-posts ul li a:hover,
.sidebar .ranking ul li a:hover,
.sidebar .cat-item a:hover,
.sidebar .filter-toggle:hover {
    color: var(--main-color);
}

.category-filter {
    position: relative;
}

.filter-toggle {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 8px 12px;
    border: 1px solid var(--border-color);
    border-radius: 10px;
    text-align: left;
    cursor: pointer;
    background: var(--bg-color);
}

.toggle-icons {
    position: relative;
    width: 12px;
    height: 12px;
    display: inline-block;
    margin-left: 0.5rem;
}

.arrow-icon,
.x-icon {
    position: absolute;
    top: 0;
    left: 0;
    transition: opacity 0.3s ease, transform 0.3s ease;
}

.x-icon {
    opacity: 0;
    transform: rotate(-90deg);
}

.filter-toggle.active .arrow-icon {
    opacity: 0;
    transform: rotate(90deg);
}

.filter-toggle.active .x-icon {
    opacity: 1;
    transform: rotate(0);
}

.filter-popup {
    display: none;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    box-sizing: border-box;
    border-radius: 10px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    z-index: 100;
    padding: 10px;
    margin-top: 5px;
    margin-bottom: 15px;
    font-size: 0.9rem;
    position: absolute;
    width: 150%;
}

.category-checkboxes .checked {
    color: var(--text-white);
    background: #c0c0c0;
    box-shadow: inset 13px 13px 7px #727575,
        inset -13px -13px 7px #888a8d;
    border-radius: 5px;
}

.close-popup {
    background: none;
    border: none;
    font-size: 20px;
    cursor: pointer;
    padding: 0 5px;
}

.category-checkboxes {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.category-checkboxes label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
}



/* サイドバー タグクラウド */
.sidebar .tag-cloud {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.sidebar .tag-zone {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
}

.sidebar .tag-zone span.tag {
    border: 1px solid var(--text-color);
    white-space: nowrap;
    padding: 0.3rem;
    border-radius: 5px;
    transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease;
}

.sidebar .tag-zone span.tag:hover {
    background-color: var(--text-color);
    color: var(--text-white);
    border-color: var(--text-color);
}

.cat-item {
    white-space: nowrap;
}

/* ニュース一覧ページ部分 */
/* カテゴリーページのスタイル */
.category-tabs {
    padding: 2rem 0;
}

.category-tabs .top-title,
.category-posts .top-title {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
}

.category-tabs h2.new-post,
.category-posts h2.new-post {
    font-size: var(--font-medium--size);
    font-weight: 700;
    line-height: 1.8;
    border-bottom: 2px solid var(--main-color);
}

.total-posts {
    font-size: 0.9rem;
    color: #777;
}

/* タブメニュー */
.tab-menu {
    display: flex;
    flex-wrap: wrap;
    gap: 1rem;
    margin-bottom: 2rem;
    list-style: none;
    padding: 0;
}

.tab-menu .tab-item {
    text-decoration: none;
    background-color: var(--bg-color);
    border: 1px solid #e1e1e1;
    border-radius: 1.1em;
    color: #969696;
    line-height: 1.75;
    padding: 0.8rem 1.5rem;
    border-radius: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 0.9rem;
}

.tab-menu .tab-item:hover {
    box-shadow: var(--hover-box-shadow);
}

.tab-menu .tab-item.active {
    color: var(--main-color);
    box-shadow: var(--active-box-shadow);
    font-weight: 600;
}

/* タブコンテンツ */
.tab-content {
    padding: 1rem 0;
}

.tab-pane {
    display: none;
}

.tab-pane.active {
    display: block;
    animation: fadeIn 0.5s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

/* 投稿リスト共通 */
.post-list,
.category-posts {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    /* display: flex;
    flex-wrap: wrap; */
    gap: 2rem;
    list-style: none;
    padding: 0;
}

.post-item,
.article {
    padding: 1rem;
    border-radius: 15px;
    background: var(--base-color);
    box-shadow: var(--neumorphism-shadow);
    transition: transform 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1rem;
}

.post-item:hover,
.article:hover {
    transform: translateY(-5px);
}

/* 記事の中央部分レイアウト */
.centerpiece {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.post-thumbnail {
    border: 1px solid var(--border-color);
    flex: 0 0 180px;
    height: 120px;
    overflow: hidden;
    border-radius: 10px;
}

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

.post-thumbnail img:hover {
    transform: scale(1.05);
}

/* 投稿タイトルと抜粋 */
a.post-title {
    font-size: 1.2rem;
    color: var(--text-color);
    text-decoration: none;
    line-height: 1.4;
    margin-bottom: 0.5rem;
    display: block;
}

a.post-title:hover {
    color: var(--main-color);
}

.post-lead {
    font-size: 0.9rem;
    line-height: 1.6;
    color: #666;
    margin-top: 0.5rem;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 続きを読むボタン */
a.read-more {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e1e1e1;
    border-radius: 1.1em;
    background: var(--bg-color);
    transition: all 0.3s ease;
    font-size: 0.85rem;
    text-decoration: none;
    color: var(--text-color);
}

a.read-more:hover {
    color: var(--main-color);
    box-shadow: var(--hover-box-shadow);
}

a.read-more:active {
    box-shadow: var(--active-box-shadow);
    transform: scale(0.98);
}

a.read-more img {
    transition: transform 0.3s ease;
}

a.read-more:hover img {
    transform: translateX(3px);
}

/* カテゴリーと日付 */
.post-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    margin: 0;
}

.post-categories a.pneumophilic {
    font-size: 0.75rem;
    padding: 0.3rem 0.8rem;
    transition: all 0.3s ease;
    text-decoration: none;
    background-color: var(--bg-color);
    border: 1px solid #e1e1e1;
    border-radius: 1.1em;
    color: #969696;
    line-height: 1.75;
}

.post-categories a.pneumophilic:hover {
    color: var(--main-color);
    box-shadow: var(--hover-box-shadow);
}

.post-categories a.pneumophilic:active {
    box-shadow: var(--active-box-shadow);
}

.post-item .post-date {
    font-size: 0.75rem;
    color: #999;
    margin-left: auto;
    white-space: nowrap;
}

/* ページネーション */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 3rem;
    list-style: none;
    padding: 0;
}

.pagination .page-numbers {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 2.5rem;
    height: 2.5rem;
    padding: 0 0.5rem;
    border-radius: 8px;
    background: var(--base-color);
    box-shadow: var(--neumorphism-shadow);
    transition: all 0.3s ease;
    text-decoration: none;
    color: var(--text-color);
}

.pagination .page-numbers:hover {
    color: var(--main-color);
    box-shadow: var(--hover-box-shadow);
}

.pagination .page-numbers.current {
    color: var(--main-color);
    font-weight: bold;
    box-shadow: var(--active-box-shadow);
}

/* 検索オーバーレイのスタイル */
.search-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: rgba(0, 0, 0, 0.5);
    z-index: 1001;
    animation: fadeIn 0.2s ease;
}

.search-overlay.active {
    display: block;
}

/* 検索ボタンとポップアップのスタイル */
.search-toggle-button button {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.5rem 1rem;
    border: 1px solid #e1e1e1;
    border-radius: 8px;
    background: var(--bg-color);
    cursor: pointer;
    transition: all 0.3s ease;
    color: var(--text-color);
    font-size: 0.9rem;
}

.search-toggle-button button:hover {
    color: var(--main-color);
    box-shadow: var(--hover-box-shadow);
}

.search-toggle-button button:active {
    box-shadow: var(--active-box-shadow);
    transform: scale(0.98);
}

/* 検索ポップアップ */
.recent-posts-search {
    display: none;
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 500px;
    background: var(--bg-color);
    border: 1px solid var(--border-color);
    border-radius: 10px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
    z-index: 1002;
    padding: 1.5rem;
}

.recent-posts-search.active {
    display: block;
    animation: fadeIn 0.3s ease;
}

.search-popup-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding-bottom: 0.8rem;
    border-bottom: 1px solid var(--border-color);
}

.search-popup-header h3 {
    font-size: 1.2rem;
    margin: 0;
    color: var(--text-color);
}

.search-popup-header button {
    background: none;
    border: none;
    cursor: pointer;
    padding: 10px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s ease;
}

.search-popup-header button:hover {
    background-color: #f0f0f0;
}

.search-form {
    width: 100%;
}

.search-row {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.search-field {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.search-field label {
    font-size: 0.9rem;
    color: #666;
}

.search-field input {
    padding: 0.5rem;
    border: 1px solid #e1e1e1;
    border-radius: 5px;
    font-size: 0.9rem;
}

.date-range {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.date-range input {
    flex: 1;
}

.search-button {
    display: flex;
    justify-content: center;
    margin-top: 0.5rem;
}

.search-button button {
    padding: 0.5rem 2rem;
    background-color: var(--main-color);
    color: white;
    border: none;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-button button:hover {
    filter: brightness(1.1);
}

/* スマホ対応 */
@media (max-width: 768px) {
    .recent-posts-search {
        width: 80%;
        padding: 1rem;
    }

    .date-range input {
        width: auto;
    }

    .centerpiece {
        flex-direction: column;
        gap: 1rem;
    }

    .post-thumbnail {
        flex: 0 0 auto;
        width: 100%;
        height: 180px;
    }

    .tab-menu {
        overflow-x: auto;
        padding-bottom: 0.5rem;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none;
        /* Firefox */
    }

    .tab-menu::-webkit-scrollbar {
        display: none;
        /* Chrome, Safari, Edge */
    }

    .tab-menu .tab-item {
        white-space: nowrap;
        flex-shrink: 0;
    }

    .post-categories {
        margin-bottom: 0.5rem;
    }

    .centerpiece:last-child {
        flex-direction: column;
    }

    .post-date {
        margin-left: 0;
    }

    .main-content {
        padding: 2rem 1.5rem 4rem 1.5rem;
    }

    .blog-title {
        font-size: var(--font-medium--size);
    }

    /* サイドバー */
    .sidebar {
        /* flex-direction: row;
        flex-wrap: wrap; */
        flex-direction: column;
        gap: 2rem;
    }

    .sidebar .recent-posts,
    .sidebar .categories,
    .sidebar .ranking,
    .sidebar .tag-cloud {
        flex: 1 1 calc(50% - 2rem);
    }

    .sidebar .recent-posts ul li a {
        width: 100%;
    }

    .sidebar .recent-posts ul li,
    .sidebar .ranking ul li {
        display: flex;
        align-items: center;
        gap: 1rem;
    }

    /* サイドバー 記事カテゴリー部分 */
    .filter-popup {
        max-height: 60vh;
        overflow-y: auto;
        width: 45vw;
        left: -20vw;
    }
}

@media (max-width:1280px) {
    .detail_page {
        grid-template-columns: 1fr;
        padding: 0 5%;
    }

    .post-thumbnail {
        flex: 0 0 auto;
        width: 100%;
        height: 180px;
    }

    .sidebar {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    }
}