/*==================================================================
# Service — Archive Styles
# Single layout lives in assets/css/single-cpt.css
#
# ⚠️ NOTE ABOUT SMUSH / LAZY LOAD PLUGINS
# The `.service-archive-card__bg` element receives its image via an
# inline `style="background-image:url(...)"` in the archive template.
# Lazy-load plugins (like Smush "Lazy Load for Background Images")
# hijack that inline style and inject their own placeholder, which
# can bypass a plain `opacity: 0`. To keep the reveal-on-hover effect
# bulletproof, the show/hide rules below use `!important`. This is
# intentional — do NOT remove it unless you also disable background
# lazy loading in the plugin settings.
==================================================================*/

/*--------------------------------------------------------------
# Archive Section
--------------------------------------------------------------*/
.service-archive-section {
    padding-top: 60px !important;
    padding-bottom: 80px !important;
}

/*--------------------------------------------------------------
# Service Archive Card
--------------------------------------------------------------*/
.service-archive-card {
    position: relative;
    display: block;
    min-height: 300px;
    border-radius: 22px;
    overflow: hidden;
    background: #fff;
    text-decoration: none;
    box-shadow: 0 4px 10px -4px rgba(16, 22, 43, 0.08),
    0 12px 30px -20px rgba(16, 22, 43, 0.20);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
    isolation: isolate;
}

.service-archive-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 24px -10px rgba(2, 51, 130, 0.20),
    0 30px 60px -25px rgba(2, 51, 130, 0.35);
}

/*--------------------------------------------------------------
# Background image layer — hidden by default, revealed on hover
#
# The `!important` on opacity + visibility is REQUIRED to survive
# overrides from Smush lazy-load and similar plugins. See the file
# header comment for details.
#--------------------------------------------------------------*/
.service-archive-card__bg {
    position: absolute;
    inset: 0;
    background-color: var(--contrast-color, #ffffff);
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;

    /* Hard-hide — resistant to plugin overrides */
    opacity: 0 !important;
    visibility: hidden !important;

    transform: scale(1.08);
    transition:
        opacity 0.5s ease,
        transform 0.8s ease,
        visibility 0s linear 0.5s;
    z-index: 1;
    pointer-events: none;
    will-change: opacity, transform;
}

/* Overlay layer (accent gradient) */
.service-archive-card__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        160deg,
        color-mix(in srgb, var(--accent-color) 92%, transparent) 0%,
        color-mix(in srgb, var(--accent-color) 60%, #1a2a4a) 100%
    );

    /* Hard-hide — resistant to plugin overrides */
    opacity: 0 !important;
    visibility: hidden !important;

    transition:
        opacity 0.4s ease,
        visibility 0s linear 0.4s;
    z-index: 2;
    pointer-events: none;
}

/* Hover / keyboard focus: reveal image + overlay */
.service-archive-card:hover .service-archive-card__bg,
.service-archive-card:focus-within .service-archive-card__bg {
    opacity: 1 !important;
    visibility: visible !important;
    transform: scale(1);
    transition:
        opacity 0.5s ease,
        transform 0.8s ease,
        visibility 0s linear 0s;
}

.service-archive-card:hover .service-archive-card__overlay,
.service-archive-card:focus-within .service-archive-card__overlay {
    opacity: 1 !important;
    visibility: visible !important;
    transition:
        opacity 0.4s ease,
        visibility 0s linear 0s;
}

/* Content layer */
.service-archive-card__content {
    position: relative;
    z-index: 3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 14px;
    padding: 42px 26px 34px;
    min-height: 300px;
    text-align: center;
    transition: color 0.3s ease;
}

.service-archive-card__icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 74px;
    height: 74px;
    border-radius: 20px;
    background: color-mix(in srgb, var(--accent-color) 10%, transparent);
    color: var(--accent-color);
    font-size: 2rem;
    transition: background 0.35s ease, color 0.35s ease, transform 0.35s ease;
}

.service-archive-card__icon i {
    font-size: 2rem;
    line-height: 1;
}

.service-archive-card__title {
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--dark-heading-color);
    margin: 0;
    line-height: 1.5;
    transition: color 0.3s ease;
}

.service-archive-card__desc {
    font-size: 0.85rem;
    color: #6b7386;
    line-height: 1.85;
    margin: 0;
    transition: color 0.3s ease;
}

