/* Combined Search and Filter Row */
.rk-c-search-filters-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    align-items: flex-start;
    justify-content: center;
    margin: 0 auto 30px;
    max-width: 1200px;
    padding: 0 20px;
}

/* Search Form Styles */
.rk-c-search {
    position: relative;
    max-width: 600px;
    margin: 0 auto 20px;
    display: flex;
    border: 1px solid #e0e0e0;
    border-radius: 30px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: all 0.3s ease;
}

.rk-c-search-filters-row .rk-c-search {
    margin: 0;
    flex: 1;
    min-width: 250px;
}

/* Filter Styles */
.rk-c-filters {
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    margin: 0 auto 30px;
    max-width: 1200px;
    justify-content: center;
    align-items: center;
}

.rk-c-search-filters-row .rk-c-filters {
    margin: 0;
    flex: 1;
    justify-content: flex-end;
}

.rk-c-filter-group {
    display: flex;
    flex-direction: column;
    gap: 5px;
    min-width: 150px;
}

.rk-c-filter-label {
    font-size: 14px;
    font-weight: 600;
    color: #233963;
    margin-bottom: 5px;
}

.rk-c-filter-select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #233963;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
}

.rk-c-keyword-filter-select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 6px;
    background: #fff;
    font-size: 14px;
    color: #233963;
    cursor: pointer;
    transition: all 0.2s ease;
    min-width: 150px;
    width: 100%;
}

.rk-c-keyword-filter-select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.rk-c-keyword-filter-select:hover {
    border-color: #1a73e8;
}

.rk-c-filter-select:focus {
    outline: none;
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.rk-c-filter-select:hover {
    border-color: #1a73e8;
}

.rk-c-search:focus-within {
    border-color: #1a73e8;
    box-shadow: 0 0 0 2px rgba(26, 115, 232, 0.2);
}

.rk-c-search-input {
    flex: 1;
    padding: 12px 20px;
    font-size: 15px;
    border: none;
    outline: none;
    background: #fff;
    color: #233963;
    height: 48px;
    width: 100%;
}

.rk-c-search-input::placeholder {
    color: #9e9e9e;
}


/* ============================================
   RK ARCHIVE CARDS WIDGET - STYLE1 GRID LAYOUT
   ============================================ */
/* WIDGET CONTAINER */
.rk-c-widget {
    width: 100%;
    position: relative;
    min-height: 1px;
}

/* GRID CONTAINER (Style1) */
.rk-c-grid {
    display: grid;
    gap: 30px;
    margin: 0;
    padding: 0;
    width: 100%;
    list-style: none;
    box-sizing: border-box;
    opacity: 1;
    transition: opacity 0.3s ease;
    grid-template-columns: repeat(var(--columns, 3), 1fr);
}

/* Grid columns are controlled via CSS variable --columns injected by Elementor */

/* Tablet breakpoint */
@media (max-width: 1024px) {
    .rk-c-widget.elementor-md-rk-c-columns-1 .rk-c-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    
    .rk-c-widget.elementor-md-rk-c-columns-2 .rk-c-grid,
    .rk-c-widget.elementor-md-rk-c-columns-3 .rk-c-grid,
    .rk-c-widget.elementor-md-rk-c-columns-4 .rk-c-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }
}

/* Responsive for combined search and filters */
@media (max-width: 1024px) {
    .rk-c-search-filters-row {
        gap: 15px;
    }

    .rk-c-search-filters-row .rk-c-search {
        min-width: 200px;
    }

    .rk-c-search-filters-row .rk-c-filters {
        min-width: 250px;
    }
}

/* Mobile breakpoint */
@media (max-width: 767px) {
    .rk-c-search-filters-row {
        flex-direction: column;
        align-items: center;
        gap: 15px;
    }

    .rk-c-search-filters-row .rk-c-search {
        min-width: auto;
        width: 100%;
    }

    .rk-c-search-filters-row .rk-c-filters {
        min-width: auto;
        width: 100%;
        justify-content: center;
    }
    .rk-c-widget.elementor-sm-rk-c-columns-1 .rk-c-grid,
    .rk-c-widget.elementor-sm-rk-c-columns-2 .rk-c-grid,
    .rk-c-widget.elementor-sm-rk-c-columns-3 .rk-c-grid,
    .rk-c-widget.elementor-sm-rk-c-columns-4 .rk-c-grid {
        grid-template-columns: 1fr !important;
    }
}

