/**
 * Vertical Scrolling Cards Block Styles
 *
 * @package TMW_Blocks
 * @since 1.0.0
 */

/* Vertical Scrolling Cards Section */
.vertical-scrolling-cards {
    overflow: visible !important;
}

/* Force overflow visible and remove contain on all parent containers */
.vertical-scrolling-cards,
.vertical-scrolling-cards .container,
.vertical-scrolling-cards-layout {
    overflow: visible !important;
    contain: none !important;
}

/* Critical: Override parent theme's overflow settings */
main,
section {
    overflow-x: visible !important;
}

/* Main layout: Uses theme grid system (row + col-* classes) */
.vertical-scrolling-cards-layout {
    /* gap handled by grid system */
}

.vertical-scrolling-cards-header {
    /* Width controlled by col-5 class */
    position: -webkit-sticky !important;

    /* Safari support */
    position: sticky !important;
    align-self: flex-start !important;

    /* Height shouldn't exceed viewport */
    max-height: calc(100vh - 150px);
    z-index: 10;

    /* Offset by every piece of sticky chrome above this block, not just the
       header: --sticky-sub-nav-height is set by the sub-navigation block when
       one is present and stays 0px otherwise, so pages without a sub-nav are
       unaffected. Omitting it pinned the heading behind the sub-nav bar on
       pages carrying both blocks. Fallbacks match the anchor-link
       scroll-margin-top pattern in the parent theme's core/base.css. */
    top: calc(var(--header-height, 0px) + var(--announcement-bar-height, 0px) + var(--sticky-sub-nav-height, 0px) + var(--sticky-element-top-offset, 20px));
}

.vertical-scrolling-cards-header .section-subtitle {
    margin: 0 0 var(--space-lg) 0;
}

.admin-bar .vertical-scrolling-cards-header {
    top: calc(var(--header-height, 0px) + var(--announcement-bar-height, 0px) + var(--sticky-sub-nav-height, 0px) + var(--sticky-element-top-offset, 20px) + 32px + 35px);
}

/* Right side cards container - vertical card stack */
.vertical-scrolling-cards-grid {
    /* Width controlled by col-7 class */

    /* flex-col utility class provides: display: flex; flex-direction: column */
    gap: var(--space-lg);
}

/* CTA Button in header */
.vertical-scrolling-cards-cta {
    margin-top: var(--space-lg);
}

/* Card styling */
.vertical-scrolling-card {
    background: var(--color-white);
    padding: var(--space-lg);
    border-radius: var(--radius-card);
    border: var(--border-width-thin) solid var(--color-border);
    position: relative;
    display: flex;
    gap: var(--space-lg);
    align-items: flex-start;
}

/* Hover effects only for clickable card links */
.vertical-scrolling-card.card-link-wrapper {
    transition: all var(--transition-slow);
    cursor: pointer;
    display: flex;
}

.vertical-scrolling-card.card-link-wrapper::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    transition: left var(--transition-slow) ease;
}

.vertical-scrolling-card.card-link-wrapper:hover {
    transform: translateY(var(--transform-offset-sm));
    box-shadow: var(--shadow-lg);
    border-color: var(--color-primary);
}

.vertical-scrolling-card.card-link-wrapper:hover::before {
    left: 100%;
}

/* Icon styling - floated to left */
.vertical-scrolling-card-icon {
    width: 80px;
    height: 80px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Icon transition only for clickable cards */
.vertical-scrolling-card.card-link-wrapper .vertical-scrolling-card-icon {
    transition: all var(--transition-base);
}

.vertical-scrolling-card-icon img {
    width: auto;
    height: auto;
    max-width: 80px;
    max-height: 80px;
    object-fit: contain;
}

/* Icon scale effect only for clickable cards */
.vertical-scrolling-card.card-link-wrapper:hover .vertical-scrolling-card-icon {
    transform: scale(1.05);
}

/* Card content wrapper */
.vertical-scrolling-card-content {
    flex: 1;
    min-width: 0;
}

.vertical-scrolling-card-content .card-title,
.has-text-color .vertical-scrolling-card-content .card-title {
    margin-bottom: var(--space-md);
    color: var(--color-heading);
}

/* Prevent parent block text color from affecting card content */
.has-text-color .vertical-scrolling-card-content p,
.has-text-color .vertical-scrolling-card-content ul,
.has-text-color .vertical-scrolling-card-content ol {
    color: var(--color-text-primary);
}

.vertical-scrolling-card-content p:last-of-type {
    margin-bottom: 0 !important;
}

/* List styling */
.vertical-scrolling-card-content ul,
.vertical-scrolling-card-content ol {
    margin-bottom: var(--space-sm);
}

/* Add spacing when list follows paragraph */
.vertical-scrolling-card-content p + ul,
.vertical-scrolling-card-content p + ol {
    margin-top: var(--space-sm);
}

/* Remove bottom margin from last list */
.vertical-scrolling-card-content ul:last-child,
.vertical-scrolling-card-content ol:last-child {
    margin-bottom: 0;
}

.vertical-scrolling-card-content .btn {
    margin-top: var(--space-md);
}

.vertical-scrolling-card-content .btn-arrow {
    margin-top: var(--space-md);
}

/* Card Background Colors */

/* Framework defaults using design system - child themes override with brand colors */
.vertical-scrolling-card.bg-option-1 {
    background: var(--color-bg-secondary);
}

.vertical-scrolling-card.bg-option-2 {
    background: var(--color-bg-secondary);
}

.vertical-scrolling-card.bg-option-3 {
    background: var(--color-bg-secondary);
}

.vertical-scrolling-card.bg-option-4 {
    background: var(--color-bg-secondary);
}

/* ==========================================================================
   Card Background Text Adaptation
   Dark bg styles handled globally by theme dark-bg-adaptation.css
   Cards with .has-nested-bg class auto-reset to light text colors
   ========================================================================== */

/* Highlighted Statistic Box */
.highlighted-statistic {
    background: var(--color-white);
    border-radius: var(--radius-md);
    margin-top: var(--space-md);
    padding: var(--space-sm) var(--space-lg);
    border: 1px solid var(--color-primary);
    font-size: var(--font-size-lead);
    font-weight: 400;
    color: var(--color-primary);
    display: inline-block;
}

.highlighted-statistic p {
    color: var(--color-primary);
}

/* Generic card link wrapper - reusable for any clickable card */
.card-link-wrapper {
    text-decoration: none;
    color: inherit;
}

.card-link-wrapper:hover {
    color: inherit;
}

/* Accessibility: Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .vertical-scrolling-card {
        transition: none;
    }
}

/* Tablet (1024px and below) - col-md-12 handles stacking */
@media (width <=1024px) {
    .vertical-scrolling-cards-header {
        position: static !important;
        align-self: auto !important;
        max-height: none !important;
        overflow-y: visible !important;
        text-align: center;
    }

    .vertical-scrolling-cards-header .section-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .vertical-scrolling-cards-grid {
        gap: var(--space-md);
    }
}

/* Mobile Responsive (768px and below) */
@media (width <=768px) {
    .vertical-scrolling-card.card-link-wrapper {
        flex-direction: column;
    }

    .vertical-scrolling-card-icon {
        width: 60px;
        height: 60px;
    }

    .vertical-scrolling-card {
        padding: var(--space-lg);
    }
}