/* แบนเนอร์เทศกาล (banners.js) ใช้ทั้งหน้าเว็บและหลังบ้าน
   ขนาดตามกล่องที่ครอบ ตัวอักษรย่อ/ขยายตามความกว้างกล่องด้วย container query */
.bn {
  --bn-ink: #fff; --bn-sub: rgba(255, 255, 255, .82); --bn-accent: #e9cf9b;
  position: relative; overflow: hidden; isolation: isolate;
  width: 100%; height: 100%;
  container-type: inline-size;
  color: var(--bn-ink);
  font-family: var(--f-body, 'Noto Sans Thai', system-ui, sans-serif);
  background: #1a2421;
}
.bn-art, .bn-veil, .bn-img { position: absolute; inset: 0; }
.bn-art { z-index: 0; overflow: hidden; }
.bn-img { width: 100%; height: 100%; object-fit: cover; z-index: 0; }
.bn-veil { z-index: 1; pointer-events: none; background: linear-gradient(90deg, rgba(8, 12, 11, .72) 0%, rgba(8, 12, 11, .35) 45%, rgba(8, 12, 11, 0) 75%); }
.bn--plain .bn-veil { display: none; }
.bn-copy { position: relative; z-index: 2; height: 100%; display: flex; flex-direction: column; justify-content: center; align-items: flex-start; gap: 2.2cqi; padding: 0 7cqi; max-width: 62cqi; }
.bn-badge { display: inline-flex; align-items: center; gap: .6em; padding: .55em 1.2em; border: 1px solid currentColor; border-radius: 999px; color: var(--bn-accent); font: 500 clamp(10px, 1.25cqi, 14px)/1 var(--f-latin, 'Cormorant Garamond', serif); letter-spacing: .22em; text-transform: uppercase; }
.bn-title { margin: 0; font: 500 clamp(22px, 5.2cqi, 66px)/1.15 var(--f-display, 'Noto Serif Thai', serif); letter-spacing: -.01em; text-wrap: balance; }
.bn-sub { margin: 0; color: var(--bn-sub); font-size: clamp(12px, 1.6cqi, 19px); line-height: 1.6; max-width: 44cqi; }
.bn-cta { display: inline-flex; align-items: center; gap: .7em; margin-top: 1cqi; padding: .95em 1.6em; border-radius: 999px; background: var(--bn-ink); color: #111; font-size: clamp(12px, 1.3cqi, 15px); font-weight: 500; text-decoration: none; transition: gap .4s, transform .4s; }
.bn-cta svg { width: 1.2em; height: 1.2em; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.bn-cta:hover { gap: 1.1em; }
@container (max-width: 520px) {
  .bn-copy { max-width: 100%; padding: 0 6cqi; gap: 3cqi; justify-content: flex-end; padding-bottom: 9cqi; }
  .bn-title { font-size: clamp(22px, 8cqi, 40px); }
  .bn-sub { font-size: clamp(12px, 3.6cqi, 15px); max-width: 100%; }
  .bn-badge { font-size: 10px; }
  .bn-cta { font-size: 13px; }
  .bn-veil { background: linear-gradient(0deg, rgba(8, 12, 11, .82) 0%, rgba(8, 12, 11, .3) 60%, rgba(8, 12, 11, 0) 100%); }
}

/* ภูเขา 3 ชั้น */
.bn-ridges { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 62%; }

/* ---- ทะเลหมอก ---- */
.bn--mist { background: linear-gradient(180deg, #1c2a3a 0%, #4b5a6a 38%, #c79a72 72%, #f0c999 100%); }
.bn--mist .bn-sun { position: absolute; right: 22%; bottom: 34%; width: 13cqi; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle, #fff3d6 0%, #ffd79a 45%, rgba(255, 196, 120, 0) 72%); filter: blur(1px); animation: bnRise 9s ease-in-out infinite alternate; }
.bn--mist .r1 { fill: #39475a; } .bn--mist .r2 { fill: #26323f; } .bn--mist .r3 { fill: #16201b; }
.bn-fog { position: absolute; left: -50%; width: 200%; height: 24%; border-radius: 50%; background: radial-gradient(closest-side, rgba(255, 255, 255, .55), rgba(255, 255, 255, 0)); filter: blur(10px); animation: bnDrift 28s linear infinite; }
.bn-fog.f1 { bottom: 26%; opacity: .7; }
.bn-fog.f2 { bottom: 12%; opacity: .55; animation-duration: 40s; animation-direction: reverse; }
.bn-fog.f3 { bottom: -4%; opacity: .8; height: 30%; animation-duration: 34s; }

/* ---- ปีใหม่ ---- */
.bn--newyear { --bn-accent: #f3d48a; background: radial-gradient(120% 90% at 80% 10%, #263257 0%, #0f1530 55%, #070a18 100%); }
.bn--newyear .bn-fireworks { position: absolute; inset: 0; width: 100%; height: 100%; }
.bn-burst { stroke: #f3d48a; fill: #fff1c8; stroke-width: 2; stroke-linecap: round; transform-box: view-box; transform-origin: 0 0; animation: bnBurst 3.4s var(--d, 0s) ease-out infinite; opacity: 0; }
.bn-burst:nth-child(2) { stroke: #f7b7c8; fill: #ffd7e2; }
.bn-burst:nth-child(3) { stroke: #a9d7ff; fill: #dff0ff; }
.bn-stars { position: absolute; inset: 0; background-image: radial-gradient(1.4px 1.4px at 12% 20%, #fff, transparent), radial-gradient(1px 1px at 30% 60%, #fff, transparent), radial-gradient(1.2px 1.2px at 48% 12%, #fff, transparent), radial-gradient(1px 1px at 66% 40%, #fff, transparent), radial-gradient(1.5px 1.5px at 88% 30%, #fff, transparent), radial-gradient(1px 1px at 22% 85%, #fff, transparent); opacity: .7; animation: bnTwinkle 4s ease-in-out infinite alternate; }
.bn--newyear .r1 { fill: #1b2240; } .bn--newyear .r2 { fill: #131930; } .bn--newyear .r3 { fill: #0a0e1e; }

/* ---- คริสต์มาส ---- */
.bn--xmas { --bn-accent: #f0d79c; background: radial-gradient(100% 120% at 85% 0%, #2c5546 0%, #143027 50%, #0b1c17 100%); }
.bn-pines { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 70%; fill: #0a1813; }
.bn-snow { position: absolute; inset: -100% 0 0; background-image: radial-gradient(2px 2px at 10% 10%, #fff, transparent), radial-gradient(1.5px 1.5px at 25% 30%, #fff, transparent), radial-gradient(2.5px 2.5px at 40% 15%, #fff, transparent), radial-gradient(1.5px 1.5px at 55% 40%, #fff, transparent), radial-gradient(2px 2px at 70% 22%, #fff, transparent), radial-gradient(1.5px 1.5px at 85% 35%, #fff, transparent), radial-gradient(2px 2px at 95% 8%, #fff, transparent); background-size: 100% 50%; animation: bnSnow 14s linear infinite; opacity: .85; }
.bn-snow.s2 { background-size: 70% 40%; animation-duration: 22s; opacity: .5; }
.bn-star { position: absolute; right: 25%; top: 14%; width: 3cqi; aspect-ratio: 1; background: #ffe7a8; clip-path: polygon(50% 0, 61% 38%, 100% 50%, 61% 62%, 50% 100%, 39% 62%, 0 50%, 39% 38%); filter: drop-shadow(0 0 14px #ffd36b); animation: bnTwinkle 2.6s ease-in-out infinite alternate; }

/* ---- สงกรานต์ ---- */
.bn--songkran { --bn-accent: #fff5c6; background: linear-gradient(120deg, #0b6f86 0%, #13a3b4 45%, #6fd6d1 100%); }
.bn--songkran .bn-veil { background: linear-gradient(90deg, rgba(4, 50, 62, .6) 0%, rgba(4, 50, 62, .2) 50%, rgba(4, 50, 62, 0) 75%); }
.bn-ripple { position: absolute; right: 18%; top: 50%; width: 30cqi; aspect-ratio: 1; border-radius: 50%; border: 1.5px solid rgba(255, 255, 255, .5); transform: translate(50%, -50%) scale(.2); animation: bnRipple 5s ease-out infinite; }
.bn-ripple.r2 { animation-delay: 1.6s; } .bn-ripple.r3 { animation-delay: 3.2s; }
.bn-flowers { position: absolute; inset: 0; width: 100%; height: 100%; }
.bn-flower { fill: #fffaf0; } .bn-flower .c { fill: #ffd25a; }
.bn-flower { animation: bnSway 6s ease-in-out infinite alternate; transform-box: fill-box; transform-origin: center; }
.bn-drop { position: absolute; left: var(--l); top: -10%; width: calc(8px * var(--s)); height: calc(14px * var(--s)); border-radius: 50% 50% 50% 50% / 60% 60% 40% 40%; background: rgba(255, 255, 255, .75); animation: bnFall 2.6s var(--t) linear infinite; }

/* ---- ลอยกระทง ---- */
.bn--loykrathong { --bn-accent: #ffe1a6; background: linear-gradient(180deg, #0b1230 0%, #1a2350 55%, #0a1026 100%); }
.bn-moon { position: absolute; right: 18%; top: 12%; width: 15cqi; aspect-ratio: 1; border-radius: 50%; background: radial-gradient(circle at 40% 40%, #fffbea, #f4e2b0 60%, #d9c18a); box-shadow: 0 0 60px 20px rgba(255, 233, 170, .25); }
.bn-river { position: absolute; left: 0; right: 0; bottom: 0; height: 40%; background: linear-gradient(180deg, rgba(40, 60, 120, .6), rgba(8, 12, 34, .95)); }
.bn-river::before { content: ''; position: absolute; right: 21%; top: 0; width: 9cqi; height: 100%; background: repeating-linear-gradient(180deg, rgba(255, 233, 170, .5) 0 3px, transparent 3px 11px); filter: blur(1px); opacity: .6; }
.bn-lamp { position: absolute; left: var(--l); bottom: var(--b); width: 14px; height: 10px; border-radius: 0 0 8px 8px; background: #3f6b3c; animation: bnBob 4s var(--t) ease-in-out infinite; }
.bn-lamp::after { content: ''; position: absolute; left: 50%; top: -9px; width: 6px; height: 9px; border-radius: 50% 50% 40% 40%; transform: translateX(-50%); background: #ffd27a; box-shadow: 0 0 14px 5px rgba(255, 190, 90, .55); animation: bnTwinkle 1.4s ease-in-out infinite alternate; }

/* ---- ตรุษจีน ---- */
.bn--cny { --bn-accent: #ffd88a; background: radial-gradient(120% 100% at 80% 20%, #c8202b 0%, #8e0f18 55%, #5a070d 100%); }
.bn-coins { position: absolute; inset: 0; opacity: .14; background-image: radial-gradient(circle, transparent 9px, #ffd88a 10px, #ffd88a 11px, transparent 12px); background-size: 46px 46px; }
.bn-lanterns { position: absolute; inset: 0; width: 100%; height: 100%; }
.bn-lantern { animation: bnSwing 4s var(--d) ease-in-out infinite alternate; transform-box: fill-box; transform-origin: 50% 0; }
.bn-lantern line, .bn-lantern .tassel { stroke: #ffd88a; stroke-width: 2; }
.bn-lantern ellipse { fill: #e2262f; stroke: #ffd88a; stroke-width: 2; filter: drop-shadow(0 0 18px rgba(255, 120, 60, .5)); }
.bn-lantern .cap { fill: #ffd88a; }
.bn-lantern .rib { fill: none; stroke: #ffd88a; stroke-width: 1.4; opacity: .8; }

/* ---- วาเลนไทน์ ---- */
.bn--valentine { --bn-accent: #ffd0dc; background: linear-gradient(120deg, #3a0d1f 0%, #7a1c3b 50%, #c2476b 100%); }
.bn-glow { position: absolute; right: 12%; top: 50%; width: 40cqi; aspect-ratio: 1; border-radius: 50%; transform: translateY(-50%); background: radial-gradient(closest-side, rgba(255, 170, 200, .45), transparent); }
.bn-heart { position: absolute; left: var(--l); bottom: -12%; width: calc(26px * var(--s)); aspect-ratio: 1; background: #ff9fbc; opacity: .8; clip-path: path('M13 24C5 17 0 12.5 0 7.3 0 3.2 3.2 0 7.2 0c2.4 0 4.6 1.2 5.8 3.1C14.2 1.2 16.4 0 18.8 0 22.8 0 26 3.2 26 7.3 26 12.5 21 17 13 24z'); animation: bnFloat 7s var(--t) ease-in infinite; }

/* ---- โปรโมชัน ---- */
.bn--promo { --bn-ink: #1d1a14; --bn-sub: #5b5446; --bn-accent: #8c6a36; background: linear-gradient(120deg, #f6efe2 0%, #eadcc1 55%, #d9c29a 100%); }
.bn--promo .bn-veil { display: none; }
.bn--promo .bn-cta { background: #1d1a14; color: #f6efe2; }
.bn-arc { position: absolute; right: -8cqi; top: 50%; aspect-ratio: 1; border-radius: 50%; border: 1px solid rgba(140, 106, 54, .45); transform: translateY(-50%); animation: bnSpin 60s linear infinite; }
.bn-arc.a1 { width: 56cqi; border-style: dashed; }
.bn-arc.a2 { width: 42cqi; right: -1cqi; animation-direction: reverse; border-color: rgba(140, 106, 54, .3); }
.bn-arc.a3 { width: 28cqi; right: 6cqi; background: radial-gradient(circle at 35% 30%, #fff7e6, #e2cda4); border: 0; box-shadow: 0 30px 60px -20px rgba(120, 90, 40, .4); animation: none; }
.bn-shine { position: absolute; inset: 0; background: linear-gradient(105deg, transparent 35%, rgba(255, 255, 255, .5) 50%, transparent 65%); transform: translateX(-100%); animation: bnShine 5s ease-in-out infinite; }

/* ---- รูปที่อัปโหลด ---- */
.bn--image .bn-img { animation: bnKen 18s ease-in-out infinite alternate; }

@keyframes bnRise { from { transform: translateY(12%); } to { transform: translateY(-8%); } }
@keyframes bnDrift { from { transform: translateX(0); } to { transform: translateX(25%); } }
@keyframes bnBurst { 0% { opacity: 0; transform: translate(var(--x), var(--y)) scale(calc(var(--s) * .1)); } 15% { opacity: 1; } 60% { opacity: .9; } 100% { opacity: 0; transform: translate(var(--x), calc(var(--y) + 20px)) scale(calc(var(--s) * 1.2)); } }
@keyframes bnTwinkle { from { opacity: .35; } to { opacity: 1; } }
@keyframes bnSnow { from { transform: translateY(0); } to { transform: translateY(50%); } }
@keyframes bnRipple { to { transform: translate(50%, -50%) scale(1.6); opacity: 0; } }
@keyframes bnSway { from { transform: rotate(-6deg); } to { transform: rotate(8deg); } }
@keyframes bnFall { from { transform: translateY(0); opacity: 0; } 15% { opacity: .9; } to { transform: translateY(1200%); opacity: 0; } }
@keyframes bnBob { 0%, 100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(-4px) rotate(3deg); } }
@keyframes bnSwing { from { transform: rotate(-3deg); } to { transform: rotate(3deg); } }
@keyframes bnFloat { 0% { transform: translateY(0) rotate(-10deg); opacity: 0; } 15% { opacity: .85; } 100% { transform: translateY(-1400%) rotate(14deg); opacity: 0; } }
@keyframes bnSpin { to { transform: translateY(-50%) rotate(360deg); } }
@keyframes bnShine { 0%, 40% { transform: translateX(-100%); } 70%, 100% { transform: translateX(100%); } }
@keyframes bnKen { from { transform: scale(1.02); } to { transform: scale(1.12) translate(-1.5%, -1%); } }

@media (prefers-reduced-motion: reduce) {
  .bn *, .bn *::before, .bn *::after { animation: none !important; }
  .bn-burst { opacity: 1; transform: translate(var(--x), var(--y)) scale(var(--s)); }
}
