/* ============================================================
   CERTIFICATES PAGE — built on top of styles.css
   Reuses: fonts, navbar, footer, root variables
   ============================================================ */

.certificate-page {
    background: #000;
}

.cert-container {
    width: 100%;
    max-width: 1500px;
    margin: 0 auto;
    padding: 2rem 4rem;
    position: relative;
    z-index: 2;
}

/* ============ HERO HEADER ============ */
.cert-hero {
    position: relative;
    width: 100%;
    height: 70vh;
    height: 70svh;
    min-height: 420px;
    display: flex;
    align-items: center;
    justify-content: center;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 0%, #000000 75%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 0%, #000000 75%, transparent);
}

.cert-hero-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    will-change: transform;
}

.cert-hero-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom, rgba(0, 0, 0, .55) 0%, rgba(0, 0, 0, .35) 45%, rgba(0, 0, 0, .65) 85%, #000 100%);
}

.cert-hero-content {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    padding: 0 1.5rem;
    text-align: center;
}

.cert-hero-eyebrow {
    font-size: clamp(.75rem, 1.4vw, 1rem);
    font-weight: 500;
    letter-spacing: 6px;
    color: var(--primary-color);
    text-transform: uppercase;
}

.cert-hero-title {
    font-size: clamp(1.9rem, 5.2vw, 4.2rem);
    font-weight: 900;
    letter-spacing: 1px;
    line-height: 1.08;
    margin: 0;
    max-width: 16ch;
    color: var(--light-text);
    text-transform: uppercase;
    text-shadow: 0 12px 40px rgba(0, 0, 0, .6);
}

.cert-hero-sub {
    font-size: clamp(.95rem, 1.8vw, 1.35rem);
    font-weight: 300;
    line-height: 1.5;
    margin: 0;
    max-width: 40ch;
    color: rgba(255, 255, 255, .88);
    text-shadow: 0 6px 24px rgba(0, 0, 0, .6);
}

/* ============ MAIN SECTION ============ */
.cert-main {
    position: relative;
    background: #000;
    padding: 2rem 0 7rem;
    overflow: hidden;
}

.cert-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 120%;
    object-fit: cover;
    object-position: center;
    opacity: .30;
    will-change: transform;
    z-index: 0;
    -webkit-mask-image: linear-gradient(to bottom, transparent, black 5%, black 40%, transparent);
    mask-image: linear-gradient(to bottom, transparent, black 5%, black 40%, transparent);
    
}

.cert-bg-overlay {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(to bottom, #000 0%, rgba(0, 0, 0, .75) 30%, rgba(0, 0, 0, .75) 70%, #000 100%);
}

.cert-page-heading {
    font-size: clamp(2.2rem, 7vw, 5rem);
    font-weight: 900;
    letter-spacing: 2px;
    color: var(--light-text);
    margin: 0 0 1.5rem;
    text-transform: uppercase;
}

.cert-sub-heading {
    font-size: clamp(1.5rem, 3.5vw, 2.6rem);
    font-weight: 700;
    letter-spacing: 2px;
    color: var(--light-text);
    margin: 3rem 0 2rem;
    text-transform: uppercase;
    text-align: center;
}

.cert-page-text {
    font-size: clamp(.95rem, 1.3vw, 1.1rem);
    font-weight: 300;
    line-height: 1.75;
    color: rgba(255, 255, 255, .82);
    max-width: 1000px;
    margin: 0 0 1.4rem;
}

/* ============ CERTIFICATE GRID ============ */
.cert-grid {
    display: grid;
    /* auto-fit (not auto-fill) so the cards fill the row instead of leaving
       an empty phantom track on wide screens */
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    align-items: stretch;
    gap: 2.5rem;
    margin-top: 2rem;
}

.cert-card {
    display: flex;
    flex-direction: column;
    height: 100%;
    background: rgba(255, 255, 255, .04);
    border: 1px solid var(--border-color);
    border-radius: 14px;
    overflow: hidden;
    transition: transform .35s ease, box-shadow .35s ease, border-color .35s ease;
}

.cert-card:hover {
    transform: translateY(-8px);
    border-color: rgba(255, 152, 0, .55);
    box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}

/* ----- card image (a <button> when a lightbox is wired up, else a <div>) ----- */
.cert-card-media {
    position: relative;
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: #fff;
    aspect-ratio: 3 / 4;
    overflow: hidden;
}

/* only the interactive (lightbox) variant advertises zooming */
button.cert-card-media {
    cursor: zoom-in;
}

.cert-card-media img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: center;
    padding: 1rem;
    transition: transform .45s ease;
}

.cert-card:hover .cert-card-media img {
    transform: scale(1.04);
}

/* magnifier hint */
.cert-card-zoom {
    position: absolute;
    right: .9rem;
    bottom: .9rem;
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .65);
    opacity: 0;
    transition: opacity .3s ease;
}

