/* Container & List Setup */
.stacking-cards-container {
    width: 100%;
    position: relative;
    box-sizing: border-box;
}

.stacking-cards-header {
    margin-bottom: 2.5rem;
    text-align: center;
}

.stacking-cards-header h1,
.stacking-cards-header h2,
.stacking-cards-header h3,
.stacking-cards-header h4,
.stacking-cards-header h5 {
    color: #106a9a;
    margin-bottom: 0.5rem;
}

.stacking-cards-subheader {
    font-size: 1.15rem;
    color: #555;
    margin-top: 0;
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.stack-cards {
    --stack-cards-gap: 24px;
    --stack-cards-top-offset: var(--header-height, 0px);
    list-style: none;
    padding: 0;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 1100px;
}

/* Sticky Card Item */
.stack-cards__item {
    position: -webkit-sticky;
    position: sticky;
    top: calc(var(--stack-cards-top-offset, 0px) + var(--stack-cards-gap));
    margin-bottom: var(--stack-cards-gap);
    transform-origin: center top;
    will-change: transform;
    transition: transform 0.2s cubic-bezier(0.2, 0, 0, 1), box-shadow 0.2s ease;
    box-sizing: border-box;
    width: 100%;
}

.stack-cards__item:last-child {
    margin-bottom: 0;
}

/* Card Outer Shell */
.stack-cards__card {
    background-color: #ffffff;
    border-radius: 16px;
    border: 1px solid rgba(16, 106, 154, 0.12);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.08), 0 1px 3px rgba(0, 0, 0, 0.04);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
    gap: 1.5rem;
    padding: 1.75rem;
    box-sizing: border-box;
    min-height: 280px;
}

@media (min-width: 768px) {
    .stack-cards {
        --stack-cards-gap: 32px;
    }

    .stack-cards__card {
        grid-template-columns: 1.2fr 0.8fr;
        padding: 2.5rem;
        gap: 2.5rem;
        align-items: center;
        min-height: 340px;
    }
}

/* Card Content Area */
.stack-cards__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-start;
}

.stack-cards__badge {
    display: inline-block;
    background: rgba(16, 106, 154, 0.1);
    color: #106a9a;
    font-size: 0.85rem;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 0.25rem 0.75rem;
    border-radius: 999px;
    margin-bottom: 0.75rem;
}

.stack-cards__title {
    font-size: 1.5rem;
    font-weight: 700;
    color: #222222;
    margin-top: 0;
    margin-bottom: 0.75rem;
    line-height: 1.3;
}

@media (min-width: 768px) {
    .stack-cards__title {
        font-size: 1.85rem;
    }
}

.stack-cards__text {
    font-size: 1rem;
    line-height: 1.6;
    color: #4a5568;
    margin-bottom: 1.25rem;
}

.stack-cards__text p {
    margin-top: 0;
    margin-bottom: 0.75rem;
}

.stack-cards__text p:last-child {
    margin-bottom: 0;
}

.stack-cards__action {
    margin-top: 0.5rem;
}

.btn-stacking-card {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #106a9a;
    color: #ffffff !important;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.95rem;
    padding: 0.65rem 1.4rem;
    border-radius: 6px;
    transition: background-color 0.2s ease, transform 0.15s ease, box-shadow 0.2s ease;
    box-shadow: 0 2px 6px rgba(16, 106, 154, 0.25);
}

.btn-stacking-card:hover {
    background-color: #0c4e72;
    text-decoration: none;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 106, 154, 0.35);
}

/* Card Media / Image */
.stack-cards__media {
    width: 100%;
    height: 100%;
    min-height: 200px;
    max-height: 320px;
    border-radius: 12px;
    overflow: hidden;
    background-color: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
}

.stack-cards__media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
    transition: transform 0.3s ease;
}

.stack-cards__card:hover .stack-cards__media img {
    transform: scale(1.02);
}
