/* リセットとベーススタイル */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: "Hiragino Kaku Gothic ProN", "ヒラギノ角ゴ ProN", "游ゴシック", "Yu Gothic", "メイリオ", Meiryo, sans-serif;
    line-height: 1.8;
    color: #333;
    background-color: #f8f8f8;
}

/* レイアウト */
.ly_container {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

/* ヘッダー */
.ly_header {
    background-color: #fff;
    border-bottom: 3px solid #0066cc;
    box-shadow: 0 2px 4px rgba(0,0,0,0.08);
}

.bl_header_inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 1.2rem 2rem;
}

.bl_header_title {
    margin: 0;
}

.bl_header_logo {
    color: #0066cc;
    text-decoration: none;
    font-size: 1.3rem;
    font-weight: 600;
    transition: color 0.3s;
}

.bl_header_logo:hover {
    color: #0052a3;
}

/* メインコンテンツ */
.ly_main {
    flex: 1;
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem;
    width: 100%;
}

.bl_pageTitle {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid #0066cc;
}

.bl_pageTitle h1 {
    font-size: 1.8rem;
    color: #333;
    font-weight: 600;
}

/* フィルターセクション */
.bl_filterSection {
    background: #fff;
    padding: 1.5rem;
    margin-bottom: 2rem;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bl_filterGroup {
    margin-bottom: 1.2rem;
}

.bl_filterGroup:last-child {
    margin-bottom: 0;
}

/* イニシャルフィルターボタン */
.bl_filterButtons {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
}

.filter-initial {
    padding: 0.5rem 0.9rem;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #666;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    font-weight: 500;
    transition: all 0.3s;
    min-width: 42px;
    text-align: center;
}

.filter-initial:hover {
    background-color: #f0f0f0;
    border-color: #0066cc;
}

.filter-initial.is_active {
    background-color: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

/* 無効状態（該当者なし） */
.filter-initial.is_disabled,
.filter-initial:disabled {
    background-color: #f8f8f8;
    color: #ccc;
    border-color: #e8e8e8;
    cursor: not-allowed;
    opacity: 0.6;
}

.filter-initial.is_disabled:hover,
.filter-initial:disabled:hover {
    background-color: #f8f8f8;
    border-color: #e8e8e8;
}

/* ALL ボタンは少し広めに */
.filter-initial[data-initial=""] {
    padding: 0.5rem 1.2rem;
}

/* 機関フィルター */
.bl_kikanFilter {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.kikan-check {
    display: inline-flex;
    align-items: center;
    padding: 0.5rem 1rem;
    border: 1px solid #ddd;
    background-color: #fff;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.3s;
}

.kikan-check:hover {
    background-color: #f0f0f0;
}

.kikan-check input[type="checkbox"] {
    margin-right: 0.5rem;
    cursor: pointer;
}

.kikan-check label {
    cursor: pointer;
    font-size: 0.95rem;
    user-select: none;
}

/* 検索ボックス */
.bl_searchBox {
    display: flex;
    gap: 0.5rem;
    max-width: 600px;
}

.bl_searchInput {
    flex: 1;
    padding: 0.7rem 1rem;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 0.95rem;
    transition: border-color 0.3s;
}

.bl_searchInput:focus {
    outline: none;
    border-color: #0066cc;
}

.bl_searchButton {
    padding: 0.7rem 2rem;
    background-color: #0066cc;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    font-weight: 500;
    transition: background-color 0.3s;
}

.bl_searchButton:hover {
    background-color: #0052a3;
}

/* リセットボタン */
.bl_resetButton {
    padding: 0.6rem 1.5rem;
    background-color: #6c757d;
    color: #fff;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.95rem;
    transition: background-color 0.3s;
}

.bl_resetButton:hover {
    background-color: #5a6268;
}

/* 検索結果サマリー */
.bl_resultSummary {
    margin-bottom: 1.5rem;
    padding: 1rem;
    background-color: #f0f7ff;
    border-left: 4px solid #0066cc;
    border-radius: 4px;
}

.bl_resultSummary p {
    color: #333;
    font-weight: 500;
}

/* 研究者リスト */
.bl_articleList {
    background: #fff;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.bl_articleList_item {
    padding: 1.5rem;
    border-bottom: 1px solid #e8e8e8;
    transition: background-color 0.3s;
}

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

.bl_articleList_item:hover {
    background-color: #f9f9f9;
}

.bl_researcher_main {
    display: flex;
    gap: 2rem;
    margin-bottom: 1rem;
}

.bl_researcher_left {
    display: flex;
    gap: 1rem;
    flex: 0 0 400px;
    max-width: 400px;
    padding-right: 2rem;
    border-right: 1px solid #ddd;
}

.bl_researcher_avatar_wrapper {
    flex-shrink: 0;
}

.bl_researcher_nameBlock {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.bl_researcher_right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
    justify-content: flex-start;
    padding-left: 2rem;
}

.bl_researcher_avatar {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    object-fit: cover;
    background-color: #e8e8e8;
}

.bl_researcher_avatar_placeholder {
    width: 70px;
    height: 70px;
    border-radius: 50%;
    background-color: #e8e8e8;
    background-image: url('../images/anon.png');
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
}

.bl_researcher_info {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
}

.bl_researcher_name {
    font-size: 1.2rem;
    font-weight: 600;
    color: #0066cc;
    line-height: 1.4;
}

.bl_researcher_nameEn {
    font-size: 0.95rem;
    color: #666;
}

.bl_researcher_tags {
    display: flex;
    gap: 0.5rem;
    margin-top: 0.5rem;
    flex-wrap: wrap;
}

.bl_orgTag {
    color: #fff;
    text-align: center;
    min-width: 5em;
    display: inline-block;
    font-size: 0.75rem;
    line-height: 1;
    padding: 0.4rem 0.6rem;
    border-radius: 2px;
    font-weight: 500;
}

.bl_orgTag_honbu {
    background: #008257;
}

.bl_orgTag_rekihaku {
    background: #937208;
}

.bl_orgTag_kokubun {
    background: #ac2828;
}

.bl_orgTag_kokugo {
    background: #006cb7;
}

.bl_orgTag_nichibun {
    background: #018935;
}

.bl_orgTag_chikyu {
    background: #7b67a2;
}

.bl_orgTag_minpaku {
    background: #08329b;
}

.bl_researcher_org {
    font-size: 0.9rem;
    color: #888;
}

.bl_researcher_position {
    font-size: 0.9rem;
    color: #555;
    line-height: 1.6;
}

.bl_researcher_link {
    margin-top: 0.3rem;
}

.bl_researcher_link a {
    color: #0066cc;
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.3s;
    display: inline-flex;
    align-items: center;
    gap: 0.3rem;
}

.bl_researcher_link a:hover {
    color: #0052a3;
    text-decoration: underline;
}

/* スニペット表示 */
.bl_researcher_snippets {
    margin-top: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid #e8e8e8;
    width: 100%;
}

.bl_snippet {
    margin-bottom: 0.6rem;
    font-size: 0.88rem;
    line-height: 1.6;
}

.bl_snippet:last-child {
    margin-bottom: 0;
}

.bl_snippet_label {
    display: inline-block;
    font-weight: 600;
    color: #0066cc;
    margin-right: 0.5rem;
    min-width: 80px;
}

.bl_snippet_text {
    color: #555;
}

.bl_snippet_link {
    color: #555;
    text-decoration: none;
    transition: color 0.3s;
    display: inline;
}

.bl_snippet_link:hover {
    color: #0066cc;
}

.bl_snippet_link:hover .bl_snippet_text {
    text-decoration: underline;
}

.bl_snippet_text mark {
    background-color: #fff3b8;
    color: #333;
    padding: 0.1em 0.3em;
    border-radius: 2px;
    font-weight: 600;
}

/* ページネーション */
.bl_pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.4rem;
    margin-top: 2rem;
    padding: 1.5rem 0;
}

.bl_pagination_button {
    padding: 0.6rem 1rem;
    border: 1px solid #ddd;
    background-color: #fff;
    color: #333;
    border-radius: 4px;
    cursor: pointer;
    font-size: 0.9rem;
    transition: all 0.3s;
    min-width: 40px;
}

.bl_pagination_button:hover:not(:disabled) {
    background-color: #0066cc;
    color: #fff;
    border-color: #0066cc;
}

.bl_pagination_button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.bl_pagination_button.active {
    background-color: #0066cc;
    color: #fff;
    border-color: #0066cc;
    font-weight: 600;
}

.bl_pagination_info {
    padding: 0.6rem 0.5rem;
    color: #999;
    font-size: 0.9rem;
}

/* フッター */
.ly_footer {
    background-color: #2c3e50;
    color: #fff;
    padding: 2.5rem 0 1.5rem;
    margin-top: 4rem;
}

.bl_footer_inner {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

.bl_footer_content {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    flex-wrap: wrap;
    gap: 2rem;
}

.bl_footer_info {
    flex: 1;
}

.bl_footer_name {
    font-size: 1.1rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
}

.bl_footer_address {
    font-size: 0.9rem;
    color: #bbb;
    line-height: 1.6;
}

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

/* ローディングとエラー */
.bl_loading {
    text-align: center;
    padding: 3rem;
    color: #666;
    font-size: 1rem;
}

.bl_error {
    background-color: #f8d7da;
    color: #721c24;
    padding: 1rem 1.5rem;
    border-radius: 4px;
    border-left: 4px solid #dc3545;
    margin: 1rem 0;
}

/* レスポンシブ */
@media (max-width: 768px) {
    .ly_main {
        padding: 1.5rem 1rem;
    }

    .bl_header_inner {
        padding: 1rem 1rem;
    }

    .bl_pageTitle h1 {
        font-size: 1.5rem;
    }

    .bl_filterSection {
        padding: 1rem;
    }

    .bl_searchBox {
        flex-direction: column;
    }

    .bl_searchButton {
        width: 100%;
    }

    .bl_articleList_item {
        padding: 1rem;
    }

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

    .bl_researcher_left {
        gap: 0.8rem;
        flex: 1;
        max-width: none;
        border-right: none;
        padding-right: 0;
    }

    .bl_researcher_right {
        padding-left: 0;
    }

    .bl_researcher_avatar,
    .bl_researcher_avatar_placeholder {
        width: 60px;
        height: 60px;
    }

    .bl_researcher_name {
        font-size: 1.1rem;
    }

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

    .bl_pagination {
        flex-wrap: wrap;
    }
}

@media (max-width: 480px) {
    .bl_filterButtons {
        flex-direction: column;
    }

    .filter-initial {
        width: 100%;
    }

    .bl_kikanFilter {
        flex-direction: column;
    }

    .kikan-check {
        width: 100%;
    }
}

/* クライアントサイドフィルタ用 */
.bl_articleList_item.is_hidden {
    display: none;
}

/* 機関フィルターのグレーアウト */
.kikan-check.is_disabled {
    opacity: 0.4;
    pointer-events: none;
}

.kikan-check.is_disabled label {
    cursor: not-allowed;
}
