/* ==========================================================================
   หน้าถวายความจงรักภักดีและน้อมรำลึกฯ ๕ ธันวาคม ๒๕๖๙ (2026)
   บริษัท เพาเวอร์ไลน์ เอ็นจิเนียริ่ง จำกัด (มหาชน)
   สไตล์ไร้กรอบการ์ด — พระบรมฉายาลักษณ์และตัวอักษรกลมกลืนไปกับพื้นหลังลายทอง
   ========================================================================== */

:root {
  --royal-ink: #431903;
  --royal-ink-soft: #5c2808;
  --royal-ink-accent: #6b3309;
  --royal-primary: #5b1d09;
  --font-serif: "Noto Serif Thai", "TH Sarabun New", "Sarabun", Georgia, serif;
  --font-sans: "Sarabun", "Leelawadee UI", "Segoe UI", Tahoma, sans-serif;
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
  width: 100%;
  min-height: 100%;
}

body {
  font-family: var(--font-serif);
  color: var(--royal-ink);
  background-color: #eab238;
  background-image: url("./bg-masthead-2026.jpg?v=20261205.7");
  background-position: center center;
  background-repeat: no-repeat;
  background-size: cover;
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* ปรับโทนแสงทองอบอุ่นบางเบา ให้เข้ากับโทนสีเดิมและคงความคมชัดของลายผ้าไหมยกทอง */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(
      ellipse 70% 74% at 50% 48%,
      rgba(255, 244, 206, 0.16) 0%,
      rgba(244, 198, 76, 0.14) 54%,
      rgba(206, 136, 20, 0.18) 100%
    );
}

/* พื้นที่จัดวางหลักแบบไร้การ์ด กึ่งกลางหน้าจออย่างสมดุล */
.memorial-shell {
  position: relative;
  z-index: 1;
  min-height: 100vh;
  min-height: 100svh;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: clamp(12px, 2vh, 22px) clamp(16px, 4vw, 32px);
}

.memorial-stage {
  width: 100%;
  max-width: 860px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  animation: gentleFadeIn 0.85s ease-out both;
}

/* พระบรมฉายาลักษณ์กลมกลืนกับพื้นหลังด้วยแสงรัศมีทองนวล */
.portrait-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: clamp(6px, 1.1vh, 12px);
}

.portrait-glow {
  position: absolute;
  width: 120%;
  height: 112%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgba(255, 245, 204, 0.62) 0%,
    rgba(248, 212, 114, 0.26) 48%,
    rgba(248, 212, 114, 0) 74%
  );
  filter: blur(16px);
  pointer-events: none;
}

.portrait-img {
  position: relative;
  z-index: 1;
  display: block;
  width: auto;
  max-width: min(380px, 74vw);
  max-height: clamp(360px, 53vh, 540px);
  height: auto;
  object-fit: contain;
  filter: drop-shadow(0 15px 30px rgba(72, 30, 4, 0.35));
  user-select: none;
}

/* ข้อความน้อมรำลึก — พิมพ์ลงบนพื้นหลังลายทองโดยตรง พร้อมเงาสว่างทองนวลให้อ่านง่าย */
.tribute-content {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-shadow:
    0 1px 0 rgba(255, 248, 222, 0.90),
    0 0 18px rgba(255, 242, 198, 0.78),
    0 0 32px rgba(255, 236, 178, 0.55);
}

/* วันที่พร้อมเส้นทองจางสมมาตร */
.tribute-date {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: clamp(1.12rem, 1.9vw, 1.42rem);
  font-weight: 700;
  color: var(--royal-ink);
  letter-spacing: 0.05em;
  line-height: 1.28;
  margin: 0 0 1px 0;
}

.tribute-date::before,
.tribute-date::after {
  content: "";
  display: inline-block;
  width: clamp(28px, 5vw, 58px);
  height: 1.5px;
  background: linear-gradient(90deg, transparent, rgba(102, 48, 8, 0.72), transparent);
}

.tribute-occasion {
  margin: 0 0 1px 0;
  font-size: clamp(1.06rem, 1.75vw, 1.34rem);
  font-weight: 600;
  color: var(--royal-ink-soft);
  line-height: 1.32;
}

.tribute-royal-name {
  margin: 0 0 2px 0;
  font-size: clamp(1.22rem, 2.2vw, 1.76rem);
  font-weight: 700;
  color: var(--royal-ink);
  line-height: 1.32;
  letter-spacing: 0.01em;
}

.keep-phrase {
  display: block;
}

.tribute-national-day {
  margin: 0 0 4px 0;
  font-size: clamp(0.95rem, 1.35vw, 1.12rem);
  font-weight: 600;
  color: var(--royal-ink-accent);
  line-height: 1.32;
  letter-spacing: 0.02em;
}

