/**
 * Agi Fair / งานเกษตรนเรศวร — overrides only
 * Stack: bootstrap.min.css → style.css (iSTUDIO) → this file (last)
 */

/*
 * ฟอนต์ไทยแบบยั่งยืน (กติกาเดียว)
 * — ทุกหน้าที่เป็นภาษาไทยเป็นหลัก: ตั้ง <html lang="th"> แล้วเนื้อหาส่วนใหญ่จะสืบทอด Kanit แทน Open Sans ของ Bootstrap
 * — ไม่ต้องไล่ใส่ font-family ทีละ section; ข้อยกเว้นคือไอคอน (FA/BI มี font-family ของตัวเอง), โค้ดใน <code>/<pre>
 */
html[lang="th"] body {
  font-family: "Kanit", "Sarabun", "Segoe UI", system-ui, sans-serif;
}

/*
 * หัวข้อ h1–h6 — Bootstrap ของเทมเพลตกำหนด Space Grotesk ให้ h1 (ไม่มี glyphp ไทย)
 * ข้อความไทยใน h1 จึง fallback เป็นระบบ แม้ body จะเป็น Kanit แล้ว
 */
html[lang="th"] h1,
html[lang="th"] h2,
html[lang="th"] h3,
html[lang="th"] h4,
html[lang="th"] h5,
html[lang="th"] h6,
html[lang="th"] .h1,
html[lang="th"] .h2,
html[lang="th"] .h3,
html[lang="th"] .h4,
html[lang="th"] .h5,
html[lang="th"] .h6 {
  font-family: "Kanit", "Sarabun", "Segoe UI", system-ui, sans-serif;
}

/* เมนูหลัก + โลโก้ในแถบนำทาง — Kanit (override Space Grotesk จาก style.css) */
.navbar {
  font-family: "Kanit", "Sarabun", "Segoe UI", system-ui, sans-serif !important;
}

/* บังคับ Kanit ที่ลิงก์เมนู/ดรอปดาวน์โดยตรง — กันถูก Bootstrap หรือธีม override ที่ .nav-link */
.navbar .navbar-brand,
.navbar .navbar-brand h1,
.navbar .navbar-nav .nav-link,
.navbar .nav-link.dropdown-toggle,
.navbar .dropdown-menu .dropdown-item {
  font-family: "Kanit", "Sarabun", "Segoe UI", system-ui, sans-serif !important;
}

/* โลโก้แทน iSTUDIO — img/logo agifair20-N.png */
.agifair-navbar-logo {
  display: block;
  height: clamp(2.35rem, 5.2vw, 3.15rem);
  width: auto;
  max-width: min(220px, 52vw);
  object-fit: contain;
}

/* โลโก้ hero แทนข้อความหลายบรรทัด — img/logo agifair20.png */
.agifair-hero-logo-wrap {
  max-width: 560px;
}

.agifair-hero-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

/* Breadcrumb + หัวข้อ hero ของหน้าย่อย — อยู่นอก .navbar จึงเคยได้ Open Sans จาก body */
.hero-header .breadcrumb,
.hero-header .breadcrumb-item,
.hero-header .breadcrumb-item a,
.hero-header h1,
.hero-header .display-1 {
  font-family: "Kanit", "Sarabun", "Segoe UI", system-ui, sans-serif !important;
}

.hero-header .agifair-hero-display,
.hero-header .agifair-hero-display h1.agifair-hero-title,
.hero-header .agifair-hero-display .agifair-hero-line,
.hero-header .agifair-hero-display .agifair-hero-edition,
.hero-header .agifair-hero-display p.agifair-hero-eyebrow,
.hero-header h5.agifair-hero-tagline {
  font-family: "Kanit", "Sarabun", "Segoe UI", system-ui, sans-serif !important;
}

.agifair-hero-display {
  font-synthesis: none;
}

.agifair-hero-eyebrow {
  letter-spacing: 0.12em;
  font-size: 0.78rem !important;
}

.agifair-hero-title .agifair-hero-line {
  font-size: clamp(2.1rem, 6.2vw, 3.65rem);
  letter-spacing: 0.03em;
}

@media (min-width: 992px) {
  .agifair-hero-title .agifair-hero-line {
    font-size: clamp(2.65rem, 3.8vw, 4.15rem);
  }
}

.agifair-hero-title .agifair-hero-line--1 {
  color: #151a18;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75), 0 14px 40px rgba(255, 255, 255, 0.35);
}

.agifair-hero-title .agifair-hero-line--2 {
  background: linear-gradient(95deg, var(--bs-primary) 0%, #198754 52%, #0d5037 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .agifair-hero-title .agifair-hero-line--2 {
    color: var(--bs-primary);
    background: none;
  }
}

