////
///
/// Overlay Mixins
/// ===========================================================================
///
/// Mixins for creating overlay elements that cover content with transitions.
/// Useful for hover effects, image captions, and modal backdrops.
///
/// @group Mixins.BodyAtoms.Display
/// @author Scape Agency
/// @link https://scape.style
/// @since 0.3.0
/// @access public
///
////

@use "../../../dev" as *;
@use "../../../variables" as *;

// ============================================================================
// Overlay Mixins
// ============================================================================

/// Base overlay that covers its parent container
/// Initially hidden, appears on interaction
/// @group Overlay
@mixin overlay--base {
    position: relative;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/// Overlay visible state
/// @group Overlay
@mixin overlay--visible {
    opacity: 1;
}

/// Absolute positioned overlay (covers parent completely)
/// @group Overlay
@mixin overlay--absolute {
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100%;
    width: 100%;
    opacity: 0;
    transition: opacity 0.5s ease;
}

/// Fixed overlay (covers viewport, for modals)
/// @group Overlay
@mixin overlay--fixed {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    right: 0;
    height: 100vh;
    width: 100vw;
    opacity: 0;
    transition: opacity 0.5s ease;
    z-index: 9998;
}

/// Dark overlay background
/// @group Overlay
@mixin overlay--dark {
    background-color: rgba(0, 0, 0, 0.5);
}

/// Light overlay background
/// @group Overlay
@mixin overlay--light {
    background-color: rgba(255, 255, 255, 0.5);
}

/// Overlay container (parent element)
/// Sets up relative positioning for child overlay
/// @group Overlay
@mixin overlay__container {
    position: relative;
    overflow: hidden;

    &:hover .overlay,
    &:focus-within .overlay {
        opacity: 1;
    }
}
