/*! Hybe Events v1.0 — หน้า event และ shortcode [hybe_events] */

.hev-single,
.hev-list,
.hev-lb{
  --hev-bg: #0C1418;
  --hev-card: #141D21;
  --hev-line: rgba(119,214,252,.3);
  --hev-line-strong: rgba(119,214,252,.3);
  --hev-text: #FAFDFF;
  --hev-muted: #65D0FA;
  --hev-accent: #32A0CB;
  --hev-accent-2: #77D6FC;
  --hev-radius: 16px;
  color: var(--hev-text);
}
.hev-single *,
.hev-list *{ box-sizing: border-box; }
.hev-single h1, .hev-single h2, .hev-single h3,
.hev-list h3{ color: #FAFDFF; margin: 0; font-family: inherit; letter-spacing: normal; }
.hev-single p, .hev-list p{ margin: 0; }
.hev-single a, .hev-list a{ text-decoration: none; }

.hev-eyebrow{
  font-family: "Poppins", Sans-serif; font-weight: 600; text-transform: uppercase;
  color: var(--hev-accent-2);
}

/* ---------- ปุ่ม ---------- */
.hev-single .hev-btn, .hev-list .hev-btn,
.hev-single .hev-btn:hover, .hev-list .hev-btn:hover,
.hev-single .hev-btn:focus, .hev-list .hev-btn:focus{
  display: flex; align-items: center; justify-content: center;
  min-height: 48px; padding: 10px 24px; border-radius: 999px;
  background: var(--hev-accent); color: #FAFDFF; border: 1px solid var(--hev-accent);
  font-size: 16px; font-weight: 500; text-align: center; line-height: 1.3;
  transition: background-color .2s, border-color .2s;
}
.hev-single .hev-btn:hover, .hev-list .hev-btn:hover{ background: #258EB7; border-color: #258EB7; }
.hev-single .hev-btn:focus-visible, .hev-list .hev-btn:focus-visible{ outline: 2px solid #FAFDFF; outline-offset: 3px; }
.hev-single .hev-btn.is-ghost, .hev-list .hev-btn.is-ghost{ background: transparent; color: var(--hev-accent-2); }
.hev-single .hev-btn.is-ghost:hover, .hev-list .hev-btn.is-ghost:hover{ background: rgba(58,166,214,.12); color: #FAFDFF; }
.hev-single .hev-btn.is-disabled, .hev-list .hev-btn.is-disabled{
  background: transparent; border-color: var(--hev-line); color: var(--hev-muted); cursor: default;
}

/* ---------- กล่องข้อมูล Date / Location / Join / Cost ---------- */
.hev-info{ display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 12px; margin: 0; }
.hev-info__item{ border: 1px solid var(--hev-line); border-radius: 16px; padding: 14px 16px; min-width: 0; }
.hev-info dt{ font-family: "Poppins", Sans-serif; text-transform: uppercase; color: var(--hev-muted); margin: 0 0 6px; font-weight: 600; }
.hev-info dd{ margin: 0; font-size: 18px; color: var(--hev-text); line-height: 1.5; }

/* =========================================================================
   หน้าเดี่ยว
   ========================================================================= */
body.single-event{ overflow-x: clip; }
.single-event .site-content > .ast-container{ max-width: none; padding: 0; display: block; }

.hev-single{
  width: 100vw; margin-left: calc(50% - 50vw);
  background: var(--hev-bg);
  padding-bottom: 96px;
}
.hev-wrap{ width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 24px; }

/* Hero */
.hev-hero{
  position: relative; display: flex; align-items: flex-end;
  min-height: clamp(520px, 74vh, 760px);
  padding: 120px 0 128px; isolation: isolate; overflow: hidden;
}
.hev-hero__bg{ position: absolute; inset: 0; z-index: -1; }
.hev-hero__bg img{ width: 100%; height: 100%; max-width: none; object-fit: cover; object-position: center 35%; }
.hev-hero__bg::after{
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(15,23,28,.2) 0%, rgba(15,23,28,.45) 45%, rgba(15,23,28,.92) 85%, var(--hev-bg) 100%);
}
.hev-single a.hev-back{ display: inline-block; color: #FAFDFF; letter-spacing: .02em; text-transform: uppercase; opacity: .9; }
.hev-single a.hev-back:hover{ opacity: 1; color: #FAFDFF; }
.hev-tags{ display: flex; flex-wrap: wrap; gap: 8px; margin: 18px 0 14px; }
.hev-tag{
  display: inline-flex; align-items: center; height: 26px; padding: 4px 12px; border-radius: 999px;
  font-weight: 500; letter-spacing: .03em; text-transform: uppercase;
  background: rgba(119,214,252,.3); border: 1px solid var(--hev-accent-2); color: var(--hev-accent-2);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.hev-tag--past, .hev-tag--closed{ background: rgba(15,23,28,.35); border-color: rgba(255,255,255,.4); color: rgba(255,255,255,.85); font-weight: 500; }
.hev-tag--open{ background: rgba(58,166,214,.85); border-color: transparent; color: #fff; }
.hev-tag--full{ background: rgba(230,160,60,.2); border-color: rgba(240,180,90,.6); color: #f3c27f; }
.hev-single .hev-title{
  font-size: clamp(38px, 5.6vw, 56px); line-height: 1.12;
  max-width: 980px; text-wrap: balance;
}
.hev-sub{ margin-top: 12px !important; color: #FAFDFF; max-width: 900px; line-height: 1.5; }

/* กล่องข้อมูล/สถิติ ซ้อนขอบล่างของ hero */
.hev-body{ position: relative; z-index: 1; }
.hev-body > :first-child{ margin-top: -88px; }

.hev-stats{
  display: grid; grid-template-columns: repeat(var(--hev-stat-cols, 4), minmax(0,1fr));
  border: 1px solid var(--hev-line-strong); border-radius: 16px; overflow: hidden;
  background: rgba(22,30,35,.92); -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
}
.hev-stat{ padding: 24px 24px 26px; min-width: 0; }
.hev-stat + .hev-stat{ border-left: 2px solid var(--hev-line-strong); }
.hev-single .hev-stat__label{
  font-weight: 600; letter-spacing: .02em; text-transform: uppercase;
  color: #65D0FA; line-height: 1.3;
}
.hev-single .hev-stat__value{
  font-size: clamp(24px, 2.5vw, 32px); font-weight: 500; color: #FAFDFF; line-height: 1.25;
  overflow-wrap: anywhere;
}
.hev-single .hev-stat__note{ color: #7C868A; line-height: 1.45; }

.hev-panel__cta{ display: flex; justify-content: flex-end; margin-top: 16px; }
.hev-panel__cta .hev-btn{ min-width: 320px; }

/* Sections */
.hev-section{ margin-top: 48px; }
.hev-single .hev-h2{ font-size: 24px; font-weight: 500; line-height: 1.3; }
.hev-content{ margin-top: 22px; max-width: 1000px; color: #FAFDFF; }
.hev-single .hev-content > *{ margin: 0; }
.hev-single .hev-content > * + *{ margin-top: 1.1em; }
.hev-content a{ color: var(--hev-accent-2); text-decoration: underline; }
.hev-content img{ border-radius: 10px; height: auto; }

/* Gallery — กลุ่มละ 5 ภาพ: ซ้ายใหญ่ 2 / ขวา 3 */
.hev-gal{
  --hev-row: clamp(96px, 11.5vw, 140px);
  display: grid; grid-template-columns: 3fr 2fr; grid-template-rows: repeat(6, var(--hev-row));
  gap: 22px; margin-top: 26px;
}
.hev-gal + .hev-gal{ margin-top: 22px; }
.hev-gal__item{ position: relative; display: block; overflow: hidden; border-radius: 12px; background: var(--hev-card); min-height: 0; }
.hev-gal__item img{ width: 100%; height: 100%; max-width: none; object-fit: cover; display: block; transition: transform .5s ease; }
.hev-gal__item:hover img{ transform: scale(1.03); }
.hev-gal__item:focus-visible{ outline: 2px solid var(--hev-accent-2); outline-offset: 3px; }

.hev-gal--n5 .hev-gal__item:nth-child(1){ grid-area: 1 / 1 / 4 / 2; }
.hev-gal--n5 .hev-gal__item:nth-child(2){ grid-area: 1 / 2 / 3 / 3; }
.hev-gal--n5 .hev-gal__item:nth-child(3){ grid-area: 3 / 2 / 5 / 3; }
.hev-gal--n5 .hev-gal__item:nth-child(4){ grid-area: 4 / 1 / 7 / 2; }
.hev-gal--n5 .hev-gal__item:nth-child(5){ grid-area: 5 / 2 / 7 / 3; }

.hev-gal--n4 .hev-gal__item:nth-child(1){ grid-area: 1 / 1 / 4 / 2; }
.hev-gal--n4 .hev-gal__item:nth-child(2){ grid-area: 1 / 2 / 4 / 3; }
.hev-gal--n4 .hev-gal__item:nth-child(3){ grid-area: 4 / 1 / 7 / 2; }
.hev-gal--n4 .hev-gal__item:nth-child(4){ grid-area: 4 / 2 / 7 / 3; }

.hev-gal--n3{ grid-template-rows: repeat(4, var(--hev-row)); }
.hev-gal--n3 .hev-gal__item:nth-child(1){ grid-area: 1 / 1 / 5 / 2; }
.hev-gal--n3 .hev-gal__item:nth-child(2){ grid-area: 1 / 2 / 3 / 3; }
.hev-gal--n3 .hev-gal__item:nth-child(3){ grid-area: 3 / 2 / 5 / 3; }

.hev-gal--n2{ grid-template-rows: repeat(3, var(--hev-row)); }
.hev-gal--n2 .hev-gal__item{ grid-row: 1 / 4; }

.hev-gal--n1{ grid-template-columns: 1fr; grid-template-rows: none; }
.hev-gal--n1 .hev-gal__item{ aspect-ratio: 16 / 9; }

/* CTA ท้ายหน้า (เฉพาะกิจกรรมที่ยังเปิดรับ) */
.hev-endcta{
  margin-top: 64px; padding: 28px 32px;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  border: 1px solid var(--hev-line); border-radius: var(--hev-radius); background: var(--hev-card);
}
.hev-endcta__title{ margin-top: 6px; font-size: 20px; font-weight: 600; color: #fff; }
.hev-endcta .hev-btn{ flex: 0 0 auto; min-width: 220px; }

/* =========================================================================
   Shortcode: การ์ดกิจกรรมที่กำลังจะเกิดขึ้น
   ========================================================================= */
.hev-features{ display: grid; gap: 20px; }
.hev-feature{
  display: grid; grid-template-columns: minmax(0, 47.5%) minmax(0, 1fr);
  border: 1px solid var(--hev-line); border-radius: var(--hev-radius); overflow: hidden;
  background: var(--hev-card);
}
.hev-feature__media{ position: relative; display: block; min-height: 380px; background: #0b1216; }
.hev-feature__media img{ position: absolute; inset: 0; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.hev-badge{
  position: absolute; top: 16px; left: 16px;
  padding: 6px 14px; border-radius: 999px; font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase;
  background: rgba(10,22,36,.82); color: #fff; border: 1px solid rgba(92,192,234,.55);
}
.hev-badge--full{ border-color: rgba(240,180,90,.6); color: #f3c27f; }
.hev-badge--closed{ border-color: rgba(255,255,255,.35); color: rgba(255,255,255,.8); }
.hev-feature__body{ padding: 26px 24px 22px; display: flex; flex-direction: column; gap: 8px; min-width: 0; }
.hev-list .hev-feature__title{ font-size: clamp(20px, 2vw, 26px); font-weight: 600; line-height: 1.35; margin-top: -8px; }
.hev-list .hev-feature__title a{ color: #fff; }
.hev-list .hev-feature__title a:hover{ color: var(--hev-accent-2); }
.hev-feature__desc{ font-size: 15px; line-height: 1.7; color: var(--hev-muted); }
.hev-feature .hev-btn{ margin-top: 4px; }

.hev-empty{
  display: flex; flex-direction: column; align-items: flex-start; gap: 16px;
  padding: 24px; border: 1px dashed var(--hev-line); border-radius: var(--hev-radius);
}
.hev-empty p{ font-size: 17px; color: var(--hev-text); }

/* =========================================================================
   Shortcode: การ์ดกิจกรรมที่ผ่านมาแล้ว
   ========================================================================= */
.hev-grid{ display: grid; grid-template-columns: repeat(var(--hev-cols, 4), minmax(0, 1fr)); gap: 16px; }
.hev-list a.hev-card{
  display: flex; flex-direction: column; overflow: hidden;
  border: 1px solid var(--hev-line); border-radius: 12px; background: var(--hev-card); color: var(--hev-text);
  transition: border-color .2s, transform .2s;
}
.hev-list a.hev-card:hover{ border-color: rgba(92,192,234,.5); color: var(--hev-text); }
.hev-list a.hev-card:focus-visible{ outline: 2px solid var(--hev-accent-2); outline-offset: 3px; }
.hev-card__media{ aspect-ratio: 5 / 4; overflow: hidden; background: #0b1216; }
.hev-card__media img{ width: 100%; height: 100%; max-width: none; object-fit: cover; transition: transform .5s ease; }
.hev-card:hover .hev-card__media img{ transform: scale(1.04); }
.hev-card__body{ flex: 1; display: flex; flex-direction: column; gap: 4px; padding: 16px 16px 18px; }
.hev-card__body .hev-eyebrow{ font-size: 14px; }
.hev-list .hev-card__title{ font-size: 20px; font-weight: 500; line-height: 1.4; color: #FAFDFF; }
.hev-card__desc{
  font-size: 14px; line-height: 1.6; color: #7C868A;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.hev-card__date{ margin-top: auto !important; padding-top: 6px; font-size: 14px; color: #7C868A; }

/* =========================================================================
   Lightbox
   ========================================================================= */
.hev-lb{
  position: fixed; inset: 0; z-index: 100000;
  display: flex; align-items: center; justify-content: center;
  background: rgba(5,9,12,.94); opacity: 0; transition: opacity .2s;
}
.hev-lb.is-open{ opacity: 1; }
.hev-lb img{ max-width: 92vw; max-height: 86vh; width: auto; height: auto; border-radius: 8px; user-select: none; }
.hev-lb .hev-lb__btn,
.hev-lb .hev-lb__btn:hover,
.hev-lb .hev-lb__btn:focus{
  position: absolute; display: grid; place-items: center;
  width: 48px; height: 48px; padding: 0; margin: 0; min-height: 0;
  border: 0; border-radius: 50%; box-shadow: none;
  background: rgba(255,255,255,.1); color: #fff; cursor: pointer;
  font: inherit; line-height: 1;
}
.hev-lb .hev-lb__btn:hover{ background: rgba(255,255,255,.2); }
.hev-lb .hev-lb__btn:focus-visible{ outline: 2px solid #fff; outline-offset: 2px; }
.hev-lb .hev-lb__close{ top: 20px; right: 20px; }
.hev-lb .hev-lb__prev{ left: 20px; top: 50%; transform: translateY(-50%); }
.hev-lb .hev-lb__next{ right: 20px; top: 50%; transform: translateY(-50%); }
.hev-lb__count{ position: absolute; bottom: 20px; left: 0; right: 0; text-align: center; font-size: 14px; color: rgba(255,255,255,.7); margin: 0; }

/* =========================================================================
   Responsive
   ========================================================================= */
@media (max-width: 1024px){
  .hev-grid{ --hev-cols: 3 !important; }
  .hev-stats{ grid-template-columns: repeat(2, minmax(0,1fr)); }
  .hev-stat:nth-child(odd){ border-left: 0; }
  .hev-stat:nth-child(n+3){ border-top: 2px solid var(--hev-line-strong); }
}
@media (max-width: 767px){
  .hev-wrap{ padding: 0 18px; }
  .hev-hero{ min-height: 560px; padding: 96px 0 104px; }
  .hev-body > :first-child{ margin-top: -64px; }
  .hev-stats{ grid-template-columns: 1fr; }
  .hev-stat{ padding: 16px 18px 18px; }
  .hev-stat + .hev-stat{ border-left: 0; border-top: 2px solid var(--hev-line-strong); }
  .hev-single .hev-stat__label{ font-size: 14px; }
  .hev-single .hev-stat__value{ font-size: 28px; }
  .hev-single .hev-stat__note{ font-size: 14px; }
  .hev-panel__cta .hev-btn{ min-width: 0; width: 100%; }
  .hev-feature .hev-info{ grid-template-columns: 1fr; }
  .hev-section{ margin-top: 32px; }

  .hev-gal, .hev-gal--n2, .hev-gal--n3{ grid-template-columns: 1fr 1fr; grid-template-rows: none; gap: 10px; }
  .hev-gal .hev-gal__item{ grid-area: auto !important; aspect-ratio: 1; }
  .hev-gal .hev-gal__item:first-child{ grid-column: 1 / -1 !important; aspect-ratio: 4 / 3; }
  .hev-gal + .hev-gal{ margin-top: 10px; }

  .hev-endcta{ flex-direction: column; align-items: stretch; padding: 22px; }
  .hev-endcta .hev-btn{ min-width: 0; }

  .hev-feature{ grid-template-columns: 1fr; }
  .hev-feature__media{ min-height: 0; aspect-ratio: 4 / 3; }
  .hev-feature__body{ padding: 24px 20px; }

  .hev-grid{ --hev-cols: 2 !important; gap: 12px; }
  .hev-card__body{ padding: 14px; }
  .hev-list .hev-card__title{ font-size: 15px; }

  .hev-lb .hev-lb__prev, .hev-lb .hev-lb__next{ top: auto; bottom: 12px; transform: none; }
  .hev-empty{ padding: 16px; }
}
@media (max-width: 480px){
  .hev-grid{ --hev-cols: 1 !important; }
}
@media (prefers-reduced-motion: reduce){
  .hev-gal__item img, .hev-card__media img{ transition: none; }
}
