/* ==========================================================================
   Page: Services (/dich-vu)
   Spec: pages/services_page.md
   Service Card's own visual style lives in css/components/service-card.css.
   This file only handles page composition: intro, grid layout, grouping,
   how-it-works steps, CTA banner — per README, page CSS doesn't duplicate
   component style.
   ========================================================================== */

/* 5. Services Intro — same restrained treatment as Contact/FAQ Intro. */
.services-intro {
    padding-block: var(--space-12) var(--space-8);
}

.services-intro__inner {
    max-width: 62ch;
}

.services-intro__lead {
    margin-top: var(--space-4);
}

/* 6. Services Grid ---------------------------------------------------- */

.services-grid-section {
    padding-top: var(--space-4);
}

.services-group + .services-group {
    margin-top: var(--space-12);
}

.services-group__title {
    margin-bottom: var(--space-6);
}

/* §6.4 — 1 col mobile / 2 col tablet / 3 col desktop, equal-height cards. */
.services-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-6);
    list-style: none;
}

@media (min-width: 768px) {
    .services-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (min-width: 1024px) {
    .services-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}

/* A lone trailing card on tablet's 2-col grid should not stretch full
   width and distort the card ratio (§6.4 "không kéo giãn full-width"). */
.services-grid__item {
    min-width: 0;
}

/* 7. How It Works ------------------------------------------------------ */
.process__list {
    display: flex;
    flex-direction: column;
    gap: var(--space-8);
    counter-reset: none;
}

.process__item {
    display: flex;
    gap: var(--space-4);
    position: relative;
}

.process__marker {
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: var(--radius-full);
    background-color: var(--color-action-primary);
    color: var(--color-text-on-brand);
    font-weight: var(--font-weight-semibold);
    font-size: var(--font-size-sm);
}

.process__item:not(:last-child)::before {
    content: "";
    position: absolute;
    left: 19.5px;
    top: 40px;
    bottom: calc(-1 * var(--space-8));
    width: var(--border-width-sm);
    background-color: var(--color-border);
}

.process__body {
    padding-top: var(--space-1);
}

.process__title {
    font-size: var(--font-size-md);
    margin-bottom: var(--space-2);
}

.process__text {
    color: var(--color-text-secondary);
    max-width: 60ch;
}

@media (min-width: 1024px) {
    .process__list {
        flex-direction: row;
        gap: var(--space-6);
    }

    .process__item {
        flex: 1;
        flex-direction: column;
        gap: var(--space-4);
    }

    .process__item:not(:last-child)::before {
        left: 40px;
        top: 19.5px;
        right: calc(-1 * var(--space-6));
        bottom: auto;
        width: auto;
        height: var(--border-width-sm);
        left: 40px;
    }
}
#process-heading {
    margin-bottom: var(--space-6);
}

@media (min-width: 768px) {
    #process-heading {
        margin-bottom: var(--space-8);
    }
}

.how-it-works {
    padding-top: var(--space-4);
}

/* 8. CTA Banner ---------------------------------------------------------
   Same quiet, centered pattern as the FAQ page's "Still Have Questions"
   banner, kept as its own page-scoped class rather than a shared
   component — see services_page.md §8. */
.services-cta {
    text-align: center;
}

.services-cta__inner {
    max-width: 560px;
}

.services-cta__text {
    margin-top: var(--space-2);
    color: var(--color-text-secondary);
}

.services-cta__actions {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-3);
    margin-top: var(--space-6);
}

/* ==========================================================================
   Component: Service Card
   Spec: pages/services_page.md §6 — introduced here, extract into a
   dedicated components/service_card.md if a second page starts reusing it.
   First consumer of the Card Token group already defined in tokens.css
   (--card-bg, --card-border, --card-radius, --card-shadow, --card-shadow-hover).
   ========================================================================== */

   .service-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    padding: var(--space-6);
    background-color: var(--card-bg);
    border: var(--border-width-sm) solid var(--card-border);
    border-radius: var(--card-radius);
    box-shadow: var(--card-shadow);
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    box-shadow: var(--card-shadow-hover);
    border-color: var(--color-border-strong);
}

.service-card:focus-visible {
    outline: var(--focus-ring-width) var(--focus-ring-style) var(--color-focus-ring);
    outline-offset: var(--focus-ring-offset);
}

/* Icon — accent color on a tinted badge, never used as text color per
   design_tokens.md's "gold không dùng làm text nhỏ" rule. */
.service-card__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    margin-bottom: var(--space-4);
    border-radius: var(--radius-md);
    background-color: var(--navy-50);
    color: var(--color-action-primary);
    flex-shrink: 0;
}

.service-card__icon svg {
    width: 24px;
    height: 24px;
}

.service-card__title {
    margin-bottom: var(--space-2);
    font-size: var(--font-size-lg);
    font-weight: var(--font-weight-semibold);
    color: var(--color-text-primary);
}

/* flex: 1 pushes the "Xem chi tiết" affordance to the same baseline across
   a row even when descriptions run different lengths. */
.service-card__desc {
    flex: 1;
    font-size: var(--font-size-sm);
    color: var(--color-text-secondary);
    line-height: var(--line-height-relaxed);
}

.service-card__cta {
    display: inline-flex;
    align-items: center;
    gap: var(--space-1);
    margin-top: var(--space-4);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    color: var(--color-action-primary);
}

.service-card__cta-arrow {
    transition: transform 0.15s ease;
}

.service-card:hover .service-card__cta-arrow {
    transform: translateX(3px);
}

@media (prefers-reduced-motion: reduce) {
    .service-card,
    .service-card__cta-arrow {
        transition: none;
    }

    .service-card:hover {
        transform: none;
    }
}

@media (max-width: 479.98px) {
    .services-cta__actions {
        flex-direction: column;
    }

    .services-cta__actions .button {
        width: 100%;
    }
}

/* Scroll-reveal enhancement --------------------------------------------
   Applied to the <li> wrapper (not .service-card itself) so it never
   fights the card's own :hover transform. Progressive enhancement only:
   .js-reveal is added by services.js after IntersectionObserver support
   is confirmed, so no-JS visitors always see cards at full opacity. */
.js-reveal .services-grid__item[data-reveal] {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.js-reveal .services-grid__item[data-reveal].is-visible {
    opacity: 1;
    transform: none;
}

@media (prefers-reduced-motion: reduce) {
    .js-reveal .services-grid__item[data-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}