/* ============================================================
   HP BLOK — Nejbližší akce (psy-eventy)
   Nahraj na FTP: /user/documents/userfiles/custom-hp-eventy.css
   Data: Supabase `events` (viz custom-hp-bloky.js → initEventy)

   Rozměry i slider drží shodu s blokem `komunita`
   (custom-hp-komunita.css) — stejná výška, stejné šipky.

   ⚠️ Šířka karet stojí na `calc((100% - 32px) / 3)`. Aby procento mělo
   o co se opřít, musí mít KAŽDÝ předek karty definitivní šířku. Proto je
   `__right` sloupcový flex (potomci se roztahují na plnou šířku) a
   `__slider` je obyčejný blok — ne řádkový flex s `flex-basis: auto`,
   který šířku dopočítává z obsahu a roztáhl by karty podle délky názvu.
   ============================================================ */

.psy-eventy {
    display: flex;
    align-items: stretch;
    background: #ffffff;
    border: 2px solid #222222;
    border-radius: 24px;
    overflow: hidden;
    height: 400px;
    max-width: 1500px;
    margin: 32px auto;
    position: relative;
    z-index: 1;
}

/* ── Levá část — text ── */
.psy-eventy__left {
    flex: 0 0 27%;
    padding: 60px 36px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 20px;
}

.psy-eventy__eyebrow {
    font-family: 'Poppins', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #5A958B;
}

.psy-eventy__title {
    font-family: 'Poppins', sans-serif;
    font-size: 2.5rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.25;
}

.psy-eventy__text {
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.65);
    line-height: 1.55;
    margin: 0;
}

.psy-eventy__btn {
    display: inline-block;
    padding: 12px 25px;
    background: #1a1a1a;
    border-radius: 14px;
    color: #ffffff !important;
    font-family: 'Poppins', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    text-decoration: none !important;
    align-self: flex-start;
    transition: background .2s;
}

.psy-eventy__btn:hover {
    background: #59948D;
    color: #ffffff !important;
}

/* ── Pravá část — slider + filtry pod ním ── */
.psy-eventy__right {
    flex: 0 0 73%;
    min-width: 0;
    padding: 32px 44px;
    display: flex;
    flex-direction: column;   /* potomci se stretchují na plnou (definitivní) šířku */
    gap: 14px;
    background: #F8F4EE;
}

/* Kotva pro šipky + definitivní šířka pro karty. Obyčejný blok, ne flex. */
.psy-eventy__slider {
    position: relative;
    flex: 1 1 auto;
    min-height: 0;
    width: 100%;
}

/* Posuvná plocha — scroll container, šipky jen mění scrollLeft.
   Scrollbar je skrytý, swipe na dotykových zařízeních zůstává funkční. */
.psy-eventy__track-wrap {
    width: 100%;
    height: 100%;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.psy-eventy__track-wrap::-webkit-scrollbar {
    display: none;
}

.psy-eventy__track {
    display: flex;
    align-items: stretch;
    gap: 16px;
    width: 100%;
    height: 100%;
}

/* ── Šipky ── */
.psy-eventy__arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 2;
    width: 36px;
    height: 36px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #ffffff;
    border: 2px solid #222222;
    border-radius: 50%;
    color: #1a1a1a;
    cursor: pointer;
    transition: background .2s, color .2s, border-color .2s;
}

.psy-eventy__arrow:hover {
    background: #59948D;
    border-color: #59948D;
    color: #ffffff;
}

.psy-eventy__arrow svg {
    display: block;
}

.psy-eventy__arrow[hidden] {
    display: none;
}

/* Šipky sedí v paddingu panelu (44px), stejně jako u bloku komunita. */
.psy-eventy__arrow--prev { left: -40px; }
.psy-eventy__arrow--next { right: -40px; }

/* ── Filtry typů akcí ── */
.psy-eventy__filters {
    flex: 0 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    min-height: 30px;
}

.psy-eventy__filter {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 6px 13px 6px 9px;
    border-radius: 999px;
    border: 2px solid rgba(26, 26, 26, 0.12);
    background: #ffffff;
    cursor: pointer;
    user-select: none;
    font-family: 'Poppins', sans-serif;
    font-size: 1.1rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: rgba(0, 0, 0, 0.55);
    transition: border-color .2s, color .2s, background .2s;
}

