/* Template Apps Page Custom Styles */
.template-cat-wrap {
    padding: 45px 80px;
    position: relative;
}

/* Header styles */
.page-template-templates .common-page-header,
.tax-template-category .common-page-header {
    padding-bottom: 20px;
    max-width: 100%;
    padding-top: 70px;
    background: url("https://www.knack.com/wp-content/themes/knacktheme/img/pink-bg-gradient.svg") no-repeat center center;
}

.page-template-templates .page-banner-desc,
.tax-template-category .page-banner-desc {
    font-size: 18px;
    line-height: 27px;
    color: #1A181D;
}

/* Centered Search Bar */
.template-cat-wrap .search_temp {
    text-align: center;
}

.template-cat-wrap .search_temp .search-group {
    position: relative;
    max-width: 550px;
    margin: 0 auto;
}

.template-cat-wrap .search_temp .search-group .input_search {
    height: 48px;
    border-radius: 24px;
    padding: 12px 60px 12px 24px;
    border: 1px solid #E0DFE1;
    font-size: 16px;
}

.template-cat-wrap .search_temp .search-group .search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #982A86;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.template-cat-wrap .search_temp .search-group .search-btn:hover {
    background-color: #7A2269;
}

.template-cat-wrap .search_temp .search-group .search-btn img {
    filter: brightness(0) invert(1);
    width: 20px;
    height: 20px;
}

input#template-search-input {
    border-radius: 22px;
    border-width: 1px;
    border: 1px solid rgba(200, 200, 200, 1);
    background: rgba(255, 255, 255, 1);
}

div#filter-copy{
display: none;
}

.template-search-bar-wrap {
    margin-top: 60px;
}
/* Filter Label */
.filter-label {
    font-size: 12px;
    font-weight: 600;
    color: #7C7C86;
    letter-spacing: 0.5px;
    margin-bottom: 16px;
}

/* Left Sidebar Adjustments */
.template-left-sidebar .temp-btn-app {
    border-radius: 8px;
    transition: all 0.2s ease;
}

.template-left-sidebar .temp-btn-app:hover {
    background-color: #F5F4F5;
}

.template-left-sidebar .temp-btn-app.active {
    background-color: #F5F4F5;
    color: #982A86;
    font-weight: 500;
}

.template-post-listing .template-post-list {
    margin-bottom: 30px;
    padding: 0 19px;
}

/* Template Cards with Colored Borders */
.template-post-listing .post-list-box {
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(200, 200, 200, 1);
}

/* Purple Border */
.post-list-box.template-card-purple .image-container{
    background: rgba(212, 149, 189, 1);
}

/* Pink Border */
.post-list-box.template-card-pink .image-container{
    background: rgba(236, 194, 221, 1);
}

/* Coral/Orange Border */
.post-list-box.template-card-coral .image-container{
    background: rgba(250, 192, 198, 1);
}

/* Lavender Border */
.post-list-box.template-card-lavender .image-container {
    background: rgba(188, 160, 182, 1);
}

/* Rose Border */
.post-list-box.template-card-rose .image-container {
    background: rgba(204, 125, 156, 1);
}

/* Peach Border */
.post-list-box.template-card-peach .image-container {
    background: rgba(244, 124, 112, 0.69);
}

.image-container {
    padding: 30px;
    border-radius: 22px 22px 0 0;
    margin-bottom: unset;
    aspect-ratio: unset;
}

/* Card Image Styles */
.template-post-listing .post-list-box .post-image {
    display: block;
    padding: 10px;
    background: white;
    border-radius: 12px;
    margin-bottom: unset;
    height: auto;
    aspect-ratio: 43 / 24;
}

.template-post-listing .post-list-box .post-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
    position: unset;
    box-shadow: 0px 4px 20px 10px rgba(80, 66, 66, 0.06);
}

/* Card Content */
.template-post-listing .post-list-box .post-content {
    padding: 26px 20px;
}

.template-post-listing .post-list-box .blog-heading {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 8px;
}

/* Clamp heading to 2 lines with ellipsis */
.blog-heading-clamp,
.blog-heading-clamp a {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.3;
}

.template-post-listing .post-list-box .post-sub-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #7C7C86;
}

