@import url('https://api.fontshare.com/v2/css?f[]=clash-display@200,300,400,500,600,700&f[]=satoshi@300,400,500,700,900&display=swap');

:root {
    --bg-color: #000;
    --text-color: #fff;
    --accent-color: red;
    --glass-bg: rgba(255, 255, 255, 0.05);
    --transition-smooth: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Satoshi', sans-serif;
    overflow-x: hidden;
    padding: 2rem;
    min-height: 100vh;
}

.back-button {
    position: fixed;
    top: 2rem;
    left: 2rem;
    width: 50px;
    height: 50px;
    border-radius: 50%;
    border: 1px solid rgba(255, 255, 255, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    cursor: pointer;
    background: transparent;
    transition: all 0.3s ease;
    z-index: 100;
}

.back-button:hover {
    color: red;
    border-color: red;
    transform: scale(1.1);
}

.category-header {
    text-align: center;
    margin-bottom: 4rem;
    padding-top: 2rem;
}

.title {
    font-family: 'Clash Display', sans-serif;
    font-size: clamp(3rem, 10vw, 6rem);
    font-weight: 600;
    line-height: 1;
    margin-bottom: 1rem;
    color: var(--text-color);
}

.title span {
    color: var(--accent-color);
}

.subtitle {
    font-size: 1.2rem;
    opacity: 0.6;
    max-width: 600px;
    margin: 0 auto;
}

/* Masonry Layout */
.masonry-container {
    columns: 3;
    column-gap: 2rem;
    width: 100%;
    max-width: 1400px;
    margin: 0 auto 6rem auto;
    /* Added bottom margin to space out from footer */
}

.masonry-item {
    break-inside: avoid;
    margin-bottom: 2rem;
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    background: var(--glass-bg);
    cursor: pointer;
    border: 1px solid var(--accent-color);
    transition: var(--transition-smooth);
    animation: fadeInUp 0.8s ease backwards;
}

.masonry-item img {
    width: 100%;
    height: auto;
    display: block;
    transition: var(--transition-smooth);
    filter: grayscale(20%);
}

.masonry-item:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 60px rgba(255, 0, 0, 0.4);
    z-index: 10;
}

.masonry-item:hover img {
    filter: grayscale(0%);
    transform: scale(1.05);
}

/* Staggered animation delays */
.masonry-item:nth-child(1) {
    animation-delay: 0.1s;
}

.masonry-item:nth-child(2) {
    animation-delay: 0.2s;
}

.masonry-item:nth-child(3) {
    animation-delay: 0.3s;
}

.masonry-item:nth-child(4) {
    animation-delay: 0.4s;
}

.masonry-item:nth-child(5) {
    animation-delay: 0.5s;
}

.masonry-item:nth-child(6) {
    animation-delay: 0.6s;
}

.masonry-item:nth-child(7) {
    animation-delay: 0.7s;
}

.masonry-item:nth-child(8) {
    animation-delay: 0.8s;
}

/* Fade in animation */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Tablet */
@media (max-width: 1024px) {
    .masonry-container {
        columns: 2;
    }
}

/* Mobile */
@media (max-width: 600px) {
    .masonry-container {
        columns: 2;
        column-gap: 0.8rem;
        margin: 0 auto 4rem auto;
        /* responsive bottom margin */
    }

    .masonry-item {
        margin-bottom: 0.8rem;
        border-radius: 16px;
    }

    body {
        padding: 1rem;
    }

    .category-header {
        margin-bottom: 2rem;
        padding-top: 2rem;
    }

    .subtitle {
        display: none;
    }
}

/* ─── Gallery page-change fade ────────────────────────────────────────────── */
.masonry-container {
    transition: opacity 0.22s ease;
}

.masonry-container.pg-fading {
    opacity: 0;
}

/* ─── Pagination Bar ──────────────────────────────────────────────────────── */
#pagination-bar {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 2.5rem 1rem 4rem;
    flex-wrap: wrap;
    /* Thin red separator line above — mirrors the card border language */
    border-top: 1px solid rgba(255, 0, 0, 0.15);
    max-width: 1400px;
    margin: 0 auto;
}

.pg-numbers {
    display: flex;
    align-items: center;
    gap: 0.4rem;
    flex-wrap: wrap;
    justify-content: center;
}

/* Base button — default border is a dim red, matching card borders */
.pg-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2.75rem;
    height: 2.75rem;
    padding: 0 0.8rem;
    border-radius: 20px;
    border: 1px solid rgba(255, 0, 0, 0.25);
    background: transparent;
    color: rgba(255, 255, 255, 0.55);
    font-family: 'Satoshi', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.28s cubic-bezier(0.23, 1, 0.32, 1),
        border-color 0.28s cubic-bezier(0.23, 1, 0.32, 1),
        box-shadow 0.28s cubic-bezier(0.23, 1, 0.32, 1),
        color 0.22s ease,
        transform 0.22s cubic-bezier(0.23, 1, 0.32, 1);
    -webkit-tap-highlight-color: transparent;
    user-select: none;
}

/* Hover — red glow like masonry cards */
.pg-btn:hover:not(:disabled) {
    background: rgba(255, 0, 0, 0.08);
    border-color: rgba(255, 0, 0, 0.7);
    box-shadow: 0 8px 28px rgba(255, 0, 0, 0.25);
    color: #fff;
    transform: translateY(-2px);
}

/* Active / current page — solid red border, stronger glow */
.pg-btn.pg-active {
    background: rgba(255, 0, 0, 0.14);
    border-color: var(--accent-color);
    box-shadow: 0 0 18px rgba(255, 0, 0, 0.30);
    color: #fff;
    font-weight: 700;
    cursor: default;
    pointer-events: none;
}

/* Disabled arrow */
.pg-btn:disabled {
    opacity: 0.22;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Arrow buttons */
.pg-arrow {
    min-width: 2.75rem;
    padding: 0;
}

/* Ellipsis */
.pg-ellipsis {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 2rem;
    color: rgba(255, 0, 0, 0.35);
    font-size: 1rem;
    letter-spacing: 0.05em;
    user-select: none;
}

/* ── Mobile pagination ────────────────────────────────────────────────────── */
@media (max-width: 600px) {
    .pg-btn {
        min-width: 2.4rem;
        height: 2.4rem;
        font-size: 0.88rem;
        border-radius: 14px;
    }

    #pagination-bar {
        gap: 0.35rem;
        padding: 2rem 0.5rem 3rem;
    }
}