/* 保護猫・犬紹介セクション用CSS */
.cafe-rescue {
    background: #fff6f0;
    padding: 2.5rem 0 2rem 0;
    text-align: center;
}

.rescue-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 2.5rem 2rem;
    max-width: 900px;
    margin: 0 auto;
    margin-top: 1.5rem;
    /* perspective: 1000px; 3D効果は削除 */
}

.rescue-card {
    background: #fff;
    border-radius: 1rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    position: relative;
    overflow: hidden;
    height: 280px;
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* --- New Hover Effect (Simpler Scale) --- */
.rescue-card:hover {
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.12);
    /* シンプルに少し浮き上がって拡大するアニメーションに変更 */
    transform: translateY(-5px) scale(1.03);
}

/* キプフェル用ピンク */
.rescue-card.kip {
    background: #cf99af;
    border: 2px solid #f8b5d1;
}

/* まめひなた用茶色 */
.rescue-card.mame {
    background: #e7d3b3;
    border: 2px solid #bfa77a;
}

/* ガーランド装飾 */
.rescue-card.mame::before,
.rescue-card.kip::before {
    content: "";
    position: absolute;
    top: 10px;
    left: 0;
    width: 100%;
    height: 60px;
    z-index: 1;
    pointer-events: none;
    background-repeat: no-repeat;
    background-position: center top;
    background-size: 100% 100%;
    opacity: 1;
}

.rescue-card.mame::before {
    background-image: url("/images/sankaku_garland1.webp");
}

.rescue-card.kip::before {
    background-image: url("/images/sankaku_garland2.webp");
}

/* --- Card Media (Image) --- */
.rescue-card .card-media {
    width: 100%;
    height: 100%;
    overflow: hidden;
    position: relative;
}

.rescue-card .card-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
    -webkit-user-drag: none;
    user-select: none;
}

.rescue-card:hover .card-media img {
    transform: scale(1.1);
}


/* --- Card Body (Overlay) --- */
.rescue-card .card-body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    padding: 1.5rem 1rem;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    color: #fff;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.2) 60%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    /* transform: translateZ(40px); 3D効果は削除 */
}

.rescue-card:hover .card-body {
    opacity: 1;
}

.rescue-card .card-body h3 {
    margin: 0 0 0.5rem 0;
    font-size: 1.25rem;
    color: #fff;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.5);
}

.rescue-card .card-body p {
    margin: 0;
    font-size: 0.9rem;
    line-height: 1.4;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.6);
}

.rescue-card .card-body .desc {
    color: #f0f0f0;
}


@media (max-width: 900px) {
    .rescue-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 600px) {
    .rescue-grid {
        grid-template-columns: 1fr;
        justify-items: center;
    }

    .rescue-card {
        width: 100%;
        max-width: 360px;
    }

    .rescue-card.mame::before,
    .rescue-card.kip::before {
        width: min(100%, 320px);
        left: 50%;
        transform: translateX(-50%);
        background-size: contain;
    }
}

.rescue-filter-btn:focus-visible {
    outline: 3px solid #f8b5a8 !important;
    outline-offset: 2px;
}

/* --- Name Bar at Bottom of Image --- */
.rescue-card .type-badge {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    top: auto;
    transform: none;
    z-index: 2;
    padding: 0.75rem 1rem;
    border-radius: 0;
    font-weight: 700;
    font-size: 1rem;
    box-shadow: none;
    border: none;
    background: rgba(255, 255, 255, 0.9);
    pointer-events: none;
    text-align: center;
    transition: none;
}

/* 個別カラー調整 */
.rescue-card.kip .type-badge {
    color: #9a3b5a;
}

.rescue-card.mame .type-badge {
    color: #7a5a44;
}

/* プロフィール画像モーダル */
.profile-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.8);
    z-index: 1000;
    justify-content: center;
    align-items: center;
    padding: 2.5rem;
    box-sizing: border-box;
}

.profile-modal.show {
    display: flex;
}

.profile-modal-image {
    display: block;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.3);
    z-index: 1001;
}

.profile-modal-close {
    position: fixed;
    top: 20px;
    right: 30px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    border: none;
    font-size: 24px;
    cursor: pointer;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    justify-content: center;
    align-items: center;
    line-height: 1;
    z-index: 1002;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease, background 0.2s ease;
}

/* フィルタボックス */
.rescue-filter-box {
    text-align: center;
    margin-bottom: 1em;
}

.rescue-filter-btn {
    margin: 0 0.5em;
}