/* =========================================================
   AMULET REAL VALUE
   Main Stylesheet
   ========================================================= */


/* =========================================================
   1. CSS VARIABLES
   ========================================================= */

:root {
  --navy: #0f1b33;
  --navy2: #16264a;

  --gold: #c8963e;
  --gold1: #ffff;
  --gold2: #e0b265;
  --gold-ink: #7a5200; /* ทองเข้ม: ใช้กับตัวอักษร/ไอคอนบนพื้นสว่าง (คอนทราสต์ 5.8:1) */

  --bg: #ecebe8;
  --card: #f6f5f2;

  --ink: #1b2438;
  --mute: #596176;
  --line: #dedbd3;

  --r: 12px;
}


/* =========================================================
   2. RESET / BASE
   ========================================================= */

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  font-family: Prompt, "Noto Sans Thai", Tahoma, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.6;
  font-size: 15px;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
input,
select,
textarea {
  font: inherit;
  color: inherit;
}


/* =========================================================
   3. COMMON LAYOUT
   ========================================================= */

.wrap {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 20px;
}

main {
  min-height: 60vh;
}

.sec {
  padding-top: 34px;
  padding-bottom: 34px;
}


/* =========================================================
   4. HEADER / NAVIGATION
   ========================================================= */

header {
  background: var(--navy);
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid #ffffff14;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  height: 68px;
}

/* โลโก้ */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gold2);
  font-weight: 600;
  letter-spacing: 0.06em;
  font-size: 20px;
  line-height: 1.1;
}
.logo-img {
  width: 48px;
  height: 48px;
  object-fit: contain;
  display: block;
}

.logo small {
  display: block;
  font-size: 9px;
  letter-spacing: 0.08em;
  color: #cfd6e6;
  font-weight: 400;
}

.logo i {
  font-style: normal;
  font-size: 30px;
}

/* เมนูหลัก */
.menu {
  display: flex;
  gap: 6px;
  flex: 1;
  margin-left: 20px;
}

.menu a {
  color: #fff;
  padding: 22px 14px;
  font-weight: 500;
  border-bottom: 2px solid transparent;
}

.menu a.on {
  color: var(--gold2);
  border-color: var(--gold);
}

/* ปุ่มเข้าสู่ระบบ */
.login {
  border: 1px solid var(--gold);
  color: var(--gold2);
  padding: 8px 18px;
  border-radius: 8px;
  background: none;
  cursor: pointer;
}

/* ปุ่มเมนูมือถือ */
.burger {
  display: none;
  background: none;
  border: 0;
  color: #fff;
  font-size: 26px;
  cursor: pointer;
}


/* =========================================================
   5. HERO SECTION
   ========================================================= */

.hero {
  background:
    radial-gradient(
      circle at 80% 40%,
      #3b3020 0,
      #14213d 45%,
      var(--navy) 80%
    );
  color: #fff;
  position: relative;
  overflow: hidden;
}

.hero .wrap {
  padding-top: 56px;
  padding-bottom: 56px;
  position: relative;
  min-height: 190px;
}

.hero h1 {
  font-size: 40px;
  color: var(--gold2);
  line-height: 1.25;
  font-weight: 600;
}

.hero h2 {
  font-size: 20px;
  font-weight: 500;
  margin-top: 8px;
}

.hero p {
  color: #d5dbea;
  margin-top: 10px;
  max-width: 520px;
}

/* Hero ขนาดใหญ่ */
.hero.big .wrap {
  padding-top: 90px;
  padding-bottom: 90px;
}

.hero.big h1 {
  font-size: 46px;
}

/* เส้นสีทอง */
.hero .gold {
  width: 40px;
  height: 2px;
  background: var(--gold);
  margin: 14px 0;
}


/* =========================================================
   6. HERO AMULET / DECORATION
   ========================================================= */

/* พระเครื่องในแบนเนอร์: เรียงเป็นพัด 1-3 รูป + สไลด์สลับเป็นชุด (ควบคุมด้วย js/banner.js)
   --bh = ความสูงภาพ  |  --fw = ตัวคูณความกว้างพัด (JS ตั้งให้ตามจำนวนรูป)
   ตัวแปรอยู่ที่ .hero เพื่อให้หัวข้อเว้นที่ให้ภาพได้ */
.hero {
  --bh: 230px;
  --fw: 1;
}

.hero.big {
  --bh: 330px;
}

/* หน้าย่อย: แบนเนอร์เตี้ยกว่า จึงใช้ภาพเล็กลงเพื่อให้เหลือที่ให้จุดเลือกชุด */
.hero:not(.big) {
  --bh: 205px;
}

.hero:not(.big) .ha-dots {
  top: 100%;
}

.hero-amulet {
  position: absolute;
  right: 4%;
  top: 50%;
  transform: translateY(-50%);
  width: calc(var(--bh) * var(--fw));
  height: var(--bh);
  pointer-events: none;
}

.ha-set {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(0.96);
  transition: opacity 0.7s ease, transform 0.7s ease, visibility 0.7s;
}

.ha-set.on {
  opacity: 1;
  visibility: visible;
  transform: none;
}