.agifair-hero-title .agifair-hero-edition {
  letter-spacing: 0.06em;
  border: 2px solid rgba(255, 255, 255, 0.55);
  box-shadow: 0 12px 32px rgba(25, 135, 84, 0.32);
}

.hero-header .agifair-hero-title .agifair-hero-edition:hover {
  transform: translateY(-1px);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 16px 36px rgba(25, 135, 84, 0.38);
}

/* ---------- สโลแกนใต้ hero (กล่องขาว) ---------- */
.hero-header h5.agifair-hero-tagline {
  font-weight: 500;
  font-size: clamp(1.05rem, 2.15vw, 1.42rem);
  line-height: 1.65;
  letter-spacing: 0.035em;
  color: #123628;
  border-radius: 0.6rem !important;
  border-color: rgba(25, 135, 84, 0.22) !important;
  background: linear-gradient(
    168deg,
    rgba(255, 255, 255, 0.99) 0%,
    rgba(246, 251, 248, 0.94) 45%,
    rgba(255, 255, 255, 0.96) 100%
  ) !important;
  box-shadow:
    inset 5px 0 0 0 var(--bs-primary),
    0 12px 36px rgba(15, 42, 32, 0.08),
    inset 0 1px 0 rgba(255, 255, 255, 0.92);
  transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.hero-header h5.agifair-hero-tagline:hover {
  box-shadow:
    inset 5px 0 0 0 #157347,
    0 14px 40px rgba(15, 42, 32, 0.1),
    inset 0 1px 0 rgba(255, 255, 255, 0.95);
  transform: translateY(-1px);
}

/* สโลแกนหน้าแรก — รูป salocan + date โปร่ง ไม่มีกล่องขาว/เงา */
.hero-header .agifair-hero-slogan-media {
  max-width: 38rem;
  background: none;
  box-shadow: none;
}

.hero-header .agifair-hero-slogan-img--line1 {
  display: block;
  width: 100%;
  max-width: 100%;
  height: auto;
  object-fit: contain;
}

/* salocan.png — สไลด์จากขวา + จาง→ชัด (จังหวะช้ากว่า slideInRight ของ animate) */
@keyframes agifair-hero-salocan-enter {
  from {
    opacity: 0;
    transform: translate3d(calc(3rem + 18vw), 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.hero-header .agifair-hero-salocan-enter {
  animation: agifair-hero-salocan-enter 2s ease-out both;
}

.hero-header .agifair-hero-slogan-img--line2 {
  display: block;
  width: auto;
  max-width: min(100%, 22rem);
  height: auto;
  object-fit: contain;
}

/* date.png — เลื่อนจากซ้าย + ค่อยๆ ชัดขึ้น opacity 0% → 100% */
@keyframes agifair-hero-date-fadein {
  from {
    opacity: 0;
    /* จุดเริ่มสไลด์ — อยู่ซ้ายกว่าเดิม (รวม vw ให้จอกว้างเริ่มไกลขึ้นด้วย) */
    transform: translate3d(calc(-3rem - 18vw), 0, 0);
  }
  to {
    opacity: 1;
    transform: translate3d(0, 0, 0);
  }
}

.hero-header .agifair-hero-date-fadein {
  animation: agifair-hero-date-fadein 1.25s ease-out 0.25s both;
}

@media (min-width: 992px) {
  .hero-header .agifair-hero-slogan-img--line2 {
    max-width: min(100%, 26rem);
  }
}

/* ---------- About page (เกษตรนเรศวร) ---------- */
.agifair-about-body {
  font-family: "Kanit", "Sarabun", "Segoe UI", system-ui, sans-serif;
}

/* ใช้ Kanit ชัดเจนใน main — ไม่ใช้ inherit เพื่อไม่ให้ถูก Open Sans จากธีมครอบ */
.agifair-about-page {
  font-family: "Kanit", "Sarabun", "Segoe UI", system-ui, sans-serif;
}

/* Breadcrumb สีขาวเฉพาะ hero พื้นเขียว (bg-primary) — หน้า index/about แบบ bg-light ใช้ตัวอักษรเข้มใน HTML */
.hero-header.bg-primary .breadcrumb-item + .breadcrumb-item::before {
  color: rgba(255, 255, 255, 0.55);
}

.hero-header.bg-primary .breadcrumb-item.active {
  color: rgba(255, 255, 255, 0.9);
}

.agifair-about-h2 {
  font-family: "Kanit", "Sarabun", "Segoe UI", system-ui, sans-serif !important;
  font-weight: 600;
  font-size: clamp(1.35rem, 2.2vw, 1.85rem);
  color: #142018;
  line-height: 1.35;
}

.agifair-about-badge {
  display: inline-flex;
  align-items: center;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--bs-primary);
  background: rgba(25, 135, 84, 0.1);
  border: 1px solid rgba(25, 135, 84, 0.2);
  border-radius: 999px;
  padding: 0.35rem 0.95rem;
}

.agifair-about-badge--dark {
  color: #0d5037;
  background: rgba(13, 80, 55, 0.08);
  border-color: rgba(13, 80, 55, 0.15);
}

.agifair-about-prose {
  font-size: 1.02rem;
  line-height: 1.75;
  color: #2b3430;
}

.agifair-about-prose p:last-child {
  margin-bottom: 0;
}

.agifair-about-figure .agifair-about-main-img {
  aspect-ratio: 4 / 3;
  object-fit: cover;
  width: 100%;
}

.agifair-about-icon-wrap {
  flex-shrink: 0;
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, rgba(25, 135, 84, 0.12), rgba(25, 135, 84, 0.04));
  color: var(--bs-primary);
  font-size: 1.25rem;
}

.agifair-about-band {
  background: linear-gradient(180deg, #f6faf7 0%, #ffffff 55%);
}

.agifair-about-card {
  background: #fff;
}

.agifair-about-cover {
  object-fit: cover;
}

.agifair-about-band-img {
  min-height: 260px;
}

@media (min-width: 992px) {
  .agifair-about-band-img {
    min-height: 320px;
  }
}

.agifair-about-thumb-img {
  aspect-ratio: 3 / 2;
  object-fit: cover;
}

.agifair-obj-card {
  position: relative;
  background: #fff;
  border-radius: 1rem;
  padding: 1.5rem 1.35rem 1.35rem 4.25rem;
  border: 1px solid rgba(25, 135, 84, 0.12);
  box-shadow: 0 8px 28px rgba(21, 26, 24, 0.06);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.agifair-obj-card:hover {
  box-shadow: 0 14px 40px rgba(21, 26, 24, 0.1);
  transform: translateY(-2px);
}

.agifair-obj-icon {
  position: absolute;
  left: 1.25rem;
  top: 1.35rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  color: #fff;
  background: linear-gradient(135deg, var(--bs-primary) 0%, #157347 100%);
}

.agifair-obj-num {
  position: absolute;
  right: 1rem;
  top: 0.85rem;
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  color: rgba(25, 135, 84, 0.45);
  text-transform: uppercase;
}

.agifair-obj-card p {
  font-size: 0.98rem;
  line-height: 1.65;
  color: #3d4742;
}

/* ---------- ตัวชี้วัดเชิงผลลัพธ์ (about) ---------- */
.agifair-outcome-section {
  background: linear-gradient(180deg, #ffffff 0%, #f4faf7 100%);
}

.agifair-outcome-panel {
  background: #fff;
  border-color: rgba(25, 135, 84, 0.15) !important;
}

.agifair-outcome-panel--quality {
  background: linear-gradient(160deg, #ffffff 0%, rgba(230, 240, 239, 0.65) 100%);
}

.agifair-outcome-cat-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 10px;
  background: rgba(13, 107, 104, 0.1);
  color: var(--bs-primary);
  font-size: 1.1rem;
}

.agifair-outcome-list {
  list-style: none;
}

.agifair-outcome-list--plain {
  list-style: none;
}

.agifair-outcome-item {
  position: relative;
  padding-left: 2.35rem;
  margin-bottom: 1rem;
  font-size: 1.02rem;
  line-height: 1.65;
  color: #2b3430;
}

.agifair-outcome-item:last-child {
  margin-bottom: 0;
}

.agifair-outcome-check {
  position: absolute;
  left: 0;
  top: 0.15rem;
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
  color: #fff;
  background: var(--bs-primary);
}

/* ---------- ผลที่คาดว่าจะได้รับ (about) ---------- */
.agifair-expected-list {
  padding-left: 0;
  margin-bottom: 0;
}

.agifair-expected-item {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin-bottom: 1.25rem;
  padding: 1.15rem 1.25rem;
  background: #fff;
  border-radius: 0.85rem;
  border: 1px solid rgba(25, 135, 84, 0.12);
  box-shadow: 0 4px 18px rgba(21, 26, 24, 0.05);
}

.agifair-expected-item:last-child {
  margin-bottom: 0;
}

.agifair-expected-num {
  flex-shrink: 0;
  width: 2.35rem;
  height: 2.35rem;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 1rem;
  color: #fff;
  background: linear-gradient(135deg, var(--bs-primary) 0%, #157347 100%);
  line-height: 1;
}

.agifair-expected-body {
  font-size: 1.02rem;
  line-height: 1.7;
  color: #2b3430;
  padding-top: 0.12rem;
}

/* ---------- การ์ดกิจกรรม / ปุ่มรายละเอียด (เขียว + hover เหลืองเข้ม) ---------- */
.agifair-project-overlay--cta {
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0.06) 0%,
    rgba(13, 107, 104, 0.35) 38%,
    rgba(3, 32, 31, 0.92) 100%
  ) !important;
}

.agifair-project-overlay--cta .text-shadow-sm {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
}

.btn.agifair-project-detail-btn {
  --agifair-detail-from: var(--bs-primary);
  --agifair-detail-to: #157347;
  --agifair-detail-hover-from: #e6b800;
  --agifair-detail-hover-to: #b8860b;
  --agifair-detail-hover-fg: #1f1b08;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.15rem;
  font-weight: 500;
  font-size: 0.8125rem;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: #fff !important;
  border-radius: 0.35rem;
  padding: 0.28rem 0.72rem;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: linear-gradient(145deg, var(--agifair-detail-from) 0%, var(--agifair-detail-to) 100%);
  box-shadow: 0 2px 12px rgba(13, 107, 104, 0.42);
  transition:
    background 0.22s ease,
    color 0.22s ease,
    border-color 0.22s ease,
    box-shadow 0.22s ease,
    transform 0.22s ease;
}

.btn.agifair-project-detail-btn .bi {
  font-size: 0.85em;
  transition: transform 0.22s ease;
}

.btn.agifair-project-detail-btn:hover,
.btn.agifair-project-detail-btn:focus-visible {
  color: var(--agifair-detail-hover-fg) !important;
  border-color: rgba(0, 0, 0, 0.12);
  background: linear-gradient(145deg, var(--agifair-detail-hover-from) 0%, var(--agifair-detail-hover-to) 100%);
  box-shadow: 0 4px 14px rgba(184, 134, 11, 0.4);
  transform: translateY(-1px);
}

.btn.agifair-project-detail-btn:hover .bi,
.btn.agifair-project-detail-btn:focus-visible .bi {
  transform: translateX(3px);
}

.btn.agifair-project-detail-btn:focus-visible {
  outline: 0;
  box-shadow:
    0 0 0 3px rgba(255, 255, 255, 0.55),
    0 4px 14px rgba(184, 134, 11, 0.4);
}

.btn.agifair-project-detail-btn:active {
  transform: translateY(0);
  box-shadow: 0 2px 8px rgba(184, 134, 11, 0.35);
}

/* หัวข้อ About หน้าแรก — เล็กลงเล็กน้อยจาก h1 ของเทมเพลต */
.agifair-index-about-title {
  font-size: clamp(1.65rem, 2.9vw, 2.15rem);
  line-height: 1.3;
}

/* "เตรียมพบกับ" — เน้นโมเดิร์น + motion */
.agifair-teaser-intro {
  line-height: 1.75;
}

.agifair-teaser-kicker-wrap {
  display: inline-block;
  margin-top: -2rem;
  margin-right: 0.35em;
  vertical-align: text-top;
  animation: agifair-kicker-float 4.5s ease-in-out infinite 1.1s;
}

.agifair-teaser-kicker {
  display: inline-block;
  font-weight: 700;
  font-size: 1.12em;
  letter-spacing: 0.06em;
  line-height: 1.2;
  position: relative;
  padding-bottom: 0.12em;
  background: linear-gradient(
    105deg,
    #0d6b68 0%,
    #1aa67a 28%,
    #20c997 52%,
    #157347 78%,
    #0d6b68 100%
  );
  background-size: 240% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 2px 14px rgba(13, 107, 104, 0.22));
  animation:
    agifair-kicker-in 0.95s cubic-bezier(0.22, 1, 0.36, 1) both,
    agifair-kicker-shimmer 5s ease-in-out infinite 0.35s;
}

.agifair-teaser-kicker::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, rgba(32, 201, 151, 0.85), transparent);
  opacity: 0.85;
  transform: scaleX(0.35);
  transform-origin: left center;
  animation: agifair-kicker-line 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.25s both;
}

@keyframes agifair-kicker-in {
  from {
    opacity: 0;
    transform: translateY(12px) scale(0.94);
    filter: blur(5px) drop-shadow(0 0 0 transparent);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0) drop-shadow(0 2px 14px rgba(13, 107, 104, 0.22));
  }
}

@keyframes agifair-kicker-shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes agifair-kicker-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes agifair-kicker-line {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 0.9;
  }
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .agifair-teaser-kicker {
    color: var(--bs-primary);
    background: none;
    animation: agifair-kicker-in 0.95s cubic-bezier(0.22, 1, 0.36, 1) both;
  }
}

