/* Website designs carousel (theme 2.0.2), matched to the skyway.media homepage carousel (Doug 2026-11-30):
 * bare 16:9 screenshots, 15px radius, soft shadow, perspective 2500px, slides at translate(-50%,-50%) rotateY(i*360/n)
 * translateZ(r), the front slide ~1.35x (720px reads ~970px at 1440), the ring running off both screen edges.
 * Base = a swipe row of the same large screenshots: phones, reduced motion, fewer than 4 designs and no-JS all get it.
 * designs-ring.js adds .is-ring for the 3D ring.
 * 2.0.4 (Doug 2026-12-01): prev/next arrows that fade in while the carousel is hovered or focused (always shown on touch
 * screens), and swipe/drag to turn the ring (.is-dragging while a pointer is down). */

.ds-designs { position: relative; overflow: hidden; background: var(--hd-bg-2, #0A1A2B); color: var(--hd-text); }
.ds-designs__head { max-width: 760px; margin: 0 0 64px; text-align: left; }
.ds-designs__head .hd-title { color: var(--hd-white); }
.ds-designs__head .hd-lead { margin: 20px 0 0; max-width: 60ch; }
.ds-designs__more { display: inline-flex; align-items: center; gap: 6px; margin-left: 4px; color: var(--hd-red-text); font-weight: 500; white-space: nowrap; text-decoration: none; transition: color .3s var(--lx-ease, ease); }
.ds-designs__more:hover, .ds-designs__more:focus-visible { color: var(--hd-white); }
.ds-designs__more .hd-icon { width: 16px; height: 16px; transition: transform .3s var(--lx-ease, ease); }
.ds-designs__more:hover .hd-icon { transform: translateX(3px); }

.ds-designs__carousel { --ds-slide-w: min(86vw, 720px); position: relative; }

/* ---------- Swipe row (base) ---------- */
.ds-designs__stage { position: relative; }
.ds-designs__ring {
	display: flex; gap: 24px; margin: 0; padding: 8px max(20px, calc((100vw - 1260px) / 2)) 40px; list-style: none;
	overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; scroll-padding-inline: max(20px, calc((100vw - 1260px) / 2));
	scrollbar-width: none;
}
.ds-designs__ring::-webkit-scrollbar { display: none; }
.ds-designs__slide { flex: 0 0 var(--ds-slide-w); margin: 0; padding: 0; scroll-snap-align: start; }

/* ---------- Bare screenshot ---------- */
.ds-designs__card { position: relative; display: block; border-radius: 15px; text-decoration: none; }
.ds-designs__card img {
	display: block; width: 100%; height: auto; max-width: none; aspect-ratio: 16 / 9; object-fit: cover; object-position: top center;
	border-radius: 15px; box-shadow: 0 24px 48px -12px rgba(0, 0, 0, .55), 0 4px 12px rgba(0, 0, 0, .25);
}
.ds-designs__card:focus-visible { outline: 2px solid var(--hd-white); outline-offset: 6px; }

/* Front design's name, one quiet line under the ring (the link's own name carries it for screen readers). */
.ds-designs__caption { margin: 8px 0 0; padding: 0 20px; text-align: center; color: var(--hd-muted, #8A9AA9); font-size: 14px; letter-spacing: .04em; min-height: 1.5em; }
.ds-designs__carousel:not(.is-ring) .ds-designs__caption { text-align: left; padding-inline: max(20px, calc((100vw - 1260px) / 2)); }

/* Pause/Play (WCAG 2.2.2): one small icon button, bottom-right of the ring. */
.ds-designs__toggle {
	position: absolute; z-index: 5; right: max(20px, calc((100vw - 1260px) / 2)); bottom: 0;
	display: inline-flex; align-items: center; justify-content: center; width: 36px; height: 36px; padding: 0;
	border: 1px solid var(--lx-hair-strong, rgba(255, 255, 255, .2)); border-radius: 50%; background: rgba(6, 17, 29, .6); color: var(--hd-white);
	opacity: .7; cursor: pointer; transition: opacity .3s var(--lx-ease, ease), border-color .3s var(--lx-ease, ease);
}
.ds-designs__toggle[hidden] { display: none; }
.ds-designs__toggle:hover, .ds-designs__toggle:focus-visible { opacity: 1; border-color: var(--hd-white); }
.ds-designs__icon-play { display: none; }
.ds-designs__toggle[aria-pressed="true"] .ds-designs__icon-play { display: block; }
.ds-designs__toggle[aria-pressed="true"] .ds-designs__icon-pause { display: none; }

/* Prev/next arrows: hidden until the carousel is hovered or has keyboard focus; always shown where there is no hover. */
.ds-designs__arrow {
	position: absolute; z-index: 6; top: 50%; transform: translateY(-50%);
	display: inline-flex; align-items: center; justify-content: center; width: 56px; height: 56px; padding: 0;
	border: 1px solid rgba(255, 255, 255, .35); border-radius: 50%; background: rgba(6, 17, 29, .72); color: var(--hd-white);
	-webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); box-shadow: 0 10px 24px -8px rgba(0, 0, 0, .6);
	cursor: pointer; opacity: 0; pointer-events: none;
	transition: opacity .3s var(--lx-ease, ease), background-color .3s var(--lx-ease, ease), border-color .3s var(--lx-ease, ease);
}
.ds-designs__arrow .hd-icon { width: 24px; height: 24px; }
.ds-designs__arrow--prev { left: max(12px, calc((100vw - 1260px) / 2)); }
.ds-designs__arrow--next { right: max(12px, calc((100vw - 1260px) / 2)); }
.ds-designs__carousel:hover .ds-designs__arrow,
.ds-designs__carousel:focus-within .ds-designs__arrow { opacity: 1; pointer-events: auto; }
.ds-designs__arrow:hover, .ds-designs__arrow:focus-visible { background: var(--hd-red, #D7262F); border-color: var(--hd-red, #D7262F); }
.ds-designs__arrow:focus-visible { outline: 2px solid var(--hd-white); outline-offset: 3px; }
@media (hover: none) { .ds-designs__arrow { opacity: 1; pointer-events: auto; } }
/* Row: the arrows sit over the screenshots (the stage includes the row's bottom padding, so nudge up). */
.ds-designs__carousel:not(.is-ring) .ds-designs__arrow { top: calc(50% - 16px); width: 44px; height: 44px; }

/* Swipe/drag the ring: grab cursor, and no image ghost or text selection while dragging. */
.ds-designs__carousel.is-ring .ds-designs__stage { cursor: grab; touch-action: pan-y; -webkit-user-select: none; user-select: none; }
.ds-designs__carousel.is-dragging .ds-designs__stage { cursor: grabbing; }
.ds-designs__card img { -webkit-user-drag: none; }

/* ---------- 3D ring (768px+, set by JS) ---------- */
@media (min-width: 768px) {
	.ds-designs__carousel.is-ring { --ds-slide-w: clamp(420px, 50vw, 720px); }
	.ds-designs__carousel.is-ring .ds-designs__stage { height: calc(var(--ds-slide-w) * .5625 * 1.42 + 48px); perspective: 2500px; }
	.ds-designs__carousel.is-ring .ds-designs__ring {
		position: absolute; inset: 0; display: block; padding: 0; overflow: visible; scroll-snap-type: none;
		transform-style: preserve-3d; transform: translateZ(var(--ds-push, 0px)) rotateY(var(--ds-angle, 0deg));
		transition: transform 1s ease-in-out;
	}
	.ds-designs__carousel.is-ring .ds-designs__slide {
		position: absolute; left: 50%; top: 50%; width: var(--ds-slide-w); margin: 0; transform-origin: center;
		transform: translate(-50%, -50%) rotateY(var(--ds-theta, 0deg)) translateZ(var(--ds-r, 650px));
		transition: transform 1s ease-in-out;
	}
	/* Slides away from the front sit under a navy veil (as on Skyway, the turned slides still show). */
	.ds-designs__carousel.is-ring .ds-designs__card::after {
		content: ""; position: absolute; inset: 0; border-radius: 15px; background: var(--hd-bg, #06111D); pointer-events: none;
		opacity: calc(var(--ds-dist, 0) * .22); transition: opacity 1s ease-in-out;
	}
}

@media (max-width: 767px) {
	.ds-designs__head { margin-bottom: 40px; }
	.ds-designs__ring { gap: 16px; padding-bottom: 28px; }
	.ds-designs__card img { box-shadow: 0 16px 32px -10px rgba(0, 0, 0, .55); }
}

@media (prefers-reduced-motion: reduce) {
	.ds-designs__ring, .ds-designs__slide, .ds-designs__card::after, .ds-designs__more .hd-icon { transition: none !important; }
}
