:root {
    --bs-body-font-family: "Sarabun", system-ui, -apple-system, sans-serif;
    --cta-accent: rgb(255, 195, 32);
    --cta-accent-soft: rgba(255, 195, 32, 0.55);
    --cta-glow: rgba(255, 195, 32, 0.45);
    --cta-ease-out-back: cubic-bezier(0.34, 1.45, 0.64, 1);
    --section-gap: 5.625rem; /* 90px */
}

html {
    max-width: 100%;
    overflow-x: hidden;
}

.container-rem {
    width: 100%;
    padding-right: 0.75rem;
    padding-left: 0.75rem;
    margin-right: auto;
    margin-left: auto;
}

@media (min-width: 36rem) {
    .container-rem {
        max-width: 33.75rem;
    }
}

@media (min-width: 48rem) {
    .container-rem {
        max-width: 45rem;
    }
}

@media (min-width: 62rem) {
    .container-rem {
        max-width: 60rem;
    }
}

@media (min-width: 75rem) {
    .container-rem {
        max-width: 71.25rem;
    }
}

@media (min-width: 87.5rem) {
    .container-rem {
        max-width: 82.5rem;
    }
}

body {
    font-family: Sarabun, system-ui, -apple-system, sans-serif;
    color: rgb(51, 51, 51);
    max-width: 100%;
    overflow-x: hidden;
}

.navbar-ios-glass {
    background: rgba(12, 12, 14, 0.52);
    backdrop-filter: blur(0.175rem) saturate(180%);
    box-shadow: rgba(255, 255, 255, 0.08) 0px 0.0625rem 0px inset, rgba(0, 0, 0, 0.35) 0px 0.0625rem 0px;
    border-bottom: 0.0625rem solid rgba(255, 255, 255, 0.07);
    padding: 0.8rem 0px;
}

@supports not ((backdrop-filter: blur(0.0625rem)) or (-webkit-backdrop-filter: blur(0.0625rem))) {
    .navbar-ios-glass {
        background: rgba(20, 20, 22, 0.92);
    }
}

.navbar-brand img {
    height: 2.5rem;
}

.btn-navbar-outline {
    border-radius: 2rem;
    padding: 0.55rem 1.35rem;
    font-size: 1.0625rem;
    font-weight: 500;
    transition: transform 0.28s var(--cta-ease-out-back), box-shadow 0.28s ease, color 0.2s ease,
        background-color 0.2s ease, border-color 0.2s ease;
}

.btn-navbar-outline:hover {
    transform: translateY(-0.125rem);
    box-shadow: 0 0.375rem 1.125rem rgba(0, 0, 0, 0.35), 0 0 0 0.0625rem var(--cta-accent-soft),
        0 0 1.25rem var(--cta-glow);
}

.btn-navbar-outline:active {
    transform: translateY(0.0625rem);
    box-shadow: 0 0.125rem 0.5rem rgba(0, 0, 0, 0.25);
}

.btn-navbar-download {
    --bs-btn-border-width: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.35em;
    padding: 0.55rem 1.35rem;
    font-size: 1.0625rem;
    font-weight: 600;
    color: rgb(255, 255, 255);
    background: rgba(152, 95, 46, 0.6);
    box-shadow: 0 0 0 0.1rem #ffc320 inset, 0 0 0 -1.625rem #2b2412 inset;
    backdrop-filter: blur(0.46875rem);
    -webkit-backdrop-filter: blur(0.46875rem);
    border-radius: 0rem;
    transition: transform 0.28s var(--cta-ease-out-back), background 0.25s ease, box-shadow 0.28s ease,
        filter 0.25s ease;
    animation: cta-navbar-download-glow 2.6s ease-in-out infinite;
}

.btn-navbar-download::before,
.btn-navbar-download::after {
    display: inline-block;
    line-height: 1;
    font-size: 0.72em;
    opacity: 0.95;
}

.btn-navbar-download::before {
    content: '\25B6\2009\25B6';
}

.btn-navbar-download::after {
    content: '\25C0\2009\25C0';
}

.btn-navbar-download:hover,
.btn-navbar-download:focus {
    color: rgb(255, 255, 255);
    background: rgba(152, 95, 46, 0.75);
    animation: none;
    transform: translateY(-0.125rem) scale(1.02);
    box-shadow: 0 0 0 0.1rem #ffc320 inset, 0 0 0 -1.625rem #2b2412 inset, 0 0.5rem 1.5rem rgba(0, 0, 0, 0.4),
        0 0 1.75rem var(--cta-glow);
    filter: brightness(1.08);
}