/* Clamp excerpt to 3 lines with ellipsis */
.post-sub-desc-clamp,
.post-sub-desc-clamp p {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    line-height: 1.5;
    margin-bottom: 0;
}

/* Hover Effect */
.template-post-listing .post-list-box:hover {
    transform: translateY(-4px);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

/* Filter Copy Styles */
#filter-copy {
    font-size: 16px;
    color: #1A181D;
}

#filter-copy cite {
    font-style: normal;
    color: #982A86;
}

#filter-copy #clear-filters {
    color: #982A86;
    text-decoration: underline;
    margin-left: 8px;
}

#filter-copy #clear-filters:hover {
    color: #7A2269;
}

/* Responsive adjustments */

/* Below 1200px - Floating Sidebar */
@media (max-width: 1199px) {
    .template-cat-wrap .row {
        position: relative;
        margin: 0;
    }
    
    /* Remove the sidebar from the layout flow completely */
    .template-cat-wrap .col-lg-3.template-left-sidebar {
        position: fixed !important;
        left: -320px;
        top: 0;
        height: 100vh;
        width: 300px;
        z-index: 1000;
        background: #fff;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 20px !important;
        margin: 0 !important;
        flex: 0 0 0 !important;
        max-width: 0 !important;
        min-width: 0 !important;
    }
    
    .template-cat-wrap .col-lg-3.template-left-sidebar.open {
        left: 0;
        max-width: 300px !important;
    }
    
    /* Make sure inner content is visible */
    .template-left-sidebar .inside-template-left-sidebar {
        display: block !important;
        width: 300px;
    }
    
    /* Toggle button for sidebar - initially absolute, becomes sticky */
    .sidebar-toggle-btn {
        position: absolute;
        left: 30px;
        top: 50px;
        z-index: 999;
        background: #982A86;
        color: #fff;
        border: none;
        border-radius: 50%;
        width: 50px;
        height: 50px;
        display: flex;
        align-items: center;
        justify-content: center;
        cursor: pointer;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        transition: all 0.3s ease;
    }
    
    .sidebar-toggle-btn:hover {
        background: #7A2269;
        transform: scale(1.05);
    }
    
    /* Make button sticky when scrolling past it */
    .sidebar-toggle-btn.sticky {
        position: fixed;
        top: 100px;
    }
    
    .sidebar-toggle-btn svg {
        width: 24px;
        height: 24px;
        fill: #fff;
    }
    
    /* Overlay when sidebar is open */
    .sidebar-overlay {
        position: fixed;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        display: none;
    }
    
    .sidebar-overlay.active {
        display: block;
    }
    
    /* Prevent body scroll when sidebar is open */
    body.sidebar-open {
        overflow: hidden;
    }
    
    /* Adjust main content to full width - the grid column that was taking space */
    .template-cat-wrap .row {
        margin: 0;
    }
    
    .template-cat-wrap .col-lg-9 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 0 !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Below 1024px - 2 columns instead of 3 */
@media (max-width: 1023px) {
    .template-post-listing .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 991px) {
    .template-cat-wrap .search_temp {
        margin-bottom: 30px !important;
    }
    
    .filter-label {
        margin-top: 30px;
    }
    
    .template-post-listing .post-list-box {
        margin-bottom: 20px;
    }
}

@media (max-width: 767px) {
    .template-cat-wrap .search_temp .search-group {
        max-width: 100%;
    }
    
    .template-post-listing .col-md-6 {
        margin-bottom: 20px;
    }
    .template-cat-wrap{
        padding: 45px 40px;
    }
    .sidebar-toggle-btn{
        left: 15px;
    }
}

/* Below 650px - Single column layout */
@media (max-width: 649px) {
    .template-post-listing .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .template-post-listing .post-list-box {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .template-cat-wrap {
        padding: 70px 0px;
    }
    .sidebar-toggle-btn{
        top: 10px;
    }    
}

@media (min-width: 1600px) {
.inside-template-left-sidebar.autofix_sb.fixed {
    max-width: 350px !important;
}
}

/* ===== Integrations Page Styles ===== */

/* Header styles for integrations */
.page-template-app-integration .common-page-header {
    padding-bottom: 20px;
    max-width: 100%;
    padding-top: 70px;
    background: url("https://www.knack.com/wp-content/themes/knacktheme/img/pink-bg-gradient.svg") no-repeat center center;
}

.page-template-app-integration .page-banner-desc, .page-template-app-integration .page-banner-desc > p {
    font-size: 18px;
    line-height: 27px;
    color: #1A181D;
    max-width: 1000px;
    margin: 0 auto;
}

/* Apply similar styles to integrations pages */
.integration-cat-wrap {
    padding: 45px 80px;
    position: relative;
    max-width: 100%;
}

.page-template-app-integration .integration-cat-wrap {
    padding: 45px 80px;
    position: relative;
    max-width: 100%;
}

/* Ensure sidebar is visible and properly styled */
.page-template-app-integration .integration-left-sidebar,
.integration-left-sidebar {
    display: block !important;
}

.page-template-app-integration .inside-integration-left-sidebar,
.inside-integration-left-sidebar {
    display: block !important;
    position: sticky;
    top: 100px;
    max-height: calc(100vh - 120px);
    overflow-y: auto;
}

/* Integration search bar */
.integration-cat-wrap .search_integration {
    text-align: center;
}

.integration-cat-wrap .search_integration .search-group {
    position: relative;
    max-width: 550px;
    margin: 0 auto;
}

.integration-cat-wrap .search_integration .search-group .input_search {
    height: 48px;
    border-radius: 24px;
    padding: 12px 60px 12px 24px;
    border: 1px solid #E0DFE1;
    font-size: 16px;
}

.integration-cat-wrap .search_integration .search-group .search-btn {
    position: absolute;
    right: 4px;
    top: 50%;
    transform: translateY(-50%);
    background-color: #982A86;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.integration-cat-wrap .search_integration .search-group .search-btn:hover {
    background-color: #7A2269;
}

.integration-cat-wrap .search_integration .search-group .search-btn img {
    filter: brightness(0) invert(1);
    width: 20px;
    height: 20px;
}

input#integration-search-input {
    border-radius: 22px;
    border-width: 1px;
    border: 1px solid rgba(200, 200, 200, 1);
    background: rgba(255, 255, 255, 1);
}

.page-template-app-integration .integration-left-sidebar .integration-btn-app,
.page-template-app-integration .integration-left-sidebar a.integration-btn-app,
.integration-left-sidebar .integration-btn-app,
.integration-left-sidebar a.integration-btn-app {
    padding: 10px 12px !important;
    border-radius: 8px !important;
    color: #1A181D !important;
    font-weight: 400 !important;
    text-decoration: none !important;
    display: block !important;
    transition: all 0.2s ease !important;
    cursor: pointer !important;
    margin-bottom: 6px !important;
    line-height: 1.4 !important;
    font-size: 16px !important;
}

/* First "Show All" button styling */
.page-template-app-integration .integration-left-sidebar .integration-btn-app#show-all,
.integration-left-sidebar .integration-btn-app#show-all {
    margin-bottom: 16px !important;
    font-weight: 500 !important;
}