/* ============================================
   RK ARCHIVE CARDS WIDGET - STYLE2 TWO COLUMN LAYOUT
   ============================================ */
.rk-c-style2-row {
    display: flex;
    gap: 30px;
    margin-bottom: 30px;
    width: 100%;
    align-items: stretch;
}

.rk-c-style2-col {
    display: flex;
    flex-direction: column;
}

.rk-c-style2-col-left {
    flex: 1;
}

.rk-c-style2-col-right {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

/* Horizontal Card Layout for Style2 Second Column */
.rk-c-card-horizontal .rk-c-card-inner {
    display: flex;
    flex-direction: row;
    gap: 15px;
    height: 100%;
}

.rk-c-card-horizontal .rk-c-card__image {
    flex: 0 0 40%;
    max-width: 40%;
    padding-top: 0;
    height: 100%;
    min-height: 150px;
    position: relative;
}

.rk-c-card-horizontal .rk-c-card__image img {
    position: relative;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 4px;
    z-index: 2;
}

.rk-c-card-horizontal .rk-c-card__image-link {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
}

.rk-c-card__image::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: transparent;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
    z-index: 1;
}

.rk-c-card-horizontal .rk-c-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    padding: 15px;
    min-height: 0;
}

.rk-c-card-horizontal .rk-c-card__title {
    font-size: 16px;
    margin: 0 0 10px;
}

