/* =================================================================
   EnmaThailand – ธีมน้ำเงินเข้ม
   โหลดต่อท้าย style.css / custom.css ทุกหน้า
   ================================================================= */

/* IBM Plex Sans Thai (SIL Open Font License) — เก็บในเว็บเอง ไม่ต้องพึ่ง Google Fonts */
@font-face{font-family:'IBM Plex Sans Thai';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/ibm-plex-sans-thai-thai-400-normal.woff2) format('woff2');unicode-range:U+0E01-0E5B,U+200C-200D,U+25CC;}
@font-face{font-family:'IBM Plex Sans Thai';font-style:normal;font-display:swap;font-weight:400;src:url(fonts/ibm-plex-sans-thai-latin-400-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'IBM Plex Sans Thai';font-style:normal;font-display:swap;font-weight:500;src:url(fonts/ibm-plex-sans-thai-thai-500-normal.woff2) format('woff2');unicode-range:U+0E01-0E5B,U+200C-200D,U+25CC;}
@font-face{font-family:'IBM Plex Sans Thai';font-style:normal;font-display:swap;font-weight:500;src:url(fonts/ibm-plex-sans-thai-latin-500-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'IBM Plex Sans Thai';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/ibm-plex-sans-thai-thai-600-normal.woff2) format('woff2');unicode-range:U+0E01-0E5B,U+200C-200D,U+25CC;}
@font-face{font-family:'IBM Plex Sans Thai';font-style:normal;font-display:swap;font-weight:600;src:url(fonts/ibm-plex-sans-thai-latin-600-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}
@font-face{font-family:'IBM Plex Sans Thai';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/ibm-plex-sans-thai-thai-700-normal.woff2) format('woff2');unicode-range:U+0E01-0E5B,U+200C-200D,U+25CC;}
@font-face{font-family:'IBM Plex Sans Thai';font-style:normal;font-display:swap;font-weight:700;src:url(fonts/ibm-plex-sans-thai-latin-700-normal.woff2) format('woff2');unicode-range:U+0000-00FF,U+0131,U+0152-0153,U+02BB-02BC,U+02C6,U+02DA,U+02DC,U+0304,U+0308,U+0329,U+2000-206F,U+2074,U+20AC,U+2122,U+2191,U+2193,U+2212,U+2215,U+FEFF,U+FFFD;}

:root {
  --navy-950: #061430;   /* footer */
  --navy-900: #0B2350;   /* สีหลัก */
  --navy-700: #17407F;   /* ปุ่ม / ลิงก์ */
  --steel-100: #E8EEF6;  /* พื้นหลังส่วนรอง */
  --paper: #F5F7FB;      /* พื้นหลังหลัก */
  --ink: #13203A;        /* ตัวอักษร */
  --muted: #5A6B85;
  --amber: #F5A623;      /* สีหมวกนิรภัยจากโลโก้ ใช้เป็นจุดเน้นเท่านั้น */
  --line: #DDE4EE;
  --font: 'IBM Plex Sans Thai', 'Kanit', Tahoma, sans-serif;
  --radius: 6px;
}

/* ---------- พื้นฐาน ---------- */
body, body.stretched, .stretched #wrapper {
  font-family: var(--font);
  color: var(--ink);
  background: var(--paper);
}
h1, h2, h3, h4, h5, h6,
.entry-title h2, .entry-title h3, #page-title h1 {
  font-family: var(--font);
  color: var(--ink);
  letter-spacing: 0;
}
a { color: var(--navy-700); }
a:hover { color: var(--navy-900); }
:focus-visible { outline: 3px solid var(--amber); outline-offset: 2px; }
#content { background: var(--paper); }
#content .content-wrap { padding: 0; }

