/* ==========================================================
   VU GAME — ธีมส้ม-ขาว-เข้ม ตามแบรนด์เว็บหลัก vu.ac.th
   ========================================================== */

:root {
  --dark: #242426;           /* header/footer เข้ม - คงเดิมให้สอดคล้องทั้งเว็บ */
  --bg: #EEF2F6;              /* พื้นหลังหน้าเว็บ ฟ้าเทาอ่อน ตามธีมงาน */
  --navy: #17395C;            /* หัวข้อ/heading สีกรมท่า */
  --orange: #F26522;          /* accent ส้ม - ปุ่ม, badge, mascot tone */
  --orange-tint: #FDEDE2;
  --white: #FFFFFF;
  --slate: #5C6B7A;
  --ink: #17395C;
  --line: #DCE3EA;
  --live: #C0392B;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Sarabun', sans-serif;
  font-size: 16px;
  line-height: 1.6;
}

h1, h2, h3, .display {
  font-family: 'Kanit', sans-serif;
  margin: 0;
  color: var(--ink);
}

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

.wrap {
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 1.5rem;
}

/* ---------- Header ---------- */
.site-header {
  background: var(--dark);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  padding-bottom: 1rem;
  position: relative;
}

.nav-toggle-checkbox { display: none; }

.nav-toggle-label {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 26px;
  cursor: pointer;
}

.nav-toggle-label span {
  display: block;
  height: 2px;
  background: var(--white);
  border-radius: 2px;
}

.lang-switch.lang-switch-mobile { display: none; }

.logo {
  font-family: 'Kanit', sans-serif;
  font-weight: 800;
  font-size: 1.4rem;
  color: var(--white);
  letter-spacing: 0.02em;
}

.logo span { color: var(--orange); }

.main-nav {
  display: flex;
  gap: 1.75rem;
}

.main-nav a {
  color: #BFBFC2;
  font-weight: 500;
  font-size: 0.95rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid transparent;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--white);
  border-bottom-color: var(--orange);
}

/* ---------- Hero (fallback — ไม่มีรูปแบนเนอร์/cover เลย) ---------- */
.hero {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 3.5rem 0;
}

.hero-inner {
  max-width: 640px;
  margin: 0 auto;
  text-align: center;
}

.hero-inner h1 {
  color: var(--navy);
  font-size: 2.3rem;
  font-weight: 800;
  line-height: 1.3;
}

.hero-meta {
  color: var(--slate);
  margin-top: 1rem;
  font-size: 0.95rem;
}

.hero-meta .meta-row { margin-bottom: 0.4rem; }
.hero-meta .tagline { margin-top: 0.75rem; color: var(--slate); }

.hero-cta { display: flex; gap: 1rem; margin-top: 1.25rem; flex-wrap: wrap; justify-content: center; }

.btn-hero {
  display: inline-flex; align-items: center; gap: 0.4rem;
  padding: 0.65rem 1.4rem; border-radius: 999px;
  font-family: 'Kanit', sans-serif; font-weight: 600; font-size: 0.92rem;
}

