/* How To Section - Frontend Styles */
.wp-block-theme-howto-steps {
    --color-bg: #f8f6f3;
    --color-text: #1a1a1a;
    --color-text-muted: #666;
    --color-accent: #a52a2a;
    --transition-smooth: cubic-bezier(0.4, 0, 0.2, 1);
    
    --card-collapsed: 140px;
    --card-default: 140px;
    --card-expanded: 570px;
    --card-height: 520px;
    
    max-width: 1400px;
    margin: 0 auto;
    padding: 80px 40px;
}

/* Section Header */
.howto-section-header {
    text-align: center;
    margin-bottom: 60px;
}

.howto-section-label {
    font-size: 0.75rem;
    font-weight: 600;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 16px;
}

.howto-section-title {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 400;
    line-height: 1.1;
    margin-bottom: 20px;
}

.howto-section-subtitle {
    font-size: 1.125rem;
    color: var(--color-text-muted);
    max-width: 500px;
    margin: 0 auto;
}

/* Steps Container */
.howto-steps-container {
    display: flex;
    gap: 10px;
    justify-content: center;
    height: var(--card-height);
}

/* Step Card */
.howto-step-card {
    position: relative;
    width: var(--card-default);
    height: 100%;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.6s var(--transition-smooth);
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    flex-shrink: 0;
}

.howto-step-card:hover:not(.expanded) {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.12);
}

/* Collapsed state */
.howto-step-card.collapsed {
    width: var(--card-collapsed);
}

/* Expanded state */
.howto-step-card.expanded {
    width: var(--card-expanded);
    cursor: default;
}

/* Show expanded overlay only when expanded */
.howto-step-card.expanded .howto-overlay-expanded {
    opacity: 1;
    transform: translateY(0);
}

/* Image */
.howto-step-image {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s var(--transition-smooth);
}

.howto-step-card:hover .howto-step-image {
    transform: scale(1.03);
}

/* Default overlay - ALWAYS visible on all cards */
.howto-overlay-default {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 28px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.5) 50%, transparent 100%);
    color: white;
    transition: opacity 0.4s var(--transition-smooth);
    z-index: 2;
}

.howto-step-number {
    font-size: 0.875rem;
    font-style: italic;
    opacity: 0.8;
    margin-bottom: 6px;
}

.howto-step-title-small {
    font-weight: 600;
    font-size: 1rem;
    line-height: 1.3;
}

/* Number badge - hidden by default, shown on collapsed */
.howto-number-badge {
    display: none;
}

/* Expanded overlay - shown only when expanded */
.howto-overlay-expanded {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px 28px;
    background: linear-gradient(to top, rgba(0,0,0,0.92) 0%, rgba(0,0,0,0.75) 70%, transparent 100%);
    color: white;
    opacity: 0;
    transform: translateY(10px);
    transition: all 0.5s var(--transition-smooth);
    transition-delay: 0s;
    z-index: 3;
}

.howto-step-card.expanded .howto-overlay-expanded {
    transition-delay: 0.15s;
}

/* Step number circle in expanded heading */
.howto-step-circle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    background: var(--color-accent);
    color: white;
    border-radius: 50%;
    font-size: 0.875rem;
    margin-right: 12px;
    flex-shrink: 0;
    vertical-align: middle;
}

.howto-step-indicator {
    font-size: 0.7rem;
    font-weight: 600;
    letter-spacing: 0.15em;
    text-transform: uppercase;
    color: var(--color-accent);
    margin-bottom: 12px;
    display: block;
}

.howto-step-title-large {
    font-size: 1.625rem;
    line-height: 1.2;
    margin-bottom: 12px;
}

.howto-step-description {
    font-size: 0.9375rem;
    line-height: 1.6;
    opacity: 0.85;
}

/* Close button */
.howto-close-btn {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    border: none;
    background: rgba(255,255,255,0.95);
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transform: scale(0.8);
    transition: all 0.3s var(--transition-smooth);
    z-index: 10;
    box-shadow: 0 2px 10px rgba(0,0,0,0.15);
}

