@import url('https://fonts.googleapis.com/css2?family=NTR&display=swap');

/* --- GLOBAL RESET & BASE STYLES --- */
* {
    margin: 0;
    padding: 0;
    list-style: none;
    box-sizing: border-box;
    font-family: 'NTR';
}

body {
    min-height: 100vh; /* กำหนดความสูงขั้นต่ำของ body ให้เต็ม viewport */
    display: flex; /* ทำให้ body เป็น flex container */
    flex-direction: column; /* จัดเรียงองค์ประกอบในแนวตั้ง */
    background: #c9ebe5;
    user-select: none;
    padding-left: 0;
    padding-right: 0;
    overflow-x: hidden;
    padding-top: 100px; /* เพิ่ม padding-top เท่ากับความสูงของ header */
    /* ไม่ต้องใช้ padding-bottom ที่ body แล้ว เพราะ footer จะจัดการตัวเอง */
}

/* --- HEADER --- */
header {
    position: fixed; /* ทำให้ Header อยู่ด้านบนเมื่อเลื่อนหน้าจอ */
    top: 0;
    left: 0;
    right: 0;
    width: 100%;
    background: #f1d5f0;
    padding: 3px 100px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 1000;
    box-shadow: 0 .5rem 1rem rgba(0, 0, 0, .1);
    height: 100px; /* กำหนดความสูงของส่วนหัว */
}

header .Izurina {
    color: #fff;
    font-weight: bolder;
    text-decoration: none;
    font-size: 3rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    text-align: left;
}

/* NAVIGATION LINKS (Always visible now) */
header .navbar ul {
    display: flex; /* ทำให้ navbar แสดงผลเสมอ */
    justify-items: center;
    align-items: center;
}

header .navbar ul li {
    list-style: none;
    margin-left: 20px;
}

header .navbar ul li a {
    text-decoration: none;
    padding: 6px 15px;
    color: #fff;
    border-radius: 15px;
    font-size: 1.1rem; /* ขนาดตัวอักษรเริ่มต้น */
    transition: all 0.3s ease; /* เพิ่ม transition เพื่อความนุ่มนวล */
}

/* เปลี่ยนสีพื้นหลังเป็นสีขาว และตัวอักษรเป็น #f77df3 เมื่อ hover หรือ active */
header .navbar ul li a:hover,
header .navbar ul li a.active {
    background: #fff;
    color: #f77df3;
}

/* --- REMOVED HAMBURGER MENU STYLES --- */
/* ส่วนของ .menu-toggle และ .bar จะถูกลบออกไปทั้งหมด */


/* --- MAIN CONTENT LAYOUT & SPACING --- */
.home-section {
    margin-top: 40px;
    margin-bottom: 30px;
    width: 100%;
    max-width: 1500px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 15px;
}

.sec {
    padding: 0 15px;
}
.sec h1 {
    text-align: center;
    font-size: 2.5rem;
    margin-bottom: 30px;
}

.card {
    background: #ffdeef;
    width: 650px;
    height: auto;
    padding: 10px;
    margin: 20px auto;
    border-radius: 30px;
    box-shadow: 0 4px 8px 0 rgba(0, 0, 0, 0.2), 0 6px 20px 0 rgba(0, 0, 0, 0.19);
    margin-bottom: 40px;
    max-width: calc(100% - 30px);
}

.card .right-containerr h5 {
    text-align: center;
    font-size: 24px;
    margin-bottom: 20px;
}