.rk-c-card-horizontal .rk-c-card__excerpt {
    font-size: 0.875rem;
    margin-bottom: 12px;
    -webkit-line-clamp: 3;
    line-clamp: 3;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.rk-c-card-horizontal .rk-c-card-tags {
    margin-bottom: 10px;
}

.rk-c-card-horizontal .rk-c-card-tag {
    font-size: 11px;
    padding: 3px 8px;
}

.rk-c-card-horizontal .rk-c-card__footer {
    margin-top: auto;
    padding-top: 10px;
    font-size: 0.75rem;
}

.rk-c-card-horizontal .rk-c-card__type {
    font-size: 10px;
    padding: 3px 8px;
    margin-bottom: 8px;
}

/* Ensure second column cards stack properly and match first column height */
.rk-c-style2-col-right .rk-c-card-horizontal {
    flex: 1;
    min-height: 0;
}

/* Make sure the first column card and second column cards have matching heights */
.rk-c-style2-col-left .rk-c-card {
    height: 100%;
}

/* ============================================
   LEFTOVER CARDS LAYOUT STYLES
   ============================================ */
.rk-c-leftover-wrapper {
    width: 100%;
    margin-top: 30px;
}

/* Single leftover card styles */
.rk-c-leftover-single.rk-c-leftover-full {
    width: 100%;
}

.rk-c-leftover-single.rk-c-leftover-half {
    width: 50%;
}

.rk-c-leftover-single.rk-c-leftover-center {
    width: 100%;
    display: flex;
    justify-content: center;
}

.rk-c-leftover-single.rk-c-leftover-center .rk-c-card {
    max-width: 600px;
    width: 100%;
}

/* Double leftover cards styles */
.rk-c-leftover-double {
    display: flex;
    gap: 30px;
    width: 100%;
}

.rk-c-leftover-double.rk-c-leftover-50-50 .rk-c-card {
    flex: 0 0 calc(50% - 15px);
    max-width: calc(50% - 15px);
}

.rk-c-leftover-double.rk-c-leftover-60-40 .rk-c-card:first-child {
    flex: 0 0 calc(60% - 18px);
    max-width: calc(60% - 18px);
}

.rk-c-leftover-double.rk-c-leftover-60-40 .rk-c-card:last-child {
    flex: 0 0 calc(40% - 12px);
    max-width: calc(40% - 12px);
}

.rk-c-leftover-double.rk-c-leftover-40-60 .rk-c-card:first-child {
    flex: 0 0 calc(40% - 12px);
    max-width: calc(40% - 12px);
}

.rk-c-leftover-double.rk-c-leftover-40-60 .rk-c-card:last-child {
    flex: 0 0 calc(60% - 18px);
    max-width: calc(60% - 18px);
}

.rk-c-leftover-double.rk-c-leftover-stacked {
    flex-direction: column;
}

.rk-c-leftover-double.rk-c-leftover-stacked .rk-c-card {
    flex: 1;
    max-width: 100%;
    width: 100%;
}

/* Responsive for Style2 - Tablet and Small Screens (768px to 1024px) */
@media (min-width: 768px) and (max-width: 1024px) {
    /* Default behavior: Maintain layout (don't stack) unless explicitly set to stack */
    .rk-c-widget[data-small-screen-behavior="stack"] .rk-c-style2-row {
        flex-direction: column;
    }

    .rk-c-widget[data-small-screen-behavior="stack"] .rk-c-style2-col-left,
    .rk-c-widget[data-small-screen-behavior="stack"] .rk-c-style2-col-right {
        flex: 1;
        width: 100% !important;
        max-width: 100% !important;
    }

    /* Horizontal cards stack vertically on small screens when stacking */
    .rk-c-widget[data-small-screen-behavior="stack"] .rk-c-card-horizontal .rk-c-card-inner {
        flex-direction: column;
    }

    .rk-c-widget[data-small-screen-behavior="stack"] .rk-c-card-horizontal .rk-c-card__image {
        flex: 0 0 100%;
        max-width: 100%;
        padding-top: 56.25%;
        position: relative;
        margin-bottom: 15px;
    }

    .rk-c-widget[data-small-screen-behavior="stack"] .rk-c-card-horizontal .rk-c-card__image-link {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
    }

    .rk-c-widget[data-small-screen-behavior="stack"] .rk-c-card-horizontal .rk-c-card__image img {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        z-index: 2;
    }

    .rk-c-widget[data-small-screen-behavior="stack"] .rk-c-card-horizontal .rk-c-card__content {
        padding: 20px;
    }

    /* When maintaining layout (default), keep two-column layout */
    .rk-c-widget[data-small-screen-behavior="maintain"] .rk-c-style2-row,
    .rk-c-widget:not([data-small-screen-behavior]) .rk-c-style2-row {
        flex-direction: row;
    }

    
    /* Leftover cards on tablet - use small screen settings when behavior is stack */
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-one-card="full_width"] .rk-c-leftover-single {
        width: 100%;
    }
    
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-one-card="half_width"] .rk-c-leftover-single {
        width: 50%;
    }
    
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-one-card="center"] .rk-c-leftover-single {
        width: 100%;
        display: flex;
        justify-content: center;
    }
    
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-one-card="center"] .rk-c-leftover-single .rk-c-card {
        max-width: 600px;
        width: 100%;
    }
    
    /* Tablet: 2 leftover cards when stacking */
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-two-cards="stacked"] .rk-c-leftover-double {
        flex-direction: column;
    }
    
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-two-cards="stacked"] .rk-c-leftover-double .rk-c-card {
        flex: 1 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
    
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-two-cards="side_by_side"] .rk-c-leftover-double .rk-c-card {
        flex: 0 0 calc(50% - 15px);
        max-width: calc(50% - 15px);
    }
    
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-two-cards="side_by_side_60_40"] .rk-c-leftover-double .rk-c-card:first-child {
        flex: 0 0 calc(60% - 18px);
        max-width: calc(60% - 18px);
    }
    
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-two-cards="side_by_side_60_40"] .rk-c-leftover-double .rk-c-card:last-child {
        flex: 0 0 calc(40% - 12px);
        max-width: calc(40% - 12px);
    }
    
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-two-cards="side_by_side_40_60"] .rk-c-leftover-double .rk-c-card:first-child {
        flex: 0 0 calc(40% - 12px);
        max-width: calc(40% - 12px);
    }
    
    .rk-c-widget[data-small-screen-behavior="stack"][data-small-leftover-two-cards="side_by_side_40_60"] .rk-c-leftover-double .rk-c-card:last-child {
        flex: 0 0 calc(60% - 18px);
        max-width: calc(60% - 18px);
    }
}

