/* ===========================
   CUBE CSS - Services Section
   =========================== */

/* COMPOSITION: Layout and structural layers */

.services {
    padding: var(--space-3xl) 0;
}

.service-process {
    position: relative;
}

.service-process-list {
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
}

.service-process-layout {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
    margin-top: 3rem;
    align-items: center;
}

.service-process-step {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: var(--space-sm);
    align-items: start;
    padding: var(--space-sm) 0;
    border-bottom: 1px solid rgba(var(--color-primary), 0.16);
}

.service-process-step-icon {
    width: 2.6rem;
    height: 2.6rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    background: rgba(var(--color-primary), 0.08);
    font-size: 1.5rem;
    line-height: 1;
    flex-shrink: 0;
}

.service-process-step-content h3 {
    margin-bottom: 0.5rem;
}

.service-process-step-content p {
    line-height: 1.9;
    max-width: 62ch;
    text-wrap: pretty;
    hyphens: auto;
    white-space: pre-line;
}

.service-process-visual {
    border-radius: 10px !important;
    overflow: hidden;
}

.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 400px));
    gap: var(--space-lg);
    text-align: center;
    align-items: start;
    justify-content: center;
}

/* UTILITY: Reusable spacing and sizing utilities */

.service-card > * {
    padding-inline: var(--space-lg);
}

.service-card > :first-child,
.service-card .service-icon {
    font-size: 48px;
    padding: var(--space-lg) var(--space-lg) var(--space-sm);
    flex-shrink: 0;
}

.service-card h3 {
    margin: 0 0 0.45rem 0;
    min-height: 2.6em;
    line-height: 1.2;
    display: -webkit-box;
    line-clamp: 2;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    flex-shrink: 0;
}

.service-card p {
    margin-bottom: 0.45rem;
    font-size: var(--text-sm);
}

.service-card .service-description {
    position: relative;
    max-height: var(--service-description-collapsed-height);
    overflow: hidden;
    transition: max-height var(--transition-base);
    padding-bottom: 0.3rem;
    cursor: pointer;
}

.service-card.is-expanded .service-description {
    max-height: none;
    overflow: visible;
    cursor: default;
}

.service-card.is-fit .service-description {
    max-height: none;
    overflow: visible;
    cursor: default;
}

.service-card .service-description::after {
    content: '';
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 2em;
    background: linear-gradient(to bottom, rgba(255, 255, 255, 0), rgb(var(--color-white)));
    pointer-events: none;
    transition: opacity var(--transition-base);
}

.service-card.is-expanded .service-description::after {
    opacity: 0;
}

.service-card.is-fit .service-description::after {
    opacity: 0;
}

.service-card p:nth-last-of-type(2),
.service-card .service-description {
    flex-grow: 1;
}

.service-card p:nth-last-of-type(1),
.service-card .service-price {
    font-weight: 600;
    color: rgb(var(--color-primary));
    margin: 0.5rem 0 0.35rem;
}

/* BLOCK: Service card component */

.service-card {
    background: rgb(var(--color-white));
    border-radius: 15px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: 0 5px 20px rgba(var(--color-black-rgb), 0.08);
    transition: transform var(--transition-base), box-shadow var(--transition-base);
    height: 550px;
    border: 2px solid transparent;
    cursor: pointer;
    --service-card-fit-buffer: 48px;
    --service-description-collapsed-height: 76px;
    width: 100%;
    max-width: 380px;
    justify-self: center;
}

.service-card.is-fit {
    cursor: default;
}

.service-card.is-expanded {
    height: auto;
    min-height: 480px;
}

.service-card:hover {
    transform: translateY(-8px) scale(1.01);
    box-shadow: 0 8px 24px rgba(var(--color-black-rgb), 0.12);
}

/* BLOCK: Service card buttons */

