/**
 * MetaSlider Lightbox Pro - Public Styles
 * Combined styles for tooltips and share customizations
 */

/* ==========================================================================
   Tooltip Styles
   ========================================================================== */

/* Ensure buttons can contain positioned tooltips */
.lg-toolbar button {
    position: relative;
    border-radius: 0;
}

/* Base tooltip styles */
.lg-tooltip {
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%) translateY(-5px);
    background-color: rgba(0, 0, 0, 0.75);
    color: #ffffff;
    padding: 5px 10px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: 400;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    line-height: 1.4;
    white-space: nowrap;
    pointer-events: none;
    z-index: 999999;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease-in-out, visibility 0.25s ease-in-out, transform 0.25s ease-in-out;
}

/* Show tooltip on hover */
.lg-tooltip.lg-tooltip-show {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%) translateY(0);
}

/* Tooltip arrow pointing up to button */
.lg-tooltip::after {
    content: '';
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-bottom: 5px solid rgba(0, 0, 0, 0.75);
}

/* Responsive adjustments for smaller screens */
@media screen and (max-width: 768px) {
    .lg-tooltip {
        white-space: normal;
        max-width: 120px;
        text-align: center;
    }
}

/* Prevent close button tooltip from overflowing right edge on desktop and iPad */
@media screen and (min-width: 769px) {
    .lg-toolbar .lg-close .lg-tooltip {
        left: -80%;
        transform: translateX(0) translateY(-5px);
    }

    .lg-toolbar .lg-close .lg-tooltip.lg-tooltip-show {
        transform: translateX(0) translateY(0);
    }

    .lg-toolbar .lg-close .lg-tooltip::after {
        left: 75%;
        transform: translateX(-50%);
    }
}

/* Ensure tooltips work with all button types */
.lg-toolbar .lg-icon {
    position: relative;
}

/* Prevent tooltip from blocking clicks */
.lg-tooltip * {
    pointer-events: none;
}

/* Hide buttons when not in use */
.lg-single-item .lg-autoplay-button {
    display: none;
}

/* Hide actual size button when image is already at actual size */
.lg-hide-actual-size {
    display: none !important;
}

/* ==========================================================================
   Share Plugin Customizations
   ========================================================================== */

/* Base styling for all share dropdown icons */
.lg-toolbar .lg-share .lg-dropdown .lg-icon {
    background-color: transparent !important;
    background-repeat: no-repeat !important;
    background-position: center !important;
    width: 20px;
    height: 20px;
    padding: 12px;
    border-radius: 100%;
}

/* Hide default icon fonts */
.lg-outer .lg-share-facebook .lg-icon::after,
.lg-outer .lg-share-twitter .lg-icon::after,
.lg-outer .lg-share-pinterest .lg-icon::after {
    content: none !important;
}

/* Social platform SVG icons */
.lg-outer .lg-share-facebook .lg-icon {
    background-image: url('../images/facebook.svg') !important;
    background-size: 20px !important;
}

.lg-outer .lg-share-twitter .lg-icon {
    background-image: url('../images/twitter-x.svg') !important;
    background-size: 15px !important;
    
}
.lg-toolbar .lg-share .lg-dropdown .lg-share-twitter .lg-icon {
    background-color: #000000 !important;
}

.lg-outer .lg-share-pinterest .lg-icon {
    background-image: url('../images/pinterest.svg') !important;
    background-size: 20px !important;
}

.lg-outer .lg-share-linkedin .lg-icon::after,
.lg-outer .lg-share-email .lg-icon::after,
.lg-outer .lg-share-copylink .lg-icon::after {
    content: none !important;
}

.lg-outer .lg-share-linkedin .lg-icon {
    background-image: url('../images/linkedin.svg') !important;
    background-size: 20px !important;
}

.lg-outer .lg-share-email .lg-icon {
    background-image: url('../images/email.svg') !important;
    background-size: 18px !important;
}

.lg-outer .lg-share-copylink .lg-icon {
    background-image: url('../images/copylink.svg') !important;
    background-size: 18px !important;
}

/* ==========================================================================
   Pager Plugin Customizations
   ========================================================================== */

.lg-outer .lg-pager-cont:hover .lg-pager-thumb-cont {
    opacity: 0 !important;
}

/* ==========================================================================
   Z-Index Override
   ========================================================================== */

.lg-outer,
.lg-backdrop {
    z-index: 100001 !important;
}

/* Image protection: block mobile long-press "Save Image", selection, and drag.
   pointer-events intentionally left intact so click-to-open and lightbox
   gestures keep working. */
.ml-gallery-container[data-lg-protect="1"] img,
.ml-gallery-container[data-lg-protect="1"] .ml-image-overlay,
.lg-container.ml-lg-protected .lg-image,
.lg-container.ml-lg-protected img {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-user-drag: none;
    user-drag: none;
}

