/* ============================================================
   FRESH IMAGE GALLERY – 100% unique classes, no conflicts
   ============================================================ */

/* ---- Grid Container ---- */
.fresh-gallery-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr); /* equal columns */
    gap: 1.5rem;
    margin: 1.5rem 0;
    align-items: stretch;      /* make all cells the same height */
    justify-items: stretch;    /* make all cells the same width */
}

/* ---- Each Card ---- */
.fresh-gallery-card {
    display: flex;
    flex-direction: column;
    text-align: center;
    background: transparent;
    border: none;
    padding: 0;
    margin: 0;
    box-shadow: none;
    min-width: 0;              /* prevent overflow from large images */
    width: 100%;               /* ensure it fills the grid cell */
}

/* ---- Image Link (square container) ---- */
.fresh-gallery-link {
    display: block;
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    background: #f5f5f5;
    text-decoration: none;
    padding: 0;
    margin: 0;
}

/* Square via pseudo-element */
.fresh-gallery-link::before {
    content: '';
    display: block;
    padding-bottom: 100%; /* 1:1 */
}

/* ---- Image (fills the square) ---- */
.fresh-gallery-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.25s ease;
}

.fresh-gallery-link:hover .fresh-gallery-image {
    transform: scale(1.06);
}

/* ---- Card Title ---- */
.fresh-gallery-card-title {
    margin: 0.6rem 0 0;
    padding: 0 0.2rem;
    font-size: 0.95rem;
    font-weight: 600;
    line-height: 1.3;
    color: #1e1e1e;
    word-break: break-word;   /* prevent long titles breaking layout */
}

.fresh-gallery-card-title a {
    color: inherit;
    text-decoration: none;
}

.fresh-gallery-card-title a:hover {
    color: #0073aa;
}

/* ---- Caption ---- */
.fresh-gallery-caption {
    margin: 0.2rem 0 0;
    padding: 0 0.2rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: #666;
    text-align: center;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* ---- Section Title ---- */
.fresh-gallery-title {
    margin-bottom: 0.5rem;
}

.fresh-gallery-search-term {
    font-weight: normal;
    font-size: 0.9em;
    color: #666;
}

/* ---- Responsive (matches Elements) ---- */
@media (max-width: 1024px) {
    .fresh-gallery-grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 1.2rem;
    }
}
@media (max-width: 768px) {
    .fresh-gallery-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 1rem;
    }
}
@media (max-width: 480px) {
    .fresh-gallery-grid {
        grid-template-columns: 1fr 1fr;
        gap: 0.8rem;
    }
    .fresh-gallery-card-title {
        font-size: 0.8rem;
        margin-top: 0.3rem;
    }
    .fresh-gallery-caption {
        display: none;
    }
}