/* ===== SECTION ===== */
.cert-section {
    padding: 40px 0;
}

/* ===== HEADING ===== */
.cert-head {
    text-align: center;
    margin-bottom: 40px;
    padding: 0 15px;
}
.cert-subhead {
    display: block;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #173071;
    margin-bottom: 10px;
}
.cert-main-heading {
    font-size: 32px;
    font-weight: 800;
    color: #111;
    line-height: 1.25;
    margin: 0;
}
.cert-main-heading span { color: #173071; }
.cert-divider {
    width: 55px;
    height: 4px;
    background: #173071;
    border-radius: 2px;
    margin: 16px auto 0;
}

/* ===== GALLERY WRAPPER ===== */
.cert-gallery-wrap {
    padding: 0 15px;
}

/* ===== GALLERY GRID — mobile first ===== */
.cert-gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* mobile: 1 column */
    gap: 16px;
    width: 100%;
}

/* ===== CARD ===== */
.cert-item {
    position: relative;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #e5e7eb;
    aspect-ratio: 4 / 3;
    background: #f3f5f9;
    cursor: pointer;
    width: 100% !important;
    float: none !important;
}
.cert-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.35s ease;
}
.cert-overlay {
    position: absolute;
    inset: 0;
    background: rgba(23,48,113,0);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-direction: column;
    gap: 10px;
    transition: background 0.3s ease;
}
.cert-item:hover .cert-overlay { background: rgba(23,48,113,0.60); }
.cert-item:hover img            { transform: scale(1.07); }

.zoom-btn {
    opacity: 0;
    transform: scale(0.75);
    transition: opacity 0.25s, transform 0.25s;
    background: #fff;
    border: none;
    border-radius: 50%;
    width: 50px;
    height: 50px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #173071;
    box-shadow: 0 2px 12px rgba(0,0,0,0.2);
}
.cert-item:hover .zoom-btn { opacity: 1; transform: scale(1); }

.cert-hover-title {
    opacity: 0;
    transform: translateY(5px);
    transition: opacity 0.25s, transform 0.25s;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    text-align: center;
    padding: 0 10px;
}
.cert-item:hover .cert-hover-title { opacity: 1; transform: translateY(0); }

/* touch — always show overlay */
@media (hover: none) {
    .zoom-btn         { opacity: 1; transform: scale(1); }
    .cert-hover-title { opacity: 1; transform: translateY(0); }
    .cert-overlay     { background: rgba(23,48,113,0.40); }
}



/* ===== LIGHTBOX ===== */
.lb-wrap {
    display: none;
    position: fixed;
    inset: 0;
    background: #000;
    z-index: 99999;
}
.lb-wrap.open { display: block; }

.lb-img {
    position: fixed;
    inset: 0;
    width: 100vw;
    height: 100vh;
    object-fit: contain;
    display: block;
    transition: transform 0.2s ease, opacity 0.15s ease;
    transform-origin: center center;
    cursor: grab;
    user-select: none;
    z-index: 100000;
    -webkit-user-drag: none;
}
.lb-img:active { cursor: grabbing; }

.lb-close {
    position: fixed;
    top: 14px;
    right: 14px;
    z-index: 100010;
    background: rgba(200,40,40,0.85);
    border: none;
    color: #fff;
    border-radius: 50%;
    width: 46px;
    height: 46px;
    font-size: 20px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    -webkit-tap-highlight-color: transparent;
}
.lb-close:hover  { background: rgba(200,40,40,1); transform: scale(1.1); }
.lb-close:active { transform: scale(0.95); }

.lb-prev {
    position: fixed;
    left: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100010;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.lb-prev:hover  { background: rgba(255,255,255,0.30); }
.lb-prev:active { background: rgba(255,255,255,0.45); transform: translateY(-50%) scale(0.95); }

.lb-next {
    position: fixed;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 100010;
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 50%;
    width: 52px;
    height: 52px;
    font-size: 32px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
}
.lb-next:hover  { background: rgba(255,255,255,0.30); }
.lb-next:active { background: rgba(255,255,255,0.45); transform: translateY(-50%) scale(0.95); }

.lb-zoom-bar {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100010;
    display: flex;
    align-items: center;
    gap: 10px;
    background: rgba(0,0,0,0.65);
    border: 1px solid rgba(255,255,255,0.2);
    border-radius: 40px;
    padding: 10px 20px;
    white-space: nowrap;
}
.lb-zbtn {
    background: rgba(255,255,255,0.15);
    border: 1px solid rgba(255,255,255,0.3);
    color: #fff;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, transform 0.15s;
    line-height: 1;
    -webkit-tap-highlight-color: transparent;
    min-width: 44px;
    min-height: 44px;
}
.lb-zbtn:hover  { background: rgba(255,255,255,0.30); }
.lb-zbtn:active { transform: scale(0.93); }
.lb-zlabel {
    color: rgba(255,255,255,0.85);
    font-size: 13px;
    min-width: 44px;
    text-align: center;
    font-weight: 500;
}

.lb-caption {
    position: fixed;
    bottom: 78px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100010;
    color: rgba(255,255,255,0.90);
    font-size: 13px;
    font-weight: 500;
    background: rgba(0,0,0,0.55);
    padding: 6px 20px;
    border-radius: 20px;
    white-space: nowrap;
    pointer-events: none;
    max-width: 90vw;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* lightbox — mobile adjustments */
@media only screen and (max-width: 767px) {
    .lb-close    { width: 40px; height: 40px; font-size: 17px; top: 10px; right: 10px; }
    .lb-prev     { width: 42px; height: 42px; font-size: 26px; left: 8px; }
    .lb-next     { width: 42px; height: 42px; font-size: 26px; right: 8px; }
    .lb-zbtn     { width: 38px; height: 38px; min-width: 38px; min-height: 38px; font-size: 20px; }
    .lb-zoom-bar { padding: 8px 14px; gap: 8px; bottom: 14px; }
    .lb-caption  { font-size: 12px; bottom: 70px; padding: 5px 16px; }
    .lb-zlabel   { font-size: 12px; min-width: 36px; }
}

/*  */

/* MOBILE FIRST */
.cert-gallery {
    grid-template-columns: repeat(1, 1fr);
}


/* TABLET */
@media (min-width: 769px) {
    .cert-gallery {
        grid-template-columns: repeat(2, 1fr);
    }
}
/* SMALL TABLET */
@media (min-width: 577px) {
    .cert-gallery {
        grid-template-columns: repeat(1, 1fr);
    }
}

/* DESKTOP */
@media (min-width: 993px) {
    .cert-gallery {
        grid-template-columns: repeat(3, 1fr);
    }
}
.cert-item {
    box-shadow: 0 4px 18px rgba(0,0,0,0.08);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}
.cert-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 28px rgba(0,0,0,0.15);
}
.cert-item img {
    object-fit: contain; /* instead of cover */
    background: #fff;
    padding: 10px;
}