.service-archive-card__arrow {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent-color) 8%, transparent);
    color: var(--accent-color);
    font-size: 1rem;
    margin-top: 8px;
    transition: background 0.3s ease, color 0.3s ease, transform 0.3s ease;
}

/* Hover: white text/content over the revealed image */
.service-archive-card:hover .service-archive-card__title,
.service-archive-card:hover .service-archive-card__desc,
.service-archive-card:hover .service-archive-card__arrow {
    color: #fff;
}

.service-archive-card:hover .service-archive-card__icon {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    transform: scale(1.08) rotate(-4deg);
}

.service-archive-card:hover .service-archive-card__arrow {
    background: var(--second-accent-color);
    color: #fff;
    transform: translateX(-4px);
}

/*--------------------------------------------------------------
# Archive CTA
--------------------------------------------------------------*/
.service-archive-cta__card {
    position: relative;
    overflow: hidden;
    padding: 56px 40px;
    border-radius: 24px;
    background: linear-gradient(135deg, var(--accent-color) 0%, #1a2a4a 100%);
    text-align: center;
    box-shadow: 0 30px 70px -35px color-mix(in srgb, var(--accent-color) 55%, transparent);
}

.service-archive-cta__card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(circle at 15% 20%, rgba(255, 255, 255, 0.12), transparent 45%),
    radial-gradient(circle at 85% 80%, rgba(250, 153, 2, 0.16), transparent 50%);
    pointer-events: none;
}

.service-archive-cta__title {
    position: relative;
    z-index: 2;
    color: #fff;
    font-size: clamp(1.4rem, 2.6vw, 2rem);
    font-weight: 800;
    margin: 0 0 14px;
    line-height: 1.35;
}

.service-archive-cta__desc {
    position: relative;
    z-index: 2;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.9;
    max-width: 560px;
    margin: 0 auto 30px;
}

.service-archive-cta__btn {
    position: relative;
    z-index: 2;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 13px 30px;
    border-radius: 50px;
    background: #fff;
    color: var(--accent-color);
    font-weight: 700;
    font-size: 0.92rem;
    text-decoration: none;
    transition: all 0.28s cubic-bezier(0.22, 1, 0.36, 1);
    box-shadow: 0 14px 30px -14px rgba(0, 0, 0, 0.4);
}

.service-archive-cta__btn:hover {
    color: var(--accent-color);
    transform: translateY(-3px);
    box-shadow: 0 20px 40px -14px rgba(0, 0, 0, 0.5);
}

.service-archive-cta__btn i {
    transition: transform 0.3s ease;
}

.service-archive-cta__btn:hover i {
    transform: translateX(-4px);
}

/*--------------------------------------------------------------
# Responsive
--------------------------------------------------------------*/
@media (max-width: 768px) {
    .service-archive-card__content {
        padding: 34px 20px 28px;
        min-height: 260px;
    }

    .service-archive-cta__card {
        padding: 40px 24px;
        border-radius: 18px;
    }
}

@media (max-width: 576px) {
    .service-archive-card {
        min-height: 240px;
    }

    .service-archive-card__icon {
        width: 62px;
        height: 62px;
        font-size: 1.6rem;
    }

    .service-archive-card__icon i {
        font-size: 1.6rem;
    }

    .service-archive-card__title {
        font-size: 1rem;
    }
}

/*--------------------------------------------------------------
# Reduced motion
# Preserve the show/hide behavior (with !important so it still
# wins over Smush) but disable transitions.
--------------------------------------------------------------*/
@media (prefers-reduced-motion: reduce) {
    .service-archive-card,
    .service-archive-card__bg,
    .service-archive-card__overlay,
    .service-archive-card__icon,
    .service-archive-card__arrow,
    .service-archive-cta__btn {
        transition: none !important;
        transform: none !important;
    }

    /* Keep the reveal-on-hover logic intact even without transitions. */
    .service-archive-card__bg,
    .service-archive-card__overlay {
        opacity: 0 !important;
        visibility: hidden !important;
    }

    .service-archive-card:hover .service-archive-card__bg,
    .service-archive-card:hover .service-archive-card__overlay,
    .service-archive-card:focus-within .service-archive-card__bg,
    .service-archive-card:focus-within .service-archive-card__overlay {
        opacity: 1 !important;
        visibility: visible !important;
    }
}