/* ===========================================================
   BrokenPinea Media
   Version 1.3 cleanup
   =========================================================== */


/* ===========================================================
   VIDEO
   =========================================================== */

video.brokenpinea-media-player {
    display: block !important;
    width: min(360px, 100%) !important;
    max-width: 360px !important;
    height: auto !important;
    max-height: 560px;
    object-fit: contain;
    margin: 10px 0;
    border-radius: 10px;
    background: #000;
}


/* ===========================================================
   AUDIO
   =========================================================== */

audio.brokenpinea-media-player {
    display: block;
    width: min(480px, 100%) !important;
    margin: 10px 0;
    background: transparent;
}


/* ===========================================================
   IMAGES INSIDE POSTS
   =========================================================== */

.postbody img.postimage,
.postbody .attachbox img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(360px, 100%);
    max-height: 560px;
    object-fit: contain;
    margin: 10px 0;
    border-radius: 10px;
    cursor: zoom-in;
}


/* ===========================================================
   MULTIPLE-IMAGE GRID
   =========================================================== */

.brokenpinea-image-grid {
    display: grid;
    gap: 8px;
    width: min(740px, 100%);
    margin: 10px 0;
}

.brokenpinea-grid-two {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.brokenpinea-grid-three {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.brokenpinea-grid-three
.brokenpinea-grid-item:first-child {
    grid-row: span 2;
}

.brokenpinea-grid-four-plus {
    grid-template-columns:
        repeat(2, minmax(0, 1fr));
}

.brokenpinea-grid-item {
    box-sizing: border-box;
    min-width: 0;
    margin: 0 !important;
    overflow: hidden;
    border-radius: 10px;
}

.brokenpinea-image-grid
.brokenpinea-grid-item img.postimage,

.brokenpinea-image-grid
.brokenpinea-grid-item .attachbox img {
    display: block !important;

    width: 100% !important;
    max-width: 100% !important;

    height: 260px !important;
    max-height: 260px !important;

    margin: 0 !important;

    object-fit: cover !important;

    border-radius: 10px;

    cursor: zoom-in;
}


/* ===========================================================
   LIGHTBOX
   =========================================================== */

.brokenpinea-lightbox {
    position: fixed;
    inset: 0;

    z-index: 99999;

    display: none;
    align-items: center;
    justify-content: center;

    padding: 24px;

    background: rgba(0, 0, 0, 0.94);
}

.brokenpinea-lightbox.is-open {
    display: flex;
}


/* ===========================================================
   EXPANDED IMAGE
   =========================================================== */

.brokenpinea-lightbox-image {
    display: block;

    width: auto;
    height: auto;

    max-width: 95vw;
    max-height: 92vh;

    object-fit: contain;

    border-radius: 8px;

    user-select: none;

    transition: transform 0.15s ease;

    transform-origin: center center;
}

.brokenpinea-lightbox-image.is-zoomed {
    cursor: zoom-out;
}


/* ===========================================================
   CLOSE BUTTON
   =========================================================== */

.brokenpinea-lightbox-close {
    position: fixed;

    top: 14px;
    right: 18px;

    z-index: 100002;

    padding: 4px 10px;

    border: 0;

    background: transparent;

    color: #fff;

    font-size: 44px;
    line-height: 1;

    cursor: pointer;
}


/* ===========================================================
   PREVIOUS / NEXT
   =========================================================== */

.brokenpinea-gallery-button {
    position: fixed;

    top: 50%;

    z-index: 100001;

    width: 54px;
    height: 70px;

    margin-top: -35px;

    border: 0;
    border-radius: 8px;

    background: rgba(0, 0, 0, 0.45);

    color: #fff;

    font-size: 42px;
    line-height: 1;

    cursor: pointer;
}

.brokenpinea-gallery-previous {
    left: 18px;
}

.brokenpinea-gallery-next {
    right: 18px;
}

.brokenpinea-gallery-button:hover {
    background: rgba(0, 0, 0, 0.75);
}

.brokenpinea-gallery-button:disabled {
    display: none;
}


/* ===========================================================
   IMAGE COUNTER
   =========================================================== */

.brokenpinea-gallery-counter {
    position: fixed;

    bottom: 16px;
    left: 50%;

    z-index: 100001;

    transform: translateX(-50%);

    padding: 7px 12px;

    border-radius: 20px;

    background: rgba(0, 0, 0, 0.65);

    color: #fff;

    font-size: 14px;
}


/* ===========================================================
   ZOOM CONTROLS
   =========================================================== */

.brokenpinea-zoom-controls {
    position: fixed;

    left: 50%;
    top: 16px;

    z-index: 100003;

    display: flex;
    align-items: center;

    gap: 5px;

    transform: translateX(-50%);

    padding: 5px;

    border-radius: 10px;

    background: rgba(0, 0, 0, 0.65);
}

.brokenpinea-zoom-button {
    width: 36px;
    height: 36px;

    padding: 0;

    border: 0;
    border-radius: 7px;

    background: rgba(255, 255, 255, 0.12);

    color: #fff;

    font-size: 22px;
    line-height: 36px;

    cursor: pointer;
}

.brokenpinea-zoom-button:hover {
    background: rgba(255, 255, 255, 0.25);
}

.brokenpinea-zoom-level {
    min-width: 55px;

    padding: 0 5px;

    color: #fff;

    font-size: 13px;
    font-weight: 600;

    text-align: center;
}


/* ===========================================================
   VIDEO COMPATIBILITY MESSAGE
   =========================================================== */

.brokenpinea-media-error {
    box-sizing: border-box;

    width: min(360px, 100%);

    margin: 8px 0 12px;

    padding: 12px 14px;

    border-radius: 8px;

    background: rgba(0, 0, 0, 0.06);

    line-height: 1.5;
}

.brokenpinea-media-download {
    display: inline-block;

    margin-top: 6px;

    font-weight: 600;
}


/* ===========================================================
   MOBILE
   =========================================================== */

@media (max-width: 700px) {

    video.brokenpinea-media-player {
        width: 100% !important;
        max-width: 100% !important;

        max-height: none;
    }

    audio.brokenpinea-media-player {
        width: 100% !important;
    }

    .postbody img.postimage,
    .postbody .attachbox img {
        max-width: 100%;
        max-height: none;
    }

    .brokenpinea-image-grid {
        width: 100%;

        gap: 5px;
    }

    .brokenpinea-image-grid
    .brokenpinea-grid-item img.postimage,

    .brokenpinea-image-grid
    .brokenpinea-grid-item .attachbox img {
        height: 180px !important;
        max-height: 180px !important;
    }

    .brokenpinea-lightbox {
        padding: 8px;
    }

    .brokenpinea-gallery-button {
        width: 42px;
        height: 58px;

        font-size: 34px;

        background: rgba(0, 0, 0, 0.35);
    }

    .brokenpinea-gallery-previous {
        left: 5px;
    }

    .brokenpinea-gallery-next {
        right: 5px;
    }

    .brokenpinea-zoom-controls {
        top: auto;
        bottom: 55px;
    }

    .brokenpinea-media-error {
        width: 100%;
    }
}
/* =========================================================
   CRUSHI - NOTIFICATIONS MUST STAY ABOVE EVERYTHING
   ========================================================= */

#page-header {
	position: relative !important;
	z-index: 2147483640 !important;
}

#notification_list,
#notification_list.dropdown,
#notification_list.dropdown-extended {
	position: absolute !important;
	z-index: 2147483647 !important;
}

#notification_list .dropdown-contents,
#notification_list .header,
#notification_list .footer,
#notification_list ul,
#notification_list li {
	position: relative;
	z-index: 2147483647 !important;
}

/* Parent container that holds the Notifications button/dropdown */
.dropdown-container:has(#notification_list) {
	position: relative !important;
	z-index: 2147483647 !important;
}
/*
 * ==========================================================
 * CRUSHI NATIVE VIDEO ATTACHMENT SIZE
 * ==========================================================
 *
 * Keeps old/phpBB attachment videos compact on desktop.
 * Bunny Stream videos are NOT affected by this.
 */

video.brokenpinea-media-player {
    display: block !important;

    width: auto !important;
    height: auto !important;

    max-width: min(100%, 420px) !important;
    max-height: 420px !important;

    object-fit: contain !important;

    margin: 10px 0 !important;

    border-radius: 10px !important;

    background: #000 !important;
}


/*
 * ==========================================================
 * MOBILE
 * ==========================================================
 *
 * Let videos use the available phone width.
 */

@media (max-width: 700px) {

    video.brokenpinea-media-player {
        width: 100% !important;
        height: auto !important;

        max-width: 100% !important;
        max-height: none !important;
    }
}