/* archive-case.php */
.a-case {
    background-color: #F7F7FA;
}

.a-case__inner {
    width: calc(100% - 40px);
    max-width: 1080px;
    margin: 0 auto;
    padding: 0 0 64px;
}

.a-case__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.a-case__page-ttl {
    display: flex;
    flex-direction: column-reverse;
    align-items: flex-start;
    margin: 42px 0;
}

.a-case__page-ttl .a-case__page-ttl-main {
    font-family: Hiragino Sans;
    font-weight: 600;
    font-size: 42px;
    color: #383B42;
    line-height: 2;
    letter-spacing: 0.02em;
}

.a-case__page-ttl .a-case__page-ttl-sub {
    font-family: Figtree;
    font-weight: 600;
    font-size: 16px;
    color: #006EC5;
    line-height: 1;
    letter-spacing: 0.02em;
}

.a-case__header-btn {
    display: none;
    align-items: center;
    gap: 8px;
    font-size: 14px;
    font-weight: 400;
    color: #383B42;
    cursor: pointer;
    white-space: nowrap;
    margin: 15px 0 0;
    transition: opacity 0.2s;
}

.a-case__header-btn::before {
    content: '';
    display: inline-block;
    width: 24px;
    height: 24px;
    background-image: url("../img/icon_condition.svg");
    background-size: contain;
    background-repeat: no-repeat;
}

.a-case__header-btn:hover {
    opacity: 0.6;
}

.case-categories__wrap {
    background: #fff;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    padding: 24px 32px;
}

.case-categories__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin: 0 0 40px;
}

.case-categories__item {
    display: flex;
    align-items: flex-start;
    gap: 20px;
}

.case-categories__item:first-child {
    padding: 0 0 20px;
    border-bottom: 1px solid rgba(56, 59, 66, 0.12);
}

.case-categories__item dt {
    flex-shrink: 0;
    width: 96px;
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    padding-top: 6px;
    line-height: 1.4;
}

.case-categories__item dd {
    flex: 1;
}

/* チェックボックスリスト */
.case-categories__item dd ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

/* inputを非表示にしてlabelでスタイリング */
.case-categories__item dd ul li {
    position: relative;
}

.case-categories__item dd ul li input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.case-categories__item dd ul li label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px 5px 10px;
    border: 1.5px solid #d0d0d0;
    border-radius: 20px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
    user-select: none;
}

/* ラジオ円のカスタム表示 */
.case-categories__item dd ul li label::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1.5px solid #c0c0c0;
    border-radius: 50%;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
}

/* チェック済みスタイル */
.case-categories__item dd ul li input[type="checkbox"]:checked+label {
    border-color: #1a73c8;
    color: #1a73c8;
    background: #f0f6ff;
}

.case-categories__item dd ul li input[type="checkbox"]:checked+label::before {
    background: #1a73c8;
    border-color: #1a73c8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpolyline points='3,8 6.5,11.5 13,5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: center;
}

.case-categories__item dd ul li label:hover {
    border-color: #1a73c8;
    color: #1a73c8;
}

/* 検索ボタン */
.case-search-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #e8edf2;
    color: #555;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    transition: background 0.2s, color 0.2s;
    cursor: pointer;
}

.case-search-btn:hover {
    background: #1a73c8;
    color: #fff;
}

.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.45);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal-overlay.is-open {
    display: flex;
}

.modal-inner {
    background: #fff;
    width: 100%;
    max-width: 480px;
    border-radius: 16px;
    padding: 24px 20px 32px;
    max-height: 90vh;
    overflow-y: auto;
    margin: 100px 0 0;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        transform: translateY(40px);
        opacity: 0;
    }

    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 24px;
}

.modal-header h2 {
    font-size: 16px;
    font-weight: 700;
    color: #1a1a1a;
}

.modal-close {
    width: 32px;
    height: 32px;
    border: none;
    background: #f0f0f0;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    color: #555;
    line-height: 1;
    transition: background 0.15s;
}

.modal-close:hover {
    background: #ddd;
}

.modal-categories__list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 20px;
    margin-bottom: 24px;
}

