/* GHTC DATABASE GALLERY - IMAGES ONLY + LIGHTBOX */
.gallery-hero {
    min-height: 250px;
}

.auto-gallery-page {
    background: #f5f7fb;
    padding-top: 72px;
    padding-bottom: 90px;
}

.auto-gallery-page .container {
    max-width: 1180px;
}

.gallery-page-head {
    display: flex;
    justify-content: space-between;
    gap: 28px;
    align-items: flex-end;
    margin-bottom: 34px;
}

.gallery-page-head-simple {
    align-items: center;
}

.gallery-eyebrow {
    display: inline-flex;
    align-items: center;
    min-height: 30px;
    padding: 0 13px;
    border-radius: 999px;
    background: rgba(231,25,63,.1);
    color: #e7193f;
    font-size: 12px;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: .04em;
    margin-bottom: 12px;
}

.gallery-page-head h2 {
    margin: 0;
    color: #071b43;
    font-size: 36px;
    font-weight: 950;
}

.gallery-tools {
    display: block;
    min-width: 340px;
    padding: 12px;
    background: #fff;
    border-radius: 18px;
    border: 1px solid rgba(7,27,67,.06);
    box-shadow: 0 16px 42px rgba(7,27,67,.07);
}

.gallery-tools input {
    width: 100%;
    min-height: 48px;
    border: 1px solid #d9e2ef;
    border-radius: 13px;
    padding: 0 14px;
    outline: none;
    color: #071b43;
    background: #fff;
}

.gallery-tools input:focus {
    border-color: #e7193f;
    box-shadow: 0 0 0 4px rgba(231,25,63,.08);
}

.auto-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 22px;
}

.images-only-gallery .auto-gallery-card {
    display: block;
    position: relative;
    width: 100%;
    padding: 0;
    border: 0;
    border-radius: 18px;
    overflow: hidden;
    background: #eaf0f7;
    box-shadow: 0 18px 46px rgba(7,27,67,.08);
    cursor: pointer;
    aspect-ratio: 4 / 3;
    transition: transform .24s ease, box-shadow .24s ease;
}

.images-only-gallery .auto-gallery-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 28px 70px rgba(7,27,67,.16);
}

.images-only-gallery .auto-gallery-card::after {
    content: "View";
    position: absolute;
    inset: auto 14px 14px auto;
    min-height: 34px;
    padding: 0 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    background: rgba(7,27,67,.86);
    color: #fff;
    font-size: 12px;
    font-weight: 900;
    opacity: 0;
    transform: translateY(8px);
    transition: all .24s ease;
}

.images-only-gallery .auto-gallery-card:hover::after {
    opacity: 1;
    transform: translateY(0);
}

.images-only-gallery .auto-gallery-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .32s ease;
}

.images-only-gallery .auto-gallery-card:hover img {
    transform: scale(1.06);
}

.gallery-empty {
    background: #fff;
    border: 1px solid rgba(7,27,67,.06);
    border-radius: 22px;
    box-shadow: 0 18px 46px rgba(7,27,67,.08);
    padding: 34px;
    text-align: center;
}

.gallery-empty h3 {
    color: #071b43;
    font-weight: 900;
}

.gallery-empty p {
    color: #65748b;
    margin: 0;
}

/* Lightbox */
body.ghtc-lightbox-open {
    overflow: hidden;
}

.ghtc-lightbox {
    position: fixed;
    inset: 0;
    z-index: 99999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 34px;
    background: rgba(3, 12, 31, .92);
    backdrop-filter: blur(8px);
}

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

