@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;
    display: flex;
    flex-direction: column;
    background: #c9ebe5;
    user-select: none;
    padding-left: 0;
    padding-right: 0;
    overflow-x: hidden;
}

/* --- HEADER --- */
header {
    position: sticky;
    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);
}

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;
}

/* Updated .card to be centered */
.card {
    background: #ffdeef;
    width: 650px;
    height: auto;
    padding: 10px;
    margin: 20px auto; /* This centers the card horizontally */
    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 (Restored to original sizes) --- */
.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; */ /* Keep default visibility for larger screens */
}

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

.slider-wrapper .image-list {
    display: grid;
    gap: 10px; /* Original gap */
    font-size: 0;
    margin-bottom: 30px; /* Original margin */
    overflow-x: auto;
    scrollbar-width: none;
    grid-auto-flow: column;
    grid-auto-columns: minmax(280px, 1fr); /* Original column size */
    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; /* Original aspect ratio */
}

.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%; /* Original width */
    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;
}

/* --- EVENT CARD --- */
:root {
    --purple: #526597;
    --pink: hsl(0, 59%, 94%);
    --light-bg: hsl(204, 37%, 92%);
    --light-gray-bg: hsl(0, 0%, 94%);
    --white: hsl(0, 0%, 100%);
    --dark: #526597;
}

h3 {
    font-size: 1.3em;
    font-weight: 700;
}

.description {
    white-space: wrap;
}

a {
    text-decoration: none;
    color: inherit;
}

.wrap {
    display: flex;
    justify-content: center;
    align-items: stretch;
    width: 80%;
    gap: 24px;
    padding: 24px;
    flex-wrap: wrap;
    margin: 0 auto;
}

.box {
    display: flex;
    flex-direction: column;
    flex-basis: 100%;
    position: relative;
    padding: 20px;
    background: #fff;
    border-radius: 10px;
}

.box-top {
    display: flex;
    flex-direction: column;
    position: relative;
    gap: 12px;
    margin-bottom: 36px;
}

.box-image {
    width: 100%;
    height: auto;
    object-fit: cover;
    object-position: 50% 20%;
}

.title-flex {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.box-title {
    border-left: 3px solid var(--purple);
    padding-left: 12px;
}

.bttn {
    display: block;
    justify-content: center;
    align-items: center;
    text-align: center;
    margin-top: auto;
    padding: 10px;
    color: #000;
    background: transparent;
    box-shadow: 0px 0px 0px 1px black inset;
    transition: background 0.4s ease;
    border-radius: 10px;
}

.bttn:hover {
    background: var(--purple);
}

.fill-one {
    background: var(--light-bg);
}

.fill-two {
    background: var(--pink);
}

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

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

    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%;
    }

    /* Event Card Responsive */
    @media (min-width: 320px) {
        .title-flex {
            flex-direction: column;
            align-items: flex-start;
        }
    }

    @media (min-width: 460px) {
        .title-flex {
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
        }
    }

    @media (min-width: 640px) {
        .box {
            flex-basis: calc(50% - 12px);
        }
        .title-flex {
            flex-direction: column;
            align-items: flex-start;
        }
    }

    @media (min-width: 840px) {
        .title-flex {
            flex-direction: row;
            justify-content: space-between;
            align-items: center;
        }
    }

    @media (min-width: 1024px) {
        .box {
            flex-basis: calc(33.3% - 16px);
        }
        .title-flex {
            flex-direction: column;
            align-items: flex-start;
        }
    }
}

/* สำหรับมือถือ (ทั่วไป max-width 768px) */
@media (max-width: 768px) {
    header {
        padding: 8px 10px;
        justify-content: space-between;
    }

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

    header .navbar {
        display: flex;
    }

    header .navbar ul li a {
        font-size: 0.9rem;
        margin-left: 10px;
        padding: 4px 8px;
    }

    header .navbar ul {
        flex-wrap: wrap;
        justify-content: flex-end;
        margin-left: auto;
    }

    .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;
    }
}

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

    header .navbar ul li a {
        font-size: 0.8rem;
        margin-left: 8px;
        padding: 3px 6px;
    }

    .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;
    }
}

/* System for mobile and tablets (Restored to original sizes and removed previous overrides) */
@media (max-width: 1290px) {
    .container {
        max-width: 1500px; /* Restored to original max-width */
        width: 100%; /* Restored to original width */
    }
    .slider-wrapper .slide-button {
        display: none; /* Only hide for smaller screens as per the original first code */
    }
    .slider-wrapper .image-list {
        gap: 10px; /* Restored to original gap */
        margin-bottom: 30px; /* Restored to original margin */
        grid-auto-columns: minmax(280px, 1fr); /* Restored to original column size */
    }
    .slider-wrapper .image-list .image-item {
        /* width: 100%; */ /* Removed specific width, let grid-auto-columns handle it */
        /* height: 100%; */ /* Removed specific height, let aspect-ratio handle it */
        aspect-ratio: 13 / 16; /* Restored to original aspect ratio */
    }
    .slider-scrollbar .scrollbar-thumb {
        width: 50%; /* Restored to original width */
    }
}

@media (max-width: 1200px) {
    .container {
        max-width: 1500px; /* Restored to original max-width */
        width: 100%; /* Restored to original width */
    }
    .slider-wrapper .slide-button {
        display: none;
    }
    .slider-wrapper .image-list {
        gap: 10px;
        margin-bottom: 30px;
        grid-auto-columns: minmax(280px, 1fr);
    }
    .slider-wrapper .image-list .image-item {
        aspect-ratio: 13 / 16;
    }
    .slider-scrollbar .scrollbar-thumb {
        width: 50%;
    }
}

@media (max-width: 1024px) {
    .container {
        max-width: 1500px; /* Restored to original max-width */
        width: 100%; /* Restored to original width */
    }
    .slider-wrapper .slide-button {
        display: none !important; /* Keep this to hide buttons on tablets as per first code */
    }
    .slider-wrapper .image-list {
        grid-auto-columns: minmax(220px, 1fr); /* Original from first code for 1024px */
        gap: 6px; /* Original from first code for 1024px */
        margin-bottom: 30px; /* Restore to original */
    }
    .slider-wrapper .image-list .image-item {
        aspect-ratio: 13 / 16; /* Original from first code for 1024px */
    }
    .slider-scrollbar .scrollbar-thumb {
        width: 30%; /* Original from first code for 1024px */
    }
}

/* Mobile specific overrides (from your first code) */
@media (max-width: 768px) {
    .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 {
        aspect-ratio: 9 / 16;
    }
    .slider-scrollbar .scrollbar-thumb {
        width: 40%;
    }
}

@media (max-width: 480px) {
    .slider-wrapper .image-list .image-item {
        aspect-ratio: 9 / 16;
    }
}
