/* =====================================================
   เว็บไซต์โรงเรียนบัวขาว สังกัด อบจ.กาฬสินธุ์
   เลย์เอาต์คงที่ (static) กว้าง 1060px ไม่เรสปอนซีฟ
   โทนสี ขาว-น้ำเงิน (สีประจำโรงเรียน) ตัดด้วยสีทอง
   ===================================================== */
* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: "Leelawadee UI", "Segoe UI", Tahoma, "TH Sarabun New", sans-serif;
  font-size: 15px;
  color: #333;
  background: #eaf0f8 url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40'%3E%3Ccircle cx='20' cy='20' r='1.2' fill='%23d0dcec'/%3E%3C/svg%3E");
  line-height: 1.65;
  padding: 18px 0 24px;
  -webkit-text-size-adjust: 100%; /* กัน iOS Safari ขยายฟอนต์เอง (font boosting) จนข้อความล้น/ปัดบรรทัด */
  text-size-adjust: 100%;
}
a { color: #14448c; text-decoration: none; }
a:hover { color: #2a6fc0; text-decoration: underline; }
img { border: 0; }
.clear { clear: both; }
.muted { color: #888; }
.center { text-align: center; }
.sm-text { font-size: 13px; }

/* กรอบรูปรอบเว็บ : ไล่เฉดน้ำเงิน-ฟ้า แซมประกายทองแบบโลหะเงา */
#frame {
  width: 1106px;
  margin: 0 auto;
  padding: 13px;
  border-radius: 18px;
  background: linear-gradient(135deg,
    #081c38 0%, #123f7d 16%, #2a6fc0 34%,
    #ffd868 50%,
    #2a6fc0 66%, #123f7d 84%, #081c38 100%);
  box-shadow:
    0 12px 34px rgba(8, 28, 56, .45),
    inset 0 0 0 2px rgba(255, 216, 104, .55),
    inset 0 0 14px rgba(0, 0, 0, .25);
}

#wrapper {
  width: 1080px;
  margin: 0 auto;
  padding: 10px;
  background: #f0f5fb;
  border-radius: 9px;
  box-shadow: inset 0 0 8px rgba(10, 38, 71, .18);
}

/* ---------- แถบบนสุด ---------- */
#topbar {
  background: #0a2647;
  color: #d9e5f5;
  font-size: 13px;
  padding: 5px 14px;
  border-radius: 6px;
}
#topbar a { color: #ffd24d; }
.tb-left { float: left; }
.tb-right { float: right; }
#topbar::after { content: ""; display: block; clear: both; }

/* ---------- แบนเนอร์หัวเว็บ ---------- */
#banner {
  position: relative;
  height: 165px;
  margin-top: 8px;
  border-radius: 8px 8px 0 0;
  background: linear-gradient(120deg, #0f356b 0%, #14448c 45%, #1d5aa8 75%, #3b82d4 100%);
  overflow: hidden;
  box-shadow: 0 2px 6px rgba(10, 38, 71, .35);
}
#banner::before {
  content: "";
  position: absolute; inset: 0;
  background:
    radial-gradient(circle at 85% 120%, rgba(255, 210, 77, .28) 0 90px, transparent 91px),
    radial-gradient(circle at 92% -30%, rgba(255, 255, 255, .12) 0 120px, transparent 121px);
}
.banner-logo {
  position: absolute; left: 24px; top: 18px;
  width: 128px; height: 128px;
  filter: drop-shadow(0 2px 4px rgba(0,0,0,.35));
}
.banner-text { position: absolute; left: 175px; top: 30px; color: #fff; }
.banner-name {
  font-size: 42px; font-weight: bold; line-height: 1.15;
  text-shadow: 1px 2px 3px rgba(0, 15, 40, .55);
}
.banner-en { font-size: 12px; letter-spacing: 3px; color: #ffd24d; margin-top: 2px; }
.banner-slogan { font-size: 15px; color: #e8f0fa; margin-top: 8px; }
.banner-lotus {
  position: absolute; right: -40px; bottom: -55px;
  width: 220px; height: 220px; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,.16) 0 60%, transparent 62%);
}

/* ---------- แถบลิงก์หน่วยงานต้นสังกัด ---------- */
#agency-strip {
  background: #081c38;
  color: #b7c9e6;
  font-size: 12.5px;
  padding: 6px 14px;
  white-space: nowrap;   /* บังคับอยู่บรรทัดเดียวทุกดีไวซ์ */
  overflow-x: auto;
}
#agency-strip a { color: #fff; margin: 0 10px 0 4px; }
#agency-strip a:hover { color: #ffd24d; }
.ag-label { color: #ffd24d; font-weight: bold; }

/* ---------- เมนูหลัก ---------- */
#mainmenu {
  background: linear-gradient(#2a6fc0, #14448c 60%, #0f356b);
  border-radius: 0 0 8px 8px;
  padding: 0 4px;
  box-shadow: 0 2px 5px rgba(10, 38, 71, .3);
  white-space: nowrap;
}
#mainmenu a {
  display: inline-block;
  color: #fff; font-size: 14.5px; font-weight: bold;
  padding: 10px 11px;
  text-decoration: none;
}
#mainmenu a:hover { background: rgba(255, 210, 77, .9); color: #0a2647; }

