/**
 * Feature Cards Block Frontend Styles
 *
 * Interactive cards with hover effects - card lifts, button slides up
 */

/* Container */
.zonkey-feature-cards {
    margin-bottom: 2rem;
}

/* Feature Card */
.feature-card {
    position: relative;
    overflow: hidden;
    height: var(--card-height, 350px);
    transition: transform var(--transition-speed, 0.3s) ease,
                box-shadow var(--transition-speed, 0.3s) ease;
}

/* Card link wrapper - covers entire card */
.feature-card-link {
    display: block;
    position: relative;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
}

/* Rounded corners */
.feature-card.rounded {
    border-radius: var(--border-radius, 8px);
}

/* Drop shadow */
.feature-card.has-shadow {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Border */
.feature-card.has-border {
    border: var(--border-width, 1px) solid var(--border-color, #e5e7eb);
}

/* Background image */
.feature-card-image {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform var(--transition-speed, 0.3s) ease;
}

/* No image fallback */
.feature-card-no-image {
    background: linear-gradient(135deg, var(--color-primary, #2563eb), var(--color-secondary, #7c3aed));
}

/* Overlay */
.feature-card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background-color: var(--overlay-color, rgba(31, 41, 55, 0.5));
    transition: background-color var(--transition-speed, 0.3s) ease;
}

/* Content area */
.feature-card-content {
    position: absolute;
    left: 0;
    right: 0;
    padding: 1.5rem;
    color: var(--text-color, #ffffff);
    text-align: var(--text-align, left);
    z-index: 2;
}

/* Text position - bottom (default) */
.feature-card[data-text-position="bottom"] .feature-card-content {
    bottom: 0;
}

/* Text position - top */
.feature-card[data-text-position="top"] .feature-card-content {
    top: 0;
}

/* Text position - center */
.feature-card[data-text-position="center"] .feature-card-content {
    top: 50%;
    transform: translateY(-50%);
}

/* Title */
.feature-card-title {
    font-family: var(--font-heading, 'Poppins', sans-serif);
    font-weight: var(--font-heading-weight, 600);
    font-size: 1.25rem;
    line-height: 1.3;
    margin: 0 0 0.5rem 0;
    color: inherit;
}

/* Button wrapper - handles the slide-up animation */
.feature-card-button-wrapper {
    overflow: hidden;
    max-height: 0;
    opacity: 0;
    transform: translateY(20px);
    transition: max-height 0.4s ease,
                opacity 0.3s ease 0.1s,
                transform 0.3s ease 0.1s;
}

/* Button - uses theme button system */
.feature-card-button-wrapper .btn {
    margin-top: 0.75rem;
    display: inline-block;
}

/* Full width button */
.feature-card-button-wrapper .btn-full-width {
    display: block;
    width: 100%;
    text-align: center;
}

/* ============================================
   HOVER EFFECTS
   ============================================ */

/* Hover - overlay darkens */
.feature-card:hover .feature-card-overlay,
.feature-card:focus-within .feature-card-overlay {
    background-color: var(--overlay-hover-color, rgba(31, 41, 55, 0.7));
}

/* Hover - button slides up */
.feature-card:hover .feature-card-button-wrapper,
.feature-card:focus-within .feature-card-button-wrapper {
    max-height: 100px;
    opacity: 1;
    transform: translateY(0);
}

/* Hover Effect: Lift */
.feature-card.hover-lift:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.15),
                0 10px 10px -5px rgba(0, 0, 0, 0.08);
}

/* Hover Effect: Zoom (image zooms) */
.feature-card.hover-zoom:hover .feature-card-image {
    transform: scale(1.1);
}

/* Hover Effect: Glow */
.feature-card.hover-glow:hover {
    box-shadow: 0 0 30px rgba(var(--color-primary-rgb, 37, 99, 235), 0.4),
                0 10px 20px rgba(0, 0, 0, 0.1);
}

/* Combined lift + zoom for extra impact */
.feature-card.hover-lift:hover .feature-card-image {
    transform: scale(1.05);
}

/* ============================================
   FOCUS STATES (Accessibility)
   ============================================ */

.feature-card-link:focus {
    outline: none;
}

.feature-card-link:focus-visible {
    outline: 3px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}

.feature-card:focus-within {
    outline: 3px solid var(--color-primary, #2563eb);
    outline-offset: 2px;
}

/* ============================================
   RESPONSIVE
   ============================================ */

@media (max-width: 1024px) {
    .feature-card-title {
        font-size: 1.125rem;
    }

    .feature-card-content {
        padding: 1.25rem;
    }
}

@media (max-width: 768px) {
    .feature-card-title {
        font-size: 1rem;
    }

    .feature-card-content {
        padding: 1rem;
    }

    /* On touch devices, show button by default */
    .feature-card-button-wrapper {
        max-height: 100px;
        opacity: 1;
        transform: translateY(0);
    }

    /* Reduce hover lift on mobile */
    .feature-card.hover-lift:hover {
        transform: translateY(-4px);
    }
}

@media (max-width: 480px) {
    .feature-card-title {
        font-size: 0.938rem;
    }

    .feature-card-content {
        padding: 0.875rem;
    }

    .feature-card-button-wrapper .btn {
        width: 100%;
        text-align: center;
    }
}

/* ============================================
   DISABLE ANIMATIONS
   ============================================ */

.disable-animations .feature-card,
.disable-animations .feature-card-image,
.disable-animations .feature-card-overlay,
.disable-animations .feature-card-button-wrapper {
    transition: none !important;
}

.disable-animations .feature-card.hover-lift:hover {
    transform: none;
}

.disable-animations .feature-card.hover-zoom:hover .feature-card-image {
    transform: none;
}

.disable-animations .feature-card.hover-glow:hover {
    box-shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1),
                0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

/* Respect prefers-reduced-motion */
@media (prefers-reduced-motion: reduce) {
    .feature-card,
    .feature-card-image,
    .feature-card-overlay,
    .feature-card-button-wrapper {
        transition: none !important;
    }

    .feature-card.hover-lift:hover {
        transform: none;
    }

    .feature-card.hover-zoom:hover .feature-card-image {
        transform: none;
    }

    /* Still show button on hover, just without animation */
    .feature-card:hover .feature-card-button-wrapper {
        max-height: 100px;
        opacity: 1;
        transform: translateY(0);
    }
}
