/* COET: phone and tablet layout for the work area (2026-11-14). Loaded after every other stylesheet.
   Everything here sits inside a max-width query, so the desktop design (901px and up) is untouched.
   Tablet: 761–900px. Phone: 760px and under. */

/* ── Tablet and phone (≤900px) ── */
@media (max-width: 900px) {
  /* Work index: each row becomes a card. There is no hover on a touch screen, so the picture is simply shown.
     Tablet puts it beside the text; phones stack it under the name (below). */
  .wi-row { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr);
    grid-template-areas: "prev name" "prev desc" "prev del"; grid-template-rows: auto auto 1fr;
    gap: var(--s2) var(--s5); align-items: start; padding-block: var(--s5); }
  .wi-name { grid-area: name; }
  .wi-desc { grid-area: desc; max-width: none; }
  .wi-del { grid-area: del; line-height: 1.7; }
  .wi-prev { grid-area: prev; display: block; }
  .wi-prev__clip { overflow: visible; }
  .wi-prev__in { clip-path: none; }
  .wi-prev__in > * { transform: none; }
  .wi-row:hover { background: none; box-shadow: none; }   /* a tap leaves the hover state stuck on */

  /* Page intro line: full width */
  .cs-aside { max-width: 60ch; }

  /* How can we help? title over the links */
  .cs-help__in { display: flex; flex-direction: column; gap: var(--s6); }
  .cs-help__rows { align-self: stretch; width: 100%; }
  .cs-help__rows a { min-height: 72px; padding-block: 8px; }
}

/* ── Phone (≤760px) ── */
@media (max-width: 760px) {
  /* Work index: name, picture, line, deliverables, stacked */
  .wi-row { display: flex; flex-direction: column; align-items: stretch; gap: var(--s3); padding-block: var(--s5) var(--s6); }
  .wi-name { order: 0; }
  .wi-prev { order: 1; margin-block: var(--s1); }
  .wi-desc { order: 2; }
  .wi-del { order: 3; }
  .wi-prev__frame { aspect-ratio: 16 / 10; }

  /* Page heads: the title sits low in a tall opening */
  .cs-hero, .is-sub .cs-hero { padding-top: calc(66px + 22svh); }
  .cs-title { font-size: clamp(48px, 15vw, 72px); }

  .cs-help__title { font-size: clamp(40px, 12vw, 64px); }
}

/* ── Work filters (phones and tablets): one row that scrolls sideways and runs off both edges of the screen,
   instead of wrapping onto a second line. The row keeps the gutter as padding, so it starts and ends lined up
   with the page. ── */
@media (max-width: 900px) {
  .wi-filters { flex-wrap: nowrap; overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: none;
    margin-inline: calc(-1 * var(--gutter)); padding-inline: var(--gutter); scroll-padding-inline: var(--gutter);
    /* 6px above and below so a pill's focus ring is not clipped by the scroller; the margins give it back */
    padding-block: 6px; margin-top: -6px; margin-bottom: calc(var(--s6) - 6px); }
  .wi-filters::-webkit-scrollbar { display: none; }
  .wi-filters::after { content: ""; flex: none; width: 1px; }   /* keeps the gutter after the last pill */
  .wi-filter { flex: none; }
}
