/**
 * Comhit Portfolio Grid - Frontend Styles
 */

/* Container */
.comhit-portfolio-grid-container {
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px 0;
    transition: opacity 0.3s ease-in-out;
}

/* Filter Dropdown */
.comhit-portfolio-filter {
    margin-bottom: 25px;
    text-align: center;
}

.comhit-filter-dropdown {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    background-color: #fff;
    min-width: 200px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
}

.comhit-filter-dropdown:hover,
.comhit-filter-dropdown:focus {
    border-color: #aaa;
    box-shadow: 0 3px 8px rgba(0,0,0,0.15);
    outline: none;
}

/* Grid Layout */
.comhit-portfolio-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 30px;
    margin-bottom: 30px;
}

/* Grid Items */
.comhit-portfolio-item {
    border-radius: 5px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    min-height: 100px;
    position: relative;
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

.comhit-portfolio-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.15);
}

.comhit-portfolio-item .item-link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.comhit-portfolio-item .item-image {
    position: relative;
    overflow: hidden;
    border-radius: 5px 5px 0 0;
}

.comhit-portfolio-item .item-image img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 5px 5px 0 0;
    transition: all 0.5s ease;
}

.comhit-portfolio-item .comhit-portfolio-item-content {
    padding: 20px;
    position: relative;
    z-index: 5;
}

.comhit-portfolio-item .item-title {
    margin: 0 0 10px;
    font-size: 1.2rem;
    font-weight: 600;
    transition: color 0.3s ease;
}

.comhit-portfolio-item .item-category {
    font-size: 0.9rem;
    margin-bottom: 10px;
    transition: color 0.3s ease;
}

.comhit-portfolio-item .item-excerpt {
    font-size: 0.9rem;
    line-height: 1.5;
    margin-top: 10px;
    transition: color 0.3s ease;
}

/* Hover Animations */
/* Zoom */
.comhit-portfolio-item.hover-zoom .item-image img {
    transform-origin: center;
}

.comhit-portfolio-item.hover-zoom:hover .item-image img {
    transform: scale(1.1);
}



/* Scale */
.comhit-portfolio-item.hover-scale {
    transform-origin: center;
    transition: transform 0.3s ease;
}

.comhit-portfolio-item.hover-scale:hover {
    transform: scale(1.05);
}





/* Pagination */
.comhit-portfolio-pagination {
    text-align: center;
    margin-top: 30px;
    clear: both;
}

.comhit-portfolio-pagination .page-numbers {
    display: inline-block;
    padding: 8px 12px;
    margin: 0 5px;
    border: 1px solid #ddd;
    border-radius: 5px;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    min-width: 30px;
    text-align: center;
    background-color: #fff;
    box-shadow: 0 1px 3px rgba(0,0,0,0.05);
}

.comhit-portfolio-pagination .page-numbers.current {
    background-color: #f5f5f5;
    color: #333;
    font-weight: bold;
    border-color: #ccc;
}

.comhit-portfolio-pagination .page-numbers:hover {
    background-color: #f5f5f5;
    border-color: #999;
}

/* Loading state */
.comhit-portfolio-grid-container.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.comhit-portfolio-grid-container.loading:after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 4px solid #f3f3f3;
    border-top: 4px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 100;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Fade-in animation for new content */
@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Staggered animation for grid items */
.comhit-portfolio-item {
    animation: fadeIn 0.5s ease-out forwards;
    opacity: 0;
}

/* Create a staggered effect where items appear one after another */
.comhit-portfolio-item:nth-child(1) { animation-delay: 0.1s; }
.comhit-portfolio-item:nth-child(2) { animation-delay: 0.15s; }
.comhit-portfolio-item:nth-child(3) { animation-delay: 0.2s; }
.comhit-portfolio-item:nth-child(4) { animation-delay: 0.25s; }
.comhit-portfolio-item:nth-child(5) { animation-delay: 0.3s; }
.comhit-portfolio-item:nth-child(6) { animation-delay: 0.35s; }
.comhit-portfolio-item:nth-child(7) { animation-delay: 0.4s; }
.comhit-portfolio-item:nth-child(8) { animation-delay: 0.45s; }
.comhit-portfolio-item:nth-child(9) { animation-delay: 0.5s; }
.comhit-portfolio-item:nth-child(n+10) { animation-delay: 0.55s; }

/* No Posts */
.comhit-portfolio-grid .no-posts {
    grid-column: 1 / -1;
    text-align: center;
    padding: 30px;
    background-color: #f5f5f5;
    border-radius: 5px;
}