.page-template-app-integration .integration-left-sidebar .integration-btn-app:hover,
.page-template-app-integration .integration-left-sidebar a.integration-btn-app:hover,
.integration-left-sidebar .integration-btn-app:hover,
.integration-left-sidebar a.integration-btn-app:hover {
    background-color: #F5F4F5 !important;
    color: #1A181D !important;
    text-decoration: none !important;
}

.page-template-app-integration .integration-left-sidebar .integration-btn-app.active,
.page-template-app-integration .integration-left-sidebar a.integration-btn-app.active,
.integration-left-sidebar .integration-btn-app.active,
.integration-left-sidebar a.integration-btn-app.active {
    background-color: #F5F4F5 !important;
    color: #982A86 !important;
    font-weight: 500 !important;
    text-decoration: none !important;
}

.page-template-app-integration .integration-left-sidebar .filter-label,
.integration-left-sidebar .filter-label,
.integration-left-sidebar .integration-main-cat-block {
    font-size: 12px !important;
    font-weight: 600 !important;
    color: #7C7C86 !important;
    letter-spacing: 0.5px !important;
    margin-bottom: 16px !important;
    margin-top: 20px !important;
}

.integration-left-sidebar .integration-filter-header {
    margin-top: 0 !important;
    margin-bottom: 20px !important;
}

