/* ================================================================
   PSY-SVETKNIHY — HP blok: Svět knihy 2026
   Nahraj na FTP: /user/documents/userfiles/custom-hp-svetknihy.css
   Aktivace: window.HP_BLOKY = { 0: 'svetknihy', ... }
   HTML šablona + initSvetknihy() v custom-hp-bloky.js
================================================================ */

.psy-svetknihy__heading {
    font-family: 'Poppins', sans-serif;
    font-size: 34px;
    font-weight: 700;
    line-height: 37px;
    color: #1f1f1f;
    text-align: center;
    max-width: 1500px;
    margin: 32px auto 36px;
    padding: 0 20px;
}

.psy-svetknihy {
    position: relative;
    z-index: 1;
    height: 400px;
    max-width: 1500px;
    margin: 0 auto 56px;
    background: #1a1a1a;
    border-radius: 24px;
    overflow: hidden;
    transition: height 0.52s cubic-bezier(0.4, 0, 0.2, 1);
}
.psy-svetknihy.psy-sk--expanded { height: 560px; }

/* ── Panely ─────────────────────────────────────────────────── */

.psy-svetknihy__panel {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 34%;
    border-radius: 24px;
    overflow: hidden;
    cursor: pointer;
    box-sizing: border-box;
    background-color: #1a1a1a;
    background-image: linear-gradient(135deg,
        rgba(255,255,255,0.08) 0%,
        rgba(255,255,255,0.02) 35%,
        rgba(0,0,0,0.18) 75%,
        rgba(0,0,0,0.32) 100%);
    transition:
        left             0.52s cubic-bezier(0.4, 0, 0.2, 1),
        width            0.52s cubic-bezier(0.4, 0, 0.2, 1),
        background-color 0.38s ease,
        background-image 0.38s ease,
        box-shadow       0.4s ease;
}

/* Klidové pozice */
.psy-svetknihy__panel:nth-child(1) { left: 0;   }
.psy-svetknihy__panel:nth-child(2) { left: 33%; }
.psy-svetknihy__panel:nth-child(3) { left: 66%; }

/* Šedící overlay */
.psy-svetknihy__panel::after {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(140,140,140,0);
    pointer-events: none;
    z-index: 20;
    border-radius: inherit;
    transition: background 0.4s ease;
}

/* Aktivní karta */
.psy-svetknihy__panel.psy-sk--active {
    width: 70%;
    background-color: #ffffff;
    background-image: none;
    box-shadow: 0 12px 48px rgba(0,0,0,0.35);
}
.psy-svetknihy__panel:nth-child(1).psy-sk--active { left: 0;   }
.psy-svetknihy__panel:nth-child(2).psy-sk--active { left: 15%; }
.psy-svetknihy__panel:nth-child(3).psy-sk--active { left: 30%; }

/* Posun prostřední karty při aktivaci krajní */
.psy-svetknihy:has(.psy-svetknihy__panel:nth-child(1).psy-sk--active) .psy-svetknihy__panel:nth-child(2) {
    left: 51%;
}
.psy-svetknihy:has(.psy-svetknihy__panel:nth-child(3).psy-sk--active) .psy-svetknihy__panel:nth-child(2) {
    left: 15%;
}

/* Tmavý rámeček aktivní karty */
.psy-svetknihy__panel::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 3px solid transparent;
    border-radius: inherit;
    box-sizing: border-box;
    pointer-events: none;
    z-index: 25;
    transition: border-color 0.3s ease;
}
.psy-svetknihy__panel.psy-sk--active::before {
    border-color: #404040;
}

/* Z-index vrstvy */
.psy-svetknihy__panel:nth-child(1) { z-index: 1; }
.psy-svetknihy__panel:nth-child(2) { z-index: 2; }
.psy-svetknihy__panel:nth-child(3) { z-index: 3; }

.psy-svetknihy__panel.psy-sk--active { z-index: 50; }
.psy-sk--active + .psy-svetknihy__panel,
.psy-svetknihy__panel:has(+ .psy-sk--active) { z-index: 40; }
.psy-sk--active + .psy-svetknihy__panel + .psy-svetknihy__panel,
.psy-svetknihy__panel:has(+ .psy-svetknihy__panel + .psy-sk--active) { z-index: 30; }

/* Zešednění sousedních karet */
.psy-sk--active + .psy-svetknihy__panel::after,
.psy-svetknihy__panel:has(+ .psy-sk--active)::after {
    background: rgba(160,160,160,0.28);
}
.psy-sk--active + .psy-svetknihy__panel + .psy-svetknihy__panel::after,
.psy-svetknihy__panel:has(+ .psy-svetknihy__panel + .psy-sk--active)::after {
    background: rgba(160,160,160,0.55);
}