.btn-navbar-download:active {
    transform: translateY(0.0625rem) scale(0.99);
}

.btn-navbar-download:focus-visible {
    outline: 0.125rem solid rgba(255, 255, 255, 0.5);
    outline-offset: 0.125rem;
}

.hero-section {
    position: relative;
    background-color: rgb(26, 21, 16);
    background-image: url("../images/bg-hero.jpg");
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    padding: 4.5rem 1.25rem 4.25rem;
    min-height: min(54rem, 84vh);
    text-align: center;
    color: white;
    max-width: 100%;
    overflow-x: clip;
}

.hero-section__media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    pointer-events: none;
}

.hero-section__video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 42%;
}

.hero-section__bottom-sec {
    position: absolute;
    left: 0;
    right: 0;
    bottom: -0.1rem;
    width: 100%;
    max-width: none;
    height: auto;
    z-index: 2;
    pointer-events: none;
    display: block;
    line-height: 0;
}

.hero-section__content {
    position: relative;
    z-index: 3;
    top: 3rem;
}

.hero-section__actions > a {
    display: block;
    line-height: 0;
}

@media (max-width: 47.9988rem) {
    .hero-section__actions {
        flex-wrap: nowrap;
        gap: 0.5rem;
        width: 100%;
    }

    .hero-section__actions > a {
        flex: 1 1 0;
        min-width: 0;
    }

    .hero-section__actions img {
        width: 100%;
        height: auto;
    }

    .hero-section {
        min-height: min(67.5rem, 82vh);
        background-image: url("../images/mb-head-bg.jpg");
    }

    .hero-section__row {
        min-height: calc(min(67.5rem, 74vh) - 7.5rem);
    }

    .hero-section__media {
        display: none;
    }
}

@keyframes cta-navbar-download-glow {

    0%,
    100% {
        box-shadow: 0 0 0 0.1rem #ffc320 inset, 0 0 0 -1.625rem #2b2412 inset, 0 0 0 rgba(255, 195, 32, 0);
    }

    50% {
        box-shadow: 0 0 0 0.1rem #ffc320 inset, 0 0 0 -1.625rem #2b2412 inset, 0 0 1.5rem var(--cta-glow);
    }
}

@media (prefers-reduced-motion: reduce) {
    .btn-navbar-download {
        animation: none;
    }

    .btn-navbar-outline,
    .btn-navbar-download {
        transition: none;
    }

    .btn-navbar-outline:hover {
        transform: none;
    }

    .btn-navbar-download:hover,
    .btn-navbar-download:focus {
        transform: none;
    }
}

.scroll-section {
    background-color: rgb(245, 240, 230);
    background-image: url("../images/bg-main-top.png"), url("../images/bg-main.jpg");
    background-repeat: no-repeat, repeat-y;
    background-position: center top, center top 19.5625rem;
    background-size: 100%, 100%;
    padding: var(--section-gap) 1.25rem 2.5rem;
    max-width: 100%;
    overflow-x: visible;
    overflow-y: visible;
}

.scroll-section .container-rem {
    display: flex;
    flex-direction: column;
    gap: var(--section-gap);
}

/* YouTube embed frame — ธีมทอง / น้ำตาล */
.yg-video-frame {
    border: 0.1875rem solid var(--cta-accent);
    border-radius: 0.375rem;
    background-color: rgb(26, 21, 16);
    box-shadow:
        inset 0 0 0 0.0625rem var(--cta-accent-soft),
        0 0.25rem 1rem rgba(26, 21, 16, 0.45);
    overflow: hidden;
}

/* Section 1 — side decorations */
.sec1-with-decor {
    position: relative;
    overflow: visible;
}

.sec1-with-decor__content {
    position: relative;
    z-index: 1;
}

.sec1-decor {
    position: absolute;
    top: -160px;
    height: 100%;
    width: auto;
    max-width: 50%;
    object-fit: contain;
    object-position: center;
    pointer-events: none;
    z-index: 0;
}

.sec1-decor--left {
    left: -197px;
    object-position: left center;
}

.sec1-decor--right {
    right: -240px;
    object-position: right center;
}

@media (max-width: 991.98px) {
    .sec1-decor {
        max-width: 42%;
        opacity: 0.9;
    }
}

@media (max-width: 575.98px) {
    .sec1-decor {
        display: none;
    }
}

