/* Carousel layout: one story per slide, horizontal scroll-snap. Active when <html> has .cr
   (set by the inline script in page.html: ?carousel=1 or a very small viewport). */

html.cr body { height: 100%; overflow: hidden; }
html.cr #titlebar, html.cr .sb, html.cr .sb-fab, html.cr .sb-backdrop, html.cr #sb-toast,
html.cr #gen-panel, html.cr #log-popup, html.cr [data-swap="masthead"], html.cr [data-swap="footer"] { display: none !important; }

html.cr .sb-content { margin-left: 0; padding-top: 0; height: 100%; }
html.cr .sb-content > div { max-width: none; height: 100%; padding: 0; display: flex; flex-direction: column; }

html.cr [data-desks] { display: flex; flex: 1; min-height: 0; margin-top: 0; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
html.cr [data-desks]::-webkit-scrollbar { display: none; }

/* Dragging the track with the mouse: grab cursor, no text selection. */
html.cr [data-desks].dragging { cursor: grabbing; user-select: none; -webkit-user-select: none; }
html.cr [data-desks] > section, html.cr [data-desk-stories] { display: contents; }
html.cr [data-desks] > section > h2, html.cr [data-desks] > section > p { display: none; }

html.cr [data-desks] article.story-card {
  flex: 0 0 100%; width: 100%; height: 100%; box-sizing: border-box; margin: 0; padding: 1rem 1rem 3.5rem;
  border-bottom: 0; overflow-y: auto; scroll-snap-align: start;
}
html.cr [data-desks] article.story-card[data-cr-out] { display: none !important; }

/* Seamless embed: transparent page so the host shows through. color-scheme must stay light here,
   otherwise the browser paints a dark canvas under the transparent body when the OS is in dark mode. */
html.cr { color-scheme: light; }
html.cr body { background: transparent; }

.carousel-dots { display: none; }
html.cr .carousel-dots {
  display: flex; position: fixed; left: 50%; bottom: .75rem; transform: translateX(-50%); z-index: 40;
  align-items: center; justify-content: center; gap: 8px;
}

.carousel-dot {
  appearance: none;
  border: 0;
  padding: 0;
  width: 7px;
  height: 7px;
  border-radius: 999px;
  background: var(--dot-color, #999);
  opacity: 0.35;
  cursor: pointer;
  transition:
    width 250ms ease,
    height 250ms ease,
    opacity 200ms ease,
    transform 200ms ease,
    background-color 200ms ease;
}

/* Too many slides: dots farther than DOT_WINDOW from the active slide fade out
   and collapse so the nav stays compact. They remain in the DOM (and clickable)
   so every article is still reachable; they fade back in as you scroll near them. */
.carousel-dot.fade {
  opacity: 0;
  width: 0;
  height: 0;
  pointer-events: none;
}

.carousel-dot.active {
  width: 22px;
  opacity: 1;
}

.carousel-dot:hover:not(.active) {
  transform: scale(1.35);
  opacity: 0.75;
}

.carousel-dot:focus-visible {
  outline: 2px solid currentColor;
  outline-offset: 4px;
}
