/**
 * AGS Project Gallery - Mobile Styles
 * Optimizes the project gallery for mobile devices
 */
/* ==========================================================================
   Gallery Options Bar - Compact Fixed Header
   ========================================================================== */
/* Reduce top position to account for smaller mobile header */
.agsGalleryPage #agsGalleryOptions {
    top: 50px;
    padding: 6px 8px;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}
/* Hide scrollbar for Chrome/Safari */
.agsGalleryPage #agsGalleryOptions::-webkit-scrollbar {
    display: none;
}
/* Flex container - single row, no wrapping */
.agsGalleryPage .agsProjectGalleryOptions .agsFlexOptions {
    display: flex;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
}
/* Individual option containers */
.agsGalleryPage .agsProjectGalleryOptions .agsGalleryOption {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-shrink: 0;
}
/* Compact form controls */
.agsGalleryPage .agsProjectGalleryOptions select,
.agsGalleryPage .agsProjectGalleryOptions input {
    padding: 4px 6px;
    font-size: 14px;
    max-width: 130px;
    min-width: auto;
}
/* Search input - slightly wider */
.agsGalleryPage #agsSearchGalleries {
    max-width: 110px;
}
/* Hide "Projects per Page" text, keep select only */
.agsGalleryPage .agsGalleryOption:last-child {
    font-size: 0;
    color: transparent;
}
/* Result count - compact */
.agsGalleryPage #agsNumResults {
    font-size: 12px;
    padding-right: 4px;
    flex-shrink: 0;
}
/* ==========================================================================
   Pagination - Move to Bottom on Mobile
   ========================================================================== */
/* Remove pagination from top fixed area */
.agsGalleryPage #agsPaginationWrapper {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #333;
    padding: 8px 4px;
    z-index: 9998;
    margin: 0;
    border-top: 1px solid #555;
}
/* Compact pagination buttons */
.agsGalleryPage .agsGalleryPagination {
    display: flex;
    flex-wrap: nowrap;
    gap: 4px;
    justify-content: flex-start;
    margin: 0;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
    padding: 2px 0;
}
.agsGalleryPage .agsGalleryPagination::-webkit-scrollbar {
    display: none;
}
.agsGalleryPage .agsPaginationBtn {
    padding: 6px 10px;
    font-size: 14px;
    min-width: 36px;
    text-align: center;
    cursor: pointer;
    user-select: none;
    border-radius: 4px;
    background: #f3f3f3;
    color: #063357;
    flex-shrink: 0;
    white-space: nowrap;
}
.agsGalleryPage .agsPaginationBtn:hover {
    background: #e8e8e8;
}
.agsGalleryPage .agsPaginationBtn.is-active {
    background-color: #0b56ff;
    color: #fff;
}
/* ==========================================================================
   Gallery Container - Adjust for New Layout
   ========================================================================== */
/* Reduce top padding for shorter header, add bottom padding for bottom pagination */
.agsGalleryPage #agsGalleryContainer {
    padding-top: 50px;
    padding-bottom: 70px;
}
/* Gallery grid adjustments */
.agsGalleryPage #agsElementHeight {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 12px;
    padding: 10px 8px 20px;
}
/* Full-width cards on small mobile */
.agsGalleryPage .agsGalleryRow {
    width: 92vw;
    max-width: 100%;
    margin: 0;
}
/* Card link styling */
.agsGalleryPage .agsGalleryCardLink {
    position: relative;
    height: 220px;
    border-radius: 6px;
    border: 2px solid #eee;
    box-shadow: 0 0 0 2px #777;
    overflow: hidden;
    display: block;
    background-size: cover;
    background-position: center;
}
/* Larger touch targets for project names */
.agsGalleryPage .agsGalleryCardName {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    padding: 12px 14px;
    background: linear-gradient(to top, rgba(0,0,0,0.85), rgba(0,0,0,0));
    text-align: left;
    pointer-events: none;
    z-index: 2;
}
.agsGalleryPage .agsGalleryCardName h2 {
    margin: 0;
    color: #fff;
    font-size: 16px;
    line-height: 1.3;
    text-shadow: 0 1px 2px rgba(0,0,0,0.9);
    max-height: 2.6em;
    overflow: hidden;
}
/* ==========================================================================
   Very Small Screens (phones under 400px)
   ========================================================================== */
@media (max-width: 400px) {
    .agsGalleryPage #agsGalleryOptions {
        top: 45px;
        padding: 5px 6px;
    }
    .agsGalleryPage .agsProjectGalleryOptions select,
    .agsGalleryPage .agsProjectGalleryOptions input {
        font-size: 13px;
        padding: 3px 5px;
        max-width: 115px;
    }
    .agsGalleryPage #agsSearchGalleries {
        max-width: 95px;
    }
    .agsGalleryPage #agsNumResults {
        font-size: 11px;
    }
    /* Taller cards for small screens */
    .agsGalleryPage .agsGalleryCardLink {
        height: 200px;
    }
    .agsGalleryPage .agsGalleryCardName h2 {
        font-size: 15px;
    }
}
/* ==========================================================================
   Landscape Mode Optimization
   ========================================================================== */
@media (max-height: 500px) and (orientation: landscape) {
    .agsGalleryPage #agsGalleryOptions {
        top: 40px;
        padding: 4px 6px;
    }
    .agsGalleryPage #agsGalleryContainer {
        padding-top: 40px;
        padding-bottom: 55px;
    }
    .agsGalleryPage .agsGalleryCardLink {
        height: 160px;
    }
    .agsGalleryPage .agsPaginationBtn {
        padding: 4px 8px;
        font-size: 13px;
    }
}