/* Mobile breakpoint (767px and below) */
@media (max-width: 767px) {
    /* Always stack on mobile - override any settings */
    .rk-c-style2-row {
        flex-direction: column !important;
    }
    
    .rk-c-style2-col-left,
    .rk-c-style2-col-right {
        flex: 1 !important;
        width: 100% !important;
        max-width: 100% !important;
    }
    
    /* On mobile, horizontal cards should stack vertically like regular cards */
    .rk-c-card-horizontal .rk-c-card-inner {
        flex-direction: column !important;
    }

    .rk-c-card-horizontal .rk-c-card__image {
        flex: 0 0 100% !important;
        max-width: 100% !important;
        padding-top: 56.25% !important;
        position: relative !important;
        margin-bottom: 15px !important;
    }

    .rk-c-card-horizontal .rk-c-card__image-link {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
    }

    .rk-c-card-horizontal .rk-c-card__image img {
        position: absolute !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100% !important;
        object-fit: cover !important;
        border-radius: 4px !important;
        z-index: 2 !important;
    }

    .rk-c-card-horizontal .rk-c-card__content {
        padding: 20px !important;
    }
    
    /* Leftover cards responsive - always full width on mobile */
    .rk-c-leftover-single {
        width: 100% !important;
    }
    
    .rk-c-leftover-single.rk-c-leftover-half {
        width: 100% !important;
    }
    
    .rk-c-leftover-single.rk-c-leftover-center {
        width: 100% !important;
    }
    
    .rk-c-leftover-single.rk-c-leftover-center .rk-c-card {
        max-width: 100% !important;
    }
    
    .rk-c-leftover-double {
        flex-direction: column !important;
    }
    
    .rk-c-leftover-double .rk-c-card {
        flex: 1 !important;
        max-width: 100% !important;
        width: 100% !important;
    }
}

/* Grid item */
.rk-c-card {
    position: relative;
    width: 100%;
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: transform 0.3s ease, box-shadow 0.3s ease, opacity 0.3s ease;
}

/* Card inner wrapper */
.rk-c-card-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

/* Ensure images are responsive */
.rk-c-card__image {
    position: relative;
    width: 100%;
    padding-top: 56.25%; /* 16:9 Aspect Ratio */
    overflow: hidden;
}

.rk-c-card__image img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
    z-index: 2;
}

.rk-c-card:hover .rk-c-card__image img {
    transform: scale(1.05);
}

.rk-c-card__image-link {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.rk-c-card__thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

/* Card content */
.rk-c-card__content {
    padding: 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.rk-c-card__type {
    display: inline-block;
    margin-bottom: 10px;
    padding: 4px 12px;
    background: #f0f4f8;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    color: #233963;
}

.rk-c-card__title {
    margin: 0 0 15px;
    font-size: 18px;
    line-height: 1.4;
    font-weight: 600;
}

.rk-c-card__title a {
    color: #233963;
    text-decoration: none;
    transition: color 0.2s ease;
}

.rk-c-card__title a:hover {
    color: #1a73e8;
}

.rk-c-card-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 15px;
}

.rk-c-card-tag {
    display: inline-block;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    color: #233963;
}

.rk-c-card__excerpt {
    color: #6c757d;
    margin-bottom: 16px;
    font-size: 0.9375rem;
    line-height: 1.6;
}

/* Card footer */
.rk-c-card__footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: auto;
    padding-top: 15px;
    border-top: 1px solid #eee;
    font-size: 0.875rem;
}

.rk-c-card__author {
    font-size: 13px;
    color: #6c757d;
}

.rk-c-card__author-link {
    color: #6c757d;
    text-decoration: none;
    transition: color 0.2s ease;
}

.rk-c-card__author-link:hover {
    color: #1a73e8;
}

.rk-c-card__date {
    font-size: 13px;
    color: #6c757d;
}

.rk-c-card__read-more {
    font-size: 14px;
    font-weight: 600;
    color: #233963;
    text-decoration: none;
    transition: color 0.2s ease;
}

.rk-c-card__read-more:hover {
    color: #1a73e8;
}

.rk-c-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(161, 159, 159, 0.15);
}

/* Load More Button */
.rk-c-load-more-container {
    text-align: center;
    margin: 40px auto 20px;
    clear: both;
    max-width: 1200px;
    padding: 0 20px;
}

.rk-c-load-more {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 12px 32px;
    background-color: #233963;
    color: #fff;
    border: none;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    height: 48px;
    min-width: 180px;
}

.rk-c-load-more:hover {
    background-color: #1a2f4f;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(26, 47, 79, 0.2);
}

.rk-c-load-more:disabled {
    background-color: #6c757d;
    cursor: not-allowed;
}

.rk-c-loading {
    display: none;
    align-items: center;
    justify-content: center;
    margin-top: 20px;
    color: #6c757d;
}

.rk-c-spinner {
    width: 20px;
    height: 20px;
    border: 3px solid rgba(35, 57, 99, 0.2);
    border-radius: 50%;
    border-top-color: #233963;
    animation: rk-c-spin 1s ease-in-out infinite;
    margin-right: 10px;
}

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

/* No Posts Found */
.rk-c-no-posts-found {
    text-align: center;
    padding: 40px 20px;
    color: #6c757d;
    grid-column: 1 / -1;
}

/* Container */
.rk-c-container {
    width: 100%;
}

