/* ============================================================
   DISCOVERY CAROUSEL — harmonised with the design system
   ============================================================ */

#discovery-carousel,
#ipad-carousel {
    position: relative;
    display: flex;
    flex-direction: column;
    height: auto;
    width: 100%;
    margin: 0 auto clamp(2rem, 6vh, 4rem);
    overflow: hidden;
}

.carousel-container {
    display: flex;
    align-items: center;
    position: relative;
}

.carousel-track {
    display: flex;
    gap: 16px;
    /* start aligned with the page content (centred 1320 container), not flush
       to the gutter — gives the first slide breathing room on wide screens */
    margin-left: max(var(--gutter), calc((100% - 1320px) / 2 + var(--gutter)));
    transition: transform 0.5s var(--ease-out);
    will-change: transform;
    cursor: grab;
}
.carousel-track.dragging { cursor: grabbing; }

.carousel-slide {
    flex: 0 0 calc(43.333% - 16px); /* ~2.5 images in view */
    max-width: calc(43.333% - 16px);
    box-sizing: border-box;
}

.carousel-slide img,
.carousel-slide video {
    display: block;
    width: 100%;
    height: 100%;
    border-radius: 8px;
    border: 1px solid var(--line-soft);
    object-fit: cover;
    -webkit-user-drag: none;
    user-select: none;
}

.carousel-chevron {
    position: absolute;
    width: var(--gutter);
    min-width: 48px;
    height: 101%;
    top: 50%;
    transform: translateY(-50%);
    background: linear-gradient(90deg, var(--ink), rgba(11, 11, 12, 0));
    color: var(--bone-dim);
    border: none;
    font-size: 32px;
    padding: 8px;
    cursor: pointer;
    z-index: 10;
    transition: color 0.3s ease, margin 0.3s var(--ease-out);
}
html[data-theme="light"] .carousel-chevron {
    background: linear-gradient(90deg, var(--ink), rgba(255, 255, 255, 0));
}
.carousel-chevron.right {
    background: linear-gradient(270deg, var(--ink), rgba(11, 11, 12, 0));
}
html[data-theme="light"] .carousel-chevron.right {
    background: linear-gradient(270deg, var(--ink), rgba(255, 255, 255, 0));
}

.carousel-chevron:hover { color: var(--accent); }
.carousel-chevron.left { left: 0; }
.carousel-chevron.right { right: 0; }
.carousel-chevron.left:hover { margin-left: -6px; }
.carousel-chevron.right:hover { margin-right: -6px; }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
}

.carousel-dots button {
    margin-top: 2px;
    width: 8px;
    height: 8px;
    border-radius: 16px;
    border: none;
    background: var(--bone-faint);
    cursor: pointer;
    transition: all 0.3s var(--ease-out);
}

.carousel-dots button.active {
    background: var(--accent-gradient);
    margin-top: 0;
    width: 32px;
    height: 12px;
}

@media (max-width: 768px) {
    .carousel-track { margin-left: var(--gutter); gap: 8px; }
}
