/* Politics.be image viewer */

/* Afbeeldingen uit [IMG] responsive maken */
.pbe-post-image {
    width: auto !important;
    max-width: 400px !important;
    height: auto !important;
}

@media screen and (max-width: 700px) {
    .pbe-post-image {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
    }
}

.pbe-attachment-image {
    width: 180px !important;
    height: 120px !important;
    object-fit: contain;
    cursor: zoom-in;
    vertical-align: middle;
}

@media screen and (max-width: 700px) {
    .pbe-attachment-image {
        width: calc(50vw - 20px) !important;
        max-width: 180px !important;
        height: 110px !important;
    }
}

/* Alleen visueel aangeven dat een losse IMG geopend kan worden.
   JS verwijdert dit gedrag niet van afbeeldingen binnen een link. */
.pbe-post-image.pbe-viewable {
    cursor: zoom-in;
}


/* Fullscreen viewer */
#pbe-imageviewer {
    display: none;
    position: fixed;
    z-index: 999999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;

    background: rgba(0, 0, 0, 0.94);

    overflow: hidden;

    -webkit-user-select: none;
    user-select: none;

    -webkit-tap-highlight-color: transparent;
}

#pbe-imageviewer.pbe-open {
    display: block;
}


/* Zone waarin de afbeelding staat */
#pbe-imageviewer-stage {
    position: absolute;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;

    overflow: hidden;

    display: flex;
    align-items: center;
    justify-content: center;

    touch-action: none;
}


/* Het grote beeld */
#pbe-imageviewer-image {
    display: block;

    max-width: none;
    max-height: none;

    width: auto;
    height: auto;

    transform-origin: center center;

    will-change: transform;

    -webkit-user-drag: none;
    user-drag: none;

    cursor: grab;
}

#pbe-imageviewer-image.pbe-dragging {
    cursor: grabbing;
}


/* Sluitknop */
#pbe-imageviewer-close {
    position: absolute;
    z-index: 10;

    right: 12px;
    top: 8px;

    width: 46px;
    height: 46px;

    border: 0;
    background: rgba(0, 0, 0, 0.55);

    color: #fff;

    font-family: Arial, sans-serif;
    font-size: 34px;
    line-height: 42px;

    text-align: center;

    cursor: pointer;

    border-radius: 4px;
}


/* Kleine zoom-indicatie */
#pbe-imageviewer-zoom {
    position: absolute;
    z-index: 10;

    left: 12px;
    bottom: 12px;

    padding: 5px 9px;

    background: rgba(0, 0, 0, 0.55);
    color: #fff;

    font-family: Arial, sans-serif;
    font-size: 12px;

    border-radius: 3px;

    pointer-events: none;
}


/* Mobiel */
@media screen and (max-width: 700px) {

    #pbe-imageviewer-close {
        right: 6px;
        top: 6px;
    }
}

/*
 * Oude vBulletin pollbars zijn 1x10 px GIFs die via het HTML width-attribuut
 * horizontaal worden uitgerekt. height:auto mag hier niet toegepast worden,
 * anders worden ze op mobiel verticaal uitgerekt.
 */
img[src*="/images/polls/bar"] {
    height: 10px !important;
}
