/* ============================
   Nawaminthara Maharaj Landing
   styles.css (Revised for sharper bg + bottom text)
   ============================ */

:root {
    --gold-0: #fff7e2;
    --gold-1: #f3e3b4;
    --gold-2: #d9b970;
    --gold-3: #b78a3a;
    --brown: #6c4c2f;
    --text: #2b1c12;
    --white: #fff;
    --shadow-lg: 0 8px 40px rgba(183, 138, 58, .28);
}

* {
    box-sizing: border-box
}

html,
body {
    height: 100%
}

body {
    margin: 0;
    font-family: "Noto Sans Thai", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
    color: var(--text);
    background: #0d0d0d;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* ====== Layout Base ====== */
.hero {
    position: relative;
    min-height: 100svh;
    overflow: hidden;
    isolation: isolate
}

/* ====== Background (Sharper + keep clouds visible bottom) ====== */
/* ลดความขุ่นของ glow/white overlay และดันจุดโฟกัสภาพให้คงใบหน้า+เมฆเสมอ */
/* True-color background: ไม่เปลี่ยนสีภาพ */
.bg {
    position: absolute;
    inset: 0;
    /* เก็บไว้แค่ไล่ขาวช่วงล่างบาง ๆ เพื่อให้เมฆ/ตัวอักษรอ่านง่าย */
    background:
        linear-gradient(to bottom,
            rgba(255, 255, 255, 0) 12%,
            rgba(255, 255, 255, .85) 88%,
            #fff 100%),
        url("assets/NawamindraMaharajDay.jpg") center var(--bg-pos, 10%) / cover no-repeat;

    /* ไม่มีฟิลเตอร์ใด ๆ เพื่อคง “สีจริง” ของไฟล์ */
    filter: none;
    transform: none;
    /* ไม่ซูม ไม่ดึงคอนทราสต์ */
    z-index: -2;
}

/* ถ้าอยากตัดเลเยอร์ไล่ขาวออกให้หมด (สีเดิมทั้งหน้า) ให้ใช้บล็อกนี้แทนด้านบน */
.bg.pure {
    background: url("assets/NawamindraMaharajDay.jpg") center var(--bg-pos, 10%) / cover no-repeat;
}

/* ปรับตำแหน่งภาพตามสัดส่วนจอให้หน้าอยู่กลางและเมฆอยู่ล่างเสมอ */
@media (max-aspect-ratio: 4/3) {

    /* มือถือแนวตั้ง/จอสูง */
    .bg {
        background-position: center 22%
    }
}

@media (max-aspect-ratio: 3/4) {

    /* จอสูงมาก ๆ */
    .bg {
        background-position: center 28%
    }
      :root {
          --bg-pos: 12%;
      }
    
      /* ขยับเฉพาะภาพ */
      .content.bottom {
          bottom: max(16px, 5svh);
      }
}

@media (min-aspect-ratio: 16/9) {

    /* จอกว้าง */
    .bg {
        background-position: center 10%
    }
}

/* เลเยอร์ละอองทอง (คงไว้แต่เบาลง) */
.gold-noise {
    position: absolute;
    inset: -20% -10% -10% -10%;
    background:
        radial-gradient(1200px 600px at 50% -10%, rgba(255, 214, 150, .40), transparent 72%),
        radial-gradient(900px 500px at 85% 10%, rgba(217, 185, 112, .28), transparent 62%),
        radial-gradient(700px 400px at 10% 20%, rgba(183, 138, 58, .20), transparent 62%);
    mix-blend-mode: screen;
    pointer-events: none;
    z-index: -1;
}

/* ====== Content: ยึดชิดล่างบนก้อนเมฆ ====== */
.content {
    width: min(1120px, 94%);
    text-align: center
}

.content.bottom {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: clamp(80px, 4.5svh, 20px);
    width: min(1120px, 94%);
    padding: clamp(18px, 2.8svh, 32px) clamp(16px, 4.6svw, 44px);
    text-align: center;
    z-index: 2;
}

@supports(padding:max(0px)) {
  .content.bottom{
    padding-bottom: max( clamp(18px,2.8svh,32px), env(safe-area-inset-bottom) );
  }
}

/* เพิ่มเงานุ่มใต้ข้อความให้ลอยจากพื้นหลังเมฆ */
.content.bottom::after {
    content: "";
    position: absolute;
    left: 50%;
    bottom: -20px;
    transform: translateX(-50%);
    width: 72%;
    height: 38px;
    background: radial-gradient(50% 100% at 50% 0%, rgba(0, 0, 0, .10), transparent 70%);
    filter: blur(6px);
    pointer-events: none;
}

/* ====== Typography (เพิ่มความอ่านง่ายบนพื้นหลัง) ====== */
.title {
    margin: 0 0 0;
    font-weight: 800;
    letter-spacing: .02em;
    font-size: clamp(32px, 5.2vw, 64px);
    color: var(--brown);
    text-shadow: 0 2px 0 rgba(255, 255, 255, .65), 0 6px 18px rgba(0, 0, 0, .10);
}

.subtitle {
    margin: 0 auto 1em;
    line-height: 1.50;
    font-size: clamp(16px, 2.2vw, 22px);
    color: #5a4633;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .55), 0 6px 16px rgba(0, 0, 0, .08);
}

.divider {
    width: 120px;
    height: 2px;
    margin: .6em auto 1.1em;
    background: linear-gradient(90deg, transparent, var(--gold-2), transparent)
}

.footer-note {
    margin: 0 auto 1.1em;
    font-size: clamp(14px, 1.9vw, 18px);
    color: #6b5742;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .5);
}

/* ====== CTA ====== */
.cta {
    display: inline-block;
    margin-top: .4em;
    padding: .5em 1.0em;
    font-size: clamp(15px, 2vw, 18px);
    font-weight: 700;
    color: #3a2a18;
    background: linear-gradient(180deg, var(--gold-0), #f0d197);
    border: 1px solid #d5b574;
    border-radius: 999px;
    box-shadow: inset 0 2px 0 rgba(255, 255, 255, .85), 0 6px 12px rgba(183, 138, 58, .30);
    text-decoration: none;
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease;
}

.cta:hover {
    transform: translateY(-2px);
    filter: saturate(1.05)
}

.cta:active {
    transform: translateY(0);
    box-shadow: 0 4px 10px rgba(183, 138, 58, .24)
}

.cta:focus-visible {
outline: 3px solid rgba(217, 185, 112, .95);
    outline-offset: 3px;
    box-shadow:
        inset 0 2px 0 rgba(255, 255, 255, .85),
        0 0 0 4px rgba(217, 185, 112, .28),
        0 6px 12px rgba(183, 138, 58, .30);
}

/* ====== Copyright ====== */
.copyright {
    position: absolute;
    left: 50%;
    transform: translateX(-50%);
    bottom: 10px;
    width: min(980px, 92%);
    text-align: center;
    font-size: 12.5px;
    color: #6f5a44;
    text-shadow: 0 1px 0 rgba(255, 255, 255, .6);
    pointer-events: none;
    z-index: 1;
}

/* ====== Responsive Tweaks ====== */
@media (max-width:1024px) {
    .content.bottom {
        width: min(900px, 94%)
    }
}

@media (max-width:560px) {
    .content.bottom {
        width: calc(100% - 20px);
        padding: 18px 16px;
        bottom: clamp(10px, 5svh, 28px)
    }

    .divider {
        width: 100px
    }
}

@media (max-width: 420px) {
    .title {
        letter-spacing: .01em;
        text-shadow: 0 1px 0 rgba(255, 255, 255, .6)
    }

    .subtitle {
        line-height: 1.75
    }
}

/* ====== Print ====== */
@media print {
    body {
        background: #fff
    }

    .hero {
        min-height: auto
    }

    .bg,
    .gold-noise {
        display: none
    }
}
/* เอฟเฟกต์ละอองทองลอยเบา ๆ */
.gold-dust {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: -1;
}

.gold-dust::before,
.gold-dust::after {
    content: "";
    position: absolute;
    width: 200%;
    height: 200%;
    top: -50%;
    left: -50%;
    background:
        radial-gradient(circle 2px, rgba(255, 220, 160, .7) 40%, transparent 42%) 0 0/80px 80px,
        radial-gradient(circle 1.5px, rgba(255, 240, 200, .5) 40%, transparent 42%) 40px 40px/90px 90px;
    animation: goldMove 40s linear infinite;
    opacity: .7;
}

.gold-dust::after {
    animation-duration: 55s;
    animation-direction: reverse;
    opacity: .5;
}

@keyframes goldMove {
    from {
        transform: translate3d(0, 0, 0) rotate(0deg);
    }

    to {
        transform: translate3d(0, 0, 0) rotate(360deg);
    }
}
.hero::before {
    content: "";
    position: absolute;
    top: -10%;
    left: 0;
    width: 100%;
    height: 60%;
    background: radial-gradient(circle at 50% 20%, rgba(255, 230, 170, .45), transparent 70%);
    opacity: 0.3;
    animation: glowPulse 8s ease-in-out infinite;
    pointer-events: none;
    z-index: -1;
}

@keyframes glowPulse {

    0%,
    100% {
        opacity: 0.3;
    }

    50% {
        opacity: 0.6;
    }
}
/* แทน .bg เดิมด้วย picture เพื่อคมกว่าและจัดวางง่าย */
.bg-media,
.bg-media img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center var(--bg-pos, 6%);
    z-index: -2;
}
/* ปิดอนิเมชันให้ผู้ใช้ที่ไม่ต้องการ motion */
@media (prefers-reduced-motion: reduce) {

    .gold-dust::before,
    .gold-dust::after,
    .hero::before {
        animation: none !important;
    }
}
/* กัน repaints: ระบุ will-change เฉพาะจุดที่ขยับจริง */
.gold-dust::before,
.gold-dust::after {
    will-change: transform;
}

.hero::before {
    will-change: opacity;
}
/* ทำให้ picture พื้นหลังโชว์แน่นอน ครอบเต็มจอ และอยู่หลังเนื้อหา */
.bg-media {
    position: fixed;
    inset: 0;
    z-index: -1;
}

.bg-media img,
.bg-media source {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ถ้ามี overlay หรือเอฟเฟกต์ ให้แน่ใจว่าอยู่เหนือพื้นหลังแต่ใต้ content */
.gold-noise,
.gold-dust {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.content,
.copyright {
    position: relative;
    z-index: 1;
}