/* SFELK Gallery — categorized mockup layout */

.sf-gallery-page {
    margin: 0;
    font-family: Outfit, 'Segoe UI', sans-serif;
    color: #1a2b45;
    background: #f4f6fa;
}

.sf-gal {
    padding: 24px 0 48px;
}

.sf-gal .wrap {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

/* Pill filter bar */
.sf-gal-filters {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin: 0 auto 32px;
    padding: 10px 14px;
    max-width: fit-content;
    background: #fff;
    border-radius: 999px;
    box-shadow: 0 14px 40px rgba(0, 36, 120, .08);
    border: 1px solid rgba(0, 51, 153, .08);
}

.sf-gal-filters button {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border-radius: 999px;
    border: 0;
    font-family: inherit;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: transform .28s ease, box-shadow .28s ease, background .28s ease, color .28s ease;
    animation: sfGalBreathe 5.4s ease-in-out infinite;
}

.sf-gal-filters button.is-idle {
    background: #d9e4f8;
    color: #003399;
}

.sf-gal-filters button.is-idle:hover {
    background: #c8d6f0;
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 51, 153, .12);
}

.sf-gal-filters button.is-active {
    background: linear-gradient(135deg, #003399, #0b2c78);
    color: #fff;
    box-shadow: 0 12px 28px rgba(0, 51, 153, .28);
    animation: sfGalBreatheActive 4.8s ease-in-out infinite;
}

/* Section */
.sf-gal-section {
    margin-bottom: 40px;
}

.sf-gal-section.is-hidden {
    display: none;
}

.sf-gal-head {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 18px;
}

.sf-gal-head h2 {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.35rem, 2.4vw, 1.75rem);
    font-weight: 700;
    color: #003399;
}

.sf-gal-head h2::before {
    content: "";
    width: 36px;
    height: 3px;
    border-radius: 3px;
    background: #e10600;
    flex: 0 0 auto;
}

.sf-gal-more {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 10px 20px;
    border-radius: 999px;
    border: 2px solid #003399;
    background: transparent;
    color: #003399;
    font-weight: 800;
    font-size: 14px;
    text-decoration: none;
    cursor: pointer;
    font-family: inherit;
    transition: background .28s ease, color .28s ease, transform .28s ease, box-shadow .28s ease;
}

.sf-gal-more:hover {
    background: #003399;
    color: #fff;
    transform: translateY(-2px);
    box-shadow: 0 10px 24px rgba(0, 51, 153, .2);
}

.sf-gal-more svg {
    width: 18px;
    height: 18px;
    transition: transform .25s ease;
}

.sf-gal-more:hover svg {
    transform: translateX(3px);
}

.sf-gal-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    grid-auto-flow: dense;
    gap: 14px;
}

@media (min-width: 640px) {
    .sf-gal-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
        gap: 16px;
    }
}

@media (min-width: 1024px) {
    .sf-gal-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 18px;
    }
    .sf-gal-thumb.is-featured {
        grid-column: span 2;
        grid-row: span 2;
        aspect-ratio: auto;
        min-height: 100%;
    }
}

.sf-gal-grid.is-gallery-in .sf-gal-thumb {
    animation-name: sfGalTileIn, sfGalThumbBreathe;
    animation-duration: 0.9s, 7.2s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1), ease-in-out;
    animation-fill-mode: backwards, none;
    animation-iteration-count: 1, infinite;
    animation-delay: calc(var(--gal-i, 0) * 0.065s + 0.04s), calc(var(--gal-i, 0) * 0.35s + 1.15s);
}

.sf-gal-grid.is-gallery-in .sf-gal-thumb img {
    animation-name: sfGalImgSettle, sfGalPhotoBreathe;
    animation-duration: 1.25s, 8s;
    animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1), ease-in-out;
    animation-fill-mode: backwards, none;
    animation-iteration-count: 1, infinite;
    animation-delay: calc(var(--gal-i, 0) * 0.065s + 0.04s), calc(var(--gal-i, 0) * 0.4s + 1.2s);
}

.sf-gal-thumb {
    position: relative;
    border: 0;
    padding: 0;
    margin: 0;
    border-radius: 14px;
    overflow: hidden;
    cursor: zoom-in;
    background: #0b1630;
    aspect-ratio: 4 / 3;
    box-shadow: 0 10px 28px rgba(0, 36, 120, .08);
    isolation: isolate;
    transition: transform 0.55s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.55s ease;
}

.sf-gal-thumb.is-extra {
    display: none;
}

.sf-gal-section.is-expanded .sf-gal-thumb.is-extra {
    display: block;
}

.sf-gal-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 1.05s cubic-bezier(0.22, 1, 0.36, 1), filter 0.65s ease;
}

.sf-gal-thumb:hover,
.sf-gal-thumb:focus-visible {
    transform: translateY(-8px);
    box-shadow: 0 22px 48px rgba(0, 51, 153, .2);
    animation-play-state: paused;
}

.sf-gal-thumb:hover img,
.sf-gal-thumb:focus-visible img {
    transform: scale(1.08);
    filter: saturate(1.08) brightness(0.96);
}

.sf-gal-tile-shade {
    position: absolute;
    inset: 0;
    z-index: 1;
    background: linear-gradient(180deg, rgba(4, 12, 32, 0.05) 35%, rgba(4, 12, 32, 0.78) 100%);
    opacity: 0.55;
    transition: opacity 0.5s ease;
    pointer-events: none;
}

.sf-gal-thumb:hover .sf-gal-tile-shade,
.sf-gal-thumb:focus-visible .sf-gal-tile-shade {
    opacity: 1;
}

