/* ============================================================
   Expanding Cards Block v1.2 — Frontend Styles
   Author: Monark Digital — https://www.monarkdigital.com
   ============================================================ */

/* ── CSS Custom Properties ── */
.ecb-container {
    --ecb-accent:      #1a2744;
    --ecb-card-bg:     #ffffff;
    --ecb-title-color: #1a2744;
    --ecb-title-size:  22px;
    --ecb-desc-color:  #555555;
    --ecb-desc-size:   14px;
    --ecb-radius:      20px;
    --ecb-height:      560px;
    --ecb-transition:  0.5s cubic-bezier(0.4, 0, 0.2, 1);
    --ecb-shadow:      0 4px 24px rgba(0,0,0,0.07);
}

/* ── Cards Row ── */
.ecb-cards-container {
    display: flex;
    flex-direction: row;
    gap: 20px;
    height: var(--ecb-height);
    align-items: stretch;
}

/* ── Single Card ── */
.ecb-card {
    position: relative;
    border-radius: var(--ecb-radius);
    background: var(--ecb-card-bg);
    overflow: hidden;
    cursor: pointer;

    /* collapsed width */
    flex: 0 0 72px;

    transition:
        flex        var(--ecb-transition),
        box-shadow  var(--ecb-transition);
}

.ecb-card--active {
    flex: 1 1 0;
    cursor: default;
}

.ecb-card:not(.ecb-card--active):hover {
    flex: 0 0 90px;
}

/* ── Image (left half, desktop) ── */
.ecb-card__image {
    position: absolute;
    top: 0;
    left: 0;
    width: 42%;
    height: 100%;
    overflow: hidden;
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--ecb-transition);
}

.ecb-card--active .ecb-card__image {
    opacity: 1;
    pointer-events: auto;
}

.ecb-card__image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
	border-radius: var(--ecb-radius);
}

/* ── Content (right half, desktop) ── */
.ecb-card__content {
    position: absolute;
    top: 0;
    right: 0;
    width: 58%;
    height: 100%;
    padding: 32px 32px 32px 28px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateX(12px);
    pointer-events: none;
    transition:
        opacity   0.35s ease 0.15s,
        transform 0.35s ease 0.15s;
}

/* Full width when no image */
.ecb-card__content--no-image {
    width: 100%;
    left: 0;
    right: 0;
}

.ecb-card--active .ecb-card__content {
    opacity: 1;
    transform: translateX(0);
    pointer-events: auto;
}

/* ── Number Badge ── */
.ecb-card__number {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(0,0,0,0.06);
    color: var(--ecb-accent);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.03em;
    align-self: flex-end;
    flex-shrink: 0;
    margin-bottom: auto;
}

/* ── Body ── */
.ecb-card__body {
    margin-top: auto;
    padding-bottom: 12px;
}

.ecb-card__title {
    font-size: var(--ecb-title-size);
    font-weight: 700;
    color: var(--ecb-title-color);
    margin: 0 0 14px 0;
    line-height: 1.25;
}

.ecb-card__description {
    font-size: var(--ecb-desc-size);
    line-height: 1.7;
    color: var(--ecb-desc-color);
    margin: 0;
    display: -webkit-box;
    -webkit-line-clamp: 5;
    //-webkit-box-orient: vertical;
    overflow: hidden;
}

/* ── Collapsed Vertical Label ── */
.ecb-card__collapsed-label {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px 12px;
    box-sizing: border-box;

    font-size: 16px;
    font-weight: 600;
    color: var(--ecb-accent);
    letter-spacing: 0.04em;
    text-align: center;

    writing-mode: vertical-rl;
    text-orientation: mixed;
    transform: rotate(180deg);

    opacity: 1;
    transition: opacity 0.2s ease;
    pointer-events: none;
}

.ecb-card--active .ecb-card__collapsed-label {
    opacity: 0;
}

/* ============================================================
   RESPONSIVE — Mobile
   ============================================================ */
@media (max-width: 768px) {

    /* Stack vertically, no fixed height on container */
    .ecb-cards-container {
        flex-direction: column;
        height: auto !important;   /* override --ecb-height on mobile */
    }

    /* Collapsed card: thin horizontal strip */
    .ecb-card {
        flex: 0 0 56px !important;
        height: 56px;
        width: 100%;
        overflow: hidden;
    }

    /* Active card: tall enough to show image + content */
    .ecb-card--active {
        flex: 0 0 440px !important;
        height: 440px;
    }

    /* ── Image on mobile: hidden on collapsed, shown on active ── */
    .ecb-card__image {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 45%;
        opacity: 0 !important;           /* HIDDEN by default */
        pointer-events: none;
        transition: opacity var(--ecb-transition);
    }

    .ecb-card--active .ecb-card__image {
        opacity: 1 !important;           /* VISIBLE on active card only */
        pointer-events: auto;
    }

    /* Content sits below image */
    .ecb-card__content {
        top: 45%;
        left: 0;
        right: 0;
        width: 100%;
        height: 55%;
        padding: 16px 20px;
    }
	
	.ecb-card__description {
    -webkit-box-orient: vertical;
}

    /* No image: content fills full card */
    .ecb-card__content--no-image {
        top: 0;
        height: 100%;
    }

    /* Collapsed label: horizontal on mobile */
    .ecb-card__collapsed-label {
        writing-mode: horizontal-tb;
        transform: none;
        justify-content: flex-start;
        padding-left: 20px;
        font-size: 14px;
    }
}