.cert-card-zoom::before,
.cert-card-zoom::after {
    content: "";
    position: absolute;
    background: #fff;
}

/* magnifier ring */
.cert-card-zoom::before {
    width: 14px;
    height: 14px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: transparent;
    top: 10px;
    left: 9px;
}

/* magnifier handle */
.cert-card-zoom::after {
    width: 2px;
    height: 9px;
    top: 22px;
    left: 24px;
    transform: rotate(-45deg);
    transform-origin: top center;
}

.cert-card:hover .cert-card-zoom,
.cert-card-media:focus-visible .cert-card-zoom {
    opacity: 1;
}

/* ----- placeholder for certificates with no scan uploaded yet ----- */
.cert-card-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: .9rem;
    width: 100%;
    aspect-ratio: 3 / 4;
    padding: 1.5rem;
    text-align: center;
    background: linear-gradient(160deg, rgba(255, 152, 0, .10), rgba(255, 255, 255, .03));
    border-bottom: 1px solid var(--border-color);
}

.cert-card-placeholder .cert-doc {
    position: relative;
    width: 56px;
    height: 70px;
    border: 2px solid var(--primary-color);
    border-radius: 4px;
    opacity: .9;
}

.cert-card-placeholder .cert-doc::before,
.cert-card-placeholder .cert-doc::after {
    content: "";
    position: absolute;
    left: 11px;
    height: 2px;
    background: var(--primary-color);
    opacity: .75;
}

.cert-card-placeholder .cert-doc::before { top: 24px; width: 30px; }
.cert-card-placeholder .cert-doc::after  { top: 34px; width: 20px; }

.cert-card-placeholder .cert-doc-label {
    font-size: .7rem;
    font-weight: 500;
    letter-spacing: 2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .55);
}

/* ----- card body ----- */
.cert-card-body {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    gap: .55rem;
    padding: 1.4rem 1.4rem 1.6rem;
}

.cert-card-title {
    font-size: clamp(1.05rem, 1.6vw, 1.3rem);
    font-weight: 700;
    letter-spacing: .5px;
    color: var(--light-text);
    margin: 0;
    text-transform: uppercase;
}

.cert-card-issuer {
    font-size: .9rem;
    font-weight: 500;
    line-height: 1.5;
    color: var(--primary-color);
    margin: 0;
}

.cert-card-desc {
    font-size: .92rem;
    font-weight: 300;
    line-height: 1.65;
    color: rgba(255, 255, 255, .75);
    margin: 0;
}

.cert-card-validity {
    font-size: .85rem;
    font-weight: 300;
    color: rgba(255, 255, 255, .6);
    margin: 0;
    display: flex;
    align-items: center;
    gap: .5rem;
}

.cert-card-validity span {
    font-size: .68rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    color: #000;
    background: var(--primary-color);
    border-radius: 3px;
    padding: .18rem .45rem;
}

/* ----- card actions ----- */
.cert-card-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: .7rem;
    margin-top: auto;
    padding-top: 1.1rem;
}

/* "PDF - 2.7 MB" hint beside the download button */
.cert-file-meta {
    font-size: .7rem;
    font-weight: 400;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: rgba(255, 255, 255, .45);
    white-space: nowrap;
}

.cert-btn {
    font-family: var(--font-gotham);
    font-size: .78rem;
    font-weight: 500;
    letter-spacing: 1.5px;
    text-transform: uppercase;
    text-decoration: none;
    padding: .6rem 1.3rem;
    border-radius: 6px;
    border: 1px solid var(--primary-color);
    cursor: pointer;
    transition: background .3s ease, color .3s ease, transform .3s ease;
}

.cert-btn-view {
    background: var(--primary-color);
    color: #000;
}

.cert-btn-view:hover {
    background: var(--secondary-color);
    border-color: var(--secondary-color);
    transform: translateY(-2px);
}

.cert-btn-download {
    background: transparent;
    color: var(--primary-color);
}

.cert-btn-download:hover {
    background: var(--primary-color);
    color: #000;
    transform: translateY(-2px);
}

/* ============ ACCREDITATION LOGO STRIP ============ */
.cert-logos {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 3rem;
    padding: 0 1.5rem;
}

.cert-logos .cert-badge {
    background: #fff;
    border-radius: 10px;
    padding: 1.2rem 1.6rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform .3s ease, box-shadow .3s ease;
}

.cert-logos .cert-badge:hover {
    transform: translateY(-6px);
    box-shadow: 0 14px 34px rgba(201, 168, 92, .25);
}

.cert-logos img {
    height: clamp(64px, 9vw, 100px);
    width: auto;
    display: block;
}

/* ============ CLOSING NOTE ============ */
.cert-note {
    max-width: 900px;
    margin: 3rem auto 0;
    padding: 1.8rem 2rem;
    border-left: 3px solid var(--primary-color);
    background: rgba(255, 255, 255, .04);
    border-radius: 0 10px 10px 0;
}

