/* The learning stories page on narrower screens: two tiles a row below 1080, and the phone (Figma 14573-10,
   the "Mobile" cells, 390 wide): the page, then the windows as sheets from the bottom. Loaded last. */

@media (max-width: 1079px) {
    .cil-st-hero { margin-inline-end: 0; }
    .cil-st-hero__art { width: 420px; min-height: 480px; }
    .cil-st-hero__photo { width: 320px; height: 400px; }
    .cil-st-hero__ring { width: 260px; height: 260px; }
    .cil-st-grid { --st-third: calc((100% - 24px) / 2); }
    .cil-st-grid > .cil-st-card.is-wide, .cil-st-grid > .cil-st-stat { flex-basis: 100%; }
}

@media (max-width: 640px) {
    .cil-st { padding-bottom: 48px; }

    /* ---- The story of the week (Figma 14603:1490): the photo in its arch above the words ---- */
    .cil-st-hero-wrap { padding-block: 8px 32px; }
    .cil-st-hero { flex-direction: column-reverse; gap: 14px; padding-bottom: 20px; border-radius: 24px; }
    .cil-st-hero__art { width: 100%; height: 300px; min-height: 0; }
    .cil-st-hero__ring { top: 30px; left: 0; width: 220px; height: 220px; }
    .cil-st-hero__dot--red { top: 40px; right: 36px; width: 22px; height: 22px; }
    .cil-st-hero__dot--green { bottom: 36px; left: 40px; width: 14px; height: 14px; }
    .cil-st-hero__dot--teal { display: none; }
    .cil-st-hero__photo { right: auto; left: 50%; width: 240px; height: 280px; border-radius: 120px 120px 0 0; transform: translateX(-50%); animation: none; }
    .cil-st-hero__text { gap: 12px; padding: 0 16px; }
    .cil-st-hero .cil-st-tag { font-size: 12px; }
    .cil-st-hero__line { font-size: 24px; }
    .cil-st-hero__actions { flex-direction: column; align-items: stretch; gap: 8px; }
    .cil-st-hero__actions .cil-st-btn { height: 44px; padding-inline: 20px; font-size: 14px; }
    .cil-st-hero__actions .cil-st-btn img { width: 16px; height: 16px; }

    /* People and tags at phone size, wherever they are. */
    .cil-st :is(.cil-st-hero, .cil-st-card, .cil-st-reader) .cil-st-person__avatar { width: 44px; height: 44px; }
    .cil-st .cil-st-card__video .cil-st-person__avatar { width: 40px; height: 40px; }
    .cil-st .cil-st-person__avatar--initials { font-size: 14px; }
    .cil-st-person__name { font-size: 16px; }
    .cil-st-person__role { font-size: 12px; }
    .cil-st-tag { font-size: 12px; }

    /* ---- The video stage (Figma 14603:1516) ---- */
    .cil-st-stage { padding-block: 28px 32px; }
    .cil-st-stage__head { flex-direction: column; align-items: flex-start; gap: 6px; margin-bottom: 20px; }
    .cil-st-stage__title { font-size: 24px; }
    .cil-st-stage__lead { font-size: 14px; }
    .cil-st .cil-st-stage__all { font-size: 12px; }

    /* ---- The stories (Figma 14603:1565) ---- */
    .cil-st-stories { gap: 16px; padding-block: 32px 16px; }
    .cil-st-toolbar { flex-direction: column; align-items: flex-start; gap: 10px; }
    .cil-st-filters { flex-wrap: nowrap; align-self: stretch; overflow-x: auto; margin-inline: -16px; padding: 0 16px; scrollbar-width: none; }
    .cil-st-filters::-webkit-scrollbar { display: none; }
    .cil-st .cil-st-filter { flex: none; padding: 7px 14px; font-size: 12px; font-weight: 400; }
    .cil-st .cil-st-filter.is-on { font-weight: 600; }
    .cil-st-count { font-size: 12px; }
    .cil-st-grid { --st-third: 100%; }
    .cil-st-grid > .cil-st-stat { align-self: stretch; }
    .cil-st-card__text { padding: 22px 20px; }
    .cil-st-card__quotes { width: 32px; height: 32px; }
    .cil-st-card__line { font-size: 20px; }
    /* One tile a row: the longest words measured 282 high here, so the design's 303 holds every tile. */
    .cil-st-card:not(.is-wide) { min-height: 420px; }
    .cil-st-card__rest, .cil-st-card.is-wide .cil-st-card__rest { font-size: 14px; }
    .cil-st-grid > .cil-st-card.is-wide { flex-direction: column-reverse; min-height: 0; }
    .cil-st-card.is-wide .cil-st-card__photo { width: 100%; max-width: none; height: 300px; }
    .cil-st-card.is-wide .cil-st-card__text { gap: 12px; padding: 20px; }
    .cil-st-card.is-wide .cil-st-card__quotes, .cil-st-card.is-wide .cil-st-tag--course { display: none; }
    .cil-st .cil-st-card .cil-st-link { font-size: 12px; }
    .cil-st-card .cil-st-link img { width: 14px; height: 14px; }
    .cil-st-stat { padding: 24px 20px; }
    .cil-st-stat > img { width: 32px; height: 32px; }
    .cil-st-stat__prefix { font-size: 16px; }
    .cil-st-stat__number { font-size: 24px; }
    .cil-st-stat__text { font-size: 14px; }
    .cil-st-card__caption { gap: 6px; }
    .cil-st-card__vline { font-size: 16px; }
    .cil-st-card__vrest { font-size: 13px; }
    .cil-st .cil-st-card__play img { width: 26px; height: 26px; }

    /* ---- "גם לך יש סיפור?" (Figma 14603:1650): one column at the reading start; the words as wide as the title ---- */
    .cil-st-share { flex-direction: column; align-items: flex-start; gap: 14px; padding: 24px 20px; }
    .cil-st-share__icon { width: 36px; height: 36px; }
    .cil-st-share__text { flex: none; width: min-content; }
    .cil-st-share__title { font-size: 20px; white-space: nowrap; }
    .cil-st-share__lead { font-size: 14px; line-height: 1.2; }
    .cil-st .cil-st-share .cil-st-btn { height: 44px; padding-inline: 20px; font-size: 14px; }
    .cil-st .cil-st-share .cil-st-btn img { width: 16px; height: 16px; }

    /* Figma 14615:947: a closer card, smaller words, the button its own width. */
    .cil-st-failed { padding-block: 8px 48px; }
    .cil-st-state { gap: 12px; padding: 32px 20px; }
    .cil-st-state__icon { width: 56px; height: 56px; }
    .cil-st-state__icon img { width: 26px; height: 26px; }
    .cil-st-state__title { font-size: 16px; }
    .cil-st-state__text { max-width: 300px; font-size: 14px; }
    .cil-st .cil-st-state .cil-st-btn { height: 44px; padding-inline: 20px; font-size: 14px; }
    .cil-st .cil-st-state .cil-st-btn img { width: 16px; height: 16px; }

    /* ---- The windows: sheets from the bottom (Figma 14603:5747, 14603:13148) ---- */
    .cil-st-dialog { width: 100%; max-width: 100%; max-height: 94vh; margin-block-end: 0; border-radius: 24px 24px 0 0; }
    .cil-st-dialog__title, .cil-st-sent__title { font-size: 20px; }
    .cil-st-reader[open] { flex-direction: column-reverse; }
    .cil-st-reader__photo { width: 100%; max-width: none; height: 240px; }
    .cil-st-reader__content { flex: none; overflow: visible; padding: 20px 16px 28px; }
    .cil-st-reader[open] { overflow-y: auto; }
    .cil-st-reader__line { font-size: 20px; }
    .cil-st-reader__story { font-size: 14px; }
    .cil-st-course__eyebrow, .cil-st-course__institution, .cil-st-course__go { font-size: 12px; }
    .cil-st-course__name { font-size: 14px; }
    .cil-st-course__go img, .cil-st-reader__actions .cil-st-link img { width: 14px; height: 14px; }
    .cil-st .cil-st-reader__actions .cil-st-link { font-size: 12px; }
    .cil-st .cil-st-reader__actions .cil-st-btn { height: 40px; padding-inline: 20px; font-size: 14px; }
    .cil-st .cil-st-reader__actions .cil-st-btn img { width: 16px; height: 16px; }
    .cil-st-form form { padding: 16px 16px 28px; }
    .cil-st-sent { padding: 16px 16px 28px; }
    .cil-st-field label { font-size: 14px; }
    .cil-st .cil-st-field :is(input, textarea) { height: 44px; font-size: 14px; }
    .cil-st .cil-st-field textarea { height: 110px; }
    .cil-st-field__hint { font-size: 12px; }
    .cil-st-consent { font-size: 14px; }
    .cil-st-alert { font-size: 14px; }
    .cil-st-form .cil-st-dialog__actions { flex-direction: column; align-items: stretch; }
    .cil-st .cil-st-form .cil-st-dialog__actions .cil-st-btn { height: 44px; font-size: 14px; }
    .cil-st .cil-st-form .cil-st-dialog__actions .cil-st-link { order: 0; align-self: flex-start; font-size: 12px; }
    .cil-st-sent__text { font-size: 14px; }
    .cil-st .cil-st-sent .cil-st-btn { height: 44px; font-size: 14px; }
}