.ghtc-lightbox-inner {
    max-width: min(1180px, 92vw);
    max-height: 88vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ghtc-lightbox-inner img {
    max-width: 100%;
    max-height: 88vh;
    object-fit: contain;
    display: block;
    border-radius: 14px;
    box-shadow: 0 30px 90px rgba(0,0,0,.45);
}

.ghtc-lightbox-close,
.ghtc-lightbox-nav {
    border: 0;
    outline: none;
    cursor: pointer;
    color: #fff;
    background: rgba(255,255,255,.13);
    transition: all .2s ease;
}

.ghtc-lightbox-close:hover,
.ghtc-lightbox-nav:hover {
    background: #e7193f;
}

.ghtc-lightbox-close {
    position: fixed;
    top: 22px;
    right: 24px;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    font-size: 36px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ghtc-lightbox-nav {
    position: fixed;
    top: 50%;
    transform: translateY(-50%);
    width: 54px;
    height: 74px;
    border-radius: 18px;
    font-size: 52px;
    line-height: 1;
    display: flex;
    align-items: center;
    justify-content: center;
}

.ghtc-lightbox-prev {
    left: 24px;
}

.ghtc-lightbox-next {
    right: 24px;
}

@media(max-width: 1199.98px) {
    .auto-gallery-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }
}

@media(max-width: 991.98px) {
    .gallery-page-head {
        flex-direction: column;
        align-items: stretch;
    }

    .gallery-tools {
        min-width: 0;
    }

    .auto-gallery-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media(max-width: 575.98px) {
    .auto-gallery-grid {
        grid-template-columns: 1fr;
    }

    .gallery-page-head h2 {
        font-size: 28px;
    }

    .ghtc-lightbox {
        padding: 16px;
    }

    .ghtc-lightbox-nav {
        width: 42px;
        height: 58px;
        font-size: 38px;
    }

    .ghtc-lightbox-prev {
        left: 10px;
    }

    .ghtc-lightbox-next {
        right: 10px;
    }

    .ghtc-lightbox-close {
        top: 12px;
        right: 12px;
    }
}


/* Gallery feature and grid stabilization */
.gallery-feature-section{
    padding:52px 0 20px;
    background:#f5f7fb;
}
.gallery-feature-card{
    display:grid;
    grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);
    gap:30px;
    align-items:center;
    padding:24px;
    border:1px solid #dfe6f1;
    border-radius:20px;
    background:#fff;
    box-shadow:0 16px 42px rgba(7,27,67,.07);
}
.gallery-feature-image{
    height:320px;
    display:flex;
    align-items:center;
    justify-content:center;
    overflow:hidden;
    border-radius:14px;
    background:#f4f6fa;
}
.gallery-feature-image img{
    display:block;
    width:100%;
    height:100%;
    object-fit:contain;
}
.gallery-feature-content h2{
    margin:0 0 14px;
    color:#071b43;
    font-size:32px;
    font-weight:800;
}
.gallery-feature-content p{
    margin:0 0 18px;
    color:#65748b;
    font-size:16px;
    line-height:1.65;
}
.gallery-feature-link{
    display:inline-flex;
    color:#e7193f;
    font-weight:800;
    text-decoration:none;
}
.gallery-feature-link:hover{color:#071b43}

/* Fixed, predictable gallery cards */
.auto-gallery-grid.images-only-gallery{
    display:grid;
    grid-template-columns:repeat(4,minmax(0,1fr));
    gap:22px;
}
.auto-gallery-grid.images-only-gallery .auto-gallery-card{
    display:block;
    width:100%;
    aspect-ratio:4 / 3;
    overflow:hidden;
    border:0;
    border-radius:18px;
    background:#eaf0f7;
    box-shadow:0 18px 46px rgba(7,27,67,.08);
}
.auto-gallery-grid.images-only-gallery .auto-gallery-card img{
    display:block;
    width:100%;
    height:100%;
    max-width:100%;
    object-fit:cover;
}

@media(max-width:1199.98px){
    .auto-gallery-grid.images-only-gallery{grid-template-columns:repeat(3,minmax(0,1fr))}
}
@media(max-width:991.98px){
    .gallery-feature-card{grid-template-columns:1fr}
    .gallery-feature-image{height:280px}
    .auto-gallery-grid.images-only-gallery{grid-template-columns:repeat(2,minmax(0,1fr))}
}
@media(max-width:575.98px){
    .gallery-feature-image{height:220px}
    .gallery-feature-content h2{font-size:26px}
    .auto-gallery-grid.images-only-gallery{grid-template-columns:1fr}
}
