/* Gallery Section Wrapper */
.section-gallery-wrapper {
    background-color: color-mix(in srgb, var(--primary-color) 8%, transparent);
    padding: 40px 0 60px 0;
    margin-bottom: 15px;
}

/* Header */
.sg-main-header {
    text-align: center;
    margin-bottom: 30px;
}

.sg-main-header h2 {
    font-size: 28px;
    font-weight: 700;
    margin: 0;
    padding-left: 0;
    border-left: none;
    color: var(--text-color);
    display: inline-block;
    position: relative;
    padding-bottom: 12px;
}

.sg-main-header h2::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background-color: var(--primary-color);
}

/* Grid Container */
.sg-grid-container {
    display: grid;
    grid-template-columns: 2fr 3fr; /* 40% Left, 60% Right */
    gap: 25px;
    align-items: stretch;
}

.sg-col {
    min-width: 0;
    height: 100%;
}

/* Photo Slider (Left Col) */
.sg-photo-slider {
    width: 100%;
    border-radius: 8px;
    overflow: hidden;
    height: 100%;
}

.sg-photo-slider .swiper-wrapper, .sg-photo-slider .swiper-slide {
    height: 100%;
}

.sg-photo-item {
    position: relative;
    height: 100%;
}

.sg-photo-image {
    position: relative;
    width: 100%;
    padding-top: 66.66%; /* 3:2 */
    background: #000;
}

.sg-photo-image > a {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
}

.sg-photo-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    opacity: 0.85;
    transition: opacity 0.3s;
}

.sg-photo-item:hover .sg-photo-image img {
    opacity: 1;
}

.sg-photo-overlay {
    position: absolute;
    bottom: 0; left: 0; width: 100%;
    padding: 40px 20px 20px 20px;
    background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
    color: #fff;
    pointer-events: none;
}

.sg-photo-overlay .sg-icon {
    font-size: 20px;
    margin-bottom: 5px;
    color: #fff;
}

.sg-photo-title {
    margin: 0;
    font-size: 22px;
    line-height: 1.4;
    pointer-events: auto;
}

.sg-photo-title a {
    color: #fff;
    text-decoration: none;
    transition: color 0.3s;
}

.sg-photo-title a:hover {
    color: var(--primary-color);
}

/* Swiper Controls Customization */
.sg-button-next, .sg-button-prev {
    color: #fff !important;
    background: rgba(0,0,0,0.5);
    width: 40px !important;
    height: 40px !important;
    border-radius: 50%;
    transition: background 0.3s;
}

.sg-button-next:hover, .sg-button-prev:hover {
    background: var(--primary-color);
    color: #fff !important;
}

.sg-button-next::after, .sg-button-prev::after {
    font-size: 18px !important;
}

/* Video Grid (Right Col) */
.sg-video-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: 1fr 1fr;
    gap: 15px;
    height: 100%;
}

.sg-video-item {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.sg-video-image {
    position: relative;
    width: 100%;
    flex-grow: 1;
    overflow: hidden;
    border-radius: 6px;
    margin-bottom: 8px;
    min-height: 0;
}

.sg-video-image > a {
    position: absolute;
    top: 0; left: 0; width: 100%; height: 100%;
    display: block;
}

.sg-video-image img {
    width: 100%; height: 100%;
    object-fit: cover;
    transition: transform 0.4s ease;
}

.sg-video-item:hover .sg-video-image img {
    transform: scale(1.05);
}

.sg-play-icon {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    width: 40px; height: 40px;
    background: rgba(0,0,0,0.7);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    transition: all 0.3s ease;
}

.sg-video-item:hover .sg-play-icon {
    background: var(--primary-color);
    color: #fff;
    transform: translate(-50%, -50%) scale(1.1);
}

.sg-video-title {
    font-size: 14px;
    line-height: 1.3;
    margin: 0;
    font-weight: 600;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.sg-video-title a {
    color: var(--text-color);
    text-decoration: none;
    transition: color 0.3s;
}

.sg-video-title a:hover {
    color: var(--primary-color);
}

/* Responsive */
@media (max-width: 1024px) {
    .sg-grid-container {
        grid-template-columns: 1fr;
    }
    
    .sg-photo-image {
        padding-top: 50%;
    }

    .sg-video-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: auto;
        height: auto;
        gap: 20px;
    }
    
    .sg-video-image {
        padding-top: 56.25%; /* Restore aspect ratio */
        flex-grow: 0;
        min-height: auto;
    }
}

@media (max-width: 768px) {
    .sg-photo-image {
        padding-top: 60%;
    }
}
