/*==============================================
    Tabbed Section Images - 16:9 Aspect Ratio
    Crops images to 16:9 for better view and removes empty space
===============================================*/

/* Container for 16:9 aspect ratio images */
.aspect-ratio-16-9 {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 aspect ratio (9/16 = 0.5625) */
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}

.aspect-ratio-16-9 img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover; /* Crops image to fit 16:9 while maintaining aspect ratio */
    object-position: center; /* Centers the crop */
    transition: transform 0.3s ease;
}

.aspect-ratio-16-9:hover img {
    transform: scale(1.05); /* Subtle zoom effect on hover */
}

/* Apply 16:9 aspect ratio to tabbed section images */
.tabbed-section .tab-content img {
    width: 100%;
    height: 250px; /* Fixed height for consistent 16:9 look */
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.tabbed-section .tab-content img:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.15);
}

/* Specific styling for different tab images */

/* About tab images */
#about-tab img {
    height: 280px; /* Slightly taller for about section */
}

/* Programme tab images */
#programme-tab img {
    height: 250px;
}

/* Accommodation tab images */
#accommodation-tab img {
    height: 300px; /* Taller for accommodation showcase */
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .tabbed-section .tab-content img {
        height: 200px;
        margin-bottom: 20px;
    }
    
    #about-tab img {
        height: 220px;
    }
    
    #programme-tab img {
        height: 200px;
    }
    
    #accommodation-tab img {
        height: 240px;
    }
}

@media (max-width: 576px) {
    .tabbed-section .tab-content img {
        height: 180px;
        border-radius: 6px;
    }
    
    #about-tab img {
        height: 200px;
    }
    
    #programme-tab img {
        height: 180px;
    }
    
    #accommodation-tab img {
        height: 220px;
    }
}

/* Enhanced image container with better spacing */
.tabbed-section .row {
    align-items: center;
}

.tabbed-section .col-md-6 {
    margin-bottom: 30px;
}

/* Image caption overlay for better presentation */
.image-container {
    position: relative;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.image-container img {
    width: 100%;
    height: 250px;
    object-fit: cover;
    object-position: center;
    transition: transform 0.3s ease;
}

.image-container:hover img {
    transform: scale(1.05);
}

.image-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.7));
    color: white;
    padding: 20px;
    transform: translateY(100%);
    transition: transform 0.3s ease;
}

.image-container:hover .image-overlay {
    transform: translateY(0);
}

/* Better spacing and alignment */
.tabbed-section .tab-content {
    padding: 40px;
}

@media (max-width: 768px) {
    .tabbed-section .tab-content {
        padding: 20px;
    }
}

/* Ensure images don't break layout */
.tabbed-section img {
    max-width: 100%;
    height: auto;
}

/* Special handling for accommodation images */
.accommodation-card img {
    height: 300px !important;
    object-fit: cover;
    object-position: center;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

@media (max-width: 768px) {
    .accommodation-card img {
        height: 240px !important;
    }
}

@media (max-width: 576px) {
    .accommodation-card img {
        height: 200px !important;
    }
}

/* Improve overall visual consistency */
.tabbed-section .rounded {
    border-radius: 8px !important;
}

.tabbed-section .shadow {
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1) !important;
}

/* Loading state for images */
.tabbed-section img {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.tabbed-section img[src] {
    animation: none;
    background: none;
}

/* Ensure proper aspect ratio maintenance */
.img-16-9 {
    aspect-ratio: 16 / 9;
    object-fit: cover;
    object-position: center;
    width: 100%;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}