/**
 * Location Feature Cards Block - Frontend Styles
 */

.loc-re-feature-cards {
    position: relative;
    z-index: 10;
    background-color: white;
    padding: 5rem 0;
    margin-top: 0;
}

.loc-re-feature-cards__container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;

    @media (max-width: 768px) {
        padding: 0 1rem;
    }
}

.loc-re-feature-cards__grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
    gap: 2rem;

    @media (max-width: 768px) {
        grid-template-columns: 1fr;
    }
}

.loc-re-feature-cards__card {
    background: white;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    height: 100%;
    display: flex;
    flex-direction: column;

    &:hover {
        transform: translateY(-8px);
        box-shadow: 0 12px 24px rgba(0, 0, 0, 0.15);
    }
}

.loc-re-feature-cards__image {
    height: 250px;
    overflow: hidden;

    &--placeholder {
        background: linear-gradient(135deg, #f3f4f6 0%, #e5e7eb 100%);
        display: flex;
        align-items: center;
        justify-content: center;
    }
}

.loc-re-feature-cards__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.loc-re-feature-cards__card:hover .loc-re-feature-cards__img {
    transform: scale(1.05);
}

.loc-re-feature-cards__placeholder {
    text-align: center;
}

.loc-re-feature-cards__placeholder-icon {
    font-size: 3rem;
    opacity: 0.5;
}

.loc-re-feature-cards__content {
    padding: 2rem;
    flex: 1;
    display: flex;
    flex-direction: column;

    @media (max-width: 768px) {
        padding: 1.5rem;
    }
}

.loc-re-feature-cards__title {
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #1a1a1a;
    line-height: 1.3;
}

.loc-re-feature-cards__description {
    color: #666;
    margin-bottom: 1.5rem;
    line-height: 1.6;
    flex: 1;
}

.loc-re-feature-cards__link {
    color: #2563eb;
    text-decoration: none;
    font-weight: 500;
    display: inline-flex;
    align-items: center;
    transition: color 0.3s ease;

    &:hover {
        color: #1d4ed8;
    }

    &::after {
        content: '→';
        margin-left: 8px;
        transition: transform 0.3s ease;
    }

    &:hover::after {
        transform: translateX(4px);
    }
    }

    &:active {
        transform: translateY(0);
    }
}

.loc-re-feature-cards__button-arrow {
    transition: transform 0.3s ease;
    font-size: 1rem;
}

// Staggered animation on load
.loc-re-feature-cards__card {
    opacity: 0;
    transform: translateY(30px);

    &.animate-in {
        animation: fadeInUp 0.6s ease-out forwards;
    }

    &:nth-child(1).animate-in { animation-delay: 0.1s; }
    &:nth-child(2).animate-in { animation-delay: 0.2s; }
    &:nth-child(3).animate-in { animation-delay: 0.3s; }
    &:nth-child(4).animate-in { animation-delay: 0.4s; }
    &:nth-child(5).animate-in { animation-delay: 0.5s; }
    &:nth-child(6).animate-in { animation-delay: 0.6s; }
}

// Animations
@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

// Accessibility improvements
@media (prefers-reduced-motion: reduce) {
    .wp-block-portal-loc-re-feature-cards {
        .loc-re-feature-card {
            animation: none;
            opacity: 1;
            transform: none;

            &:hover {
                transform: none;
            }

            .loc-re-card-image {
                transition: none;
            }

            .loc-re-card-button {
                &::before {
                    display: none;
                }

                &:hover {
                    transform: none;
                }

                &::after {
                    transition: none;
                }

                &:hover::after {
                    transform: none;
                }
            }
        }
    }
}

// High contrast mode support
@media (prefers-contrast: high) {
    .wp-block-portal-loc-re-feature-cards {
        .loc-re-feature-card {
            border: 2px solid var(--loc-re-text-dark, #1f2937);

            .loc-re-card-button {
                border: 2px solid white;
            }
        }
    }
}

// Print styles
@media print {
    .wp-block-portal-loc-re-feature-cards {
        .loc-re-feature-card {
            break-inside: avoid;
            box-shadow: none;
            border: 1px solid #ccc;

            .loc-re-card-button {
                background: transparent;
                color: var(--loc-re-text-dark, #1f2937);
                border: 1px solid var(--loc-re-text-dark, #1f2937);

                &::after {
                    display: none;
                }
            }
        }
    }
}

