/* ==========================================================================
   Services Page Styles
   ========================================================================== */

/* Service Section — full viewport */
.service-section {
    position: relative;
    width: 100%;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: var(--service-bg) center / cover no-repeat;
}

/* Subtle overlay — just enough to ensure card stands out */
.service-section__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        rgba(28, 25, 23, 0.25) 0%,
        rgba(28, 25, 23, 0.4) 100%
    );
    z-index: 1;
}

/* Card wrapper — perspective container */
.service-card-wrapper {
    position: relative;
    z-index: 2;
    width: 70%;
    max-width: 900px;
    height: 70vh;
    max-height: 600px;
    perspective: 1200px;
}

/* 3D flip card */
.service-card {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transition: transform 0.6s ease;
}

/* Desktop: hover flips the card */
@media (min-width: 1025px) {
    .service-card-wrapper:hover .service-card:not(.flipped) {
        transform: rotateY(180deg);
    }
}

/* All viewports: click toggles a persistent flip */
.service-card {
    cursor: pointer;
}

.service-card.flipped {
    transform: rotateY(180deg);
}

/* Front face — 50% transparent frosted glass */
.service-card__front {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: rgba(250, 250, 249, 0.5);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 3rem;
    text-align: center;
    color: var(--color-text, #1C1917);
    box-shadow: 0 12px 40px rgba(28, 25, 23, 0.18);
}

/* Back face — 20% transparent frosted glass (more opaque for readability) */
.service-card__back {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    transform: rotateY(180deg);
    background: rgba(250, 250, 249, 0.8);
    backdrop-filter: blur(24px) saturate(1.2);
    -webkit-backdrop-filter: blur(24px) saturate(1.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 16px;
    padding: 2.5rem 3rem;
    color: var(--color-text, #1C1917);
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    box-shadow: 0 12px 40px rgba(28, 25, 23, 0.18);
}

/* ==========================================================================
   Front Face Typography
   ========================================================================== */

.service-card__icon {
    width: 48px;
    height: 48px;
    color: var(--color-amber, #D97706);
    margin-bottom: 1.5rem;
}

.service-card__icon svg {
    width: 100%;
    height: 100%;
}

.service-card__title {
    font-family: var(--font-heading);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    margin-bottom: 1rem;
    color: var(--color-text, #1C1917);
}

.service-card__hint {
    font-size: 0.875rem;
    color: var(--color-grey, #78716C);
    font-style: italic;
}

/* ==========================================================================
   Back Face Typography
   ========================================================================== */

.service-card__back-title {
    font-family: var(--font-heading);
    font-size: 1.5rem;
    color: var(--color-amber, #D97706);
    margin-bottom: 1rem;
}

.service-card__back p {
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1rem;
    color: #57534E;
}

.service-card__back ul {
    list-style: none;
    padding: 0;
    margin: 0 0 1rem;
}

.service-card__back li {
    padding: 0.3rem 0;
    padding-left: 1.2rem;
    position: relative;
    font-size: 0.85rem;
    color: var(--color-text, #1C1917);
}

.service-card__back li::before {
    content: '\2192';
    position: absolute;
    left: 0;
    color: var(--color-amber, #D97706);
}

.service-card__best-for {
    font-size: 0.8rem;
    color: var(--color-grey, #78716C);
    margin-top: auto;
}

.service-card__cta {
    margin-top: 1.5rem;
    align-self: flex-start;
    flex-shrink: 0;
    /* Ensure exact match with hero buttons — no overrides */
    height: 52px;
    padding: 0 var(--space-xl);
    font-size: var(--text-nav);
    font-weight: 500;
    line-height: 1;
    border-radius: var(--border-radius-pill);
}

/* ==========================================================================
   CTA Section
   ========================================================================== */

.service-cta {
    background-color: var(--color-amber, #D97706);
    padding: 5rem 0;
    color: var(--color-white, #ffffff);
}

.service-cta h2 {
    font-family: var(--font-heading);
    font-size: clamp(1.5rem, 3vw, 2.25rem);
    margin-bottom: 0.75rem;
}

.service-cta p {
    font-size: 1rem;
    opacity: 0.9;
    margin-bottom: 2rem;
}

/* ==========================================================================
   Mobile — no flip, stacked content
   ========================================================================== */

@media (max-width: 767px) {
    .service-section {
        height: auto;
        min-height: auto;
        padding: 4rem 1rem;
    }

    .service-card-wrapper {
        width: 100%;
        height: auto;
        max-height: none;
        perspective: none;
    }

    .service-card {
        transform-style: flat;
        transform: none !important;
    }

    .service-card__front,
    .service-card__back {
        position: relative;
        backface-visibility: visible;
        transform: none !important;
    }

    .service-card__front {
        border-radius: 16px 16px 0 0;
        padding: 2rem 1.5rem;
    }

    .service-card__back {
        border-radius: 0 0 16px 16px;
        padding: 2rem 1.5rem;
    }

    .service-card__hint {
        display: none;
    }
}

/* ==========================================================================
   Tablet — tap to flip hint
   ========================================================================== */

@media (min-width: 768px) and (max-width: 1024px) {
    .service-card__hint::after {
        content: ' (tap to explore)';
    }
}
