/* ==========================================================================
   Accommodation list, grouped by star rating
   ========================================================================== */

.orvix-stays__group + .orvix-stays__group {
    margin-top: 32px;
}

.orvix-stays__heading {
    margin: 0 0 16px;
    font-size: 20px;
    line-height: 1.3;
}

/* Fixed column counts rather than auto-fit, so a group holding one hotel shows
   a card the same width as every other group's - auto-fit would stretch that
   lone card across the whole row and the groups would not line up.

   Breakpoints match the ones in product-gallery.js, which is the set used
   everywhere else in this plugin. */
.orvix-stays__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

@media (max-width: 991px) {
    .orvix-stays__grid {
        grid-template-columns: repeat(3, 1fr);
        gap: 20px;
    }
}

/* Below 767px the grid stops wrapping and becomes a horizontal scroller.
   Wrapping on a phone pushes the later groups far down the page; scrolling
   keeps each group one row tall, so all three headings stay reachable.

   Cards are sized so the next one is partly visible - that peek is what tells
   a reader there is more to the right, since a touch device shows no
   scrollbar until you actually scroll. */
@media (max-width: 767px) {
    .orvix-stays__grid {
        display: flex;
        grid-template-columns: none;
        gap: 16px;
        overflow-x: auto;
        scroll-snap-type: x proximity;
        -webkit-overflow-scrolling: touch;
        /* Room for the scrollbar so it never sits on top of the stars. */
        padding-bottom: 10px;
    }

    /* A fixed width rather than a percentage, so a card is the same size on
       every phone and the image can be sized once for all of them.

       max-width caps it on the narrowest handsets: at 320px a 300px card would
       leave no room for the next one to peek through, and that peek is the only
       hint that the row scrolls. */
    .orvix-stays__grid > .orvix-stay-card {
        flex: 0 0 300px;
        max-width: 80vw;
        scroll-snap-align: start;
    }

    .orvix-stays__grid::-webkit-scrollbar {
        height: 4px;
    }
    .orvix-stays__grid::-webkit-scrollbar-track {
        background: rgba(0, 0, 0, 0.06);
        border-radius: 2px;
    }
    .orvix-stays__grid::-webkit-scrollbar-thumb {
        background: rgba(0, 0, 0, 0.25);
        border-radius: 2px;
    }
}


.orvix-stay-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    text-decoration: none;
    color: inherit;
}

.orvix-stay-card__thumb {
    display: block;
    width: 100%;
    overflow: hidden;
    border-radius: 8px;
}

.orvix-stay-card__img {
    display: block;
    width: 100%;
    height: auto;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.orvix-stay-card:hover .orvix-stay-card__img {
    transform: scale(1.04);
}

.orvix-stay-card__title {
    font-weight: 600;
    text-align: center;
    line-height: 1.4;
}

/* The card is the link, so it needs a visible focus ring of its own. */
.orvix-stay-card:focus-visible {
    outline: 2px solid #1a1a1a;
    outline-offset: 4px;
    border-radius: 10px;
}
