/**
 * User Cover Photo Block Styles
 * Styles for displaying user cover photos in various sizes and aspect ratios
 */

.wpuf-cover-photo {
    position: relative;
    overflow: hidden;
    background-color: #f9fafb;
    width: 100%;
}

.wpuf-cover-photo__container {
    position: relative;
    width: 100%;
    height: 100%;
}

.wpuf-cover-photo__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.3s ease;
}

.wpuf-cover-photo__image:hover {
    transform: scale(1.02);
}

.wpuf-cover-photo__link {
    display: block;
    text-decoration: none;
    color: inherit;
}

.wpuf-cover-photo__link:hover {
    text-decoration: none;
    color: inherit;
}

/* Loading state */
.wpuf-cover-photo__loading {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 14px;
}

/* Placeholder styles */
.wpuf-cover-photo__placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    min-height: 200px;
    background-color: #f3f4f6;
    color: #6b7280;
    font-size: 16px;
    font-weight: 500;
}

.wpuf-cover-photo__placeholder-text {
    opacity: 0.7;
}

.wpuf-cover-photo__solid {
    width: 100%;
    height: 100%;
    min-height: 200px;
}

/* Width variations */
.wpuf-cover-photo--full-width {
    width: 100%;
    max-width: 100%;
    margin: 0;
}

.wpuf-cover-photo--custom {
    /* Custom width is applied via inline styles */
    margin: 0 auto;
}

/* Fit type variations */
.wpuf-cover-photo--cover .wpuf-cover-photo__image {
    object-fit: cover;
    width: 100%;
    height: 100%;
}

.wpuf-cover-photo--contain .wpuf-cover-photo__image {
    object-fit: contain;
    width: 100%;
    height: 100%;
}

/* Color picker in editor */
.wpuf-cover-photo__color-picker {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #e5e7eb;
}

.wpuf-cover-photo__color-picker label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #374151;
}

/* Responsive behavior */
@media (max-width: 768px) {
    .wpuf-cover-photo--small,
    .wpuf-cover-photo--medium,
    .wpuf-cover-photo--large {
        width: 100%;
        max-width: 100%;
    }

    .wpuf-cover-photo--custom {
        width: 100%;
        max-width: 100%;
    }
}

@media (max-width: 480px) {
    .wpuf-cover-photo--small {
        --wpuf-cover-photo-height: 120px;
    }

    .wpuf-cover-photo--medium {
        --wpuf-cover-photo-height: 200px;
    }

    .wpuf-cover-photo--large {
        --wpuf-cover-photo-height: 250px;
    }
}

/* Editor-specific styles */
.wp-block-wpuf-ud-cover-photo {
    margin: 20px 0;
}

/* Block inspector enhancements */
.components-panel__body .wpuf-cover-photo__color-picker .components-color-palette {
    margin-top: 8px;
}

/* Animation for loading state */
@keyframes pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

.wpuf-cover-photo__loading {
    animation: pulse 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .wpuf-cover-photo__placeholder {
        border: 2px solid #000;
    }

    .wpuf-cover-photo__placeholder-text {
        color: #000;
        font-weight: 700;
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .wpuf-cover-photo__image {
        transition: none;
    }

    .wpuf-cover-photo__image:hover {
        transform: none;
    }

    .wpuf-cover-photo__loading {
        animation: none;
    }
}
