/* =============================================================
   modal-nahled.css
   Modální náhledové okno — video (YouTube) a PDF viewer
   Použití: přilinkovat na stránkách, kde jsou média ke zobrazení
   Volání:  otevriNahled('video' | 'pdf', url, titulek)
   ============================================================= */

.modal-nahled {
    position: fixed;
    inset: 0;
    background: rgba(3, 3, 51, 0.88);
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1.5rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.2s ease, visibility 0.2s ease;
}
.modal-nahled.je-otevreny {
    opacity: 1;
    visibility: visible;
}

/* Okno */
.modal-nahled__okno {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    width: 100%;
    max-width: 920px;
    max-height: 90vh;
    box-shadow: 0 24px 64px rgba(0, 0, 0, 0.5);
}

/* Hlavička */
.modal-nahled__hlavicka {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    background: #030333;
    color: #fff;
    padding: 0.65rem 1rem 0.65rem 1.25rem;
    flex-shrink: 0;
}
.modal-nahled__titulek {
    font-size: 0.88rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.85);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.modal-nahled__zavrit {
    background: rgba(255, 255, 255, 0.1);
    border: none;
    color: #fff;
    cursor: pointer;
    font-size: 1.1rem;
    line-height: 1;
    padding: 0.35rem 0.6rem;
    border-radius: 6px;
    flex-shrink: 0;
    transition: background 0.15s;
}
.modal-nahled__zavrit:hover {
    background: rgba(255, 255, 255, 0.22);
}

/* Video — 16:9 */
.modal-nahled__video {
    position: relative;
    padding-bottom: 56.25%;
    height: 0;
}
.modal-nahled__video iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    border: none;
    display: block;
}

/* PDF */
.modal-nahled__pdf {
    flex: 1;
    min-height: 0;
}
.modal-nahled__pdf iframe {
    width: 100%;
    height: 100%;
    min-height: 75vh;
    border: none;
    display: block;
}

/* Tlačítko pro otevření média (outline varianta) */
.tlacitko--media {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: transparent;
    border: 2px solid rgba(3, 3, 51, 0.25);
    color: #030333;
    padding: 0.55rem 1.1rem;
    border-radius: var(--polomer, 6px);
    font-size: 0.88rem;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: border-color 0.2s, background 0.2s;
    font-family: inherit;
}
.tlacitko--media:hover {
    border-color: #030333;
    background: rgba(3, 3, 51, 0.06);
}
/* Varianta pro tmavé/barevné pozadí */
.tlacitko--media-bila {
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}
.tlacitko--media-bila:hover {
    border-color: #fff;
    background: rgba(255, 255, 255, 0.1);
}

@media (max-width: 600px) {
    .modal-nahled {
        padding: 0.5rem;
        align-items: flex-end;
    }
    .modal-nahled__okno {
        max-height: 95vh;
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
    }
}