/* ชื่องาน — ใหญ่ เด่น + motion */
.agifair-teaser-eventname-float {
  display: block;
  margin-top: -2rem;
  margin-bottom: 0.15rem;
  animation: agifair-event-float 5.2s ease-in-out infinite 0.35s;
}

.agifair-teaser-eventname {
  display: inline-block;
  font-weight: 800;
  font-size: clamp(1.45rem, 4.5vw, 2.45rem);
  line-height: 1.2;
  letter-spacing: 0.03em;
  background: linear-gradient(
    98deg,
    #021a19 0%,
    #0d6b68 18%,
    #1db584 42%,
    #20c997 55%,
    #0f5132 78%,
    #0d6b68 100%
  );
  background-size: 280% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  filter: drop-shadow(0 4px 22px rgba(13, 107, 104, 0.32));
  animation:
    agifair-event-in 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both,
    agifair-kicker-shimmer 6.5s ease-in-out infinite 0.45s;
}

.agifair-teaser-eventtagline {
  display: block;
  margin-top: 0.35rem;
  max-width: 38rem;
  font-size: clamp(0.95rem, 2.05vw, 1.1rem);
  font-weight: 500;
  line-height: 1.65;
  color: #3a4541;
}

@keyframes agifair-event-in {
  from {
    opacity: 0;
    transform: translateY(1.35rem) scale(0.9);
    letter-spacing: 0.14em;
    filter: blur(6px) drop-shadow(0 0 0 transparent);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    letter-spacing: 0.03em;
    filter: blur(0) drop-shadow(0 4px 22px rgba(13, 107, 104, 0.32));
  }
}