/* เมนูย่อยแบบ dropdown */
#mainmenu .mm-item { display: inline-block; position: relative; }
#mainmenu .mm-caret { font-size: 10px; opacity: .85; }
#mainmenu .mm-sub {
  display: none; position: absolute; top: 100%; left: 0; z-index: 90;
  min-width: 225px; padding: 4px 0;
  background: #0f356b;
  border: 1px solid #2a6fc0; border-top: 3px solid #ffd24d;
  border-radius: 0 0 7px 7px;
  box-shadow: 0 8px 16px rgba(10, 38, 71, .4);
}
#mainmenu .mm-item:hover .mm-sub { display: block; }
#mainmenu .mm-sub a {
  display: block; font-size: 13.5px; font-weight: normal;
  padding: 8px 14px; white-space: nowrap;
}

/* ---------- ข่าวเด่นตัววิ่ง ---------- */
#marquee-bar {
  margin: 10px 0;
  background: #fff;
  border: 1px solid #ccd9ea;
  border-left: 46px solid #c0392b;
  border-radius: 6px;
  position: relative;
  height: 36px;
  overflow: hidden;
}
.mq-label {
  position: absolute; left: -46px; top: 0;
  width: 46px; height: 34px;
  color: #fff; font-size: 12px; font-weight: bold;
  text-align: center; line-height: 34px;
}
.mq-window { overflow: hidden; height: 34px; }
.mq-text {
  display: inline-block; white-space: nowrap;
  line-height: 34px; padding-left: 100%;
  color: #8e2020; font-weight: bold;
  animation: mqscroll 30s linear infinite;
}
@keyframes mqscroll { 0% { transform: translateX(0); } 100% { transform: translateX(-100%); } }

/* ---------- เลย์เอาต์ 3 คอลัมน์ ---------- */
#layout { width: 1060px; }
#col-left   { float: left; width: 215px; }
#col-center { float: left; width: 588px; margin: 0 13px; }
#col-right  { float: left; width: 231px; }

