/**
 * Home Projects Section - Square Image Cards
 * Primary: #19868b | Secondary: #e1273d
 */

/* Section */
.home-projects-section {
    background: linear-gradient(180deg, #ffffff 0%, #f8f9fa 100%);
}

/* Square Image Card */
.project-card-square {
    position: relative;
    overflow: visible;
}

.project-card-square .card-img {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    transition: transform 0.5s ease;
    border-radius: 0.5rem;
}

.project-card-square:hover .card-img {
    transform: scale(1.02);
}

/* Overlay Gradient - Very light for maximum image visibility */
.project-card-square .card-img-overlay {
    background: linear-gradient(to top, rgba(0,0,0,0.5) 0%, rgba(0,0,0,0.05) 40%, transparent 100%);
    border-radius: 0.5rem;
    overflow: visible;
}

/* Light Overlay Gradient Class - Maximum image visibility */
.bg-overlay-gradient-light {
    position: relative;
}

.bg-overlay-gradient-light::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: linear-gradient(rgba(0, 0, 0, 0) 50%, rgba(0, 0, 0, 0.4) 100%) !important;
    z-index: 1;
    border-radius: inherit;
    pointer-events: none;
}

/* Pointer events none for overlay */
.pointer-events-none {
    pointer-events: none;
}

