/* YouTube Video Background Block Styles */ .youtube-video-background { position: relative; overflow: hidden; width: 100%; height: 400px; display: flex; align-items: center; justify-content: center; /* iOS performance optimizations */ -webkit-transform: translateZ(0); transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; -webkit-perspective: 1000; perspective: 1000; } /* Embedded Video Styles */ .youtube-video-embed { position: relative; width: 100%; max-width: 100%; margin: 0 auto; } .youtube-embed-container { position: relative; width: 100%; height: 0; overflow: hidden; } .youtube-embed-container iframe { position: absolute; top: 0; left: 0; width: 100%; height: 100%; border: 0; /* iOS performance optimizations */ -webkit-transform: translateZ(0); transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; } .youtube-video-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; /* iOS performance optimizations */ -webkit-transform: translateZ(0); transform: translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; } /* Thumbnail placeholder styles */ .youtube-thumbnail-placeholder { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-size: cover; background-position: center; background-repeat: no-repeat; display: flex; align-items: center; justify-content: center; transition: opacity 0.3s ease; } .youtube-thumbnail-placeholder.loading { opacity: 0.7; } .youtube-thumbnail-placeholder.loaded { opacity: 0; pointer-events: none; } /* YouTube play button styles */ .youtube-play-button { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); cursor: pointer; transition: transform 0.2s ease; z-index: 2; } .youtube-play-button:hover { transform: translate(-50%, -50%) scale(1.1); } .youtube-play-button-bg { fill: rgba(0, 0, 0, 0.8); transition: fill 0.2s ease; } .youtube-play-button:hover .youtube-play-button-bg { fill: rgba(255, 0, 0, 0.8); } .youtube-play-button-icon { fill: white; } /* Mobile play overlay styles */ .mobile-play-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background: rgba(0, 0, 0, 0.3); display: flex; align-items: center; justify-content: center; z-index: 10; cursor: pointer; transition: background-color 0.2s ease; } .mobile-play-overlay:hover { background: rgba(0, 0, 0, 0.4); } .mobile-play-overlay:active { background: rgba(0, 0, 0, 0.5); } .mobile-play-button { text-align: center; color: white; transition: transform 0.2s ease; } .mobile-play-overlay:hover .mobile-play-button { transform: scale(1.05); } .mobile-play-overlay:active .mobile-play-button { transform: scale(0.95); } .mobile-play-text { margin-top: 10px; font-size: 14px; font-weight: bold; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.8); color: white; } /* Iframe container styles */ .youtube-iframe-container { position: absolute; top: 0; left: 0; width: 100%; height: 100%; } .youtube-iframe-container iframe { position: absolute; top: 50%; left: 50%; width: 100vw; height: 56.25vw; /* 16:9 aspect ratio */ min-height: 100vh; min-width: 177.77vh; /* 16:9 aspect ratio */ transform: translate(-50%, -50%); pointer-events: none; /* iOS performance optimizations */ -webkit-transform: translate(-50%, -50%) translateZ(0); transform: translate(-50%, -50%) translateZ(0); -webkit-backface-visibility: hidden; backface-visibility: hidden; /* Prevent iOS Safari from refreshing on video loop */ -webkit-overflow-scrolling: touch; } .youtube-video-overlay { position: absolute; top: 0; left: 0; width: 100%; height: 100%; background-color: rgba(0, 0, 0, 0.5); z-index: 1; } .youtube-video-content { position: relative; z-index: 2; color: white; padding: 2rem; width: 100%; height: 100%; display: flex; flex-direction: column; justify-content: center; } /* Apply container alignment */ .youtube-content-align-center .youtube-video-content { text-align: center; } .youtube-content-align-left .youtube-video-content { text-align: left; } .youtube-content-align-right .youtube-video-content { text-align: right; } /* Override alignment for specific blocks that should stay left-aligned */ .youtube-video-content .wp-block-list { text-align: left !important; } .youtube-video-content .wp-block-list li { text-align: left !important; } .youtube-video-content .wp-block-table { text-align: left !important; } .youtube-video-content .wp-block-code { text-align: left !important; } /* Allow WordPress alignment classes to override */ .youtube-video-content .has-text-align-left { text-align: left !important; } .youtube-video-content .has-text-align-center { text-align: center !important; } .youtube-video-content .has-text-align-right { text-align: right !important; } /* Ensure all text is white */ .youtube-video-content * { color: white !important; } .youtube-video-content h1, .youtube-video-content h2, .youtube-video-content h3, .youtube-video-content h4, .youtube-video-content h5, .youtube-video-content h6 { color: white !important; text-shadow: 0 2px 4px rgba(0, 0, 0, 0.7); margin-bottom: 1rem; } .youtube-video-content p { color: white !important; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.7); margin-bottom: 1rem; } .youtube-video-content .wp-block-button .wp-block-button__link { text-shadow: none; } /* Handle buttons alignment */ .youtube-content-align-center .youtube-video-content .wp-block-buttons { justify-content: center; } .youtube-content-align-right .youtube-video-content .wp-block-buttons { justify-content: flex-end; } .youtube-content-align-left .youtube-video-content .wp-block-buttons { justify-content: flex-start; } /* Error and placeholder styles */ .youtube-bg-placeholder, .youtube-bg-error { padding: 2rem; text-align: center; background-color: #f8f9fa; border: 2px dashed #dee2e6; color: #6c757d; font-style: italic; } .youtube-bg-error { background-color: #f8d7da; border-color: #f5c6cb; color: #721c24; } /* Responsive adjustments */ @media (max-width: 768px) { .youtube-video-content { padding: 1rem; } .youtube-video-container iframe { width: 100vw; height: 56.25vw; min-height: 100%; min-width: 177.77vh; } } /* Accessibility improvements */ @media (prefers-reduced-motion: reduce) { .youtube-video-container iframe { background: linear-gradient(45deg, #667eea 0%, #764ba2 100%); } }