.angie-gallery-grid {
    display: grid;
    width: 100%;
}

.angie-gallery-item {
    position: relative;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Initial Overlay Layer (Dedicated DIV) */
.angie-gallery-initial-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Default is transparent unless set individually */
    background-color: transparent; 
    z-index: 1;
    transition: opacity 0.4s ease-in-out;
    opacity: 1; /* Default opacity */
    pointer-events: none; /* Let clicks pass through */
}

/* Hide initial overlay on hover */
.angie-gallery-item:hover .angie-gallery-initial-overlay {
    opacity: 0 !important; /* Force fade out on hover */
}

/* Static Title Styles (Always Visible) */
.angie-gallery-title-static {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 2; /* Increased Z-index to be above initial overlay */
    color: #ffffff;
    text-align: center;
    margin: 0;
    text-transform: uppercase;
    width: 100%;
    pointer-events: none; /* Let clicks pass through to the item */
    transition: opacity 0.3s ease;
}

/* Force hide static title on hover using specificity and !important */
.angie-gallery-item:hover .angie-gallery-title-static,
.angie-overlay-mode-hover .angie-gallery-item:hover .angie-gallery-title-static {
    opacity: 0 !important;
    visibility: hidden;
}

/* Overlay Styles */
.angie-gallery-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%; /* Default width */
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7); /* Fallback default */
    opacity: 0;
    display: flex;
    justify-content: center; /* Horizontally centered */
    align-items: center;    /* Vertically centered (default, overridden by control) */
    text-align: center;
    padding: 20px; /* Fallback default */
    transition: opacity 0.4s ease-in-out;
    z-index: 3; /* Increased Z-index to be above static title */
}

/* Split Overlay Mode: Leaves 35% visible on the right */
.angie-overlay-split-yes .angie-gallery-overlay {
    width: 65%; /* 100% - 35% = 65% width */
}

/* Overlay Behavior: Hover Mode */
.angie-overlay-mode-hover .angie-gallery-item .angie-gallery-overlay {
    opacity: 0;
}

.angie-overlay-mode-hover .angie-gallery-item:hover .angie-gallery-overlay {
    opacity: 1;
}

/* Overlay Behavior: Always Visible Mode */
.angie-overlay-mode-always .angie-gallery-item .angie-gallery-overlay {
    opacity: 1;
}

/* Content Styles */
.angie-gallery-content {
    color: #fff;
    width: 100%;
}

/* Animate content only on hover mode */
.angie-overlay-mode-hover .angie-gallery-content {
    transform: translateY(20px);
    transition: transform 0.4s ease-in-out;
}

.angie-overlay-mode-hover .angie-gallery-item:hover .angie-gallery-content {
    transform: translateY(0);
}

.angie-gallery-title {
    margin: 0 0 10px;
    font-size: 1.5rem;
    font-weight: bold;
    color: #ffffff; /* Fallback default */
    text-transform: uppercase;
}

.angie-gallery-description {
    font-size: 1rem;
    line-height: 1.5;
    color: #f0f0f0; /* Fallback default */
}

/* Responsive Handling */
@media (max-width: 767px) {
    .angie-gallery-grid {
        grid-template-columns: 1fr; /* Default mobile fallback */
    }
}
