/* ========================================
   5trak Case Study Archive Widget
   ======================================== */

/* --- Toolbar --- */
.csa-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.csa-toolbar__field {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.csa-toolbar__field select,
.csa-toolbar__field input {
    font-family: inherit;
    font-size: 14px;
    padding: 10px 40px 10px 16px;
    border: 1px solid #D1D5DB;
    border-radius: 4px;
    background: #fff;
    color: #1A1A2E;
    min-width: 160px;
    outline: none;
    transition: border-color 0.2s;
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;
}

.csa-toolbar__field select:focus,
.csa-toolbar__field input:focus {
    border-color: #3773B9;
}

/* All icons right-aligned inside fields */
.csa-toolbar__icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    font-size: 12px;
    line-height: 1;
}

.csa-toolbar__icon img,
.csa-toolbar__icon i,
.csa-toolbar__icon svg {
    width: 14px;
    height: 14px;
    display: block;
    line-height: 1;
    object-fit: contain;
}

/* --- Carousel --- */
.csa-carousel {
    position: relative;
    overflow: hidden;
}

.csa-carousel--sides {
    /* space for side arrows handled via padding */
}

.csa-track {
    display: flex;
    gap: 24px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -ms-overflow-style: none;
    scrollbar-width: none;
    scroll-snap-type: x mandatory;
}

.csa-track::-webkit-scrollbar {
    display: none;
}

/* --- Card --- */
.csa-card {
    flex: 0 0 auto;
    scroll-snap-align: start;
    transition: opacity 0.3s;
}

.csa-card__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.csa-card__image {
    overflow: hidden;
    background: #F3F4F6;
    border-radius: 8px;
}

.csa-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.4s ease;
}

/* Zoom only when class is present (controlled by widget toggle) */
.csa-card--zoom:hover .csa-card__image img {
    transform: scale(1.04);
}

.csa-card__title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.35;
    margin: 16px 0 0;
}

/* --- Navigation --- */
.csa-nav {
    display: flex;
    align-items: center;
    gap: 12px;
}

.csa-nav--below {
    justify-content: flex-start;
}

.csa-nav__btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border: none;
    background: transparent;
    cursor: pointer;
    transition: color 0.2s, background-color 0.2s, border-color 0.2s;
    padding: 0;
    line-height: 1;
}

.csa-nav__btn:disabled {
    opacity: 0.3;
    cursor: default;
}

/* Side-positioned arrows */
.csa-nav__btn--side {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
}

.csa-nav__btn--side.csa-nav__btn--prev {
    left: 0;
}

.csa-nav__btn--side.csa-nav__btn--next {
    right: 0;
}

/* --- Arrow SVG Icon States (normal + hover) --- */
.csa-arrow-icon {
    pointer-events: none;
}

.csa-arrow-normal { display: inline-block; }
.csa-arrow-hover  { display: none; }

.csa-nav__btn:hover .csa-arrow-normal { display: none; }
.csa-nav__btn:hover .csa-arrow-hover  { display: inline-block; }

/* --- No results --- */
.csa-no-results {
    text-align: center;
    padding: 60px 20px;
    font-size: 16px;
    color: #9CA3AF;
}

/* --- Responsive --- */
@media (max-width: 640px) {
    .csa-toolbar {
        flex-direction: column;
        align-items: stretch;
    }

    .csa-toolbar__field {
        width: 100%;
    }

    .csa-toolbar__field select,
    .csa-toolbar__field input {
        width: 100%;
        min-width: 0;
    }
}
