/* ------------------------------------------------------------------
   Maison Bleue — visionneuse de fichiers (lightbox autonome)
   Aucune dependance : ni jQuery, ni Bootstrap, ni magnific-popup.
   Les icones utilisent Font Awesome 4, deja charge par head.php.
   ------------------------------------------------------------------ */

.mblb-root {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 20000;
    background: #14161a;
    background: rgba(16, 18, 22, .97);
    display: none;
    font-family: "Helvetica Neue", Helvetica, Arial, sans-serif;
    color: #f2f4f7;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    opacity: 0;
    transition: opacity .12s linear;
}

.mblb-root.mblb-visible {
    display: block;
    opacity: 1;
}

.mblb-lock {
    overflow: hidden !important;
}

/* ---------------- barre d'outils ---------------- */

.mblb-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 52px;
    display: flex;
    align-items: center;
    padding: 0 8px;
    background: rgba(10, 11, 14, .86);
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    z-index: 6;
}

.mblb-title {
    flex: 1 1 auto;
    min-width: 0;
    padding: 0 6px 0 10px;
    line-height: 1.2;
}

.mblb-name {
    display: block;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.mblb-sub {
    display: block;
    font-size: 11px;
    color: #9aa3b0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-top: 2px;
}

.mblb-tools {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 2px;
}

.mblb-btn {
    -webkit-appearance: none;
    appearance: none;
    border: 0;
    background: transparent;
    color: #e8ebf0;
    width: 40px;
    height: 40px;
    border-radius: 6px;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .12s linear, color .12s linear;
    padding: 0;
}

.mblb-btn:hover,
.mblb-btn:focus {
    background: rgba(255, 255, 255, .12);
    color: #fff;
    outline: none;
}

.mblb-btn:active {
    background: rgba(255, 255, 255, .2);
}

.mblb-btn[disabled] {
    opacity: .28;
    cursor: default;
    background: transparent;
}

.mblb-btn.mblb-on {
    background: #2f7de1;
    color: #fff;
}

.mblb-btn.mblb-close {
    font-size: 22px;
    margin-left: 6px;
}

.mblb-sep {
    width: 1px;
    height: 24px;
    background: rgba(255, 255, 255, .12);
    margin: 0 6px;
}

.mblb-zoomval {
    font-size: 12px;
    color: #c3cad4;
    min-width: 46px;
    text-align: center;
    font-variant-numeric: tabular-nums;
}

/* ---------------- scene ---------------- */

.mblb-stage {
    position: absolute;
    top: 52px;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: hidden;
    touch-action: none;
}

.mblb-stage.mblb-grab {
    cursor: grab;
    cursor: -webkit-grab;
}

.mblb-stage.mblb-grabbing {
    cursor: grabbing;
    cursor: -webkit-grabbing;
}

.mblb-stage.mblb-crosshair {
    cursor: crosshair;
}

.mblb-img {
    position: absolute;
    top: 0;
    left: 0;
    transform-origin: 50% 50%;
    will-change: transform;
    -webkit-user-drag: none;
    user-drag: none;
    pointer-events: none;
    max-width: none;
    max-height: none;
}

/* ---------------- navigation ---------------- */

.mblb-nav {
    position: absolute;
    top: 50%;
    margin-top: -32px;
    width: 56px;
    height: 64px;
    border: 0;
    border-radius: 8px;
    background: rgba(10, 11, 14, .55);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background .12s linear;
}

.mblb-nav:hover {
    background: rgba(47, 125, 225, .9);
}

.mblb-prev {
    left: 10px;
}

.mblb-next {
    right: 10px;
}

.mblb-nav[hidden] {
    display: none;
}

/* ---------------- etats ---------------- */

.mblb-spinner {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 42px;
    height: 42px;
    margin: -21px 0 0 -21px;
    border: 3px solid rgba(255, 255, 255, .18);
    border-top-color: #4a9bff;
    border-radius: 50%;
    animation: mblb-spin .7s linear infinite;
    z-index: 4;
}

.mblb-spinner[hidden] {
    display: none;
}

@keyframes mblb-spin {
    to {
        transform: rotate(360deg);
    }
}

.mblb-card {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 90%;
    max-width: 420px;
    background: #1d2129;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 10px;
    padding: 28px 24px;
    text-align: center;
    z-index: 4;
}

.mblb-card i.mblb-card-icon {
    font-size: 52px;
    color: #6d7787;
    display: block;
    margin-bottom: 14px;
}

.mblb-card-name {
    font-size: 14px;
    font-weight: 600;
    word-break: break-all;
    margin-bottom: 4px;
}

.mblb-card-note {
    font-size: 12px;
    color: #9aa3b0;
    margin-bottom: 18px;
}

.mblb-card-actions {
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.mblb-action {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    border: 0;
    border-radius: 6px;
    padding: 10px 18px;
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    background: rgba(255, 255, 255, .1);
    color: #e8ebf0;
}

.mblb-action:hover,
.mblb-action:focus {
    background: rgba(255, 255, 255, .18);
    color: #fff;
    text-decoration: none;
}

.mblb-action.mblb-primary {
    background: #2f7de1;
    color: #fff;
}

.mblb-action.mblb-primary:hover {
    background: #4a90ea;
    color: #fff;
}

.mblb-action.mblb-danger {
    background: rgba(255, 255, 255, .1);
    color: #ffb3b3;
}

/* ---------------- recadrage ---------------- */

.mblb-cropmask {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 3;
    display: none;
}

.mblb-cropping .mblb-cropmask {
    display: block;
}

.mblb-shade {
    position: absolute;
    background: rgba(8, 9, 12, .62);
}

.mblb-cropbox {
    position: absolute;
    border: 1px solid #fff;
    box-shadow: 0 0 0 1px rgba(0, 0, 0, .45);
}

.mblb-cropbox::before,
.mblb-cropbox::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 33.333%;
    width: 33.333%;
    border-left: 1px solid rgba(255, 255, 255, .35);
    border-right: 1px solid rgba(255, 255, 255, .35);
    pointer-events: none;
}

.mblb-cropbox::after {
    top: 33.333%;
    bottom: 33.333%;
    left: 0;
    width: auto;
    right: 0;
    border: 0;
    border-top: 1px solid rgba(255, 255, 255, .35);
    border-bottom: 1px solid rgba(255, 255, 255, .35);
}

.mblb-handle {
    position: absolute;
    width: 26px;
    height: 26px;
    z-index: 2;
}

.mblb-handle::after {
    content: "";
    position: absolute;
    width: 14px;
    height: 14px;
    background: #fff;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}

.mblb-h-nw {
    top: -13px;
    left: -13px;
    cursor: nwse-resize;
}

.mblb-h-nw::after {
    top: 6px;
    left: 6px;
}

.mblb-h-ne {
    top: -13px;
    right: -13px;
    cursor: nesw-resize;
}

.mblb-h-ne::after {
    top: 6px;
    right: 6px;
}

.mblb-h-sw {
    bottom: -13px;
    left: -13px;
    cursor: nesw-resize;
}

.mblb-h-sw::after {
    bottom: 6px;
    left: 6px;
}

.mblb-h-se {
    bottom: -13px;
    right: -13px;
    cursor: nwse-resize;
}

.mblb-h-se::after {
    bottom: 6px;
    right: 6px;
}

.mblb-cropbar {
    position: absolute;
    left: 50%;
    bottom: 26px;
    transform: translateX(-50%);
    display: none;
    align-items: center;
    gap: 10px;
    background: rgba(10, 11, 14, .92);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 10px;
    padding: 10px 14px;
    z-index: 7;
    box-shadow: 0 8px 26px rgba(0, 0, 0, .5);
}

.mblb-cropping .mblb-cropbar {
    display: flex;
}

.mblb-crophint {
    font-size: 12px;
    color: #9aa3b0;
    margin-right: 4px;
    max-width: 230px;
}

/* au doigt, les poignees du cadre demandent une cible plus large */
@media (pointer: coarse) {
    .mblb-handle {
        width: 40px;
        height: 40px;
    }

    .mblb-h-nw {
        top: -20px;
        left: -20px;
    }

    .mblb-h-nw::after {
        top: 13px;
        left: 13px;
    }

    .mblb-h-ne {
        top: -20px;
        right: -20px;
    }

    .mblb-h-ne::after {
        top: 13px;
        right: 13px;
    }

    .mblb-h-sw {
        bottom: -20px;
        left: -20px;
    }

    .mblb-h-sw::after {
        bottom: 13px;
        left: 13px;
    }

    .mblb-h-se {
        bottom: -20px;
        right: -20px;
    }

    .mblb-h-se::after {
        bottom: 13px;
        right: 13px;
    }

    .mblb-handle::after {
        width: 18px;
        height: 18px;
    }
}

/* ---------------- pdf ---------------- */

.mblb-pdf {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow: auto;
    -webkit-overflow-scrolling: touch;
    padding: 20px 0 40px;
    text-align: center;
    display: none;
}

.mblb-pdf.mblb-pdf-on {
    display: block;
}

.mblb-pdf canvas {
    display: block;
    margin: 0 auto 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
    max-width: 100%;
}

.mblb-pdf-page {
    position: relative;
    margin: 0 auto 14px;
    background: #fff;
    box-shadow: 0 4px 18px rgba(0, 0, 0, .5);
}

.mblb-pdf-page canvas {
    margin: 0;
    box-shadow: none;
}

/* ---------------- notification ---------------- */

.mblb-toast {
    position: absolute;
    left: 50%;
    top: 66px;
    transform: translateX(-50%);
    background: rgba(10, 11, 14, .94);
    border: 1px solid rgba(255, 255, 255, .1);
    border-radius: 20px;
    padding: 7px 16px;
    font-size: 12.5px;
    font-weight: 600;
    z-index: 8;
    opacity: 0;
    pointer-events: none;
    transition: opacity .18s linear;
    white-space: nowrap;
}

.mblb-toast.mblb-toast-on {
    opacity: 1;
}

.mblb-toast.mblb-toast-ok {
    color: #7ee2a8;
}

.mblb-toast.mblb-toast-err {
    color: #ff9a9a;
}

.mblb-toast.mblb-toast-busy {
    color: #d7dee8;
}

/* ---------------- ecrans etroits ---------------- */

@media (max-width: 767px) {
    .mblb-bar {
        height: 48px;
        padding: 0 2px;
    }

    .mblb-stage,
    .mblb-pdf {
        top: 48px;
    }

    .mblb-sub {
        display: none;
    }

    .mblb-name {
        font-size: 12px;
    }

    .mblb-btn {
        width: 38px;
        height: 38px;
    }

    .mblb-hide-xs {
        display: none !important;
    }

    .mblb-nav {
        width: 44px;
        height: 56px;
        font-size: 21px;
        margin-top: -28px;
    }

    .mblb-cropbar {
        left: 8px;
        right: 8px;
        bottom: 12px;
        transform: none;
        justify-content: center;
        flex-wrap: wrap;
    }

    .mblb-crophint {
        display: none;
    }
}

/* le curseur "voir" sur les vignettes cliquables */
[data-mb-lb],
[data-mb-lb-images] img {
    cursor: zoom-in;
}
