/* Gallery — listing (3 cols) & album detail (flat grid) */

.gallery-page,
.gallery-detail-page {
    position: relative;
    display: block;
    width: 100%;
    clear: both;
    float: none !important;
    padding-bottom: 64px;
    overflow: hidden;
}

.gallery-page {
    margin-top: 100px !important;
}

.gallery-detail-page.image-bank-container {
    margin-top: 100px !important;
    margin-bottom: 0 !important;
    padding: 0 !important;
}

.gallery-page__bg,
.gallery-detail-page__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    pointer-events: none;
    background:
        radial-gradient(ellipse 60% 45% at 5% 0%, rgba(30, 64, 127, 0.07), transparent 55%),
        radial-gradient(ellipse 50% 40% at 95% 20%, rgba(0, 150, 136, 0.05), transparent 50%);
}

.gallery-page__inner,
.gallery-detail-page__inner {
    position: relative;
    z-index: 2;
}

/* Listing — 3 albums per row */
.gallery-albums-row {
    clear: both;
    width: 100%;
    float: left;
}

.gallery-albums-row > [class*="col-"] {
    float: none;
    display: block;
}

.gallery-albums-row__item {
    animation: galleryFadeUp 0.5s ease backwards;
    animation-delay: calc(var(--gallery-delay, 1) * 0.06s);
}

@keyframes galleryFadeUp {
    from {
        opacity: 0;
        transform: translateY(14px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.gallery-album-card {
    float: none !important;
    width: 100% !important;
    margin: 0;
    border-radius: 18px;
    overflow: hidden;
    box-shadow: 0 10px 36px rgba(15, 35, 80, 0.1);
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.4s ease;
}

.gallery-album-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 18px 48px rgba(15, 35, 80, 0.16);
}

.gallery-album-card__link {
    display: block;
    width: 100%;
    text-decoration: none !important;
    color: inherit;
}

.gallery-album-card__link:focus-visible {
    outline: 2px solid var(--webiste-second-color);
    outline-offset: 3px;
    border-radius: 18px;
}

.gallery-album-card__media {
    position: relative;
    width: 100%;
    padding-bottom: 118%;
    height: 0;
    background-position: center;
    background-repeat: no-repeat;
    background-size: cover;
    overflow: hidden;
    transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-album-card:hover .gallery-album-card__media {
    transform: scale(1.04);
}

.gallery-album-card__shade {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        180deg,
        transparent 35%,
        rgba(6, 14, 32, 0.82) 100%
    );
    pointer-events: none;
}

.gallery-album-card__hover {
    position: absolute;
    top: 16px;
    right: 16px;
    z-index: 3;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.95);
    color: var(--webiste-second-color);
    box-shadow: 0 6px 20px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
}

.gallery-album-card__hover ion-icon {
    font-size: 20px;
}

.gallery-album-card:hover .gallery-album-card__hover {
    opacity: 1;
    transform: scale(1);
}

.gallery-album-card__overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 22px 20px 20px;
    pointer-events: none;
}

.gallery-album-card__title {
    float: left;
    width: 100%;
    margin: 0 0 8px !important;
    padding: 0 !important;
    font-family: Outfit, sans-serif !important;
    font-size: 18px !important;
    font-weight: 600 !important;
    line-height: 1.3 !important;
    color: #fff !important;
    text-shadow: 0 1px 12px rgba(0, 0, 0, 0.35);
}

.gallery-album-card__count {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-family: Outfit, sans-serif;
    font-size: 12px;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.88);
}

.gallery-album-card__count ion-icon {
    font-size: 14px;
}

/* Empty */
.gallery-empty {
    text-align: center;
    padding: 48px 24px;
    font-family: Outfit, sans-serif;
    color: var(--webiste-text-color);
    background: rgba(255, 255, 255, 0.65);
    border: 1px dashed rgba(30, 64, 127, 0.18);
    border-radius: 20px;
}

.gallery-empty ion-icon {
    display: block;
    font-size: 44px;
    margin: 0 auto 14px;
    color: var(--webiste-second-color);
    opacity: 0.65;
}

.gallery-empty p {
    margin: 0;
    font-size: 15px;
    opacity: 0.75;
}

.gallery-empty--inline {
    float: left;
    width: 100%;
}

/* Detail — nav & intro */
.gallery-detail-nav {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
    float: left;
    margin-bottom: 20px;
}

.gallery-detail-back {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 10px 18px 10px 12px;
    font-family: Outfit, sans-serif;
    font-size: 14px;
    font-weight: 500;
    color: var(--webiste-text-color) !important;
    text-decoration: none !important;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid rgba(0, 0, 0, 0.06);
    border-radius: 100px;
    box-shadow: 0 4px 14px rgba(15, 35, 80, 0.06);
    transition: transform 0.25s ease;
}

.gallery-detail-back:hover {
    transform: translateX(-3px);
    color: var(--webiste-second-color) !important;
}

.gallery-detail-back__icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(30, 64, 127, 0.08);
    color: var(--webiste-second-color);
}

.gallery-detail-back__icon ion-icon {
    font-size: 17px;
}

