﻿/**
 * Service cards and preview section styles.
 *
 * @package MaxisTheme
 */

.services-preview {
    padding-block: var(--layout-section-space-y);
}

.services-preview__head {
    margin-bottom: var(--layout-section-head-space-y);
    display: grid;
    gap: var(--space-2);
}

.services-preview__title,
.services-preview__subtitle {
    margin: 0;
}

.services-preview__subtitle {
    color: var(--text-secondary);
    max-width: 65ch;
}

.services-preview__grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: clamp(16px, 1.8vw, 24px);
}

.services-preview__grid>* {
    height: 100%;
}

.services-preview__empty {
    margin: 0;
    padding: 16px;
    border: 1px dashed var(--border);
    border-radius: var(--r-sm);
    color: var(--text-muted);
}

.services-preview__more {
    margin: 20px 0 0;
}

.service-card {
    height: 100%;
    border-radius: var(--r-md);
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.service-card:hover {
    transform: translateY(-2px);
    border-color: rgba(59, 130, 246, 0.42);
    box-shadow: var(--shadow-md);
}

.service-card__link {
    display: flex;
    flex-direction: column;
    height: 100%;
    text-decoration: none;
    color: inherit;
    border-radius: inherit;
    overflow: hidden;
}

.service-card__media {
    aspect-ratio: 16 / 10;
    background: var(--bg-elev-1);
    border-bottom: 1px solid var(--border);
}

.service-card__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.service-card__body {
    display: flex;
    flex-direction: column;
    gap: 14px;
    height: 100%;
}

.service-card__head {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: start;
    gap: 10px;
}

.service-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: var(--r-sm);
    background: rgba(59, 130, 246, 0.14);
    border: 1px solid rgba(59, 130, 246, 0.26);
    color: var(--text-primary);
    font-size: 16px;
    line-height: 1;
    flex: 0 0 36px;
}

.service-card__icon-image {
    width: 18px;
    height: 18px;
    object-fit: contain;
}

.service-card__title {
    margin: 0;
    font-size: 1.125rem;
    line-height: 1.33;
    font-weight: 650;
    color: var(--text-primary);
}

.service-card__excerpt {
    margin: 0;
    color: var(--text-secondary);
    font-size: 0.9375rem;
    line-height: 1.6;
}