.cert-note-text {
    font-size: .95rem;
    font-weight: 300;
    line-height: 1.75;
    color: rgba(255, 255, 255, .8);
    margin: 0 0 .8rem;
}

.cert-note-text:last-child {
    margin-bottom: 0;
}

/* ============================================================
   LIGHTBOX (rendered outside #smooth-wrapper via wp_footer)
   ============================================================ */
.cert-lightbox {
    position: fixed;
    inset: 0;
    z-index: 20000;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 3rem 1.5rem;
}

.cert-lightbox.is-open {
    display: flex;
}

.cert-lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, .92);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: certFadeIn .25s ease;
}

.cert-lightbox-dialog {
    position: relative;
    z-index: 1;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    max-width: 1200px;
    width: 100%;
    animation: certZoomIn .3s ease;
}

.cert-lightbox-figure {
    flex: 1 1 auto;
    margin: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1rem;
    min-width: 0;
}

.cert-lightbox-img {
    max-width: 100%;
    max-height: 78vh;
    width: auto;
    height: auto;
    object-fit: contain;
    background: #fff;
    border-radius: 8px;
    box-shadow: 0 24px 70px rgba(0, 0, 0, .7);
}

.cert-lightbox-caption {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: .3rem;
    text-align: center;
}

.cert-lightbox-title {
    font-size: clamp(1rem, 2vw, 1.35rem);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: var(--light-text);
}

.cert-lightbox-issuer {
    font-size: .88rem;
    font-weight: 300;
    color: var(--primary-color);
}

/* ----- controls ----- */
.cert-lightbox-close {
    position: absolute;
    top: -2.6rem;
    right: 0;
    width: 44px;
    height: 44px;
    font-size: 2rem;
    line-height: 1;
    color: #fff;
    background: transparent;
    border: 0;
    cursor: pointer;
    transition: color .3s ease, transform .3s ease;
}

.cert-lightbox-close:hover {
    color: var(--primary-color);
    transform: rotate(90deg);
}

.cert-lightbox-nav {
    flex: 0 0 auto;
    width: 52px;
    height: 52px;
    font-size: 2.2rem;
    line-height: 1;
    color: #fff;
    background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .2);
    border-radius: 50%;
    cursor: pointer;
    transition: background .3s ease, color .3s ease, border-color .3s ease;
}

.cert-lightbox-nav:hover {
    background: var(--primary-color);
    border-color: var(--primary-color);
    color: #000;
}

.cert-lightbox-nav[hidden] {
    visibility: hidden;
}

@keyframes certFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

@keyframes certZoomIn {
    from { opacity: 0; transform: scale(.94); }
    to   { opacity: 1; transform: scale(1); }
}

/* prevent background scroll while the lightbox is open */
body.cert-lightbox-open {
    overflow: hidden;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */

/* ----- large tablets / small laptops ----- */
@media (max-width: 1200px) {
    .cert-container { padding: 2rem 3rem; }
    .cert-grid { gap: 2rem; }
}

/* ----- tablets ----- */
@media (max-width: 991px) {
    .cert-hero { min-height: 380px; }
    .cert-container { padding: 2rem; }
    .cert-grid { grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
    .cert-logos { gap: 1.5rem; padding: 0; }
    .cert-logos .cert-badge { padding: 1rem 1.2rem; }
    .cert-logos img { height: clamp(56px, 14vw, 72px); }
    .cert-lightbox-dialog { gap: .8rem; }
    .cert-lightbox-nav { width: 44px; height: 44px; font-size: 1.8rem; }
}

/* ----- large phones ----- */
@media (max-width: 767px) {
    .cert-main { padding-bottom: 4.5rem; }
    .cert-container { padding: 1.5rem; }
    .cert-grid { grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.5rem; }
    .cert-card-body { padding: 1.1rem 1.1rem 1.3rem; }
    .cert-logos { gap: 1rem; }
    .cert-logos .cert-badge { padding: .8rem 1rem; border-radius: 8px; }
    .cert-logos img { height: clamp(48px, 13vw, 60px); }
    .cert-note { padding: 1.4rem 1.5rem; }
    .cert-lightbox { padding: 4rem 1rem 1.5rem; }
    .cert-lightbox-img { max-height: 65vh; }
}

/* ----- small phones ----- */
@media (max-width: 575px) {
    .cert-hero { min-height: 340px; }
    .cert-grid { grid-template-columns: 1fr; }
    .cert-logos img { height: 44px; }
    .cert-btn { padding: .55rem 1rem; font-size: .72rem; }

    /* stack the nav buttons under the image on very small screens */
    .cert-lightbox-dialog { flex-wrap: wrap; justify-content: center; }
    .cert-lightbox-figure { flex: 1 0 100%; order: 1; }
    .cert-lightbox-prev { order: 2; }
    .cert-lightbox-next { order: 3; }
}
