/* GalleryPlus — modernized UI, aligned to the babyforum design tokens.
 * Albums use a flex grid (GSAP-animated); images use Isotope masonry
 * (only opacity is animated so Isotope keeps control of layout transforms).
 */

.Section-Gallery .ProfileOptions {
    display: none;
}

.GalleryBody {
    text-align: center;
}

/* ── Album grid ────────────────────────────────────────────────── */
.AlbumGridInner {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
    justify-content: flex-start;
}

.GalleryAlbum {
    position: relative;
    display: flex;
    flex-direction: column;
    width: calc((100% - 48px) / 3);
    background: var(--color-surface, #fff);
    border: 1px solid var(--color-border, #BFCAD9);
    border-radius: var(--radius-lg);
    text-align: center;
    text-decoration: none;
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-base), box-shadow var(--transition-base), border-color var(--transition-base);
}

.GalleryAlbum:hover,
.GalleryAlbum:focus-within {
    transform: translateY(-4px);
    border-color: var(--color-link, #4fc6de);
    box-shadow: var(--shadow-lg);
}

.GalleryAlbum#AddAlbum {
    border-style: dashed;
    border-width: 2px;
    background: var(--color-bg, #f6f9fc);
    box-shadow: none;
}

.GalleryAlbum#AddAlbum:hover {
    border-color: var(--color-accent, #EA6D86);
    background: var(--color-surface, #fff);
}

.GalleryAlbum .AlbumLink {
    display: block;
    color: inherit;
    text-decoration: none;
}

.GalleryAlbum .Thumbnail {
    width: 100%;
    height: 180px;
    background-size: cover;
    background-position: center;
    transition: transform var(--transition-slow);
}

.GalleryAlbum:hover .Thumbnail {
    transform: scale(1.06);
}

.GalleryAlbum .Thumbnail.Add {
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 32px auto;
    width: 92px;
    height: 92px;
    font-size: 64px;
    line-height: 1;
    border-radius: var(--radius-full);
    border: 3px solid var(--color-muted, #7e96b3);
    color: var(--color-muted, #7e96b3);
    background: none;
    transition: color var(--transition-base), border-color var(--transition-base);
}

.GalleryAlbum#AddAlbum:hover .Thumbnail.Add {
    color: var(--color-accent, #EA6D86);
    border-color: var(--color-accent, #EA6D86);
    transform: none;
}

.GalleryAlbum .Title {
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 10px 14px;
    width: 100%;
    text-align: center;
    font-family: var(--font-heading, 'Fraunces', serif);
    font-size: var(--text-lg);
    font-weight: var(--weight-semibold);
    color: var(--color-primary, #344254);
    line-height: 1.3;
}

.GalleryAlbum .AlbumOptions {
    display: flex;
    justify-content: center;
    gap: 18px;
    padding: 0 0 12px;
}

.GalleryAlbum .AlbumOptions a.AlbumOption {
    padding: 4px;
    font-size: 18px;
    color: var(--color-muted, #7e96b3);
    transition: color var(--transition-fast), transform var(--transition-fast);
}

.GalleryAlbum .AlbumOptions a.AlbumOption:hover {
    color: var(--color-accent, #EA6D86);
    transform: scale(1.12);
}

/* ── Image masonry grid ────────────────────────────────────────── */
.ImageGridInner {
    margin: 0 auto;
}

.ImageGridInner .GalleryImage {
    display: inline-block;
    text-align: center;
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    box-shadow: var(--shadow-sm);
    background: var(--color-surface, #fff);
}

.GalleryImage a.swipebox {
    display: block;
    overflow: hidden;
}

.GalleryImage img {
    display: block;
    height: auto;
    width: 100%;
    margin: 0;
    transition: transform var(--transition-slow);
}

.GalleryImage:hover img {
    transform: scale(1.05);
}

.GalleryImage .ImageOptions {
    opacity: 0;
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    padding: 8px 10px;
    background: linear-gradient(to bottom, rgba(50, 66, 93, 0.55), transparent);
    transition: opacity var(--transition-base);
    pointer-events: none;
}

.GalleryImage:hover .ImageOptions,
.GalleryImage:focus-within .ImageOptions {
    opacity: 1;
    pointer-events: auto;
}

.GalleryImage .ImageOptions a,
.GalleryImage .ImageOptions i.icon {
    color: #fff;
}

.GalleryImage .ImageOptions i.icon {
    font-size: 22px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    transition: transform var(--transition-fast);
}

.GalleryImage .ImageOptions a:hover i.icon {
    transform: scale(1.15);
}

.ImageOption.Date {
    color: #fff;
    font-size: var(--text-xs);
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.5);
    align-self: center;
}

/* ── Grid chrome ───────────────────────────────────────────────── */
.ImageGrid .Empty,
.AlbumGrid .Empty {
    text-align: center;
    color: var(--color-muted, #7e96b3);
    padding: 40px 16px;
}

.GridOptions {
    text-align: center;
    padding-top: 24px;
    color: var(--color-muted, #7e96b3);
    font-size: var(--text-sm);
}

.GridTop {
    text-align: center;
    padding-bottom: 10px;
}

/* ── Uploader ──────────────────────────────────────────────────── */
#GalleryUploadBrowse {
    width: fit-content;
    min-width: 220px;
    font-weight: var(--weight-normal);
    margin: 24px auto;
}

#Uploading {
    display: none;
}

.GalleryUpload {
    text-align: center;
    background: var(--color-bg, #f6f9fc);
    border-radius: var(--radius-md);
    padding: 10px 20px 20px;
}

.GalleryUpload .BigButton {
    width: 230px;
    margin: 5px auto;
}

.GalleryUpload .dz-preview {
    display: none;
}

/* ── Profile / panel modules ───────────────────────────────────── */
.LatestImageModule p,
.UserImagesModule .Images {
    text-align: center;
}

.LatestImageModule p .UserLink {
    font-weight: var(--weight-semibold);
}

.LatestImageModule img {
    max-width: 180px;
    height: auto;
    border-radius: var(--radius-md);
}

.UserImagesModule .Images {
    overflow: hidden;
    display: flex;
    justify-content: space-between;
    gap: 6px;
    flex-wrap: nowrap;
}

.UserImagesModule .Images a {
    width: 30%;
    overflow: hidden;
    border-radius: var(--radius-md);
}

.UserImagesModule img {
    max-height: 150px;
    width: auto;
    transition: transform var(--transition-base);
}

.UserImagesModule .Images a:hover img {
    transform: scale(1.06);
}

.GalleryContent {
    text-align: center;
}

/* ── Responsive ────────────────────────────────────────────────── */
@media (max-width: 960px) {
    .GalleryImage .ImageOptions {
        opacity: 1;
        pointer-events: auto;
    }

    .AlbumGrid {
        text-align: center;
    }

    .AlbumGridInner {
        gap: 16px;
        padding: 0 15px;
        justify-content: center;
    }

    .GalleryAlbum {
        width: calc((100% - 16px) / 2);
    }

    #GalleryUploadBrowse {
        margin: 0 auto 30px;
    }
}

@media (max-width: 560px) {
    .GalleryAlbum {
        width: 100%;
    }
}