/* Section 1 — item glow overlay */
.sec1-item-glow {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 100%;
}

.sec1-item-glow__base {
    position: relative;
    z-index: 1;
    display: block;
    width: 100%;
    height: auto;
    filter: drop-shadow(2px 4px 6px black);
}

.sec1-item-glow__light {
    position: absolute;
    left: 50%;
    top: 37%;
    width: 47%;
    height: 45%;
    max-width: none;
    object-fit: contain;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: lighten;
    animation: sec1-item-light-rotate 10s linear infinite;
}

.sec1-item-glow__overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 3;
    pointer-events: none;
}

@keyframes sec1-item-light-rotate {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }
    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

@media (prefers-reduced-motion: reduce) {
    .sec1-item-glow__light {
        animation: none;
    }
}

.sec1-detail-note {
    color: #c0392b;
    text-decoration: underline;
    margin-bottom: 0;
}

/* Section 2 Event Column Layout */
.event-card {
    border-style: solid;
    border-width: 10px 10px 10px 10px;
    border-image-source: url("../images/bg-img.png");
    border-image-slice: 68 68 68 68 fill;
    border-image-width: 10px 10px 10px 10px;
    border-image-outset: 0px 0px 0px 0px;
    border-image-repeat: stretch;
    padding: 0.6rem 1rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    min-height: 10rem;
    margin-bottom: 1.5rem;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.event-card:hover {
    transform: translateY(-5px);
    filter: brightness(1.03);
}

.event-card__content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-self: stretch;
    min-height: 100%;
    text-align: left;
    padding-right: 0.5rem;
}

.event-card__title {
    font-size: 1.25rem;
    font-weight: 700;
    color: #1a0f00;
    margin-bottom: 0.25rem;
    line-height: 1.25;
}

.event-card__desc {
    font-size: 0.85rem;
    color: #4a3c31;
    margin-bottom: 0.35rem;
    line-height: 1.35;
    font-style: italic;
}

.event-card__link {
    margin-top: auto;
    font-size: 0.85rem;
    color: #b22222;
    text-decoration: underline;
    font-weight: bold;
    transition: color 0.2s ease;
}

.event-card__link:hover {
    color: #8b0000;
}

.event-card__icon-wrap {
    position: relative;
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    line-height: 0;
}

