.horizontal-gallery {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(100px, 1fr);
    grid-template-rows: repeat(2, minmax(0, 0.85fr));

    gap: 0.8rem;
    padding: 0.5rem 0;
    width: 100%;
    max-width: 90%;
    box-sizing: border-box;

    overflow-x: auto;
    overflow-y: hidden;
    scroll-snap-type: x mandatory;
    cursor: grab;
    scroll-behavior: smooth;
    user-select: none;
}

.horizontal-gallery::-webkit-scrollbar {
    height: 6px;
}

.gallery-item {
    background: white;
    width: 100%;
    max-width: 90%;
    height: 100%;
    max-height: 90%;
    padding: 5px 5px 20px;
    box-sizing: border-box;
    box-shadow: 0 4px 10px rgba(0,0,0,0.15);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    border: 1px solid #000;
    scroll-snap-align: center;
}

.gallery-item img {
    width: 100%;
    max-width: 100%;
    height: 100%;
    max-height: 90%;
    object-fit: cover;
    border-style: solid;
    border-width: 1px;
    margin: none;
}

.gallery-item span {
    font-size: 0.9rem;
    color: #555;
    font-style: italic;
    text-align: center;
    padding: 0 4px;
}

.portfolio-image-link {
    all: unset;
    cursor: pointer;
}

.portfolio-image-link {
    display: contents;
}

@media screen and (max-width: 920px) and (orientation: landscape) {
    .horizontal-gallery {
        grid-template-rows: 1fr;
        grid-auto-columns: minmax(200px, 1fr);
    }
}

@media (max-width: 600px) and (orientation: portrait) {
    .horizontal-gallery {
        height: 65vh;
        grid-template-rows: repeat(4, minmax(0, 0.8fr));
        grid-auto-rows: minmax(0, 0.8fr);
    }
}