/* Mobile and Text Scaling Fixes for Treasuretrap */

/* Larger gallery cards for better readability */
.gallery-card-container {
    margin-bottom: 25px; /* Increase spacing between cards */
}

/* Make gallery cards larger */
.gallery-card-container .card {
    width: 180px; /* Increase from default 150px */
    height: 252px; /* Increase from default 210px (maintaining aspect ratio) */
    transform: scale(1) !important; /* Override any scaling down */
}

/* Adjust gallery layout for larger cards */
.gallery-content {
    grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)) !important; /* Wider columns */
    gap: 25px !important; /* More space between items */
}

/* Fix for negative card text scaling in gallery */
.negative-card .card-description {
    font-size: 0.85rem; /* Larger font size */
    line-height: 1.3;
    max-height: 5.2em; /* 4 lines of text */
    overflow: hidden;
    text-overflow: ellipsis;
    display: -webkit-box;
    -webkit-line-clamp: 4; /* Show more lines */
    -webkit-box-orient: vertical;
    margin: 8px 0;
    padding: 0 8px;
    word-wrap: break-word;
}

/* Ensure negative badge doesn't overflow */
.negative-badge {
    max-width: 85%;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 0.85rem; /* Slightly larger */
    color: #f0c33c !important; /* Gold color for negative badge */
}

/* Gallery-specific negative card fixes */
.gallery-card-container.negative-container .card-description {
    font-size: 0.8rem;
    line-height: 1.3;
    max-height: 3.9em; /* 3 lines of text */
    -webkit-line-clamp: 3;
}

/* Ensure card info section is large enough */
.gallery-card-info {
    padding: 12px !important;
    min-height: 80px; /* Ensure enough space for content */
}

/* Responsive adjustments for smaller screens */
@media (max-width: 768px) {
    .gallery-content {
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)) !important;
    }
    
    .gallery-card-container .card {
        width: 160px;
        height: 224px;
    }
    
    .negative-card .card-description {
        font-size: 0.8rem;
        max-height: 3.9em; /* 3 lines on medium screens */
        -webkit-line-clamp: 3;
    }
    
    .gallery-card-container.negative-container .card-description {
        font-size: 0.75rem;
    }
}

/* Ensure card title doesn't overflow in negative cards */
.negative-card .card-title {
    font-size: 1.3rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 90%;
    margin: 0 auto;
    color: #f0c33c !important; /* Gold color for negative cards */
}

/* Gallery-specific negative card title */
.gallery-card.negative-card .card-title {
    font-size: 1.2rem;
    color: #f0c33c !important; /* Gold color for negative cards in gallery */
}

/* Vertical layout for very small screens */
@media (max-width: 480px) {
    .gallery-content {
        grid-template-columns: 1fr !important; /* Single column */
    }
    
    .gallery-card-container {
        max-width: 280px;
        margin: 0 auto 20px;
    }
    
    .gallery-card-container .card {
        width: 180px; /* Keep cards readable size even on small screens */
        height: 252px;
        margin: 0 auto;
    }
    
    .negative-card .card-title {
        font-size: 1.1rem;
    }
    
    .gallery-card.negative-card .card-title {
        font-size: 1rem;
    }
    
    .gallery-card-info {
        max-width: 280px;
        margin: 0 auto;
    }
}

/* Make card icons larger */
.gallery-card .card-icon {
    font-size: 3rem !important;
    margin-bottom: 10px !important;
}

.negative-label {
    color: #f0c33c !important; /* Gold color for negative label */
}