.gradienttext {
    background-image: linear-gradient(to right, #526597 0%, #526597 100%);
    color: transparent;
    background-clip: text;
    -webkit-background-clip: text;
}

/* --- TABLE STYLES --- */
.card table {
    width: 100%;
    border-collapse: collapse;
    height: auto;
}

.card table tr {
    border-bottom: 1px solid #eee;
}

.card table tr:last-child {
    border-bottom: none;
}

.card table td {
    padding: 10px;
    border: none;
    color: rgb(82, 101, 151);
}

.card table td:first-child {
    font-weight: bold;
}

/* --- SLIDER - ADJUSTED FOR UNIFORM IMAGE SIZE --- */
.container {
    max-width: 1500px;
    width: 100%;
    margin-left: auto;
    margin-right: auto;
}

.slider-wrapper {
    position: relative;
}

.slider-wrapper .slide-button {
    position: absolute;
    top: 50%;
    height: 50px;
    width: 50px;
    color: #fff;
    border: none;
    outline: none;
    background: #ffdeef;
    font-size: 2.2rem;
    cursor: pointer;
    border-radius: 50%;
    transform: translateY(-50%);
    z-index: 1;
}

.slider-wrapper .slide-button:hover {
    background: #fff;
    color: #ffdeef;
}

.slider-wrapper .slide-button#prev-slide {
    left: -20px;
    display: none;
}

.slider-wrapper .slide-button#next-slide {
    right: -20px;
}

.slider-wrapper .image-list {
    display: grid;
    gap: 10px;
    font-size: 0;
    margin-bottom: 30px;
    overflow-x: auto;
    scrollbar-width: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr);
    scroll-snap-type: x mandatory;
}

.slider-wrapper .image-list::-webkit-scrollbar {
    display: none;
}

.slider-wrapper .image-list .image-item {
    width: 100%;
    height: 100%;
    object-fit: cover;
    scroll-snap-align: start;
    flex-shrink: 0;
    aspect-ratio: 13 / 16; /* Desktop/Tablet: สัดส่วนเดิม */
}

.container .slider-scrollbar {
    height: 24px;
    width: 100%;
    display: flex;
    align-items: center;
}

.slider-scrollbar .scrollbar-track {
    height: 2px;
    width: 100%;
    background: #fff;
    position: relative;
    border-radius: 4px;
}

.slider-scrollbar:hover .scrollbar-track {
    height: 4px;
}

.slider-scrollbar .scrollbar-thumb {
    position: absolute;
    height: 100%;
    width: 50%;
    background: #ffdeef;
    border-radius: inherit;
    cursor: grab;
}

.slider-scrollbar .scrollbar-thumb:active {
    cursor: grabbing;
    height: 8px;
    top: -2px;
}

.slider-scrollbar .scrollbar-thumb::after {
    content: "";
    position: absolute;
    left: 0;
    right: 0;
    top: -10px;
    bottom: -10px;
}

/* --- SOCIAL MEDIA BUTTONS --- */
.social-wrapper {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
    margin-bottom: 50px;
    padding: 0 15px;
}

.social-wrapper .button {
    display: flex;
    align-items: center;
    height: 60px;
    width: 60px;
    overflow: hidden;
    background: #ffdeef;
    border-radius: 50px;
    cursor: pointer;
    box-shadow: 0px 10px 10px rgba(0, 0, 0, .1);
    transition: all 0.3s ease-in-out;
}

.social-wrapper .button:hover {
    width: 200px;
}

.social-wrapper .button .icon {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 60px;
    min-width: 60px;
    text-align: center;
    border-radius: 50%;
    box-sizing: border-box;
    transition: all 0.3s ease-in-out;
}
.social-wrapper .button a {
    text-decoration: none;
    display: flex;
    align-items: center;
}

