/* Default: ขาว */
.site-header {
    --w-header-bg: rgba(255, 255, 255, 1);
    --w-header-color: #fc567b;
    --bs-body-color: #334155;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    min-height: 70px;
    padding: 0 12px;
    background: var(--w-header-bg);
    display: grid;
    align-items: center;
    transition: .3s;
}

/* ถ้ายังไม่ active (เช่น ตอนอยู่บนสุด) => โปร่ง+ตัวหนังสือขาว */
.site-header:not(.active) {
    --w-header-bg: linear-gradient(to top, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, 0.15) 100%);
    --w-header-color: #fff;
}

.site-header.scrolled {
    background-color: white;
    --w-header-bg: none;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);;
}

.site-header.scrolled .n-toggle b{
    background-color: var(--bs-body-color); /* เปลี่ยนสีขีดในปุ่ม hamburger */
}

.site-header.scrolled .n-toggle b::before {
    background-color: var(--bs-body-color); /* เปลี่ยนสีขีดในปุ่ม hamburger */
}

.site-header.scrolled .n-toggle b::after {
    background-color: var(--bs-body-color); /* เปลี่ยนสีขีดในปุ่ม hamburger */
}

.site-header.scrolled .nav-text {
  color: var(--bs-body-color);
}

.site-header.scrolled .svgicon path {
  fill: var(--bs-body-color);
}

.n-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
}

.n-header a {
    color: var(--w-header-color);
}

.n-branding {
    display: flex;
    align-items: center;
    gap: 8px;
}

.logo-header-nav {
    width: auto;
    height: 48px;
}

img, picture, video, canvas {
    max-width: 100%;
    height: auto;
}

.n-manu-ul {
    display: flex;
    align-items: center;
    justify-content: center;
    list-style: none;
    margin: 0;
    padding: 0;
}

.n-manu-ul a {
    display: block;
    font-size: 17px;
    font-weight: 700;
    white-space: nowrap;
    padding: 8px 15px;
    border-radius: 6px;
    text-decoration: none;
}

.n-toggle {
    height: 32px;
    width: 32px;
    font-size: 10px;
    cursor: pointer;
    position: relative;
    border: none;
    background-color: transparent;
    padding: 4px;
    z-index: 1000;
}

.nav-text {
    display: block;
    font-size: 14px;
    font-weight: 700;
    white-space: nowrap;
    padding: 8px 12px;
    border-radius: 6px;
}

.nav-text:hover{
    border-radius: 8px;
    background: rgba(0,0,0, 0.2);
    transition: .3s;
}

hr {
    margin: 1rem 0;
    color: white;
    border: 0;
    border-top: 1px solid;
}

hr.scrolled{
    color: var(--bs-body-color);
}

@media (min-width: 992px) {
    .n-action {
        display: none;
    }
}

.svgicon {
    display: var(--fa-display, inline-block);
    height: 1em;
    overflow: visible;
    vertical-align: -.125em;
}

.n-action.scrolled{
    background: var(--bs-body-color);
}

/* สร้างเส้นในปุ่ม toggle */
.n-toggle b,
.n-toggle b::before,
.n-toggle b::after {
    content: "";
    display: block;
    height: 2px;
    background: var(--w-header-color);
    border-radius: 2px;
    transition: 0.3s;
    position: relative;
}

/* ระยะห่างระหว่างเส้น */
.n-toggle b::before {
    top: -6px;
    position: absolute;
    width: 100%;
}

.n-toggle b::after {
    top: 6px;
    position: absolute;
    width: 100%;
}

/* ตอน active: แปลงเป็น X */
.site-header.menu-open .n-toggle b {
    background: transparent;
}

.site-header.menu-open .n-toggle b::before {
    background-color: var(--bs-body-color);
    transform: rotate(45deg);
    top: 0; 
}

.site-header.menu-open .n-toggle b::after {
    background-color: var(--bs-body-color);
    transform: rotate(-45deg);
    top: 0;
}

.site-header.menu-open.scrolled .n-manu-ul {
    background: #fff;
}

hr.scrolled{
    color: var(--bs-body-color);
}

@media (max-width:425px) {
    .n-manu-ul{
        width: 100%!important;
    }
}

@media (max-width: 991px) {
    .n-manu-ul {
        position: fixed;
        top: 0;
        right: -100%;
        width: 350px;
        height: 100vh;
        background-color: #fff;
        flex-direction: column;
        align-items: flex-start;
        padding: 80px 16px 16px;
        transition: right 0.3s ease;
        border-radius: 0;
        box-shadow: -4px 0 16px rgba(0,0,0,0.1);
        z-index: 999;
        justify-content: normal;
        font-size: 20px;
    }

    .n-manu-ul a{
        font-size: 20px;
        color: var(--bs-body-color);
    }

    .site-header .nav-text {
        color: var(--bs-body-color);
    }

    .n-manu-ul li {
        width: 100%;
        text-align: left;
    }

    .site-header.menu-open .n-manu-ul {
        right: 0;
    }

    .svgicon path {
    fill: var(--bs-body-color);
  }
}

.n-manu-ul hr {
    width: 100%;
    border: none;
    border-top: 1px solid rgba(0,0,0);
    margin: 8px 0;
}

.site-header:not(.active) .n-manu-ul hr {
    border-top: 2px solid #29546e; /* ให้ขาวเวลาหัวข้อเป็นสีขาว */
}

#event, #info, #social, #library{
    scroll-margin-top: 70px; 
}

.n-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: rgba(0, 0, 0, 0.4); /* สีดำใส */
    z-index: 998;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

/* เมื่อเมนูเปิดให้แสดง backdrop */
.site-header.menu-open .n-backdrop {
    opacity: 1;
    pointer-events: auto;
}