.sf-gal-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 3;
    background: linear-gradient(115deg, transparent 28%, rgba(255, 255, 255, 0.24) 48%, transparent 68%);
    pointer-events: none;
    transform: translateX(-120%);
}

.sf-gal-thumb:hover::after,
.sf-gal-thumb:focus-visible::after {
    transform: translateX(120%);
    transition: transform 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

.sf-gal-zoom {
    position: absolute;
    top: 12px;
    right: 12px;
    z-index: 4;
    width: 2.65rem;
    height: 2.65rem;
    display: grid;
    place-items: center;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.55);
    background: rgba(8, 18, 48, 0.38);
    -webkit-backdrop-filter: blur(6px);
    backdrop-filter: blur(6px);
    color: #fff;
    font-size: 14px;
    opacity: 0;
    transform: scale(0.65) rotate(-40deg);
    transition: opacity 0.45s ease, transform 0.55s cubic-bezier(0.34, 1.56, 0.64, 1);
    pointer-events: none;
}

.sf-gal-thumb:hover .sf-gal-zoom,
.sf-gal-thumb:focus-visible .sf-gal-zoom {
    opacity: 1;
    transform: none;
}

.sf-gal-cap {
    position: absolute;
    left: 12px;
    right: 12px;
    bottom: 12px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    text-align: left;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity .35s ease, transform .35s ease;
    z-index: 2;
    pointer-events: none;
}

.sf-gal-thumb:hover .sf-gal-cap {
    opacity: 1;
    transform: none;
}

/* Memories banner */
.sf-gal-memories {
    margin-top: 8px;
    border-radius: 18px;
    overflow: hidden;
    position: relative;
    min-height: 160px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #fff;
    box-shadow: 0 20px 50px rgba(0, 36, 120, .18);
}

.sf-gal-memories__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center;
    transform: scale(1.04);
    animation: sfGalKenBurns 22s ease-in-out infinite alternate;
}

.sf-gal-memories__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(0, 51, 153, .92), rgba(7, 30, 82, .88));
}

.sf-gal-memories__inner {
    position: relative;
    z-index: 2;
    padding: 36px 24px;
    max-width: 620px;
}

.sf-gal-memories__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 14px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .35);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    animation: sfGalBreathe 5s ease-in-out infinite;
}

.sf-gal-memories h3 {
    margin: 0 0 8px;
    font-family: 'Playfair Display', Georgia, serif;
    font-size: clamp(1.4rem, 3vw, 1.85rem);
    font-weight: 700;
}

.sf-gal-memories p {
    margin: 0;
    font-size: 15px;
    line-height: 1.55;
    color: rgba(255, 255, 255, .9);
}

/* Lightbox */
.sf-gal-lightbox {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(4, 10, 28, .94);
    padding: 24px;
}

.sf-gal-lightbox.is-open {
    display: flex;
}

.sf-gal-lightbox img {
    max-width: min(960px, 92vw);
    max-height: 82vh;
    object-fit: contain;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .45);
}

.sf-gal-lightbox__meta {
    color: #fff;
    text-align: center;
    margin-top: 14px;
    font-weight: 600;
}

.sf-gal-lightbox__close,
.sf-gal-lightbox__nav {
    position: absolute;
    border: 0;
    background: rgba(255, 255, 255, .12);
    color: #fff;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 18px;
    transition: background .25s ease, transform .25s ease;
}

.sf-gal-lightbox__close:hover,
.sf-gal-lightbox__nav:hover {
    background: rgba(255, 255, 255, .22);
    transform: scale(1.06);
}

.sf-gal-lightbox__close {
    top: 20px;
    right: 20px;
}

.sf-gal-lightbox__prev {
    left: max(16px, 3vw);
    top: 50%;
    transform: translateY(-50%);
}

.sf-gal-lightbox__next {
    right: max(16px, 3vw);
    top: 50%;
    transform: translateY(-50%);
}

/* Scroll reveal */
.sf-gal [data-sf-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity .75s cubic-bezier(.2, .8, .2, 1), transform .75s cubic-bezier(.2, .8, .2, 1);
}

.sf-gal [data-sf-reveal].is-in {
    opacity: 1;
    transform: none;
}

@keyframes sfGalBreathe {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-2px); }
}

@keyframes sfGalBreatheActive {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-3px); }
}

@keyframes sfGalThumbBreathe {
    0%, 100% {
        box-shadow: 0 10px 28px rgba(0, 36, 120, 0.08);
    }
    50% {
        box-shadow: 0 18px 38px rgba(0, 51, 153, 0.14);
    }
}

@keyframes sfGalTileIn {
    from {
        opacity: 0;
        transform: translateY(26px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: none;
    }
}

@keyframes sfGalImgSettle {
    from {
        transform: scale(1.08);
        filter: blur(4px) brightness(1.05);
    }
    to {
        transform: scale(1);
        filter: none;
    }
}

@keyframes sfGalPhotoBreathe {
    0%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(1.03);
    }
}

@keyframes sfGalKenBurns {
    from {
        transform: scale(1.04);
    }
    to {
        transform: scale(1.1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sf-gal-filters button,
    .sf-gal-memories__icon,
    .sf-gal-thumb,
    .sf-gal-memories__bg,
    .sf-gal-grid.is-gallery-in .sf-gal-thumb,
    .sf-gal-grid.is-gallery-in .sf-gal-thumb img {
        animation: none !important;
    }
    .sf-gal [data-sf-reveal] {
        opacity: 1;
        transform: none;
        transition: none;
    }
}