/* ===== استایل گواهینامه‌ها ===== */

.cert-grid-dnn {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 20px;
    font-family: 'Vazirmatn', 'Tahoma', sans-serif;
    padding: 0 0 20px 0;
    max-width: 1200px;
    margin: 0 auto;
}

/* جهت نوشتار در HTML تنظیم میشه، اینجا دیگه direction نمی‌ذاریم */
/* برای فارسی: dir="rtl" و برای انگلیسی: dir="ltr" */

.cert-card-dnn {
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.06);
    overflow: hidden;
    transition: all 0.3s ease;
    border: 2px solid rgba(200, 200, 200, 0.6);
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 18px 12px 16px;
    text-align: center;
}

.cert-card-dnn:hover {
    transform: translateY(-6px);
    box-shadow: 0 16px 36px rgba(0,0,0,0.10);
    border-color: rgba(160, 160, 160, 0.8);
}

.cert-image-dnn {
    width: 100%;
    max-width: 260px;
    aspect-ratio: 3 / 4;
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 12px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    pointer-events: auto;
}

.cert-image-dnn img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
    background: #ffffff;
    padding: 8px;
    pointer-events: none;
}

.cert-title-dnn {
    font-size: 1rem;
    font-weight: 700;
    color: #0f1e34;
    margin-bottom: 2px;
    pointer-events: none;
}

.cert-sub-dnn {
    font-size: 0.75rem;
    color: #5d7188;
    line-height: 1.4;
    pointer-events: none;
}

.cert-badge-dnn {
    display: inline-block;
    margin-top: 10px;
    background: #eef3f8;
    padding: 4px 14px;
    border-radius: 30px;
    font-size: 0.6rem;
    font-weight: 600;
    color: #1a2b4a;
    transition: 0.3s;
    pointer-events: none;
}

.cert-card-dnn:hover .cert-badge-dnn {
    background: #e31b23;
    color: #fff;
}

.cert-link-dnn {
    margin-top: 10px;
    font-size: 0.75rem;
    color: #8fa0b5;
    text-decoration: none;
    transition: 0.3s;
    border-bottom: 1px dashed transparent;
    cursor: pointer;
    background: none;
    border: none;
    font-family: inherit;
    padding: 8px 16px;
    position: relative;
    z-index: 10;
}

.cert-card-dnn:hover .cert-link-dnn {
    color: #e31b23;
    border-bottom-color: #e31b23;
}

/* ===== پاپ‌آپ ===== */

.lightbox-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.85);
    z-index: 9999;
    justify-content: center;
    align-items: center;
    backdrop-filter: blur(6px);
    animation: fadeIn 0.3s ease;
}

.lightbox-overlay.active {
    display: flex;
}

.lightbox-content {
    background: #ffffff;
    border-radius: 20px;
    padding: 30px;
    max-width: 90vw;
    width: auto;
    max-height: 90vh;
    position: relative;
    box-shadow: 0 30px 60px rgba(0,0,0,0.5);
    animation: scaleIn 0.3s ease;
    display: flex;
    flex-direction: column;
    align-items: center;
    border: 3px solid rgba(200, 200, 200, 0.6);
}

.lightbox-content img {
    width: auto;
    height: auto;
    max-width: 85vw;
    max-height: 75vh;
    object-fit: contain;
    border-radius: 12px;
    background: #f8fafc;
    padding: 15px;
    display: block;
}

.lightbox-close {
    position: absolute;
    top: 12px;
    font-size: 1.8rem;
    font-weight: 700;
    color: #1a2b4a;
    cursor: pointer;
    transition: 0.3s;
    background: #f0f4f8;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    line-height: 1;
    z-index: 20;
}

/* موقعیت دکمه بستن در HTML با کلاس تنظیم میشه */
/* برای فارسی: left: 16px ، برای انگلیسی: right: 16px */

.lightbox-close:hover {
    background: #e31b23;
    color: #fff;
    transform: rotate(90deg);
}

.lightbox-title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #0f1e34;
    margin-top: 16px;
    margin-bottom: 4px;
}

.lightbox-sub {
    font-size: 0.9rem;
    color: #5d7188;
    margin-bottom: 12px;
}

/* ===== انیمیشن‌ها ===== */

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes scaleIn {
    from { transform: scale(0.9); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* ===== ریسپانسیو ===== */

@media (max-width: 992px) {
    .cert-grid-dnn {
        grid-template-columns: repeat(2, 1fr);
        gap: 18px;
    }
    .cert-image-dnn {
        max-width: 220px;
    }
}

@media (max-width: 576px) {
    .cert-grid-dnn {
        grid-template-columns: 1fr;
        gap: 16px;
    }
    .cert-image-dnn {
        max-width: 260px;
    }
    .lightbox-content {
        padding: 20px;
        width: 95%;
    }
    .lightbox-close {
        top: 8px;
        width: 34px;
        height: 34px;
        font-size: 1.4rem;
    }
}
