:root {
    --image-width: 350px;
    --image-height: 350px;
    --step-spacing: 16px;
    --step-inactive-height: 64px;
    --step-active-height: calc(var(--image-height) - (2 * var(--step-inactive-height)) - (2 * var(--step-spacing)));
    --step-border-radius: 16px;
    --step-active-color: var(--maestra-blue);
    --content-padding: 24px;
    --transition-duration: 0.3s;
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, black);
}

.dark-mode {
    --neutral-text: white;
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, white);
}

/* How To Section */
.how-to {
    padding: 50px 0 100px 0;
    width: 100%;
    overflow: hidden;
    text-align: left;
}

.how-to h2 {
    text-align: center;
    margin-bottom: 40px;
}

.how-to-steps {
    position: relative;
    width: 100%;
}

.how-to-layout {
    display: flex;
    gap: 30px;
    width: 100%;
    align-items: flex-start;
}

/* Image container */
.how-to .image-container {
    flex: 0 0 var(--image-width);
    position: relative;
    width: var(--image-width);
    height: var(--image-height);
    border-radius: var(--step-border-radius);
    overflow: hidden;
    background-color: var(--background);
    position: sticky;
    top: 80px;
}

.step-image {
    position: absolute;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity var(--transition-duration) ease;
}

.step-image[data-active="true"] {
    opacity: 1;
    z-index: 2;
}

.img-placeholder {
    width: 100%;
    height: 100%;
    background: var(--background);
    border: solid 1px color-mix(in srgb, var(--text) 10%, transparent);
    border-radius: var(--step-border-radius);
    overflow: hidden;
}

.img-placeholder img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Steps container */
.steps-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: var(--step-spacing);
    height: var(--image-height);
}

/* Step cards */
.step-card {
    width: 100%;
    height: var(--step-inactive-height);
    border-radius: var(--step-border-radius);
    background-color: color-mix(in srgb, var(--text) 5%, var(--background));
    overflow: hidden;
    transition: height var(--transition-duration) ease, 
                background-color var(--transition-duration) ease,
                border-color var(--transition-duration) ease;
    display: flex;
    flex-direction: column;
    padding: 0 24px;
    cursor: pointer;
    text-align: left;
}

.img-placeholder img{
	width:100%;
    height:auto;
    image-rendering: smooth;
    object-fit: cover;
}

.step-card * {
    color: var(--text);
}

.step-number {
    font-weight: bold;
    opacity: 0.8;
    padding: 4px 10px;
    border-radius: 16px;
    background: var(--background);
    font-size: var(--font-sm);
    transition: background-color var(--transition-duration) ease, color var(--transition-duration) ease;
    margin-right: 12px;
    display: inline-block;
}

.step-card h3,
.how-to-title-area {
    margin: 0;
    transition: color var(--transition-duration) ease;
    display: inline-flex;
    align-items: center;
    min-height: var(--step-inactive-height);
}

.how-to-title-area span:last-child
{
    font-weight: 600;
    font-size: var(--font-lg);
}

.step-content {
    max-height: 0;
    overflow: hidden;
    transition: max-height var(--transition-duration) ease, margin var(--transition-duration) ease;
    margin-top: 0;
    display: flex;
    align-items: flex-start;
    gap: 20px;
    height: min(var(--video-size), 100%);
}

.media {
    width: min(var(--video-size), 100%);
    height: 0;
    padding-bottom: min(var(--video-size), 100%);
    flex-shrink: 0;
}

.media img,
.media video {
    width: 100%;
    object-fit: cover;
    border-radius: var(--video-border-radius);
    flex-direction: column;
    justify-content: start;
}

/* Active step styling */
.step-card[data-active="true"] {
    height: var(--step-active-height);
    background-color: color-mix(in srgb, var(--step-active-color) 25%, var(--background));
    display: flex;
    flex-direction: column;
}

.step-card[data-active="true"] * {
    color: var(--text-color);
}

.step-card[data-active="true"] .step-number {
    background-color: var(--step-active-color);
    color: white;
}

.step-card[data-active="true"] .step-content {
    max-height: calc(var(--step-active-height) - var(--step-inactive-height));
    margin-top: 1rem;
    margin-bottom: 0;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

/* Step card colors */
.step-card:nth-child(1) {
    --step-active-color: var(--maestra-blue);
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, black);
}

.step-card:nth-child(2) {
    --step-active-color: var(--maestra-green);
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, black);
}

.step-card:nth-child(3) {
    --step-active-color: var(--maestra-yellow);
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, black);
}

.step-card:nth-child(4) {
    --step-active-color: var(--maestra-purple);
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, black);
}

.dark-mode .step-card:nth-child(1) {
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, white);
}

.dark-mode .step-card:nth-child(2) {
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, white);
}

.dark-mode .step-card:nth-child(3) {
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, white);
}

.dark-mode .step-card:nth-child(4) {
    --text-color: color-mix(in srgb, var(--step-active-color) 40%, white);
}

/* Material 3 elevation effect on hover */
.step-card:hover {
    background-color: color-mix(in srgb, var(--text) 5%, var(--background));
}

.step-card[data-active="true"]:hover {
    background-color: color-mix(in srgb, var(--step-active-color) 20%, var(--background));
}
@media(max-width:767px) {
    .how-to {
        padding: 20px 0;
        display: flex;
        flex-direction: column;
    }

    .how-to-steps {
        flex: 1;
        height: var(--mobile-card-height);
        max-height: var(--mobile-card-height);
        padding-bottom: 20px;
        overflow: hidden;
    }
}
/* Responsive styles */
@media (max-width: 767px) {
    :root {
        --image-height: 300px;
        --image-width: 100%;
        --step-inactive-height: 60px;
    }
    
    .how-to-layout {
        flex-direction: column;
    }
    
    .how-to .image-container {
        width: 100%;
        max-width: 400px;
        height: var(--image-height);
        margin: 0 auto 20px;
        position: relative;
        top: 0;
        flex: none;
    }
    
    .steps-container {
        height: auto;
        width: 100%;
    }
}

@media (max-width: 500px) {
    :root {
        --image-height: 320px;
        --step-inactive-height: 54px;
        --step-active-height: 148px;
        --step-spacing: 12px;
        --step-border-radius: 12px;
        --steps-container-height: calc(var(--step-active-height) + 2 * var(--step-spacing) + 2 * var(--step-inactive-height))
    }

    .how-to .image-container {
        max-width: 100%;
        height: var(--image-height);
    }

    .how-to h2 {
        margin-bottom: 30px;
    }


    .step-card {
        padding: 0 16px;
    }
  
    .step-card h3 {
        min-height: var(--step-inactive-height);
    }

    .step-number {
        padding: 3px 8px;
        margin-right: 8px;
    }


    .media {
        position: relative;
        width: min(var(--video-size), 100%);
        height: 0;
        padding-bottom: min(var(--video-size), 100%);
    }

    .how-to {
        padding: 30px 0 60px 0;
    }
}

@media (max-width: 350px) {
    :root {
        --image-height: 280px;
        --step-inactive-height: 48px;
        --step-spacing: 10px;
    }
    .step-number {
        padding: 2px 6px;
        margin-right: 6px;
    }

    .step-card[data-active="true"] .step-content {
        margin-top: 0;
    }
}
