/* Mosquée Al Hijra — Popup Annonces v6 */

/* Overlay */
.mcl-overlay {
    position: fixed; top: 0; left: 0; right: 0; bottom: 0;
    z-index: 999999;
    display: flex; align-items: center; justify-content: center;
    opacity: 0; visibility: hidden; pointer-events: none;
    transition: opacity .3s ease, visibility .3s ease;
    padding: 20px; overflow-y: auto; -webkit-overflow-scrolling: touch;
}
.mcl-overlay.active {
    opacity: 1; visibility: visible; pointer-events: auto;
}

/* Popup box */
.mcl-popup {
    position: relative; width: 100%; max-width: 620px;
    background: #fff; border-radius: 20px;
    box-shadow: 0 20px 60px rgba(0,0,0,.3);
    overflow: hidden;
    transform: scale(.8); opacity: 0;
    transition: all .4s cubic-bezier(.68,-.55,.265,1.55);
    z-index: 1000000; margin: auto;
}
.mcl-overlay.active .mcl-popup { transform: scale(1); opacity: 1; }

/* Animations */
.mcl-popup.fadeInUp   { transform: translateY(50px) scale(.9); }
.mcl-popup.fadeInDown { transform: translateY(-50px) scale(.9); }
.mcl-popup.zoomIn     { transform: scale(.5); }
.mcl-overlay.active .mcl-popup.fadeInUp,
.mcl-overlay.active .mcl-popup.fadeInDown,
.mcl-overlay.active .mcl-popup.zoomIn { transform: translateY(0) scale(1); }

/* Barre déco */
.mcl-topbar { height: 4px; }

/* Bouton fermer */
.mcl-close {
    position: absolute; top: 12px; right: 14px;
    width: 34px; height: 34px; border: none;
    background: rgba(0,0,0,.06); border-radius: 50%;
    cursor: pointer; display: grid; place-items: center;
    font-size: 1rem; color: #333;
    transition: background .2s, transform .2s; z-index: 10;
}
.mcl-close:hover { background: rgba(0,0,0,.12); transform: rotate(90deg); }

/* Image normale (dans slide) */
.mcl-img-wrap {
    width: 100%; overflow: hidden; background: #f5f5f5;
}
.mcl-img {
    width: 100%; height: auto; max-height: 340px;
    object-fit: contain; object-position: center;
    display: block; margin: 0 auto;
}

/* Header */
.mcl-header {
    padding: 24px 26px 10px; text-align: center; position: relative;
}
.mcl-header::before {
    content: ''; position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 54px; height: 4px; border-radius: 2px;
    background: linear-gradient(90deg, #004B39, #DB9E30);
}
.mcl-icon { font-size: 40px; display: inline-block; margin-bottom: 8px; animation: mclFloat 3s ease-in-out infinite; }
@keyframes mclFloat { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-7px)} }
.mcl-title { font-size: 1.45rem; font-weight: 700; color: #004B39; margin: 0; line-height: 1.3; }

/* Body */
.mcl-body { padding: 0 26px 22px; text-align: center; }
.mcl-message { font-size: .94rem; line-height: 1.7; color: #555; margin-bottom: 18px; }
.mcl-message p { margin: 0 0 8px; }
.mcl-message p:last-child { margin-bottom: 0; }

/* Bouton */
.mcl-btn {
    display: inline-block; padding: 12px 28px;
    font-size: .93rem; font-weight: 700; border-radius: 50px;
    border: none; cursor: pointer; text-decoration: none;
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    transition: transform .2s, box-shadow .2s;
}
.mcl-btn:hover { transform: translateY(-2px); box-shadow: 0 7px 20px rgba(0,0,0,.25); }

/* Slides */
.mcl-slide { display: none; }
.mcl-slide.active { display: block; animation: mclIn .32s ease; }
@keyframes mclIn { from{opacity:0;transform:translateX(20px)} to{opacity:1;transform:translateX(0)} }

/* Navigation */
.mcl-nav {
    position: absolute; top: 50%; transform: translateY(-50%);
    width: 32px; height: 32px; background: rgba(255,255,255,.88);
    border: 1px solid rgba(0,0,0,.08); border-radius: 50%;
    font-size: .9rem; cursor: pointer; display: grid; place-items: center;
    z-index: 5; box-shadow: 0 2px 8px rgba(0,0,0,.1); transition: background .2s;
}
.mcl-nav:hover { background: #fff; }
.mcl-prev { left: 8px; }
.mcl-next { right: 8px; }

/* Points */
.mcl-dots { display: flex; justify-content: center; gap: 7px; padding: 8px 0 4px; }
.mcl-dot {
    width: 10px; height: 10px; border-radius: 50%;
    border: none; cursor: pointer; padding: 0;
    transition: transform .2s, background .25s;
}
.mcl-dot.active { transform: scale(1.4); }

/* Compteur */
.mcl-counter { text-align: center; font-size: .73rem; font-weight: 700; letter-spacing: .05em; margin: 0 0 14px; opacity: .7; }

/* ===== MODE IMAGE SEULE ===== */
.mcl-popup.mcl-image-only {
    max-width: 90vw !important; width: auto !important;
    background: transparent !important; box-shadow: none !important;
    padding: 0 !important; border-radius: 0 !important; overflow: visible !important;
}
.mcl-popup.mcl-image-only .mcl-io-img {
    display: block; max-width: 90vw; max-height: 90vh;
    width: auto; height: auto; margin: 0 auto;
    object-fit: contain; border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,.5);
}
.mcl-popup.mcl-image-only .mcl-close {
    position: absolute; top: -14px; right: -14px; z-index: 10;
    background: #fff; color: #004B39; border-radius: 50%;
    width: 40px; height: 40px; font-size: 18px;
    box-shadow: 0 4px 14px rgba(0,0,0,.4);
}

/* Responsive */
@media(max-width:560px){
    .mcl-overlay { padding: 10px; }
    .mcl-popup { border-radius: 14px; }
    .mcl-header { padding: 18px 14px 8px; }
    .mcl-body { padding: 0 14px 18px; }
    .mcl-title { font-size: 1.15rem; }
    .mcl-img { max-height: 220px; }
    .mcl-popup.mcl-image-only { max-width: 94vw !important; }
    .mcl-popup.mcl-image-only .mcl-io-img { max-width: 94vw; max-height: 85vh; }
    .mcl-popup.mcl-image-only .mcl-close { top: -8px; right: -8px; }
}
@media(prefers-reduced-motion:reduce){
    .mcl-overlay,.mcl-popup,.mcl-btn { transition: none; }
    .mcl-icon { animation: none; }
    .mcl-close:hover { transform: none; }
    .mcl-slide.active { animation: none; }
}
@media print { .mcl-overlay { display: none !important; } }
body.mcl-popup-open { overflow: hidden !important; }