.howto-step-card.expanded .howto-close-btn {
    opacity: 1;
    transform: scale(1);
    transition-delay: 0.2s;
}

.howto-close-btn:hover {
    background: var(--color-text);
    color: white;
}

.howto-close-btn svg {
    width: 16px;
    height: 16px;
}

/* Mobile Tabs */
.howto-mobile-tabs {
    display: none;
}

/* Responsive - Tablet */
@media (max-width: 1200px) {
    .wp-block-theme-howto-steps {
        --card-expanded: 500px;
        --card-default: 100px;
        --card-collapsed: 100px;
    }
}

/* Responsive - Mobile */
@media (max-width: 1020px) {
    .wp-block-theme-howto-steps {
        padding: 0;
    }

    .howto-steps-container {
        flex-direction: column;
        height: auto;
        gap: 0;
    }

    .howto-step-card {
        display: none;
        width: 100%;
        height: 380px;
        border-radius: 16px 16px 0 0;
    }

    .howto-step-card.active {
        display: block;
    }

    /* Always show expanded overlay on mobile active card */
    .howto-step-card.active .howto-overlay-default {
        opacity: 0;
    }

    .howto-step-card.active .howto-overlay-expanded {
        opacity: 1;
        transform: translateY(0);
    }

    .howto-step-card.active .howto-step-image {
        transform: scale(1);
    }

    .howto-close-btn {
        display: none;
    }

    .howto-step-card.collapsed,
    .howto-step-card.expanded {
        width: 100%;
    }

    /* Mobile Tabs */
    .howto-mobile-tabs {
        display: grid;
        grid-template-columns: repeat(6, 1fr);
        gap: 0;
        background: white;
        border-radius: 0 0 16px 16px;
        overflow: hidden;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    }

    .howto-mobile-tab {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        padding: 16px 8px;
        border: none;
        background: white;
        cursor: pointer;
        transition: all 0.3s var(--transition-smooth);
        border-right: 1px solid #f0f0f0;
        gap: 6px;
    }

    .howto-mobile-tab:last-child {
        border-right: none;
    }

    .howto-mobile-tab:hover {
        background: var(--color-bg);
    }

   .howto-mobile-tab.active {
        background: var(--color-accent);
        color: white;
    }
    
    .howto-mobile-tab.active .howto-tab-number {
        background: white;
        color: var(--color-accent);
    }
    
    .howto-mobile-tab.active .howto-tab-label {
        opacity: 1;
    }

    .howto-tab-number {
        width: 28px;
        height: 28px;
        border-radius: 50%;
        background: var(--color-bg);
        display: flex;
        align-items: center;
        justify-content: center;
        font-size: 0.875rem;
        font-weight: 500;
        transition: all 0.3s var(--transition-smooth);
    }

    .howto-mobile-tab.active .howto-tab-number {
        background: rgba(255,255,255,0.25);
        color: white;
    }

    .howto-tab-label {
        font-size: 0.625rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.05em;
        opacity: 0.7;
    }

    .howto-mobile-tab.active .howto-tab-label {
        opacity: 1;
    }

    .howto-step-title-large {
    font-size: 1.625rem;
    line-height: 1.2;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
}

    .howto-overlay-expanded {
        padding: 28px 24px;
    }
}

@media (max-width: 480px) {
    .howto-step-card.active {
        height: 340px;
    }

    .howto-mobile-tab {
        padding: 12px 4px;
    }

    .howto-tab-label {
        display: block;
        font-size: 0.5rem;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        max-width: 100%;
    }

    .howto-tab-number {
        width: 28px;
        height: 28px;
        font-size: 0.875rem;
    }

    .howto-step-title-large {
        font-size: 1.375rem;
    }

    .howto-step-description {
        font-size: 0.875rem;
    }
}