.psy-eventy__filter:hover {
    border-color: rgba(26, 26, 26, 0.35);
    color: #1a1a1a;
}

/* Nativní checkbox zůstává v DOM kvůli klávesnici a čtečkám, jen není vidět. */
.psy-eventy__filter input {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
    margin: 0;
}

.psy-eventy__filter-box {
    flex: 0 0 auto;
    width: 15px;
    height: 15px;
    border-radius: 5px;
    border: 2px solid rgba(26, 26, 26, 0.25);
    background: #ffffff;
    position: relative;
    transition: background .2s, border-color .2s;
}

/* Fajfka — nakreslená bordrem, aby nepotřebovala další element ani font. */
.psy-eventy__filter-box::after {
    content: '';
    position: absolute;
    left: 3.5px;
    top: 0.5px;
    width: 4px;
    height: 8px;
    border: solid #ffffff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg) scale(0);
    transition: transform .15s ease;
}

.psy-eventy__filter input:checked ~ .psy-eventy__filter-box::after {
    transform: rotate(45deg) scale(1);
}

.psy-eventy__filter input:focus-visible ~ .psy-eventy__filter-box {
    outline: 2px solid #5A958B;
    outline-offset: 2px;
}

/* Zaškrtnutý stav přebírá barvu své pilulky (shoda s badge na kartě). */
.psy-eventy__filter--on {
    color: #1a1a1a;
    background: rgba(26, 26, 26, 0.05);
    border-color: #1a1a1a;
}

.psy-eventy__filter--on .psy-eventy__filter-box {
    background: #1a1a1a;
    border-color: #1a1a1a;
}

.psy-eventy__filter--on[data-mod="event"],
.psy-eventy__filter--on[data-mod="festival"] {
    color: #5A958B;
    border-color: #5A958B;
    background: rgba(90, 149, 139, 0.10);
}

.psy-eventy__filter--on[data-mod="event"] .psy-eventy__filter-box,
.psy-eventy__filter--on[data-mod="festival"] .psy-eventy__filter-box {
    background: #5A958B;
    border-color: #5A958B;
}

.psy-eventy__filter--on[data-mod="prednaska"] {
    color: #764D5A;
    border-color: #764D5A;
    background: rgba(118, 77, 90, 0.10);
}

.psy-eventy__filter--on[data-mod="prednaska"] .psy-eventy__filter-box {
    background: #764D5A;
    border-color: #764D5A;
}

/* ── Skeleton (loading stav) ── */
.psy-eventy__skeleton {
    flex: 0 0 calc((100% - 32px) / 3);
    border-radius: 18px;
    background: linear-gradient(90deg, #EFEBE2 25%, #F6F3EC 37%, #EFEBE2 63%);
    background-size: 400% 100%;
    animation: psy-eventy-shimmer 1.4s ease infinite;
}

@keyframes psy-eventy-shimmer {
    0%   { background-position: 100% 50%; }
    100% { background-position: 0 50%; }
}

/* ── Karta akce ── */
.psy-eventy__card {
    flex: 0 0 calc((100% - 32px) / 3);
    scroll-snap-align: start;
    display: flex;
    flex-direction: column;
    gap: 14px;
    background: #ffffff;
    border-radius: 18px;
    padding: 22px;
    text-decoration: none !important;
    transition: transform .2s ease, box-shadow .2s ease;
}

.psy-eventy__card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.08);
}

.psy-eventy__info {
    display: flex;
    flex-direction: column;
    flex: 1 1 auto;
    min-height: 0;
    gap: 10px;
}

/* ── Pilulka typu akce ── */
.psy-eventy__badge {
    flex: 0 0 auto;
    font-family: 'Poppins', sans-serif;
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    line-height: 1;
    padding: 6px 12px;
    border-radius: 999px;
    white-space: nowrap;
    /* výchozí = neutrální (fallback pro neznámý typ) */
    color: #1a1a1a;
    background: rgba(26, 26, 26, 0.08);
}

/* Kino = neutrální tmavá (shodné s výchozím, ponecháno explicitně) */
.psy-eventy__badge--kino {
    color: #1a1a1a;
    background: rgba(26, 26, 26, 0.08);
}

.psy-eventy__badge--event {
    color: #5A958B;
    background: rgba(90, 149, 139, 0.15);
}

