/* =============================================
   VIDEOS — Estilos externos
   Laboratorios Gaher S.A.
   ============================================= */

/* ===== HERO ===== */
.video-hero {
    position: relative;
    background: var(--primary-navy, #00173b);
    padding: 56px 0 48px;
    overflow: hidden;
}

.video-hero-pattern {
    position: absolute;
    inset: 0;
    opacity: 0.12;
    background-image: url("data:image/svg+xml,%3Csvg width='60' height='60' viewBox='0 0 60 60' xmlns='http://www.w3.org/2000/svg'%3E%3Cg fill='none' fill-rule='evenodd'%3E%3Cg fill='%23ffffff' fill-opacity='0.4'%3E%3Cpath d='M36 34v-4h-2v4h-4v2h4v4h2v-4h4v-2h-4zm0-30V0h-2v4h-4v2h4v4h2V6h4V4h-4zM6 34v-4H4v4H0v2h4v4h2v-4h4v-2H6zM6 4V0H4v4H0v2h4v4h2V6h4V4H6z'/%3E%3C/g%3E%3C/g%3E%3C/svg%3E");
}

.video-hero-title {
    font-size: 2.2rem;
    font-weight: 700;
    color: white;
    margin-bottom: 12px;
    letter-spacing: -0.02em;
    line-height: 1.2;
}

.video-hero-desc {
    font-size: 1rem;
    color: rgba(255, 255, 255, 0.8);
    max-width: 640px;
    line-height: 1.6;
    margin: 0 auto;
}

/* ===== SEARCH ===== */
.video-filters-section {
    padding: 24px 0;
    border-bottom: 1px solid #e0e0e0;
    background: white;
}

.video-search-form {
    max-width: 480px;
    margin: 0 auto;
}

.video-search-icon {
    position: absolute;
    left: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: #9e9e9e;
    font-size: 0.9rem;
}

.video-search-input {
    padding-left: 40px;
    border: 1px solid #e0e0e0;
    border-radius: 50px;
    height: 44px;
    font-size: 0.9rem;
}

.video-search-input:focus {
    border-color: var(--accent-yellow, #ffc200);
    box-shadow: 0 0 0 3px rgba(255, 194, 0, 0.15);
    outline: none;
}

/* ===== GRID ===== */
.video-grid-section {
    padding: 40px 0 60px;
}

/* ===== CARD ===== */
.video-card {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    height: 100%;
    transition:
        box-shadow 0.3s ease,
        transform 0.3s ease;
    cursor: pointer;
    text-decoration: none;
    color: inherit;
}

.video-card:hover {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
    transform: translateY(-4px);
    color: inherit;
}

.video-card:hover .video-card-play-overlay {
    opacity: 1;
}

.video-card:hover .video-card-play-btn {
    transform: translate(-50%, -50%) scale(1);
}

.video-card-player {
    position: relative;
    aspect-ratio: 16 / 9;
    background: #000;
    overflow: hidden;
}

.video-card-thumb {
    position: absolute;
    top: 50%;
    left: 50%;
    min-width: 100%;
    min-height: 100%;
    width: auto;
    height: auto;
    transform: translate(-50%, -50%);
    object-fit: cover;
}

.video-card-thumb-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.video-card-thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #1a1a2e;
    gap: 6px;
}

.video-card-thumb-placeholder .material-symbols-outlined {
    font-size: 48px;
    color: rgba(255, 255, 255, 0.3);
}

.video-card-platform-icon {
    font-size: 40px;
}

.video-card-platform-label {
    font-size: 0.7rem;
    font-weight: 600;
    color: rgba(255, 255, 255, 0.5);
    text-transform: uppercase;
    letter-spacing: 1px;
}

/* Play overlay */
.video-card-play-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.35);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.video-card-play-btn {
    width: 64px;
    height: 64px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%) scale(0.85);
    transition: transform 0.3s ease;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.video-card-play-btn .material-symbols-outlined {
    font-size: 36px;
    color: var(--primary-navy, #00173b);
    margin-left: 3px;
}

.video-card-body {
    padding: 16px 20px 20px;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.video-card-date {
    font-size: 0.75rem;
    color: #747780;
    display: flex;
    align-items: center;
    gap: 5px;
    margin-bottom: 6px;
}

.video-card-title {
    font-size: 1rem;
    font-weight: 700;
    color: var(--primary-navy, #00173b);
    margin: 0;
    line-height: 1.3;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* ===== PAGINATION ===== */
.video-pagination {
    margin-top: 40px;
    display: flex;
    justify-content: center;
}

.video-pagination .pagination {
    margin: 0;
}

/* ===== LINK FALLBACK (para enlaces externos) ===== */
.video-link-fallback {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

.video-link-fallback-inner {
    text-align: center;
    padding: 32px 24px;
    max-width: 400px;
}

.video-link-fallback-icon {
    font-size: 52px;
    margin-bottom: 16px;
    display: block;
}

.video-link-fallback-msg {
    color: #fff;
    font-size: 1rem;
    font-weight: 600;
    margin-bottom: 6px;
}

.video-link-fallback-sub {
    color: rgba(255, 255, 255, 0.55);
    font-size: 0.82rem;
    margin-bottom: 20px;
    line-height: 1.5;
}

.video-link-fallback-btn {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: #fff;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.9rem;
    padding: 12px 28px;
    border-radius: 50px;
    transition:
        transform 0.2s,
        box-shadow 0.2s;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
}

.video-link-fallback-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.4);
    color: #fff;
}

/* ===== PLAY PAGE ===== */
.video-play-section {
    padding: 40px 0 24px;
}

.video-play-back {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-navy, #00173b);
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    margin-bottom: 24px;
    transition: color 0.2s;
}

.video-play-back:hover {
    color: var(--accent-yellow, #ffc200);
}

/* Contenedor principal con relación de aspecto 16:9 fija */
.video-play-wrapper {
    position: relative;
    width: 100%;
    max-width: 960px;
    margin: 0 auto 24px auto;
    aspect-ratio: 16 / 9;
    background-color: #000;
    border-radius: 12px;
    overflow: hidden;
}

/* Forzar a todos los elementos dentro del reproductor a llenar exactamente el marco */
.video-play-wrapper:not(.video-play-wrapper--fb) > *,
.video-play-wrapper:not(.video-play-wrapper--fb) .video-play-player,
.video-play-wrapper:not(.video-play-wrapper--fb) .video-play-embed,
.video-play-wrapper:not(.video-play-wrapper--fb) .video-embed-wrapper {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    margin: 0;
    padding: 0 !important;
    border: none;
}

/* Asegurar que las etiquetas iframe y video dentro de los helpers respeten la altura */
.video-play-wrapper:not(.video-play-wrapper--fb) iframe,
.video-play-wrapper:not(.video-play-wrapper--fb) video,
.video-play-wrapper:not(.video-play-wrapper--fb) .video-play-embed iframe,
.video-play-wrapper:not(.video-play-wrapper--fb) .video-embed-wrapper iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    border: none;
    object-fit: contain;
}

/* Modo adaptativo para videos de Facebook (plugin SDK con data-width auto) */
.video-play-wrapper--fb {
    aspect-ratio: auto;
    min-height: 320px;
}

.video-play-wrapper--fb .video-embed-wrapper,
.video-play-wrapper--fb .video-play-embed {
    position: relative !important;
    width: 100% !important;
    height: auto !important;
}

.video-play-wrapper--fb .fb-video {
    width: 100%;
}

/* Base 480/420px en desktop: evita que el vertical se vea gigante y elimina franjas negras enormes */
@media (min-width: 769px) {
    .video-play-wrapper--fb {
        max-width: 480px;
    }
    .video-play-wrapper--fb .video-embed-wrapper,
    .video-play-wrapper--fb .video-play-embed {
        max-width: 420px;
        margin-left: auto;
        margin-right: auto;
    }
}

.video-play-link-fallback {
    border-radius: 12px;
    overflow: hidden;
}

.video-play-info {
    margin-bottom: 40px;
}

.video-play-title {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--primary-navy, #00173b);
    margin-bottom: 8px;
    line-height: 1.3;
}

.video-play-date {
    font-size: 0.85rem;
    color: #747780;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* Related videos */
.video-play-related {
    padding: 0 0 60px;
}

.video-play-related-title {
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--primary-navy, #00173b);
    margin-bottom: 20px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 768px) {
    .video-hero-title {
        font-size: 1.6rem;
    }

    .video-hero-desc {
        font-size: 0.9rem;
    }

    .video-grid-section {
        padding: 24px 0 40px;
    }

    .video-play-title {
        font-size: 1.3rem;
    }

    .video-play-wrapper {
        border-radius: 0;
        margin-left: -16px;
        margin-right: -16px;
        width: calc(100% + 32px);
        max-width: none;
    }

    .video-link-fallback-inner {
        padding: 24px 16px;
    }

    .video-link-fallback-icon {
        font-size: 40px;
    }

    .video-link-fallback-btn {
        padding: 10px 22px;
        font-size: 0.82rem;
    }
}