/* Simple Grid Style - Container with no styling */
.grid-style-simple .comhit-portfolio-item {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    transform: none !important;
    transition: none !important;
}

/* Remove hover effects from container in simple view */
.grid-style-simple .comhit-portfolio-item:hover {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Image styling with optional shadow - 4:3 aspect ratio */
.grid-style-simple .comhit-portfolio-item .item-image {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.grid-style-simple .comhit-portfolio-item .item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

/* Typography area - completely free of styling */
.grid-style-simple .comhit-portfolio-item .comhit-portfolio-item-content {
    padding: 15px 0 0 0 !important;
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
}

.grid-style-simple .comhit-portfolio-item .item-title {
    margin: 0 0 8px 0;
    background: none;
    box-shadow: none;
}

.grid-style-simple .comhit-portfolio-item .item-category {
    margin: 0 0 8px 0;
    background: none;
    box-shadow: none;
}

.grid-style-simple .comhit-portfolio-item .item-excerpt {
    margin: 0;
    background: none;
    box-shadow: none;
}

/* Simple style hover effects - only affect the image */
.grid-style-simple .comhit-portfolio-item:hover .item-image {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.grid-style-simple .comhit-portfolio-item.hover-zoom:hover .item-image img {
    transform: scale(1.05);
}

.grid-style-simple .comhit-portfolio-item.hover-scale:hover .item-image {
    transform: scale(1.02);
}

/* Overlay Grid Style - Typography on image */
.grid-style-overlay .comhit-portfolio-item {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 !important;
    overflow: visible !important;
    transform: none !important;
    transition: none !important;
}

/* Remove hover effects from container in overlay view */
.grid-style-overlay .comhit-portfolio-item:hover {
    background: none !important;
    border: none !important;
    box-shadow: none !important;
    transform: none !important;
}

/* Image styling with overlay shadow - 4:3 aspect ratio */
.grid-style-overlay .comhit-portfolio-item .item-image {
    position: relative;
    width: 100%;
    padding-bottom: 75%; /* 4:3 aspect ratio */
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.grid-style-overlay .comhit-portfolio-item .item-image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    transition: transform 0.3s ease;
}

/* Typography overlay on image */
.grid-style-overlay .comhit-portfolio-item .comhit-portfolio-item-content {
    position: absolute !important;
    bottom: 0 !important;
    left: 0 !important;
    right: 0 !important;
    padding: 35px 15px 0 15px!important;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.3), transparent) !important;
    border: none !important;
    box-shadow: none !important;
    border-radius: 0 0 8px 8px !important;
    z-index: 10;
}

.grid-style-overlay .comhit-portfolio-item .item-title {
    margin: 0 0 8px 0;
    color: #ffffff !important;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    background: none;
    box-shadow: none;
}

.grid-style-overlay .comhit-portfolio-item .item-category {
    margin: 0 0 8px 0;
    color: rgba(255, 255, 255, 0.9) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    background: none;
    box-shadow: none;
}

.grid-style-overlay .comhit-portfolio-item .item-excerpt {
    margin: 0;
    color: rgba(255, 255, 255, 0.8) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
    background: none;
    box-shadow: none;
}

/* Overlay style hover effects - only affect the image */
.grid-style-overlay .comhit-portfolio-item:hover .item-image {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

.grid-style-overlay .comhit-portfolio-item.hover-zoom:hover .item-image img {
    transform: scale(1.05);
}

.grid-style-overlay .comhit-portfolio-item.hover-scale:hover .item-image {
    transform: scale(1.02);
}

/* Responsive Styles */

/* Tablet: 2 columns */
@media screen and (max-width: 992px) {
    .comhit-portfolio-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* Mobile: 1 column */
@media screen and (max-width: 576px) {
    .comhit-portfolio-grid {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .comhit-portfolio-item .item-title {
        font-size: 1rem;
    }
    
    .comhit-portfolio-item .item-category,
    .comhit-portfolio-item .item-excerpt {
        font-size: 0.8rem;
    }
    
    .comhit-filter-dropdown {
        width: 100%;
        min-width: auto;
    }
}

/* Debug styles */
.comhit-portfolio-debug {
    background: #f5f5f5;
    padding: 10px;
    margin-bottom: 15px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-family: monospace;
    font-size: 12px;
    max-height: 300px;
    overflow: auto;
}

/* Force visibility of item content for debugging */
.debug-mode .comhit-portfolio-item .comhit-portfolio-item-content {
    opacity: 1 !important;
    visibility: visible !important;
    display: block !important;
}

@keyframes portfolio-grid-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
} 