.psy-eventy__badge--festival {
    color: #ffffff;
    background: #5A958B;
}

.psy-eventy__badge--prednaska {
    color: #764D5A;
    background: rgba(118, 77, 90, 0.13);
}

/* Hlavička karty — datum vlevo, pilulka typu vpravo */
.psy-eventy__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex: 0 0 auto;
}

.psy-eventy__date {
    display: flex;
    align-items: baseline;
    gap: 8px;
}

.psy-eventy__day {
    font-family: 'Poppins', sans-serif;
    font-size: 2.8rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #1a1a1a;
    line-height: 1;
}

.psy-eventy__month {
    font-family: 'Poppins', sans-serif;
    font-size: 1.15rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #5A958B;
}

.psy-eventy__name {
    font-family: 'Poppins', sans-serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: #1a1a1a;
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    transition: color .2s;
}

.psy-eventy__card:hover .psy-eventy__name {
    color: #5A958B;
}

.psy-eventy__place {
    font-family: 'Poppins', sans-serif;
    font-size: 1.3rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.6);
    margin: 0;
    margin-top: auto;
    line-height: 1.35;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.psy-eventy__empty {
    flex: 1 1 auto;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Poppins', sans-serif;
    font-size: 1.4rem;
    font-weight: 500;
    color: rgba(0, 0, 0, 0.45);
    margin: 0;
}

/* ── Responsivita ── */
@media (max-width: 1280px) {
    .psy-eventy__title { font-size: 2rem; }
    .psy-eventy__text  { font-size: 1.25rem; }
    .psy-eventy__btn   { font-size: 1.25rem; }
    .psy-eventy__left  { padding: 40px 28px; gap: 16px; }
    .psy-eventy__right { padding: 28px 44px; }
    .psy-eventy__name  { font-size: 1.55rem; }
    .psy-eventy__place { font-size: 1.2rem; }
    .psy-eventy__day   { font-size: 2.4rem; }
    .psy-eventy__badge { font-size: 0.95rem; padding: 5px 11px; }
    .psy-eventy__card  { padding: 18px; gap: 11px; }
    .psy-eventy__info  { gap: 8px; }
    .psy-eventy__filter { font-size: 1rem; padding: 5px 11px 5px 8px; }
}

@media (max-width: 768px) {
    .psy-eventy {
        flex-direction: column;
        height: auto;
        max-width: 100%;
    }
    .psy-eventy__left {
        padding: 24px 22px;
        gap: 12px;
    }
    .psy-eventy__title { font-size: 1.6rem; }
    .psy-eventy__text  { font-size: 1rem; }
    .psy-eventy__btn   { font-size: 1rem; }

    .psy-eventy__right {
        flex: none;
        padding: 16px 38px 20px;
    }
    .psy-eventy__slider {
        flex: none;
        height: 230px;
    }
    .psy-eventy__track {
        gap: 14px;
    }
    .psy-eventy__card,
    .psy-eventy__skeleton {
        flex: 0 0 calc((100% - 14px) / 2);
    }
    .psy-eventy__card {
        padding: 16px;
    }
    .psy-eventy__info {
        flex: 1 1 auto;
        gap: 6px;
    }
    .psy-eventy__place {
        margin-top: auto;
        font-size: 1.2rem;
    }
    .psy-eventy__head {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    .psy-eventy__badge {
        font-size: 0.9rem;
        padding: 5px 10px;
    }
    .psy-eventy__day   { font-size: 2.2rem; }
    .psy-eventy__name  { font-size: 1.4rem; -webkit-line-clamp: 3; }
    .psy-eventy__arrow {
        width: 32px;
        height: 32px;
    }
    .psy-eventy__arrow--prev { left: -34px; }
    .psy-eventy__arrow--next { right: -34px; }
}

@media (max-width: 480px) {
    .psy-eventy__card,
    .psy-eventy__skeleton {
        flex: 0 0 100%;
    }
    .psy-eventy__slider { height: 250px; }
}

/* Přeskakování stránek slideru je animované, ale ne pro uživatele,
   kteří si vyžádali omezený pohyb. */
@media (prefers-reduced-motion: reduce) {
    .psy-eventy__track-wrap { scroll-behavior: auto; }
    .psy-eventy__filter-box::after { transition: none; }
}
