.home-gallery {
    overflow: hidden;
    padding-block: clamp(3rem, 6vw, 5rem);
    background: #fff;
}

.home-gallery > .container { max-width: 1680px; }

.home-gallery .container-sm { max-width: 1400px; }

.home-gallery__header {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2.5rem;
    margin-bottom: clamp(2rem, 4vw, 3.75rem);
}

.home-gallery__title {
    margin: 0;
    color: #3d7ca7;
    font-family: 'Phudu', sans-serif;
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 700;
    line-height: 1.25;
    text-transform: uppercase;
    text-align: center;
}

.home-gallery__tabs {
    display: flex;
    gap: 2.5rem;
    border-bottom: 1px solid #dcdcdc;
    width: 100%;
    justify-content: center;
    flex-wrap: wrap;
}

.home-gallery__tab {
    position: relative;
    padding: 0 0 0.5rem 0;
    border: none;
    background: transparent;
    color: #656565;
    font-family: "Inter Tight", 'Inter Tight', sans-serif;
    font-size: 1.125rem;
    font-weight: 700;
    cursor: pointer;
    transition: color 250ms ease;
    margin-bottom: -1px;
    border-bottom: 2px solid transparent;
}

.home-gallery__tab.is-active {
    color: #3d7ca7;
    border-bottom-color: #3d7ca7;
}

.home-gallery__panel {
    padding-inline: max(1rem, calc((100% - 1680px) / 2 + 1rem));
}

.home-gallery__viewport {
    overflow-x: auto;
    overflow-y: hidden;
    padding-bottom: 0.5rem;
    cursor: grab;
    scrollbar-width: none;
    scroll-behavior: smooth;
    scroll-snap-type: x proximity;
    touch-action: pan-x;
}

.home-gallery__viewport::-webkit-scrollbar {
    display: none;
}

.home-gallery__viewport.is-dragging {
    cursor: grabbing;
    scroll-behavior: auto;
    scroll-snap-type: none;
    user-select: none;
}

.home-gallery__track {
    display: flex;
    gap: 1.25rem;
    width: max-content;
}

.home-gallery__col {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    width: clamp(14rem, 20vw, 16.55rem);
}

.home-gallery__item {
    min-width: 0;
    overflow: hidden;
    border-radius: 8px;
    background: #efefef;
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 100%;
}

.home-gallery__col--tall-1 .home-gallery__item { height: 320px; }
.home-gallery__col--tall-2 .home-gallery__item { height: 420px; }
.home-gallery__col--tall-3 .home-gallery__item { height: 265px; }
.home-gallery__col--tall-4 .home-gallery__item { height: 343px; }
.home-gallery__col--double .home-gallery__item { height: 194px; }

.home-gallery__media {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    overflow: hidden;
    color: #fff;
    text-decoration: none;
}

.home-gallery__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 350ms ease;
}

.home-gallery__caption {
    position: absolute;
    inset: auto 0 0;
    padding: clamp(1rem, 2vw, 1.5rem);
    background: linear-gradient(transparent, rgb(0 0 0 / 78%));
    color: #fff;
    opacity: 0;
    transform: translateY(0.75rem);
    transition: opacity 250ms ease, transform 250ms ease;
}

.home-gallery__caption h3 {
    margin: 0;
    font-family: 'Phudu', sans-serif;
    font-size: 1.25rem;
    line-height: 1.4;
}

.home-gallery__caption p {
    margin: 0.35rem 0 0;
    font-size: 0.875rem;
}

.home-gallery__media:hover .home-gallery__image,
.home-gallery__media:focus-visible .home-gallery__image {
    transform: scale(1.04);
}

.home-gallery__media:hover .home-gallery__caption,
.home-gallery__media:focus-visible .home-gallery__caption {
    opacity: 1;
    transform: translateY(0);
}

.home-gallery__controls {
    position: relative;
    margin-top: 2.5rem;
    height: 3rem;
}

.home-gallery__progress {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    overflow: hidden;
    background: #efefef;
    border-radius: 40px;
}

.home-gallery__progress-bar {
    position: absolute;
    inset: 0 auto 0 0;
    width: 0;
    background: #3d7ca7;
    transform-origin: left center;
}

.home-gallery__drag-hint {
    position: absolute;
    top: 12px;
    right: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 4px 12px;
    background: rgba(0, 0, 0, 0.4);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 28px;
    z-index: 2;
}

.home-gallery__actions {
    display: flex;
    justify-content: center;
    margin-top: 1rem;
}

.home-gallery__btn-more {
    display: inline-flex;
    align-items: center;
    padding: 12px 24px;
    border-radius: 80px;
    font-family: "Inter Tight", sans-serif;
    font-size: 1rem;
    font-weight: 700;
    text-transform: none;
    border: 1px solid #3d7ca7;
    color: #3d7ca7;
    background: #fff;
    text-decoration: none;
    transition: all 0.3s ease;
}

.home-gallery__btn-more:hover,
.home-gallery__btn-more:focus-visible {
    background: #3d7ca7;
    color: #fff;
}

@media (max-width: 767.98px) {
    .home-gallery__tabs {
        flex-wrap: nowrap;
        overflow-x: auto;
        justify-content: flex-start;
        padding-bottom: 0.25rem;
        scrollbar-width: none;
    }

    .home-gallery__tabs::-webkit-scrollbar {
        display: none;
    }

    .home-gallery__tab {
        flex-shrink: 0;
    }

    .home-gallery__col {
        width: min(82vw, 16rem);
    }

    .home-gallery__col--tall-1 .home-gallery__item { height: 260px; }
    .home-gallery__col--tall-2 .home-gallery__item { height: 320px; }
    .home-gallery__col--tall-3 .home-gallery__item { height: 220px; }
    .home-gallery__col--tall-4 .home-gallery__item { height: 280px; }
    .home-gallery__col--double .home-gallery__item { height: 160px; }

    .home-gallery__caption {
        opacity: 1;
        transform: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .home-gallery__viewport {
        scroll-behavior: auto;
    }

    .home-gallery__image,
    .home-gallery__caption {
        transition: none;
    }
}