.gallery-detail-badge {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
    font-family: Outfit, sans-serif;
    font-size: 12px;
    font-weight: 600;
    color: var(--webiste-second-color);
    background: rgba(30, 64, 127, 0.08);
    border-radius: 100px;
}

.gallery-detail-intro {
    float: left;
    width: 100%;
    margin-bottom: 28px;
    padding: 0 2px;
}

.gallery-detail-intro h1 {
    float: left;
    width: 100%;
    margin: 0 0 10px !important;
    padding: 0 !important;
    font-family: Caveat, cursive !important;
    font-size: 40px !important;
    font-weight: 700 !important;
    line-height: 1.1 !important;
    color: var(--webiste-second-color) !important;
}

.gallery-detail-intro p {
    float: left;
    width: 100%;
    max-width: 720px;
    margin: 0 !important;
    font-family: Outfit, sans-serif !important;
    font-size: 15px !important;
    line-height: 1.65 !important;
    color: var(--webiste-text-color) !important;
    opacity: 0.82;
}

/* Masonry — flat (no cards) */
.gallery-masonry-wrap {
    float: left;
    width: 100%;
}

.gallery-masonry-grid.masonry-grid-container {
    float: left;
    width: 100%;
    position: relative;
}

.gallery-masonry-sizer {
    position: absolute;
    visibility: hidden;
    height: 0;
    margin: 0 !important;
    padding: 0 !important;
    pointer-events: none;
}

.gallery-masonry-item {
    position: relative;
    box-sizing: border-box;
    padding-bottom: 14px !important;
    animation: galleryFadeUp 0.45s ease backwards;
    animation-delay: calc(var(--gallery-delay, 1) * 0.04s);
}

.gallery-masonry-item__link {
    display: block;
    float: left;
    width: 100%;
    text-decoration: none !important;
    border-radius: 14px;
    overflow: hidden;
}

.gallery-masonry-item__media {
    position: relative;
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 14px;
    background: #0f1f3d;
}

.gallery-masonry-item__media img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 0 !important;
    transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}

.gallery-masonry-item:hover .gallery-masonry-item__media img {
    transform: scale(1.04);
}

.gallery-masonry-item__media--video {
    border-radius: 14px;
    overflow: hidden;
}

.gallery-masonry-item__media--video video {
    display: block;
    width: 100%;
    height: auto;
    vertical-align: top;
}

.gallery-masonry-item__mute {
    position: absolute;
    left: 12px;
    bottom: 12px;
    z-index: 3;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--webiste-second-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
}

.gallery-masonry-item__mute:hover {
    transform: scale(1.06);
    background: #fff;
}

.gallery-masonry-item__mute ion-icon {
    font-size: 18px;
    pointer-events: none;
}

.gallery-masonry-item__zoom {
    position: absolute;
    right: 12px;
    bottom: 12px;
    z-index: 2;
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.92);
    color: var(--webiste-second-color);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.15);
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.28s ease, transform 0.28s ease;
    pointer-events: none;
}

.gallery-masonry-item__zoom ion-icon {
    font-size: 18px;
}

.gallery-masonry-item:hover .gallery-masonry-item__zoom {
    opacity: 1;
    transform: scale(1);
}

.gallery-masonry-item__badge {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 2;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.92);
    color: var(--webiste-primary-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.gallery-masonry-item__badge ion-icon {
    font-size: 16px;
}

.gallery-masonry-item__caption {
    float: left;
    width: 100%;
    padding: 10px 4px 0;
}

.gallery-masonry-item__caption h2 {
    float: left;
    width: 100%;
    margin: 0 0 4px !important;
    padding: 0 !important;
    font-family: Outfit, sans-serif !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    color: var(--webiste-text-color) !important;
}

.gallery-masonry-item__caption p {
    float: left;
    width: 100%;
    margin: 0 !important;
    font-family: Outfit, sans-serif !important;
    font-size: 12px !important;
    line-height: 1.45 !important;
    color: var(--webiste-text-color) !important;
    opacity: 0.7;
}

/* 4 columns masonry = ~3 on tablet, 2 mobile */
.gallery-masonry-grid .masonry-section-item-4 {
    width: calc(25% - 11px) !important;
}

.gallery-detail-page.image-bank-item-page .masonry-section-item h2,
.gallery-detail-page.image-bank-item-page .masonry-section-item p {
    font-family: Outfit, sans-serif !important;
}

@media screen and (max-width: 991px) {
    .gallery-masonry-grid .masonry-section-item-4 {
        width: calc(33.3333% - 10px) !important;
    }
}

@media screen and (max-width: 760px) {
    .gallery-page,
    .gallery-detail-page.image-bank-container {
        margin-top: 70px !important;
    }

    .gallery-album-card__media {
        padding-bottom: 110%;
    }

    .gallery-album-card__title {
        font-size: 16px !important;
    }

    .gallery-detail-intro h1 {
        font-size: 30px !important;
    }

    .gallery-masonry-grid .masonry-section-item-4 {
        width: calc(50% - 8px) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .gallery-albums-row__item,
    .gallery-masonry-item,
    .gallery-album-card,
    .gallery-album-card__media {
        animation: none;
        transition: none;
    }

    .gallery-album-card:hover {
        transform: none;
    }
}
