/* An event's details, open in its row (Figma 38-41, "Event details" / "Event details · past"): the text,
   the facts, the way there, the registering column; for a past event its recordings, photos and
   files. Then the page on narrower screens. */

/* Clipped only while its height moves (events.js), so the calendars of "הוספה ליומן" drop out of it once open. */
.cil-ev-details.is-moving { overflow: hidden; }
.cil-ev-details[hidden] { display: none; }
.cil-ev-details__inner { display: flex; align-items: flex-start; gap: 48px; padding-block: 0 32px; padding-inline: 144px 28px; }
.cil-ev-details__info { flex: 1; display: flex; flex-direction: column; gap: 24px; min-width: 0; }
.cil-ev-details__text { color: var(--cil-black); font-size: 18px; line-height: 1.3; }
.cil-ev-details__text > :first-child { margin-top: 0; } .cil-ev-details__text > :last-child { margin-bottom: 0; }
.cil-ev-details__actions { flex: none; width: 220px; }
.cil-ev-details__actions .cil-ev-actions__row { flex-direction: column; align-items: stretch; }
.cil-ev-details__actions .cil-ev-btn { width: 100%; }.cil-ev-facts { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 16px 40px; }
.cil-ev-facts dt { margin-bottom: 4px; color: var(--cil-black-regular-7); font-size: 14px; font-weight: 600; }
.cil-ev-facts dd { color: var(--cil-black); font-size: 16px; font-weight: 700; line-height: 1.2; }