@keyframes agifair-event-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-4px);
  }
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .agifair-teaser-eventname {
    color: #0a3d3b;
    background: none;
    animation: agifair-event-in 1.05s cubic-bezier(0.22, 1, 0.36, 1) 0.12s both;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agifair-teaser-kicker-wrap {
    animation: none !important;
    transform: none;
  }

  .agifair-teaser-kicker,
  .agifair-teaser-kicker::after {
    animation: none !important;
    transform: none;
    background-position: 50% 50%;
  }

  .agifair-teaser-kicker::after {
    transform: scaleX(1);
    opacity: 0.75;
  }

  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .agifair-teaser-kicker {
      background-position: 50% 50%;
    }
  }

  .agifair-teaser-eventname-float {
    animation: none !important;
    transform: none;
  }

  .agifair-teaser-eventname {
    animation: none !important;
    transform: none;
    letter-spacing: 0.03em;
    background-position: 50% 50%;
  }

  @supports ((-webkit-background-clip: text) or (background-clip: text)) {
    .agifair-teaser-eventname {
      background-position: 50% 50%;
    }
  }
}

/* ---------- Newsletter — ติดตามงาน + ข้อมูล + motion ---------- */
.agifair-newsletter-cta {
  position: relative;
  overflow: hidden;
}

