/* Gallery Layout Styles */
.custom-card-gallery {
    position: relative;
    max-width: 100%;
    margin: 20px 0;
    font-family: inherit;
}

/* Gallery Filters */
.gallery-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 30px;
    padding: 20px 0;
}

.filter-btn {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.filter-btn:hover, .filter-btn.active {
    background: #2ea3f2;
    color: white;
    border-color: #2ea3f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 163, 242, 0.3);
}

/* Gallery Container */
.gallery-container {
    display: grid;
    grid-template-columns: repeat(var(--cards-per-row, 4), 1fr);
    gap: var(--gap-size, 20px);
    margin-bottom: 30px;
}

/* Gallery Card */
.gallery-card {
    width: 100%;
    height: 430px;
    background: linear-gradient(180deg, rgba(236, 57, 60, 1) 0%, rgba(85, 12, 51, 1) 100%);
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid #f0f0f0;
    position: relative;
    opacity: 1;
    animation: fadeInUp 0.6s ease-out;
}

.gallery-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.2);
}

/* Animation for new cards */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Card content styles (reuse from carousel) */
.gallery-card .card-title {
    margin: 0 0 10px 0;
    padding-bottom: 0;
    font-size: 18px;
    font-weight: bold;
    color: white;
    line-height: 1.4;
    text-align: left;
}

.gallery-card .card-subtitle {
    margin: 0 0 5px 0;
    color: white;
    font-weight: bold;
    font-size: 14px;
    text-align: left;
}

.gallery-card .card-company {
    margin: 0 0 10px 0;
    color: white;
    font-size: 0.9em;
    text-align: center;
}

.gallery-card .card-subtitle-2 {
    margin: 0px 0 5px;
    color: white;
    font-size: 14px;
    font-weight: bold;
    line-height: 1.5;
    text-align: left;
}

.gallery-card .card-custom-bio {
    margin: 10px 0 30px;
    color: white;
    font-size: 12px;
    line-height: 1.5;
    text-align: left;
}

.gallery-card .card-excerpt {
    margin: 15px 0;
    color: #555555;
    line-height: 1.6;
    font-size: 0.9em;
}

.gallery-card .card-meta {
    margin: 5px 0;
    color: #777777;
    font-size: 0.85em;
}

/* Gallery Pagination */
.gallery-pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 40px;
    gap: 15px;
}

.pagination-numbers {
    display: flex;
    gap: 8px;
    align-items: center;
}

.page-btn {
    background: #f8f9fa;
    color: #495057;
    border: 2px solid #dee2e6;
    padding: 12px 16px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s ease;
    min-width: 44px;
    text-align: center;
}

.page-btn:hover, .page-btn.active {
    background: #2ea3f2;
    color: white;
    border-color: #2ea3f2;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(46, 163, 242, 0.3);
}

.load-more-btn {
    background: linear-gradient(135deg, #2ea3f2 0%, #1e88d4 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 16px;
    font-weight: 600;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(46, 163, 242, 0.3);
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.load-more-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 25px rgba(46, 163, 242, 0.4);
}

.load-more-btn:disabled {
    background: #cccccc;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.load-more-btn.loading {
    position: relative;
    color: transparent;
}

.load-more-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    margin: -10px 0 0 -10px;
    border: 2px solid #ffffff;
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    to {
        transform: rotate(360deg);
    }
}

/* Responsive Design for Gallery */
@media (max-width: 1199px) {
    .gallery-container {
        grid-template-columns: repeat(3, 1fr);
    }
    
    .gallery-card {
        height: 350px;
    }
}

@media (max-width: 991px) {
    .gallery-container {
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
    }
    
    .gallery-card {
        height: 340px;
    }
    
    .gallery-card .card-content {
        padding: 15px;
    }
}

@media (max-width: 767px) {
    .gallery-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .gallery-card {
        height: 370px;
        max-width: 400px;
        margin: 0 auto;
    }
    
    .gallery-filters {
        justify-content: center;
        gap: 8px;
    }
    
    .filter-btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    .pagination-numbers {
        flex-wrap: wrap;
        gap: 5px;
    }
    
    .page-btn {
        padding: 10px 12px;
        font-size: 12px;
        min-width: 36px;
    }
    
    .load-more-btn {
        padding: 12px 24px;
        font-size: 14px;
    }
}

