/* ============================================
   GALLERY PAGE — Full UI Design
   ============================================ */

.page-gallery .site-header:not(.scrolled) {
    background: transparent;
    box-shadow: none;
}

.page-gallery .site-header:not(.scrolled) .site-nav__link {
    color: var(--color-gray-800);
}

/* ---- Hero (same layout as About page) ---- */
.gallery-hero {
    position: relative;
    min-height: 420px;
    padding: 120px 0 100px;
    display: flex;
    align-items: flex-end;
    overflow: hidden;
}

.gallery-hero__bg {
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: right center;
    background-repeat: no-repeat;
    background-position-y: -150px;
}

.gallery-hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(105deg,
        rgba(255, 251, 247, 0.97) 0%,
        rgba(255, 251, 247, 0.88) 32%,
        rgba(255, 251, 247, 0.42) 58%,
        rgba(255, 251, 247, 0.08) 100%);
}

.gallery-hero__container {
    position: relative;
    z-index: 2;
    width: 100%;
}

.gallery-hero__content {
    max-width: 520px;
}

.gallery-hero__breadcrumb {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: var(--font-size-sm);
    margin-bottom: 18px;
}

.gallery-hero__breadcrumb a {
    color: var(--color-text-muted);
    font-weight: var(--font-weight-medium);
}

.gallery-hero__breadcrumb a:hover {
    color: var(--color-primary);
}

.gallery-hero__breadcrumb i {
    font-size: 10px;
    color: var(--color-gray-400);
}

.gallery-hero__breadcrumb span {
    color: var(--color-primary);
    font-weight: var(--font-weight-semibold);
}

.gallery-hero__title {
    font-size: clamp(2.25rem, 5vw, 3rem);
    font-weight: var(--font-weight-extrabold);
    color: var(--color-gray-900);
    margin-bottom: 10px;
    line-height: 1.1;
}

.gallery-hero__tagline {
    font-size: clamp(1.05rem, 2.2vw, 1.25rem);
    font-weight: var(--font-weight-semibold);
    color: var(--color-primary);
    margin-bottom: 14px;
}

.gallery-hero__intro {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    line-height: 1.75;
    max-width: 480px;
    margin: 0;
}

.gallery-hero__wave {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    z-index: 3;
    line-height: 0;
}

.gallery-hero__wave svg {
    width: 100%;
    height: 70px;
    display: block;
}
/* ---- Filter Bar ---- */
.gallery-toolbar-wrap {
    margin-top: -50px;
    position: relative;
    z-index: 10;
    padding-bottom: 8px;
}

.gallery-filter-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    background: var(--color-white);
    padding: 14px 16px;
    border-radius: var(--radius-lg);
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.08);
    border: 1px solid rgba(0, 0, 0, 0.04);
}

.gallery-filter-bar__btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 11px 18px;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-full);
    background: var(--color-white);
    color: var(--color-text-muted);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-medium);
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}

.gallery-filter-bar__btn i {
    font-size: 14px;
}

.gallery-filter-bar__btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.gallery-filter-bar__btn.active {
    background: var(--gradient-primary);
    border-color: transparent;
    color: var(--color-white);
    box-shadow: 0 4px 16px rgba(245, 124, 0, 0.3);
}

/* ---- Gallery Listing ---- */
.gallery-listing {
    padding: 40px 0 72px;
    background: var(--color-white);
}

.gallery-page__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 16px;
    margin-bottom: 28px;
}

.gallery-page__count {
    font-size: var(--font-size-base);
    color: var(--color-text-muted);
    margin: 0;
}

.gallery-page__count strong {
    color: var(--color-gray-900);
}

.gallery-page__controls {
    display: flex;
    align-items: center;
    gap: 14px;
}

.gallery-page__sort {
    padding: 10px 36px 10px 16px;
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    color: var(--color-text);
    background: var(--color-white) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%23999' d='M6 8L1 3h10z'/%3E%3C/svg%3E") no-repeat right 14px center;
    appearance: none;
    cursor: pointer;
}

.gallery-page__view-toggle {
    display: flex;
    align-items: center;
    gap: 8px;
}

.gallery-page__view-label {
    font-size: var(--font-size-sm);
    color: var(--color-text-muted);
    white-space: nowrap;
}

.gallery-page__view-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-white);
    color: var(--color-text-muted);
    border: 1px solid var(--color-gray-200);
    border-radius: var(--radius-md);
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 15px;
}

.gallery-page__view-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-white);
}

/* ---- Masonry Grid ---- */
.gallery-page__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: 200px;
    gap: 18px;
}

.gallery-page__item {
    border-radius: 14px;
    overflow: hidden;
    min-height: 0;
}

.gallery-page__item--tall {
    grid-row: span 2;
}

.gallery-page__item--wide {
    grid-column: span 2;
}

.gallery-page__item--large {
    grid-column: span 2;
    grid-row: span 2;
}

.gallery-page__thumb {
    width: 100%;
    height: 100%;
    padding: 0;
    border: none;
    background: none;
    cursor: pointer;
    position: relative;
    display: block;
    border-radius: 14px;
    overflow: hidden;
}

.gallery-page__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

.gallery-page__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, transparent 40%, rgba(0, 0, 0, 0.65) 100%);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.35s ease;
    color: var(--color-white);
}

.gallery-page__overlay i {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.8);
    font-size: 28px;
    opacity: 0;
    transition: all 0.35s ease;
}

.gallery-page__caption {
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    transform: translateY(10px);
    transition: transform 0.35s ease;
}

.gallery-page__thumb:hover .gallery-page__img {
    transform: scale(1.06);
}

