/* What opens over the learning stories page (Figma 14573-10): the story reader, the share form with its
   sending, error and thanks, and the window a video plays in. On narrower screens: narrow.css. */

/* Figma's "Black - Light 1" (#F6F6F6) is not the front palette's light-1 (#E7EBEF): it is light-2 halfway to white. */
.cil-st { --st-surface: color-mix(in srgb, var(--cil-black-light-2) 50%, var(--cil-white)); }
.cil-st-dialog {
    max-width: calc(100% - 32px); max-height: 90vh; padding: 0; border: 0; border-radius: 24px; background: var(--cil-white); color: var(--cil-black);
    box-shadow: 0 8px 24px -4px color-mix(in srgb, var(--cil-black) 14%, transparent), 0 1px 3px color-mix(in srgb, var(--cil-black) 8%, transparent);
}
.cil-st-dialog[open] { animation: cil-st-rise .3s var(--st-ease); }
.cil-st-dialog::backdrop { background: color-mix(in srgb, var(--cil-black) 60%, transparent); }
.cil-st-dialog__head { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.cil-st-dialog__title { font-size: 32px; font-weight: 700; line-height: 1.2; }
/* The close button's hover -- the popup's black iris -- is hovers.css; its hairline is a shadow so the iris can cover it. */
.cil-st .cil-st-close { position: relative; flex: none; display: grid; place-items: center; width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%; background: var(--cil-white); box-shadow: inset 0 0 0 1px var(--cil-black-light-3); color: var(--cil-black); cursor: pointer; }
.cil-st .cil-st-close:is(:hover, :focus-visible) { background: var(--cil-white); outline: none; }

/* ---- The reader ---- */
.cil-st-reader { width: 1040px; }
.cil-st-reader[open] { display: flex; overflow: hidden; }
.cil-st-reader__content { flex: 1; display: flex; flex-direction: column; gap: 18px; min-width: 0; overflow-y: auto; padding: 32px 40px 40px; }
.cil-st-reader__photo { flex: none; width: 420px; max-width: 45%; object-fit: cover; }
.cil-st-reader__photo[hidden] { display: none; }
.cil-st-reader__line { font-size: 32px; font-weight: 700; line-height: 1.2; }
/* Paragraphs 18 apart, like the reader's other parts (Figma 14603:5345). */
.cil-st-reader__story { color: var(--cil-black-regular-7); font-size: 16px; line-height: 1.2; }
.cil-st-reader__story > * { margin-block: 0 18px; } .cil-st-reader__story > :last-child { margin-bottom: 0; }
/* A story of one sentence: the title says it all, and no empty body takes a gap. */
.cil-st-reader__story:empty { display: none; }
.cil-st .cil-st-course { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border-radius: 16px; background: var(--st-surface); color: var(--cil-black); text-decoration: none; }
.cil-st .cil-st-course[hidden] { display: none; }
/* Its hover -- the outline drawn in, the book and the caret stepping forward -- is hovers.css. */
.cil-st .cil-st-course:is(:hover, :focus-visible) { color: var(--cil-black); outline: none; }
.cil-st-course__words { flex: 1; display: flex; flex-direction: column; gap: 2px; min-width: 0; line-height: 1.2; }
.cil-st-course__eyebrow { color: var(--cil-black-regular-7); font-size: 14px; }
.cil-st-course__name { font-size: 16px; font-weight: 700; }
.cil-st-course__institution { color: var(--cil-black-regular-6); font-size: 14px; }
.cil-st-course__go { flex: none; display: inline-flex; align-items: center; gap: 4px; color: var(--cil-blue-dark-1); font-size: 14px; font-weight: 600; }
.cil-st-reader__actions { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; margin-top: auto; }
/* "לסיפור הבא" always at the far end (the left in Hebrew), with or without "צפייה בסרטון" beside it. */
.cil-st .cil-st-reader__actions [data-st-reader-next] { margin-inline-start: auto; }

/* ---- The share form ---- */
.cil-st-form { width: 640px; }
.cil-st-form form, .cil-st-sent { display: flex; flex-direction: column; gap: 16px; padding: 32px 36px; }
.cil-st-form form[hidden], .cil-st-sent[hidden] { display: none; }
.cil-st-field { display: flex; flex-direction: column; gap: 6px; }
.cil-st-field label { font-size: 16px; font-weight: 700; }
.cil-st .cil-st-field :is(input, textarea) { width: 100%; height: 48px; margin: 0; padding: 0 14px; border: 1px solid var(--cil-black-light-4); border-radius: 10px; background: var(--cil-white); color: var(--cil-black); font: inherit; font-size: 16px; box-shadow: none; }
.cil-st .cil-st-field textarea { height: 120px; padding-block: 12px; resize: vertical; }
.cil-st .cil-st-field :is(input, textarea)::placeholder { color: var(--cil-black-regular-5); opacity: 1; }
/* Focus: the outline is drawn in round the field (hovers.css, .cil-st-field__box), not switched on. */
.cil-st .cil-st-field :is(input, textarea):focus { outline: none; }
.cil-st .cil-st-field [aria-invalid="true"] { border: 2px solid var(--cil-red-regular-5); }
.cil-st-field__error { margin: 0; color: var(--cil-red-regular-5); font-size: 14px; }
/* The course: typed, or picked from the site's through the caret at the far side (Figma 14603:12745). */
.cil-st-field__pick { position: relative; display: block; }
.cil-st .cil-st-field__pick input { padding-inline-end: 38px; }
.cil-st .cil-st-field__pick input::-webkit-calendar-picker-indicator { display: none !important; }
.cil-st-field__caret { position: absolute; top: 50%; inset-inline-end: 14px; margin-top: -8px; cursor: pointer; }
/* What a field takes, under it (the file's kinds and size, the contact question's consent). */
.cil-st-field__hint { margin: 0; color: var(--cil-black-regular-7); font-size: 14px; line-height: 1.4; }
/* The box (Figma 14603:12762): a 2px grey square; agreed (14615:1541), the brand's blue with a dark rim and tick. */
.cil-st-consent { display: flex; align-items: center; gap: 10px; font-size: 16px; line-height: 1.2; cursor: pointer; }
.cil-st .cil-st-consent input {
    appearance: none; flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin: 0;
    border: 2px solid var(--cil-black-regular-5); border-radius: 6px; background: var(--cil-white); cursor: pointer;
}
.cil-st .cil-st-consent input:checked { border-color: var(--cil-blue-dark-1); background: var(--cil-blue) url("../../../images/stories-page/check.svg") center / 14px 14px no-repeat; }
.cil-st .cil-st-consent input:focus-visible { outline: 2px solid var(--cil-blue-dark-1); outline-offset: 2px; }
.cil-st .cil-st-consent input[aria-invalid="true"] { border-color: var(--cil-red-regular-5); }
/* Ticking it: the box presses in and swells back as the blue comes in, and the tick grows from its middle;
   un-ticking just lets the colour go. */
.cil-st .cil-st-consent input { transition: background-color .25s ease, border-color .25s ease; }
.cil-st .cil-st-consent input:checked { animation: cil-st-tick .42s var(--st-ease); }
@keyframes cil-st-tick {
    0% { transform: scale(.82); background-size: 0 0; }
    55% { transform: scale(1.12); background-size: 16px 16px; }
    100% { transform: none; background-size: 14px 14px; }
}
.cil-st .cil-st-consent input[aria-invalid="true"]:not(:checked) { animation: cil-st-nudge .32s ease; }
@keyframes cil-st-nudge { 25% { transform: translateX(-3px); } 50% { transform: translateX(3px); } 75% { transform: translateX(-2px); } }
@media (prefers-reduced-motion: reduce) { .cil-st .cil-st-consent input, .cil-st .cil-st-consent input:checked, .cil-st .cil-st-consent input[aria-invalid="true"]:not(:checked) { animation: none; transition: none; } }
/* Could not be sent (Figma 14615:2984): the reason above the buttons, the mark at the reading start. */
.cil-st-alert { display: flex; align-items: center; gap: 10px; padding: 12px 16px; border-radius: 12px; background: var(--cil-red-light-1); color: var(--cil-black); font-size: 16px; line-height: 1.2; }
.cil-st-alert img { flex: none; }
.cil-st-alert[hidden] { display: none; }
.cil-st-dialog__actions { display: flex; align-items: center; gap: 12px; }
.cil-st .cil-st-dialog__actions .cil-st-link { align-self: center; }
/* The share form: "ביטול" at the reading start (right in Hebrew), "שליחת הסיפור" at the far end (Oren, 2026-10-09). */
.cil-st-form .cil-st-dialog__actions { justify-content: space-between; }
.cil-st .cil-st-form .cil-st-dialog__actions .cil-st-link { order: -1; }
/* Sending (Figma 14615:1545): "שליחה…" and a turning spinner; the button keeps its blue. */
.cil-st-btn__spinner { display: none; }
.cil-st .cil-st-btn--send.is-sending { cursor: progress; }
.cil-st .cil-st-btn--send.is-sending .cil-st-btn__spinner { display: block; animation: cil-st-spin .8s linear infinite; }
/* Sent (Figma 14603:13740): the close at the far top, the tick, the words, closing across the width. */
.cil-st-sent { gap: 12px; align-items: center; text-align: center; }
.cil-st-sent:focus { outline: none; }
.cil-st-sent .cil-st-dialog__head { align-self: stretch; justify-content: flex-end; margin-bottom: 12px; }
.cil-st-sent__mark { animation: cil-st-pop .45s var(--st-ease); }
@keyframes cil-st-pop { from { transform: scale(.4); opacity: 0; } 70% { transform: scale(1.08); } }
.cil-st-sent__title { font-size: 32px; font-weight: 700; line-height: 1.2; }
.cil-st-sent__text { color: var(--cil-black-regular-7); font-size: 16px; line-height: 1.2; }
.cil-st-sent .cil-st-btn--wide { margin-top: 12px; }

/* ---- A video's own window ---- */
/* fixed, as a dialog is: `relative` laid the open window out at the top of the page, and opening it
   scrolled the page there (Oren, 2026-10-09). Fixed is also what its corner button is placed against. */
/* The platform's player, wide as most videos are; an upright one (a Short, TikTok -- reels.js sets is-tall)
   in the upright window. Both fit the screen's height. */
.cil-st-watch { position: fixed; width: min(960px, calc(100% - 32px), calc(90vh * 16 / 9)); aspect-ratio: 16 / 9; max-height: 90vh; overflow: hidden; background: var(--cil-black-dark-2); }
.cil-st-watch.is-tall { width: min(420px, calc(100% - 32px), calc(90vh * 9 / 16)); aspect-ratio: 9 / 16; }
.cil-st-watch__media, .cil-st-watch__media > * { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cil-st .cil-st-watch__close { position: absolute; z-index: 2; top: 12px; inset-inline-end: 12px; }

@media (prefers-reduced-motion: reduce) {
    .cil-st-dialog[open], .cil-st-sent__mark { animation: none; }
    .cil-st .cil-st-btn--send.is-sending .cil-st-btn__spinner { animation-duration: 2.4s; }
}