.modal-categories__item dt {
    font-size: 14px;
    font-weight: 600;
    color: #1a1a1a;
    margin-bottom: 12px;
}

.modal-categories__item dd ul {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.modal-categories__item dd ul li {
    position: relative;
}

.modal-categories__item dd ul li input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.modal-categories__item dd ul li label {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px 5px 10px;
    border: 1.5px solid #d0d0d0;
    border-radius: 20px;
    font-size: 13px;
    color: #444;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    white-space: nowrap;
    user-select: none;
}

.modal-categories__item dd ul li label::before {
    content: '';
    display: inline-block;
    width: 16px;
    height: 16px;
    border: 1.5px solid #c0c0c0;
    border-radius: 50%;
    flex-shrink: 0;
    transition: border-color 0.15s, background 0.15s;
}

.modal-categories__item dd ul li input[type="checkbox"]:checked+label {
    border-color: #1a73c8;
    color: #1a73c8;
    background: #f0f6ff;
}

.modal-categories__item dd ul li input[type="checkbox"]:checked+label::before {
    background: #1a73c8;
    border-color: #1a73c8;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16'%3E%3Cpolyline points='3,8 6.5,11.5 13,5' stroke='white' stroke-width='2' fill='none' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
    background-size: 12px;
    background-repeat: no-repeat;
    background-position: center;
}

.modal-categories__item dd ul li label:hover {
    border-color: #1a73c8;
    color: #1a73c8;
}

.modal-search-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: #e8edf2;
    color: #555;
    text-align: center;
    text-decoration: none;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 500;
    border: none;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    margin-bottom: 12px;
}

.modal-search-btn:hover {
    background: #1a73c8;
    color: #fff;
}

.modal-close-bottom {
    display: block;
    width: 100%;
    padding: 12px;
    background: none;
    border: none;
    color: #888;
    font-size: 14px;
    cursor: pointer;
    text-align: center;
}

@media (max-width: 767px) {

    /* PCのフィルターパネルを非表示 */
    .case-categories__wrap {
        display: none;
    }

    /* SPヘッダーボタンを表示 */
    .a-case__header-btn {
        display: flex;
    }
}

.case-list__wrap {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 24px;
    margin: 42px 0 0;
}

.case-list__wrap .case_post-item {
    width: 100%;
    max-width: 343px;
    height: auto;
    display: flex;
    flex-direction: column;
    border: none;
    border-radius: 10px;

    @media (max-width: 741px) {
        max-width: 80%;
    }

    @media (max-width: 550px) {
        max-width: 100%;
    }
}

.case-list__wrap .case_links {
    flex: 1;
    display: flex;
    flex-direction: column;
    border-radius: 10px;
}

.case-list__wrap .case_thumb {
    width: 100%;
    aspect-ratio: 338 / 210;
    height: 213px;
}

.case-list__wrap .case_inner {
    width: calc(100% - 40px);
}

.case-list__wrap .case_ttl {
    color: var(--black, #383B42);
    font-style: normal;
    font-weight: 600;
    line-height: 150%;
}

.case-list__wrap .clinical_department_inner {
    flex-flow: column;
    margin: 10px 0 0;
}

.case-list__wrap .clinical_department_wrap {
    flex-flow: column;
    gap: 20px;
}

.case-list__wrap .case_open {
    position: relative;
    text-align: right;
    font-size: 16px;
    border-radius: 32px;
    padding: 0 24px 0 0;
    margin: 24px 20px 20px auto;
    display: block;
    transition: opacity 0.3s;
}

.case-list__wrap .case_open::before {
    content: "";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 8px solid var(--primary);
}

.case-list__wrap .case_open:hover {
    opacity: 0.8;
    text-decoration: none;
}

.case-list__wrap .post_content2 {
    display: none;
}

@media (max-width: 767px) {
    .case-list__wrap {
        gap: 16px;
    }

    .case-list__wrap .case_post-item {
        width: 100%;
    }

    .case-list__wrap .case_inner {
        width: 100%;
    }

    .case-list__wrap .case_links {
        padding: 10px;
    }
}