/* ==========================================================================
   968Forums Gallery - Style Overrides & Lightbox Enhancement
   
   INSTALLATION:
   Add to your headerinclude template or paste into global.css:
   <link rel="stylesheet" type="text/css" href="{$mybb->asset_url}/968gallery_custom.css" />
   ========================================================================== */

/* --------------------------------------------------------------------------
   CATEGORY GRID: Better card layout on index page
   -------------------------------------------------------------------------- */

.gallery-categories .gal-cat-card {
    background: #fff;
    border: 1px solid #dde2e8;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.2s, box-shadow 0.2s;
}

.gallery-categories .gal-cat-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.1);
}

.gallery-categories .gal-cat-card img {
    width: 100%;
    height: 150px;
    object-fit: cover;
    display: block;
}

.gallery-categories .gal-cat-card .gal-cat-info {
    padding: 8px 12px;
}

.gallery-categories .gal-cat-card .gal-cat-info a {
    font-weight: 600;
    font-size: 13px;
}
/* Hide subcategory pill links on gallery index cards */
div[style="margin-top:6px"] {
    display: none !important;
}

/* --------------------------------------------------------------------------
   IMAGE GRID: Better thumbnail cards in category view
   -------------------------------------------------------------------------- */
.gallery-grid {
    gap: 12px !important;
    padding: 12px;
}

.gal-grid-item {
    background: #fff;
    border: 1px solid #eaedf0;
    border-radius: 8px;
    overflow: hidden;
    transition: transform 0.15s, box-shadow 0.15s;
}

.gal-grid-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.1);
}

.gal-grid-item a.gal-thumb img {
    border-radius: 0 !important;
    aspect-ratio: 4/3;
    object-fit: cover;
}

.gal-grid-item .smalltext {
    padding: 6px 8px 10px;
}

/* --------------------------------------------------------------------------
   SHOW PAGE: Image display improvements
   -------------------------------------------------------------------------- */

/* Make the image container better */
.tborder td[style*="text-align:center"] img {
    max-width: 100%;
    height: auto;
    cursor: pointer;
    border-radius: 4px;
    transition: opacity 0.15s;
}

.tborder td[style*="text-align:center"] img:hover {
    opacity: 0.92;
}

/* Image info bar - cleaner */
.tborder .trow2.smalltext {
    padding: 10px 16px;
    color: #666;
    border-top: 1px solid #eaedf0;
}

/* Action buttons row */
.button {
    display: inline-block;
    padding: 6px 14px;
    margin: 4px 2px;
    background: #f5f5f5;
    border: 1px solid #ccc;
    border-radius: 4px;
    color: #333;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.15s;
    text-decoration: none;
}

.button:hover {
    background: #e8e8e8;
    border-color: #999;
}

/* --------------------------------------------------------------------------
   BUILT-IN VIEWER: Style improvements
   -------------------------------------------------------------------------- */
.galv {
    backdrop-filter: blur(4px);
}

.galv-main img {
    border-radius: 4px !important;
    border: none !important;
    box-shadow: 0 8px 32px rgba(0,0,0,0.5);
}

.galv-close {
    font-size: 13px;
    font-weight: 600;
    border-radius: 6px !important;
    padding: 8px 14px !important;
}

.galv-nav {
    width: 44px !important;
    height: 44px !important;
    font-size: 18px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.3);
}

.galv-thumb {
    border-radius: 4px !important;
    padding: 2px !important;
}

.galv-thumb.active {
    border-color: #d4a84b !important;
    box-shadow: 0 0 0 2px rgba(212,168,75,0.4) !important;
}

.galv-thumbs {
    background: rgba(0,0,0,0.4) !important;
    padding: 10px 60px !important;
}

/* --------------------------------------------------------------------------
   COMMENTS: Cleaner styling
   -------------------------------------------------------------------------- */
.tborder .trow1 .smalltext,
.tborder .trow2 .smalltext {
    font-size: 12px;
    line-height: 1.5;
}

/* --------------------------------------------------------------------------
   RESPONSIVE
   -------------------------------------------------------------------------- */
@media (max-width: 768px) {
    .gallery-categories {
        grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
        gap: 10px;
        padding: 8px;
    }
    
    .gallery-categories .gal-cat-card img {
        height: 100px;
    }
    
    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
    }

/* Gallery grid mobile responsiveness */

    .gallery-grid {
        grid-template-columns: repeat(2, 1fr) !important;
        gap: 8px !important;
        padding: 8px !important;
    }
    
    .gal-grid-item .smalltext {
        font-size: 11px;
    }
    div[style*="width:180px;display:inline-block"] {
        width: 45% !important;
        margin: 4px !important;
    }
    @media (max-width: 768px) {
    div.gallery-grid[style] {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
        gap: 6px !important;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        grid-template-columns: repeat(1, 1fr) !important;
    }
    div[style*="width:180px;display:inline-block"] {
        width: 100% !important;
    }
    @media (max-width: 480px) {
    div.gallery-grid[style] {
        grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
    }
}

