.our-library-wrapper-d154e10f {
    font-family: sans-serif;
}

.library-header-controls {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.library-filters {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
}

.library-filters.sub-filters {
    margin-top: -10px;
    margin-bottom: 30px;
    overflow-x: auto;
    white-space: nowrap;
}

.filter-group {
    display: flex;
    gap: 15px;
    flex-wrap: nowrap;
}

.category-filters {
     flex-wrap: wrap;
}

.filter-btn {
    background: none;
    border: none;
    padding: 5px 0;
    cursor: pointer;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    border-bottom: 2px solid transparent;
    transition: all 0.3s ease;
    white-space: nowrap;
}

.filter-btn.active {
    color: #000;
    border-bottom-color: #3498db; /* Default active border */
}

.filter-select {
    padding: 8px 12px;
    border: 1px solid #ccc;
    border-radius: 4px;
    background-color: #fff;
    color: #333;
    font-size: 14px;
    cursor: pointer;
    min-width: 150px;
}

/* Search Form Styles */
.library-search-form {
    display: flex;
    align-items: stretch;
    height: 40px;
}

.search-input {
    border: 1px solid #ccc;
    border-right: none;
    padding: 0 15px;
    height: 100%;
    outline: none;
    min-width: 250px;
}

.search-btn {
    background: transparent;
    border: 1px solid #3498db;
    color: #3498db;
    padding: 0 20px;
    height: 100%;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.search-btn:hover {
    background: #f8f9fa;
}

/* Grid Layout - Dynamic via Elementor settings */
.library-grid {
    display: grid;
    gap: 30px;
    margin-bottom: 40px;
    /* Default grid set in PHP via selectors, fallback below */
    grid-template-columns: repeat(3, 1fr);
}

.library-grid.library-masonry {
    display: block;
    column-count: 3;
    column-gap: 30px;
}

.library-grid.library-masonry .our-library-item {
    break-inside: avoid;
    margin-bottom: 30px;
}


@media (max-width: 1024px) {
    .library-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .library-grid.library-masonry {
        column-count: 2;
    }
}

@media (max-width: 767px) {
    .library-grid {
        grid-template-columns: repeat(1, 1fr);
    }
    .library-grid.library-masonry {
        column-count: 1;
    }
    .library-header-controls {
        flex-direction: column;
        align-items: flex-start;
    }
    .search-input {
        min-width: 100%;
    }
    .library-search-form {
        width: 100%;
    }
    .elementor-post--image-left,
    .elementor-post--image-right {
        flex-direction: column !important;
    }
}

.our-library-item {
    background: #fff;
    box-shadow: 0 4px 15px rgba(0,0,0,0.05);
    display: flex;
    flex-direction: column;
    overflow: hidden; /* For border radius */
    transition: all 0.3s ease; /* Ensure smooth transitions for hover effects */
}

/* Image Positions */
.elementor-post--image-left {
    flex-direction: row;
}

.elementor-post--image-right {
    flex-direction: row-reverse;
}


.item-thumbnail img {
    width: 100%;
    height: auto;
    display: block;
    /* Aspect ratio controlled by settings, default below */
    aspect-ratio: 1 / 0.66;
    object-fit: cover;
    filter: grayscale(100%);
    transition: filter 0.3s ease, border-radius 0.3s ease;
}

.item-thumbnail:hover img {
    filter: grayscale(0%);
}

.placeholder-img {
    width: 100%;
    aspect-ratio: 1 / 0.66;
    background: #eee;
}

.item-content {
    padding: 25px;
    display: flex;
    flex-direction: column;
    flex-grow: 1;
    transition: all 0.3s ease; /* Ensure smooth transitions for hover effects */
}

.item-meta {
    font-size: 12px;
    color: #777;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 10px;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.item-meta a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.item-meta a:hover {
    color: #3498db;
}

.meta-separator {
    margin: 0 5px;
}

.item-title {
    font-size: 18px;
    margin: 0 0 15px 0;
    color: #2c3e50;
    font-weight: 400;
    transition: all 0.3s ease;
}

.item-title a {
    color: inherit;
    text-decoration: none;
    transition: all 0.3s ease;
}

.item-excerpt {
    font-size: 14px;
    color: #555;
    margin-bottom: 20px;
    line-height: 1.5;
    transition: all 0.3s ease;
}

.read-more {
    margin-top: auto;
    font-size: 13px;
    font-weight: 600;
    color: #3498db;
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    transition: all 0.3s ease;
}

.load-more-wrapper {
    text-align: center;
    margin-top: 40px;
}

.load-more-btn {
    background: transparent;
    border: none;
    color: #3498db;
    padding: 15px 40px;
    font-size: 14px;
    font-weight: 600;
    letter-spacing: 1px;
    text-transform: uppercase;
    cursor: pointer;
    transition: all 0.3s ease;
}

.loading-spinner {
    grid-column: 1 / -1;
    text-align: center;
    padding: 20px;
    color: #777;
}