.page-template-app-integration .integration-left-sidebar .filter-label:first-child,
.integration-left-sidebar .filter-label:first-child {
    margin-top: 0 !important;
}

.integration-post-listing .integration-post-list {
    margin-bottom: 30px;
    padding: 0 19px;
}

/* Integrations Cards */
.page-template-app-integration .integration-post-listing .post-list-box,
.integration-post-listing .post-list-box {
    border-radius: 22px !important;
    overflow: hidden !important;
    box-shadow: none !important;
    border: 1px solid rgba(200, 200, 200, 1) !important;
    background: #fff !important;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.integration-post-listing .image-container {
    padding:    12px;
    border-radius: 22px 22px 0 0;
    margin-bottom: unset;
    aspect-ratio: unset;
    background: transparent;
}

/* Card Image Styles */
.integration-post-listing .post-list-box .post-image {
    display: block;
    padding: 12px;
    background: transparent;
    margin: 0 auto;
    height: auto;
    aspect-ratio: 1 / 1;
    width: 90px;
}

.integration-post-listing .post-list-box .post-image img {
    width: 100%;
    height: 100%;
    object-fit: scale-down;
    position: unset;
    border-radius: 2px;
}

/* Card Content */
.integration-post-listing .post-list-box .post-content {
    padding: 20px 8px;
    text-align: left;
}

.integration-post-listing .post-list-box .blog-heading {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
    margin-bottom: 6px;
}

.integration-post-listing .post-list-box .post-sub-desc {
    font-size: 14px;
    line-height: 1.5;
    color: #7C7C86;
}

/* Hover Effect for Integration Cards */
.integration-post-listing .post-list-box:hover {
    border-color: #982A86;
}

/* Responsive for integrations below 1200px - Floating Sidebar */
@media (max-width: 1199px) {
    .integration-cat-wrap .row {
        position: relative;
        margin: 0;
    }
    
    /* Remove the sidebar from the layout flow completely */
    .integration-cat-wrap .col-lg-3.integration-left-sidebar {
        position: fixed !important;
        left: -320px;
        top: 0;
        height: 100vh;
        width: 300px;
        z-index: 1000;
        background: #fff;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        transition: left 0.3s ease;
        overflow-y: auto;
        padding: 20px !important;
        margin: 0 !important;
        flex: 0 0 0 !important;
        max-width: 0 !important;
        min-width: 0 !important;
    }
    
    .integration-cat-wrap .col-lg-3.integration-left-sidebar.open {
        left: 0;
        max-width: 300px !important;
    }
    
    /* Make sure inner content is visible */
    .integration-left-sidebar .inside-integration-left-sidebar {
        display: block !important;
        width: 300px;
    }
    
    /* Adjust main content to full width */
    .integration-cat-wrap .row {
        margin: 0;
    }
    
    .integration-cat-wrap .col-lg-9 {
        width: 100%;
        flex: 0 0 100%;
        max-width: 100%;
        margin-top: 0 !important;
        padding-left: 15px;
        padding-right: 15px;
    }
}

/* Below 1024px - 2 columns for integrations */
@media (max-width: 1023px) {
    .integration-post-listing .col-md-4 {
        flex: 0 0 50%;
        max-width: 50%;
    }
}

@media (max-width: 991px) {
    .integration-cat-wrap .search_integration {
        margin-bottom: 30px !important;
    }
    
    .integration-post-listing .post-list-box {
        margin-bottom: 20px;
    }
}

@media (max-width: 767px) {
    .integration-cat-wrap .search_integration .search-group {
        max-width: 100%;
    }
    
    .integration-post-listing .col-md-6 {
        margin-bottom: 20px;
    }
    .integration-cat-wrap{
        padding: 45px 40px;
    }
}

/* Below 650px - Single column for integrations */
@media (max-width: 649px) {
    .integration-post-listing .col-md-4 {
        flex: 0 0 100%;
        max-width: 100%;
    }
    
    .integration-post-listing .post-list-box {
        margin-bottom: 20px;
    }
}

@media (max-width: 480px) {
    .integration-cat-wrap {
        padding: 70px 0px;
    }   
}

@media (min-width: 1600px) {
    .inside-integration-left-sidebar.autofix_sb.fixed {
        max-width: 350px !important;
    }
}