.tribute-message {
  margin: 0 0 4px 0;
  font-size: clamp(1.04rem, 1.6vw, 1.28rem);
  font-weight: 600;
  color: var(--royal-ink-soft);
  line-height: 1.36;
}

/* ลวดลายกระหนกคั่นสีทองเข้ม กลมกลืนและคมชัดบนพื้นหลังลายทอง */
.ornament-divider {
  width: min(270px, 72%);
  height: auto;
  margin: 0 0 4px 0;
  display: block;
  filter: drop-shadow(0 1px 1px rgba(255, 246, 210, 0.85));
}

/* คำลงท้ายและชื่อองค์กร */
.tribute-closing {
  margin: 0 0 clamp(10px, 1.6vh, 16px) 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
  line-height: 1.35;
}

.tribute-closing-salutation,
.tribute-closing-people {
  margin: 0;
  font-size: clamp(0.96rem, 1.35vw, 1.12rem);
  font-weight: 500;
  color: var(--royal-ink-soft);
}

.tribute-closing-org {
  margin: 1px 0 0 0;
  font-size: clamp(1.02rem, 1.5vw, 1.24rem);
  font-weight: 700;
  color: var(--royal-ink);
}

/* ปุ่มเข้าสู่เว็บไซต์ กลมกลืนกับโทนทอง-น้ำตาลราชสำนัก */
.action-group {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px;
  width: 100%;
  text-shadow: none;
}

.btn-royal {
  font-family: var(--font-sans);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-width: 174px;
  min-height: 44px;
  padding: 9px 26px;
  border-radius: 999px;
  font-size: 0.98rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  transition:
    transform 0.22s ease,
    box-shadow 0.22s ease,
    background-color 0.22s ease,
    border-color 0.22s ease,
    color 0.22s ease;
}

.btn-royal:focus-visible {
  outline: 3px solid rgba(91, 29, 9, 0.55);
  outline-offset: 3px;
}

.btn-royal--primary {
  color: #fff9eb;
  background: linear-gradient(135deg, #68230b 0%, #481605 100%);
  border: 1.5px solid #e7c268;
  box-shadow: 0 8px 20px rgba(72, 24, 4, 0.28);
}

.btn-royal--primary:hover {
  background: linear-gradient(135deg, #802d10 0%, #5b1d08 100%);
  border-color: #f7da8c;
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(72, 24, 4, 0.36);
}

.btn-royal--primary:active {
  transform: translateY(0);
}

.btn-royal--secondary {
  color: var(--royal-ink);
  background: rgba(255, 248, 224, 0.42);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
  border: 1.5px solid rgba(91, 29, 9, 0.55);
  box-shadow: 0 6px 16px rgba(90, 42, 6, 0.12);
}

.btn-royal--secondary:hover {
  color: #fff9eb;
  background: linear-gradient(135deg, #74340e 0%, #562107 100%);
  border-color: #e7c268;
  transform: translateY(-2px);
  box-shadow: 0 10px 22px rgba(72, 24, 4, 0.28);
}

.btn-royal--secondary:active {
  transform: translateY(0);
}

.btn-arrow {
  width: 15px;
  height: 15px;
  transition: transform 0.22s ease;
}

.btn-royal:hover .btn-arrow {
  transform: translateX(3px);
}

@keyframes gentleFadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ==========================================================================
   Responsive Breakpoints (Tablet & Mobile)
   ========================================================================== */
@media (max-width: 768px) {
  body {
    background-attachment: scroll;
  }

  .portrait-img {
    max-width: min(325px, 74vw);
    max-height: 460px;
  }
}

@media (max-width: 520px) {
  .memorial-shell {
    padding: 14px 14px 20px;
  }

  .portrait-img {
    max-width: min(285px, 76vw);
    max-height: 405px;
  }

  .tribute-date {
    font-size: 1.05rem;
    gap: 10px;
  }

  .tribute-occasion {
    font-size: 1.02rem;
  }

  .tribute-royal-name {
    font-size: 1.12rem;
    line-height: 1.38;
  }

  .tribute-national-day {
    font-size: 0.92rem;
    margin-bottom: 4px;
  }

  .tribute-message {
    font-size: 0.98rem;
  }

  .ornament-divider {
    width: 210px;
  }

  .tribute-closing-salutation,
  .tribute-closing-people {
    font-size: 0.94rem;
  }

  .tribute-closing-org {
    font-size: 0.98rem;
  }

  .action-group {
    flex-direction: column;
    gap: 10px;
  }

  .btn-royal {
    width: 100%;
    max-width: 250px;
    min-height: 44px;
    font-size: 0.96rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .memorial-stage {
    animation: none;
  }
  .btn-royal,
  .btn-arrow {
    transition: none;
  }
}
