/* =========================================================
   TechESteel Gallery
========================================================= */

.techesteel-gallery-page{
    background:#fff;
}

.techesteel-gallery-hero{
    padding:90px 0 70px;
    text-align:center;
    background:
        radial-gradient(circle at top right, rgba(31,148,255,.13), transparent 35%),
        #f4f9fe;
    border-bottom:1px solid var(--border);
}

.techesteel-gallery-kicker{
    display:inline-block;
    margin-bottom:14px;
    color:var(--blue2);
    font:700 12px var(--mono);
    letter-spacing:.13em;
    text-transform:uppercase;
}

.techesteel-gallery-hero h1{
    margin:0;
    font-size:clamp(44px,6vw,76px);
    line-height:1.05;
    letter-spacing:-.045em;
}

.techesteel-gallery-hero p{
    max-width:680px;
    margin:22px auto 0;
    color:var(--muted);
    font-size:18px;
    line-height:1.7;
}

.techesteel-gallery-content{
    padding:80px 0 110px;
}

.techesteel-gallery-editor-content{
    width:100%;
    max-width:none;
}

/* Native Gutenberg Gallery block */
.techesteel-gallery-editor-content .wp-block-gallery{
    display:grid !important;
    grid-template-columns:repeat(3,minmax(0,1fr)) !important;
    gap:22px !important;
    width:100% !important;
    max-width:none !important;
    margin:0 !important;
}

.techesteel-gallery-editor-content .wp-block-gallery.has-nested-images figure.wp-block-image{
    position:relative;
    width:100% !important;
    aspect-ratio:4 / 3;
    margin:0 !important;
    overflow:hidden;
    border-radius:18px;
    background:#edf6fe;
    box-shadow:0 15px 35px rgba(25,88,145,.10);
    cursor:zoom-in;
}

.techesteel-gallery-editor-content .wp-block-gallery figure.wp-block-image img{
    width:100% !important;
    height:100% !important;
    object-fit:cover;
    transition:transform .35s ease;
}

.techesteel-gallery-editor-content .wp-block-gallery figure.wp-block-image:hover img{
    transform:scale(1.045);
}

.techesteel-gallery-editor-content .wp-block-gallery figure.wp-block-image::after{
    content:"View";
    position:absolute;
    right:16px;
    bottom:16px;
    padding:8px 13px;
    border-radius:999px;
    background:rgba(5,30,53,.78);
    color:#fff;
    font-size:12px;
    font-weight:700;
    opacity:0;
    transform:translateY(6px);
    transition:.25s ease;
    pointer-events:none;
}

.techesteel-gallery-editor-content .wp-block-gallery figure.wp-block-image:hover::after{
    opacity:1;
    transform:translateY(0);
}

.techesteel-gallery-editor-content .wp-block-gallery figcaption{
    position:absolute !important;
    inset:auto 0 0 !important;
    margin:0 !important;
    padding:35px 16px 14px !important;
    background:linear-gradient(transparent,rgba(3,25,45,.78)) !important;
    color:#fff !important;
    font-size:14px !important;
    text-align:left !important;
}

/* Classic editor gallery fallback */
.techesteel-gallery-editor-content .gallery{
    display:grid;
    grid-template-columns:repeat(3,minmax(0,1fr));
    gap:22px;
}

.techesteel-gallery-editor-content .gallery-item{
    width:100% !important;
    margin:0 !important;
}

.techesteel-gallery-editor-content .gallery-icon{
    aspect-ratio:4 / 3;
    overflow:hidden;
    border-radius:18px;
}

.techesteel-gallery-editor-content .gallery-icon img{
    width:100%;
    height:100%;
    object-fit:cover;
    border:0 !important;
}

/* Lightbox */
.techesteel-lightbox{
    position:fixed;
    inset:0;
    z-index:999999;
    display:none;
    align-items:center;
    justify-content:center;
    padding:30px 90px;
    background:rgba(2,15,28,.94);
}

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

.techesteel-lightbox-figure{
    max-width:min(1100px,100%);
    max-height:88vh;
    margin:0;
    text-align:center;
}

.techesteel-lightbox-figure img{
    display:block;
    max-width:100%;
    max-height:80vh;
    margin:auto;
    object-fit:contain;
    border-radius:12px;
}

.techesteel-lightbox-figure figcaption{
    min-height:28px;
    margin-top:14px;
    color:#dcecff;
    font-size:14px;
}

.techesteel-lightbox-close,
.techesteel-lightbox-nav{
    position:absolute;
    border:0;
    background:transparent;
    color:#fff;
    cursor:pointer;
}

.techesteel-lightbox-close{
    top:20px;
    right:28px;
    font-size:46px;
    line-height:1;
}

.techesteel-lightbox-nav{
    top:50%;
    transform:translateY(-50%);
    width:58px;
    height:58px;
    border-radius:50%;
    background:rgba(255,255,255,.10);
    font-size:32px;
}

.techesteel-lightbox-prev{
    left:22px;
}

.techesteel-lightbox-next{
    right:22px;
}

body.techesteel-lightbox-open{
    overflow:hidden;
}

@media(max-width:900px){
    .techesteel-gallery-editor-content .wp-block-gallery,
    .techesteel-gallery-editor-content .gallery{
        grid-template-columns:repeat(2,minmax(0,1fr)) !important;
    }
}

@media(max-width:600px){
    .techesteel-gallery-hero{
        padding:70px 0 54px;
    }

    .techesteel-gallery-content{
        padding:55px 0 80px;
    }

    .techesteel-gallery-editor-content .wp-block-gallery,
    .techesteel-gallery-editor-content .gallery{
        grid-template-columns:1fr !important;
        gap:16px !important;
    }

    .techesteel-lightbox{
        padding:70px 18px 30px;
    }

    .techesteel-lightbox-nav{
        width:44px;
        height:44px;
        font-size:24px;
        background:rgba(255,255,255,.16);
    }

    .techesteel-lightbox-prev{
        left:8px;
    }

    .techesteel-lightbox-next{
        right:8px;
    }

    .techesteel-lightbox-close{
        top:14px;
        right:18px;
    }
}