/* Clickable card link styles */
a.project-card-square {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* Card Hover Effect */
.project-card-square {
    transition: box-shadow 0.3s ease, transform 0.3s ease;
}

.project-card-square:hover {
    box-shadow: 0 15px 40px rgba(25, 134, 139, 0.3);
    transform: translateY(-5px);
}

/* Badge Styling */
.home-projects-section .badge-primary {
    background: linear-gradient(135deg, #19868b 0%, #0d6b6f 100%);
    max-width: 150px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 11px;
}

@media (max-width: 1200px) {
    .home-projects-section .badge-primary {
        max-width: 120px;
    }
}

@media (max-width: 768px) {
    .home-projects-section .badge-primary {
        max-width: 100px;
        font-size: 10px;
    }
}

/* Nav Pills - Category Tabs */
.home-projects-section .nav-pills .nav-link {
    transition: all 0.3s ease;
}

.home-projects-section .nav-pills .nav-link.active,
.home-projects-section .nav-pills .nav-link:hover {
    background: linear-gradient(135deg, #19868b 0%, #0d6b6f 100%) !important;
    color: #fff !important;
}

/* Spec Icons in Overlay */
.home-projects-section .list-inline-item img {
    opacity: 0.9;
}

/* Image/Video Count Badges - Show on hover only */
.home-projects-section .project-media-count {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}

.home-projects-section .project-card-square:hover .project-media-count {
    opacity: 1;
    visibility: visible;
}

.home-projects-section .project-media-count .list-inline-item {
    margin-right: 8px;
}

.home-projects-section .bg-dark-opacity-03 {
    background: rgba(0, 0, 0, 0.6) !important;
    backdrop-filter: blur(5px);
    border: 1px solid rgba(255,255,255,0.2);
}

.home-projects-section .w-40px {
    width: 36px !important;
    height: 36px !important;
    min-width: 36px;
}

.home-projects-section .h-40 {
    height: 36px !important;
}

.home-projects-section .w-40px i,
.home-projects-section .h-40 i {
    font-size: 14px;
}

/* Category Badge */
.home-projects-section .badge-primary {
    padding: 8px 14px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 0.5px;
}

/* Heading Divider */
.home-projects-section .heading-divider {
    display: block;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, #19868b 0%, #0d6b6f 100%);
    margin: 12px 0 15px;
    border-radius: 2px;
}

/* Responsive */
@media (max-width: 992px) {
    .home-projects-section {
        padding-left: 15px;
        padding-right: 15px;
    }
}

@media (max-width: 768px) {
    .home-projects-section {
        padding-left: 15px;
        padding-right: 15px;
    }
    
    .home-projects-section .nav-pills {
        justify-content: flex-start !important;
        flex-wrap: wrap;
    }
    
    .home-projects-section .nav-pills .nav-item {
        margin-bottom: 10px;
    }
    
    /* Keep overlay style on tablet - override position-relative-sm */
    .home-projects-section .project-card-square .card-img-overlay {
        position: absolute !important;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
    
    /* Override the position-relative-sm class specifically */
    .home-projects-section .project-card-square .card-img-overlay.position-relative-sm {
        position: absolute !important;
    }
    
    /* Ensure card maintains proper structure */
    .home-projects-section .project-card-square {
        position: relative;
        overflow: hidden;
    }
}

@media (max-width: 576px) {
    .home-projects-section {
        padding-left: 12px;
        padding-right: 12px;
        padding-top: 40px;
        padding-bottom: 40px;
    }
    
    .home-projects-section .w-40px {
        width: 30px !important;
        height: 30px !important;
        min-width: 30px;
    }
    
    .home-projects-section .h-40 {
        height: 30px !important;
    }
    
    .home-projects-section .w-40px i,
    .home-projects-section .h-40 i {
        font-size: 12px;
    }
    
    .home-projects-section .badge-primary {
        padding: 6px 10px;
        font-size: 10px;
    }
    
    /* Keep overlay style on mobile - override position-relative-sm */
    .home-projects-section .project-card-square .card-img-overlay {
        position: absolute !important;
        top: 0;
        right: 0;
        bottom: 0;
        left: 0;
    }
    
    /* Override the position-relative-sm class specifically */
    .home-projects-section .project-card-square .card-img-overlay.position-relative-sm {
        position: absolute !important;
    }
    
    /* Ensure card maintains proper structure */
    .home-projects-section .project-card-square {
        position: relative;
        overflow: hidden;
    }
    
    /* Card image fills the card */
    .home-projects-section .project-card-square .card-img {
        width: 100%;
        height: 100%;
        aspect-ratio: 1 / 1;
        object-fit: cover;
    }
    
    /* Text styling for mobile overlay */
    .home-projects-section .project-card-square .card-img-overlay .fs-17 {
        font-size: 15px !important;
    }
    
    .home-projects-section .project-card-square .card-img-overlay .fs-14 {
        font-size: 12px !important;
    }
    
    .home-projects-section .project-card-square .card-img-overlay .fs-16 {
        font-size: 14px !important;
    }
    
    .home-projects-section .project-card-square .card-img-overlay .fs-13 {
        font-size: 11px !important;
    }
    
    /* Specs list on mobile */
    .home-projects-section .project-card-square .card-img-overlay .list-inline {
        flex-wrap: wrap;
        gap: 4px;
    }
    
    .home-projects-section .project-card-square .card-img-overlay .list-inline-item {
        margin-right: 8px !important;
    }
    
    .home-projects-section .project-card-square .card-img-overlay .list-inline-item img {
        width: 14px !important;
        height: 14px !important;
    }
    
    /* Bottom content padding adjustment */
    .home-projects-section .project-card-square .card-img-overlay .mt-auto {
        padding-bottom: 10px;
    }
}

/* RTL Support */
[dir="rtl"] .home-projects-section .mr-auto {
    margin-right: 0 !important;
    margin-left: auto !important;
}

[dir="rtl"] .home-projects-section .mr-2 {
    margin-right: 0 !important;
    margin-left: 0.5rem !important;
}

[dir="rtl"] .home-projects-section .mr-4 {
    margin-right: 0 !important;
    margin-left: 1rem !important;
}

[dir="rtl"] .home-projects-section .mr-1 {
    margin-right: 0 !important;
    margin-left: 0.25rem !important;
}

/* RTL Support for mobile */
@media (max-width: 576px) {
    [dir="rtl"] .home-projects-section .project-card-square .card-img-overlay .list-inline-item {
        margin-right: 0 !important;
        margin-left: 8px !important;
    }
}

