/* Plyr dark theme, matching this page's dark background */
:root {
    --plyr-color-main: #b69d74;
    --plyr-video-background: #000;
    --plyr-menu-background: #1e1e1e;
    --plyr-menu-color: #eaeaea;
    --plyr-tooltip-background: #1e1e1e;
    --plyr-tooltip-color: #eaeaea;
    --plyr-control-icon-size: 18px;
}

/* Post media gallery grid */
.media-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 14px;
    margin: 25px 0;
}

@media (max-width: 600px) {
    .media-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 8px;
    }
}

.media-gallery-item {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 10px;
    overflow: hidden;
    cursor: pointer;
    background: #111;
    aspect-ratio: 4 / 3;
}

.media-gallery-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .35s ease;
}

.media-gallery-item:hover img {
    transform: scale(1.05);
}

.media-gallery-play {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 26px;
    background: rgba(0, 0, 0, .3);
}

.media-gallery-caption {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 8px 10px;
    font-size: 12px;
    color: #fff;
    background: linear-gradient(transparent, rgba(0, 0, 0, .75));
    text-align: right;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* Inline video block (rendered outside the lightbox, in article body) */
.media-video-block {
    margin-bottom: 25px;
}

.media-video-block video {
    width: 100%;
    border-radius: 10px;
}

.media-caption {
    font-size: 13px;
    color: #8a8a8a;
    margin-top: 6px;
    text-align: center;
}

/* PhotoSwipe custom UI additions */
.pswp-video-wrapper {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #000;
}

.pswp-video-wrapper video,
.pswp-video-wrapper .plyr {
    width: 100%;
    max-height: 80vh;
}

.pswp__custom-caption {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 62px;
    text-align: center;
    color: #fff;
    font-family: 'estedad-light', var(--font-family-base);
    font-size: 14px;
    padding: 0 20px;
    z-index: 100000;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .6);
}

.pswp__custom-counter {
    color: #fff;
    font-size: 13px;
    align-self: center;
    padding: 0 10px;
    opacity: .85;
}

/* Frosted-glass strip behind the top-corner title/likes, so they stay
   readable regardless of what's in the photo underneath. */
.pswp__custom-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 90px;
    z-index: 99999;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .55), transparent);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    -webkit-mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
    mask-image: linear-gradient(to bottom, black 0%, black 55%, transparent 100%);
    pointer-events: none;
}

.pswp__custom-title {
    position: fixed;
    top: 16px;
    right: 16px;
    z-index: 100000;
    max-width: 60vw;
    color: #fff;
    font-family: 'estedad-lightbold', var(--font-family-base);
    font-size: 15px;
    text-align: right;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.pswp__custom-likes {
    position: fixed;
    left: 16px;
    top: 16px;
    z-index: 100000;
    display: flex;
    align-items: center;
    gap: 6px;
    border: 0;
    background: transparent;
    padding: 6px 8px;
    border-radius: 20px;
    cursor: pointer;
    color: #fff;
    font-size: 14px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, .7);
    transition: background-color .15s ease;
}

.pswp__custom-likes:hover {
    background: rgba(255, 255, 255, .12);
}

.pswp__custom-likes i {
    color: #fff;
    font-size: 16px;
}

.pswp__custom-likes i.bi-heart-fill {
    color: #e0475c;
}

.pswp__thumbnails-strip {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    gap: 6px;
    justify-content: center;
    padding: 8px;
    overflow-x: auto;
    background: rgba(0, 0, 0, .55);
    z-index: 100000;
}

.pswp__thumbnails-strip img {
    width: 52px;
    height: 38px;
    object-fit: cover;
    border-radius: 4px;
    opacity: .55;
    cursor: pointer;
    border: 2px solid transparent;
    transition: opacity .2s, border-color .2s;
}

.pswp__thumbnails-strip img:hover {
    opacity: .85;
}

.pswp__thumbnails-strip img.is-active {
    opacity: 1;
    border-color: #fff;
}
