/* Profile gallery — All / Photos / Videos tabs over an Instagram-style grid.
   Markup: resources/views/components/profile/gallery.blade.php */
:root {
    --pgal-navy: #112b64;
    --pgal-pill: #eef1f6;
    --pgal-pill-ink: #5b6477;
    --pgal-badge: #dde2eb;
    --pgal-tile: #e9ecf2;
}

.pgal {
    background: #fff;
    border-radius: 18px;
    padding: 14px 12px 12px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .06), 0 1px 2px rgba(16, 24, 40, .04);
}

/* ── Tabs ─────────────────────────────────────────────────────────── */
.pgal-tabs {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    overflow-x: auto;
    scrollbar-width: none;
}

.pgal-tabs::-webkit-scrollbar {
    display: none;
}

.pgal-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    flex: 0 0 auto;
    padding: 6px 8px 6px 12px;
    border: 0;
    border-radius: 999px;
    background: var(--pgal-pill);
    color: var(--pgal-pill-ink);
    font-size: 13px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background-color .2s ease, color .2s ease;
}

.pgal-tab:hover {
    background: #e3e7ef;
}

.pgal-tab:focus-visible {
    outline: 2px solid var(--pgal-navy);
    outline-offset: 2px;
}

.pgal-tab.is-active {
    background: var(--pgal-navy);
    color: #fff;
}

.pgal-tab-icon {
    display: inline-flex;
    width: 15px;
    height: 15px;
}

.pgal-tab-icon svg {
    width: 100%;
    height: 100%;
}

.pgal-count {
    min-width: 22px;
    padding: 3px 7px;
    border-radius: 999px;
    background: var(--pgal-badge);
    color: #3b4458;
    font-size: 11px;
    font-weight: 700;
    text-align: center;
}

.pgal-tab.is-active .pgal-count {
    background: #fff;
    color: var(--pgal-navy);
}

/* ── Grid ─────────────────────────────────────────────────────────── */
.pgal-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 4px;
}

.pgal-item[hidden] {
    display: none;
}

@media (min-width: 768px) {
    .pgal-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        gap: 6px;
    }
}

@media (min-width: 1200px) {
    .pgal-grid {
        grid-template-columns: repeat(6, minmax(0, 1fr));
    }
}

.pgal-item {
    position: relative;
    display: block;
    aspect-ratio: 10 / 11;
    overflow: hidden;
    border-radius: 8px;
    background: var(--pgal-tile);
}

.pgal-item img,
.pgal-item video {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform .3s ease;
}

/* A failed image falls back to the grey tile instead of wrapped alt text. */
.pgal-item img {
    font-size: 0;
    color: transparent;
}

.pgal-item video {
    pointer-events: none;
}

.pgal-item:hover img,
.pgal-item:hover video {
    transform: scale(1.04);
}

.pgal-item::after {
    content: "";
    position: absolute;
    inset: 0;
    pointer-events: none;
    background: linear-gradient(to top, rgba(0, 0, 0, .35), transparent 35%);
    opacity: 0;
}

.pgal-item--video::after {
    opacity: 1;
}

/* ── Video badges ─────────────────────────────────────────────────── */
.pgal-play {
    position: absolute;
    top: 6px;
    right: 6px;
    z-index: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    background: rgba(17, 24, 39, .55);
    color: #fff;
}

.pgal-play svg {
    width: 12px;
    height: 12px;
    margin-left: 1px;
}

.pgal-duration {
    position: absolute;
    left: 6px;
    bottom: 5px;
    z-index: 1;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .6);
}

.pgal-duration:empty {
    display: none;
}
