/* Expanding Horizontal Cards */
.expanding-section {
    padding: 80px 0;
    overflow: hidden;
}

.expanding-grid {
    display: flex;
    gap: 12px;
    height: 400px;
    /* Fixed height for the strip */
    min-width: 100%;
}

.expanding-card {
    flex: 1;
    position: relative;
    border-radius: 20px;
    overflow: hidden;
    cursor: pointer;
    transition: flex 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    min-width: 60px;
    /* Prevent shrinking too much on mobile */
}

/* Hover State: Expand */
.expanding-card:hover {
    flex: 3;
}

/* Overlay for text readability */
.expanding-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.1) 60%);
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.expanding-card:hover .expanding-overlay {
    opacity: 0.5;
    /* Lighten on hover */
}

/* Content Positioning */
.expanding-content {
    position: absolute;
    bottom: 24px;
    left: 24px;
    right: 24px;
    z-index: 2;
    color: white;
    white-space: nowrap;
    /* Keep single line title initially */
}

/* Icon */
.exp-icon {
    font-size: 24px;
    margin-bottom: 8px;
    display: inline-block;
    background: rgba(255, 255, 255, 0.2);
    width: 40px;
    height: 40px;
    line-height: 40px;
    text-align: center;
    border-radius: 50%;
    backdrop-filter: blur(4px);
}

/* Title */
.expanding-content h3 {
    margin: 0;
    font-size: 1.2rem;
    font-weight: 600;
    transition: all 0.3s ease;
}

/* Subtitle / Description (Hidden by default) */
.expanding-footer {
    max-height: 0;
    /* Animated height */
    opacity: 0;
    overflow: hidden;
    transition: all 0.5s ease;
    margin-top: 0;
    white-space: normal;
    /* Allow wrap when visible */
}

.expanding-card:hover .expanding-footer {
    max-height: 100px;
    opacity: 1;
    margin-top: 8px;
}

.expanding-footer p {
    font-size: 0.9rem;
    color: rgba(255, 255, 255, 0.9);
    margin: 0;
    line-height: 1.4;
}

/* Dark Mode Support (if needed, though bg images usually dictate text color) */
[data-theme="dark"] .expanding-card {
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* Responsive: Stack on mobile */
@media (max-width: 768px) {
    .expanding-grid {
        flex-direction: column;
        height: auto;
    }

    .expanding-card {
        height: 120px;
        /* Collapsed height */
        flex: none;
        /* Disable flex growth logic on vertical */
        width: 100%;
    }

    .expanding-card:hover {
        height: 250px;
        /* Expand height */
    }

    .expanding-content {
        bottom: 16px;
    }
}