/**
 * Extra Styles for CT Design Library
 * تصميمات إضافية للجاليري والواجهة الأمامية
 */


/* ======== لوحة تحكم المواقع الفرعية – فلاتر الجاليري ======== */

#ctdl-subsite-controls {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 14px;
    margin-bottom: 25px;
    padding: 15px;
    background: #ffffff;
    border-radius: 14px;
    box-shadow: 0 4px 12px rgba(0,0,0,0.08);
    direction: rtl;
}

/* تنسيق الحقول */
#ctdl-subsite-controls input,
#ctdl-subsite-controls select {
    padding: 10px 12px;
    font-size: 14px;
    border: 1px solid #d3d3d3;
    border-radius: 8px;
    background: #fafafa;
    transition: 0.25s;
    height: 44px !important;
}

/* تأثير hover & focus */
#ctdl-subsite-controls input:focus,
#ctdl-subsite-controls select:focus {
    border-color: #0073aa;
    background: #fff;
    box-shadow: 0 0 0 2px rgba(0,115,170,0.15);
}

/* تعديل الكروت تبتعد عن الفلاتر */
.ctdl-gallery-wrapper {
    margin-top: 20px !important;
}

/* تحسين الكروت بالداخلي */
.ctdl-card {
    margin-top: 15px;
}





/* ======== تحسين كروت الجاليري ======== */

.ctdl-gallery-wrapper {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 25px;
    margin-top: 20px;
}

.ctdl-card {
    background: #000000;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0,0,0,0.12);
    display: flex;
    flex-direction: column;
    text-align: center;
    transition: 0.3s;
}

.ctdl-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 18px rgba(0,0,0,0.15);
}

/* الصورة تملى العرض بالكامل */
.ctdl-card img {
    width: 100%;
    height: auto;
    object-fit: contain;   /* بدل cover */
    background: #f5f5f5;   /* خلفية بسيطة للصور الأصغر من الإطار */
    padding: 5px;
    border-radius: 8px;
}

/* منطقة المحتوى */
.ctdl-card h3 {
    font-size: 18px;
    margin: 12px 0 8px;
    padding: 0 10px;
}

.ctdl-card p {
    font-size: 14px;
    color: #444;
    padding: 0 15px 10px;
    min-height: 60px;
}

/* زر الاستخدام */
.ctdl-use-btn {
    display: block;
    margin: 12px auto 16px;
    background: #0073aa;
    color: #fff !important;
    padding: 10px 18px;
    border-radius: 6px;
    font-size: 14px;
    text-decoration: none !important;
    transition: 0.3s;
    width: fit-content;
}

.ctdl-use-btn:hover {
    background: #005f8d;
    color: #fff !important;
}


/* ===== Lightbox ===== */

#ctdl-lightbox {
    position: fixed;
    inset: 0;
    display: none;
    background: rgba(0,0,0,0.85);

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 999999;
}

#ctdl-lightbox img {
    max-width: 40%;
    max-height: 80%;
    object-fit: contain;
}


@keyframes pop {
    from { transform: scale(0.8); opacity: 0; }
    to   { transform: scale(1); opacity: 1; }
}




/* رسالة لا توجد قوالب */
.ctdl-empty {
    text-align: center;
    padding: 40px;
    font-size: 18px;
    color: #888;
}

/* Responsive */
@media (max-width: 480px) {
    .ctdl-card img {
        height: 150px;
    }
}