.event-card__icon {
    position: relative;
    z-index: 1;
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.event-card__icon-light {
    position: absolute;
    left: 50%;
    top: 49%;
    width: 95%;
    height: 95%;
    max-width: none;
    object-fit: contain;
    transform: translate(-50%, -50%);
    z-index: 2;
    pointer-events: none;
    mix-blend-mode: lighten;
    animation: sec1-item-light-rotate 10s linear infinite;
}

.event-card__icon-overlay {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: contain;
    z-index: 3;
    pointer-events: none;
}

@media (prefers-reduced-motion: reduce) {
    .event-card__icon-light {
        animation: none;
    }
}

.character-column {
    display: flex;
    justify-content: center;
    align-items: center;
}

@media (max-width: 991.98px) {
    .section2-layout-row {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.75rem;
    }

    .section2-layout-row > .col-lg-4:not(.character-column) {
        display: contents;
    }

    .section2-layout-row .character-column {
        grid-column: 1 / -1;
        order: -1;
    }
}

.character-wrapper {
    position: relative;
    width: 100%;
    max-width: 320px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.character-main {
    position: relative;
    z-index: 2;
    width: 100%;
    height: auto;
    transition: transform 0.3s ease;
}

.character-main:hover {
    transform: scale(1.05);
}

/* Section 3 — character + video tab buttons */
@media (max-width: 991.98px) {
    .sec3-char {
        width: 180px;
        max-width: 180px;
        height: auto;
    }
}

.video-tab-link {
    display: block;
    width: 100%;
    line-height: 0;
    transition:
        transform 0.25s var(--cta-ease-out-back),
        filter 0.25s ease,
        opacity 0.25s ease;
}

.video-tab-link img {
    display: block;
    width: 100%;
    height: auto;
}

.video-tab-link:hover {
    transform: scale(1.03);
    filter: brightness(1.08);
}

/* Section 4 — news carousel */
.section4-group {
    display: grid;
    width: 100%;
    padding: 0 51px;
    position: relative;
}

.section4-carousel {
    grid-area: 1 / 1;
    width: 100%;
    min-width: 0;
}

.section4-carousel__viewport {
    overflow: hidden;
    width: 100%;
    touch-action: pan-y;
}

.section4-carousel__track {
    display: flex;
    width: 100%;
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.section4-carousel__slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 0;
}

.section4-carousel__controls {
    grid-area: 1 / 1;
    position: relative;
    align-self: stretch;
    pointer-events: none;
    z-index: 3;
    min-height: 0;
}

.section4-carousel__nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    pointer-events: auto;
    border: 0;
    background: transparent;
    padding: 0;
    line-height: 0;
    cursor: pointer;
    transition: opacity 0.25s ease;
}

.section4-carousel__nav--prev {
    left: -51px;
}

.section4-carousel__nav--next {
    right: -51px;
}

@media (max-width: 991.98px) {
    .section4-group {
        padding: 0 20px;
    }
}

@media (max-width: 47.9988rem) {
    .section4-carousel__controls {
        display: none;
    }
}

@media (prefers-reduced-motion: reduce) {
    .section4-carousel__track {
        transition: none;
    }
}

.section4-carousel__nav:hover {
    opacity: 0.85;
}

.section4-carousel__nav:hover .section4-carousel__nav-img {
    transform: scale(1.05);
}

.section4-carousel__nav-img {
    width: 102px;
    height: 102px;
    display: block;
    object-fit: contain;
    transition: transform 0.25s ease;
}

.section4-carousel__indicators {
    grid-row: 2;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding: 0;
    background: transparent;
}

.section4-carousel__indicator {
    width: 0.5rem;
    height: 0.5rem;
    padding: 0;
    border: 0;
    border-radius: 0.125rem;
    background-color: #d0b889;
    cursor: pointer;
    transition:
        background-color 0.2s ease,
        width 0.2s ease,
        height 0.2s ease,
        border-radius 0.2s ease;
}

.section4-carousel__indicator:hover {
    background-color: #c4a87a;
}

.section4-carousel__indicator.is-active {
    width: 1.25rem;
    height: 0.5rem;
    border-radius: 0.25rem;
    background-color: #2d1c15;
}

/* Section 4 — news + image block */
.section4-block {
    background-color: #000;
    color: #fff;
}

.section4-block__media {
    line-height: 0;
}

.section4-news {
    padding: 2rem;
    min-height: 100%;
}

.section4-news__footer {
    margin-top: auto;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    width: 100%;
    gap: 1rem;
}

.section4-news__title,
.section4-news__desc,
.section4-news__date {
    color: #fff;
}

.section4-news__title {
    font-size: 1.5rem;
    font-weight: 700;
    margin: 0;
    line-height: 1.3;
}

.section4-news__desc {
    font-size: 1rem;
    line-height: 1.5;
    opacity: 0.92;
}

.section4-news__date {
    font-size: 0.875rem;
    opacity: 0.75;
}

.section4-news__btn {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background-color: #f5c518;
    border-color: #f5c518;
    color: #000;
    font-weight: 600;
}

.section4-news__btn-icon {
    width: 1.125em;
    height: 1.125em;
    flex-shrink: 0;
}

.section4-news__btn:hover,
.section4-news__btn:focus {
    background-color: #e0b310;
    border-color: #e0b310;
    color: #000;
}

.section4-news__btn:active {
    background-color: #c9a00e;
    border-color: #c9a00e;
    color: #000;
}

@media (max-width: 991.98px) {
    .section2-layout-row .event-card {
        margin-bottom: 0;
    }

    .event-card {
        flex-direction: column;
        align-items: center;
        justify-content: center;
        min-height: 10rem;
        padding: 1rem 0.75rem;
        gap: 0.75rem;
    }

    .event-card__icon-wrap {
        order: 1;
        width: 100%;
        max-width: 17.5rem;
        height: auto;
        aspect-ratio: 2 / 1;
        margin-inline: auto;
    }

    .section2-layout-row .event-card__icon-wrap {
        max-width: 100%;
    }

    .section2-layout-row .event-card__title {
        font-size: 0.95rem;
    }

    .event-card__content,
    .event-card__content.text-end {
        order: 2;
        flex: none;
        width: 100%;
        align-items: center;
        text-align: center;
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .event-card__title {
        width: 100%;
        text-align: center;
        font-size: 1.1rem;
    }

    .character-wrapper {
        width: 50%;
        max-width: none;
    }
}

.main-footer {
    width: 100%;
    max-width: 100%;
    margin: 0;
    background-color: rgb(45, 28, 21);
}

.footer-copyright {
    margin: 0px;
    font-size: 0.85rem;
}

.back-to-top {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right));
    bottom: max(1rem, env(safe-area-inset-bottom));
    z-index: 1030;
    width: 3.125rem;
    height: 3.125rem;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 0.0625rem solid rgba(250, 241, 211, 0.28);
    border-radius: 50%;
    background: rgba(87, 46, 0, 0.9);
    backdrop-filter: blur(0.625rem);
    -webkit-backdrop-filter: blur(0.625rem);
    color: rgb(250, 241, 211);
    box-shadow: 0 0 0 0.0625rem rgba(255, 195, 32, 0.22) inset, 0 0.3125rem 0.9375rem rgba(0, 0, 0, 0.4);
    cursor: pointer;
    opacity: 0;
    visibility: hidden;
    transform: translateY(0.5rem);
    transition: opacity 0.35s ease, visibility 0.35s ease, transform 0.35s ease, background 0.25s ease,
        color 0.25s ease, box-shadow 0.25s ease;
    font-family: Sarabun, sans-serif;
    pointer-events: none;
}

