.teacher-grid {
    max-width: 1200px;
    margin: 0 auto;
    padding: 60px 20px;
}

.teacher-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.teacher-card {
    position: relative;
    display: block;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
}

.teacher-card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.teacher-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0) 40%,
            rgba(0, 0, 0, 0.55) 100%);
}

.teacher-info {
    position: absolute;
    bottom: 16px;
    left: 16px;
    right: 16px;
    color: #fff;
}

.teacher-name {
    font-size: 1.1rem;
    font-weight: 600;
}

.teacher-role {
    font-size: 0.85rem;
    opacity: 0.85;
}

/* Hover effect (optional) */
.teacher-card:hover img {
    transform: scale(1.05);
    transition: 0.4s ease;
}


.teacher-grid {
    position: relative;
}

/* tombol nav */
.nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: rgba(0, 0, 0, .6);
    color: #fff;
    font-size: 22px;
    cursor: pointer;
}

.nav.left {
    left: 10px;
}

.nav.right {
    right: 10px;
}

/* DESKTOP */
.teacher-grid-wrapper {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

/* MOBILE SLIDER */
@media (max-width: 768px) {
    .teacher-grid-wrapper {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        gap: 16px;
    }

    .teacher-card {
        flex: 0 0 75%;
        scroll-snap-align: center;
    }

    /* tombol hanya muncul di mobile */
    .nav {
        display: block;
    }
}

/* sembunyikan tombol di desktop */
@media (min-width: 769px) {
    .nav {
        display: none;
    }
}