.social-wrapper .button:nth-child(1):hover .icon { background: #4267B2; }
.social-wrapper .button:nth-child(2):hover .icon { background:linear-gradient(45deg, #f09433 0%, #e6683c 25%, #dc2743 50%, #cc2366 75%, #bc1888 100%); }
.social-wrapper .button:nth-child(3):hover .icon { background: #505255; }
.social-wrapper .button:nth-child(4):hover .icon { background:#000; }
.social-wrapper .button:nth-child(5):hover .icon { background: #ff0000; }

.social-wrapper .button .icon i {
    font-size: 25px;
    transition: all 0.3s ease-in-out;
    color: #526597;
}
.social-wrapper .button:hover .icon i { color: #fff; }

.social-wrapper .button span {
    font-size: 20px;
    font-weight: 500;
    line-height: 60px;
    margin-left: 10px;
    transition: all 0.3s ease-in-out;
    white-space: nowrap;
}

.social-wrapper .button:nth-child(1) span { color: #4267B2; }
.social-wrapper .button:nth-child(2) span { color: #E1306C; }
.social-wrapper .button:nth-child(3) span { color: #505255; }
.social-wrapper .button:nth-child(4) span { color: #000; }
.social-wrapper .button:nth-child(5) span { color: #ff0000; }
.social-wrapper .button:nth-child(6) span { color: #000; }
.social-wrapper .button:nth-child(7) span { color: #000; }


/* --- FOOTER --- */
.footer {
    margin-top: auto;
    left: 0;
    bottom: 0;
    width: 100%;
    background-color: #f1d5f0;
    color: #fff;
    text-align: center;
    padding: 10px 0;
}

/* ================================================================= */
/* MEDIA QUERIES (สำหรับ Responsive Design)          */
/* ================================================================= */

/* สำหรับหน้าจอขนาดกลาง (Tablets) และ Desktop ที่แคบ */
@media (max-width: 1024px) {
    header {
        padding: 3px 15px;
        height: 80px; /* ปรับความสูง header บน Tablet */
    }

    header .Izurina {
        font-size: 2.2rem;
    }

    /* ทำให้ Navbar แสดงผลเสมอ */
    header .navbar {
        display: flex; /* Navbar แสดงผลบนหน้าจอขนาดนี้ */
    }

    /* ปรับขนาดตัวอักษรของ Navbar บน Tablet */
    header .navbar ul li a {
        font-size: 1rem;
        margin-left: 15px; /* ลดระยะห่างระหว่างลิงก์ */
        padding: 5px 10px;
    }

    /* ไม่มี Hamburger icon อีกต่อไป */
    .menu-toggle {
        display: none;
    }

    .sec h1 {
        font-size: 2rem;
    }

    .slider-wrapper .image-list {
        grid-auto-columns: minmax(220px, 1fr);
        gap: 6px;
    }

    .slider-wrapper .image-list .image-item {
        aspect-ratio: 13 / 16;
    }

    .slider-scrollbar .scrollbar-thumb {
        width: 30%;
    }

    body {
        padding-top: 80px; /* ปรับ padding-top ของ body ให้เข้ากับความสูง header ใหม่ */
    }
}

/* สำหรับมือถือ (ทั่วไป max-width 768px) */
@media (max-width: 768px) {
    header {
        padding: 8px 10px;
        /* เปลี่ยน justify-content เพื่อให้ Navbar ชิดขวา หรือเว้นช่องว่างตามต้องการ */
        justify-content: space-between;
        height: 70px; /* ปรับความสูง header บนมือถือ */
    }

    header .Izurina {
        font-size: 1.8rem;
    }

    /* ทำให้ Navbar แสดงผลเสมอ */
    header .navbar {
        display: flex; /* Navbar แสดงผลบนหน้าจอมือถือ */
    }

    /* ปรับขนาดตัวอักษรของ Navbar บนมือถือ */
    header .navbar ul li a {
        font-size: 0.9rem; /* ลดขนาดตัวอักษรลงอีกสำหรับมือถือ */
        margin-left: 10px; /* ลดระยะห่างระหว่างลิงก์ */
        padding: 4px 8px;
    }

    /* หาก Navbar บนมือถือล้น ให้พิจารณาเปลี่ยนเป็น flex-wrap หรือลด padding/margin เพิ่มเติม */
    header .navbar ul {
        flex-wrap: wrap; /* ทำให้ลิงก์ขึ้นบรรทัดใหม่ถ้าล้น */
        justify-content: flex-end; /* จัดลิงก์ให้ชิดขวา */
        margin-left: auto; /* ดัน navbar ไปทางขวา */
    }


    /* ไม่มี Hamburger icon อีกต่อไป */
    .menu-toggle {
        display: none;
    }

    /* Slider (ภาพสไลด์) */
    .home-section {
        margin-top: 20px;
        margin-bottom: 20px;
        padding: 0 10px;
    }

    .sec h1 {
        font-size: 1.8rem;
    }

    .slider-wrapper .slide-button {
        height: 35px;
        width: 35px;
        font-size: 1.5rem;
    }
    .slider-wrapper .slide-button#prev-slide { left: 5px; display: block; }
    .slider-wrapper .slide-button#next-slide { right: 5px; display: block; }

    .slider-wrapper .image-list {
        grid-auto-columns: 100%;
        gap: 0;
    }

    .slider-wrapper .image-list .image-item {
        width: 100%;
        height: 100%;
        aspect-ratio: 9 / 16;
    }

    .slider-scrollbar .scrollbar-thumb {
        width: 40%;
    }

    /* Basic Information (ตารางข้อมูล) */
    .card {
        padding: 10px;
        margin: 15px auto;
        max-width: calc(100% - 20px);
    }

    .card .right-containerr h5 {
        font-size: 1.1em;
        margin-bottom: 15px;
    }

    .card table td {
        padding: 8px 0;
        font-size: 0.9em;
    }

    .card table td:first-child {
        font-weight: bold;
    }

    /* Social Media Buttons */
    .social-wrapper {
        gap: 10px;
        margin-bottom: 30px;
    }

    .social-wrapper .button {
        height: 50px;
        width: 50px;
    }

    .social-wrapper .button:hover {
        width: 150px;
    }
    .social-wrapper .button .icon {
        height: 50px;
        min-width: 50px;
    }
    .social-wrapper .button .icon i {
        font-size: 20px;
    }
    .social-wrapper .button span {
        font-size: 16px;
        line-height: 50px;
    }

    /* Footer */
    .footer {
        padding: 10px 0;
        font-size: 0.75em;
    }

    body {
        padding-top: 70px; /* ปรับ padding-top ของ body ให้เข้ากับความสูง header ใหม่ */
    }
}

/* สำหรับมือถือที่เล็กมากๆ (max-width: 480px) */
@media (max-width: 480px) {
    header .Izurina {
        font-size: 1.5rem;
    }

    /* ปรับขนาดตัวอักษรของ Navbar บนมือถือเล็กๆ */
    header .navbar ul li a {
        font-size: 0.8rem; /* ลดขนาดตัวอักษรลงอีกสำหรับมือถือเล็กๆ */
        margin-left: 8px;
        padding: 3px 6px;
    }

    /* ไม่มี Hamburger icon อีกต่อไป */
    .menu-toggle {
        display: none;
    }

    .sec h1 {
        font-size: 1.3rem;
    }

    .slider-wrapper .image-list .image-item {
        aspect-ratio: 9 / 16;
    }

    .card .right-containerr h5 {
        font-size: 1em;
    }

    .card table td {
        font-size: 0.8em;
        padding: 6px 0;
    }

    .social-wrapper .button {
        height: 45px;
        width: 45px;
    }
    .social-wrapper .button:hover {
        width: 140px;
    }
    .social-wrapper .button .icon {
        height: 45px;
        min-width: 45px;
    }
    .social-wrapper .button .icon i {
        font-size: 18px;
    }
    .social-wrapper .button span {
        font-size: 14px;
        line-height: 45px;
    }

    .footer {
        padding: 8px 0;
        font-size: 0.7em;
    }
}

/* --- WORK LIST (TABLE) --- */
@media print {
    .table, .table__body {
        overflow: visible;
        height: auto !important;
        width: auto !important;
    }
}

main.table {
    width: 90%; /* ความกว้างของตารางบนหน้าจอทั่วไป */
    max-width: 800px; /* ความกว้างสูงสุดของตาราง */
    min-height: 200px; /* ความสูงขั้นต่ำของตาราง */
    max-height: 70vh; /* ความสูงสูงสุดของตาราง (70% ของ viewport height) */
    background-color: #fff5;
    backdrop-filter: blur(7px);
    box-shadow: 0 .4rem .8rem #0005;
    border-radius: .8rem;
    overflow: hidden; /* ซ่อนส่วนเกินที่อาจจะเกิดขึ้นนอกกรอบ */
    margin: 20px auto; /* จัดให้อยู่ตรงกลางแนวนอน และมีระยะห่างจากด้านบน/ล่าง */
    display: flex; /* ใช้ flexbox เพื่อให้ body อยู่ภายในอย่างเหมาะสม */
    flex-direction: column; /* จัดเรียงองค์ประกอบในแนวตั้ง */
}

.table__header {
    width: 100%;
    height: 10%; /* ความสูงของ header ภายในตาราง */
    background-color: #fff4;
    padding: .8rem 1rem;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-shrink: 0; /* ป้องกันไม่ให้ header หดตัว */
}

.table__body {
    width: 95%; /* ความกว้างของเนื้อหาตาราง */
    max-height: calc(100% - 1.6rem - 10%); /* ความสูงสูงสุดที่เหลือสำหรับเนื้อหา (ลบ header และ padding) */
    background-color: #fffb;
    margin: .8rem auto;
    border-radius: .6rem;
    overflow-y: auto; /* ทำให้เกิด Scrollbar แนวตั้งเมื่อเนื้อหาเกิน */
    overflow-x: hidden; /* ซ่อน Scrollbar แนวนอน ถ้ามี */
    scrollbar-width: thin; /* สำหรับ Firefox */
    scrollbar-color: #0004 #fff; /* สำหรับ Firefox */
}

.table__body::-webkit-scrollbar {
    width: 0.5rem;
    height: 0.5rem;
}

.table__body::-webkit-scrollbar-thumb {
    border-radius: .5rem;
    background-color: #0004;
}

.table__body::-webkit-scrollbar-track {
    background: #fff;
}

table {
    width: 100%;
}

table, th, td {
    border-collapse: collapse;
    padding: 1rem;
    text-align: center;
}

thead th {
    position: sticky;
    top: 0;
    left: 0;
    background-color: #d0dfd6fe;
    cursor: pointer;
    text-transform: capitalize;
}

tbody tr:nth-child(even) {
    background-color: #0000000b;
}

tbody tr {
    --delay: .1s;
    transition: .5s ease-in-out var(--delay), background-color 0s;
}

tbody tr.hide {
    opacity: 0;
    transform: translateX(100%);
}

tbody tr:hover {
    background-color: #fff6 !important;
}

.click {
    padding: .4rem 0;
    border-radius: 2rem;
    text-align: center;
}

.click {
    background-color: #ffdeef;
    color: #fff;
}

@media (max-width: 1000px) {
    main.table {
        width: 95%;
        max-height: 60vh; /* ลดความสูงสูงสุดบน Tablet */
    }
    td:not(:first-of-type) {
        min-width: 10rem;
    }
}

@media (max-width: 768px) {
    main.table {
        width: 98%;
        max-height: 50vh; /* ลดความสูงสูงสุดบนมือถือ */
        padding: 0 5px;
    }
    thead th {
        font-size: 0.9em;
        padding: 0.8rem;
    }
    tbody td {
        font-size: 0.8em;
        padding: 0.8rem;
    }
    td:not(:first-of-type) {
        min-width: auto;
    }
}

@media (max-width: 480px) {
    main.table {
        width: 100%;
        max-height: 40vh; /* ลดความสูงสูงสุดบนมือถือขนาดเล็ก */
        border-radius: 0;
        padding: 0;
    }
    thead th,
    tbody td {
        font-size: 0.75em;
        padding: 0.6rem;
    }
}

/* --- TIMELINE --- */
:root {
    --white: #fff;
    --black: #323135;
    --crystal: #a8dadd;
    --columbia-blue: #cee9e4;
    --midnight-green: #01565b;
    --yellow: #e5f33d;
    --timeline-gradient: rgba(206, 233, 228, 1) 0%, rgba(206, 233, 228, 1) 50%,
        rgba(206, 233, 228, 0) 100%;
}

.section {
    padding: 50px 0;
}

.section .container {
    width: 82vw;
    max-width: 1200px;
    margin: 0 auto;
    text-align: center;
}

.section h1 {
    font-size: 2.5rem;
    line-height: 1.25;
}

.section h2 {
    font-size: 1.3rem;
}

.timeline {
    position: relative;
    white-space: nowrap;
    max-width: 1400px;
    padding: 0 10px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 320px auto;
    grid-gap: 20px;
}

.timeline::before,
.timeline::after {
    content: "";
    position: absolute;
    top: 0;
    bottom: 30px;
    width: 100px;
    z-index: 2;
}

.timeline::after {
    right: 0;
}

.timeline::before {
    left: 340px;
}

.timeline .info {
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 20px 40px;
    color: #526597;
    background: #ffdeef;
    white-space: normal;
    border-radius: 10px;
}

.timeline .info p {
    font-size: 20px;
    color: #526597;
}

.timeline .info a {
    text-decoration: none;
}

.timeline ol::-webkit-scrollbar {
    height: 10px;
}

.timeline ol::-webkit-scrollbar-thumb,
.timeline ol::-webkit-scrollbar-track {
    border-radius: 92px;
}

.timeline ol::-webkit-scrollbar-thumb {
    background: #ffdeef;
}

.timeline ol::-webkit-scrollbar-track {
    background: #fff;
}

.timeline ol {
    font-size: 0;
    padding: 300px 0;
    transition: all 1s;
    overflow-x: scroll;
    scroll-snap-type: x mandatory;
    scrollbar-color: #ffdeef #fff;
}

.timeline ol li {
    position: relative;
    display: inline-block;
    list-style-type: none;
    width: 160px;
    height: 5px;
    background: var(--white);
    scroll-snap-align: start;
}

.timeline ol li:last-child {
    width: 340px;
}

.timeline ol li:not(:first-child) {
    margin-left: 14px;
}

.timeline ol li:not(:last-child)::after {
    content: "";
    position: absolute;
    top: 50%;
    left: calc(100% + 1px);
    bottom: 0;
    width: 16px;
    height: 16px;
    transform: translateY(-50%);
    border-radius: 50%;
    background: #526597;
    z-index: 1;
}

.timeline ol li div {
    position: absolute;
    left: calc(100% + 7px);
    width: 280px;
    padding: 15px;
    font-size: 1rem;
    white-space: normal;
    color: var(--black);
    background: var(--white);
    border-radius: 0 10px 10px 10px;
}

.timeline ol li div::before {
    content: "";
    position: absolute;
    top: 100%;
    left: 0;
    width: 0;
    height: 0;
    border-style: solid;
}

.timeline ol li:nth-child(odd) div {
    top: -16px;
    transform: translateY(-100%);
    border-radius: 10px 10px 10px 0;
}

.timeline ol li:nth-child(even) div {
    top: calc(100% + 16px);
}

.timeline ol li:nth-child(even) div::before {
    top: -8px;
    border-width: 8px 0 0 8px;
    border-color: transparent transparent transparent var(--white);
}

.timeline time {
    display: block;
    font-size: 1.4rem;
    font-weight: bold;
    margin-bottom: 8px;
    color: #526597;
}

/* GENERAL MEDIA QUERIES FOR TIMELINE
–––––––––––––––––––––––––––––––––––––––––––––––––– */
@media screen and (max-width: 800px) {
    .timeline {
        display: block;
    }

    .timeline::before,
    .timeline::after {
        width: 50px;
    }

    .timeline::before {
        left: 0;
    }

    .timeline .info {
        display: none;
    }
}
