/* Overlay */
.obra-modal-overlay {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: pf-redes-fadeIn 0.2s ease-out;
}
@keyframes pf-redes-fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

/* Modal box */
.obra-modal {
    background: #fff;
    max-width: 900px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    border-radius: 4px;
}

/* Close button */
.obra-modal-close {
    position: absolute;
    top: 10px; right: 15px;
    background: none;
    border: none;
    font-size: 28px;
    cursor: pointer;
    color: #333;
    z-index: 1;
}
.obra-modal-close:hover { color: #C91517; }

/* Content: 2 columns */
.obra-modal-content {
    display: flex;
    gap: 24px;
    padding: 24px;
}

/* Left: poster + video */
.obra-modal-left {
    flex: 0 0 250px;
}
.obra-modal-cartel {
    width: 100%;
    height: auto;
    display: block;
}
.obra-modal-left iframe {
    width: 100%;
    height: 150px;
    margin-top: 12px;
}

/* Right: metadata */
.obra-modal-right {
    flex: 1;
    min-width: 0;
}
.obra-modal-right h3 {
    margin: 0 0 8px;
    font-size: 22px;
    color: #171723;
}

/* Tips/tags */
.obra-modal .tips-box {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-bottom: 16px;
}
.obra-modal .tip {
    padding: 2px 8px;
    background: #d0d0d0;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 1px;
}

/* Info fields */
.obra-modal-field {
    margin-bottom: 8px;
    font-size: 14px;
    line-height: 1.4;
}
.obra-modal-field strong {
    color: #171723;
}
.obra-modal-contact-link {
    color: #C91517;
    text-decoration: none;
    border-bottom: 1px dotted currentColor;
}
.obra-modal-contact-link:hover,
.obra-modal-contact-link:focus {
    color: #B90507;
    border-bottom-style: solid;
}

/* Event block ("Esta presentación") — only used by the presentaciones panel. */
.obra-modal-event {
    margin-bottom: 14px;
    padding: 10px 12px;
    background: #f6f6f8;
    border-left: 3px solid #C91517;
    border-radius: 3px;
}
.obra-modal-event-heading {
    font-weight: 700;
    color: #171723;
    margin-bottom: 6px;
    font-size: 14px;
}
.obra-modal-event .obra-modal-field {
    margin-bottom: 4px;
}

/* Sinopsis */
.obra-modal-sinopsis {
    margin-top: 12px;
    font-size: 13px;
    color: #555;
    line-height: 1.5;
}

/* Fuente block («Datos proporcionados por: [logo]», tema#99). El logo es el
   UNICO enlace del bloque: a la pagina del gestor en RED-ES o, sin gestor, a la
   web externa de la Source (target _blank). */
.obra-modal .fuente-block {
    padding: 12px 24px;
    border-top: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    font-size: 13px;
}
.obra-modal .fuente-block p {
    margin: 0;
}
.obra-modal .fuente-link {
    display: inline-flex;
    align-items: center;
    color: #C91517;
    text-decoration: none;
}
/* Logo a 64px de alto (antes 40): eleccion documentada en la DEC de tema#99
   (DEC-068) frente a la caja 4:3 de 80px de la ficha — el bloque es una fila a
   pie de modal y 80px la engordaba; el ancho se acota para que un logo muy
   apaisado (hay hasta 8,6:1) no se coma la fila. `object-fit: contain` como en
   la ficha. */
.obra-modal .fuente-logo {
    height: 64px;
    width: auto;
    max-width: 240px;
    object-fit: contain;
    border-radius: 5px;
    display: block;
}
/* Gestor sin foto: la «name-box» de la ficha (obra-header) a la escala del
   modal — misma silueta 4:3 que tendria el logo, borde sutil, nombre centrado
   en mayusculas pequeñas, 3 lineas maximo. */
.obra-modal .fuente-name-box {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 64px;
    aspect-ratio: 4 / 3;
    padding: 4px;
    border: 1px solid #e6e6e6;
    border-radius: 5px;
    color: #171723;
    transition: border-color 0.2s, color 0.2s;
}
.obra-modal a.fuente-link:hover .fuente-name-box,
.obra-modal a.fuente-link:focus .fuente-name-box {
    border-color: #C91517;
    color: #C91517;
}
.obra-modal .fuente-name-box-text {
    font-size: 11px;
    font-weight: 700;
    line-height: 1.2;
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.02em;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    word-break: break-word;
}

/* Action buttons */
.obra-modal .obra-modal-actions {
    padding: 16px 24px;
    border-top: 1px solid #eee;
    text-align: center;
}
.obra-modal .obra-more-info-button {
    display: inline-block;
    padding: 10px 24px;
    background: #C91517;
    color: #fff;
    text-decoration: none;
    font-weight: 600;
    border-radius: 0;
}
.obra-modal .obra-more-info-button:hover {
    background: #B90507;
}

/* Login prompt */
.obra-modal .identify-yourself {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 16px;
    text-align: center;
}
.obra-modal .identify-yourself span {
    width: 100%;
    margin-bottom: 4px;
    font-size: 14px;
    color: #555;
}
.obra-modal .identify-yourself .obra-more-info-button {
    margin: 0 4px;
    flex: 0 0 auto;
}

/* Responsive */
@media (max-width: 650px) {
    .obra-modal-content {
        flex-direction: column;
        padding: 16px;
        gap: 16px;
    }
    .obra-modal-left {
        flex: none;
        max-width: 80%;
        width: 100%;
        margin: 0 auto;
    }
    .obra-modal-left iframe {
        height: 200px;
    }

    .obra-modal .obra-modal-actions {
        padding: 12px 16px;
    }
    .obra-modal .identify-yourself {
        gap: 6px;
        padding: 8px 0;
    }
    .obra-modal .identify-yourself .obra-more-info-button {
        padding: 8px 16px;
        font-size: 14px;
    }
}
