/**
 * Core Solutions Widget Styles
 */

.core-solutions-wrapper {
    display: flex;
    flex-wrap: nowrap;
    align-items: stretch;
    gap: 12px;
    width: 100%;
    overflow: hidden;
}

/* ---------- CARD BASE ---------- */
.core-solution-item {
    position: relative;
    flex: 0 0 120px;
    height: 500px;
    background-color: #0E2A56;
    border-radius: 12px;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.5s cubic-bezier(0.4, 0, 0.2, 1),
                background-color 0.4s ease;
    outline: none;
}

.core-solution-item:focus-visible {
    box-shadow: 0 0 0 3px rgba(60, 183, 181, 0.6);
}

/* ---------- BACKGROUND IMAGE (only visible on active) ---------- */
.core-solution-bg {
    position: absolute;
    inset: 0;
    background-image: var(--core-solution-bg);
    background-size: cover;
    background-position: center;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 1;
}

.core-solution-overlay {
    position: absolute;
    inset: 0;
    background-color: transparent;
    transition: background-color 0.5s ease;
    z-index: 2;
}

.core-solution-item.is-active .core-solution-bg {
    opacity: 1;
}

.core-solution-item.is-active .core-solution-overlay {
    background-color: rgba(14, 42, 86, 0.55);
}

/* ---------- ARROW ICON (top-right when active) ---------- */
.core-solution-arrow {
    position: absolute;
    top: 18px;
    right: 18px;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background-color: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(6px);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #ffffff;
    opacity: 0;
    transform: scale(0.7);
    transition: opacity 0.4s ease 0.1s, transform 0.4s ease 0.1s;
    z-index: 5;
    pointer-events: none;
}

.core-solution-item.is-active .core-solution-arrow {
    opacity: 1;
    transform: scale(1);
}

/* ---------- CONTENT LAYER ---------- */
.core-solution-content {
    position: relative;
    z-index: 3;
    height: 100%;
    padding: 24px;
    display: flex;
    flex-direction: column;
    color: #ffffff;
}

/* ---------- COLLAPSED STATE ---------- */
.core-solution-collapsed {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: space-between;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.core-solution-number {
    font-size: 56px;
    font-weight: 700;
    line-height: 1;
    color: rgba(255, 255, 255, 0.15);
    letter-spacing: -0.02em;
}

.core-solution-title--vertical {
    writing-mode: vertical-rl;
    transform: rotate(180deg);
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    margin: auto 0;
    letter-spacing: 0.02em;
    white-space: nowrap;
}

/* Bottom icon visible in collapsed state */
.core-solution-icon--bottom {
    align-self: flex-start;
    margin-top: auto;
    opacity: 1;
    transition: opacity 0.3s ease;
}

/* ---------- EXPANDED STATE ---------- */
.core-solution-expanded {
    position: absolute;
    inset: 24px;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.4s ease, visibility 0s linear 0.4s;
    pointer-events: none;
}

.core-solution-item.is-active .core-solution-expanded {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity 0.4s ease 0.15s, transform 0.5s ease 0.15s, visibility 0s linear 0s;
    pointer-events: auto;
}

.core-solution-item.is-active .core-solution-collapsed,
.core-solution-item.is-active .core-solution-icon--bottom {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* ---------- ICON ---------- */
.core-solution-icon {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 18px;
    flex-shrink: 0;
}

.core-solution-icon i {
    color: #0E2A56;
    font-size: 20px;
    line-height: 1;
}

.core-solution-icon svg {
    width: 20px;
    height: 20px;
    fill: #0E2A56;
}

/* ---------- HORIZONTAL TITLE (expanded) ---------- */
.core-solution-title--horizontal {
    writing-mode: horizontal-tb;
    transform: none;
    font-size: 22px;
    font-weight: 600;
    color: #ffffff;
    margin: 0 0 12px;
    line-height: 1.2;
    white-space: normal;
}

/* ---------- DESCRIPTION ---------- */
.core-solution-description {
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, 0.85);
    margin: 0 0 18px;
}

/* ---------- LEARN MORE LINK ---------- */
.core-solution-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: #3CB7B5;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    border-bottom: 1px solid #3CB7B5;
    padding-bottom: 2px;
    align-self: flex-start;
    transition: color 0.25s ease, border-color 0.25s ease, transform 0.25s ease;
}

.core-solution-link:hover {
    color: #ffffff;
    border-color: #ffffff;
    transform: translateX(2px);
}

.core-solution-link-arrow {
    font-size: 16px;
    line-height: 1;
}

/* ---------- RESPONSIVE ---------- */
@media (max-width: 1024px) {
    .core-solution-item {
        flex: 0 0 100px;
        height: 440px;
    }
    .core-solution-number { font-size: 44px; }
    .core-solution-title--vertical { font-size: 18px; }
}

@media (max-width: 767px) {
    .core-solutions-wrapper {
        flex-direction: column;
        flex-wrap: wrap;
        overflow: visible;
    }

    /* Reset desktop fixed sizing on mobile */
    .core-solution-item,
    .core-solution-item.is-active {
        flex: 1 1 100% !important;
        width: 100%;
        height: auto !important;
        min-height: 0;
    }

    /* Collapsed cards become compact horizontal strips */
    .core-solution-content {
        padding: 18px 20px;
    }

    .core-solution-collapsed {
        flex-direction: row;
        align-items: center;
        justify-content: flex-start;
        gap: 16px;
        flex: 0 0 auto;
        width: 100%;
    }

    .core-solution-number {
        font-size: 36px;
        flex-shrink: 0;
        line-height: 1;
    }

    /* Critical fix: kill vertical writing mode + nowrap so title can wrap */
    .core-solution-title--vertical {
        writing-mode: horizontal-tb !important;
        transform: none !important;
        font-size: 18px;
        margin: 0;
        flex: 1 1 auto;
        min-width: 0;
        white-space: normal !important;
        word-break: break-word;
        overflow-wrap: anywhere;
        line-height: 1.25;
    }

    /* Hide the bottom-corner icon on mobile collapsed cards
       (keeps the strip compact; icon still shows when expanded). */
    .core-solution-icon--bottom {
        display: none;
    }

    /* Active card on mobile: number+title row stays at top,
       then expanded content flows below */
    .core-solution-item.is-active .core-solution-collapsed {
        opacity: 1;
        visibility: visible;
        pointer-events: auto;
        margin-bottom: 18px;
    }

    .core-solution-item.is-active .core-solution-expanded {
        position: relative;
        inset: auto;
        padding: 0;
        transform: none;
        justify-content: flex-start;
    }

    /* On mobile, hide the duplicate horizontal title inside expanded
       state since the collapsed row already shows it */
    .core-solution-item.is-active .core-solution-title--horizontal {
        display: none;
    }

    /* Arrow icon positioning on mobile */
    .core-solution-arrow {
        top: 14px;
        right: 14px;
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 400px) {
    .core-solution-number  { font-size: 30px; }
    .core-solution-title--vertical { font-size: 16px; }
    .core-solution-content { padding: 16px; }
}
