/**
 * Showcase Box Widget Styles
 */

.wml-showcase-box-container {
    --wml-showcase-bg: #ffc0cb;
    --wml-showcase-transition: 1s;
    --wml-showcase-hover-speed: 0.2s;
    --wml-showcase-hover-opacity: 0.7;
    --wml-showcase-reveal-size: 85%;
    --wml-showcase-columns: 4;
    width: 100%;
    max-width: 100%;
}

.wml-showcase-box-wrapper {
    display: flex;
    flex-wrap: wrap;
    margin: 0;
    justify-content: flex-start;
    /* Default: left */
}

/* Alignment classes */
.wml-showcase-box-wrapper[style*="justify-content: center"] {
    justify-content: center;
}

.wml-showcase-box-wrapper[style*="justify-content: right"],
.wml-showcase-box-wrapper[style*="justify-content: flex-end"] {
    justify-content: flex-end;
}

.wml-showcase-box {
    display: inline-block;
    width: 160px;
    height: 160px;
    position: relative;
    border: 1px solid currentColor;
    border-style: solid;
    z-index: 0;
    transition: all 0.3s ease;
    opacity: 1;
    margin-right: -1px;
    margin-bottom: -1px;
    text-decoration: none;
    box-sizing: border-box;
}

.wml-showcase-box:hover {
    z-index: 10;
}

/* Pseudo elements for reveal animation */
.wml-showcase-box::before,
.wml-showcase-box::after {
    content: "";
    display: block;
    position: absolute;
    background: var(--wml-showcase-bg);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-iteration-count: 1;
    transform-origin: 50% 50%;
    opacity: 1;
}

.wml-showcase-box::before {
    width: calc(100% + 2px);
    height: 100%;
    z-index: 1;
    transition: height var(--wml-showcase-transition) ease, opacity 0.8s ease;
}

.wml-showcase-box::after {
    height: calc(100% + 2px);
    width: 100%;
    z-index: 1;
    transition: width var(--wml-showcase-transition) ease, opacity 0.8s ease;
}

.wml-showcase-box:hover::before,
.wml-showcase-box:focus::before {
    transition: height var(--wml-showcase-hover-speed) ease, opacity 0.3s ease;
    height: var(--wml-showcase-reveal-size);
    opacity: var(--wml-showcase-hover-opacity);
}

.wml-showcase-box:hover::after,
.wml-showcase-box:focus::after {
    transition: width var(--wml-showcase-hover-speed) ease, opacity 0.3s ease;
    width: var(--wml-showcase-reveal-size);
    opacity: calc(var(--wml-showcase-hover-opacity) + 0.1);
}

/* Image/SVG styling */
.wml-showcase-box__image {
    width: 60%;
    will-change: width;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(1);
    transition: all 0.5s ease;
    z-index: 2;
    max-height: 80%;
    object-fit: contain;
}

/* For SVG elements - ensure they inherit fill color */
.wml-showcase-box__image svg,
svg.wml-showcase-box__image {
    fill: inherit;
}

/* Placeholder styling */
.wml-showcase-box__placeholder {
    width: 60%;
    height: 60%;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    z-index: 2;
}

/* Ensure hover triggers on the container only (fixes dead zones) */
.wml-showcase-box::before,
.wml-showcase-box::after,
.wml-showcase-box__image,
.wml-showcase-box svg,
.wml-showcase-box__placeholder {
    pointer-events: none;
}