← back to Jill Website
public/css/video.css
386 lines
/**
* Responsive Video Gallery Component Styles
* Features: Adaptive video players, custom controls, responsive design, mobile optimization
*/
/* ==================== Video Gallery Container ==================== */
.video-gallery {
width: 100%;
max-width: 1400px;
margin: 0 auto;
padding: 2rem 1rem;
display: grid;
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
gap: 2rem;
}
/* ==================== Video Items ==================== */
.video-item {
position: relative;
background: #f5f5f5;
border-radius: 12px;
overflow: hidden;
transition: transform 0.3s ease, box-shadow 0.3s ease;
cursor: pointer;
}
.video-item:hover {
transform: translateY(-5px);
box-shadow: 0 12px 30px rgba(0, 0, 0, 0.15);
}
.video-item:focus {
outline: 3px solid var(--primary-color, #2c5f8d);
outline-offset: 2px;
}
/* ==================== Video Wrapper ==================== */
.video-wrapper {
position: relative;
width: 100%;
aspect-ratio: 16 / 9;
background: #000;
overflow: hidden;
}
.video-element {
width: 100%;
height: 100%;
object-fit: cover;
display: block;
}
/* Hide native controls (we show custom overlay) */
.video-element::-webkit-media-controls {
display: none !important;
}
.video-element::-webkit-media-controls-enclosure {
display: none !important;
}
/* Show native controls as fallback on focus/playing */
.video-item.playing .video-element {
pointer-events: auto;
}
.video-item.playing .video-element::-webkit-media-controls {
display: flex !important;
}
.video-item.playing .video-element::-webkit-media-controls-enclosure {
display: flex !important;
}
/* ==================== Video Controls Overlay ==================== */
.video-controls-overlay {
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
display: flex;
align-items: center;
justify-content: center;
background: rgba(0, 0, 0, 0.3);
opacity: 1;
transition: opacity 0.3s ease;
pointer-events: none;
}
.video-item.playing .video-controls-overlay {
opacity: 0;
}
.video-item:hover .video-controls-overlay {
background: rgba(0, 0, 0, 0.5);
}
.video-play-button {
width: 80px;
height: 80px;
border-radius: 50%;
background: rgba(255, 255, 255, 0.9);
border: none;
color: var(--primary-color, #2c5f8d);
display: flex;
align-items: center;
justify-content: center;
cursor: pointer;
transition: all 0.3s ease;
pointer-events: auto;
box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}
.video-play-button:hover {
background: rgba(255, 255, 255, 1);
transform: scale(1.1);
}
.video-play-button i {
font-size: 2rem;
}
/* ==================== Loading Indicator ==================== */
.video-loading-indicator {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
display: none;
align-items: center;
justify-content: center;
color: white;
font-size: 2rem;
z-index: 10;
}
.video-item.loading .video-loading-indicator {
display: flex;
}
/* ==================== Video Info ==================== */
.video-info {
padding: 1.25rem;
background: white;
}
.video-title {
margin: 0 0 0.5rem 0;
font-size: 1.1rem;
font-weight: 600;
color: var(--dark, #333);
}
.video-caption {
margin: 0;
font-size: 0.95rem;
color: var(--text-color, #666);
line-height: 1.5;
}
/* ==================== Loading States ==================== */
.video-item.loading .video-wrapper::before {
content: '';
position: absolute;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.6);
z-index: 5;
}
.video-item.error .video-wrapper::after {
content: '⚠️ Failed to load video';
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
color: white;
font-size: 1rem;
text-align: center;
background: rgba(0, 0, 0, 0.8);
padding: 1rem 1.5rem;
border-radius: 8px;
z-index: 20;
}
/* ==================== Playing State ==================== */
.video-item.playing {
box-shadow: 0 0 0 3px var(--primary-color, #2c5f8d);
}
.video-item.playing .video-play-button {
opacity: 0;
pointer-events: none;
}
/* Show play button on hover even when playing */
.video-item.playing:hover .video-play-button {
opacity: 0.8;
pointer-events: auto;
}
/* ==================== Grid Variations ==================== */
.video-gallery-2 {
grid-template-columns: repeat(auto-fit, minmax(500px, 1fr));
}
.video-gallery-3 {
grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
}
.video-gallery-1 {
grid-template-columns: 1fr;
max-width: 1000px;
}
/* ==================== Responsive Design ==================== */
/* Tablet (768px and below) */
@media (max-width: 768px) {
.video-gallery {
grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
gap: 1.5rem;
padding: 1.5rem 1rem;
}
.video-play-button {
width: 60px;
height: 60px;
}
.video-play-button i {
font-size: 1.5rem;
}
.video-title {
font-size: 1rem;
}
.video-caption {
font-size: 0.9rem;
}
.video-info {
padding: 1rem;
}
}
/* Mobile (480px and below) */
@media (max-width: 480px) {
.video-gallery {
grid-template-columns: 1fr;
gap: 1.25rem;
padding: 1rem 0.5rem;
}
.video-wrapper {
aspect-ratio: 16 / 9; /* Maintain 16:9 on mobile */
}
.video-play-button {
width: 50px;
height: 50px;
}
.video-play-button i {
font-size: 1.25rem;
}
.video-item:hover {
transform: none; /* Disable hover lift on mobile */
}
.video-title {
font-size: 0.95rem;
}
.video-caption {
font-size: 0.85rem;
}
}
/* ==================== Connection Speed Indicators ==================== */
.video-item[data-quality="low"] .video-wrapper::before {
content: 'SD';
position: absolute;
top: 10px;
right: 10px;
background: rgba(0, 0, 0, 0.7);
color: white;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 600;
z-index: 10;
}
.video-item[data-quality="high"] .video-wrapper::before {
content: 'HD';
position: absolute;
top: 10px;
right: 10px;
background: rgba(0, 0, 0, 0.7);
color: white;
padding: 0.25rem 0.5rem;
border-radius: 4px;
font-size: 0.75rem;
font-weight: 600;
z-index: 10;
}
/* ==================== Accessibility ==================== */
.video-item:focus-visible {
outline: 3px solid var(--primary-color, #2c5f8d);
outline-offset: 3px;
}
.video-play-button:focus-visible {
outline: 3px solid var(--primary-color, #2c5f8d);
outline-offset: 2px;
}
/* Screen reader only text */
.sr-only {
position: absolute;
width: 1px;
height: 1px;
padding: 0;
margin: -1px;
overflow: hidden;
clip: rect(0, 0, 0, 0);
white-space: nowrap;
border-width: 0;
}
/* ==================== Reduced Motion Support ==================== */
@media (prefers-reduced-motion: reduce) {
.video-item,
.video-play-button,
.video-controls-overlay {
transition: none;
}
}
/* ==================== Print Styles ==================== */
@media print {
.video-gallery {
display: block;
}
.video-item {
break-inside: avoid;
page-break-inside: avoid;
margin-bottom: 1rem;
}
.video-wrapper {
display: none; /* Hide video players in print */
}
.video-info {
display: block;
}
}
/* ==================== Dark Mode Support (Optional) ==================== */
@media (prefers-color-scheme: dark) {
.video-item {
background: #1a1a1a;
}
.video-info {
background: #2a2a2a;
}
.video-title {
color: #f0f0f0;
}
.video-caption {
color: #b0b0b0;
}
}