/* Service Cards Mobile Fix - Fix White Blank Cards on Touch */

/* Mobile - Fix the reveal overlay to show content properly on tap */
@media (max-width: 1024px) {
    /* Make reveal work properly on touch devices */
    .service-card {
        -webkit-tap-highlight-color: transparent;
    }
    
    /* Ensure reveal content is always visible and not blank */
    .service-card .reveal {
        background: #000000 !important;
        transition: transform 0.4s cubic-bezier(0.2, 0.9, 0.2, 1) !important;
    }
    
    /* Fix reveal content visibility */
    .service-card .reveal-content {
        display: flex !important;
        flex-direction: column !important;
        justify-content: flex-start !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .service-card .reveal-content h3 {
        background: linear-gradient(145deg, #E5C97A, #C8A75A, #8A6A2F) !important;
        -webkit-background-clip: text !important;
        -webkit-text-fill-color: transparent !important;
        background-clip: text !important;
        color: #E5C97A !important;
        font-size: 16px !important;
        margin-bottom: 12px !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    .service-card .reveal-content p {
        color: #ffffff !important;
        font-size: 17px !important;
        line-height: 1.6 !important;
        visibility: visible !important;
        opacity: 1 !important;
    }
    
    /* Show reveal on active class (added by JavaScript) */
    .service-card.reveal-active .reveal {
        transform: translateY(0%) !important;
    }
    
    /* Keep corner circle visible and clickable */
    .service-card .corner-circle {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        background: #000000 !important;
        color: #ffffff !important;
        pointer-events: auto !important;
        cursor: pointer !important;
    }
    
    /* Ensure diagonal cut is visible */
    .service-card .reveal::before {
        display: block !important;
        visibility: visible !important;
    }
}

/* Fix: services section clips 2nd and 3rd cards on mobile due to fixed height */
@media (max-width: 768px) {
    .services-overview-section {
        height: auto !important;
        min-height: unset !important;
        padding-bottom: 60px !important;
    }

    .services-overview-section .service-card {
        height: auto !important;
        min-height: unset !important;
    }

    .services-overview-section .service-card .card-content,
    .services-overview-section .service-card .reveal {
        padding: 20px !important;
    }
}

/* Phone portrait: show description + enable tap-to-reveal animation */
@media (max-width: 767px) {
    .services-overview-section .service-card,
    .services-overview-section .service-card .service-inner,
    .services-overview-section .service-card .card-content {
        height: auto !important;
        min-height: unset !important;
    }

    .services-overview-section .service-card {
        padding: 0 !important;
        overflow: hidden !important;
    }

    .services-overview-section .service-card .service-inner {
        position: relative !important;
    }

    .services-overview-section .service-card .card-content {
        padding: 16px !important;
        opacity: 1 !important;
        transition: opacity 0.4s ease !important;
    }

    /* reveal: re-enable, sit below card ready to slide up */
    .services-overview-section .service-card .reveal {
        display: block !important;
        transform: translateY(100%) !important;
        padding: 16px !important;
        transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) !important;
    }

    /* corner-circle: always visible on mobile so users can navigate */
    .services-overview-section .service-card-wrapper > .corner-circle {
        display: flex !important;
        opacity: 1 !important;
        transform: scale(1) translateY(0) !important;
        pointer-events: auto !important;
        width: 44px !important;
        height: 44px !important;
        right: -8px !important;
        top: -8px !important;
    }

    /* tap-reveal active state: slide reveal up, fade card-content */
    .services-overview-section .service-card.reveal-active .card-content {
        opacity: 0 !important;
    }

    .services-overview-section .service-card.reveal-active .reveal {
        transform: translateY(0%) !important;
    }

    .services-overview-section .service-card .card-content p,
    .services-overview-section .service-card .reveal-content p {
        display: block !important;
        font-size: 13px !important;
        line-height: 1.6 !important;
        margin-top: 8px !important;
        color: rgba(255,255,255,0.85) !important;
        -webkit-text-fill-color: rgba(255,255,255,0.85) !important;
    }

    .services-overview-section .service-card .card-content h3,
    .services-overview-section .service-card .reveal-content h3 {
        font-size: 15px !important;
        line-height: 1.3 !important;
        margin-bottom: 4px !important;
    }
}

/* Phone landscape: show description + enable tap-to-reveal in 3-column grid */
@media (max-width: 932px) and (orientation: landscape) and (max-height: 500px) {
    /* No vh-based height in phone landscape */
    .services-overview-section {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }
    .services-overview-section .services-container {
        height: auto !important;
        min-height: auto !important;
    }

    .services-overview-section .service-card,
    .services-overview-section .service-card .service-inner,
    .services-overview-section .service-card .card-content {
        height: auto !important;
        min-height: unset !important;
    }

    .services-overview-section .service-card {
        padding: 0 !important;
        overflow: hidden !important;
    }

    .services-overview-section .service-card .service-inner {
        position: relative !important;
    }

    .services-overview-section .service-card .card-content {
        padding: 14px 16px !important;
        opacity: 1 !important;
        transition: opacity 0.4s ease !important;
    }

    /* reveal: re-enable, sit below card ready to slide up */
    .services-overview-section .service-card .reveal {
        display: block !important;
        transform: translateY(100%) !important;
        padding: 14px 16px !important;
        transition: transform 0.45s cubic-bezier(0.2, 0.9, 0.2, 1) !important;
    }

    /* corner-circle: always visible */
    .services-overview-section .service-card-wrapper > .corner-circle {
        display: flex !important;
        opacity: 1 !important;
        transform: scale(1) translateY(0) !important;
        pointer-events: auto !important;
        width: 40px !important;
        height: 40px !important;
        right: -6px !important;
        top: -6px !important;
    }

    /* tap-reveal active state */
    .services-overview-section .service-card.reveal-active .card-content {
        opacity: 0 !important;
    }

    .services-overview-section .service-card.reveal-active .reveal {
        transform: translateY(0%) !important;
    }

    .services-overview-section .service-card .card-content p,
    .services-overview-section .service-card .reveal-content p {
        display: block !important;
        font-size: 12px !important;
        line-height: 1.5 !important;
        margin-top: 6px !important;
        color: rgba(255,255,255,0.85) !important;
        -webkit-text-fill-color: rgba(255,255,255,0.85) !important;
    }

    .services-overview-section .service-card .card-content h3,
    .services-overview-section .service-card .reveal-content h3 {
        font-size: 14px !important;
        line-height: 1.3 !important;
        margin-bottom: 4px !important;
    }

    .services-overview-section .services-grid {
        grid-template-columns: repeat(3, 1fr) !important;
        gap: 12px !important;
    }
}


@media (min-width: 1024px) and (max-width: 1366px) and (orientation: landscape) and (pointer: coarse) and (hover: none) {
    .services-overview-section,
    .services-overview-section .services-container {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .services-overview-section {
        display: block !important;
        padding: 56px 0 !important;
    }

    .services-overview-section .services-container {
        padding: 0 40px !important;
    }

    .services-overview-section .services-header {
        align-items: flex-start !important;
        gap: 24px !important;
        margin-bottom: 32px !important;
    }

    .services-overview-section .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 20px !important;
    }

    .services-overview-section .service-card {
        height: 190px !important;
    }

    .services-overview-section .service-card .card-content {
        padding: 24px !important;
    }
}

/* iPad portrait only (touch devices): fix services section alignment */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) and (pointer: coarse) and (hover: none) {
    .services-overview-section,
    .services-overview-section .services-container {
        height: auto !important;
        min-height: auto !important;
        max-height: none !important;
    }

    .services-overview-section {
        display: block !important;
        padding: 48px 0 !important;
    }

    .services-overview-section .services-container {
        padding: 0 28px !important;
    }

    .services-overview-section .services-header {
        flex-direction: column !important;
        align-items: flex-start !important;
        gap: 20px !important;
        margin-bottom: 28px !important;
    }

    .services-overview-section .services-intro {
        text-align: left !important;
        max-width: none !important;
    }

    .services-overview-section .services-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 16px !important;
    }

    .services-overview-section .service-card {
        height: 180px !important;
    }

    .services-overview-section .service-card .card-content,
    .services-overview-section .service-card .reveal {
        padding: 18px !important;
    }
}
