/**
 * KSM Consulting - Field Realizations Gallery & Lightbox Styles
 */

.gallery-section {
    background-color: #f8fafc;
    position: relative;
    padding: 70px 0;
    overflow: hidden;
}

.gallery-header {
    text-align: center;
    max-width: 800px;
    margin: 0 auto 40px auto;
}

.gallery-badge-top {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #e0f2fe;
    color: #0284c7;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    padding: 6px 16px;
    border-radius: 20px;
    margin-bottom: 14px;
}

.gallery-section .section-title {
    font-size: clamp(1.8rem, 3vw, 2.3rem);
    font-weight: 700;
    color: #0a2540;
    margin-bottom: 12px;
    text-align: center;
}

.gallery-section .section-subtitle {
    font-size: 15px;
    line-height: 1.6;
    color: #475569;
    max-width: 680px;
    margin: 0 auto 18px auto;
    text-align: center;
}

.gallery-section .accent-line {
    width: 60px;
    height: 3px;
    background: #0081ba;
    margin: 0 auto 35px auto;
    border-radius: 2px;
}

/* 4-column balanced responsive grid */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 18px;
    width: 100%;
    margin: 0 auto;
}

.gallery-card {
    position: relative;
    border-radius: 10px;
    overflow: hidden;
    background: #0a2540;
    box-shadow: 0 4px 14px rgba(15, 23, 42, 0.08);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    margin: 0;
    padding: 0;
}

.gallery-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.gallery-card:focus-visible {
    outline: 3px solid #0081ba;
    outline-offset: 2px;
}

.gallery-image-wrapper {
    position: relative;
    width: 100%;
    aspect-ratio: 4 / 3;
    overflow: hidden;
    display: block;
    background: #0f172a;
}

.gallery-img {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    transition: transform 0.4s ease !important;
}

.gallery-card:hover .gallery-img {
    transform: scale(1.07);
}

/* Clean hover zoom overlay */
.gallery-overlay {
    position: absolute;
    inset: 0;
    background: rgba(10, 37, 64, 0.45);
    opacity: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: opacity 0.25s ease;
}

.gallery-card:hover .gallery-overlay,
.gallery-card:focus-within .gallery-overlay {
    opacity: 1;
}

.gallery-zoom-circle {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: #0081ba;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.25);
    transform: scale(0.85);
    transition: transform 0.25s ease, background 0.2s ease, color 0.2s ease;
}

.gallery-card:hover .gallery-zoom-circle {
    transform: scale(1);
}

.gallery-card:hover .gallery-zoom-circle:hover {
    background: #0081ba;
    color: #ffffff;
}

/* Lightbox Modal */
.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
}

.lightbox-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(10, 25, 47, 0.92);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    cursor: pointer;
}

.lightbox-container {
    position: relative;
    z-index: 2;
    max-width: 960px;
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.lightbox-figure {
    position: relative;
    background: #0a192f;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.7);
    max-height: 88vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    max-width: 100%;
}

.lightbox-top-bar {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 12px 18px;
    background: linear-gradient(180deg, rgba(10, 25, 47, 0.85) 0%, rgba(10, 25, 47, 0) 100%);
    z-index: 5;
}

.lightbox-counter-pill {
    background: rgba(0, 129, 186, 0.85);
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    padding: 4px 12px;
    border-radius: 16px;
    letter-spacing: 0.5px;
}

.lightbox-img {
    max-height: 82vh;
    max-width: 100%;
    width: auto;
    object-fit: contain;
    background: #020617;
    display: block;
}

.lightbox-close-btn {
    appearance: none;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    cursor: pointer;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, transform 0.2s ease;
}

.lightbox-close-btn:hover {
    background: #ef4444;
    transform: scale(1.1);
}

.lightbox-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    color: #ffffff;
    border: 1px solid rgba(255, 255, 255, 0.3);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    z-index: 10;
}

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

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

.lightbox-nav-btn:hover {
    background: #0081ba;
    border-color: #0081ba;
    transform: translateY(-50%) scale(1.1);
}

/* Responsive Breakpoints */
@media (max-width: 1024px) {
    .gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 16px;
    }
}

@media (max-width: 768px) {
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 14px;
    }
    .lightbox-prev-btn {
        left: 8px;
    }
    .lightbox-next-btn {
        right: 8px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    .gallery-section {
        padding: 50px 0;
    }
}