.gallery-page__thumb:hover .gallery-page__overlay {
    opacity: 1;
}

.gallery-page__thumb:hover .gallery-page__overlay i {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1);
}

.gallery-page__thumb:hover .gallery-page__caption {
    transform: translateY(0);
}

/* List View */
.gallery-page__grid--list {
    grid-template-columns: 1fr;
    grid-auto-rows: auto;
    gap: 16px;
}

.gallery-page__grid--list .gallery-page__item,
.gallery-page__grid--list .gallery-page__item--tall,
.gallery-page__grid--list .gallery-page__item--wide,
.gallery-page__grid--list .gallery-page__item--large {
    grid-column: span 1;
    grid-row: span 1;
}

.gallery-page__grid--list .gallery-page__thumb {
    height: 220px;
}

/* Load More */
.gallery-page__load-more-wrap {
    text-align: center;
    margin-top: 44px;
}

.gallery-page__load-more {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 32px;
    background: var(--color-white);
    color: var(--color-primary);
    border: 2px solid var(--color-primary);
    border-radius: var(--radius-full);
    font-family: var(--font-family);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    cursor: pointer;
    transition: all 0.3s ease;
}

.gallery-page__load-more:hover:not(:disabled) {
    background: var(--color-primary-ghost);
}

.gallery-page__load-more:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.gallery-page__load-more.is-loading i {
    animation: gallerySpin 0.8s linear infinite;
}

@keyframes gallerySpin {
    to { transform: rotate(360deg); }
}

/* ---- CTA Banner ---- */
.gallery-cta {
    position: relative;
    background: var(--gradient-primary);
    padding: 0;
    overflow: hidden;
}

.gallery-cta__decor {
    position: absolute;
    right: 4%;
    top: 50%;
    transform: translateY(-50%);
    font-size: 140px;
    color: rgba(255, 255, 255, 0.1);
    pointer-events: none;
    line-height: 1;
}

.gallery-cta__inner {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: center;
    gap: 24px;
    flex-wrap: wrap;
    padding: 36px 0;
}

.gallery-cta__icon {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-white);
    font-size: 22px;
    flex-shrink: 0;
}

.gallery-cta__content {
    flex: 1;
    min-width: 220px;
}

.gallery-cta__title {
    font-size: 1.25rem;
    font-weight: var(--font-weight-bold);
    color: var(--color-white);
    margin-bottom: 6px;
}

.gallery-cta__text {
    font-size: var(--font-size-sm);
    color: rgba(255, 255, 255, 0.88);
    margin: 0;
    line-height: 1.5;
}

.gallery-cta__btn {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 14px 28px;
    background: var(--color-white);
    color: var(--color-primary);
    font-size: var(--font-size-sm);
    font-weight: var(--font-weight-semibold);
    border-radius: var(--radius-full);
    text-decoration: none;
    transition: all 0.3s ease;
    white-space: nowrap;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
}

.gallery-cta__btn:hover {
    color: var(--color-primary-dark);
    transform: translateY(-2px);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.16);
}

/* ---- Responsive ---- */
@media (max-width: 1199.98px) {
    .gallery-page__grid {
        grid-template-columns: repeat(3, 1fr);
        grid-auto-rows: 180px;
    }

    .gallery-page__item--wide,
    .gallery-page__item--large {
        grid-column: span 2;
    }
}

@media (max-width: 991.98px) {
    .gallery-hero {
        min-height: 380px;
        padding: 110px 0 80px;
    }

    .gallery-hero__bg {
        background-position: 70% center;
    }

    .gallery-hero__overlay {
        background: linear-gradient(180deg,
            rgba(255, 251, 247, 0.95) 0%,
            rgba(255, 251, 247, 0.82) 55%,
            rgba(255, 251, 247, 0.35) 100%);
    }

    .gallery-page__grid {
        grid-template-columns: repeat(2, 1fr);
        grid-auto-rows: 170px;
    }

    .gallery-page__item--tall {
        grid-row: span 1;
    }

    .gallery-page__item--wide,
    .gallery-page__item--large {
        grid-column: span 2;
        grid-row: span 1;
    }

    .gallery-filter-bar {
        justify-content: center;
    }
}

@media (max-width: 767.98px) {
    .gallery-toolbar-wrap {
        margin-top: -24px;
    }

    .gallery-filter-bar__btn {
        padding: 10px 14px;
        font-size: 0.8rem;
    }

    .gallery-filter-bar__btn span {
        display: none;
    }

    .gallery-filter-bar__btn i {
        font-size: 16px;
    }

    .gallery-page__header {
        flex-direction: column;
        align-items: flex-start;
    }

    .gallery-page__controls {
        width: 100%;
        justify-content: space-between;
    }

    .gallery-page__grid {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 14px;
    }

    .gallery-page__item--wide,
    .gallery-page__item--large,
    .gallery-page__item--tall {
        grid-column: span 1;
        grid-row: span 1;
    }

    .gallery-page__thumb {
        height: 220px;
    }

    .gallery-cta__inner {
        flex-direction: column;
        text-align: center;
        padding: 32px 0;
    }

    .gallery-cta__btn {
        width: 100%;
        justify-content: center;
    }

    .gallery-cta__decor {
        font-size: 90px;
        right: 2%;
        opacity: 0.5;
    }
}

@media (max-width: 575.98px) {
    .gallery-hero__title {
        font-size: 2.25rem;
    }

    .gallery-hero__wave svg {
        height: 50px;
    }

    .gallery-toolbar-wrap {
        margin-top: -20px;
    }
}