.btn-hero.primary { background: var(--orange); color: var(--white); }
.btn-hero.primary:hover { background: #D9560F; }

.btn-hero.outline { background: var(--white); border: 1.5px solid var(--line); color: var(--navy); }
.btn-hero.outline:hover { background: #F5F5F5; }

/* ---------- Hero slider (มีรูปแบนเนอร์/cover) — กล่องข้อความลอยทับรูปสไลด์ ---------- */
.hero-slider {
  position: relative;
  width: 100%;
  height: 480px;
  overflow: hidden;
  background: var(--dark);
}

.hero-slide { position: absolute; inset: 0; opacity: 0; transition: opacity 0.7s ease; }
.hero-slide.active { opacity: 1; }
.hero-slide img { width: 100%; height: 100%; object-fit: cover; display: block; }

.hero-info-box {
  position: absolute;
  left: 8%;
  top: 50%;
  transform: translateY(-50%);
  max-width: 360px;
  padding: 2.25rem;
  z-index: 2;
}

.hero-info-box h1 {
  color: var(--navy);
  font-size: 1.9rem;
  font-weight: 800;
  line-height: 1.35;
}

.hero-info-box .hero-meta { color: var(--slate); margin-top: 1rem; font-size: 0.92rem; }
.hero-info-box .hero-cta { justify-content: flex-start; }

/* ---------- Event heading (ใต้แบนเนอร์) ---------- */
.event-heading {
  background: var(--white);
  border-bottom: 1px solid var(--line);
  padding: 2rem 0;
  text-align: center;
}

.event-heading h2 {
  font-family: 'Kanit', sans-serif;
  font-weight: 700;
  font-size: 1.15rem;
  color: var(--navy);
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 100%;
  margin: 0 auto;
}

.event-heading .event-tagline {
  margin: 0.75rem auto 0;
  max-width: 640px;
  color: var(--slate);
  font-size: 1rem;
}

@media (max-width: 640px) {
  .event-heading h2 { font-size: 0.92rem; }
}

/* ---------- Sport categories grid ---------- */
.sport-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 15px;
}

.sport-box {
  flex: 1 1 150px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 1.75rem 1rem;
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 6px 16px rgba(15, 23, 41, 0.08);
  text-align: center;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.sport-box:hover { transform: translateY(-2px); box-shadow: 0 10px 22px rgba(15, 23, 41, 0.12); }

.sport-box .sport-icon-circle {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--orange-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0.6rem;
  font-size: 1.6rem; /* base ที่ทั้ง emoji และรูปไอคอนอ้างอิงร่วมกัน */
}

.sport-box .sport-icon {
  font-size: 1em;
  line-height: 1;
}

/* ---------- Sport box: โหมดพื้นหลังรูป (เมื่ออัปโหลด icon_image) ---------- */
.sport-box.has-bg-image {
  position: relative;
  min-height: 150px;
  background-size: cover;
  background-position: center;
  justify-content: flex-end;
  padding-bottom: 1.1rem;
  overflow: hidden;
}

.sport-box.has-bg-image::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10, 15, 25, 0.75) 0%, rgba(10, 15, 25, 0.2) 55%, rgba(10, 15, 25, 0) 100%);
}

.sport-box.has-bg-image .sport-name {
  position: relative;
  z-index: 1;
  color: var(--white);
}

.sport-box .sport-name {
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 0.88rem;
  color: var(--navy);
}

@media (max-width: 640px) {
  .sport-box { flex-basis: calc(50% - 8px); padding: 1.25rem 0.75rem; }
}

/* ---------- Section ---------- */
.section {
  padding: 2.75rem 0;
}

.section-tint {
  background: #FDEDE2;
}

/* ---------- Site background image mode: ทำ section ทึบให้โปร่งแสง เห็นรูปพื้นหลังทะลุ ---------- */
body.has-site-bg .site-header,
body.has-site-bg .site-footer {
  background: rgba(36, 36, 38, 0.85);
  backdrop-filter: blur(6px);
}

body.has-site-bg .site-header {
  border-bottom: 2px solid rgba(0, 0, 0, 0.35);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
  position: relative;
  z-index: 10;
}

body.has-site-bg .hero,
body.has-site-bg .event-heading {
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(6px);
}

body.has-site-bg .section-tint {
  background: rgba(253, 237, 226, 0.85);
  backdrop-filter: blur(6px);
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.25rem;
}

.section-head .eyebrow {
  display: block;
  color: var(--orange);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: 0.2rem;
}

.section-head h2 {
  font-size: 1.5rem;
  font-weight: 700;
}

.section-head .see-all {
  flex-shrink: 0;
  background: var(--orange);
  color: var(--white);
  font-size: 0.85rem;
  font-weight: 600;
  padding: 0.5rem 1.1rem;
  border-radius: 999px;
}

.section-head .see-all:hover { background: #D9560F; }

/* ---------- Sport filter chips ---------- */
.sport-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-bottom: 1.5rem;
}

.chip {
  padding: 0.4rem 1rem;
  border: 1px solid var(--line);
  background: var(--white);
  font-size: 0.9rem;
  font-weight: 500;
  color: var(--slate);
  border-radius: 999px;
}

.chip:hover { border-color: var(--orange); color: var(--orange); }

.chip.active {
  background: var(--orange);
  border-color: var(--orange);
  color: var(--white);
}

/* ---------- Match ticket card ---------- */
.match-list { display: flex; flex-direction: column; gap: 0.75rem; }

.match-card {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  background: var(--white);
  border: 1px solid var(--line);
  border-left: 4px solid var(--orange);
  padding: 1rem 1.25rem;
}

