* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
    font-family: 'Sarabun', sans-serif;
}

body {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: #f4f4f4;
}

/* --- Layout หลัก --- */
.main-container {
    display: flex;
    flex: 1;
    height: 100%;
    flex-direction: row;
    /* ปกติเป็นแนวนอนสำหรับ PC */
    position: relative;
    z-index: 1;
    flex-wrap: nowrap;
}

/* --- 1. ซ้าย: แถบเมนู --- */
.sidebar-left {
    width: 250px;
    background-color: #ffffff;
    color: rgb(179, 47, 47);
    padding: 20px;
    flex-shrink: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(ุ10px);
}

.sidebar-left h3 {
    margin-bottom: 20px;
    text-align: center;
    border-bottom: 1px solid #ff0000;
    padding-bottom: 10px;
    font-size: 1.2rem;
}

.u a {
    display: block;
    color: #852727;
    text-decoration: none;
    padding: 12px;
    margin-bottom: 5px;
    border-radius: 2px;
    transition: background 0.3s, transform 0.2s;
}

.u a:hover {
    background-color: #92929284;
    color: white;
    transform: translateX(5px);
}

/* --- 2. กลาง: สไลเดอร์ --- */
.content-center {
    flex: 1;
    background-color: #a3a3a3;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    overflow: hidden;
    min-width: 0;
    backdrop-filter: blur(10px);
}

.slider-container {
    width: 100%;
    max-width: 100%;
    max-height: 800px;
    aspect-ratio: 16/9;
    /* รักษาสัดส่วนภาพ */
    position: relative;
    overflow: hidden;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(110, 23, 23, 0.646);
    background: #000;
    z-index: 2;
}

#slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: opacity 0.5s ease-in-out;
}

.slider-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background-color: rgba(255, 255, 255, 0.2);
    color: #333;
    border: none;
    padding: 15px;
    cursor: pointer;
    font-size: 18px;
    border-radius: 50%;
    user-select: none;
    z-index: 3;
    transition: background 0.3s;
}

.slider-btn:hover {
    background-color: rgba(255, 255, 255, 0.9);
    color: #000;
}

.prev-btn {
    left: 10px;
}

.next-btn {
    right: 10px;
}

/* --- 3. ขวา: ข้อมูลหัวหน้า --- */
.sidebar-right {
    width: 250px;
    background-color: #ffffff;
    padding: 20px;
    text-align: center;
    flex-shrink: 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(30px);
}

.head-profile img {
    width: 100%;
    max-width: 140px;
    height: auto;
    aspect-ratio: 3/4;
    object-fit: cover;
    margin-bottom: 10px;
    border: 2px solid #ffffff;
    display: block;
    margin: 0 auto 10px auto;
}



@media screen and (max-width: 1024px) {

    .main-container {
            flex-direction: column;
        }
    
        /* --- 1. สลับให้เมนู (ซ้าย) ขึ้นก่อน --- */
        .sidebar-left {
    
            order: 2;
            /* เปลี่ยนเป็นเลข 1 เพื่อให้อยู่บนสุด */
            width: 100%;
            background-color: transparent;
            padding: 10px;
            background-color: #ffffffda;
            backdrop-filter: blur(30px);
        }
    
        .sidebar-right {
            order: 1;
            /* เปลี่ยนเป็นเลข 1 เพื่อให้อยู่บนสุด */
            width: 100%;
            background-color: transparent;
            padding: 10px;
            background-color: #ffffffbb;
            backdrop-filter: blur(30px);
        }
    
    
        .content-center {
            order: 2;
            width: 100%;
            padding: 10px;
        }
    
    
        .sidebar-right {
            order: 3;
            width: 100%;
            border-top: 1px solid #ffffff00;
        }
    
    
        .u {
            display: grid;
            grid-template-columns: repeat(2, 1fr);
            gap: 10px;
            margin-top: 5px;
        }
    
        .u a {
            background-color: #ffffff00;
            border: 1px solid #e0e0e000;
            border-radius: 10px;
            padding: 0;
            box-shadow: 0 2px 4px rgba(0, 0, 0, 0);
            color: #000000;
            font-weight: 600;
            display: flex;
            justify-content: center;
            align-items: center;
            height: 55px;
        }
    
        .u a:active {
            transform: scale(0.98);
            background-color: #000000;
        }
    
        /* --- ปรับสไลเดอร์ --- */
        .slider-container {
            border-radius: 10px;
        }
    }


@media screen and (max-width: 768px) {

    .main-container {
        flex-direction: column;
    }

    /* --- 1. สลับให้เมนู (ซ้าย) ขึ้นก่อน --- */
    .sidebar-left {

        order: 2;
        /* เปลี่ยนเป็นเลข 1 เพื่อให้อยู่บนสุด */
        width: 100%;
        background-color: transparent;
        padding: 10px;
        background-color: #ffffffda;
        backdrop-filter: blur(30px);
    }

    .sidebar-right {
        order: 1;
        /* เปลี่ยนเป็นเลข 1 เพื่อให้อยู่บนสุด */
        width: 100%;
        background-color: transparent;
        padding: 10px;
        background-color: #ffffffbb;
        backdrop-filter: blur(30px);
    }


    .content-center {
        order: 2;
        width: 100%;
        padding: 10px;
    }


    .sidebar-right {
        order: 3;
        width: 100%;
        border-top: 1px solid #ffffff00;
    }


    .u {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
        margin-top: 5px;
    }

    .u a {
        background-color: #ffffff00;
        border: 1px solid #e0e0e000;
        border-radius: 10px;
        padding: 0;
        box-shadow: 0 2px 4px rgba(0, 0, 0, 0);
        color: #000000;
        font-weight: 600;
        display: flex;
        justify-content: center;
        align-items: center;
        height: 55px;
    }

    .u a:active {
        transform: scale(0.98);
        background-color: #000000;
    }

    /* --- ปรับสไลเดอร์ --- */
    .slider-container {
        border-radius: 10px;
    }
}


@media screen and (max-width: 480px) {
    .u {
        grid-template-columns: 1fr;
    }

    .slider-container {
        aspect-ratio: 4/3;
    }
}