.ha {
  position: absolute;
  left: 50%;
  top: 0;
  height: 100%;
  width: auto;
  display: block;
  transform-origin: 50% 90%;
  transform: translateX(calc(-50% + var(--ha-dx, 0) * var(--bh))) rotate(var(--ha-r, 0deg));
  filter: drop-shadow(0 16px 26px rgba(0, 0, 0, 0.55));
}

/* รูปหน้าสุด (ภาพที่ 1) */
.ha.p0 { z-index: 3; }
.ha-set.on .p0 { animation: amuletFloat 6s ease-in-out infinite; }

/* รูปที่ 2 / 3 = ด้านหลังซ้าย / ขวา */
.ha.p1,
.ha.p2 {
  top: 7%;
  height: 90%;
  filter: brightness(0.8) drop-shadow(0 16px 26px rgba(0, 0, 0, 0.55));
}

.ha.p1 { z-index: 1; }
.ha.p2 { z-index: 2; }

/* 1 รูป */
.n1 .p0 { --ha-dx: 0; }

/* 2 รูป: หน้าอยู่ขวา หลังเอียงซ้าย */
.n2 .p0 { --ha-dx: 0.17; }
.n2 .p1 { --ha-dx: -0.2; --ha-r: -9deg; }

/* 3 รูป: หน้ากลาง หลังกางสองข้าง */
.n3 .p0 { --ha-dx: 0; }
.n3 .p1 { --ha-dx: -0.36; --ha-r: -12deg; height: 88%; top: 8%; }
.n3 .p2 { --ha-dx: 0.36; --ha-r: 12deg; height: 88%; top: 8%; }

@keyframes amuletFloat {
  50% { translate: 0 -6px; }
}

/* จุดเลือกชุด */
.ha-dots {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 8px);
  display: flex;
  justify-content: center;
  gap: 4px;
  pointer-events: auto;
}

.ha-dots button {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  display: grid;
  place-items: center;
}

.ha-dots button::before {
  content: "";
  width: 8px;
  height: 8px;
  border-radius: 99px;
  background: #ffffff55;
  transition: width 0.3s, background 0.3s;
}

.ha-dots button.on::before {
  width: 22px;
  background: var(--gold2);
}

.ha-dots button:focus-visible {
  outline: 2px solid var(--gold2);
  outline-offset: -2px;
  border-radius: 6px;
}

@media (prefers-reduced-motion: reduce) {
  .ha-set { transition: none; }
  .ha-set.on .p0 { animation: none; }
}

/* เว้นที่ให้พระเครื่อง ไม่ให้ข้อความชนกับภาพ */
@media (min-width: 601px) {
  .hero h1,
  .hero h2 { max-width: calc(100% - var(--bh) * var(--fw) - 50px); }
  .hero p   { max-width: min(520px, calc(100% - var(--bh) * var(--fw) - 50px)); }
}


/* =========================================================
   7. BUTTONS
   ========================================================= */

.btn {
  display: inline-block;
  background: var(--gold);
  color: #1b1405;
  padding: 10px 22px;
  border-radius: 8px;
  font-weight: 500;
  border: 0;
  cursor: pointer;
  margin-top: 18px;
}

.btn.dark {
  background: var(--navy);
  color: #fff;
  margin: 0;
}


/* =========================================================
   8. TYPOGRAPHY / TITLES
   ========================================================= */

h3.t {
  font-size: 20px;
  font-weight: 600;
  margin-bottom: 16px;
}

h3.t::after {
  content: "";
  display: block;
  width: 26px;
  height: 2px;
  background: var(--gold);
  margin-top: 6px;
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 6px;
}

.row a {
  color: var(--gold-ink);
  font-size: 13px;
}


/* =========================================================
   9. CARDS / GRID
   ========================================================= */

.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--r);
  padding: 18px;
}

.grid {
  display: grid;
  gap: 16px;
}

.g4 {
  grid-template-columns: repeat(4, 1fr);
}

.g6 {
  grid-template-columns: repeat(6, 1fr);
}

.g2 {
  grid-template-columns: 1fr 1fr;
}


/* =========================================================
   10. PLATFORM CARDS
   ========================================================= */

.pl {
  text-align: center;
  transition: 0.15s;
}

.pl:hover {
  border-color: var(--gold);
  transform: translateY(-2px);
}

.pl .ic {
  margin: 0 auto 10px;
}

.pl b {
  display: block;
}

.pl small {
  color: var(--mute);
  font-size: 12px;
  display: block;
  margin: 4px 0 8px;
}

.tag {
  display: inline-block;
  font-size: 11px;
  background: #e9dfc8;
  color: #7a5a24;
  padding: 1px 9px;
  border-radius: 5px;
}


/* =========================================================
   11. PLATFORM DETAIL CARD
   ========================================================= */

.pcard {
  display: grid;
  gap: 8px;
}

.pcard .top {
  display: flex;
  gap: 14px;
  align-items: flex-start;
}

.pcard h4 {
  font-size: 17px;
}

.pcard p {
  color: var(--mute);
  font-size: 13px;
}

.go {
  display: flex;
  justify-content: space-between;
  align-items: center;

  background: var(--navy);
  color: var(--gold2);

  padding: 9px 14px;
  border-radius: 8px;
  font-size: 13px;
}

.go svg {
  flex: none;
}


/* =========================================================
   12. ICONS
   ========================================================= */