.match-card.status-live { border-left-color: var(--live); }
.match-card.status-finished { border-left-color: var(--slate); }

.match-meta {
  flex: 0 0 130px;
  font-size: 0.82rem;
  color: var(--slate);
}

.match-meta .sport-name {
  display: block;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.95rem;
  margin-bottom: 0.15rem;
}

.match-teams {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  font-size: 1.05rem;
}

/* ทีม = [โลโก้] + ชื่อ  (โลโก้อยู่หน้าชื่อทั้งสองฝั่ง) */
.match-teams .team {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 0.7rem;
  min-width: 0;
}
.match-teams .team.home { justify-content: flex-end; text-align: right; }
.match-teams .team.away { justify-content: flex-start; text-align: left; }

.match-teams .team-logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
  flex-shrink: 0;
}

.match-teams .team-name { min-width: 0; line-height: 1.35; }

.match-score {
  font-size: 1.5rem;
  font-weight: 800;
  color: var(--orange);
  min-width: 70px;
  text-align: center;
}

.match-score .sep { color: var(--slate); font-weight: 400; padding: 0 0.3rem; }

.match-status-tag {
  flex: 0 0 110px;
  text-align: right;
  font-size: 0.82rem;
  font-weight: 600;
}

.match-status-tag .dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  margin-right: 0.35rem;
  background: var(--orange);
}

.status-live .match-status-tag .dot { background: var(--live); }
.status-finished .match-status-tag .dot { background: var(--slate); }

.match-venue {
  font-size: 0.78rem;
  color: var(--slate);
  margin-top: 0.15rem;
}

.date-heading {
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  color: var(--ink);
  font-size: 0.9rem;
  margin: 1.5rem 0 0.6rem;
  padding-bottom: 0.3rem;
  border-bottom: 2px solid var(--orange-tint);
}

.date-heading:first-child { margin-top: 0; }

/* ---------- Venue card ---------- */
.venue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1rem;
}

.venue-card {
  background: var(--white);
  border: 1px solid var(--line);
  border-top: 3px solid var(--orange);
  padding: 1.25rem;
}

.venue-card h3 { font-size: 1.05rem; margin-bottom: 0.4rem; }
.venue-card p { color: var(--slate); font-size: 0.9rem; margin: 0; }

.venue-card .map-link {
  display: inline-block;
  margin-top: 0.6rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--orange);
}

/* ---------- Empty state ---------- */
.empty-note {
  color: var(--slate);
  font-size: 0.92rem;
  padding: 1.25rem;
  border: 1px dashed var(--line);
  background: var(--white);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--dark);
  color: #9C9C9F;
  padding: 1.75rem 0;
  font-size: 0.85rem;
  margin-top: 2rem;
}

/* ---------- Responsive ---------- */
@media (max-width: 768px) {
  .nav-toggle-label { display: flex; order: 3; }

  .main-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0;
    background: var(--dark);
    box-shadow: 0 12px 20px rgba(0,0,0,0.25);
    z-index: 40;
  }

  .nav-toggle-checkbox:checked ~ .main-nav { display: flex; }

  .main-nav a {
    padding: 0.9rem 1.5rem;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    width: 100%;
  }

  .lang-switch.lang-switch-desktop { display: none; }

  .lang-switch.lang-switch-mobile {
    display: flex;
    padding: 1rem 1.5rem;
    margin-left: 0;
  }

  .hero-inner h1 { font-size: 1.7rem; }
  .match-card { flex-wrap: wrap; }
  .match-meta { flex: 1 1 100%; }
  .match-status-tag { flex: 1 1 100%; text-align: left; margin-top: 0.4rem; }
  .section-head { align-items: flex-start; flex-direction: column; gap: 0.75rem; }

  .match-teams { gap: 0.6rem; font-size: 0.95rem; }
  .match-teams .team { gap: 0.5rem; }
  .match-teams .team-logo { width: 32px; height: 32px; }
}

@media (max-width: 480px) {
  .match-teams .team,
  .match-teams .team.home,
  .match-teams .team.away {
    flex-direction: column;
    justify-content: flex-start;
    text-align: center;
    gap: 0.35rem;
  }
  .match-teams .team-logo { width: 36px; height: 36px; }
  .match-score { min-width: 52px; font-size: 1.25rem; }
}

