/* Photo carousel: home sidebar ("Новые фото на карте", "Новые лодки",
   "Популярные лодки") and the place page ("Фото рядом"). JS: carousel.js.
   --carousel-bg-rgb: the block's background, for the fade over the peeking
   next card (set it where the carousel sits on another background). */
.boat-carousel__viewport { --carousel-bg-rgb: 248, 248, 249; }

.boat-carousel__header {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 8px;
}

.boat-carousel__all-link {
    flex-shrink: 0;
    font-size: 13px;
    font-weight: 500;
    color: #6b7280;
    text-decoration: none;
    white-space: nowrap;
}
.boat-carousel__all-link:hover { color: #0b1f33; }

.boat-carousel__viewport {
    position: relative;
    margin-top: 10px;
}

/* Fades the peeking next card's photo/name into the block's own background
   instead of hard-cutting them mid-word — the block's bg color is the same
   rgb(248,248,249) on desktop and (per the mobile override further down)
   once this block gets relocated into the feed. */
.boat-carousel__viewport::after {
    content: "";
    position: absolute;
    top: 0;
    /* Matches the sliver the peeking next card actually occupies (card is
       88% wide, 12% left over minus the gap between cards) — any wider and
       the fade creeps onto the in-focus card's own photo. */
    right: 0;
    bottom: 0;
    width: calc(12% - 10px);
    background: linear-gradient(to right, rgba(var(--carousel-bg-rgb), 0), rgb(var(--carousel-bg-rgb)));
    pointer-events: none;
    z-index: 1;
}

.boat-carousel__track {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
}
.boat-carousel__track::-webkit-scrollbar { display: none; }

.boat-carousel__card {
    flex: 0 0 88%;
    min-width: 0;
    scroll-snap-align: start;
    text-decoration: none;
    display: block;
}
/* Just one card: nothing peeks from the right, so it takes the full width
   and the fade (meant for the next card's sliver) goes away. */
.boat-carousel__card:only-child { flex-basis: 100%; }
.boat-carousel__viewport:has(.boat-carousel__card:only-child)::after { display: none; }

.boat-carousel__photo {
    width: 100%;
    aspect-ratio: 16 / 9;
    border-radius: 4px;
    overflow: hidden;
    background: #e4ecf4;
    display: flex;
    align-items: center;
    justify-content: center;
}

.boat-carousel__img { width: 100%; height: 100%; object-fit: cover; display: block; }

.boat-carousel__placeholder { font-size: 28px; line-height: 1; color: #9ca3af; }

.boat-carousel__name {
    display: block;
    margin-top: 8px;
    font-size: 14px;
    font-weight: 600;
    color: #1f2933;
    line-height: 1.3;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.boat-carousel__card:hover .boat-carousel__name { color: #0b1f33; }

/* "Новые фото на карте": the author's avatar + nick instead of a boat name. */
.boat-carousel__name--author { display: flex; align-items: center; gap: 8px; }
.boat-carousel__avatar {
    width: 24px; height: 24px; border-radius: 50%; object-fit: cover; flex-shrink: 0;
}
.boat-carousel__avatar--placeholder {
    display: inline-flex; align-items: center; justify-content: center;
    background: #e4ecf4; color: #374151; font-size: 12px; font-weight: 600;
}
.boat-carousel__author-name { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.boat-carousel__arrow {
    position: absolute;
    top: 44%;
    transform: translateY(-50%);
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.92);
    color: #1f2933;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.18);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    padding: 0;
    z-index: 2;
}
.boat-carousel__arrow:hover { background: #fff; }
.boat-carousel__arrow--prev { left: 6px; }
.boat-carousel__arrow--next { right: 6px; }

/* Matches the breakpoint where index.html's own JS relocates its carousels
   into the feed column (see the mobile-interleave script) — arrows make no
   sense once touch/swipe is the only input in that layout. */
@media (max-width: 900px) {
    .boat-carousel__arrow { display: none !important; }
}
