/* ─── Case Studies Loop Widget v2 ──────────────────────────────────────── */

.csw-wrapper {
    position: relative;
    overflow: hidden;
}

.csw-inner {
    display: flex;
    flex-direction: row;
    min-height: 480px;
}

/* ─── LEFT: Carousel ─────────────────────────── */

.csw-carousel-col {
    position: relative;
    overflow: hidden;
    background: #1a1a1a;
}

.csw-carousel-track {
    display: flex;
    height: 100%;
    will-change: transform;
    transition: transform 0.38s cubic-bezier(0.4, 0, 0.2, 1);
}

.csw-slide {
    flex: 0 0 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

.csw-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.csw-slide::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.3) 0%, transparent 55%);
    pointer-events: none;
}

/* ─── Carousel Dots ──────────────────────────── */

.csw-dots {
    position: absolute;
    bottom: 16px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 3;
}

.csw-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.45);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, transform 0.2s;
}

.csw-dot.active {
    background: #ffffff;
    transform: scale(1.3);
}

/* ─── Carousel Button ────────────────────────── */

.csw-btn-wrap,
.csw-btn-wrap--bottom-left,
.csw-btn-wrap--bottom-right,
.csw-btn-wrap--bottom-center {
    position: absolute;
    z-index: 10;
    bottom: 20px;
}

.csw-btn-wrap,
.csw-btn-wrap--bottom-left {
    left: 20px;
    right: auto;
    transform: none;
}

.csw-btn-wrap--bottom-right {
    left: auto;
    right: 20px;
    transform: none;
}

.csw-btn-wrap--bottom-center {
    left: 50%;
    right: auto;
    transform: translateX(-50%);
    white-space: nowrap;
}

.csw-btn {
    display: inline-block;
    font-size: 0.8rem;
    font-weight: 500;
    color: #ffffff;
    background: rgba(0, 0, 0, 0.45);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    padding: 10px 20px;
    cursor: pointer;
    text-decoration: none;
    transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
    letter-spacing: 0.01em;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.csw-btn:hover {
    background: rgba(0, 0, 0, 0.65);
    border-color: rgba(255, 255, 255, 0.6);
    color: #ffffff;
    text-decoration: none;
}

/* ─── RIGHT: Content ──────────────────────────── */

.csw-right-col {
    display: flex;
    flex-direction: column;
    padding: 2.25rem 2rem;
}

.csw-meta {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding-bottom: 1.5rem;
}

.csw-post-title {
    font-size: 1.4rem;
    font-weight: 500;
    line-height: 1.3;
    margin: 0 0 0.85rem;
    transition: opacity 0.28s ease;
}

.csw-post-desc {
    font-size: 0.875rem;
    line-height: 1.7;
    color: #666;
    transition: opacity 0.28s ease;
    margin: 0;
}

.csw-post-title.csw-fade,
.csw-post-desc.csw-fade {
    opacity: 0;
}

/* ─── Tabs ────────────────────────────────────── */

.csw-tabs {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.csw-tab {
    display: flex;
    align-items: flex-start;
    gap: 0;
    width: 100%;
    background: #f5f5f3;
    border: 1px solid #e5e5e2;
    border-radius: 4px;
    padding: 12px 16px;
    cursor: pointer;
    text-align: left;
    position: relative;
    overflow: hidden;
    transition: background 0.18s ease, border-color 0.18s ease;
    min-height: 56px;
}

.csw-tab:hover {
    background: #edede9;
    border-color: #d5d5d0;
}

.csw-tab.active {
    background: #ffffff;
    border-color: #ccc;
}

.csw-tab.active::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 3px;
    background: #888780;
}

.csw-tab-num {
    font-size: 11px;
    font-weight: 600;
    color: #aaa;
    min-width: 20px;
    flex-shrink: 0;
    font-variant-numeric: tabular-nums;
    letter-spacing: 0.03em;
    transition: color 0.18s;
    margin-right: 10px;
    padding-top: 2px;
    align-self: flex-start;
}

.csw-tab.active .csw-tab-num {
    color: #666;
}

.csw-tab-label {
    flex: 1;
    font-size: 0.8rem;
    line-height: 1.35;
    color: #555;
    transition: color 0.18s;
    white-space: normal;
    word-break: break-word;
    min-width: 0;
    padding-top: 2px;
}

.csw-tab.active .csw-tab-label {
    color: #111;
    font-weight: 500;
}

.csw-arrow {
    flex-shrink: 0;
    width: 14px;
    height: 14px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
    color: transparent;
    margin-left: auto;
    transition: color 0.18s;
    align-self: flex-start;
    padding-top: 2px;
}

.csw-tab.active .csw-arrow {
    color: #666;
    stroke: #666;
}

/* ─── Responsive ──────────────────────────────── */

/* csw-inner uses flex so Elementor responsive selectors work cleanly */
.csw-inner {
    display: flex;
    flex-direction: row;
}

/* Right col fills remaining space */
.csw-right-col {
    flex: 1 1 0;
    min-width: 0;
}

/* Mobile defaults (Elementor responsive controls override these) */
@media (max-width: 767px) {
    .csw-inner {
        flex-direction: column;
    }
    .csw-carousel-col {
        width: 100%;
        flex: 0 0 100%;
        height: 260px;
    }
    .csw-right-col {
        padding: 1.5rem 1.25rem;
    }
}

/* ─── No posts fallback ───────────────────────── */
.csw-no-posts {
    padding: 2rem;
    color: #888;
    font-size: 0.875rem;
}
