:root {
    --g-dark: #cfae44;
    --g-mid: #e2c45f;
    --g-light: #f2d97c;
    --g-end: #e6c862;
    --gold-top: linear-gradient(90deg,
            var(--g-end) 0%,
            var(--g-dark) 12%,
            var(--g-light) 30%,
            var(--g-mid) 52%,
            var(--g-dark) 70%,
            var(--g-light) 88%,
            var(--g-end) 100%);
    --gold-bottom: linear-gradient(90deg,
            var(--g-end) 0%,
            var(--g-light) 18%,
            var(--g-dark) 32%,
            var(--g-light) 48%,
            var(--g-mid) 68%,
            var(--g-dark) 88%,
            var(--g-end) 100%);
    --gold-left: linear-gradient(180deg,
            var(--g-end) 0%,
            var(--g-light) 22%,
            var(--g-dark) 40%,
            var(--g-light) 62%,
            var(--g-mid) 85%,
            var(--g-end) 100%);
    --gold-right: linear-gradient(180deg,
            var(--g-end) 0%,
            var(--g-light) 12%,
            var(--g-dark) 35%,
            var(--g-mid) 62%,
            var(--g-light) 85%,
            var(--g-end) 100%);
}

.lgrMainLayout {
    position: relative;
    width: 100%;
    min-height: 100dvh;
    padding: 20px;
    padding-top: 190px;

    background-color: #31241d;
    background-image: url("../images/background/contantMainLayout.png");
    background-repeat: no-repeat;
    background-position: top center;
    background-size: 100% auto;

    font-size: 30px;
    font-weight: 800;
    color: #fff5b8;
    font-family: "PSLToranong", sans-serif;


    display: flex;
    flex-direction: column;
    align-items: center;
}

.lgrTitle {
    position: relative;
    display: inline-block;
    margin: 0;
    padding: 10px;
    font-size: 55px;
    line-height: 40px;
    font-weight: 800;
    white-space: nowrap;

    font-family: "PSLToranong", sans-serif;

    color: #2a1a0a;
    -webkit-text-stroke: 6px #2a1a0a;
    text-shadow: 0 6px 0 #2a1a0a, 0 8px 6px rgba(0, 0, 0, 0.4);
}

