/* ========== Base Styles & Typography ========== */
body {
    font-family: 'Montserrat', sans-serif;
    overflow-x: hidden;
    background-color: #F8F5F2; /* bg-cream */
    color: #2D2D2D; /* text-charcoal */
}

/* ========== Redefined Image Gallery Section ========== */
.image-gallery-flex {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2rem; /* Spacing between images */
    padding: 0 1rem;
    flex-wrap: wrap; /* Allows items to wrap on smaller screens */
}

.gallery-item {
    background-position: center;
    background-size: cover;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.12);
    transition: transform 0.4s ease;
    overflow: hidden;
    border-radius: 4px;
}

.gallery-item:hover {
    transform: scale(1.03);
}

.gallery-item img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Sizing for the three distinct items */
.item-left {
    width: 280px;
    height: 420px;
}

.item-middle {
    width: 350px;
    height: 525px;
    z-index: 10; /* Ensures it's visually prominent */
}

.item-right {
    width: 280px;
    height: 420px;
}

/* Responsive adjustments for the gallery */
@media (max-width: 1024px) {
    .item-left { width: 220px; height: 330px; }
    .item-middle { width: 280px; height: 420px; }
    .item-right { width: 220px; height: 330px; }
}

@media (max-width: 768px) {
    .image-gallery-flex {
        flex-direction: column; /* Stack them vertically on mobile */
        gap: 2.5rem;
    }
    .item-left, .item-middle, .item-right {
        width: 80%;
        max-width: 350px;
        height: auto;
        aspect-ratio: 2 / 3; /* Maintain a consistent portrait aspect ratio */
    }
}


/* ========== Animated Workflow Section ========== */
.workflow-container {
    position: relative;
    padding: 2rem 0;
}

.workflow-steps-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
    position: relative;
    z-index: 10;
}

.workflow-timeline {
    position: absolute;
    top: 52px; /* Vertically align with the center of the dots */
    left: 12.5%; /* Start from the center of the first item */
    width: 75%; /* Span to the center of the last item */
    height: 2px;
    background-color: #e5e7eb; /* gray-200 */
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

.workflow-progress {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2D2D2D; /* charcoal */
    transform: scaleX(0);
    transform-origin: left;
    transition: transform 1.5s cubic-bezier(0.25, 1, 0.5, 1) 0.5s; /* Delay start */
}

/* Active state triggered by JS */
.workflow-container.is-active .workflow-timeline {
    transform: scaleX(1);
}

.workflow-container.is-active .workflow-progress {
    /* 3 out of 4 steps are complete, so 3/3 of the visible bar = 100% */
    /* If the last one was also complete, this would still be 100% */
    transform: scaleX(calc(3/3));
}


.workflow-step {
    text-align: center;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.6s ease, transform 0.6s ease;
}

.workflow-dot {
    width: 24px;
    height: 24px;
    margin: 0 auto 1.5rem auto;
    border-radius: 9999px;
    border: 4px solid #fff;
    box-shadow: 0 0 0 2px #2D2D2D; /* charcoal outline */
    background-color: #2D2D2D; /* charcoal fill */
    position: relative;
    z-index: 20;
}

/* Style for the last, "incomplete" dot */
.workflow-step:last-child .workflow-dot {
    background-color: #e5e7eb; /* gray-200 */
    box-shadow: 0 0 0 2px #d1d5db; /* gray-300 outline */
}

/* Staggered animation for each step */
.workflow-container.is-active .workflow-step:nth-child(1) { transition-delay: 0.8s; }
.workflow-container.is-active .workflow-step:nth-child(2) { transition-delay: 1.1s; }
.workflow-container.is-active .workflow-step:nth-child(3) { transition-delay: 1.4s; }
.workflow-container.is-active .workflow-step:nth-child(4) { transition-delay: 1.7s; }

.workflow-container.is-active .workflow-step {
    opacity: 1;
    transform: translateY(0);
}

@media (max-width: 640px) {
    .workflow-steps-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 2rem;
    }
    .workflow-timeline {
        display: none; /* Hide complex timeline on small screens for simplicity */
    }
}