/* Mobile Image Overlay Enhancement CSS */

/* Base overlay container styles */
.responsive-overlay-container {
    position: relative;
    overflow: hidden;
    border-radius: 0.5rem;
    cursor: pointer;
}

/* Image styles within overlay container */
.responsive-overlay-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

/* Base overlay styles */
.responsive-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 0%, transparent 60%, transparent 100%);
    opacity: 0;
    transition: opacity 0.3s ease;
    display: flex;
    align-items: flex-end;
    padding: 1rem;
}

/* Overlay content positioning */
.responsive-overlay-content {
    color: white;
    width: 100%;
}

.responsive-overlay-content h4,
.responsive-overlay-content h5 {
    font-weight: 600;
    font-size: 1.125rem;
    margin-bottom: 0.25rem;
}

.responsive-overlay-content p {
    font-size: 0.875rem;
    color: rgba(255, 255, 255, 0.8);
    margin: 0;
}

/* Mobile indicator - golden circle with info icon */
.mobile-overlay-indicator {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 2rem;
    height: 2rem;
    background-color: #d4af37;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 10;
    pointer-events: none;
}

.mobile-overlay-indicator::after {
    content: 'i';
    color: #1e2832;
    font-weight: bold;
    font-size: 0.875rem;
    font-style: italic;
}

/* Desktop hover behavior - only apply on devices that support hover */
@media (hover: hover) and (pointer: fine) {
    .responsive-overlay-container:hover img {
        transform: scale(1.05);
    }

    .responsive-overlay-container:hover .responsive-overlay {
        opacity: 1;
    }

    /* Hide mobile indicator on hover-capable devices */
    .mobile-overlay-indicator {
        display: none;
    }
}

/* Mobile/touch behavior - only apply on devices without hover capability */
@media (hover: none) and (pointer: coarse) {

    /* Show mobile indicator on touch devices */
    .responsive-overlay-container .mobile-overlay-indicator {
        opacity: 1;
    }

    /* Active state for mobile overlay */
    .responsive-overlay-container.overlay-active .responsive-overlay {
        opacity: 1;
    }

    .responsive-overlay-container.overlay-active img {
        transform: scale(1.02);
    }

    /* Slightly reduce indicator opacity when overlay is active */
    .responsive-overlay-container.overlay-active .mobile-overlay-indicator {
        opacity: 0.7;
    }
}

/* Hybrid devices - devices that support both hover and touch */
@media (hover: hover) and (pointer: coarse) {

    /* Show both hover and touch behaviors */
    .responsive-overlay-container .mobile-overlay-indicator {
        opacity: 0.6;
    }

    .responsive-overlay-container:hover .mobile-overlay-indicator {
        opacity: 0.8;
    }

    .responsive-overlay-container:hover img {
        transform: scale(1.05);
    }

    .responsive-overlay-container:hover .responsive-overlay {
        opacity: 1;
    }

    .responsive-overlay-container.overlay-active .responsive-overlay {
        opacity: 1;
    }
}

/* Accessibility improvements */
@media (prefers-reduced-motion: reduce) {

    .responsive-overlay-container img,
    .responsive-overlay,
    .mobile-overlay-indicator {
        transition: none;
    }
}

/* Focus styles for keyboard navigation */
.responsive-overlay-container:focus-visible {
    outline: 2px solid #d4af37;
    outline-offset: 2px;
}

.responsive-overlay-container:focus-visible .responsive-overlay {
    opacity: 1;
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .responsive-overlay {
        background: linear-gradient(to top, rgba(0, 0, 0, 0.9) 0%, transparent 60%, transparent 100%);
    }

    .mobile-overlay-indicator {
        border: 2px solid white;
    }
}

/* Ensure proper stacking context */
.responsive-overlay-container {
    isolation: isolate;
}