/* แยกออกจาก template/project/content.php เมื่อ 2026-08-19 */
/* ========================================
   RESPONSIVE CSS สำหรับหน้า Project
   ======================================== */

/* Grid สำหรับรายการโปรเจกต์ */
.content-news {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 25px;
    margin-top: 20px;
    align-items: stretch;
}

/* กล่องแต่ละโปรเจกต์ */
.box-news {
    display: flex;
    flex-direction: column;
    border: 1px solid #eee;
    border-radius: 8px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    background-color: #fff;
    transition: box-shadow 0.3s ease, transform 0.3s ease;
    overflow: hidden;
}

.box-news:hover {
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
    transform: translateY(-5px);
}

.box-image a {
    display: block;
    height: 200px;
    overflow: hidden;
}

.box-image img, 
.box-image iframe {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.box-content {
    flex-grow: 1;
    padding: 15px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.text-news {
    text-decoration: none;
    color: inherit;
    display: block;
}

.line-clamp {
    overflow: hidden;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-height: 1.4;
    margin: 0 0 5px 0;
}

.box-content h5 {
    font-size: 16px;
    font-weight: bold;
    color: #333;
    -webkit-line-clamp: 2;
}

.box-content p {
    font-size: 14px;
    color: #666;
    -webkit-line-clamp: 2;
    margin-top: 5px;
}

/* ส่วนไอคอน/ชื่อกลุ่ม (Group Info) */
.groups-info-container {
    display: flex;
    justify-content: flex-end;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 10px;
}

.group-info {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 60px;
}

.group-info-icon {
    width: 35px;
    height: 35px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 4px;
    border: 1px solid #ddd;
}

.group-info-text {
    font-size: 10px;
    color: #666;
    max-width: 60px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

/* CSS สำหรับซ่อน Scrollbar */
.hide-scrollbar-x {
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.hide-scrollbar-x::-webkit-scrollbar {
    display: none;
}

/* เพิ่มเงาที่ขอบกล่องกลุ่ม */
.group-box-shadow {
    box-shadow: 0px 4px 8px rgba(0, 0, 0, 0.2);
    transition: box-shadow 0.3s ease-in-out;
}

.group-box-shadow:hover {
    box-shadow: 0px 6px 12px rgba(0, 0, 0, 0.6);
}

/* CSS สำหรับ ปุ่มเลื่อนและคอนเทนเนอร์ */
.group-carousel-container {
    position: relative;
    padding: 20px 50px;
    margin-bottom: 20px;
}

.group-list-container {
    overflow-x: auto;
    white-space: nowrap;
    display: flex;
    gap: 20px;
    align-items: center;
    scroll-behavior: smooth;
}

.group-list-wrapper {
    display: inline-flex;
    gap: 20px;
    align-items: center;
}

.group-item {
    text-decoration: none;
    display: inline-block;
    text-align: center;
    min-width: 100px;
    flex-shrink: 0;
}

/* สไตล์ปุ่มเลื่อนที่กำหนดเอง */
.scroll-btn-custom {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: #77777738;
    color: white;
    border: none;
    padding: 10px 15px;
    cursor: pointer;
    z-index: 10;
    font-size: 20px;
    line-height: 1;
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s, opacity 0.3s;
    opacity: 0.9;
}

.scroll-btn-custom:hover {
    background-color: #ff9800;
    opacity: 1;
}

.scroll-btn-custom.left {
    left: 0;
}

.scroll-btn-custom.right {
    right: 0;
}

/* Search Bar */
.input-group {
    display: flex;
    align-items: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    background: white;
}

.input-group .form-control {
    border: none;
    padding: 10px 15px;
    outline: none;
    min-width: 250px;
}

.input-group .btn-search {
    background-color: #ff9800;
    color: white;
    border: none;
    padding: 10px 20px;
    cursor: pointer;
    transition: background-color 0.3s;
}

.input-group .btn-search:hover {
    background-color: #e68900;
}

/* Pagination */
.pagination {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 30px;
    flex-wrap: wrap;
}

.pagination a {
    padding: 8px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    text-decoration: none;
    color: #333;
    transition: all 0.3s;
}

.pagination a:hover {
    background-color: #ff9800;
    color: white;
    border-color: #ff9800;
}

.pagination a.active {
    background-color: #ff9800;
    color: white;
    border-color: #ff9800;
}

/* ========================================
   RESPONSIVE BREAKPOINTS
   ======================================== */

/* Tablet - Medium screens (768px - 1024px) */
@media (max-width: 1024px) {
    .content-news {
        grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
        gap: 20px;
    }
    
    .group-carousel-container {
        padding: 20px 40px;
    }
    
    .input-group .form-control {
        min-width: 200px;
    }
}

/* Mobile - Small screens (max-width: 768px) */
@media (max-width: 768px) {
    .content-news {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
        padding: 0 10px;
    }
    
    .group-carousel-container {
        padding: 20px 10px;
    }
    
    .scroll-btn-custom {
        display: none;
    }
    
    .group-list-container {
        gap: 15px;
        padding: 0 5px;
    }
    
    .group-list-wrapper {
        gap: 15px;
    }
    
    .group-item {
        min-width: 80px;
    }
    
    .group-box-shadow {
        width: 120px !important;
        height: 70px !important;
    }
    
    .group-item p {
        font-size: 12px !important;
    }
    
    .box-image a {
        height: 180px;
    }
    
    .input-group {
        width: 100%;
        max-width: 400px;
    }
    
    .input-group .form-control {
        min-width: auto;
        flex: 1;
    }
    
    .pagination {
        gap: 5px;
        padding: 0 10px;
    }
    
    .pagination a {
        padding: 6px 12px;
        font-size: 0.9em;
    }
}

/* Mobile - Extra small screens (max-width: 480px) */
@media (max-width: 480px) {
    .content-news {
        grid-template-columns: 1fr;
        gap: 15px;
        padding: 0 10px;
    }
    
    .box-news {
        max-width: 100%;
    }
    
    .box-image a {
        height: 200px;
    }
    
    .box-content {
        padding: 12px;
    }
    
    .box-content h5 {
        font-size: 1em;
    }
    
    .box-content p {
        font-size: 0.85em;
    }
    
    .groups-info-container {
        gap: 8px;
    }
    
    .group-info {
        max-width: 50px;
    }
    
    .group-info-icon {
        width: 30px;
        height: 30px;
    }
    
    .group-info-text {
        font-size: 9px;
        max-width: 50px;
    }
    
    .group-carousel-container {
        padding: 15px 5px;
    }
    
    .group-item {
        min-width: 70px;
    }
    
    .group-box-shadow {
        width: 100px !important;
        height: 60px !important;
        padding: 5px !important;
    }
    
    .group-item p {
        font-size: 11px !important;
        margin-top: 5px !important;
    }
    
    .input-group .form-control {
        padding: 8px 12px;
        font-size: 0.9em;
    }
    
    .input-group .btn-search {
        padding: 8px 15px;
    }
}
