/* Case study template v2: rules the Webflow CSS import cannot take.
   Goes in the site head (or the template page head) as a small style embed.
   Every rule here is listed with its reason in WEBFLOW_BUILD.md. */

/* 1. Native disclosure: hide the browser triangle; the +/x box is a real span. */
.cs2-sum::-webkit-details-marker { display: none; }
.cs2-sum::marker { content: ""; }
.cs2-more[open] > .cs2-sum .cs2-plus-g { transform: rotate(45deg); }

/* 2. Scroll rows: no scrollbar on the chip row; a thin, visible one on the gallery row and
      the phone switcher pans (scrollbar-color is not a Designer property). */
.cs2-jump-list::-webkit-scrollbar { display: none; }
.cs2-swipe,
.cs2-pan { scrollbar-width: thin; scrollbar-color: #9ea2a2 #1a1a1a; }

/* 3. Right-edge fades (mask-image is not a Designer property), so a cut-off chip or thumbnail
      reads as "scroll for more". Chip row: tablet and phone. Switcher pans: phones only. */
@media screen and (max-width: 991px) {
  .cs2-jump-list {
    -webkit-mask-image: linear-gradient(90deg, #000 70%, transparent 98%);
    mask-image: linear-gradient(90deg, #000 70%, transparent 98%);
  }
}
@media screen and (max-width: 767px) {
  .cs2-pan {
    -webkit-mask-image: linear-gradient(90deg, #000 75%, transparent);
    mask-image: linear-gradient(90deg, #000 75%, transparent);
  }
}

/* 3b. The YouTube iframe the script creates has no class (it would cost script bytes), so it is
       styled by its position: a direct child of a cs2 figure. */
.cs2-fig > iframe { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; border: 0; }

/* 3c. Data table inside a details block (Detox Unit print locations): thin visible scrollbar and,
       on phones, a right-edge fade so the cut column reads as "scroll for more" (mask-image and
       scrollbar-color are not Designer properties). The frame has padding-right 3rem in the main
       file so the last column scrolls clear of the fade. */
.cs2-table-wrap { scrollbar-width: thin; scrollbar-color: #9ea2a2 #1a1a1a; }
@media screen and (max-width: 767px) {
  .cs2-table-wrap {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
  }
}

/* 3d. YouTube click-to-load: the play mark fills on hover or keyboard focus (descendant of a
       pseudo state, not expressible in the import). */
.cs2-yt:hover .cs2-yt-play,
.cs2-yt:focus-visible .cs2-yt-play { background-color: #dfff00; }
.cs2-yt:hover .cs2-yt-tri,
.cs2-yt:focus-visible .cs2-yt-tri { border-left-color: #080808; }

/* 4. The existing GRIDSPACES embed builds its own markup (labs-sandboxes script). On phones this
      template drops two of its parts: the shader code excerpt and the description block that repeats
      the section copy. Descendant selectors on third-party markup, so they cannot go in the import. */
@media screen and (max-width: 767px) {
  .cs2-play .labs-isf-code,
  .cs2-play .labs-sb-meta { display: none; }
}

/* 5. Motion: smooth anchor scroll only when the visitor allows motion. */
@media (prefers-reduced-motion: no-preference) {
  html,
  .cs2-swipe { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  .cs2-plus-g { transition: none; }
}

/* 6. Phone type floor (12 px) and contrast for site-wide nav, footer, and button classes
      on this template. These belong in the site-wide classes; until then they are scoped here. */
.cs2-page .foot-1 { font-size: .75rem; color: #f2f2f0a6; }
.cs2-page .lm-hud { white-space: pre-wrap; }
.cs2-page .lm-stack-cta-btn.lm-dual-cta-btn { font-size: .75rem; }
.cs2-page .lm-nav-cta-1 { font-size: .75rem; }
.cs2-page .lm-nav-link-1 { font-size: .75rem; }

/* 7. 44 px tap targets for the site-wide nav brand, nav links, and footer links, without
      changing their visual height (the negative margin cancels the extra box). */
.cs2-page .lm-brand-1,
.cs2-page .lm-nav-link-1,
.cs2-page .site-footer-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  margin-top: -13px;
  margin-bottom: -13px;
}
.cs2-page .lm-nav-cta-1 { display: inline-flex; align-items: center; min-height: 44px; margin-top: -4px; margin-bottom: -4px; }
.cs2-page .lm-foot-meta { row-gap: 0; }

/* 8. Contrast inside the GRIDSPACES embed (its control labels and code comments are under 4.5:1
      in the labs script's own CSS; the same fix belongs in that script for the Labs pages). */
.cs2-play .labs-sb-ctrls label { color: #a8a7a2; font-size: 12px; }
.cs2-play .labs-sb-bar,
.cs2-play .labs-sb-bar a,
.cs2-play .labs-sb-bar button,
.cs2-play .labs-sb-ctrls,
.cs2-play .labs-touch-cue,
.cs2-play .labs-isf-action-row a { font-size: 12px; }
.cs2-play .labs-isf-cm { color: #8f8e8a; }

/* 9. OddRhythm: the live reaction-diffusion explorer (labs-sandboxes, data-piece="rd"). Carried from the old
      page's embed: the liquid-mercury look is a filter on the canvas, and the explorer's links to the other
      sandboxes and the labs page are hidden. Space is held before the script mounts it (no poster exists),
      and on phones the controls are 44 px tall. Its own labels are under 12 px in the labs script's CSS.
      Attribute and descendant selectors on third-party markup, so they cannot go in the import. */
/* the labs script sets an inline min-height: 70vh on the mount (an empty band under the panel on phones),
   so the held height overrides it with !important: 36.75rem matches the panel at 1440 (588 px once the
   description line below is hidden; 39rem left a 36 px empty band), 29.25rem at 390 */
.cs2-play[data-piece="rd"] { min-height: 36.75rem !important; }
.cs2-play[data-piece="rd"] canvas { max-width: 100%; filter: grayscale(1) contrast(1.22) brightness(1.06); }
.cs2-play[data-piece="rd"] .labs-sb-bar a:not(.labs-sb-title-link) { display: none !important; }
.cs2-play[data-piece="rd"] .labs-sb-btn,
.cs2-play[data-piece="rd"] .labs-sb-title-link,
.cs2-play[data-piece="rd"] .labs-touch-cue span { font-size: 12px; }
/* the "Paint · Shift=erase" hint has an inline style (8.8 px, 45 % alpha), so only !important reaches it */
.cs2-play[data-piece="rd"] .labs-sb-ctrls label { font-size: 12px !important; color: #a8a7a2 !important; }
/* the piece prints its own description ("RD: Gray-Scott ... Purple shadows, green body, lime rims."), which
   describes the colour version, not this page's mercury look: hide that one line (a div.labs-sb-meta with no id,
   direct child of the panel). Never matches #rd-stats or #rd-presets, or a meta block holding them. */
.cs2-play[data-piece="rd"] .labs-sb-panel > .labs-sb-meta:not(#rd-stats):not(#rd-presets):not(:has(#rd-stats, #rd-presets)) { display: none; }
@media screen and (max-width: 767px) {
  .cs2-play[data-piece="rd"] { min-height: 29.25rem !important; }
  .cs2-play[data-piece="rd"] .labs-sb-btn { min-height: 44px; }
  .cs2-play[data-piece="rd"] .labs-sb-title-link { display: inline-flex; align-items: center; min-width: 44px; min-height: 44px; }
}
/* 9b. A one-word related link ("Labs") is narrower than 44 px: hold the tap target width. */
.cs2-page .cs2-related-a { min-width: 44px; }

/* 10. Towr Media status pipeline: the horizontal diagram needs 1095 px for 12 px text, so below that it
       scrolls inside its own frame; thin visible scrollbar and, 768 to 991 px, a right-edge fade (the frame
       has padding-right 3rem in the main file so the last stage scrolls clear). Below 768 the vertical
       variant replaces it. mask-image and scrollbar-color are not Designer properties. */
.cs2-towr-pipe-h { scrollbar-width: thin; scrollbar-color: #9ea2a2 #1a1a1a; }
@media screen and (max-width: 991px) {
  .cs2-towr-pipe-h {
    -webkit-mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
    mask-image: linear-gradient(90deg, #000 calc(100% - 3rem), transparent);
  }
}