/* Multi-size download menu. Styled like lg-share.css's dropdown but not reusing
   .lg-dropdown, whose visibility is tied to .lg-outer.lg-dropdown-active — sharing
   that state would open the Share dropdown too. */
.lg-container.ml-lg-download-sizes .ml-lg-download-menu {
    position: absolute;
    z-index: 1085;
    margin: 6px 0 0;
    padding: 6px 0;
    min-width: 180px;
    list-style: none;
    background-color: #fff;
    border-radius: 4px;
    box-shadow: 0 2px 8px rgba( 0, 0, 0, 0.35 );
    text-align: left;
}

.lg-container.ml-lg-download-sizes .ml-lg-download-menu li {
    margin: 0;
    padding: 0;
}

.lg-container.ml-lg-download-sizes .ml-lg-download-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 7px 14px;
    color: #333;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    white-space: nowrap;
}

.lg-container.ml-lg-download-sizes .ml-lg-download-option:hover,
.lg-container.ml-lg-download-sizes .ml-lg-download-option:focus {
    background-color: #f2f2f2;
    color: #000;
    outline: none;
}

.lg-container.ml-lg-download-sizes .ml-lg-download-option-dims {
    margin-left: auto;
    color: #767676;
    font-size: 11px;
    font-variant-numeric: tabular-nums;
}

.lg-container.ml-lg-download-sizes .ml-lg-download-option:focus-visible {
    background-color: #f2f2f2;
    outline: 2px solid #0073aa;
    outline-offset: -2px;
}

/* Lightbox like button */
.lg-container.ml-lg-likes .ml-lg-like {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 0 10px;
    background: none;
    border: 0;
    cursor: pointer;
    color: #999;
    transition: color .2s ease;
}

.lg-container.ml-lg-likes .ml-lg-like:hover,
.lg-container.ml-lg-likes .ml-lg-like:focus {
    color: #fff;
}

.lg-container.ml-lg-likes .ml-lg-like-icon {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
}

.lg-container.ml-lg-likes .ml-lg-like.ml-lg-liked {
    color: #e0245e;
}

.lg-container.ml-lg-likes .ml-lg-like.ml-lg-liked .ml-lg-like-icon {
    fill: currentColor;
}

.lg-container.ml-lg-likes .ml-lg-like-count {
    font-size: 13px;
    font-variant-numeric: tabular-nums;
    line-height: 1;
}

/* Photo metadata, under the lightbox caption. */
.ml-lg-photo-meta {
    margin-top: 6px;
    padding-top: 6px;
    border-top: 1px solid rgba(128, 128, 128, 0.35);
    font-size: 0.85em;
    line-height: 1.4;
    opacity: 0.8;
}

/* The same line on a thumbnail. No rule to separate it from the caption: a tile
   is small, and the caption overlay already sits on a gradient. */
.ml-thumb-photo-meta {
    display: block;
    margin-top: 2px;
    font-size: 0.85em;
    line-height: 1.3;
    opacity: 0.8;
}

/* ==========================================================================
   Before & After layout
   ========================================================================== */

/* No overflow:hidden here: it would clip the frame's Image Styles box-shadow. */
.ml-gallery-container.ml-layout-before-after {
    --ml-compare-pos: 50%;
    position: relative;
    direction: ltr;
    user-select: none;
    -webkit-user-select: none;
}

/* Only once the script has built a comparison is there anything to drag. */
.ml-gallery-container.ml-layout-before-after.is-comparing {
    touch-action: pan-y;
    cursor: ew-resize;
}

.ml-gallery-container.ml-layout-before-after.is-comparing[data-ml-compare-orientation="vertical"] {
    touch-action: pan-x;
    cursor: ns-resize;
}

.ml-layout-before-after > a {
    display: block;
}

/* Editor preview only: the attribute is emitted for REST renders. */
.ml-layout-before-after[data-ml-compare-empty]:not(:has(> a))::before {
    content: attr(data-ml-compare-empty);
    display: flex;
    align-items: center;
    justify-content: center;
    height: var(--ml-row-height, 220px);
    border: 1px dashed #c3c4c7;
    border-radius: 4px;
    background: #f6f7f7;
    color: #646970;
    font: 14px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

/* The gallery's Height setting sizes the comparison, as it sizes a Grid row. */
.ml-layout-before-after > a:nth-of-type(1) {
    height: var(--ml-row-height, 220px);
}

/* After sits exactly over Before; its frame shadow would double Before's. */
.ml-layout-before-after > a:nth-of-type(2) {
    position: absolute;
    inset: 0;
    box-shadow: none !important;
}

/* Rotate and flip would turn the clip, and so the divider, with the image. */
.ml-layout-before-after > a img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transform: none !important;
}

