/**
 * DGA Carousel Slide CSS
 * Version: 1.0.6
 */

/* Main container */
.dga-carousel-container {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 20px 0;
    overflow: hidden;
    box-sizing: border-box;
}

/* Track container */
.dga-carousel-track-container {
    overflow: hidden;
    position: relative;
    width: 100%;
}

/* Track */
.dga-carousel-track {
    display: flex;
    position: relative;
    left: 0;
    transition: left 0.4s ease;
}

/* Slide */
.dga-carousel-slide {
    position: relative;
    transition: all 0.4s ease;
    overflow: hidden;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    flex-shrink: 0;
    cursor: pointer; /* ทำให้เข้าใจว่าคลิกได้ */
}

/* เพิ่ม visual cue ว่าสไลด์สามารถคลิกได้ */
.dga-carousel-slide:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.15);
}

/* เพิ่ม effect เมื่อ active เพื่อให้เห็นว่าคลิกได้ */
.dga-carousel-slide.active-card,
.dga-carousel-slide.active-slide {
    transform: scale(1.02);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
    z-index: 10; /* ให้อยู่ด้านหน้าเสมอ */
}

/* Link within slide - ให้เต็มพื้นที่ของสไลด์ */
.dga-carousel-slide-link {
    display: block;
    width: 100%;
    height: 100%;
    text-decoration: none;
    color: inherit;
    position: relative;
}

/* Image */
.dga-carousel-image {
    width: 100%;
    height: 350px; /* Fixed height for consistency */
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    border-radius: 8px;
    position: relative;
}

/* เพิ่ม overlay สำหรับให้เห็นชื่อโพสและทำให้เห็นชัดว่าคลิกได้ */
.dga-carousel-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
    padding: 30px 20px 20px;
    border-bottom-left-radius: 8px;
    border-bottom-right-radius: 8px;
    opacity: 0;
    transition: opacity 0.3s ease;
    color: #fff;
}

/* แสดง overlay เสมอสำหรับสไลด์ที่เป็น active */
.dga-carousel-slide.active-card .dga-carousel-overlay {
    opacity: 1;
}

/* แสดง overlay เมื่อ hover */
.dga-carousel-slide:hover .dga-carousel-overlay {
    opacity: 1;
}

.dga-carousel-title {
    color: #fff;
    font-size: 18px;
    margin: 0 0 10px;
    text-shadow: 1px 1px 2px rgba(0,0,0,0.7);
}

.dga-carousel-excerpt {
    color: rgba(255, 255, 255, 0.9);
    font-size: 14px;
    margin: 0 0 10px;
    line-height: 1.4;
}

.dga-carousel-read-more {
    display: inline-block;
    color: #fff;
    background-color: rgba(255, 255, 255, 0.2);
    padding: 5px 12px;
    border-radius: 20px;
    font-size: 12px;
    transition: background-color 0.3s ease;
    margin-top: 5px;
}

.dga-carousel-slide:hover .dga-carousel-read-more,
.dga-carousel-slide.active-card .dga-carousel-read-more {
    background-color: rgba(255, 255, 255, 0.3);
}

/* Controls */
.dga-carousel-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-top: 20px;
    position: relative;
}

/* Navigation buttons */
.dga-carousel-prev,
.dga-carousel-next {
    background: white;
    border: none;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    margin: 0 10px;
    transition: all 0.3s ease;
    z-index: 10;
}

.dga-carousel-prev:hover,
.dga-carousel-next:hover {
    background: #f5f5f5;
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.dga-carousel-prev:focus,
.dga-carousel-next:focus {
    outline: 2px solid #4d90fe;
    box-shadow: 0 0 0 4px rgba(77, 144, 254, 0.3);
}

/* Dots */
.dga-carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    margin: 0 15px;
}

.dga-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: #ddd;
    border: none;
    padding: 0;
    cursor: pointer;
    transition: all 0.3s ease;
}

.dga-carousel-dot.active {
    background: #4d90fe;
    transform: scale(1.2);
}

.dga-carousel-dot:hover {
    background: #bbb;
}

.dga-carousel-dot:focus {
    outline: 2px solid #4d90fe;
    box-shadow: 0 0 0 4px rgba(77, 144, 254, 0.3);
}

/* Dragging state */
.dga-carousel-track.dga-dragging {
    cursor: grabbing;
}

/* Screen reader only text */
.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute;
    width: 1px;
    word-wrap: normal;
}

/* Active slide */
.dga-carousel-slide.active {
    transform: scale(1.05);
    z-index: 10;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .dga-carousel-image {
        height: 250px;
    }
    
    .dga-carousel-title {
        font-size: 16px;
    }
    
    .dga-carousel-excerpt {
        font-size: 12px;
    }
    
    .dga-carousel-prev,
    .dga-carousel-next {
        width: 32px;
        height: 32px;
    }
}

@media (max-width: 480px) {
    .dga-carousel-image {
        height: 200px;
    }
    
    .dga-carousel-controls {
        margin-top: 15px;
    }
    
    .dga-carousel-overlay {
        padding: 20px 15px 15px;
    }
}