.i {
  display: inline-block;
  vertical-align: -0.18em;
  flex: none;
}

.ic {
  width: 60px;
  height: 60px;

  border-radius: 50%;

  display: grid;
  place-items: center;

  font-size: 28px;
  color: #fff;
  flex: none;

  background-image:
    linear-gradient(
      145deg,
      #ffffff38,
      #0000 55%
    );

  box-shadow:
    0 6px 16px -6px #0007,
    inset 0 0 0 1.5px #ffffff33;
}

.ic svg {
  width: 52%;
  height: 52%;
}


/* =========================================================
   13. NEWS
   ========================================================= */

.news {
  display: flex;
  gap: 14px;
}

.thumb {
  width: 150px;
  min-height: 110px;

  border-radius: 10px;

  background:
    radial-gradient(
      circle at 28% 18%,
      #8a6727,
      #16264a 72%
    );

  display: grid;
  place-items: center;

  font-size: 42px;
  flex: none;
  position: relative;
  color: #fff;
}

.thumb svg {
  width: 44px;
  height: 44px;
  color: var(--gold2);
}

.live {
  position: absolute;
  left: 6px;
  top: 6px;

  background: #d62b2b;
  font-size: 11px;
  padding: 0 7px;
  border-radius: 4px;
}

.news h4 {
  font-size: 16px;
  margin: 4px 0;
}

.news p,
.meta {
  font-size: 12.5px;
  color: var(--mute);
}


/* =========================================================
   14. LAYOUT / SIDEBAR
   ========================================================= */

.layout {
  display: grid;
  grid-template-columns: 250px 1fr;
  gap: 22px;
  align-items: start;
}

.layout > *,
.grid > * {
  min-width: 0;
}

.side button {
  display: flex;
  justify-content: space-between;

  width: 100%;

  border: 0;
  background: none;

  padding: 9px 12px;
  border-radius: 8px;

  cursor: pointer;
  text-align: left;
}

.side button.on {
  background: var(--gold);
  color: #1b1405;
}

.side button span {
  font-size: 12px;
  opacity: 0.8;
}


/* =========================================================
   15. SEARCH / TOOLS / FORMS
   ========================================================= */

