/* Reset box sizing and layout */
.mtg-gallery-grid,
.mtg-gallery-grid * {
    box-sizing: border-box;
}

/* Grid container */
.mtg-gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 15px;
    margin: 20px auto;
    max-width: 1200px;
    padding: 10px;
    width: 100%;
}

/* Each gallery item */
.mtg-gallery-item {
    width: 100%;
    position: relative;
    display: inline-block;
}

/* Image thumbnails */
.mtg-gallery-item img {
    width: 100% !important;
    aspect-ratio: 1 / 1;
    height: auto !important;
    object-fit: cover;
    border-radius: 6px;
    transition: transform 0.2s ease;
    display: block;
    cursor: pointer;
}

/* Hover effect */
.mtg-gallery-item img:hover {
    transform: scale(1.03);
}

/* SQL number label */
.mtg-sql-number {
    position: absolute;
    bottom: 3px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.75);
    color: #fff;
    padding: 3px 8px;
    font-size: 14px;
    font-weight: bold;
    border-radius: 4px;
    pointer-events: none;
    font-family: monospace;
}

/* Lightbox overlay */
.mtg-lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(10, 10, 10, 0.95);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    padding: 40px;
    box-sizing: border-box;
}

/* Lightbox image */
.mtg-lightbox-overlay img {
    max-width: 100%;
    max-height: 100%;
    border-radius: 10px;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
    background: black;
}

/* Close button */
.mtg-lightbox-close {
    position: absolute;
    top: 25px;
    right: 25px;
    font-size: 40px;
    color: white;
    font-weight: bold;
    cursor: pointer;
    z-index: 10000;
    background: none;
    border: none;
    transition: opacity 0.2s ease;
}

.mtg-lightbox-close:hover {
    opacity: 0.6;
}

/* Navigation arrows */
.mtg-lightbox-arrow {
    position: absolute;
    bottom: 20px;
    font-size: 2rem;
    color: white;
    background: rgba(0, 0, 0, 0.7);
    width: 40px;
    height: 40px;
    text-align: center;
    line-height: 40px;
    border-radius: 4px;
    margin: 0 10px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background 0.2s;
    z-index: 10001;
}

.mtg-lightbox-arrow:hover {
    background: rgba(255, 255, 255, 0.2);
}

.mtg-lightbox-prev {
    left: 40px;
}

.mtg-lightbox-next {
    right: 40px;
}

.mtg-lightbox-nav {
    position: absolute;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 40px;
    z-index: 10001;
}

.mtg-lightbox-prev::before {
    content: "▶";
}

.mtg-lightbox-next::before {
    content: "◀";
}

/* Pagination */
.mtg-pagination-wrapper {
    margin: 30px auto;
    max-width: 1200px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    padding: 10px;
    border: none; /* Removed border */
}

.mtg-page-info {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 10px;
}

.mtg-page-links {
    display: flex;
    gap: 6px;
    margin-bottom: 10px;
}

.mtg-page-link {
    display: inline-block;
    padding: 5px 10px;
    background-color: #002964; /* Navy */
    color: #fff;
    text-decoration: none;
    border-radius: 4px;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.mtg-page-link:hover {
    background-color: #001b3e; /* Darker navy on hover */
}

.mtg-page-link.current {
    background-color: #c15100; /* Highlight current page */
    pointer-events: none;
}

.mtg-ellipsis {
    display: inline-block;
    padding: 5px 10px;
    font-size: 14px;
    color: #333;
}