.lgrTitle::after {
    content: attr(data-text);
    position: absolute;
    left: 10px;
    top: 10px;
    white-space: nowrap;

    -webkit-text-stroke: 0;
    text-shadow: none;
    background: linear-gradient(to bottom,
            #fffbe3 0%,
            #fff1b5 50%,
            #e3bb4a 55%,
            #c79b34 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;
}

.lgrNote {
    background: radial-gradient(circle,
            rgba(251, 239, 175, 1) 0%,
            rgba(222, 186, 58, 1) 100%);

    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    color: transparent;

    font-size: 30px;
    line-height: 20px;
    font-weight: 800;
    font-family: "PSLToranong", sans-serif;
}

/* ===== BACKGROUND IMAGE (clipped to the gold frame shape) ===== */
.packageFrameContentMainLayout {
    --o-inset: 4px;
    --o-t: 3px;
    --o-r: 25px;
    --i-inset: 13px;
    --i-t: 1.5px;
    --i-r: 22px;

    position: relative;
    isolation: isolate;
    box-sizing: border-box;
    width: 100%;
    max-width: 1090px;
    min-height: 350px;

    background: #cfaf4425;
    outline: 1px solid #fffbc95c;
    padding: 45px;
    padding-top: 50px;
}

.packageFrameContentMainLayout::before,
.packageFrameContentMainLayout::after {
    content: "";
    position: absolute;
    pointer-events: none;
    background-repeat: no-repeat;
}

/* outer thick line */
.packageFrameContentMainLayout::before {
    inset: var(--o-inset);
    --t: var(--o-t);
    --r: var(--o-r);
}

/* inner thin line */
.packageFrameContentMainLayout::after {
    inset: var(--i-inset);
    --t: var(--i-t);
    --r: var(--i-r);
}

.packageFrameContentMainLayout::before,
.packageFrameContentMainLayout::after {
    background-image:
        radial-gradient(circle at 0 0,
            transparent calc(var(--r) - var(--t) - 0.6px),
            var(--g-end) calc(var(--r) - var(--t)),
            var(--g-end) calc(var(--r) - 0.6px),
            transparent var(--r)),
        radial-gradient(circle at 100% 0,
            transparent calc(var(--r) - var(--t) - 0.6px),
            var(--g-end) calc(var(--r) - var(--t)),
            var(--g-end) calc(var(--r) - 0.6px),
            transparent var(--r)),
        radial-gradient(circle at 0 100%,
            transparent calc(var(--r) - var(--t) - 0.6px),
            var(--g-end) calc(var(--r) - var(--t)),
            var(--g-end) calc(var(--r) - 0.6px),
            transparent var(--r)),
        radial-gradient(circle at 100% 100%,
            transparent calc(var(--r) - var(--t) - 0.6px),
            var(--g-end) calc(var(--r) - var(--t)),
            var(--g-end) calc(var(--r) - 0.6px),
            transparent var(--r)),
        var(--gold-top),
        var(--gold-bottom),
        var(--gold-left),
        var(--gold-right);

    background-size:
        var(--r) var(--r),
        var(--r) var(--r),
        var(--r) var(--r),
        var(--r) var(--r),
        calc(100% - 2 * var(--r)) var(--t),
        calc(100% - 2 * var(--r)) var(--t),
        var(--t) calc(100% - 2 * var(--r)),
        var(--t) calc(100% - 2 * var(--r));

    background-position:
        0 0,
        100% 0,
        0 100%,
        100% 100%,
        var(--r) 0,
        var(--r) 100%,
        0 var(--r),
        100% var(--r);
}

.packageFrameContentMainLayout_bg {
    --cut: calc(var(--o-r) - var(--o-t) / 2);
    position: absolute;
    inset: var(--o-inset);
    z-index: -1;
    background: url("../images/background/frameBg.png") center / cover no-repeat;
    /* opacity: .5; */
    -webkit-mask-image:
        radial-gradient(circle at 0 0,
            transparent var(--cut),
            #000 calc(var(--cut) + 0.5px)),
        radial-gradient(circle at 100% 0,
            transparent var(--cut),
            #000 calc(var(--cut) + 0.5px)),
        radial-gradient(circle at 0 100%,
            transparent var(--cut),
            #000 calc(var(--cut) + 0.5px)),
        radial-gradient(circle at 100% 100%,
            transparent var(--cut),
            #000 calc(var(--cut) + 0.5px));
    -webkit-mask-composite: source-in;
    mask-image:
        radial-gradient(circle at 0 0,
            transparent var(--cut),
            #000 calc(var(--cut) + 0.5px)),
        radial-gradient(circle at 100% 0,
            transparent var(--cut),
            #000 calc(var(--cut) + 0.5px)),
        radial-gradient(circle at 0 100%,
            transparent var(--cut),
            #000 calc(var(--cut) + 0.5px)),
        radial-gradient(circle at 100% 100%,
            transparent var(--cut),
            #000 calc(var(--cut) + 0.5px));
    mask-composite: intersect;
}

.lgrHr {
    position: relative;
    width: 100%;
    max-width: 600px;
    margin: 30px auto;
}

.lgrTopicMainLayout {
    position: relative;
    width: 800px;
    height: 113px;

    background: url("../images/section_1/topic.png") center / cover;

    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;

    font-size: 22px;
    line-height: 25px;
    font-weight: 800;
    color: #fff5b8;
}

/* Section 01 */
.lgrSec1_mainLayout {
    position: relative;
    width: 100%;
    min-height: 200px;

    display: flex;
    align-items: stretch;
    justify-content: center;
    gap: 20px;
}

.lgrSec1_ncp {
    position: relative;
    width: 280px;
    min-height: 200px;

    display: flex;
    flex-direction: column;
    align-items: center;

    color: #fef2cb;
    font-size: 20px;
    line-height: 20px;
    font-weight: 700;
}

.lgrSec1_ncpItem {
    width: 250px;
    min-width: 250px;
}

.lgrSec1_ncpDetail {
    width: 100%;
    padding-left: 50px;

    display: flex;
    flex-direction: column;
    align-items: start;
    text-align: start;
}

/* Section 02 */
.lgrSec2_mainLayout {
    position: relative;
    width: 100%;
    min-height: 200px;

    display: flex;
    flex-direction: column;
    align-items: center;

}

.lgrSec2_slideMainLayout {
    position: relative;
    z-index: 2;
    width: 100%;
    min-height: 250px;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
}

.lgrSec2_slideBtn {
    width: 45px;
    height: 45px;
    padding: 10px;
    border-radius: 50px;

    border: 1px solid #ffeabb;
    background: #180c05;

    display: flex;
    align-items: center;
    justify-content: center;

    flex-shrink: 0;
    transition:
        transform 0.2s ease,
        background 0.2s ease,
        border-color 0.2s ease,
        box-shadow 0.2s ease;
}

.lgrSec2_slideBtn img {
    width: 20px;
    min-width: 20px;
    height: 20px;
    margin-left: 5px;

    object-fit: contain;
    transition: transform 0.2s ease, filter 0.2s ease;
}

.lgrSec2_slideBtn.prev img {
    transform: rotate(180deg);
    margin-right: 8px;
}

@media (hover: hover) {
    .lgrSec2_slideBtn:hover {
        background: #2c180b;
        border-color: #fff4d0;
        transform: scale(1.1);
        box-shadow:
            0 0 8px 2px rgba(242, 217, 124, 0.55),
            0 0 18px 4px rgba(207, 174, 68, 0.3);
    }

    .lgrSec2_slideBtn:hover img {
        filter: brightness(1.3) drop-shadow(0 0 4px rgba(255, 224, 158, 0.9));
    }
}

.lgrSec2_slideBtn:active {
    transform: scale(0.92);
    box-shadow: 0 0 4px 1px rgba(242, 217, 124, 0.5);
}

.lgrSec2_slideBtn:focus-visible {
    outline: 2px solid #fff4d0;
    outline-offset: 3px;
    box-shadow: 0 0 10px 3px rgba(242, 217, 124, 0.6);
}

.lgrSec2_slideImg {
    position: relative;
    width: 700px;
    height: 600px;
    border: 5px solid #ffe09e;
    box-shadow: 1px 1px 10px 2px #00000070;

    overflow: hidden;
}

.lgrSec2_slideImg img {
    display: block;
    transition: opacity 0.25s ease;
    user-select: none;
    -webkit-user-drag: none;
    object-fit: cover;
}

.lgrSec2_slideImg img.is-fading {
    opacity: 0;
}

.lgrSec2_slideBtn {
    cursor: pointer;
    flex-shrink: 0;
    transition: transform 0.15s ease, background 0.15s ease;
}

.lgrSec2_slideBtn:hover {
    background: #2c180b;
    transform: scale(1.08);
}

.lgrSec2_slideBtn:active {
    transform: scale(0.95);
}

.lgrSec2_detailMainLayout {
    position: relative;
    width: 100%;
    max-width: 700px;

    display: flex;
    flex-direction: column;
    align-items: start;

    color: #fef2cb;
    font-size: 20px;
    line-height: 20px;
    font-weight: 700;
}

/* ===== Slide image : hint ให้รู้ว่ากดขยายได้ ===== */
.lgrSec2_slideImg {
    cursor: zoom-in;
}

.lgrSec2_slideImg::after {
    content: "🔍";
    position: absolute;
    right: 8px;
    bottom: 8px;
    padding: 5px 5px;
    border-radius: 20px;
    background: rgba(24, 12, 5, 0.75);
    border: 1px solid #ffeabb;
    color: #fef2cb;
    font-size: 13px;
    line-height: 18px;
    pointer-events: none;
}

.lgrSec2_slideImg:focus-visible {
    outline: 2px solid #fff4d0;
    outline-offset: 3px;
}

/* ===== Lightbox ===== */
body.lgr-lightbox-open {
    overflow: hidden;
}

.lgrLightbox {
    position: fixed;
    inset: 0;
    z-index: 2000;
    background: rgba(10, 5, 2, 0.94);
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s;
}

.lgrLightbox.is-open {
    opacity: 1;
    visibility: visible;
}

.lgrLightbox_stage {
    position: absolute;
    inset: 0;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    /* ให้ JS จัดการ pinch / drag เอง */
    cursor: zoom-in;
}

.lgrLightbox_stage.is-zoomed {
    cursor: grab;
}

.lgrLightbox_stage.is-dragging {
    cursor: grabbing;
}

.lgrLightbox_img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none;
}

.lgrLightbox_btn {
    width: 44px;
    height: 44px;
    padding: 0;
    border-radius: 50%;
    border: 1px solid #ffeabb;
    background: #180c05;
    color: #fef2cb;
    font-size: 22px;
    line-height: 1;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.lgrLightbox_btn:active {
    transform: scale(0.92);
}

.lgrLightbox_btn:focus-visible {
    outline: 2px solid #fff4d0;
    outline-offset: 3px;
}

@media (hover: hover) {
    .lgrLightbox_btn:hover {
        background: #2c180b;
        box-shadow: 0 0 8px 2px rgba(242, 217, 124, 0.55);
    }
}

.lgrLightbox_close {
    position: absolute;
    z-index: 2;
    top: max(14px, env(safe-area-inset-top));
    right: 14px;
    font-size: 30px;
    padding-bottom: 5px;
}

.lgrLightbox_tools {
    position: absolute;
    z-index: 2;
    left: 50%;
    bottom: max(18px, env(safe-area-inset-bottom));
    transform: translateX(-50%);
    display: flex;
    gap: 10px;
}

.lgrLightbox_tools .lgrLightbox_btn[data-act="reset"] {
    font-size: 14px;
}

.lgrSec2_object {
    position: absolute;
    right: -20%;
    bottom: 3%;
    z-index: 1;

    width: 320px;
    filter: drop-shadow(1px 1px 10px #ffea95bf);
}

.lgrSec2_object_2 {
    position: absolute;
    left: -12%;
    top: 0%;
    z-index: 1;

    width: 150px;
}



/* Section 03 */
.lgrSec3_mainLayout {
    position: relative;
    width: 100%;
    min-height: 200px;

    display: flex;
    flex-direction: column;
    align-items: center;
}

.lgrSec3_TopicLayout {
    position: relative;
    z-index: 2;
    width: 550px;
    height: 79px;
    padding: 10px;
    padding-left: 60px;
    padding-right: 180px;

    background: url("../images/section_1/topic.png") center / cover;

    display: flex;
    flex-direction: column;
    align-items: start;
    justify-content: center;
    text-align: start;

    font-size: 25px;
    line-height: 25px;
    font-weight: 800;
    color: #fff5b8;
}

.lgrSec3_TopicItem {
    position: absolute;
    right: 35px;
    top: 50%;
    transform: translateY(-50%);

    width: 130px;
}

.lgrSec3_npcLayout {
    width: 100%;
    max-width: 280px;
}

.lgeSec3_object {
    position: absolute;
    z-index: 1;
    top: 40%;
    right: -9%;

    width: 110px;
}

.lgeSec3_object_2 {
    position: absolute;
    z-index: 1;
    top: 0%;
    left: -9%;

    width: 110px;
}

.lgeSec3_object_3 {
    position: absolute;
    z-index: 1;
    bottom: -11%;
    right: -9%;

    width: 120px;
}

.lgrBtnHome {
    position: fixed;
    z-index: 5;
    top: 150px;
    left: 20px;

    width: 35px;
    height: 35px;
    border-radius: 50%;
    padding: 0;

    display: flex;
    align-items: center;
    justify-content: center;

    font-size: 13px;
    line-height: 1;
    font-weight: 600;

    background: #f2d289;
    border: 2px solid #daa847;
    box-shadow: 0px 3px 0px #082d8d;
    color: #452716;

    transition: all 0.2s ease;
}

.lgrBtnHome span {
    display: block;
    line-height: 1;
    transform: translateY(-3px);
}

.lgrBtnHome:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 0 #082d8d, 0 10px 22px rgba(242, 210, 137, .45);
    filter: brightness(1.06);
}

.lgrBtnHome.top {
    top: inherit;
    left: inherit;
    bottom: 20px;
    right: 20px;
}

.lgrBtnHome.top {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: all 0.2s ease, opacity 0.25s ease, visibility 0.25s;
}

.lgrBtnHome.top.is-visible {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
}