/* ================================================================
   PANEL 1 — PROMO
================================================================ */

.psy-sk-promo {
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    z-index: 5;
    padding: 42px 36px 36px 50px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    transition: right 0.52s cubic-bezier(0.4, 0, 0.2, 1);
}
.psy-sk--active .psy-sk-promo {
    right: 50%;
    padding: 34px 36px 36px;
}

.psy-sk-promo__label {
    font-size: 16px;
    font-weight: 400;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    margin: 0 0 18px;
    line-height: 1.2;
    transition: color 0.35s;
}
.psy-sk--active .psy-sk-promo__label { color: rgba(0,0,0,0.45); }

.psy-sk-promo__title {
    font-size: 30px;
    font-weight: 700;
    line-height: 1.2;
    color: #ffffff;
    margin: 0 0 14px;
    transition: color 0.35s;
}
.psy-sk--active .psy-sk-promo__title { color: #1a1a1a; }

.psy-sk-promo__perex {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    color: rgba(255,255,255,0.6);
    margin: 0;
    transition: color 0.35s;
}
.psy-sk--active .psy-sk-promo__perex { color: rgba(0,0,0,0.6); }

.psy-sk-promo__pill {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 12px;
    font-weight: 700;
    padding: 7px 18px;
    border-radius: 999px;
    background: rgba(255,255,255,0.12);
    color: rgba(255,255,255,0.9);
    border: 1.5px solid rgba(255,255,255,0.35);
    white-space: nowrap;
    transition: background 0.35s, color 0.35s, border-color 0.35s;
}
.psy-sk--active .psy-sk-promo__pill {
    background: rgba(0,0,0,0.06);
    color: rgba(0,0,0,0.7);
    border-color: rgba(0,0,0,0.25);
}

.psy-sk-promo__spacer { flex: 1; }

.psy-sk-promo__bottom {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
}

.psy-sk-promo__btn {
    display: inline-block;
    align-self: flex-start;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    padding: 13px 26px;
    border-radius: 8px;
    white-space: nowrap;
    background: #ffffff;
    color: #1a1a1a;
    transition: background 0.25s, color 0.25s;
}
.psy-sk-promo__btn:hover { background: #5A958B; color: #fff; }
.psy-sk--active .psy-sk-promo__btn { background: #1a1a1a; color: #ffffff; }
.psy-sk--active .psy-sk-promo__btn:hover { background: #5A958B; }

/* Pravá polovina promo karty (jen aktivní stav) */
.psy-sk-promo-extra {
    position: absolute;
    top: 34px;
    right: 36px;
    bottom: 36px;
    left: 50%;
    padding-left: 28px;
    box-sizing: border-box;
    z-index: 6;
    display: flex;
    flex-direction: column;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.45s ease 0.2s, transform 0.45s ease 0.2s;
}
.psy-sk--active .psy-sk-promo-extra {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.psy-sk-promo-extra__text {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(0,0,0,0.7);
    margin: 0 0 18px;
}

.psy-sk-promo-extra__photos {
    position: relative;
    flex: 1;
    width: 100%;
    min-height: 180px;
}
.psy-sk-promo-extra__photo {
    position: absolute;
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    display: block;
}
.psy-sk-promo-extra__photo--bottom {
    right: 0;
    bottom: 0;
    width: 80%;
    height: 78%;
    z-index: 1;
}
.psy-sk-promo-extra__photo--top {
    left: 0;
    top: 0;
    width: 58%;
    height: 56%;
    z-index: 2;
    box-shadow: 0 10px 28px rgba(0,0,0,0.28);
}

/* ================================================================
   PANELY 2 & 3 — PŘEDNÁŠEJÍCÍ
================================================================ */

.psy-sk-photo {
    position: absolute;
    bottom: 0;
    height: 92%;
    width: auto;
    right: -80px;
    transform: translateX(0);
    z-index: 0;
    pointer-events: none;
    user-select: none;
    transition:
        right     0.6s cubic-bezier(0.4, 0, 0.2, 1),
        transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity   0.5s ease;
}
.psy-sk-photo--dark  { opacity: 1; }
.psy-sk-photo--light { opacity: 0; }

.psy-sk--active .psy-sk-photo {
    right: 50%;
    transform: translateX(50%);
}
.psy-sk--active .psy-sk-photo--dark  { opacity: 0; }
.psy-sk--active .psy-sk-photo--light { opacity: 1; }

.psy-sk-speaker {
    position: absolute;
    top: 0; bottom: 0; left: 0; right: 0;
    z-index: 16;
    padding: 42px 36px 36px 50px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
    pointer-events: none;
    transition: right 0.52s cubic-bezier(0.4, 0, 0.2, 1), padding 0.4s ease;
}
.psy-sk--active .psy-sk-speaker {
    right: 67%;
    padding: 34px 36px 36px;
}

.psy-sk-speaker__time {
    font-size: 16px;
    font-weight: 400;
    color: rgba(255,255,255,0.85);
    margin: 0 0 4px;
    line-height: 1.3;
    transition: color 0.35s;
}
.psy-sk--active .psy-sk-speaker__time { color: rgba(0,0,0,0.7); }

.psy-sk-speaker__location {
    font-size: 16px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 1px;
    color: #ffffff;
    margin: 0 0 28px;
    line-height: 1.3;
    transition: color 0.35s;
}
.psy-sk--active .psy-sk-speaker__location {
    color: rgba(0,0,0,0.85);
    text-transform: none;
    letter-spacing: 0;
    font-size: 18px;
    font-weight: 700;
}

.psy-sk-speaker__name {
    font-size: 42px;
    font-weight: 700;
    line-height: 1.05;
    color: #ffffff;
    margin: 0 0 22px;
    transition: color 0.35s;
}
.psy-sk--active .psy-sk-speaker__name { color: #1a1a1a; }

.psy-sk-speaker__intro {
    font-size: 19px;
    font-weight: 400;
    color: rgba(255,255,255,0.75);
    margin: 0 0 0px;
    line-height: 1.3;
    transition: color 0.35s, font-size 0.35s;
}
.psy-sk--active .psy-sk-speaker__intro {
    color: rgba(0,0,0,0.55);
    font-size: 19px;
    margin-bottom: 0;
}

.psy-sk-speaker__book {
    font-size: 20px;
    font-weight: 700;
    color: #ffffff;
    margin: 0;
    line-height: 1.2;
    transition: color 0.35s, font-size 0.35s;
}
.psy-sk--active .psy-sk-speaker__book {
    color: #1a1a1a;
    font-size: 21px;
}

.psy-sk-speaker__description {
    position: absolute;
    bottom: 36px;
    left: 36px;
    right: 50%;
    max-height: 120px;
    overflow: hidden;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.6;
    color: rgba(0,0,0,0.7);
    margin: 0;
    z-index: 15;
    opacity: 0;
    transform: translateY(6px);
    pointer-events: none;
    transition: opacity 0.4s ease 0.18s, transform 0.4s ease 0.18s;
}
.psy-sk--active .psy-sk-speaker__description {
    left: 36px;
    right: 62%;      /* zúžení → ~5 řádků */
    max-height: 220px;
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.psy-sk-speaker__spacer { flex: 1; }

.psy-sk-photo-gradient {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 64%;
    height: 70%;
    background: linear-gradient(to top right, #ffffff 22%, rgba(255,255,255,0.75) 38%, rgba(255,255,255,0) 58%);
    pointer-events: none;
    z-index: 14;
    opacity: 0;
    transition: opacity 0.45s ease 0.18s;
}
.psy-sk--active .psy-sk-photo-gradient { opacity: 1; }

.psy-sk-speaker__more {
    font-size: 16px;
    font-weight: 700;
    color: #ffffff;
    text-decoration: none;
    line-height: 1;
    align-self: flex-start;
    pointer-events: auto;
    opacity: 1;
    transition: opacity 0.25s ease, color 0.25s;
}
.psy-sk-speaker__more:hover { color: #5A958B; }
.psy-sk--active .psy-sk-speaker__more {
    opacity: 0;
    pointer-events: none;
}

/* ================================================================
   PRAVÁ TŘETINA — popis nad knihou + obal + button
================================================================ */

.psy-sk-extra {
    position: absolute;
    top: 34px;
    right: 36px;
    bottom: 36px;
    width: 36%;
    max-width: 340px;
    z-index: 16;
    opacity: 0;
    transform: translateY(10px);
    pointer-events: none;
    transition: opacity 0.45s ease 0.22s, transform 0.45s ease 0.22s;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    box-sizing: border-box;
}
.psy-sk--active .psy-sk-extra {
    opacity: 1;
    transform: none;
    pointer-events: auto;
}

.psy-sk-extra__heading {
    font-family: 'Poppins', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: rgba(0,0,0,0.85);
    margin: 0 0 8px;
    text-align: right;
    width: 100%;
}

.psy-sk-extra__description {
    font-size: 16px;
    font-weight: 400;
    line-height: 1.55;
    color: rgba(0,0,0,0.78);
    margin: 0 0 18px;
    text-align: right;
    width: 100%;
}

.psy-sk-extra__book {
    margin-top: auto;
    width: 100%;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    position: relative;
}

.psy-sk-extra__cover {
    display: block;
    width: auto;
    max-width: 100%;
    height: auto;
    max-height: 240px;
    border-radius: 4px;
    box-shadow: 0 8px 24px rgba(0,0,0,0.18);
    margin-bottom: -22px;
}

.psy-sk-extra__btn {
    display: inline-block;
    font-family: 'Poppins', sans-serif;
    font-size: 16px;
    font-weight: 700;
    text-decoration: none;
    padding: 11px 24px;
    border-radius: 999px;
    background: #ffffff;
    color: #1a1a1a;
    border: 1.5px solid #1a1a1a;
    box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    transition: background 0.25s, color 0.25s, border-color 0.25s;
    position: relative;
    z-index: 2;
}
.psy-sk-extra__btn:hover {
    background: #1a1a1a;
    color: #ffffff;
}

/* ── Mobil ── */
@media (max-width: 768px) {

    /* Container */
    .psy-svetknihy {
        display: flex;
        flex-direction: column;
        height: auto;
        gap: 6px;
        border-radius: 16px;
    }
    .psy-svetknihy.psy-sk--expanded { height: auto; }

    /* Closed panel — dark peek s fotkou vpravo */
    .psy-svetknihy__panel {
        position: relative;
        width: 100% !important;
        left: 0 !important;
        height: 200px;
        border-radius: 16px;
        cursor: pointer;
        overflow: hidden;
    }
    .psy-svetknihy__panel .psy-sk-speaker { padding: 20px 16px; }
    .psy-svetknihy__panel .psy-sk-speaker__more { display: none; }
    .psy-sk-speaker__name { font-size: 8vw; }
    .psy-sk-promo__title  { font-size: 5.5vw; }

    /* Active panel → vertikální flex (přepíše absolutní desktop layout) */
    .psy-svetknihy__panel.psy-sk--active {
        height: auto;
        display: flex;
        flex-direction: column;
        cursor: default;
    }

    /* ── Speaker panels — aktivní stav ── */

    /* Světlá fotka nahoře přes celou šířku */
    .psy-svetknihy__panel.psy-sk--active .psy-sk-photo--dark  { display: none; }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-photo--light {
        position: relative;
        order: 1;
        right: auto;
        transform: none;
        opacity: 1;
        width: 100%;
        height: 280px;
        object-fit: cover;
        object-position: top center;
        flex-shrink: 0;
    }

    /* Blok s přednášejícím pod fotkou */
    .psy-svetknihy__panel.psy-sk--active .psy-sk-speaker {
        position: relative;
        order: 2;
        right: auto;
        top: auto; left: auto; bottom: auto;
        padding: 20px 20px 12px;
        pointer-events: auto;
    }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-speaker__name   { font-size: 9vw; }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-speaker__spacer { display: none; }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-speaker__more   { display: none; }

    /* Krátký popis přednášky */
    .psy-svetknihy__panel.psy-sk--active .psy-sk-speaker__description {
        display: block;
        position: relative;
        order: 3;
        bottom: auto; left: auto; right: auto;
        max-height: none;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        padding: 0 20px 16px;
        font-size: 15px;
    }

    /* Sekce s knihou a tlačítkem */
    .psy-svetknihy__panel.psy-sk--active .psy-sk-extra {
        display: flex;
        position: relative;
        order: 4;
        top: auto; right: auto; bottom: auto;
        width: 100%;
        max-width: none;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        padding: 0 20px 24px;
        box-sizing: border-box;
        flex-direction: column;
        align-items: flex-start;
    }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-extra__heading,
    .psy-svetknihy__panel.psy-sk--active .psy-sk-extra__description {
        text-align: left;
        width: auto;
    }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-extra__book {
        align-items: flex-start;
        width: 100%;
    }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-extra__cover { max-height: 180px; }

    /* Gradient přes fotku — skrýt na mobilu */
    .psy-svetknihy__panel.psy-sk--active .psy-sk-photo-gradient { display: none; }

    /* ── Promo panel — aktivní stav ── */
    .psy-svetknihy__panel.psy-sk--active .psy-sk-promo {
        position: relative;
        order: 1;
        right: auto;
        top: auto; left: auto; bottom: auto;
        padding: 24px 20px 20px;
    }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-promo__title  { font-size: 6vw; }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-promo__spacer { display: none; }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-promo-extra {
        display: flex;
        position: relative;
        order: 2;
        left: auto; top: auto; right: auto; bottom: auto;
        opacity: 1;
        transform: none;
        pointer-events: auto;
        width: 100%;
        padding: 0 20px 24px;
        box-sizing: border-box;
    }
    .psy-svetknihy__panel.psy-sk--active .psy-sk-promo-extra__photos { min-height: 200px; }
}