.agifair-newsletter-row {
  align-items: stretch;
}

.agifair-newsletter-left {
  min-height: 220px;
}

@media (min-width: 768px) {
  .agifair-newsletter-left {
    min-height: 0;
  }
}

/* รูปยืดเต็มคอลัมน์ซ้ายตามแถว (ไม่ใช่สกรอลล์ย่อย) */
.agifair-newsletter-aspect {
  position: relative;
  width: 100%;
  min-height: min(55vw, 300px);
  flex: 1 1 auto;
  overflow: hidden;
  background: rgba(0, 0, 0, 0.12);
}

@media (min-width: 768px) {
  .agifair-newsletter-aspect {
    min-height: 280px;
  }
}

.agifair-newsletter-side-img {
  object-fit: cover;
}

.agifair-newsletter-text-col {
  position: relative;
  z-index: 2;
  border-radius: 0 1.1rem 1.1rem 0;
  overflow: visible;
}

@media (max-width: 767.98px) {
  .agifair-newsletter-text-col {
    border-radius: 0;
  }
}

.agifair-newsletter-text-col::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse 120% 80% at 80% 10%, rgba(13, 107, 104, 0.06), transparent 50%);
  pointer-events: none;
  animation: agifair-nl-bg-drift 10s ease-in-out infinite;
  z-index: 0;
  border-radius: inherit;
  opacity: 0.9;
}

