/*
Welcome to Custom CSS!

To learn how this works, see http://wp.me/PEmnE-Bt
*/.wp-block-gallery.has-nested-images figure.wp-block-image figcaption {
    position: relative !important;
    bottom: auto !important;
    background: none !important;
    text-shadow: none !important;
    box-shadow: none !important;
    color: inherit !important;
    font-family: inherit !important;
    font-size: inherit !important;
    padding: 8px 0 !important;
    text-align: center !important;
}/* 1. KEEP CORE LIGHTBOX BACKDROP SOLID BLACK */
.pswp__bg {
    background: #000000 !important;
    background-color: #000000 !important;
    opacity: 1 !important;
}

/* 2. ZAP ALL CAPTION BACKGROUND BARS, BORDERS, AND SHADOWS */
.pswp__custom-caption,
.pswp__dynamic-caption,
.pswp__dynamic-caption--below,
.pswp__dynamic-caption--mobile,
.pswp__dynamic-caption--aside {
    background: transparent !important;
    background-color: transparent !important;
    border: none !important;
    box-shadow: none !important;
    text-shadow: none !important;
}

/* 3. CRUSH THE NATIVE GRADIENT OVERLAYS AND BLACK BARS COMPLETELY */
.pswp__caption::before,
.pswp__caption:before,
.pswp__ui__caption-shadow,
.pswp__ui__caption-shadow::before,
.pswp__ui__caption-shadow::after {
    display: none !important;
    background: none !important;
    background-image: none !important;
    box-shadow: none !important;
    opacity: 0 !important;
    visibility: hidden !important;
}

/* 4. ANCHOR BARE TEXT FLAT IN THE BOTTOM RIGHT HAND CORNER AREA */
.pswp__custom-caption,
.pswp__dynamic-caption {
    position: fixed !important; 
    bottom: 30px !important;   
    right: 20px !important;    /* Decreased to pull the text closer to the right screen edge */
    left: auto !important;
    top: auto !important;
    width: 300px !important;   
    height: auto !important;
    margin: 0 !important;
    display: block !important;
    transform: none !important;
    z-index: 9999 !important;
}

/* 5. STYLE RAW WHITE LETTERS JUSTIFIED TO THE RIGHT HAND SIDE */
.pswp__custom-caption,
.pswp__dynamic-caption,
.pswp__dynamic-caption--aside,
.pswp__caption__center {
    color: #ffffff !important; 
    font-size: 15px !important;
    line-height: 1.5 !important;
    text-align: right !important; 
    padding: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}/* 5. STYLE RAW LETTERS WITH AUTOMATIC COLOR INVERSION */
.pswp__custom-caption,
.pswp__dynamic-caption,
.pswp__dynamic-caption--aside,
.pswp__caption__center {
    color: #ffffff !important; /* Base color is white */
    mix-blend-mode: difference !important; /* Magic rule: Flips text black over white backgrounds */
    font-size: 15px !important;
    line-height: 1.5 !important;
    text-align: right !important; 
    padding: 0 !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
}/* 4. ANCHOR BARE TEXT FLAT IN THE BOTTOM RIGHT HAND CORNER AREA */
.pswp__custom-caption,
.pswp__dynamic-caption {
    position: fixed !important; 
    bottom: 30px !important;   
    right: 20px !important;    
    left: auto !important;
    top: auto !important;
    width: 280px !important; /* Slightly narrower to give images extra breathing room */  
    max-height: 120px !important; /* Prevents long text from growing upwards into the image */
    overflow-y: auto !important;  /* Adds an automatic scrollbar ONLY if text is too long */
    margin: 0 !important;
    display: block !important;
    transform: none !important;
    z-index: 9999 !important;
}

/* 5. STYLE RAW WHITE LETTERS WITH SMOOTH HIGH-CONTRAST EDGE RENDERING */
.pswp__custom-caption,
.pswp__dynamic-caption,
.pswp__dynamic-caption--aside,
.pswp__caption__center {
    color: #ffffff !important; 
    font-size: 14px !important; /* Dropped slightly to help long sentences fit cleanly */
    line-height: 1.4 !important;
    text-align: right !important; 
    padding: 0 5px 0 0 !important; /* Tiny padding adjustment on the right edge */
    max-width: 100% !important;
    box-sizing: border-box !important;
    mix-blend-mode: normal !important; 

    /* Smooth, anti-aliased high-contrast text edge protection */
    text-shadow: 
        0 0 2px rgba(0, 0, 0, 1), 
        0 0 4px rgba(0, 0, 0, 0.9), 
        0 1px 2px rgba(0, 0, 0, 0.8) !important;
}

/* 5b. OPTIONAL: Hide the browser scrollbar track for long text to keep it looking clean */
.pswp__custom-caption::-webkit-scrollbar,
.pswp__dynamic-caption::-webkit-scrollbar {
    width: 4px;
}
.pswp__custom-caption::-webkit-scrollbar-thumb,
.pswp__dynamic-caption::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, 0.3);
    border-radius: 10px;
}
