html[data-initial-view="gallery"] .list-container {
    display: none;
}

html[data-initial-view="list"] .gallery-container {
    display: none;
}

/* Style for active view buttons */
.view-toggle-button.active {
    border: 2px solid #000000;
}

/* Style for non-active view buttons */
.view-toggle-button {
    padding: 3px;
    border: 1.5px solid #c6c6c6;
    background-color: white;
    cursor: pointer;
    border-radius: 5px;
}

.list-gal-buttons {
    display: flex; 
    justify-content: space-between; 
    margin-bottom: 3px;
    margin-top: 3px;
    margin-right: 5px;
}

.gal-details {
    width: 100%;
}

.gallery-view {
    max-width: 393px;
    min-height: 460px;
    display: flex;
    flex-direction: column;
}

.gallery-view .media-slider, .gallery-view .slider-media {
    width: 393px; 
    height: 300px;
}

.gal-heading {
    font-size: 19px;
    margin-top: 4px;
    margin-bottom: 1.5px;
    margin-left: 3px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    -webkit-text-stroke: 1px rgba(0, 0, 0, 50);
}

.gallery-company-logo {
    min-width: 20px;  /* Adjust width/height to match your avatar */
    min-height: 20px;
    max-width: 20px;  /* Adjust width/height to match your avatar */
    max-height: 20px;
    border: 1.5px solid #cbcbcb;
    border-radius: 50%;
    margin-top: 4px;
    margin-left: 5px;
    z-index: 5;
    background-color: #fff;
}

.gallery-bottom-bar {
    position: absolute;
    bottom: 125px;
    width: 392px; /* Spans the full width of the listing */
    height: 30px; /* Adjust height as needed */
    background-color: #fff;
    z-index: 3; /* Below the logo */
    box-shadow: 0 -1px 5px rgba(0, 0, 0, 0.1);
    display: flex;
    align-items: center;
    border: 0.3px solid #ddd;
}

.gallery-bottom-text {
    font-size: 17px; /* Set the font size */
    color: #333; /* Text color */
    overflow: hidden; /* Hide overflowing content */
    white-space: nowrap; /* Prevent text from wrapping to the next line */
    text-overflow: ellipsis; /* Add the ellipsis for truncated text */
    max-width: 170px;
    margin-left: 3px;
}

.gallery-grid {
    display: flex;
    flex-wrap: wrap;
    padding-top: 8px;
}

.gal-created-at {
    position: absolute;
    font-size: 13px; 
    color:#777777; 
    display: flex; 
    gap: 4px; 
    bottom: 3px;
    left: 7px;
}

.gal-details .small-distance-marker {
    width: 12px; 
    height: 12px;
    margin: 1px -4px 0 -2px;
}

.short-version {
    font-size: 11px;
}

.organic-bg {
    background-color: #f0fff0;
    border: 1.25px solid rgb(157, 203, 159); 
}

.featured-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background-color: #f7e34a;
    color: #222;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.2;
    letter-spacing: 0.01em;
    padding: 3px 8px;
    border: none;
    border-radius: 999px;
    box-shadow:
        0 1px 3px rgba(0, 0, 0, 0.12),
        0 0 0 1px rgba(255, 255, 255, 0.25) inset;
    z-index: 5;
}

.map-error {
    position: absolute;
    inset: 0;
    background: #f8f8f8;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
}

.map-error-box {
    text-align: center;
    font-size: 14px;
    color: #444;
}

.map-error button {
    margin-top: 8px;
    padding: 6px 12px;
    border-radius: 6px;
    border: 1.5px solid #c1c1c1;
    background: white;
    cursor: pointer;
}

.gal-created-dist-wrapper {
    display: flex;
    gap: 4px;
}

@media (max-width: 1350px) {
    .gallery-view {
        max-width: 475px;
        min-height: 450px;
    }
    .gallery-view .media-slider, .gallery-view .slider-media {
        width: 475px; 
        height: 300px;
    }
}

@media (max-width: 1150px) {
    .gallery-view {
        max-width: 375px;
        min-height: 450px;
    }
    .gallery-view .media-slider, .gallery-view .slider-media {
        max-width: 375px;
        height: 300px;
    }
}

@media (max-width: 850px) {
    .gallery-view {
        max-width: 316px;
        min-height: 450px;
    }
    .gallery-view .media-slider, .gallery-view .slider-media {
        max-width: 316px;
        height: 280px;
    }
}

@media (max-width: 710px) {
    .gallery-view {
        max-width: 285px;
        min-height: 435px;
    }
    .gallery-view .media-slider, .gallery-view .slider-media {
        max-width: 285px;
        height: 265px;
    }
}