/* Each image shows only its own side, so a translucent one never shows the other through. */
.ml-layout-before-after > a:nth-of-type(1):not(:last-of-type) img {
    clip-path: inset(0 calc(100% - var(--ml-compare-pos)) 0 0);
}

.ml-layout-before-after > a:nth-of-type(2) img {
    clip-path: inset(0 0 0 var(--ml-compare-pos));
}

.ml-layout-before-after[data-ml-compare-orientation="vertical"] > a:nth-of-type(1):not(:last-of-type) img {
    clip-path: inset(0 0 calc(100% - var(--ml-compare-pos)) 0);
}

.ml-layout-before-after[data-ml-compare-orientation="vertical"] > a:nth-of-type(2) img {
    clip-path: inset(var(--ml-compare-pos) 0 0 0);
}

.ml-compare-divider {
    position: absolute;
    top: 0;
    bottom: 0;
    left: var(--ml-compare-pos);
    width: 2px;
    margin-left: -1px;
    background: #fff;
    box-shadow: 0 0 4px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

.ml-layout-before-after[data-ml-compare-orientation="vertical"] .ml-compare-divider {
    top: var(--ml-compare-pos);
    right: 0;
    bottom: auto;
    left: 0;
    width: auto;
    height: 2px;
    margin: -1px 0 0;
}

.ml-compare-handle {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 40px;
    height: 40px;
    margin: -20px 0 0 -20px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.35);
    box-shadow: 0 0 6px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
}

/* Two chevrons pointing along the drag axis. */
.ml-compare-handle::before,
.ml-compare-handle::after {
    content: "";
    position: absolute;
    top: 50%;
    width: 7px;
    height: 7px;
    margin-top: -4px;
    border: solid #fff;
    border-width: 0 0 2px 2px;
}

.ml-compare-handle::before {
    left: 9px;
    transform: rotate(45deg);
}

.ml-compare-handle::after {
    right: 9px;
    transform: rotate(-135deg);
}

.ml-layout-before-after[data-ml-compare-orientation="vertical"] .ml-compare-handle {
    transform: rotate(90deg);
}

.ml-compare-range:focus-visible + .ml-compare-divider .ml-compare-handle {
    outline: 2px solid #fff;
    outline-offset: 3px;
}

/* Visually hidden, still focusable: keyboard and screen-reader control. */
.ml-compare-range {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    border: 0;
    white-space: nowrap;
}

.ml-compare-label {
    position: absolute;
    top: 12px;
    padding: 4px 10px;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    font-size: 13px;
    line-height: 1.4;
    pointer-events: none;
}

.ml-compare-label--before {
    left: 12px;
}

.ml-compare-label--after {
    right: 12px;
}

.ml-layout-before-after[data-ml-compare-orientation="vertical"] .ml-compare-label--after {
    top: auto;
    right: auto;
    bottom: 12px;
    left: 12px;
}

.ml-compare-fullscreen {
    position: absolute;
    right: 12px;
    bottom: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 3px;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    cursor: pointer;
}

.ml-compare-fullscreen:hover,
.ml-compare-fullscreen:focus-visible {
    background: rgba(0, 0, 0, 0.8);
}

.ml-compare-fullscreen:focus-visible {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Fullscreen: fit both images to the screen. Kept as separate rules — one unknown
   pseudo-class in a selector list drops the whole rule. */
.ml-layout-before-after:fullscreen {
    width: 100vw;
    height: 100vh;
    margin: 0;
    background: #000;
}

.ml-layout-before-after:-webkit-full-screen {
    width: 100vw;
    height: 100vh;
    margin: 0;
    background: #000;
}

.ml-layout-before-after:fullscreen > a:nth-of-type(1) {
    position: absolute;
    inset: 0;
    height: auto;
}

.ml-layout-before-after:-webkit-full-screen > a:nth-of-type(1) {
    position: absolute;
    inset: 0;
    height: auto;
}

.ml-layout-before-after:fullscreen > a img {
    height: 100%;
    object-fit: contain;
}

.ml-layout-before-after:-webkit-full-screen > a img {
    height: 100%;
    object-fit: contain;
}

/* Watermark. Positioned in JS against the measured image box; starts hidden so
   it never flashes at 0,0 before the first measure lands. */
.ml-lg-watermark {
    position: absolute;
    visibility: hidden;
    z-index: 20;
    pointer-events: none;
    max-width: 100%;
    height: auto;
}

/* Zoom transforms the image out from under a measured position, so step aside
   rather than drift. lg-zoom puts this class on .lg-outer. */
.lg-outer.lg-zoomed .ml-lg-watermark {
    display: none;
}