/* ---------- Header ---------- */
.enma-header {
  position: sticky; top: 0; z-index: 399;
  background: var(--navy-900);
  border-bottom: 3px solid var(--amber);
}
.enma-header .container {
  display: flex; align-items: center; justify-content: space-between;
  min-height: 72px; gap: 16px;
}
.enma-brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: #fff; min-width: 0; }
.enma-brand:hover { color: #fff; }
.enma-brand img { width: 52px; height: 52px; flex: 0 0 52px; }
.enma-brand-text { display: flex; flex-direction: column; line-height: 1.25; min-width: 0; }
.enma-brand-text strong { font-size: 17px; font-weight: 600; color: #fff; }
.enma-brand-text small { font-size: 12px; color: #A9BCD8; }
.enma-nav ul { display: flex; gap: 4px; list-style: none; margin: 0; padding: 0; }
.enma-nav a {
  display: block; padding: 10px 14px; border-radius: var(--radius);
  color: #DCE5F2; font-size: 15px; font-weight: 500; text-decoration: none;
}
.enma-nav a:hover { background: rgba(255,255,255,.08); color: #fff; }
.enma-nav a.is-active { color: #fff; box-shadow: inset 0 -3px 0 var(--amber); border-radius: 0; }
.enma-nav-toggle {
  display: none; background: transparent; border: 1px solid rgba(255,255,255,.3);
  color: #fff; border-radius: var(--radius); width: 44px; height: 40px; font-size: 20px; line-height: 1;
}
@media (max-width: 991.98px) {
  .enma-nav-toggle { display: block; }
  .enma-nav { position: absolute; left: 0; right: 0; top: 100%; background: var(--navy-900); border-bottom: 3px solid var(--amber); display: none; }
  .enma-nav.is-open { display: block; }
  .enma-nav ul { flex-direction: column; padding: 8px 16px 16px; }
  .enma-nav a.is-active { box-shadow: inset 3px 0 0 var(--amber); }
}
@media (max-width: 575.98px) {
  .enma-brand-text strong { font-size: 14px; }
  .enma-brand-text small { display: none; }
  .enma-brand img { width: 44px; height: 44px; flex-basis: 44px; }
}

/* ---------- Hero (หน้าแรก) ---------- */
.enma-hero {
  position: relative; overflow: hidden; color: #fff;
  background: var(--navy-900) url('../images/slider/swiper/1.jpg') center bottom / cover no-repeat;
}
.enma-hero::before {   /* ชั้นสีน้ำเงิน */
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(100deg, rgba(11,35,80,.97) 0%, rgba(11,35,80,.9) 45%, rgba(11,35,80,.55) 100%);
}
.enma-hero::after {    /* ตารางกระดาษเขียนแบบ (blueprint) */
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(rgba(255,255,255,.09) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.09) 1px, transparent 1px),
    linear-gradient(rgba(255,255,255,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.035) 1px, transparent 1px);
  background-size: 160px 160px, 160px 160px, 32px 32px, 32px 32px;
  -webkit-mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.5) 60%, transparent 100%);
          mask-image: linear-gradient(90deg, #000 0%, rgba(0,0,0,.5) 60%, transparent 100%);
}
.enma-hero .container { position: relative; z-index: 1; padding-top: 96px; padding-bottom: 104px; }
.enma-hero-inner { display: flex; align-items: center; gap: 40px; }
.enma-hero-emblem { flex: 0 0 auto; width: 168px; height: 168px; filter: drop-shadow(0 12px 28px rgba(0,0,0,.45)); }
.enma-hero h1 {
  color: #fff; font-weight: 700; margin: 0 0 8px;
  font-size: clamp(28px, 4.4vw, 52px); line-height: 1.25; max-width: 16em;
}
.enma-hero-en { color: #A9BCD8; font-size: clamp(15px, 1.6vw, 19px); font-weight: 500; margin: 0 0 20px; }
.enma-hero-motto {
  display: inline-block; margin: 0 0 32px; padding-left: 14px;
  border-left: 4px solid var(--amber); color: #EAF0F8; font-size: clamp(16px, 1.8vw, 20px);
}
.enma-hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
@media (max-width: 767.98px) {
  .enma-hero .container { padding-top: 56px; padding-bottom: 64px; }
  .enma-hero-inner { flex-direction: column; align-items: flex-start; gap: 20px; }
  .enma-hero-emblem { width: 104px; height: 104px; }
  .enma-hero { background-position: 100% 100%; }
  .enma-hero::before { background: rgba(11,35,80,.93); }
}

/* ---------- ปุ่ม ---------- */
.enma-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 22px; border-radius: var(--radius); border: 2px solid transparent;
  font-family: var(--font); font-size: 16px; font-weight: 600; text-decoration: none; line-height: 1.2;
  transition: background-color .15s, color .15s, border-color .15s;
}
.enma-btn-amber { background: var(--amber); color: var(--navy-900); }
.enma-btn-amber:hover { background: #FFB940; color: var(--navy-900); }
.enma-btn-ghost { border-color: rgba(255,255,255,.55); color: #fff; }
.enma-btn-ghost:hover { background: #fff; color: var(--navy-900); }
.enma-btn-outline { border-color: var(--navy-700); color: var(--navy-700); background: transparent; padding: 9px 18px; font-size: 15px; }
.enma-btn-outline:hover { background: var(--navy-900); border-color: var(--navy-900); color: #fff; }

/* ---------- ส่วนเนื้อหา ---------- */
.enma-section { padding: 72px 0; }
.enma-section-alt { background: var(--steel-100); }
.enma-section-head {
  display: flex; align-items: flex-end; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  margin-bottom: 32px;
}
.enma-section-head h2 { margin: 0; font-size: clamp(24px, 2.6vw, 32px); font-weight: 700; color: var(--navy-900); }
.enma-section-head h2::after { content: ""; display: block; width: 48px; height: 4px; background: var(--amber); margin-top: 10px; }
.enma-section-head p { margin: 6px 0 0; color: var(--muted); }

/* ส่วนต้อนรับ */
.enma-welcome { display: grid; grid-template-columns: minmax(0, 340px) minmax(0, 1fr); gap: 64px; align-items: center; }
.enma-welcome-photo { position: relative; margin: 0 16px 16px 0; }
.enma-welcome-photo::before {
  content: ""; position: absolute; inset: 16px -16px -16px 16px;
  border: 3px solid var(--amber); border-radius: var(--radius);
}
.enma-welcome-photo img { position: relative; width: 100%; border-radius: var(--radius); display: block; }
.enma-welcome h2 { font-size: clamp(24px, 2.8vw, 34px); font-weight: 700; color: var(--navy-900); margin: 0 0 6px; line-height: 1.35; }
.enma-welcome .en { color: var(--muted); font-size: 16px; margin: 0 0 24px; }
.enma-welcome .motto { font-size: 20px; color: var(--navy-700); font-weight: 600; margin: 0 0 16px; }
.enma-welcome p { font-size: 17px; line-height: 1.8; max-width: 38em; }
@media (max-width: 767.98px) {
  .enma-welcome { grid-template-columns: 1fr; gap: 40px; }
  .enma-welcome-photo { max-width: 280px; }
}

/* การ์ดข่าว / บทความ */
.enma-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 28px; }
@media (max-width: 991.98px) { .enma-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 575.98px) {
  .enma-grid { gap: 14px; }
  .enma-card-body { padding: 12px; }
  .enma-card h3 { font-size: 14px; }
  .enma-card p { display: none; }
  .enma-card time { font-size: 12px; }
}
.enma-card {
  display: flex; flex-direction: column; background: #fff; border-radius: var(--radius);
  border: 1px solid var(--line); overflow: hidden; height: 100%;
}
/* แสดงภาพเต็ม (ไม่ตัดโปสเตอร์) บนพื้นหลังภาพเดียวกันแบบเบลอ */
.enma-card-img { position: relative; display: block; aspect-ratio: 4 / 5; background: var(--navy-900); overflow: hidden; }
.enma-card-img::before {
  content: ""; position: absolute; inset: 0; background: var(--bg) center / cover no-repeat;
  filter: blur(18px) brightness(.6); transform: scale(1.25);
}
.enma-card-img img { position: relative; width: 100%; height: 100%; object-fit: contain; transition: transform .3s ease; }
.enma-card:hover .enma-card-img img { transform: scale(1.03); }
.enma-card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 18px 18px; }
.enma-card h3 { font-size: 16px; font-weight: 600; line-height: 1.5; margin: 0 0 10px; }
.enma-card h3 a { color: var(--ink); text-decoration: none;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.enma-card h3 a:hover { color: var(--navy-700); }
.enma-card p { font-size: 14px; color: var(--muted); line-height: 1.6; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.enma-card time { margin-top: auto; font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; }
.enma-card time i { color: var(--amber); }

/* ---------- ผู้สนับสนุน ---------- */
.enma-sponsor-main { background: var(--navy-900); position: relative; }
.enma-sponsor-main .enma-section-head h2 { color: #fff; }
.enma-sponsor-main .enma-section-head p { color: #A9BCD8; }
.enma-logo-grid { display: grid; gap: 20px; list-style: none; margin: 0; padding: 0; }
.enma-logo-grid.is-main { grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.enma-logo-grid.is-event { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 16px; }
.enma-logo-tile {
  display: flex; align-items: center; justify-content: center; background: #fff;
  border-radius: var(--radius); border: 1px solid var(--line); text-decoration: none;
}
.is-main .enma-logo-tile { aspect-ratio: 5 / 3; padding: 28px 32px; border: 0; }
.is-event .enma-logo-tile { aspect-ratio: 3 / 2; padding: 16px 20px; }
.enma-logo-tile img { max-width: 100%; max-height: 100%; object-fit: contain; }
a.enma-logo-tile:hover { box-shadow: 0 0 0 3px var(--amber); }
@media (max-width: 479.98px) {
  .enma-logo-grid.is-main { grid-template-columns: 1fr; }
  .enma-logo-grid.is-event { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- Page title (หน้ารายการ / รายละเอียด) ---------- */
#page-title {
  background: var(--navy-900); border-bottom: 3px solid var(--amber); padding: 48px 0;
}
#page-title h1 { color: #fff; font-weight: 700; font-size: clamp(22px, 2.6vw, 30px); }
#page-title span { color: #A9BCD8; font-family: var(--font); font-size: 17px; }

/* หน้ารายการข่าว/บทความเดิม (Canvas) */
.post-grid .entry .grid-inner {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; height: 100%;
}
.post-grid .entry .entry-image { margin-bottom: 0; aspect-ratio: 1 / 1; background: var(--steel-100); overflow: hidden; }
.post-grid .entry .entry-image a { display: block; height: 100%; }
.post-grid .entry .entry-image img { width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.post-grid .entry .entry-title, .post-grid .entry .entry-meta, .post-grid .entry .entry-content { padding: 0 16px; }
.post-grid .entry .entry-title { padding-top: 16px; }
.post-grid .entry .entry-title h2 { text-transform: none; font-size: 16px; font-weight: 600; line-height: 1.5; }
.post-grid .entry .entry-title h2 a { color: var(--ink); }
.post-grid .entry .entry-title p { font-size: 14px; color: var(--muted); }
.post-grid .entry .entry-content { padding-bottom: 16px; }
.entry-meta li, .entry-meta li a { color: var(--muted); font-family: var(--font); }
.entry-meta li i { color: var(--amber); }
.more-link { color: var(--navy-700); border-bottom-color: var(--amber); font-style: normal; font-family: var(--font); }

/* หน้ารายละเอียด */
.single-post .entry { border-bottom: 0; }
.single-post .entry-title h2 { text-transform: none; font-size: clamp(22px, 2.4vw, 30px); font-weight: 700; color: var(--navy-900); line-height: 1.45; }
.single-post .entry-content { font-size: 17px; line-height: 1.85; max-width: 46em; }
#content .content-wrap > .container { padding-top: 56px; padding-bottom: 56px; }

/* ---------- Footer ---------- */
#footer.enma-footer, .enma-footer { background: var(--navy-950); color: #A9BCD8; border-top: 0; margin: 0; }
.enma-footer-main { padding: 56px 0 40px; display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr); gap: 40px; }
.enma-footer h4 { color: #fff; font-size: 16px; font-weight: 600; margin: 0 0 14px; }
.enma-footer-brand { display: flex; gap: 14px; align-items: flex-start; }
.enma-footer-brand img { width: 64px; height: 64px; }
.enma-footer-brand strong { display: block; color: #fff; font-size: 17px; font-weight: 600; line-height: 1.4; }
.enma-footer-brand span { font-size: 14px; }
.enma-footer ul { list-style: none; margin: 0; padding: 0; }
.enma-footer li { margin-bottom: 8px; }
.enma-footer a { color: #DCE5F2; text-decoration: none; }
.enma-footer a:hover { color: var(--amber); }
.enma-footer li i { color: var(--amber); margin-right: 8px; }
.enma-footer-bottom { border-top: 1px solid rgba(255,255,255,.1); padding: 18px 0; font-size: 13px; }
@media (max-width: 767.98px) { .enma-footer-main { grid-template-columns: 1fr; gap: 28px; } }

#gotoTop { background-color: var(--navy-700); }
#gotoTop:hover { background-color: var(--amber); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; animation: none !important; scroll-behavior: auto !important; }
}

/* ---------- แกลเลอรีภาพในหน้ารายละเอียดข่าว ----------
   แต่ละแถวสูงเท่ากัน ความกว้างของภาพตามสัดส่วนจริง (--r = กว้าง/สูง) จึงไม่ตัดขอบโปสเตอร์/เอกสาร */
.enma-gallery {
  --row: 260px;
  display: flex; flex-wrap: wrap; gap: 10px;
  margin: 24px 0 40px;
}
.enma-gallery::after { content: ""; flex-grow: 999999; }   /* แถวสุดท้ายไม่ยืดภาพจนใหญ่เกิน */
.enma-gallery-item {
  position: relative; display: block; overflow: hidden;
  flex-grow: var(--r); flex-basis: calc(var(--r) * var(--row));
  max-width: 100%;
  border-radius: var(--radius); background: var(--steel-100);
}
.enma-gallery-item img {
  display: block; width: 100%; height: auto; aspect-ratio: var(--r);
  transition: transform .3s ease, filter .3s ease;
}
.enma-gallery-item::after {   /* ไอคอนขยายเมื่อชี้ */
  content: "\2922"; position: absolute; right: 10px; bottom: 10px;
  width: 34px; height: 34px; border-radius: 50%;
  background: rgba(11,35,80,.85); color: #fff; font-size: 18px; line-height: 34px; text-align: center;
  opacity: 0; transition: opacity .2s ease;
}
.enma-gallery-item:hover img { transform: scale(1.03); filter: brightness(.92); }
.enma-gallery-item:hover::after, .enma-gallery-item:focus-visible::after { opacity: 1; }
.enma-gallery.is-single .enma-gallery-item { flex: 0 1 auto; width: calc(var(--r) * 560px); }
@media (max-width: 767.98px) { .enma-gallery { --row: 170px; gap: 8px; } .enma-gallery.is-single .enma-gallery-item { width: 100%; } }
@media (max-width: 479.98px) { .enma-gallery { --row: 150px; gap: 6px; } }

/* ---------- เนื้อหาที่จัดรูปแบบจากตัวแก้ไข (WYSIWYG) ---------- */
.single-post .entry-content h2,
.single-post .entry-content h3,
.single-post .entry-content h4 { color: var(--navy-900); font-weight: 700; line-height: 1.4; margin: 1.4em 0 .5em; }
.single-post .entry-content h2 { font-size: clamp(22px, 2.2vw, 26px); }
.single-post .entry-content h3 { font-size: clamp(19px, 1.9vw, 21px); }
.single-post .entry-content h4 { font-size: 18px; }
.single-post .entry-content p { margin: 0 0 1em; }
.single-post .entry-content ul,
.single-post .entry-content ol { margin: 0 0 1em 1.4em; padding-left: .4em; }
.single-post .entry-content ul { list-style: disc; }
.single-post .entry-content ol { list-style: decimal; }
.single-post .entry-content li { margin-bottom: .35em; }
.single-post .entry-content li::marker { color: var(--navy-700); }
.single-post .entry-content blockquote {
  margin: 1.2em 0; padding: .6em 1.2em; border-left: 4px solid var(--amber);
  background: var(--steel-100); font-size: inherit; font-style: normal;
}
.single-post .entry-content a { color: var(--navy-700); text-decoration: underline; text-underline-offset: 3px; }
.single-post .entry-content blockquote p:last-child { margin-bottom: 0; }

/* ---------- Main Sponsor: การ์ดใหญ่ (หน้าแรก) ----------
   แถวสุดท้ายจัดกึ่งกลาง เช่น 7 บริษัท = 4 + 3 */
.enma-sponsor-cards { display: flex; flex-wrap: wrap; justify-content: center; gap: 24px; }
.enma-sponsor-card {
  flex: 0 1 calc((100% - 72px) / 4); min-width: 230px;
  display: flex; flex-direction: column; background: #fff; border-radius: var(--radius); overflow: hidden;
  border-top: 4px solid var(--amber);
}
.enma-sponsor-card-logo {
  display: flex; align-items: center; justify-content: center;
  aspect-ratio: 16 / 9; padding: 24px 28px; background: #fff; border-bottom: 1px solid var(--line);
}
.enma-sponsor-card-logo img { max-width: 100%; max-height: 100%; object-fit: contain; }
.enma-sponsor-card-body { display: flex; flex-direction: column; flex: 1; padding: 16px 20px 20px; }
.enma-sponsor-card h3 { font-size: 17px; font-weight: 700; color: var(--navy-900); line-height: 1.45; margin: 0 0 6px; }
.enma-sponsor-card p { font-size: 14px; line-height: 1.65; color: var(--muted); margin: 0 0 14px; }
.enma-sponsor-card-link {
  margin-top: auto; align-self: flex-start; font-size: 14px; font-weight: 600; color: var(--navy-700);
  text-decoration: none; border-bottom: 2px solid var(--amber); padding-bottom: 2px;
}
.enma-sponsor-card-link:hover { color: var(--navy-900); }
a.enma-sponsor-card-logo:hover img { transform: scale(1.04); }
.enma-sponsor-card-logo img { transition: transform .25s ease; }
@media (max-width: 991.98px) { .enma-sponsor-card { flex-basis: calc((100% - 24px) / 2); } }
@media (max-width: 575.98px) { .enma-sponsor-cards { gap: 16px; } .enma-sponsor-card { flex-basis: 100%; min-width: 0; } }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- แถบโลโก้ผู้สนับสนุนทุกหน้า (เหนือ footer) 3 บรรทัด ---------- */
.enma-sponsor-strip { background: #fff; border-top: 1px solid var(--line); padding: 40px 0 44px; }
.enma-sponsor-strip h2 { font-size: 18px; font-weight: 700; color: var(--navy-900); text-align: center; margin: 0 0 8px; }
.enma-strip-row { padding: 18px 0; }
.enma-strip-row + .enma-strip-row { border-top: 1px solid var(--line); }
.enma-strip-label { text-align: center; font-size: 13px; font-weight: 600; color: var(--muted); margin: 0 0 14px; }
.enma-strip-row ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; justify-content: center; align-items: center;
}
.enma-strip-row li a, .enma-strip-row li > span { display: flex; align-items: center; justify-content: center; }
.enma-strip-row img { max-width: 100%; max-height: 100%; object-fit: contain; transition: transform .2s ease; }
.enma-strip-row a:hover img { transform: scale(1.05); }
/* ขนาดโลโก้: is-lg = Main Sponsor และ Event Sponsor, is-md = Event Sponsor Premium, is-sm = สำรองไว้ */
.enma-strip-row.is-lg ul { gap: 20px 40px; max-width: 860px; margin: 0 auto; }   /* แถวละไม่เกิน 4 โลโก้ */
.enma-strip-row.is-lg li a, .enma-strip-row.is-lg li > span { width: 180px; height: 84px; }
.enma-strip-row.is-md ul { gap: 16px 28px; }
.enma-strip-row.is-md li a, .enma-strip-row.is-md li > span { width: 124px; height: 60px; }
.enma-strip-row.is-sm ul { gap: 12px 22px; }
.enma-strip-row.is-sm li a, .enma-strip-row.is-sm li > span { width: 88px; height: 40px; }
.enma-strip-row.is-sm img { opacity: .9; }
@media (max-width: 575.98px) {
  .enma-strip-row.is-lg li a, .enma-strip-row.is-lg li > span { width: 132px; height: 62px; }
  .enma-strip-row.is-lg ul { gap: 14px 22px; }
  .enma-strip-row.is-md li a, .enma-strip-row.is-md li > span { width: 96px; height: 46px; }
  .enma-strip-row.is-md ul { gap: 12px 18px; }
  .enma-strip-row.is-sm li a, .enma-strip-row.is-sm li > span { width: 72px; height: 34px; }
}

/* ---------- Event Sponsor Premium: แบนเนอร์ 16:9 (หน้าแรก) ----------
   2 ใบต่อแถว แถวสุดท้ายจัดกึ่งกลาง เช่น 7 บริษัท = 2+2+2+1 */
.enma-premium-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 28px; margin-bottom: 8px; }
.enma-premium-card {
  flex: 0 1 calc((100% - 28px) / 2); display: block; position: relative;
  border-radius: 10px; overflow: hidden; background: #fff;
  box-shadow: 0 1px 0 var(--line), 0 10px 28px -14px rgba(11,35,80,.35);
  transition: transform .25s ease, box-shadow .25s ease;
}
.enma-premium-card img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; }
a.enma-premium-card:hover { transform: translateY(-3px); box-shadow: 0 0 0 3px var(--amber), 0 16px 34px -14px rgba(11,35,80,.45); }
.enma-premium-fallback { aspect-ratio: 16 / 9; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 10px; padding: 24px; text-align: center; }
.enma-premium-fallback img { width: auto; max-width: 60%; max-height: 50%; aspect-ratio: auto; object-fit: contain; }
.enma-premium-fallback strong { color: var(--navy-900); font-size: 18px; }
.enma-premium-fallback small { color: var(--muted); font-size: 14px; }
.enma-subhead { font-size: 18px; font-weight: 700; color: var(--navy-900); margin: 48px 0 18px; }
@media (max-width: 767.98px) { .enma-premium-grid { gap: 16px; } .enma-premium-card { flex-basis: 100%; } }

/* ลิงก์ #sponsors #news ฯลฯ ไม่ให้หัวข้อถูก header ที่ติดด้านบนบัง */
#about, #news, #sponsors, #event-sponsors, #articles { scroll-margin-top: 75px; }

/* ---------- แถบโลโก้ท้ายหน้า: แถว Event Sponsor 8 โลโก้ต่อแถว ---------- */
.enma-strip-row.is-row8 ul {
  display: grid; grid-template-columns: repeat(8, minmax(0, 1fr)); gap: 18px 20px; justify-items: center;
}
.enma-strip-row.is-row8 li { width: 100%; display: flex; justify-content: center; }
.enma-strip-row.is-row8 li a, .enma-strip-row.is-row8 li > span { width: 100%; max-width: 124px; height: 58px; }
@media (max-width: 991.98px) { .enma-strip-row.is-row8 ul { grid-template-columns: repeat(6, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .enma-strip-row.is-row8 ul { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px 12px; } .enma-strip-row.is-row8 li a, .enma-strip-row.is-row8 li > span { height: 46px; } }

/* ---------- Event Sponsor: การ์ดกะทัดรัด 3 ใบต่อแถว ----------
   แสดง: ประเภท+ปี / โลโก้ / บรรทัดรอง (ชื่อบริษัทเต็ม) / เว็บไซต์+เบอร์โทร
   สีมาจากข้อมูลแต่ละบริษัท: --panel (แถบล่าง สีเข้ม) และ --accent (สีเน้น) */
.enma-ev-grid { display: flex; flex-wrap: wrap; justify-content: center; gap: 20px; margin-bottom: 8px; }
.enma-ev-grid > .enma-ev-card { flex: 0 1 calc((100% - 40px) / 3); }
@media (max-width: 991.98px) { .enma-ev-grid > .enma-ev-card { flex-basis: calc((100% - 20px) / 2); } }
@media (max-width: 575.98px) { .enma-ev-grid { gap: 14px; } .enma-ev-grid > .enma-ev-card { flex-basis: 100%; } }

.enma-ev-card {
  --panel: #0B2350; --accent: #F5A623;
  display: flex; flex-direction: column; overflow: hidden;
  border-radius: 10px; background: #fff; color: #fff; text-decoration: none; font-family: var(--font);
  border: 1px solid var(--line); border-top: 4px solid var(--accent);
  box-shadow: 0 8px 22px -16px rgba(11,35,80,.45);
  transition: transform .2s ease, box-shadow .2s ease;
}
a.enma-ev-card:hover { color: #fff; transform: translateY(-3px); box-shadow: 0 0 0 2px var(--amber), 0 14px 28px -16px rgba(11,35,80,.5); }

.enma-ev-top { position: relative; height: 128px; display: flex; align-items: center; justify-content: center; padding: 28px 24px 12px; background: #fff; }
.enma-ev-tag { position: absolute; left: 14px; top: 10px; display: flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; color: var(--navy-900); }
.enma-ev-tag::before { content: ""; width: 14px; height: 3px; background: var(--amber); }
.enma-ev-logo { display: flex; align-items: center; justify-content: center; width: 100%; height: 100%; }
.enma-ev-logo img { max-width: 72%; max-height: 80px; object-fit: contain; transition: transform .2s ease; }
a.enma-ev-card:hover .enma-ev-logo img { transform: scale(1.04); }

.enma-ev-body {
  flex: 1; display: flex; flex-direction: column; justify-content: center; gap: 6px;
  padding: 12px 18px 14px; background: var(--panel);
  background: linear-gradient(120deg, color-mix(in srgb, var(--panel) 82%, #fff) 0%, var(--panel) 70%);
}
.enma-ev-sub { margin: 0; color: #fff; font-size: 15px; font-weight: 600; line-height: 1.4; text-wrap: pretty; }
.enma-ev-contact { margin: 0; display: flex; flex-wrap: wrap; gap: 2px 14px; font-size: 13px; font-weight: 500; color: rgba(255,255,255,.88); }
.enma-ev-contact span { display: inline-flex; align-items: center; gap: 6px; word-break: break-all; }
.enma-ev-contact span::before { content: ""; flex: 0 0 auto; width: 7px; height: 7px; border-radius: 50%; background: var(--accent); }
.enma-ev-card [hidden] { display: none !important; }

/* ---------- ผู้สนับสนุนการจัดงาน (โลโก้) บนหน้าแรก: 5 รูปต่อแถว โลโก้ใหญ่ขึ้น ---------- */
.enma-logo-grid.is-event { grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 16px; }
.is-event .enma-logo-tile { aspect-ratio: 3 / 2; padding: 10px 14px; }
@media (max-width: 991.98px) { .enma-logo-grid.is-event { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
@media (max-width: 767.98px) { .enma-logo-grid.is-event { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; } }
@media (max-width: 479.98px) { .enma-logo-grid.is-event { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