@media (max-width: 640px) {
    .gallery-view {
        max-width: 247px; 
        min-height: 400px;
    }
    .gallery-view .media-slider, .gallery-view .slider-media {
        width: 247px; 
        height: 227px;
    }
    .gal-created-at {
        font-size: 11px;
        flex-direction: column;
        gap: 2px;
    }
    .gal-created-separator {
        display: none;
    }
    .gal-created-dist-wrapper {
        margin-top: -2px;
    }
    .gal-details .small-distance-marker {
        width: 10px; 
        height: 10px;
        margin-top: 0.5px;
    }
}

@media (max-width: 480px) {
    .gallery-grid {
        --gallery-mobile-media-height: clamp(140px, 35vw, 165px);
        --gallery-mobile-card-min-height: 305px;
    }

    .gallery-grid {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .gallery-container {
        width: 100%;
        max-width: 100%;
        min-width: 0;
        box-sizing: border-box;
    }

    .list-container {
        grid-column: 1 / -1;
        min-width: 0;
    }

    .gallery-view .media-slider, .gallery-view .slider-media {
        width: 100%;
        max-width: 100%;
        height: var(--gallery-mobile-media-height);
        min-height: 0;
        max-height: none;
    }
    .gallery-view .media {
        width: 100%;
        max-width: 100%;
        height: 100%;
    }
    .gallery-view .slider-media {
        flex: 0 0 100%;
        min-width: 100%;
        margin-right: 0;
    }
    .gallery-view {
        width: calc(100% - 10px);
        max-width: none;
        min-width: 0;
        box-sizing: border-box;
        min-height: var(--gallery-mobile-card-min-height);
    }
    .gallery-company-logo {
        display: none;
    }
    .gal-heading {
        font-size: 14px;
        -webkit-text-stroke: 0.6px rgba(0, 0, 0, 50);
    }
    .short-version {
        font-size: 8px;
        padding: 3px;
    }
    .featured-badge {
        font-size: 0.68rem;
        padding: 2px 7px;
    }
}

/* Compact gallery card variant for allitems and similar flexible grid pages. */
.gallery-view-generic {
    max-width: 289px;
    min-height: 350px;
}

.gallery-view-generic .media-slider,
.gallery-view-generic .slider-media {
    width: 289px;
    height: 240px;
}

.gallery-view-generic .gal-heading {
    font-size: 18px;
    margin-left: 2px;
    margin-bottom: 2px;
    -webkit-text-stroke: 0.6px rgba(0, 0, 0, 50);
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
}

.gallery-view-generic .job_p {
    margin-left: 2px;
}

@media (max-width: 1350px) {
    .gallery-view-generic {
        max-width: 475px;
        min-height: 450px;
    }

    .gallery-view-generic .media-slider,
    .gallery-view-generic .slider-media {
        width: 475px;
        height: 340px;
    }
}

@media (max-width: 1150px) {
    .gallery-view-generic {
        max-width: 375px;
        min-height: 445px;
    }

    .gallery-view-generic .media-slider,
    .gallery-view-generic .slider-media {
        max-width: 375px;
        height: 340px;
    }
}

@media (max-width: 850px) {
    .gallery-view-generic {
        max-width: 316px;
        min-height: 385px;
    }

    .gallery-view-generic .media-slider,
    .gallery-view-generic .slider-media {
        max-width: 316px;
        height: 280px;
    }
}

@media (max-width: 710px) {
    .gallery-view-generic {
        max-width: 285px;
        min-height: 340px;
    }

    .gallery-view-generic .media-slider,
    .gallery-view-generic .slider-media {
        max-width: 285px;
        height: 235px;
    }
}

@media (max-width: 640px) {
    .gallery-view-generic {
        max-width: 247px;
    }

    .gallery-view-generic .media-slider,
    .gallery-view-generic .slider-media {
        width: 247px;
        height: 227px;
    }
}

@media (max-width: 480px) {
    .gallery-view-generic {
        --gallery-mobile-media-height: 140px;
        --gallery-mobile-card-min-height: 250px;
    }

    .gallery-view-generic .media-slider,
    .gallery-view-generic .slider-media {
        width: 100%;
        max-width: 100%;
        height: var(--gallery-mobile-media-height);
        min-height: 0;
        max-height: none;
    }

    .gallery-view-generic {
        width: calc(100% - 10px);
        max-width: none;
        min-width: 0;
        box-sizing: border-box;
        min-height: var(--gallery-mobile-card-min-height);
    }

    .gallery-view-generic .gal-heading {
        font-size: 13px;
    }
}
