/**
 * ENFOQUE MULTIFORMATO — MÓDULO PDF / FLIPBOOK
 * /assets/css/enfoque-multiformato-pdf.css
 *
 * Dos modos:
 *   local_pdf      → altura fija 900px (portrait) / tarjeta poster en móvil
 *   external_embed → altura leída desde ACF campo enfoque_pdf_height_desktop (default 400px)
 *
 * v1.3.0
 */

/* =====================================================
 * WRAP
 * ===================================================== */

.enfoque-pdf-wrap {
    width: 100%;
    max-width: 820px;
    margin: 40px auto;
}

/* =====================================================
 * CONTENEDOR PRINCIPAL
 * ===================================================== */

.enfoque-pdf {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* =====================================================
 * FRAME WRAP
 * ===================================================== */

.enfoque-pdf__frame-wrap {
    position: relative;
    width: 100%;
    overflow: hidden;
    background: var(--enfoque-color-surface, #1a1a1a);
    border-radius: 4px;
    box-shadow: 0 2px 16px rgba(0, 0, 0, 0.12);
}

/* =====================================================
 * IFRAME — base
 * ===================================================== */

.enfoque-pdf__iframe {
    display: block;
    width: 100%;
    max-width: 100% !important;
    border: none;
    outline: none;
    -webkit-overflow-scrolling: touch;
}

.enfoque-pdf__frame-wrap,
.enfoque-pdf__iframe {
    box-sizing: border-box;
}

/* =====================================================
 * SHIMMER DE CARGA
 * ===================================================== */

.enfoque-pdf__frame-wrap::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        transparent 0%,
        rgba(255, 255, 255, 0.06) 50%,
        transparent 100%
    );
    background-size: 200% 100%;
    animation: enfoque-pdf-shimmer 1.8s infinite;
    pointer-events: none;
    z-index: 1;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.enfoque-pdf__frame-wrap.is-loaded::before {
    opacity: 0;
}

@keyframes enfoque-pdf-shimmer {
    0%   { background-position: -200% 0; }
    100% { background-position:  200% 0; }
}

/* =====================================================
 * FALLBACK
 * ===================================================== */

.enfoque-pdf__fallback {
    display: none;
    margin-top: 0.75rem;
    padding: var(--enfoque-space-sm, 8px) var(--enfoque-space-md, 16px);
    font-size: var(--enfoque-text-sm, 0.875rem);
    color: var(--enfoque-color-text-muted, #888);
    text-align: center;
}

.enfoque-pdf__fallback a {
    color: inherit;
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* =====================================================
 * ERROR
 * ===================================================== */

.enfoque-pdf__error {
    padding: var(--enfoque-space-md, 16px) var(--enfoque-space-lg, 24px);
    background: rgba(220, 50, 50, 0.08);
    border-left: 3px solid rgba(220, 50, 50, 0.45);
    border-radius: 4px;
    font-size: var(--enfoque-text-sm, 0.875rem);
    color: var(--enfoque-color-text-muted, #888);
    margin: 0;
}

/* =====================================================
 * RESPONSIVE — MÓVIL (max 768px)
 * ===================================================== */

@media (max-width: 768px) {

    .enfoque-pdf-wrap {
        max-width: 100%;
        margin: 24px auto;
    }

    .enfoque-pdf__frame-wrap {
        border-radius: 0;
        box-shadow: none;
    }

    .enfoque-pdf__iframe {
        width: 100% !important;
        max-width: 100% !important;
    }
}

/* =====================================================
 * FIX — Safari iOS
 * ===================================================== */

@supports (-webkit-touch-callout: none) {
    .enfoque-pdf__frame-wrap {
        -webkit-transform: translateZ(0);
        transform: translateZ(0);
    }
}

/* =====================================================
 * ACCESIBILIDAD
 * ===================================================== */

@media (prefers-reduced-motion: reduce) {
    .enfoque-pdf__frame-wrap::before {
        animation: none;
        opacity: 0;
    }
}

/* =====================================================
 * MÓVIL — TARJETA POSTER PDF (local_pdf)
 * Solo activa en móvil — el bloque PHP solo se genera
 * cuando enfoque_pdf_is_mobile() === true.
 * Desktop usa iframe directo, estas reglas no interfieren.
 * ===================================================== */

.enfoque-pdf__mobile-card {
    display: flex;
    align-items: center;
    gap: 20px;
    width: 100%;
    padding: 22px 20px;
    background: #0f0f0f;
    border: 2px solid #cf0000;
    border-radius: 12px;
    box-sizing: border-box;
}

/* Wrapper del ícono — font-size:0 neutraliza herencia de Blocksy sobre SVG */
.enfoque-pdf__mobile-icon {
    flex-shrink: 0;
    font-size: 0;
    line-height: 0;
}

/* Columna de contenido */
.enfoque-pdf__mobile-content {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

/* Label superior rojo */
.enfoque-pdf__mobile-eyebrow {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: #cf0000;
    line-height: 1;
}

/* Titular grande */
.enfoque-pdf__mobile-headline {
    margin: 0;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial Black, Arial, sans-serif;
    font-size: 26px;
    font-weight: 900;
    line-height: 1.0;
    color: #f0ebe0;
    text-transform: uppercase;
    letter-spacing: 0.01em;
}

/* "PDF" en rojo dentro del titular */
.enfoque-pdf__mobile-headline span {
    color: #cf0000;
}

/* Botón abrir enlace */
.enfoque-pdf__mobile-btn {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 12px 16px;
    background: transparent;
    border: 2px solid rgba(240, 235, 224, 0.7);
    border-radius: 8px;
    color: #f0ebe0;
    text-decoration: none;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Arial, sans-serif;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
}

.enfoque-pdf__mobile-btn:active {
    background: rgba(240, 235, 224, 0.08);
    color: #f0ebe0;
    text-decoration: none;
}

/* Neutralizar cualquier estilo de Blocksy sobre el SVG del botón */
.enfoque-pdf__mobile-btn svg {
    width: 22px !important;
    height: 22px !important;
    max-width: 22px !important;
    max-height: 22px !important;
    flex-shrink: 0;
}