.cil-ev-block { display: flex; flex-direction: column; gap: 12px; }
.cil-ev-block__title { color: var(--cil-black); font-size: 18px; font-weight: 600; }
.cil-ev-recordings { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; margin: 0; padding: 0; list-style: none; }
.cil-ev-rec { overflow: hidden; border-radius: 12px; background: var(--cil-white); box-shadow: 0 8px 24px -4px color-mix(in srgb, var(--cil-black) 16%, transparent), 0 1px 3px color-mix(in srgb, var(--cil-black) 8%, transparent); transition: transform .3s var(--ev-ease); }
.cil-ev-rec[hidden] { display: none; }
.cil-ev-rec:hover { transform: translateY(-3px); }
.cil-ev .cil-ev-rec__thumb { position: relative; display: block; aspect-ratio: 16 / 9; overflow: hidden; background: var(--cil-black-dark-2); }
.cil-ev-rec__picture { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ev-ease); }
.cil-ev-rec:hover .cil-ev-rec__picture { transform: scale(1.04); }
.cil-ev-rec__top { position: absolute; top: 12px; inset-inline: 12px; display: flex; gap: 8px; }
.cil-ev-rec__chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 6px; background: color-mix(in srgb, var(--cil-black-dark-5) 85%, transparent); color: var(--cil-white); font-size: 14px; font-weight: 700; }
.cil-ev-rec__yt { display: grid; place-items: center; padding: 4px 8px; border-radius: 6px; background: var(--cil-red); }
.cil-ev-rec__length { position: absolute; bottom: 12px; inset-inline-end: 12px; }
.cil-ev-rec__play { position: absolute; top: 50%; left: 50%; display: grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--cil-white); transform: translate(-50%, -50%); transition: transform .25s var(--ev-ease); }
.cil-ev-rec:hover .cil-ev-rec__play { transform: translate(-50%, -50%) scale(1.08); }
.cil-ev-rec__body { display: flex; flex-direction: column; gap: 10px; padding: 16px 20px 20px; }
.cil-ev-rec__title { overflow: hidden; color: var(--cil-black); font-size: 18px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.cil-ev-rec__event { color: var(--cil-black-regular-7); font-size: 14px; }
.cil-ev-rec__foot { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.cil-ev .cil-ev-rec__watch { display: inline-flex; align-items: center; gap: 6px; color: var(--cil-blue-dark-1); font-size: 16px; font-weight: 600; text-decoration: none; }
.cil-ev .cil-ev-rec__watch:is(:hover, :focus-visible) { color: var(--cil-blue-dark-1); text-decoration: underline; }
.cil-ev-rec__where { display: inline-flex; align-items: center; gap: 6px; color: var(--cil-black-regular-7); font-size: 14px; }

.cil-ev-gallery { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 12px; margin: 0; padding: 0; list-style: none; }
.cil-ev-gallery a { position: relative; display: block; height: 150px; overflow: hidden; border-radius: 12px; }
.cil-ev-gallery img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s var(--ev-ease); }
.cil-ev-gallery a:hover img { transform: scale(1.05); }
.cil-ev-gallery__more { position: absolute; inset: 0; display: grid; place-items: center; background: color-mix(in srgb, var(--cil-black-dark-4) 80%, transparent); color: var(--cil-white); font-size: 24px; font-weight: 700; }
.cil-ev-files { display: flex; flex-wrap: wrap; gap: 12px 24px; }

/* ---- Narrower screens ---- */
@media (max-width: 1079px) {
    .cil-ev-next__card { flex-direction: column-reverse; }
    .cil-ev-next__image { width: 100%; height: 320px; min-height: 0; border-radius: 24px 24px 0 0; }
    .cil-ev-row__image { display: none; }
    .cil-ev-details__inner { flex-direction: column; padding-inline: 28px; }
    .cil-ev-details__actions { width: 100%; }
    .cil-ev-recordings { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
    .cil-ev__body { gap: 48px; padding-bottom: 80px; }
    .cil-ev .cil-ev__title { font-size: 24px; }
    .cil-ev .cil-ev__title::before { height: 24px; }
    .cil-ev-filters { flex-wrap: nowrap; overflow-x: auto; margin-inline: -16px; padding: 8px 16px 6px; scrollbar-width: none; }
    .cil-ev-filters::-webkit-scrollbar { display: none; }
    .cil-ev .cil-ev-filter { flex: none; }
    .cil-ev-next__content { gap: 14px; padding: 24px 20px; }
    .cil-ev .cil-ev-next__label { margin-block-end: -6px; }
    .cil-ev-next__title { font-size: 28px; }
    .cil-ev-next__line { font-size: 16px; }
    /* No event coming (Figma 13628:766): the buttons stacked full width, the main one first, words at the reading start. */
    .cil-ev-none__box { padding: 32px 20px; }
    .cil-ev .cil-ev-none__title { font-size: 24px; }
    .cil-ev-none__text { font-size: 16px; }
    .cil-ev-none__actions { flex-direction: column; align-self: stretch; }
    .cil-ev-none__actions .cil-ev-btn { justify-content: flex-start; }
    .cil-ev-actions__row, .cil-ev-actions--long .cil-ev-actions__row { flex-direction: column; align-items: stretch; }
    .cil-ev .cil-ev-btn { width: 100%; }
    .cil-ev-row__main { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px 14px; padding: 18px 16px; align-items: start; }
    .cil-ev-tile { width: 64px; height: 76px; border-radius: 12px; }
    .cil-ev-tile__day { font-size: 24px; }
    .cil-ev-row__title { font-size: 18px; }
    .cil-ev-row__line { font-size: 14px; }
    .cil-ev-row__actions { grid-column: 1 / -1; flex-direction: row; flex-wrap: wrap; align-items: center; justify-content: space-between; }
    .cil-ev-row__actions .cil-ev-actions { flex: 1; }
    .cil-ev-row__actions .cil-ev-btn { width: auto; }
    /* A registered row: "נרשמת" and "ביטול ההרשמה" side by side at their own widths, "פרטים" still at the far end. */
    .cil-ev-row__actions .cil-ev-actions__row { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 8px 16px; }
    /* Every row's "פרטים" at the far end, even alone on its line (Oren 2026-10-15, items 36, 64). */
    .cil-ev .cil-ev-row__actions .cil-ev-toggle { margin-inline-start: auto; }
    .cil-ev-details__inner { padding: 0 16px 24px; gap: 20px; }
    .cil-ev-details__text { font-size: 16px; }
    .cil-ev-recordings { grid-template-columns: minmax(0, 1fr); }
    .cil-ev-gallery { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .cil-ev-gallery a { height: 96px; }
    .cil-ev-gallery li:nth-child(n + 4) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
    .cil-ev-rec, .cil-ev-rec__picture, .cil-ev-rec__play, .cil-ev-gallery img { transition: none; }
    .cil-ev-rec:hover { transform: none; }
}