.tools {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.tools input,
.tools select,
.f input,
.f select,
.f textarea {
  padding: 10px 12px;

  border: 1px solid var(--line);
  border-radius: 8px;

  background: var(--card);
  width: 100%;
}

.tools input {
  flex: 1;
}

.tools select {
  width: auto;
}

.f {
  display: grid;
  gap: 12px;
}

.f .two {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
}


/* =========================================================
   16. STATISTICS
   ========================================================= */

.stats {
  background: var(--navy);
  color: #fff;

  border-radius: var(--r);
  padding: 20px;

  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.stats b {
  font-size: 28px;
  color: #fff;
  display: block;
  line-height: 1.2;
}

.stats span {
  font-size: 12px;
  color: #aab4cc;
}

.stats em {
  font-style: normal;
  color: var(--gold2);
  font-size: 12px;
}


/* =========================================================
   17. EVENTS
   ========================================================= */

.ev {
  display: flex;
  gap: 14px;
  align-items: center;

  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}

.ev:last-child {
  border: 0;
}

.date {
  background: var(--bg);
  border-radius: 8px;

  text-align: center;

  padding: 4px 10px;
  min-width: 62px;

  line-height: 1.25;
}

.date b {
  font-size: 24px;
  display: block;
}

.date small {
  font-size: 11px;
}


/* =========================================================
   18. FAQ
   ========================================================= */

.faq details {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 8px;
  margin-bottom: 8px;
}

.faq summary {
  padding: 14px 16px;
  cursor: pointer;

  font-weight: 500;
  list-style: none;

  display: flex;
  justify-content: space-between;
}

.faq summary::after {
  content: "⌄";
}

.faq details[open] summary::after {
  content: "⌃";
}

.faq details p {
  padding: 0 16px 14px;
  color: var(--mute);
}


/* =========================================================
   19. CONTACT
   ========================================================= */

.chan {
  display: flex;
  align-items: center;
  gap: 14px;

  padding: 12px 14px;
  margin-bottom: 10px;
}

#chan.grid .chan {
  margin-bottom: 0;
}

.chan .ic {
  width: 44px;
  height: 44px;
  font-size: 20px;
}

.chan div {
  flex: 1;
}

.chan small {
  color: var(--mute);
  display: block;
  font-size: 12px;
}

.chan .cn {
  width: 110px;
}

.soc {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.soc a {
  width: 34px;
  height: 34px;

  border: 1px solid var(--gold);
  border-radius: 50%;

  display: grid;
  place-items: center;

  color: var(--gold2);
}


/* =========================================================
   20. FORM STATUS / MAP
   ========================================================= */

.ok {
  background: #e3f1e3;
  border: 1px solid #9cc79c;

  padding: 12px;
  border-radius: 8px;
  margin-top: 10px;

  display: flex;
  gap: 8px;
  align-items: center;
}

.ok svg {
  color: #2f7d32;
  flex: none;
}

/* ======================================
   แผนที่ Google Maps
   ====================================== */

.map {
    margin-left: 20px;
}

.map iframe {
    display: block;
    width: 100%;
    max-width: 800px;
    height: 200px;
    border: 0;
}


/* =========================================================
   21. TRUST / SECURITY
   ========================================================= */

.trust {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;

  background: #f1ebdd;
  border: 1px solid var(--line);
  border-radius: var(--r);

  padding: 16px;
  margin-top: 24px;
}

.trust > div {
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.trust small {
  color: var(--mute);
  display: block;
}

.trust svg {
  color: var(--gold);
  flex: none;
}

.trust.one {
  grid-template-columns: 1fr;
}


/* =========================================================
   22. ABOUT
   ========================================================= */

.about {
  display: flex;
  gap: 24px;
  align-items: center;
}

.about .thumb {
  width: 260px;
  min-height: 200px;
  overflow: hidden;
  align-self: stretch;
}

.about .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 48%;
}

.about .thumb svg {
  width: 68px;
  height: 68px;
}


/* =========================================================
   23. SUBSCRIBE
   ========================================================= */

.sub {
  background: var(--navy);
  color: #fff;

  border-radius: var(--r);
  padding: 18px 22px;

  display: flex;
  gap: 14px;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;

  margin-top: 20px;
}

.sub form {
  display: flex;
  gap: 8px;
}

.sub input {
  padding: 9px 12px;
  border-radius: 8px;
  border: 0;
  min-width: 220px;
}


/* =========================================================
   24. FOOTER
   ========================================================= */

footer {
  background: var(--navy);
  color: #cfd6e6;

  margin-top: 30px;
  padding: 36px 0 14px;

  font-size: 13px;
}

.fg {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1.3fr;
  gap: 24px;
}

footer h5 {
  color: var(--gold2);
  font-size: 14px;
  margin-bottom: 10px;
}

footer li {
  list-style: none;
  margin: 5px 0;
}

footer a:hover {
  color: var(--gold2);
}

.copy {
  border-top: 1px solid #ffffff1c;

  margin-top: 22px;
  padding-top: 12px;

  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 8px;

  font-size: 12px;
}


/* =========================================================
   25. UTILITY CLASSES
   ========================================================= */

.mi {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-right: 12px;
}

.st {
  display: flex;
  gap: 12px;
  align-items: center;
}

.st > svg {
  color: var(--gold2);
  width: 32px;
  height: 32px;
}

.fc li {
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.fc svg {
  color: var(--gold2);
  margin-top: 3px;
}

.link {
  background: none;
  border: 0;
  color: var(--gold-ink);
  cursor: pointer;
  text-align: left;
  padding: 0;
  font-size: 13px;
}

.mlogin {
  display: none;
}


/* =========================================================
   26. FOCUS / ACCESSIBILITY
   ========================================================= */

:focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 2px;
}


/* =========================================================
   27. CALENDAR
   ========================================================= */

.calcard {
  padding: 18px;
}

.calh {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.calh .ct {
  flex: 1;
  text-align: center;
  line-height: 1.3;
}

.calh .ct b {
  display: block;
  font-size: 17px;
}

.calh .ct small {
  color: var(--mute);
  font-size: 12px;
}

.calh button {
  width: 38px;
  height: 38px;

  border: 1px solid var(--line);
  background: var(--bg);
  border-radius: 10px;

  cursor: pointer;
  display: grid;
  place-items: center;

  flex: none;
  transition: 0.15s;
}

.calh button:hover {
  border-color: var(--gold-ink);
  color: var(--gold);
}

.cal {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;

  text-align: center;
}

.cal .h {
  font-size: 12px;
  color: var(--mute);
  padding: 4px 0 6px;
}

.cal .h:first-child {
  color: #c0392b;
}

.cal .d {
  position: relative;

  aspect-ratio: 1;

  display: grid;
  place-items: center;

  border-radius: 10px;
  font-size: 14px;

  border: 0;
  background: none;
  padding: 0;

  color: var(--ink);
}

.cal .d.sun {
  color: #c0392b;
}

.cal button.has {
  background: var(--gold);
  color: #1b1405;
  font-weight: 600;
  cursor: pointer;
  transition: 0.15s;
}

.cal button.has:hover {
  background: var(--gold2);
}

.cal button.has.sel {
  background: var(--navy);
  color: var(--gold2);

  box-shadow: 0 0 0 2px var(--gold);
}

.cal .d.today {
  box-shadow: inset 0 0 0 2px var(--navy);
}

.cal .d.has.today {
  box-shadow: inset 0 0 0 2px var(--navy);
}

.cal .d.lv::after {
  content: "";

  position: absolute;
  top: 4px;
  right: 4px;

  width: 7px;
  height: 7px;

  border-radius: 50%;
  background: #d62b2b;

  box-shadow: 0 0 0 2px var(--gold);
}

.cal .d.has.sel.lv::after {
  box-shadow: 0 0 0 2px var(--navy);
}


/* =========================================================
   28. CALENDAR FOOTER / LEGEND
   ========================================================= */

.calf {
  display: flex;
  justify-content: space-between;
  align-items: center;

  gap: 8px;
  flex-wrap: wrap;

  margin-top: 14px;
  padding-top: 12px;

  border-top: 1px solid var(--line);

  font-size: 12px;
  color: var(--mute);
}

.lg {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.lg span {
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.lg i {
  width: 10px;
  height: 10px;

  border-radius: 3px;
  background: var(--gold);
}

.lg i.t {
  background: none;
  box-shadow: inset 0 0 0 2px var(--navy);
}

.lg i.l {
  background: #d62b2b;
  border-radius: 50%;
}


/* =========================================================
   29. EVENTS PAGE
   ========================================================= */

.layout.evp {
  display: grid;

  grid-template-columns:
    minmax(0, 1.5fr)
    minmax(300px, 1fr);

  grid-template-areas: "list cal";

  grid-template-rows: auto;

  gap: 22px 28px;
}

.evp .a-list {
  grid-area: list;
}

.evp .a-cal {
  grid-area: cal;
  align-self: start;
}

.esub {
  display: flex;
  align-items: center;
  gap: 8px;

  min-height: 30px;
  margin: -6px 0 14px;

  font-size: 13px;
  color: var(--mute);
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;

  background: #f1ebdd;
  border: 1px solid var(--line);

  border-radius: 99px;

  padding: 3px 6px 3px 12px;
  color: var(--ink);
}

.chip button {
  width: 22px;
  height: 22px;

  border-radius: 50%;
  border: 0;

  background: var(--navy);
  color: #fff;

  display: grid;
  place-items: center;

  cursor: pointer;
}


/* รายการกิจกรรม */
.evc {
  display: grid;

  grid-template-columns:
    68px
    minmax(0, 1fr)
    auto;

  gap: 14px;
  align-items: start;

  padding: 14px;

  transition: 0.15s;
  scroll-margin-top: 84px;
}

.evc .dt {
  background: var(--navy);
  color: #fff;

  border-radius: 10px;

  text-align: center;

  padding: 8px 4px;
  line-height: 1.2;
}

.evc .dt small {
  display: block;
  font-size: 11px;
  color: #cfd6e6;
}

.evc .dt .w {
  color: var(--gold2);
}

.evc .dt b {
  display: block;
  font-size: 26px;
  color: #fff;
}

.evc h4 {
  font-size: 16px;
  margin: 6px 0 4px;
  line-height: 1.35;
}

.evc .tg {
  display: flex;
  gap: 6px;
  align-items: center;
  flex-wrap: wrap;
}

.evc .lv {
  background: #d62b2b;
  color: #fff;

  font-size: 11px;
  padding: 1px 8px;

  border-radius: 5px;
}

.evc .meta {
  margin-top: 2px;
}

.evc p.meta {
  margin-top: 6px;
}

.evc .ei {
  width: 40px;
  height: 40px;

  border-radius: 50%;

  display: grid;
  place-items: center;

  background: #f1ebdd;
  color: var(--gold-ink);
}

.empty {
  text-align: center;
  color: var(--mute);
  padding: 28px 16px;
}

.empty .btn {
  margin-top: 12px;
}


/* =========================================================
   30. EXTRA ICON / AMULET STYLING
   ========================================================= */

.logo svg {
  color: var(--gold2);
}

.login {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

/* ลูกศรท้ายการ์ด (สีทอง) — เจาะจงเฉพาะลูกศร ไม่ให้กระทบไอคอนใน .ic */
.pl > svg:last-child {
  color: var(--gold-ink);
}

/* ไอคอนในวงกลมสีของการ์ดบริการยอดนิยม = สีขาวทุกอัน */
.pl .ic svg {
  color: #fff;
}


/* =========================================================
   31. RESPONSIVE
   ========================================================= */

/* ---------------------------------------------------------
   Tablet / หน้าจอไม่เกิน 1100px
   --------------------------------------------------------- */

@media (max-width: 1100px) {
  .g6 {
    grid-template-columns: repeat(3, 1fr);
  }

  .menu a {
    padding: 22px 8px;
    font-size: 14px;
  }

  .nav {
    gap: 14px;
  }
}


/* ---------------------------------------------------------
   Tablet / Mobile ไม่เกิน 900px
   --------------------------------------------------------- */

@media (max-width: 900px) {
  .g4,
  .g6,
  .stats,
  .trust {
    grid-template-columns: 1fr 1fr;
  }

  .layout,
  .g2,
  .fg {
    grid-template-columns: 1fr;
  }

  .hero { --bh: 170px; }
  .hero.big { --bh: 250px; }

  /* เมนูมือถือ */
  .menu {
    display: none;

    position: absolute;
    top: 68px;
    left: 0;
    right: 0;

    background: var(--navy);

    flex-direction: column;

    margin: 0;
    padding: 8px 20px;

    max-height: calc(100vh - 68px);
    overflow-y: auto;
  }

  .menu.open {
    display: flex;
  }

  .menu a {
    padding: 12px 0;
    border-bottom: 1px solid #ffffff14;
  }

  .menu a.on {
    border-color: var(--gold);
  }

  .burger {
    width: 44px;
    height: 44px;

    display: grid;
    place-items: center;

    padding: 0;
    margin-left: auto;
    margin-right: -8px;
  }

  .login {
    display: none;
  }

  .mlogin {
    display: flex;

    align-items: center;
    justify-content: center;
    gap: 6px;

    margin: 10px 0 6px;
    padding: 12px;

    border: 1px solid var(--gold);
    color: var(--gold2);

    background: none;
    border-radius: 8px;

    cursor: pointer;
  }

  /* Hero */
  .hero .wrap {
    padding-top: 40px;
    padding-bottom: 40px;
  }

  .hero.big .wrap {
    padding-top: 56px;
    padding-bottom: 56px;
  }

  /* Layout */
  .side {
    padding: 14px;
  }

  .side h3.t {
    display: none;
  }

  .side > div {
    display: flex;
    gap: 6px;

    overflow-x: auto;
    padding-bottom: 4px;

    scrollbar-width: thin;
  }

  .side button {
    flex: none;
    width: auto;
    gap: 8px;

    border: 1px solid var(--line);
    padding: 8px 14px;
  }

  .side button.on {
    border-color: var(--gold);
  }

  /* หน้ากิจกรรม */
  .layout.evp {
    grid-template-columns: minmax(0, 1fr);

    grid-template-areas:
      "cal"
      "list";

    gap: 20px;
  }

  .about,
  .news {
    flex-direction: column;
  }

  .news .thumb,
  .about .thumb {
    width: 100%;
  }

  .hero h1,
  .hero.big h1 {
    font-size: 30px;
  }
}


/* ---------------------------------------------------------
   Mobile ไม่เกิน 600px
   --------------------------------------------------------- */

@media (max-width: 600px) {
  body {
    font-size: 14.5px;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  .wrap {
    padding: 0 clamp(14px, 4vw, 28px);
  }

  .sec {
    padding-top: 24px;
  padding-bottom: 24px;
  }

  .wrap.sec {
    padding-top: 24px;
    padding-bottom: 24px;
  }

  /* Navigation */
  .nav {
    gap: 10px;
    height: 60px;
  }

  .menu {
    top: 60px;
    max-height: calc(100vh - 60px);
  }

  .logo {
    font-size: 18px;
  }

  .logo svg {
    width: 30px;
    height: 30px;
  }

  /* Grid */
  .g6 {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .g4 {
    grid-template-columns: 1fr;
  }

  .pl {
    padding: 14px 10px;
  }

  .pl .ic {
    width: 52px;
    height: 52px;
  }

  .pl small {
    font-size: 11.5px;
  }

  /* Buttons */
  .btn {
    padding: 12px 22px;
  }

  /* Hero */
  .hero p {
    font-size: 14px;
  }

  /* Forms / Tools */
  .tools,
  .sub form {
    flex-direction: column;
  }

  .tools select,
  .sub input {
    width: 100%;
  }

  .f .two {
    grid-template-columns: 1fr;
  }

  /* Trust */
  .trust {
    grid-template-columns: 1fr;
  }

  /* Contact */
  .chan {
    flex-wrap: wrap;
  }

  .chan .cn {
    width: auto;
  }

  /* Statistics */
  .stats {
    grid-template-columns: 1fr 1fr;
    padding: 16px;
  }

  .stats b {
    font-size: 22px;
  }

  /* News */
  .news {
    flex-direction: column;
  }

  .thumb {
    width: 100%;
    min-height: 96px;
  }

  /* Events */
  .ev {
    align-items: flex-start;
  }

  .evc {
    grid-template-columns:
      58px
      minmax(0, 1fr);

    padding: 12px;
    gap: 12px;
  }

  .evc .ei {
    display: none;
  }

  .evc .dt b {
    font-size: 22px;
  }

  .layout.evp {
    gap: 16px;
  }

  /* Calendar */
  .calcard {
    padding: 14px;
  }

  .cal {
    gap: 3px;
  }

  .cal .d {
    font-size: 13px;
    border-radius: 9px;
  }

  /* Footer */
  .footer-links,
  .fg {
    gap: 20px;
  }

  .copy {
    flex-direction: column;
  }

  /* หน้าแรก: พระเครื่องอยู่ใต้ข้อความ กึ่งกลาง */
  .hero.big { --bh: 230px; }

  .hero.big .hero-amulet {
    position: relative;
    right: auto;
    top: auto;
    transform: none;
    margin: 26px auto 30px;
    pointer-events: auto;
    touch-action: pan-y;
  }

  /* หน้าย่อย: เป็นภาพประดับจาง ๆ ด้านขวา ไม่บังข้อความ */
  .hero:not(.big) { --bh: 130px; }

  .hero:not(.big) .hero-amulet {
    right: 3%;
    opacity: 0.28;
  }

  .hero:not(.big) .ha-dots { display: none; }
}


/* ---------------------------------------------------------
   Small Mobile ไม่เกิน 380px
   --------------------------------------------------------- */

@media (max-width: 380px) {
  .g6 {
    grid-template-columns: 1fr 1fr;
  }

  .pl small {
    display: none;
  }

  .stats {
    grid-template-columns: 1fr;
  }
}


/* ---------------------------------------------------------
   Large Desktop ตั้งแต่ 1500px
   --------------------------------------------------------- */

@media (min-width: 1500px) {
  .wrap {
    max-width: 1320px;
  }
}


/* ---------------------------------------------------------
   Reduced Motion
   --------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
  }
}
@media (max-width: 380px) {
  .hero.big { --bh: 205px; }
}


/* =========================================================
   32. FLOATING CONTACT BUTTONS (LINE / Messenger)
   ========================================================= */

.fabs {
  position: fixed;
  right: 16px;
  bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  z-index: 30;

  display: flex;
  flex-direction: column;
  gap: 10px;
}

.fab {
  width: 52px;
  height: 52px;
  border-radius: 50%;

  display: grid;
  place-items: center;

  color: #fff;
  box-shadow: 0 6px 16px -4px #0006;
  transition: transform 0.15s;
}

.fab:hover {
  transform: translateY(-2px) scale(1.04);
}

.fab-line {
  background: #06b050;
}

.fab-msn {
  background: #0084ff;
}

@media print {
  .fabs {
    display: none;
  }
}

@media (max-width: 600px) {
  .fab {
    width: 48px;
    height: 48px;
  }
}


/* =========================================================
   33. EMPTY NOTE / FOOTER LEGAL LINKS
   ========================================================= */

.empty-note {
  text-align: center;
  color: var(--mute);
  padding: 24px 8px;
  line-height: 1.9;
}

.empty-note a {
  color: var(--gold-ink);
}

.copy a:hover {
  color: var(--gold2);
}


/* =========================================================
   34. LEGAL PAGES (นโยบายความเป็นส่วนตัว / ข้อกำหนดการใช้งาน)
   ========================================================= */

.legal {
  max-width: 860px;
  margin: 0 auto;
  line-height: 1.9;
}

.legal .upd {
  color: var(--mute);
  font-size: 13px;
  margin-bottom: 18px;
}

.legal h2 {
  font-size: 18px;
  margin: 28px 0 8px;
  color: var(--navy);
}

.legal p,
.legal li {
  color: var(--ink);
  font-size: 15px;
}

.legal ul {
  margin: 6px 0 6px 22px;
  list-style: disc;
}

.legal a {
  color: var(--gold-ink);
  text-decoration: underline;
}



/* =========================================================
   35. ACCESSIBILITY (ข้ามไปเนื้อหา / โฟกัสบนพื้นเข้ม)
   ========================================================= */

.skip {
  position: fixed;
  left: 12px;
  top: -80px;
  z-index: 100;
  background: var(--gold);
  color: #1b1405;
  padding: 10px 18px;
  border-radius: 8px;
  font-weight: 500;
  transition: top 0.15s;
}

.skip:focus {
  top: 12px;
}

main:focus {
  outline: none;
}

/* พื้นหลังสีเข้ม ใช้วงโฟกัสสีทองอ่อน */
header :focus-visible,
footer :focus-visible,
.hero :focus-visible,
.cc :focus-visible {
  outline-color: var(--gold2);
}

.fab:focus-visible {
  outline: 3px solid var(--navy);
  outline-offset: 3px;
  box-shadow: 0 0 0 6px #fff;
}


/* =========================================================
   36. ลิงก์ทั้งการ์ด (ข่าว / กิจกรรม) + หน้ารายละเอียด
   ========================================================= */

.card.news,
.evc,
.ev {
  position: relative;
}

.stretch {
  color: inherit;
}

.stretch::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
}

.card.news:hover {
  border-color: var(--gold);
}

.card.news:hover h4 a,
.ev:hover .stretch {
  text-decoration: underline;
  text-underline-offset: 3px;
}

.card:has(.stretch:focus-visible),
.ev:has(.stretch:focus-visible) {
  outline: 2px solid var(--gold-ink);
  outline-offset: 2px;
  border-radius: var(--r);
}

.stretch:focus-visible {
  outline: none;
}

.dcard {
  max-width: 820px;
  margin: 0 auto;
  padding: 26px;
}

.dcard .tg {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}

.dcard h2 {
  font-size: 26px;
  line-height: 1.35;
  margin: 10px 0 8px;
  color: var(--navy);
}

.dcard .meta {
  font-size: 14px;
  margin-bottom: 14px;
}

.dcard .dtext p {
  font-size: 16px;
  line-height: 1.9;
  margin-bottom: 12px;
}

.dcard .past {
  background: #f1ebdd;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14px;
  margin: 4px 0 14px;
}

.dcard .lv {
  background: #d62b2b;
  color: #fff;
  font-size: 11px;
  padding: 1px 8px;
  border-radius: 5px;
}

.share {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  border-top: 1px solid var(--line);
  margin-top: 18px;
  padding-top: 16px;
}

.sbtn {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 6px 16px;
  border-radius: 8px;
  border: 1px solid var(--navy);
  background: none;
  color: var(--navy);
  cursor: pointer;
  font-size: 14px;
}

.sbtn:hover {
  background: var(--navy);
  color: #fff;
}

.dback {
  display: inline-block;
  margin-bottom: 14px;
  color: var(--gold-ink);
  text-decoration: underline;
  text-underline-offset: 3px;
}

.drel {
  max-width: 820px;
  margin: 34px auto 0;
}

.nf {
  text-align: center;
  padding: 40px 12px 20px;
}

.nf .big {
  font-size: 72px;
  font-weight: 600;
  color: var(--navy);
  line-height: 1.1;
}

.nf .btns {
  display: flex;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap;
}

.nf .btns .btn {
  margin-top: 14px;
}


/* =========================================================
   37. แบนเนอร์ขอความยินยอมคุกกี้ (js/consent.js)
   ========================================================= */

.cc {
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(12px + env(safe-area-inset-bottom, 0px));
  z-index: 60;
  max-width: 780px;
  margin: 0 auto;
  display: flex;
  gap: 14px 20px;
  align-items: center;
  flex-wrap: wrap;
  background: var(--navy);
  color: #fff;
  border: 1px solid var(--gold);
  border-radius: 12px;
  padding: 16px 18px;
  box-shadow: 0 10px 30px -8px #0009;
}

.cc p {
  flex: 1 1 320px;
  font-size: 14px;
  line-height: 1.7;
  color: #e6eaf4;
}

.cc a {
  color: var(--gold2);
  text-decoration: underline;
}

.cc-btns {
  display: flex;
  gap: 10px;
  flex: none;
}

.cc-btns button {
  min-height: 44px;
  min-width: 96px;
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  cursor: pointer;
  border: 1px solid var(--gold2);
}

.cc-no {
  background: #fff;
  color: var(--navy);
}

.cc-yes {
  background: var(--gold);
  color: #1b1405;
}

@media print {
  .cc {
    display: none;
  }
}


/* =========================================================
   v6.1  รูปข่าว / ป้ายปักหมุด-ข่าวเด่น / รูปปกหน้ารายละเอียด
   ========================================================= */

/* การ์ดข่าวที่มีรูป: รูปเต็มกรอบ thumbnail */
.thumb.has-img {
  overflow: hidden;
  background: #16264a;
}

.thumb.has-img img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.thumb.has-img .live {
  z-index: 1;
}

/* มือถือ: การ์ดข่าวเรียงแนวตั้ง ให้รูปสูงพอดูได้ชัด */
@media (max-width: 900px) {
  .news .thumb.has-img {
    min-height: 170px;
  }
}

/* ป้ายบนการ์ดข่าว */
.tag.pin {
  background: var(--gold);
  color: #1b1405;
}

.tag.fea {
  background: var(--navy);
  color: var(--gold2);
}

/* รูปปกในหน้ารายละเอียดข่าว */
.dcover {
  display: block;
  width: 100%;
  max-height: 440px;
  object-fit: cover;
  border-radius: 12px;
  margin: 4px 0 18px;
  background: #16264a;
}


/* =========================================================
   v6.3 — ปรับความสวยงามเล็กน้อย + รองรับทุกหน้าจอ
   ========================================================= */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
::selection { background: #c8963e55; }
h1, h2, h3, h4 { text-wrap: balance; }
img, video { max-width: 100%; height: auto; }
.card { box-shadow: 0 1px 2px rgba(15, 27, 51, .04), 0 6px 18px -8px rgba(15, 27, 51, .12); }
.card.news, .card.dcard { overflow-wrap: anywhere; }
.btn { transition: transform .12s, filter .15s, box-shadow .15s; }
.btn:active { transform: translateY(1px); }
/* ปุ่มลอย: ไม่ชนขอบจอที่มีรอยบาก (iPhone) และเล็กลงบนจอเล็ก */
.fabs { right: calc(14px + env(safe-area-inset-right, 0px)); }
@media (max-width: 600px) {
  .fabs { right: calc(10px + env(safe-area-inset-right, 0px)); bottom: calc(12px + env(safe-area-inset-bottom, 0px)); gap: 8px; }
  .fab { width: 44px; height: 44px; opacity: .94; }
  .fab svg { width: 22px; height: 22px; }
}
/* จอใหญ่/จอกว้างพิเศษ: ไม่ให้เนื้อหาชิดขอบมากเกินไป */
@media (min-width: 1920px) { .wrap { max-width: 1280px; } }
/* หน้าจอที่เตี้ย (มือถือแนวนอน): ลดความสูง hero */
@media (max-height: 480px) and (orientation: landscape) { .hero, .hero.big { --bh: 150px; } }


/* =========================================================
   v6.4  การ์ดข่าว: เนื้อหาย่อย 2 บรรทัด / รูปกรอบเท่ากัน / น้ำหนักฟอนต์
   ========================================================= */
:root { --nt-w: 600; --nx-w: 400; }

.news h4, .dcard h2 { font-weight: var(--nt-w); }
.news p.ex, .dcard .dtext p { font-weight: var(--nx-w); }

.news > div:last-child { min-width: 0; flex: 1; }
.news p.ex {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
  line-height: 1.5;
  margin: 0;
}
.news .more { display: block; font-size: 12.5px; color: var(--gold); margin: 4px 0 2px; }

/* รูป/ไอคอนทุกข่าวกรอบเท่ากัน: 3:2 บนคอมพิวเตอร์ ครอบพอดีกรอบไม่บิดภาพ */
.news .thumb {
  width: 180px;
  min-height: 0;
  aspect-ratio: 3 / 2;
  align-self: flex-start;
}
.thumb.has-img img { object-fit: cover; object-position: center; }

/* มือถือ/แท็บเล็ต: การ์ดเรียงแนวตั้ง รูป 16:9 เต็มความกว้าง */
@media (max-width: 900px) {
  .news .thumb,
  .news .thumb.has-img {
    width: 100%;
    min-height: 0;
    aspect-ratio: 16 / 9;
    align-self: stretch;
  }
}