/* ---------- กล่อง ---------- */
.box {
  background: #fff;
  border: 1px solid #ccd9ea;
  border-radius: 7px;
  margin-bottom: 13px;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(20, 60, 120, .08);
}
.box h3 {
  background: linear-gradient(#2a6fc0, #14448c);
  color: #fff;
  font-size: 15.5px;
  padding: 8px 12px;
  border-bottom: 3px solid #ffd24d;
}
.box h3.bh-hot { background: linear-gradient(#e05a2b, #c0392b); }
.box .pad { padding: 10px 12px; }

/* เมนูข้าง */
.side-menu, .side-news { list-style: none; }
.side-menu li, .side-news li { border-bottom: 1px dashed #dde7f2; }
.side-menu li:last-child, .side-news li:last-child { border-bottom: 0; }
.side-menu a, .side-news a, .side-menu li.muted, .side-news li.muted {
  display: block; padding: 7px 12px 7px 26px; font-size: 14px;
  position: relative;
}
.side-menu a::before {
  content: "»"; position: absolute; left: 11px; color: #7fabde;
}
.side-news a::before {
  content: "•"; position: absolute; left: 13px; color: #e05a2b; font-weight: bold;
}
.side-menu a:hover, .side-news a:hover { background: #f0f6fc; text-decoration: none; }
.side-menu.sm a { font-size: 13px; }
.side-menu .cnt { color: #999; font-size: 12px; }

/* ผู้บริหาร */
.director { text-align: center; padding: 14px 10px; }
.director img {
  width: 150px; height: 180px; object-fit: cover;
  border: 3px solid #d8e5f5; border-radius: 6px; background: #edf3fa;
}
.d-name { font-weight: bold; margin-top: 8px; color: #0f356b; }
.d-pos { font-size: 13px; color: #777; }
.d-more { display: inline-block; margin-top: 6px; font-size: 13px; }

/* รองผู้อำนวยการ : สไลด์หมุนเวียนในกล่องผู้บริหาร */
.deputy-slider { border-top: 1px dashed #ccd9ea; margin-top: 12px; padding-top: 8px; }
.dp-label {
  display: inline-block; font-size: 12px; font-weight: bold; color: #0f356b;
  background: #eef3fa; border: 1px solid #d5e0ef; border-radius: 10px;
  padding: 1px 10px; margin-bottom: 6px;
}
.dp-slide { display: none; min-height: 208px; }
.dp-slide.on { display: block; animation: dpFade .6s ease; }
@keyframes dpFade { from { opacity: 0; } to { opacity: 1; } }
.dp-slide img {
  width: 120px; height: 145px; object-fit: cover;
  border: 3px solid #d8e5f5; border-radius: 6px; background: #edf3fa;
}
.dp-dots { margin-top: 4px; }
.dp-dot {
  display: inline-block; width: 9px; height: 9px; margin: 0 3px; padding: 0;
  border-radius: 50%; border: 1px solid #96b6dd; background: #dce7f5; cursor: pointer;
}
.dp-dot.on { background: #14448c; border-color: #14448c; }

/* ฟอร์มทั่วไป */
label { display: block; font-size: 13.5px; margin: 7px 0 2px; color: #0f356b; font-weight: bold; }
input[type=text], input[type=password], input[type=email], select, textarea {
  width: 100%; padding: 6px 8px;
  border: 1px solid #b8c9e0; border-radius: 4px;
  font-family: inherit; font-size: 14px;
  background: #fcfdff;
}
input:focus, textarea:focus, select:focus { outline: 2px solid #a7c4ee; }
.btn {
  display: inline-block;
  background: linear-gradient(#2a6fc0, #14448c);
  color: #fff; font-family: inherit; font-size: 14.5px; font-weight: bold;
  border: 0; border-radius: 5px;
  padding: 8px 22px; margin-top: 10px;
  cursor: pointer;
}
.btn:hover { background: linear-gradient(#3b82d4, #1d5aa8); }
.btn-block { display: block; width: 100%; }
.btn-gold { background: linear-gradient(#f5c33b, #dd9f10); color: #0f356b; }
.btn-sm { padding: 3px 10px; font-size: 12.5px; margin: 0; }
.btn-red { background: linear-gradient(#e05a2b, #c0392b); }

/* แบนเนอร์สมัครนักข่าว */
.reporter-banner {
  display: flex; align-items: center; gap: 10px;
  background: linear-gradient(120deg, #c0392b, #e05a2b);
  color: #fff !important;
  border-radius: 7px;
  padding: 12px;
  margin-bottom: 13px;
  font-size: 13.5px; line-height: 1.4;
  box-shadow: 0 1px 3px rgba(150, 40, 20, .3);
}
.reporter-banner:hover { text-decoration: none; filter: brightness(1.08); }
.rb-icon { font-size: 30px; }

/* สถิติ */
.stat-table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
.stat-table td { padding: 6px 12px; border-bottom: 1px dashed #dde7f2; }
.stat-table tr:last-child td { border-bottom: 0; }
.stat-table .num { text-align: right; font-weight: bold; color: #14448c; }

/* ---------- กล่องเนื้อหากลาง ---------- */
.cbox { margin-bottom: 14px; }
.cbox-head {
  background: linear-gradient(#2a6fc0, #14448c);
  border-radius: 7px 7px 0 0;
  border-bottom: 3px solid #ffd24d;
  padding: 8px 14px;
  position: relative;
}
.cbox-head h2 { color: #fff; font-size: 17px; display: inline; }
.cbox-head .more { position: absolute; right: 12px; top: 9px; color: #ffd24d; font-size: 13px; }
.cbox-body {
  background: #fff;
  border: 1px solid #ccd9ea; border-top: 0;
  border-radius: 0 0 7px 7px;
  padding: 12px 14px;
}

/* สไลด์ภาพข่าวเด่น — กรอบสัดส่วน 3:2 เท่าภาพถ่ายแนวนอนของกล้อง DSLR (586×391) */
.slider-body { padding: 0; }
.slider {
  position: relative; width: 100%; height: 0;
  padding-top: 66.6667%; /* 2/3 ของความกว้าง = สัดส่วน 3:2 */
  background: #0a2647; border-radius: 0 0 6px 6px; overflow: hidden;
}
.slider .slide {
  position: absolute; top: 0; left: 0; right: 0; bottom: 0;
  display: block; opacity: 0; transition: opacity .7s ease; z-index: 1;
}
.slider .slide.on { opacity: 1; z-index: 2; }
.slider .slide img { width: 100%; height: 100%; object-fit: cover; display: block; }
.slide-cap {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 38px 16px 12px;
  background: linear-gradient(transparent, rgba(10, 38, 71, .92));
  color: #fff;
}
.slide-cat {
  display: inline-block; background: #ffd24d; color: #0a2647;
  font-size: 11.5px; font-weight: bold; border-radius: 3px;
  padding: 1px 8px; margin-bottom: 5px;
}
.slide-title {
  display: block; font-size: 17px; font-weight: bold; line-height: 1.4;
  text-shadow: 0 1px 3px rgba(0, 0, 0, .5);
}
.slide-meta { display: block; font-size: 12px; color: #cfe0f5; margin-top: 3px; }
.slide:hover .slide-title { color: #ffd24d; }
.sl-nav {
  position: absolute; top: 50%; margin-top: -17px; z-index: 3;
  width: 34px; height: 34px; border: 0; border-radius: 50%;
  background: rgba(10, 38, 71, .55); color: #fff;
  font-size: 15px; line-height: 1; cursor: pointer;
}
.sl-nav:hover { background: #ffd24d; color: #0a2647; }
.sl-prev { left: 10px; }
.sl-next { right: 10px; }
.sl-dots { position: absolute; bottom: 9px; right: 12px; z-index: 3; display: flex; gap: 6px; }
.sl-dot {
  width: 10px; height: 10px; border-radius: 50%; padding: 0; cursor: pointer;
  border: 1px solid #fff; background: rgba(255, 255, 255, .35);
}
.sl-dot.on { background: #ffd24d; border-color: #ffd24d; }

/* ภาพข่าวเด่น (grid) */
.photo-grid { display: flex; gap: 12px; }
.photo-grid .ph-item { width: 33.33%; }
.ph-item img, .ph-thumb {
  width: 100%; height: 118px; object-fit: cover;
  border-radius: 5px; border: 1px solid #d5e0ef;
  background: linear-gradient(135deg, #c8d9ef, #96b6dd);
  display: block;
}
.ph-item .ph-title {
  display: block; font-size: 13.5px; line-height: 1.45; margin-top: 6px;
  font-weight: bold;
}
.ph-item .ph-date { font-size: 12px; color: #999; }

/* รายการข่าวแบบลิสต์ */
.news-list { list-style: none; }
.news-list li {
  border-bottom: 1px dashed #dde7f2;
  padding: 7px 2px 7px 22px;
  position: relative;
}
.news-list li::before {
  content: "▸"; position: absolute; left: 5px; color: #e05a2b;
}
.news-list li:last-child { border-bottom: 0; }
.news-list .nl-date { font-size: 12px; color: #999; white-space: nowrap; margin-left: 6px; }
.news-list .nl-new {
  background: #c0392b; color: #fff; font-size: 10px;
  border-radius: 3px; padding: 1px 5px; margin-left: 6px;
}

/* แถวข่าวมีรูป */
.news-row { display: flex; gap: 12px; padding: 10px 0; border-bottom: 1px dashed #dde7f2; }
.news-row:last-child { border-bottom: 0; }
.news-row img, .news-row .ph-thumb-sm {
  width: 130px; height: 90px; object-fit: cover; flex: 0 0 130px;
  border-radius: 5px; border: 1px solid #d5e0ef;
  background: linear-gradient(135deg, #c8d9ef, #96b6dd);
}
.news-row h4 { font-size: 15px; }
.news-row .meta { font-size: 12.5px; color: #999; }
.news-row p { font-size: 13.5px; color: #555; }

/* สองคอลัมน์ในเนื้อหากลาง */
.half-wrap { display: flex; gap: 14px; }
.half-wrap .cbox { width: 50%; }
.half-wrap .cbox-head h2 { font-size: 15px; }
.half-wrap .news-list li { font-size: 13.5px; }

/* บุคลากรแถวเลื่อน */
.staff-strip { display: flex; gap: 10px; }
.staff-card { width: 20%; text-align: center; font-size: 12.5px; }
.staff-card img {
  width: 100%; height: 115px; object-fit: cover;
  border-radius: 5px; border: 1px solid #d5e0ef; background: #edf3fa;
}
.staff-card .st-name { font-weight: bold; line-height: 1.3; margin-top: 4px; }
.staff-card .st-pos { color: #888; font-size: 11.5px; line-height: 1.3; }

/* หน้ารายละเอียดข่าว */
.article-full h1 { color: #0f356b; font-size: 24px; line-height: 1.4; margin-bottom: 6px; }
.article-meta {
  font-size: 13px; color: #777;
  background: #f0f6fc; border: 1px solid #dce7f5; border-radius: 5px;
  padding: 6px 12px; margin-bottom: 14px;
}
.article-body { font-size: 15.5px; }
.article-body p { margin: 0 0 12px; }
.article-body img { max-width: 100%; height: auto; }
.article-body ul, .article-body ol { margin: 0 0 12px 28px; }
.article-body table { border-collapse: collapse; }
.article-body td, .article-body th { border: 1px solid #b7cbe6; padding: 5px 9px; }
.article-cover { width: 100%; max-height: 330px; object-fit: cover; border-radius: 6px; margin-bottom: 14px; }

/* ไฟล์แนบ */
.attach-list { list-style: none; margin-top: 8px; }
.attach-list li {
  display: flex; align-items: center; gap: 9px;
  border: 1px solid #dde7f2; border-radius: 5px;
  padding: 7px 10px; margin-bottom: 6px; background: #f9fbfe;
}
.fi {
  display: inline-block; min-width: 40px; text-align: center;
  color: #fff; font-size: 11px; font-weight: bold;
  border-radius: 4px; padding: 4px 5px;
}
.fi-pdf { background: #c0392b; } .fi-doc { background: #2b579a; }
.fi-xls { background: #217346; } .fi-ppt { background: #d24726; }
.fi-zip { background: #7d6608; } .fi-img { background: #0e7490; }
.fi-etc { background: #666; }
.attach-list .a-size { color: #999; font-size: 12px; margin-left: auto; white-space: nowrap; }

/* ความคิดเห็น */
.comment { border: 1px solid #dde7f2; border-radius: 6px; padding: 9px 13px; margin-bottom: 9px; background: #fcfdff; }
.comment .c-head { font-size: 12.5px; color: #5d7aa0; margin-bottom: 3px; }
.comment .c-head strong { color: #0f356b; }
.comment .c-guest { background: #eef3fa; color: #5d7aa0; border: 1px solid #d5e0ef; border-radius: 3px; font-size: 11px; padding: 0 5px; }

/* ตารางข้อมูล */
.data-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.data-table th {
  background: linear-gradient(#2a6fc0, #14448c); color: #fff;
  padding: 8px 10px; text-align: left;
}
.data-table td { padding: 7px 10px; border-bottom: 1px solid #e4edf8; vertical-align: middle; }
.data-table tr:nth-child(even) td { background: #f7fafd; }
.data-table tr:hover td { background: #ebf3fb; }

/* แบ่งหน้า */
.pagination { margin: 14px 0 4px; text-align: center; }
.pagination a, .pagination .cur {
  display: inline-block; min-width: 32px; padding: 4px 8px; margin: 0 2px;
  border: 1px solid #b7cbe6; border-radius: 4px; text-align: center;
}
.pagination .cur { background: #14448c; color: #fff; border-color: #14448c; }
.pagination a:hover { background: #e6f0fb; text-decoration: none; }

/* แจ้งเตือน */
.alert { padding: 10px 15px; border-radius: 6px; margin-bottom: 13px; font-weight: bold; }
.alert-success { background: #e7f6e7; color: #1e7a1e; border: 1px solid #b4dfb4; }
.alert-error { background: #fdecea; color: #b3261e; border: 1px solid #f5c6c0; }

/* breadcrumb */
.crumb { font-size: 13px; color: #888; margin-bottom: 10px; }

/* ---------- ฟุตเตอร์ (<= 4 บรรทัด กว้างเต็ม 1060px) ---------- */
#footer {
  margin-top: 4px;
  background: linear-gradient(#0f356b, #081c38);
  color: #c8d9ef;
  border-radius: 8px;
  padding: 16px 20px;
  text-align: center;
  font-size: 13.5px;
  line-height: 1.8;
  border-top: 4px solid #ffd24d;
}
#footer .ft-name { font-size: 16px; font-weight: bold; color: #fff; }
#footer .ft-copy { color: #88a8cf; font-size: 12.5px; }
