html, 
/* ggg */
body {
    overflow-x: hidden;
}
body {
    font-family: "Prompt", sans-serif;
}

.navbar-custom {
    background-color: #fff;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}
.image-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4); /* ✅ ดำจาง */
    z-index: 1;
}

.carousel-item img {
    position: relative;
    z-index: 0;
}

.btn-red {
    background-color: #dc3545;
    color: white;
    border-radius: 25px;
    padding: 8px 20px;
    border: none;
}

.btn-red:hover {
    background-color: #c82333;
    color: white;
}

.hero-section {
    /* min-height: 600px; */
    position: relative;
    overflow: hidden;
    /* display: flex; */
    align-items: center;
    justify-content: center;
}

.scroll-indicator-mobile {
    z-index: 2;
}

.hero-background {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.hero-bg-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    z-index: 2;
}

.hero-shapes {
    position: absolute;
    top: 0;
    right: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
}

.shape-1 {
    position: absolute;
    top: 20%;
    right: 10%;
    width: 300px;
    height: 300px;
    background: linear-gradient(45deg, #ffd700, #ffed4e);
    border-radius: 50% 20% 50% 20%;
    opacity: 0.8;
}

.shape-2 {
    position: absolute;
    bottom: 10%;
    right: 20%;
    width: 200px;
    height: 200px;
    background: linear-gradient(45deg, #dc3545, #ff6b6b);
    border-radius: 30% 70% 70% 30%;
    opacity: 0.7;
}

.hero-content {
    position: relative;
    z-index: 4;
    padding: 80px 0;
}

.hero-title {
    font-size: 3rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
    /* text-shadow: 2px 2px 4px rgba(255, 255, 255, 0.8); */
}

.hero-subtitle {
    font-size: 2.3rem;
    color: #333;
    /* margin-bottom: 30px; */
}

.scroll-indicator {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    text-align: center;
    z-index: 2;
    color: #333;
}

.scroll-text {
    font-size: 0.9rem;
    margin-bottom: 5px;
}

.profile-card {
    border-radius: 20px;
    /* padding: 30px; */
    /* text-align: center; */
    /* color: white; */
    margin-bottom: 30px;
    /* box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1); */
}

.profile-img {
    width: 200px;
    height: 250px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 20px;
}

.profile-name {
    font-size: 1.3rem;
    font-weight: bold;
    margin-bottom: 10px;
}

.profile-title {
    font-size: 1rem;
    opacity: 0.9;
    margin-left: 60px;
}

.section-title {
    /* color: #dc3545; */
    font-size: 2rem;
    font-weight: bold;
    margin-bottom: 30px;
    position: relative;
}

.section-title::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 500px;
    height: 3px;
    background-color: #000000;
}

/* Staff Cards */
.staff-card {
    /* background: linear-gradient(135deg, #17a2b8, #20c997); */
    border-radius: 20px;
    padding: 20px;
    text-align: center;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.staff-card:hover {
    transform: translateY(-5px);
}

.staff-img {
    width: 100%;
    max-width: 180px;
    height: 220px;
    object-fit: cover;
    border-radius: 15px;
    margin-bottom: 15px;
}

.staff-name {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 8px;
}

.staff-subtitle {
    font-size: 0.9rem;
    opacity: 0.9;
    line-height: 1.4;
}

/* Contact Card */
.contact-card {
    background: linear-gradient(135deg, #dc3545, #ff6b6b);
    border-radius: 20px;
    padding: 30px;
    text-align: center;
    color: white;
    margin-bottom: 20px;
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.contact-info {
    width: 100%;
}

.contact-title {
    font-size: 1.1rem;
    font-weight: bold;
    margin-bottom: 15px;
    color: #ffd700;
}

.contact-phone,
.contact-email {
    font-size: 1rem;
    margin-bottom: 10px;
    opacity: 0.95;
}

.btn-outline-light {
    border: 2px solid white;
    color: white;
    border-radius: 25px;
    padding: 8px 20px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.btn-outline-light:hover {
    background-color: white;
    color: #dc3545;
    border-color: white;
}
.full-width-dropdown {
    display: none;
    position: fixed; /* ✅ ใช้ fixed เพื่อให้กินพื้นที่แน่นอนทั้งจอ */
    top: 70px; /* ✅ ปรับให้ dropdown อยู่ใต้ navbar (เปลี่ยนตาม navbar height) */
    left: 0;
    right: 0;
    width: 100vw;
    background-color: #ffd233;
    z-index: 9999;
    padding: 20px 0;
}
.dropdown-item:hover {
    color: red !important;
    background-color: transparent !important;
    font-weight: bold !important;
}
/* Hover แสดง dropdown */
.nav-item.dropdown:hover .full-width-dropdown {
    display: block;
}

/* ข้อความภายในวางตรงกับเมนูหลัก */
.menu-inner {
    padding-left: 6.5rem; /* ชดเชยระยะ .ms-4 จาก “เกี่ยวกับภาควิชา” */
    max-width: 1320px;
    margin: 0 auto;
}
#aboutDropdown {
    /* color: white; */
    transition: all 0.2s ease;
    padding: 6px 12px;
    border-radius: 0; /* ปกติไม่มีขอบมน */
}

#aboutDropdown:hover {
    background-color: #ffd233;
    color: black !important;
    border-radius: 999px; /* ✅ ขอบมนแบบ pill */
    padding: 6px 16px;
}
.gallery-wrapper {
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

/* ใช้ scroll แนวนอน */
.gallery-row {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: 1rem;
    padding-inline: 0; /* ❌ เอา padding ออก */
    width: 100vw; /* ✅ บังคับให้กว้างสุดจอ */
    margin-left: calc(-50vw + 50%); /* ✅ ดึงให้ชิดซ้ายสุดขอบ */
}

/* รูปภาพเหมือน card */
.gallery-row img {
    flex-shrink: 0;
    border-radius: 12px;
    object-fit: cover;
    scroll-snap-align: start;
    height: auto;
}

/* ขนาดของแต่ละ row */
.gallery-row.large img {
    height: 240px;
    aspect-ratio: 4/3;
}

.gallery-row.medium img {
    height: 150px;
    aspect-ratio: 4/3;
}

/* ซ่อน scrollbar (optional) */
.gallery-row::-webkit-scrollbar {
    display: none;
}
.transition-move {
    transition: transform 0.3s ease;
}

.person-hover:hover .transition-move {
    transform: translateY(-10px);
}

.person-hover:hover .person-info {
    display: block !important;
    animation: fadeIn 0.3s ease-in-out;
}
.person-hover:hover .transition-move {
    transform: scale(1.05);
}
.overlay-text {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    background: rgba(0, 0, 0, 0.55);
    color: white;
    text-align: center;
    transition: all 0.3s ease;
    z-index: 2;
}

/* แสดงข้อความเมื่อ hover */
.person-hover:hover .overlay-text {
    display: block !important; /* override d-none */
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .hero-title {
        font-size: 2.5rem;
    }

    .hero-subtitle {
        font-size: 2.1rem;
        margin-bottom: 0px;
    }
    .staff-img {
        height: 200px;
    }

    .contact-card {
        margin-top: 20px;
    }

    .shape-1,
    .shape-2 {
        display: none;
    }

    .hero-content {
        padding: 40px 0;
    }
}
/* Simple Profile Cards - No Background */
.section-title-simple {
    color: #dc3545;
    font-size: 1.8rem;
    font-weight: 700;
    margin-bottom: 10px;
    position: relative;
}

.section-title-simple::after {
    content: "";
    position: absolute;
    bottom: -10px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: #ddd;
}

.simple-profile-card {
    background: #fff;
    padding: 10px;
    border-radius: 10px;
}

.simple-profile-img {
    width: 100%;
    max-width: 220px;
    object-fit: cover;
    height: auto;
    border-radius: 8px;
    margin: 0 auto 10px;
}

.simple-profile-name {
    font-size: 1rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 8px;
}

.simple-profile-title {
    font-size: 0.9rem;
    color: #555;
}

/* Contact Card Simple */
.contact-card-simple {
    background-color: #dc3545;
    padding: 20px;
    border-radius: 10px;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.red-box .contact-info {
    color: #fff;
    text-align: center;
}

.img-fluid {
    max-height: 360px;
    object-fit: cover;
}

/* Responsive adjustments for simple cards */
@media (max-width: 768px) {
    .simple-profile-img {
        width: 200px;
        height: 240px;
    }

    .contact-card-simple {
        height: auto;
        margin-top: 20px;
    }

    .section-title-simple {
        font-size: 1.5rem;
        text-align: center;
    }

    .section-title-simple::after {
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
    }
}

/* Footer Banner Swiper overrides */
.swiper.bannerSwiper,
.swiper.bannerSwiper .swiper-wrapper,
.swiper.bannerSwiper .swiper-slide {
    height: auto !important;
}

/* Lecturer list responsive image sizing */
.lecturer-photo {
    width: 100px;
    aspect-ratio: 3 / 4; /* keep 3:4 portrait */
    object-fit: cover;
    display: block;
    border-radius: 16px;
    cursor: pointer;
}

@media (min-width: 576px) { /* sm */
    .lecturer-photo { width: 130px; border-radius: 18px; }
}

@media (min-width: 768px) { /* md */
    .lecturer-photo { width: 160px; border-radius: 20px; }
}

@media (min-width: 992px) { /* lg */
    .lecturer-photo { width: 200px; border-radius: 22px; }
}

@media (max-width: 768px) {
    .hero-section h1 {
        font-size: 2.25rem !important;
    }

    .hero-section h5 {
        font-size: 0.5rem !important;
    }

    .hero-section .fs-4 {
        font-size: 0.5rem !important;
    }
}
@media (max-width: 344px) {
    .hero-section h1 {
        font-size: 1.25rem !important;
    }
}
@media (max-width: 576px) {
    .hero-section h1 {
        font-size: 1.25rem !important;
    }
}
.hero-section {
    /* height: 100vh; */
    overflow: hidden;
    position: relative;
}

.hero-img {
    height: 100%;
    object-fit: cover;
    z-index: 1;
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
}

.hero-title {
    font-size: 3rem;
    line-height: 1.2;
}

/* ✅ ปรับเฉพาะมือถือ */
@media (max-width: 768px) {
    .hero-section {
        height: auto;
    }

    .hero-img {
        height: 100%;
        object-fit: cover;
        z-index: 1;
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
    }

    .hero-title {
        font-size: 2rem;
    }

    .fs-4 {
        font-size: 1.1rem !important;
    }

    .fs-5 {
        font-size: 1rem !important;
    }
}
.hero-img {
    height: 100%;
    object-fit: cover;
    z-index: 1;
}

.hero-text-overlay {
    position: absolute;
    top: 65%;
    left: 5%;
    transform: translateY(-50%);
    z-index: 2;
    color: white;
    max-width: 400px;
}

.hero-text-overlay h1 {
    color: #c8102e;
    font-size: 3rem;
    line-height: 1.2;
}

.hero-text-overlay h5 {
    font-size: 1.2rem;
}

.hero-text-overlay .text-warning {
    font-size: 1.3rem;
}

/* Tablet และ Desktop ขนาดใหญ่ */
@media (min-width: 992px) {
    .hero-text-overlay {
        right: 30px;
        left: auto;
        max-width: 1000px;
    }

    .hero-text-overlay h1 {
        font-size: 4.5rem;
    }
}

/* Tablet */
@media (max-width: 991.98px) and (min-width: 768px) {
    .hero-text-overlay {
        right: 20px;
        left: auto;
        max-width: 350px;
    }

    .hero-text-overlay h1 {
        font-size: 2.6rem;
    }

    .hero-text-overlay h4 {
        font-size: 1.1rem;
    }
}

/* Mobile */
@media (max-width: 767.98px) {
    .hero-img {
        position: relative;
        height: auto;
    }
    .hero-subtitle {
        font-size: 0.75rem;
        color: #333;
        margin-bottom: 0px;
    }
    .hero-text-overlay {
        position: absolute;
        top: 50%;
        left: 5%;
        transform: translateY(-50%);
        max-width: 250px;
    }

    .hero-text-overlay h1 {
        font-size: 1.8rem;
        line-height: 1.1;
    }

    .hero-text-overlay h5 {
        font-size: 0.9rem;
    }

    .hero-text-overlay .text-warning {
        font-size: 1.3rem;
    }
}

/* Mobile เล็ก */
@media (max-width: 576px) {
    .hero-text-overlay {
        left: 3%;
        max-width: 200px;
        top: 55%;
    }

    .hero-text-overlay h1 {
        font-size: 0.75rem;
        margin-top: 20px;
    }

    .hero-text-overlay h5 {
        font-size: 0.85rem;
        margin-bottom: 5px;
    }

    .hero-text-overlay .text-warning {
        font-size: 0.75rem;
    }
}
