/* Import variables just in case */
:root {
    --bg-pink: #FFC0CB;
    --btn-pink: #FF69B4;
    --border-pink: #FFB6C1;
    --text-brown: #5D4037;
    --text-grey: #8d8d8d;
    --soft-bg: #FFF5F7;
}

.gallery-main {
    padding: 20px 15px;
    min-height: 90vh; /* FIXED: Changed height to min-height */
    background-color: var(--soft-bg);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow-y: auto; /* Ensure scrolling inside main if needed */
}

.hidden { display: none !important; }

/* --- SWIPER STYLES --- */
.swiper {
    width: 100%;
    max-width: 320px; /* Reduced from 400px for a more compact look */
    padding-top: 10px;
    padding-bottom: 40px;
}

.swiper-slide {
    background-color: white;
    border-radius: 20px;
    border: 3px solid var(--bg-pink);
    box-shadow: 0 8px 15px rgba(255, 192, 203, 0.3);
    overflow: hidden;
    height: auto; 
    display: flex;
    flex-direction: column;
}

.pet-image-container {
    height: 200px; /* Reduced from 250px */
    overflow: hidden;
    border-bottom: 3px solid var(--bg-pink);
}

.pet-image-container img {
    width: 100%; height: 100%; object-fit: cover;
}

.pet-details {
    padding: 15px 20px; /* Reduced padding inside card */
    text-align: left;
    color: var(--text-brown);
}

.pet-name {
    font-size: 1.5rem; /* Slightly smaller font */
    font-weight: 700;
    color: var(--btn-pink);
    margin-bottom: 5px;
    display: flex; justify-content: space-between; align-items: center;
}

.pet-breed-age {
    font-size: 0.9rem; color: var(--text-grey); margin-bottom: 10px; font-weight: 600;
}

.btn-read-story {
    background-color: white;
    color: var(--btn-pink);
    border: 2px solid var(--btn-pink);
    padding: 8px;
    width: 100%;
    border-radius: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: 0.3s;
    font-size: 0.9rem;
}

.btn-read-story:hover {
    background-color: var(--btn-pink);
    color: white;
}

/* --- STORY MODAL STYLES --- */
.modal {
    position: fixed;
    z-index: 1000;
    left: 0; top: 0;
    width: 100%; height: 100%;
    background-color: rgba(0,0,0,0.6);
    backdrop-filter: blur(3px);
    display: flex;
    justify-content: center;
    align-items: center;
}

.modal-content {
    background-color: #fff;
    margin: 15px;
    padding: 25px;
    border-radius: 25px;
    border: 4px solid var(--bg-pink);
    width: 90%;
    max-width: 400px; /* Made modal smaller too */
    position: relative;
    box-shadow: 0 20px 50px rgba(0,0,0,0.3);
    animation: popup 0.3s ease-out;
}

@keyframes popup {
    from { transform: scale(0.7); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

.close-modal {
    position: absolute;
    top: 10px; right: 15px;
    color: var(--text-grey);
    font-size: 1.8rem;
    font-weight: bold;
    cursor: pointer;
}

.close-modal:hover { color: var(--btn-pink); }

.modal-header h2 { color: var(--btn-pink); font-size: 1.6rem; margin-bottom: 5px; }
.modal-body p { 
    font-size: 1rem; 
    line-height: 1.5; 
    color: var(--text-brown); 
    margin-top: 10px; 
    max-height: 200px; /* Prevents long stories from breaking layout */
    overflow-y: auto; /* Adds scroll only if story is huge */
}

/* Swiper navigation colors */
.swiper-button-next, .swiper-button-prev { 
    color: var(--btn-pink) !important; 
    background: rgba(255,255,255,0.9); 
    width: 40px; height: 40px; /* Smaller buttons */
    border-radius: 50%; 
}
.swiper-button-next:after, .swiper-button-prev:after { font-size: 1.2rem !important; }
.swiper-pagination-bullet-active { background-color: var(--btn-pink) !important; }