.video-section {
    text-align: center;
    margin-top: 10rem;
    margin-bottom: 10rem;
    width: 100%;
}

.video-section .video-header {

    padding-bottom: 4rem;
}

/* Videos container with responsive behavior */
.videos-container {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 30px;
    margin-top: 30px;
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 20px;
}

/* Video wrapper - handles the grid layout */
.video-wrapper {
    /* For single video: full width but max-width */
    width: 100%;
    max-width: 800px; /* Center and limit width for single video */
    margin: 0 auto;
    
    /* For multiple videos: 2 per row */
    flex: 0 1 calc(50% - 15px); /* 2 items per row with gap */
    min-width: 300px;
}
.video-wrapper p{
      font-size: 1.3rem;
      padding-top: 1.5rem;
}

/* For single video layout */
.videos-container:has(.video-wrapper:only-child) .video-wrapper {
    flex: 0 1 auto; /* Reset flex for single video */
    max-width: 35rem;
    width: 100%;
}

/* For 2+ videos - 2 per row */
.videos-container:has(.video-wrapper:nth-child(2)) .video-wrapper {
    flex: 0 1 calc(50% - 6rem);
}

/* Video embed iframe styling */
.video-embed {
    width: 100%;
    position: relative;
    padding-bottom: 56.25%; /* 16:9 aspect ratio */
    height: 0;
    overflow: hidden;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.video-embed:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.15);
}

.video-embed iframe {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border: none;
    border-radius: 12px;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .videos-container:has(.video-wrapper:only-child) .video-wrapper {
    flex: 0 1 auto; /* Reset flex for single video */
    max-width: 70%;
    width: 100%;
}

/* For 2+ videos - 2 per row */
.videos-container:has(.video-wrapper:nth-child(2)) .video-wrapper {
    flex: 0 1 calc(50% - 15rem);
}
    .video-section {
        text-align: center;
        margin-top: 3rem;
        margin-bottom: 3rem;
    }
    
    .video-section .video-header {
        font-size: 2.5rem;
        padding-bottom: 2rem;
    }
    
 
    .video-wrapper {
        flex: 0 1 100% !important;
        max-width: 100%;
    }
    
    .videos-container {
        padding: 0 15px;
        gap: 20px;
    }
}


@media (min-width: 1200px) {
    .videos-container:has(.video-wrapper:nth-child(3)) .video-wrapper {
        flex: 0 1 calc(50% - 15px); /* Still 2 per row even with 3+ videos */
    }
}