/* Hide superseded controls without changing the compiled story markup. */
[class*='ContinuousStory'][class*='header'],
.page-header,
.page-motion,
.motion-control {
  display: none !important;
}

/* The export still contains its sample collection and footer. Hide them from
   first paint; the custom homepage below the story replaces both. */
#home > #collection,
#home > footer {
  display: none !important;
}

/* Preserve the dot artwork while giving each chapter a usable touch target. */
[class*='ContinuousStory'][class*='dots'] a {
  min-width: 24px;
  min-height: 24px;
  flex-shrink: 0;
}

@media (max-width: 699px) {
  [class*='ContinuousStory'][class*='bottom'] {
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 8px;
  }

  [class*='ContinuousStory'][class*='dots'] {
    grid-column: 1 / -1;
    grid-row: 2;
    justify-content: center;
  }
}

/* Crop the texture inside the unchanged rug silhouette instead of stretching. */
[data-fabric] > img {
  object-fit: cover;
}

/* The rug is invisible throughout the opening chapter. Keep its lazy image
   off the initial download queue; it loads in chapter one before the loom. */
#home:not([data-chapter]) [data-loom],
#home[data-chapter='0'] [data-loom] {
  content-visibility: hidden;
}


/* Fix for hero section line breaks rendered as text by React hydration */
[class*='ContinuousStory'][class*='copy'] span {
  white-space: pre-line;
}