@keyframes agifair-nl-bg-drift {
  0%,
  100% {
    opacity: 0.55;
    transform: translate3d(0, 0, 0) scale(1);
  }
  50% {
    opacity: 0.9;
    transform: translate3d(-18px, 10px, 0) scale(1.03);
  }
}

.agifair-newsletter-surface {
  position: relative;
  z-index: 1;
  border-left: 3px solid #c4a635;
  border-radius: 0 1.1rem 1.1rem 0;
  /* พื้นสว่าง อ่านง่าย — ตัดกับตัวอักษรเข้ม */
  background: linear-gradient(165deg, #f6faf9 0%, #ecf5f2 45%, #e2f0ec 100%);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.95),
    0 12px 36px rgba(0, 40, 35, 0.12);
}

@media (max-width: 767.98px) {
  .agifair-newsletter-surface {
    border-radius: 0;
    border-left-width: 0;
    border-top: 3px solid rgba(255, 224, 102, 0.45);
    height: auto;
  }
}

.agifair-newsletter-panel {
  position: relative;
  z-index: 1;
  color: #1b2f2c;
}

.agifair-newsletter-divider-b {
  border-color: rgba(13, 107, 104, 0.18) !important;
}

.agifair-newsletter-divider-t {
  border-top: 1px solid rgba(13, 107, 104, 0.18) !important;
}

.agifair-newsletter-venue,
.agifair-newsletter-contact-label {
  color: #1b2f2c;
}

.agifair-newsletter-tel-sep {
  color: rgba(0, 0, 0, 0.35);
}

.agifair-newsletter-event-title {
  font-size: clamp(1.2rem, 2.4vw, 1.75rem);
  line-height: 1.25;
  color: #041f1d;
  text-shadow: none;
}

.agifair-newsletter-event-sub {
  font-size: clamp(1rem, 2.15vw, 1.22rem);
  color: #2a4541;
  opacity: 1;
}

.agifair-newsletter-follow-label {
  color: #3a524e;
  opacity: 1;
}

.agifair-newsletter-url {
  display: inline-flex;
  align-items: center;
  color: #0a5a54 !important;
  font-weight: 600;
  padding: 0.3rem 0.5rem;
  margin-left: -0.5rem;
  border-radius: 0.4rem;
  text-decoration: none !important;
  transition:
    color 0.2s ease,
    transform 0.25s ease,
    background 0.2s ease,
    box-shadow 0.25s ease;
}

.agifair-newsletter-url:hover {
  color: #023632 !important;
  transform: translateX(4px);
  background: rgba(13, 107, 104, 0.08);
  box-shadow: 0 4px 14px rgba(13, 107, 104, 0.12);
}

.agifair-newsletter-url:focus-visible {
  outline: 2px solid #0d6b68;
  outline-offset: 3px;
}

.agifair-newsletter-chip {
  height: 100%;
  color: #142b28;
  background: #fff;
  border: 1px solid rgba(13, 107, 104, 0.2);
  border-radius: 0.85rem;
  padding: 0.7rem 1rem;
  font-weight: 600;
  line-height: 1.45;
  box-shadow: 0 4px 16px rgba(0, 40, 35, 0.08);
  transition:
    transform 0.28s ease,
    border-color 0.28s ease,
    background 0.28s ease,
    box-shadow 0.28s ease;
}

.agifair-newsletter-chip:hover {
  transform: translateY(-2px);
  border-color: rgba(13, 107, 104, 0.4);
  background: #fbfffe;
  box-shadow: 0 8px 22px rgba(0, 40, 35, 0.12);
}

.agifair-newsletter-mapbtn {
  color: #fff !important;
  background: var(--bs-primary) !important;
  border: none;
  animation: agifair-nl-map-pulse 2.7s ease-in-out infinite;
  transition:
    transform 0.22s ease,
    background 0.22s ease,
    color 0.22s ease,
    box-shadow 0.22s ease;
}

.agifair-newsletter-mapbtn:hover {
  background: #0a5754 !important;
  color: #fff !important;
  transform: scale(1.04);
  animation: none;
  box-shadow: 0 6px 20px rgba(13, 107, 104, 0.35);
}

.agifair-newsletter-mapbtn:focus-visible {
  outline: 2px solid #0d6b68;
  outline-offset: 3px;
}

@keyframes agifair-nl-map-pulse {
  0%,
  100% {
    box-shadow: 0 0 0 0 rgba(13, 107, 104, 0.35);
  }
  60% {
    box-shadow: 0 0 0 10px rgba(13, 107, 104, 0);
  }
}

.agifair-newsletter-tel {
  color: #063531 !important;
  text-decoration: none !important;
  font-weight: 700;
  transition:
    color 0.2s ease,
    background 0.2s ease;
}

.agifair-newsletter-tel:hover {
  color: #021a18 !important;
  text-decoration: underline !important;
  text-underline-offset: 0.15em;
}

.agifair-newsletter-tel:focus-visible {
  outline: 2px solid #0d6b68;
  outline-offset: 2px;
  border-radius: 0.25rem;
}

@keyframes agifair-nl-rise {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.agifair-nl-item {
  opacity: 0;
  animation: agifair-nl-rise 0.74s cubic-bezier(0.22, 1, 0.36, 1) forwards;
}

.agifair-nl-item--d0 {
  animation-delay: 0.05s;
}

.agifair-nl-item--d1 {
  animation-delay: 0.1s;
}

.agifair-nl-item--d2 {
  animation-delay: 0.16s;
}

.agifair-nl-item--d3 {
  animation-delay: 0.22s;
}

.agifair-nl-item--d4 {
  animation-delay: 0.28s;
}

.agifair-nl-item--d5 {
  animation-delay: 0.34s;
}

.agifair-nl-item--d6 {
  animation-delay: 0.4s;
}

.agifair-nl-item--d7 {
  animation-delay: 0.46s;
}

.agifair-nl-item--d8 {
  animation-delay: 0.52s;
}

.agifair-nl-item--d9 {
  animation-delay: 0.58s;
}

.agifair-nl-item--d10 {
  animation-delay: 0.64s;
}

@media (prefers-reduced-motion: reduce) {
  .agifair-newsletter-text-col::before {
    animation: none !important;
    transform: none !important;
    opacity: 0.65;
  }

  .agifair-nl-item {
    opacity: 1 !important;
    animation: none !important;
    transform: none !important;
  }

  .agifair-newsletter-mapbtn {
    animation: none !important;
  }
}

/* ---------- หัวข้อ Hero ของหน้าย่อย (page title) ---------- */
.hero-header h1.agifair-page-title {
  position: relative;
  display: inline-block;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.1;
  font-size: clamp(2.4rem, 6.8vw, 4.6rem);
  margin: 0;
  padding-bottom: 0.55rem;
  perspective: 800px;
}

.agifair-page-title-text {
  display: inline-block;
  background: linear-gradient(
    100deg,
    #0d3b25 0%,
    #198754 22%,
    #f6e36a 48%,
    #ffffff 60%,
    #ffe680 72%,
    #198754 90%,
    #0d3b25 100%
  );
  background-size: 260% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-weight: 800;
  text-shadow: 0 2px 0 rgba(255, 255, 255, 0.18);
  filter: drop-shadow(0 6px 22px rgba(13, 59, 37, 0.28));
  animation:
    agifair-pagetitle-in 1.05s cubic-bezier(0.22, 1, 0.36, 1) both,
    agifair-pagetitle-shimmer 6s ease-in-out infinite 0.4s;
}

.agifair-page-title-underline {
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(255, 255, 255, 0.85) 18%,
    #ffe680 50%,
    rgba(255, 255, 255, 0.85) 82%,
    transparent 100%
  );
  transform-origin: left center;
  transform: scaleX(0);
  opacity: 0;
  animation: agifair-pagetitle-underline 1.1s cubic-bezier(0.22, 1, 0.36, 1) 0.55s forwards;
  box-shadow: 0 4px 18px rgba(255, 255, 255, 0.35);
}

/*
 * พื้น hero สว่าง (เช่น about.html)
 * ไม่ใช้ gradient + background-clip:text + drop-shadow — กันพื้นสี่เหลี่ยม/กล่องเงาเหมือนหน้า training
 * ขนาด + motion สอดคล้องกับ conference subhero (reuse keyframes เดียวกัน)
 */
.hero-header.bg-light h1.agifair-page-title {
  font-size: clamp(1.5rem, 2.8vw + 0.35rem, 2.35rem);
  line-height: 1.28;
  padding-bottom: 0.48rem;
  animation: conference-subhero-title-block-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.hero-header.bg-light h1.agifair-page-title .agifair-page-title-text {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: #0f5132;
  filter: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.9);
  animation: conference-subhero-title-float 4.5s ease-in-out infinite 0.9s;
}

.hero-header.bg-light .agifair-page-title-underline {
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(25, 135, 84, 0.35) 28%,
    #c9a227 50%,
    rgba(25, 135, 84, 0.35) 72%,
    transparent 100%
  );
  box-shadow: none;
  animation: conference-subhero-underline-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both,
    conference-subhero-underline-shimmer 3.2s ease-in-out infinite 1.2s;
}