.back-to-top--visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.back-to-top:hover {
    background: rgb(139, 69, 19);
    color: rgb(255, 255, 255);
    box-shadow: 0 0 0 0.1rem rgba(255, 195, 32, 0.45) inset, 0 0.375rem 1rem rgba(0, 0, 0, 0.45);
}

.back-to-top:focus {
    outline: none;
}

.back-to-top:focus-visible {
    outline: 0.125rem solid rgba(255, 195, 32, 0.85);
    outline-offset: 0.1875rem;
}

.back-to-top__icon {
    width: 1.375rem;
    height: 1.375rem;
    flex-shrink: 0;
}

@media (prefers-reduced-motion: reduce) {
    .back-to-top {
        transition: none;
    }
}

@media (max-width: 47.9988rem) {
    .back-to-top {
        width: 2.875rem;
        height: 2.875rem;
    }

    .back-to-top__icon {
        width: 1.25rem;
        height: 1.25rem;
    }
}

.side-floating-menu {
    position: absolute;
    left: 0;
    top: 0;
    z-index: 9999;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0.5rem;
    pointer-events: none;
    transform: translateY(-50%);
}

.menu-item {
    pointer-events: auto;
    display: flex;
    align-items: center;
    background: rgba(87, 46, 0, 0.85);
    backdrop-filter: blur(0.625rem);
    -webkit-backdrop-filter: blur(0.625rem);
    color: rgb(250, 241, 211);
    text-decoration: none;
    padding: 0.625rem 0.9375rem;
    border-radius: 0 2rem 2rem 0;
    font-family: Sarabun, sans-serif;
    font-weight: 600;
    transition: all 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    box-shadow: 0.3125rem 0.3125rem 0.9375rem rgba(0, 0, 0, 0.4);
    border: 0.0625rem solid rgba(250, 241, 211, 0.2);
    border-left: none;
    width: 3.5rem;
    overflow: hidden;
    white-space: nowrap;
    position: relative;
}

.menu-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(120deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: 0.5s;
}

.menu-item:hover::before {
    left: 100%;
}

.menu-item:hover {
    width: 12.5rem;
    background: rgb(139, 69, 19);
    padding-right: 1.25rem;
    color: white;
}

.icon-wrapper {
    min-width: 1.5rem;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-right: 0.9375rem;
}

.icon-wrapper svg {
    width: 100%;
    height: 100%;
    fill: rgb(250, 241, 211);
    transition: fill 0.3s ease;
}

.menu-item:hover .icon-wrapper svg {
    fill: white;
}

.menu-text {
    font-size: 1rem;
    opacity: 0;
    transform: translateX(-1.25rem);
    transition: all 0.3s ease;
}

.menu-item:hover .menu-text {
    opacity: 1;
    transform: translateX(0);
}

@media (max-width: 47.9988rem) {
    .side-floating-menu {
        gap: 0.25rem;
    }

    .menu-item {
        width: 3.125rem;
        padding: 0.5rem 0.75rem;
    }

    .menu-item:hover {
        width: 3.125rem;
        transform: none;
    }

    .menu-text {
        display: none;
    }

    .icon-wrapper {
        margin-right: 0;
    }
}

/* AOS — respect reduced motion */
@media (prefers-reduced-motion: reduce) {
    [data-aos] {
        opacity: 1 !important;
        transform: none !important;
        transition: none !important;
    }
}