.service-card__meta {
    margin-top: auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

.service-card__price {
    font-size: 1rem;
    line-height: 1.25;
    font-weight: 700;
    color: var(--text-primary);
}

.service-card__more {
    pointer-events: none;
}

.service-card:focus-within {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

.archive-list {
    list-style: none;
    display: grid;
    gap: 12px;
}

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

/* Home services */
.home-services {
    position: relative;
    overflow: hidden;
    padding-block: clamp(40px, 5vw, 72px);
}


.home-services__head {
    position: relative;
    z-index: 2;
    margin-bottom: clamp(24px, 4vw, 48px);
    display: grid;
    gap: 10px;
    padding: clamp(20px, 4vw, 32px);
    border-radius: 16px;
    background: linear-gradient(135deg, rgba(59, 130, 246, 0.08) 0%, rgba(96, 165, 250, 0.04) 55%, rgba(59, 130, 246, 0.02) 100%);
    border: 1px solid rgba(148, 163, 184, 0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.home-services__title,
.home-services__subtitle {
    margin: 0;
}

.home-services__title {
    font-size: clamp(1.5rem, 5vw, 2.25rem);
    line-height: 1.25;
    font-weight: 700;
    color: #fff;
    letter-spacing: -0.5px;
}

.home-services__subtitle {
    color: #9ca3af;
    max-width: 65ch;
    font-size: clamp(0.9rem, 2.2vw, 1.05rem);
    line-height: 1.6;
}

.home-services__grid {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr;
    gap: clamp(16px, 3vw, 18px);
}

.service-home-card {
    min-width: 0;
}

.service-home-card__link {
    position: relative;
    display: flex;
    flex-direction: column;
    gap: 14px;
    min-height: 100%;
    padding: clamp(18px, 3.2vw, 24px);
    border: 1px solid rgba(148, 163, 184, 0.24);
    border-radius: 18px;
    color: inherit;
    text-decoration: none;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.06) 0%, rgba(255, 255, 255, 0.02) 100%),
        rgba(15, 23, 42, 0.72);
    box-shadow: 0 12px 28px rgba(2, 6, 23, 0.38);
    overflow: hidden;
    transform: translateY(0);
    --gx: 50%;
    --gy: 50%;
    transition: transform 0.32s cubic-bezier(0.34, 1.56, 0.64, 1), border-color 0.4s ease-out, box-shadow 0.4s ease, background 0.4s ease, --gx 0.08s linear, --gy 0.08s linear;
}

.service-home-card__link:hover,
.service-home-card__link:focus-visible {
    color: inherit;
    text-decoration: none;
    transform: translateY(-6px);
    border-color: rgba(96, 165, 250, 0.85);
    box-shadow: 0 0 0 1.5px rgba(96, 165, 250, 0.4), 0 20px 48px rgba(59, 130, 246, 0.35);
    background:
        linear-gradient(180deg, rgba(96, 165, 250, 0.12) 0%, rgba(255, 255, 255, 0.03) 100%),
        rgba(15, 23, 42, 0.88);
}

.service-home-card__link:focus-visible {
    outline: 2px solid rgba(147, 197, 253, 0.9);
    outline-offset: 3px;
}

.service-home-card__link * {
    text-decoration: none;
}

.service-home-card__link::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    background: radial-gradient(280px circle at 100% 0%, rgba(56, 189, 248, 0.2), transparent 65%);
    opacity: 0;
    transition: opacity 0.5s ease-out;
}

.service-home-card__glow {
    position: absolute;
    inset: 0;
    border-radius: inherit;
    pointer-events: none;
    opacity: 0;
    transition: opacity 0.35s ease, filter 0.35s ease;
    background: radial-gradient(220px circle at var(--gx, 50%) var(--gy, 50%),
            rgba(96, 165, 250, 0.32),
            rgba(96, 165, 250, 0.08) 50%,
            transparent 75%);
    filter: blur(0px);
    z-index: 1;
}

.service-home-card__link:hover::before,
.service-home-card__link:focus-visible::before {
    opacity: 1;
}

.service-home-card__link:hover .service-home-card__glow,
.service-home-card__link:focus-visible .service-home-card__glow {
    opacity: 1;
    filter: blur(1px);
}

.service-home-card__link.leaving::before {
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.service-home-card__link.leaving .service-home-card__glow {
    transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), filter 0.6s cubic-bezier(0.4, 0, 0.2, 1), --gx 0.16s linear, --gy 0.16s linear;
}

.service-home-card__header {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 10px;
    align-items: start;
}

.service-home-card__title {
    margin: 0;
    font-size: clamp(1rem, 2.4vw, 1.15rem);
    line-height: 1.35;
    font-weight: 700;
    color: #f8fafc;
    letter-spacing: -0.2px;
    word-break: break-word;
}

.service-home-card__price-badge {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    padding: 5px 10px;
    border-radius: 999px;
    font-size: clamp(0.74rem, 1.5vw, 0.84rem);
    font-weight: 700;
    letter-spacing: 0.2px;
    color: #bfdbfe;
    background: rgba(59, 130, 246, 0.2);
    border: 1px solid rgba(147, 197, 253, 0.35);
}

.service-home-card__desc {
    position: relative;
    z-index: 2;
    margin: 0;
    color: #cbd5e1;
    font-size: clamp(0.86rem, 2vw, 0.95rem);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.service-home-card__footer {
    position: relative;
    z-index: 2;
    margin-top: auto;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    padding-top: 10px;
}

.service-home-card__cta {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: clamp(0.85rem, 2vw, 0.95rem);
    font-weight: 600;
    color: #93c5fd;
    letter-spacing: 0.2px;
    transition: color 0.24s ease;
}

.service-home-card__cta-icon {
    transition: transform 0.24s ease;
}

.service-home-card__link:hover .service-home-card__cta,
.service-home-card__link:focus-visible .service-home-card__cta {
    color: #dbeafe;
}

.service-home-card__link:hover .service-home-card__cta-icon,
.service-home-card__link:focus-visible .service-home-card__cta-icon {
    transform: translateX(3px);
}

.home-services__empty {
    position: relative;
    z-index: 2;
    margin: 0;
    padding: 20px 24px;
    border: 1px dashed rgba(148, 163, 184, 0.28);
    border-radius: 12px;
    color: #94a3b8;
    background: rgba(15, 23, 42, 0.46);
    text-align: center;
    font-size: 0.95rem;
}

.home-services__actions {
    position: relative;
    z-index: 2;
    margin-top: clamp(28px, 4vw, 40px);
}

.home-services__cta,
.home-services__cta-fallback {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: clamp(44px, 10vw, 52px);
    padding-inline: clamp(20px, 4vw, 28px);
    border-radius: 999px;
    text-decoration: none;
    font-weight: 650;
    letter-spacing: 0.3px;
    transition: all 0.24s ease;
    font-size: clamp(0.9rem, 2vw, 1rem);
}

.home-services__cta-fallback {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    border: 1px solid rgba(59, 130, 246, 0.7);
    color: #fff;
    box-shadow: 0 0 28px rgba(59, 130, 246, 0.24);
}

.home-services__cta-fallback:hover,
.home-services__cta-fallback:focus-visible {
    box-shadow: 0 0 40px rgba(59, 130, 246, 0.36);
    transform: translateY(-2px);
}

@media (max-width: 640px) {
    .home-services__subtitle {
        max-width: 55ch;
    }

    .service-home-card__link {
        gap: 10px;
    }

    .service-home-card__header {
        grid-template-columns: 1fr auto;
    }

    .service-home-card__title {
        min-width: 0;
    }

    .service-home-card__link:hover,
    .service-home-card__link:focus-visible {
        transform: translateY(-3px);
    }

    .home-services__cta-fallback {
        width: 100%;
    }
}

@media (min-width: 768px) {
    .home-services__grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 20px;
    }
}

@media (min-width: 1024px) {
    .home-services__grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 22px;
    }
}

@media (prefers-reduced-motion: reduce) {

    .service-home-card__link,
    .service-home-card__link::before,
    .service-home-card__cta,
    .service-home-card__cta-icon {
        transition: none;
    }

    .service-home-card__link:hover,
    .service-home-card__link:focus-visible {
        transform: none;
    }
}