/*
 * ประชุมวิชาการ — subhero
 * ไม่ใช้ background-clip:text + drop-shadow (บางเบราว์เซอร์จะเป็นกล่องพื้นเข้มหลังตัวอักษร)
 * ขนาดตัวอักษร: ไม่ใช้ clamp ใหญ่ของ .hero-header h1.agifair-page-title — ใกล้ display-4/5
 * motion: เข้าฉากที่ h1 + ลอยเบาๆ ที่ span (ไม่ชน transform กัน)
 */
.conference-about-subhero.hero-header h1.agifair-page-title {
  font-size: clamp(1.5rem, 2.8vw + 0.35rem, 2.15rem);
  line-height: 1.28;
  padding-bottom: 0.48rem;
  animation: conference-subhero-title-block-in 1s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.conference-about-subhero.hero-header h1.agifair-page-title .agifair-page-title-text {
  background: none;
  -webkit-background-clip: unset;
  background-clip: unset;
  color: #1a2e4e;
  filter: none;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
  animation: conference-subhero-title-float 4.5s ease-in-out infinite 0.9s;
}

.conference-about-subhero.hero-header .agifair-page-title-underline {
  height: 4px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    rgba(212, 175, 55, 0.65) 35%,
    #d4af37 50%,
    rgba(212, 175, 55, 0.65) 65%,
    transparent 100%
  );
  box-shadow: none;
  animation: conference-subhero-underline-in 0.85s cubic-bezier(0.22, 1, 0.36, 1) 0.35s both,
    conference-subhero-underline-shimmer 3.2s ease-in-out infinite 1.2s;
}