@media (max-width: 479px) {
    .gallery-card {
        height: 350px;
        max-width: 320px;
    }
    
    .gallery-card .card-title {
        font-size: 16px;
    }
    
    .gallery-card .card-subtitle {
        font-size: 14px;
    }
    
    .gallery-card .card-custom-bio {
        font-size: 11px;
    }
    
    .filter-btn {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* Loading states */
.gallery-container.loading {
    opacity: 0.7;
    pointer-events: none;
}

.gallery-card.hidden {
    display: none;
}

.gallery-card.filtered-out {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
}

/* Accessibility improvements */
.filter-btn:focus, .page-btn:focus, .load-more-btn:focus {
    outline: 2px solid #2ea3f2;
    outline-offset: 2px;
}

.gallery-card:focus {
    outline: 2px solid #2ea3f2;
    outline-offset: 2px;
}

/* Animation for filtered items */
.gallery-card {
    transition: all 0.3s ease;
}

.gallery-card.filter-animation {
    animation: filterIn 0.6s ease-out;
}

@keyframes filterIn {
    from {
        opacity: 0;
        transform: scale(0.8) translateY(20px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

/* Smooth scrolling for reduced motion users */
@media (prefers-reduced-motion: reduce) {
    .gallery-card {
        transition: none;
        animation: none;
    }
    
    .filter-btn, .page-btn, .load-more-btn {
        transition: none;
    }
    
    .gallery-card.filter-animation {
        animation: none;
    }
}

/* Custom scrollbar for overflow scenarios */
.gallery-container::-webkit-scrollbar {
    width: 8px;
}

.gallery-container::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.gallery-container::-webkit-scrollbar-thumb {
    background: #2ea3f2;
    border-radius: 4px;
}

.gallery-container::-webkit-scrollbar-thumb:hover {
    background: #1e88d4;
}

/* Empty state styling */
.custom-gallery-empty {
    text-align: center;
    padding: 60px 20px;
    color: #666666;
    font-style: italic;
    font-size: 18px;
    background: #f8f9fa;
    border-radius: 12px;
    border: 2px dashed #dee2e6;
}

/* Special layout for different card counts */
.gallery-container[data-cards-per-row="2"] {
    grid-template-columns: repeat(2, 1fr);
}

.gallery-container[data-cards-per-row="3"] {
    grid-template-columns: repeat(3, 1fr);
}

.gallery-container[data-cards-per-row="5"] {
    grid-template-columns: repeat(5, 1fr);
}

.gallery-container[data-cards-per-row="6"] {
    grid-template-columns: repeat(6, 1fr);
}

@media (max-width: 1199px) {
    .gallery-container[data-cards-per-row="5"],
    .gallery-container[data-cards-per-row="6"] {
        grid-template-columns: repeat(3, 1fr);
    }
}

@media (max-width: 991px) {
    .gallery-container[data-cards-per-row="3"],
    .gallery-container[data-cards-per-row="4"],
    .gallery-container[data-cards-per-row="5"],
    .gallery-container[data-cards-per-row="6"] {
        grid-template-columns: repeat(2, 1fr);
    }
}d-image {
    width: 100%;
    height: 200px;
    overflow: hidden;
    position: relative;
}

.gallery-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.gallery-card .card-cover {
    overflow: hidden;
    transition: all 0.5s;
    height: 370px;
    display: flex;
    flex-direction: column;
}

.gallery-card .card-cover img {
    max-width: 100%;
    width: 100%;
    object-fit: cover;
    object-position: top;
    height: 87%;
}

.gallery-card:hover .card-cover {
    height: 0;
}

.gallery-card .card-content {
    padding: 20px 20px 0 0;
    background-position: top;
    background-repeat: no-repeat;
    background-size: cover;
    height: 100%;
    display: flex;
    align-items: flex-start;
    flex-direction: column;
    justify-content: space-between;
}

.gallery-card .card-info {
    box-shadow: black 0px 0px 25px 20px;
    backdrop-filter: blur(8px) brightness(0);
    padding: 0px 0px 20px 20px;
    width: 95%;
}

.gallery-card .card-topic {
    font-family: 'Montserrat';
    font-weight: bold;
    font-size: 12px;
    color: white;
    background-color: #EC393C;
    padding: 0 5px;
    border-radius: 20px;
    margin-left: 15px;
}

.gallery-card .card-ribbon {
    background-color: #550C33;
    padding: 11px;
    padding-bottom: 11px !important;
}