/* home-main.css : CSS หน้าแรก (ไม่รวมส่วน header ซึ่งอยู่ใน header.css/header.html) */
:root { --primary:#003399; --accent:#ffcc00; --danger:#b30000; --bg-color:#f4f8fb; --text-dark:#1e293b; --text-muted:#64748b; --card-bg:#fff; --radius-md:16px; }
body { font-family:'Kanit',sans-serif; margin:0; background:var(--bg-color); overflow-x:hidden; color:var(--text-dark); display:flex; flex-direction:column; min-height:100vh; }
#main-content { flex:1; }
.container { max-width:1200px; margin:0 auto; padding:0 15px; box-sizing:border-box; }
.skip-link { position:absolute; left:-999px; top:-999px; background:var(--accent); color:var(--primary); padding:12px 20px; z-index:100000; font-weight:700; border-radius:0 0 8px 0; text-decoration:none; }
.skip-link:focus { left:0; top:0; }

/* slider */
.main-slider { max-width:100%; margin:0 auto; position:relative; z-index:10; }
.slider-container { position:relative; width:100%; overflow:hidden; background:#eee; }
.slide { display:none; width:100%; }
.slide.active { display:block; animation:fadeAni 1.2s; }
.slide img { width:100%; height:auto; max-height:540px; object-fit:cover; display:block; }
.caption-bar { position:absolute; bottom:0; left:0; width:100%; background:linear-gradient(to top,rgba(0,51,153,.85),transparent); color:#fff; text-align:center; padding:40px 20px 20px; font-size:1.25rem; font-weight:500; letter-spacing:1px; box-sizing:border-box; pointer-events:none; }
.prev-arrow,.next-arrow { cursor:pointer; position:absolute; top:50%; transform:translateY(-50%); padding:18px 22px; color:#fff; font-weight:bold; font-size:24px; transition:.3s; background:rgba(0,51,153,.4); border:none; z-index:15; }
.next-arrow { right:0; border-radius:8px 0 0 8px; }
.prev-arrow { left:0; border-radius:0 8px 8px 0; }
.prev-arrow:hover,.next-arrow:hover { background:var(--primary); color:var(--accent); }
@keyframes fadeAni { from{opacity:.4} to{opacity:1} }

/* ปุ่มหลัก */
.highlight-action-row { display:flex; justify-content:center; gap:20px; margin:-30px auto 40px; position:relative; z-index:20; max-width:1200px; padding:0 15px; flex-wrap:wrap; }
.action-btn { display:flex; align-items:center; gap:18px; color:#fff; padding:16px 35px; border-radius:50px; text-decoration:none; font-size:1.3rem; font-weight:600; transition:.3s; border:3px solid #fff; }
.action-btn.admission { background:linear-gradient(135deg,#ea580c,#c2410c); box-shadow:0 10px 20px rgba(234,88,12,.3); }
.action-btn.vnet { background:linear-gradient(135deg,#16a34a,#15803d); box-shadow:0 10px 20px rgba(22,163,74,.3); }
.action-btn:hover { transform:translateY(-5px) scale(1.02); color:#fff; border-color:var(--accent); }
.action-btn span { line-height:1.2; text-align:left; }
.action-btn small { font-weight:400; font-size:.9rem; color:#f1f5f9; }

/* เมนูลัด */
.access-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:25px; margin:30px auto 50px; max-width:1200px; padding:0 15px; box-sizing:border-box; }
.access-card { background:#fff; border:1px solid #eee; display:flex; flex-direction:column; align-items:center; justify-content:center; padding:35px 15px; border-radius:12px; text-decoration:none; color:var(--primary); font-weight:600; font-size:1.15rem; box-shadow:0 5px 15px rgba(0,0,0,.05); transition:.3s; text-align:center; }
.access-card:hover { transform:translateY(-5px); box-shadow:0 10px 25px rgba(0,51,153,.15); border-color:var(--primary); }
.access-card img { object-fit:contain; margin-bottom:15px; }
.access-card .access-icon { font-size:55px; color:var(--primary); display:flex; align-items:center; justify-content:center; margin-bottom:15px; }

/* สถิติ */
.stats-section { padding:50px 0; background:#fff; }
.stats-grid { display:grid; grid-template-columns:repeat(4,1fr); gap:25px; text-align:center; }
.stat-item { padding:20px; }
.stat-number { font-size:2.6rem; font-weight:700; color:var(--primary); line-height:1.1; }
.stat-number .plus { color:var(--accent); }
.stat-label { font-size:1rem; color:var(--text-muted); margin-top:8px; font-weight:500; }

/* E-Service */
.eservice-section { padding:50px 0 60px; background:#f4f8fb; }
.eservice-header { text-align:center; margin-bottom:40px; }
.eservice-header h2 { margin:0; }
.eservice-header p { color:var(--text-muted); font-size:1.1rem; margin-top:5px; }
.eservice-grid { display:grid; grid-template-columns:repeat(2,1fr); gap:20px 30px; max-width:900px; margin:0 auto; }
.eservice-row-card { display:flex; background:#fff; box-shadow:0 4px 10px rgba(0,0,0,.06); text-decoration:none; transition:.2s; height:65px; border:1px solid #f0f0f0; }
.eservice-row-card:hover { transform:translateY(-3px); box-shadow:0 8px 15px rgba(0,0,0,.1); }
.eservice-icon-box { width:75px; color:#fff; display:flex; align-items:center; justify-content:center; font-size:24px; flex-shrink:0; transition:.3s; }
.eservice-text { padding:0 20px; display:flex; align-items:center; color:#333; font-size:1.1rem; font-weight:500; flex-grow:1; }

/* ผู้อำนวยการ */
.director-row-box { display:grid; grid-template-columns:1fr 2.5fr; gap:40px; background:#fff; border-radius:12px; padding:35px; border:1px solid #eef2f6; margin:40px auto; box-shadow:0 5px 15px rgba(0,0,0,.03); align-items:center; max-width:1170px; }
.dir-pic-frame { width:100%; max-width:210px; border-radius:14px; overflow:hidden; box-shadow:0 8px 20px rgba(0,0,0,.06); border:4px solid #fff; outline:1px solid #e2e8f0; margin:0 auto; }
.dir-pic-frame img { width:100%; height:auto; object-fit:cover; display:block; }
.dir-txt-area h3 { font-size:1.35rem; color:var(--primary); margin:0 0 5px; font-weight:700; }
.dir-rank { font-size:.92rem; color:#64748b; font-weight:500; margin-bottom:15px; }
.dir-txt-area p { font-size:.98rem; color:#475569; line-height:1.6; font-style:italic; margin:0; }

/* แผนก */
.dept-section { padding:50px 0; background:#fff; border-top:1px solid #e2e8f0; border-bottom:1px solid #e2e8f0; }
.dept-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(200px,1fr)); gap:20px; margin-top:35px; }
.dept-card { background:var(--bg-color); border:1px solid #e2e8f0; border-radius:12px; padding:30px 15px; text-align:center; transition:.3s; text-decoration:none; color:var(--text-dark); display:flex; flex-direction:column; align-items:center; justify-content:center; }
.dept-card:hover { transform:translateY(-5px); box-shadow:0 10px 25px rgba(0,51,153,.1); border-color:var(--primary); background:#fff; }
.dept-icon { width:70px; height:70px; background:rgba(0,51,153,.08); color:var(--primary); border-radius:50%; display:flex; align-items:center; justify-content:center; font-size:30px; margin-bottom:15px; transition:.3s; }
.dept-card:hover .dept-icon { background:var(--primary); color:#fff; transform:scale(1.1); }

/* รางวัล */
.award-section { padding:60px 0; background:linear-gradient(135deg,#001f66,var(--primary)); color:#fff; position:relative; }
.award-section::before { content:''; position:absolute; top:0; left:0; right:0; height:5px; background:var(--accent); }
.award-grid { display:grid; grid-template-columns:repeat(auto-fit,minmax(300px,1fr)); gap:30px; margin-top:40px; }
.award-card { background:rgba(255,255,255,.05); border:1px solid rgba(255,255,255,.1); border-radius:16px; overflow:hidden; transition:.4s; }
.award-card:hover { transform:translateY(-10px); background:#fff; color:var(--text-dark); box-shadow:0 15px 30px rgba(0,0,0,.3); }
.award-img { width:100%; height:220px; object-fit:cover; border-bottom:3px solid var(--accent); display:block; }
.award-info { padding:25px; }
.award-badge { display:inline-block; background:var(--accent); color:var(--primary); font-size:.75rem; font-weight:700; padding:4px 12px; border-radius:50px; margin-bottom:15px; }
.award-title { font-size:1.2rem; font-weight:600; margin:0 0 10px; line-height:1.4; }
.award-card:hover .award-title { color:var(--primary); }
.award-desc { font-size:.9rem; margin:0; opacity:.85; line-height:1.5; }

/* ข่าว */
.news-tab { padding:10px 20px; background:#fff; color:var(--primary); border-radius:50px; cursor:pointer; transition:.3s; font-family:'Kanit',sans-serif; font-weight:500; border:1px solid #ddd; }
.news-tab.active,.news-tab:hover { background:var(--primary); color:#fff; border-color:var(--primary); }
#news-list-home { display:grid; grid-template-columns:repeat(auto-fill,minmax(280px,1fr)); gap:25px; padding:20px 0; }
.modern-news-card { background:#fff; border-radius:15px; overflow:hidden; box-shadow:0 5px 15px rgba(0,0,0,.05); border:1px solid #eee; transition:.3s; text-decoration:none; display:flex; flex-direction:column; height:100%; }
.modern-news-card:hover { transform:translateY(-5px); box-shadow:0 10px 25px rgba(0,51,153,.1); border-color:var(--primary); }
.card-banner { width:100%; height:200px; position:relative; overflow:hidden; background:#eee; }
.card-banner img { width:100%; height:100%; object-fit:cover; transition:.5s; }
.modern-news-card:hover .card-banner img { transform:scale(1.05); }
.card-badge { position:absolute; top:12px; right:12px; background:var(--accent); color:var(--primary); padding:5px 15px; border-radius:50px; font-size:.75rem; font-weight:600; z-index:2; }
.card-details { padding:20px; display:flex; flex-direction:column; flex-grow:1; }
.card-details h3 { margin:0 0 10px; font-size:1.15rem; color:var(--primary); line-height:1.4; font-weight:600; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card-details p { margin:0 0 15px; color:#666; font-size:.9rem; line-height:1.5; display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.card-meta { margin-top:auto; padding-top:15px; border-top:1px solid #eee; display:flex; justify-content:space-between; align-items:center; font-size:.85rem; }
.card-meta .readmore-txt { color:var(--primary); font-weight:600; }

/* แผนที่ + ปฏิทิน + วิดีโอ */
.map-cal-section { padding:55px 0; background:#fff; }
.map-cal-grid { display:grid; grid-template-columns:1.1fr 1fr; gap:35px; align-items:stretch; }
.map-box { border-radius:14px; overflow:hidden; box-shadow:0 5px 15px rgba(0,0,0,.06); border:1px solid #eee; min-height:340px; }
.map-box iframe { width:100%; height:100%; min-height:340px; border:0; display:block; }
.cal-box { background:var(--bg-color); border-radius:14px; padding:30px; border:1px solid #e2e8f0; }
.cal-box h3 { color:var(--primary); margin:0 0 20px; font-size:1.4rem; font-weight:700; }
.cal-timeline { list-style:none; margin:0; padding:0; }
.cal-timeline li { display:flex; gap:15px; padding:14px 0; border-bottom:1px dashed #cbd5e1; }
.cal-timeline li:last-child { border-bottom:none; }
.cal-date { flex-shrink:0; background:var(--primary); color:#fff; font-weight:600; font-size:.85rem; padding:6px 12px; border-radius:8px; height:fit-content; white-space:nowrap; }
.cal-desc { font-size:.98rem; padding-top:3px; }
.video-section { padding:55px 0; background:var(--bg-color); }
.video-wrap { max-width:900px; margin:35px auto 0; border-radius:14px; overflow:hidden; box-shadow:0 10px 30px rgba(0,0,0,.1); position:relative; padding-top:50.625%; height:0; }
.video-wrap iframe { position:absolute; top:0; left:0; width:100%; height:100%; border:0; }

/* popup / cookie */
#specialDayPopup { position:fixed; inset:0; z-index:99999; display:flex; flex-direction:column; align-items:center; justify-content:center; backdrop-filter:blur(5px); }
.popup-img { max-width:90%; max-height:75vh; border-radius:15px; border:3px solid #fff; }
.enter-site-btn { margin-top:20px; padding:12px 30px; font-size:18px; font-weight:bold; border:none; border-radius:30px; cursor:pointer; font-family:'Kanit',sans-serif; }
#cookieConsent { position:fixed; left:0; right:0; bottom:0; background:#001f3f; color:#f1f5f9; padding:18px 20px; z-index:99998; box-shadow:0 -4px 20px rgba(0,0,0,.25); }
.cookie-inner { max-width:1200px; margin:0 auto; display:flex; align-items:center; justify-content:space-between; gap:20px; flex-wrap:wrap; }
.cookie-inner p { margin:0; font-size:.92rem; line-height:1.5; max-width:780px; }
.cookie-inner a { color:var(--accent); text-decoration:underline; }
.cookie-btns { display:flex; gap:10px; flex-shrink:0; }
.cookie-btn { border:none; padding:10px 22px; border-radius:30px; font-family:'Kanit',sans-serif; font-weight:600; cursor:pointer; font-size:.9rem; }
.cookie-accept { background:var(--accent); color:var(--primary); }
.cookie-reject { background:transparent; color:#f1f5f9; border:1px solid rgba(255,255,255,.4); }

/* แชทบอท + LINE */
.chat-widget { position:fixed; bottom:30px; right:30px; z-index:9999; font-family:'Kanit',sans-serif; }
.chat-btn { background:var(--primary); color:#fff; width:60px; height:60px; border-radius:50%; display:flex; justify-content:center; align-items:center; font-size:28px; cursor:pointer; box-shadow:0 5px 15px rgba(0,0,0,.2); transition:.3s; border:none; margin-left:auto; }
.chat-btn:hover { transform:scale(1.1); background:var(--danger); }
.chat-box { display:none; background:#fff; border-radius:12px; box-shadow:0 10px 30px rgba(0,0,0,.2); overflow:hidden; margin-bottom:15px; flex-direction:column; border:1px solid #ddd; }
.chat-header { background:var(--primary); color:#fff; padding:15px; font-weight:600; display:flex; justify-content:space-between; align-items:center; }
.chat-body { height:320px; padding:15px; overflow-y:auto; background:#f9f9f9; display:flex; flex-direction:column; gap:10px; }
.msg { max-width:85%; padding:10px 15px; border-radius:12px; font-size:.9rem; line-height:1.4; word-wrap:break-word; text-align:left; }
.msg.bot { background:#fff; color:#333; align-self:flex-start; border:1px solid #eee; border-bottom-left-radius:0; }
.msg.user { background:var(--primary); color:#fff; align-self:flex-end; border-bottom-right-radius:0; }
.chat-footer { padding:10px; background:#fff; border-top:1px solid #eee; display:flex; gap:8px; }
.chat-input { flex:1; padding:10px 15px; border:1px solid #ddd; border-radius:20px; font-family:'Kanit',sans-serif; }
.chat-send { background:var(--primary); color:#fff; border:none; width:40px; height:40px; border-radius:50%; cursor:pointer; }
.chat-options { display:flex; flex-wrap:wrap; gap:5px; margin-top:10px; }
.opt-btn { background:#fff; border:1px solid var(--primary); color:var(--primary); padding:6px 12px; border-radius:20px; font-size:.8rem; cursor:pointer; font-family:'Kanit',sans-serif; }
.line-float { position:fixed; bottom:100px; right:30px; z-index:9998; background:#06C755; width:60px; height:60px; border-radius:50%; display:flex; align-items:center; justify-content:center; box-shadow:0 5px 15px rgba(0,0,0,.2); text-decoration:none; transition:.3s; }
.line-float:hover { transform:scale(1.1); }
.line-float i { color:#fff; font-size:28px; }

/* responsive */
@media (max-width:992px) {
  .access-grid,.eservice-grid,.stats-grid { grid-template-columns:repeat(2,1fr); }
  .director-row-box { grid-template-columns:1fr; gap:20px; text-align:center; }
  .map-cal-grid { grid-template-columns:1fr; }
}
@media (max-width:768px) {
  .access-grid,.eservice-grid { grid-template-columns:1fr; }
  .slide img { aspect-ratio:16/9; }
  .highlight-action-row { flex-direction:column; padding:0 20px; }
  .action-btn { justify-content:center; text-align:center; }
  .line-float { bottom:95px; right:20px; width:52px; height:52px; }
  .chat-widget { right:20px; bottom:20px; }
  .cookie-inner { flex-direction:column; align-items:flex-start; }
}
