/* =======================
   CERTIFICATE SECTION
======================= */

.certificates-section {
    padding: 100px 0;
    background: #faf7ff; /* Hafif mor-soft arka plan */
}

.certificates-section .container {
    max-width: 1300px;
    margin: 0 auto;
    padding: 0 40px;
    text-align: center;
}

.cert-title {
    font-size: 42px;
    font-weight: 800;
    letter-spacing: .03em;
    margin-bottom: 10px;
    color: #3c1e9d;
    text-transform: uppercase;
}

.cert-sub {
    max-width: 650px;
    margin: 0 auto 60px;
    font-size: 17px;
    color: #666;
    line-height: 1.6;
}

/* ===== GRID ===== */

.cert-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.cert-item {
    background: #fff;
    border-radius: 18px;
    padding: 25px 20px 35px;
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    transition: 0.25s ease;
    cursor: pointer;
}

.cert-item:hover {
    transform: translateY(-8px);
    box-shadow: 0 18px 40px rgba(108, 46, 244, 0.18); /* mor gölge */
}

/* Görsel kutusu */

.cert-img {
    width: 100%;
    height: 360px;
    border-radius: 12px;
    overflow: hidden;
    background: #f2f2f2;
    margin-bottom: 22px;
}

.cert-img img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Başlık */

.cert-item h3 {
    font-size: 22px;
    font-weight: 700;
    color: #4617d4;
    margin-bottom: 4px;
    letter-spacing: .02em;
}

/* Alt açıklama */

.cert-item p {
    font-size: 15px;
    color: #555;
    margin: 0;
}

/* ==== MOBİL ==== */

@media(max-width: 992px){
    .cert-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media(max-width: 768px){
    .cert-grid {
        grid-template-columns: 1fr;
    }
    .cert-img {
        height: 300px;
    }
}
/* =======================
   POPUP (LIGHTBOX)
======================= */

.cert-popup {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.65);
    backdrop-filter: blur(4px);
    display: flex;
    align-items: center;
    justify-content: center;

    opacity: 0;
    visibility: hidden;
    transition: opacity .25s ease;
    z-index: 99999;
}

.cert-popup.active {
    opacity: 1;
    visibility: visible;
}

.cert-popup img {
    max-width: 85%;
    max-height: 85%;
    border-radius: 14px;
    box-shadow: 0 12px 40px rgba(0,0,0,0.3);
    animation: popupIn .25s ease;
}

/* Açılış animasyonu */
@keyframes popupIn {
    from {
        transform: scale(0.85);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

/* X KAPATMA BUTONU */
.cert-close {
    position: absolute;
    top: 40px;
    right: 40px;
    font-size: 42px;
    color: #fff;
    cursor: pointer;
    transition: .2s ease;
    font-weight: 300;
}

.cert-close:hover {
    transform: scale(1.2);
}

/* Mobil */
@media(max-width: 768px){
    .cert-close {
        top: 20px;
        right: 20px;
        font-size: 34px;
    }
    .cert-popup img {
        max-width: 92%;
        max-height: 92%;
    }
}
/* ==========================================
   CERTIFICATE POPUP
========================================== */
.cert-popup {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 20px;
}

.cert-popup img {
    max-width: 95%;
    max-height: 90%;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
}

.cert-close {
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 40px;
    font-weight: bold;
    color: #fff;
    cursor: pointer;
    z-index: 10000;
    transition: .2s;
}

.cert-close:hover {
    color: #d6d6d6;
}
/* ===== MOBILE CERTIFICATE HEADER FIX ===== */
@media (max-width: 768px) {

    .cert-title {
        font-size: 28px !important;
        line-height: 1.2 !important;
        text-align: center !important;
        padding: 0 10px !important;
        word-break: break-word !important; /* Taşmayı tamamen engeller */
    }

    .cert-sub {
        font-size: 15px !important;
        line-height: 1.55 !important;
        padding: 0 15px !important;
    }

    .certificates-section {
        padding: 60px 0 !important; /* Mobilde fazla boşluk olmasın */
    }

    .certificates-section .container {
        padding: 0 20px !important;
    }
}
/* ===========================
   CERTIFICATE POPUP – FINAL
=========================== */

.cert-popup {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.75);
    backdrop-filter: blur(6px);
    display: none; /* Başta kapalı */
    justify-content: center;
    align-items: center;
    z-index: 99999;
    padding: 20px;
}

.cert-popup img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 15px 40px rgba(0,0,0,0.25);
    animation: popupZoom .25s ease;
}

/* X Kapatma */
.cert-close {
    position: absolute;
    top: 25px;
    right: 30px;
    font-size: 42px;
    color: #fff;
    cursor: pointer;
    z-index: 100000;
    transition: .2s;
}

.cert-close:hover {
    transform: scale(1.2);
    color: #e5e5e5;
}

/* Açılış animasyonu */
@keyframes popupZoom {
    from { transform: scale(0.85); opacity: 0; }
    to { transform: scale(1); opacity: 1; }
}

/* Mobil için optimize */
@media(max-width: 768px){
    .cert-popup img {
        max-width: 96%;
        max-height: 85%;
    }
    .cert-close {
        top: 15px;
        right: 20px;
        font-size: 34px;
    }
}