/* ---------- Slideshow controls (ใช้ร่วมกับ .hero-slider) ---------- */
.banner-dots { position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%); display: flex; gap: 0.5rem; z-index: 3; }
.banner-dot { width: 9px; height: 9px; border-radius: 50%; background: rgba(120,120,120,0.4); cursor: pointer; border: none; padding: 0; }
.banner-dot.active { background: var(--orange); }
.banner-arrow {
  position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
  background: rgba(16,25,38,0.35); color: var(--white); border: none; width: 36px; height: 36px;
  font-size: 1.1rem; cursor: pointer; display: flex; align-items: center; justify-content: center;
}
.banner-arrow:hover { background: rgba(16,25,38,0.6); }
.banner-arrow.prev { left: 14px; }
.banner-arrow.next { right: 14px; }

@media (max-width: 768px) {
  .hero-slider { height: 320px; }
  .banner-arrow { width: 30px; height: 30px; font-size: 0.95rem; }
  .banner-arrow.prev { left: 8px; }
  .banner-arrow.next { right: 8px; }
  .banner-dots { bottom: 10px; }
}

@media (max-width: 480px) {
  .hero-slider { height: 220px; }
  .banner-arrow { width: 26px; height: 26px; font-size: 0.85rem; }
}

/* ---------- News card ---------- */
.news-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.news-card {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 41, 0.1);
  overflow: hidden;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.news-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(15, 23, 41, 0.14); }
.news-card img { width: 100%; height: 160px; object-fit: cover; display: block; }
.news-card-body { padding: 1.1rem 1.1rem 1.25rem; }
.news-date { font-size: 0.78rem; color: var(--slate); font-weight: 500; }
.news-card h3 { font-size: 1rem; margin: 0.5rem 0 0.75rem; line-height: 1.4; color: var(--navy); }
.news-readmore { font-size: 0.85rem; font-weight: 600; color: var(--orange); }

@media (max-width: 900px) {
  .news-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .news-grid { grid-template-columns: 1fr; }
}

/* ---------- Language switch ---------- */
.lang-switch { display: flex; align-items: center; gap: 0.4rem; margin-left: 1.5rem; font-size: 0.85rem; }
.lang-switch a { color: var(--white); font-weight: 700; padding: 0.15rem 0.3rem; opacity: 0.85; }
.lang-switch a.active, .lang-switch a:hover { color: var(--orange); opacity: 1; }
.lang-switch span { color: rgba(255,255,255,0.5); }

/* ---------- Footer grid ---------- */
.footer-grid { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; }
.footer-heading { font-family: 'Kanit', sans-serif; font-weight: 600; color: var(--white); font-size: 0.85rem; margin-bottom: 0.5rem; }
.social-links { display: flex; gap: 1rem; }
.social-links a { color: #9C9C9F; font-size: 0.85rem; }
.social-links a:hover { color: var(--orange); }

/* ---------- Documents page ---------- */
.doc-list { display: flex; flex-direction: column; gap: 0.6rem; }
.doc-item { display: flex; align-items: center; justify-content: space-between; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--orange); padding: 0.9rem 1.1rem; }
.doc-item .doc-title { font-weight: 600; }
.doc-item .doc-download { color: var(--orange); font-weight: 600; font-size: 0.88rem; }

/* ---------- News category badge ---------- */
.news-badge { display: inline-block; background: var(--orange); color: var(--white); font-size: 0.72rem; font-weight: 600; padding: 0.15rem 0.6rem; margin-right: 0.5rem; }
.news-badge.badge-announcement { background: var(--dark); }

/* ---------- Document embed (iframe จากเว็บ *.vu.ac.th) ---------- */
.doc-embed {
  background: var(--white);
  border-radius: 14px;
  box-shadow: 0 6px 18px rgba(15, 23, 41, 0.1);
  overflow: hidden;
}

.doc-embed-title {
  padding: 0.9rem 1.25rem;
  font-family: 'Kanit', sans-serif;
  font-weight: 600;
  color: var(--navy);
  border-bottom: 1px solid var(--line);
  border-left: 4px solid var(--orange);
}

.doc-embed iframe {
  display: block;
  width: 100%;
  border: 0;
}

/* ---------- Venue: กีฬาที่ใช้แข่งขัน ---------- */
.venue-card .venue-sports {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--navy);
  line-height: 1.5;
}

.venue-card .venue-sports strong { color: var(--orange); font-weight: 600; }