@keyframes conference-subhero-title-block-in {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes conference-subhero-title-float {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-3px);
  }
}

@keyframes conference-subhero-underline-in {
  from {
    transform: scaleX(0);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@keyframes conference-subhero-underline-shimmer {
  0%,
  100% {
    opacity: 0.88;
    filter: brightness(1);
  }
  50% {
    opacity: 1;
    filter: brightness(1.12);
  }
}

@keyframes agifair-pagetitle-in {
  0% {
    opacity: 0;
    transform: translateY(28px) rotateX(-12deg) scale(0.94);
    letter-spacing: 0.18em;
    filter: blur(8px) drop-shadow(0 0 0 transparent);
  }
  60% {
    opacity: 1;
    transform: translateY(-3px) rotateX(0deg) scale(1.01);
    letter-spacing: 0.025em;
    filter: blur(0) drop-shadow(0 6px 22px rgba(13, 59, 37, 0.28));
  }
  100% {
    opacity: 1;
    transform: translateY(0) rotateX(0deg) scale(1);
    letter-spacing: 0.02em;
    filter: blur(0) drop-shadow(0 6px 22px rgba(13, 59, 37, 0.28));
  }
}

@keyframes agifair-pagetitle-shimmer {
  0%,
  100% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
}

@keyframes agifair-pagetitle-underline {
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

@supports not ((-webkit-background-clip: text) or (background-clip: text)) {
  .agifair-page-title-text {
    color: #fff;
    background: none;
    text-shadow: 0 2px 12px rgba(13, 59, 37, 0.45);
  }

  .hero-header.bg-light .agifair-page-title-text {
    color: #0f5132;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.95);
  }

  .conference-about-subhero.hero-header .agifair-page-title-text {
    color: #1a2e4e;
    background: none;
    text-shadow: 0 1px 0 rgba(255, 255, 255, 0.75);
    -webkit-background-clip: unset;
    background-clip: unset;
  }
}

@media (prefers-reduced-motion: reduce) {
  .agifair-page-title-text,
  .agifair-page-title-underline {
    animation: none !important;
    transform: none !important;
    opacity: 1 !important;
    background-position: 50% 50% !important;
    letter-spacing: 0.02em !important;
    filter: none !important;
  }

  .conference-about-subhero.hero-header h1.agifair-page-title .agifair-page-title-text {
    animation: none !important;
    transform: none !important;
  }

  .conference-about-subhero.hero-header h1.agifair-page-title {
    animation: none !important;
    transform: none !important;
  }

  .conference-about-subhero.hero-header .agifair-page-title-underline {
    animation: none !important;
    filter: none !important;
  }

  .hero-header.bg-light h1.agifair-page-title {
    animation: none !important;
    transform: none !important;
  }

  .hero-header.bg-light h1.agifair-page-title .agifair-page-title-text {
    animation: none !important;
    transform: none !important;
  }

  .hero-header.bg-light .agifair-page-title-underline {
    animation: none !important;
    filter: none !important;
  }

  .agifair-page-title-underline {
    transform: scaleX(1) !important;
  }
}