.service-card a,
.service-card .btn-service {
    background: transparent;
    color: rgb(var(--color-primary));
    padding: var(--space-sm) var(--space-lg);
    border-radius: 50px;
    text-decoration: none;
    display: inline-block;
    margin: 0 var(--space-lg) var(--space-md);
    transition: background var(--transition-base), color var(--transition-base), border var(--transition-base), transform var(--transition-fast);
    border: 2px solid rgb(var(--color-primary));
    font-weight: 600;
    font-size: 14px;
    cursor: pointer;
}

.service-card a:hover,
.service-card .btn-service:hover {
    background: rgb(var(--color-primary));
    color: rgb(var(--color-white));
}

/* EXCEPTION: Featured card (nth-child) and responsive variations */

.service-card:nth-child(2) {
    border-color: rgb(var(--color-primary));
    border-width: 3px;
    transform: scale(1.05);
}

.service-card:nth-child(2):hover {
    transform: scale(1.06) translateY(-8px);
}

.service-card:nth-child(2) a,
.service-card:nth-child(2) .btn-service {
    background: rgb(var(--color-primary));
    color: rgb(var(--color-white));
    border-color: rgb(var(--color-primary));
}

.service-card:nth-child(2) a:hover,
.service-card:nth-child(2) .btn-service:hover {
    background: rgb(var(--color-secondary));
    border-color: rgb(var(--color-secondary));
}

/* EXCEPTION - Tablet */
@media (max-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(auto-fit, minmax(260px, 300px));
    }

    .service-card:nth-child(2) {
        transform: scale(1.02);
    }

    .service-card:nth-child(2):hover {
        transform: translateY(-8px) scale(1.03);
    }

    .service-card {
        height: 500px;
        --service-card-fit-buffer: 40px;
        --service-description-collapsed-height: 81px;
    }

    .service-card.is-expanded {
        min-height: 500px;
    }
}

/* EXCEPTION - Mobile */
@media (max-width: 768px) {
    .services {
        padding: var(--space-2xl) 0;
    }

    .service-process-layout {
        grid-template-columns: 1fr;
        gap: var(--space-2xl);
    }

    .services-grid {
        grid-template-columns: 1fr;
        justify-content: stretch;
        gap: var(--space-md);
    }

    .service-process-step {
        padding: var(--space-sm) 0;
    }

    .service-process-step-icon {
        width: 2.25rem;
        height: 2.25rem;
        font-size: 1.25rem;
    }

    .service-card {
        height: 500px;
        max-width: 80%;
    }

    .service-card:nth-child(2) {
        transform: scale(1);
    }

    .service-card:nth-child(2):hover {
        transform: translateY(-8px) scale(1.01);
    }

    .service-card > :first-child {
        font-size: 36px;
        padding: var(--space-2xl) var(--space-lg) var(--space-lg);
    }

    .service-card h3 {
        font-size: var(--text-lg);
    }

    .service-card .service-description {
        max-height: var(--service-description-collapsed-height);
    }
}

/* EXCEPTION - Small mobile */
@media (max-width: 480px) {
    .services {
        padding: var(--space-xl) 0;
    }

    .service-process-list {
        gap: var(--space-sm);
    }

    .service-process-step {
        padding: var(--space-xs) 0;
    }

    .services-grid {
        gap: var(--space-sm);
    }

.service-card {
    max-width: 80%;
    height: 450px;
    border-radius: 10px;
    --service-card-fit-buffer: 28px;
    --service-description-collapsed-height: 62px;
}

    .service-card > * {
        padding-inline: var(--space-md);
    }

    .service-card > :first-child {
        font-size: 32px;
        padding: var(--space-lg) var(--space-md) var(--space-md);
    }

    .service-card h3 {
        font-size: var(--text-base);
        margin: 0 0 0.35rem 0;
        min-height: 2.4em;
    }

    .service-card p {
        font-size: 13px;
        margin-bottom: 0.35rem;
    }

    .service-card .service-description {
        max-height: var(--service-description-collapsed-height);
    }

    .service-card a {
        padding: var(--space-sm) var(--space-md);
        font-size: 13px;
        margin: 0 var(--space-md) var(--space-sm);
    }

    .service-card:nth-child(2) {
        border-width: 2px;
    }
}
