/*
Theme Name:  ACSP Classroom
Theme URI:   https://www.themosthub.com
Author:      TheMostHub
Description: ธีมห้องเรียนออนไลน์ ACSP — แถบประกาศ LINE, เมนูไอคอน, ส่วนหัววิชา, พื้นหลังสีเลือดหมู และการ์ดขาวแถบฟ้า ใช้ได้กับทุกหน้า รวมถึงคลังข้อสอบ
Version:     1.1.0
Requires at least: 6.0
Requires PHP: 7.4
License:     GPLv2 or later
Text Domain: acsp
*/

:root{
  --acsp-maroon:#841A1C;
  --acsp-maroon-2:#6E1517;
  --acsp-navy:#0B3570;
  --acsp-navy-2:#003876;
  --acsp-blue:#1596D6;
  --acsp-cyan:#1CACEA;
  --acsp-ink:#0E2B4A;
  --acsp-ink-2:#3D5A7A;
  --acsp-ink-3:#6F87A3;
  --acsp-nav:#F3F6FA;
  --acsp-line:#E3E8EF;
  --acsp-track:#E6EDF5;
  --acsp-badge:#F6E7E7;
  --acsp-stripe:linear-gradient(90deg,#0B3873 0%,#1675B2 50%,#1EAFED 100%);
  --acsp-radius:16px;
  --acsp-shadow:0 10px 30px rgba(40,0,0,.22);
  --acsp-head:'Kanit','Prompt','IBM Plex Sans Thai',sans-serif;
  --acsp-body:'IBM Plex Sans Thai','Sarabun',-apple-system,'Segoe UI',sans-serif;
}

*,*::before,*::after{box-sizing:border-box}
html{-webkit-text-size-adjust:100%}
body{
  margin:0;background:var(--acsp-maroon);color:var(--acsp-ink);
  min-height:100vh;display:flex;flex-direction:column;
  font-family:var(--acsp-body);font-size:16px;line-height:1.7;
  -webkit-font-smoothing:antialiased;
}
img,video,iframe{max-width:100%}
img{height:auto}
a{color:var(--acsp-blue)}
.screen-reader-text{position:absolute!important;width:1px;height:1px;overflow:hidden;clip:rect(1px,1px,1px,1px)}
.acsp-skip:focus{position:fixed;top:8px;left:8px;z-index:9999;background:#fff;padding:8px 14px;border-radius:8px}

/* ── แถบประกาศบนสุด ─────────────────────────── */
.acsp-topbar{
  background:var(--acsp-navy-2);color:#fff;text-align:center;
  font-size:14.5px;font-weight:500;padding:8px 16px;line-height:1.5;
}
.acsp-topbar a{color:#fff;font-weight:700;text-decoration:underline;text-underline-offset:3px}

/* ── เมนูหลัก ───────────────────────────────── */
.acsp-nav{background:var(--acsp-nav);border-bottom:1px solid var(--acsp-line)}
.acsp-nav ul{
  list-style:none;margin:0 auto;padding:0 12px;display:flex;justify-content:flex-start;
  overflow-x:auto;scrollbar-width:none;max-width:1400px;
}
.acsp-nav ul::-webkit-scrollbar{display:none}
.acsp-nav li{flex:0 0 auto;position:relative}
.acsp-nav li:first-child{margin-left:auto}.acsp-nav li:last-child{margin-right:auto}  /* จัดกลาง แต่เลื่อนได้เมื่อเมนูยาว */
.acsp-nav li + li::before{content:'';position:absolute;left:0;top:10px;bottom:10px;width:1px;background:var(--acsp-line)}
.acsp-nav a{
  display:flex;align-items:center;gap:7px;padding:11px 15px 10px;
  color:var(--acsp-ink-2);text-decoration:none;font-size:15px;font-weight:500;white-space:nowrap;
  border-bottom:3px solid transparent;transition:color .15s,border-color .15s;
}
.acsp-nav a:hover{color:var(--acsp-maroon)}
.acsp-nav .current-menu-item > a,.acsp-nav .current_page_item > a,
.acsp-nav .current-menu-ancestor > a,.acsp-nav .current_page_ancestor > a{
  color:var(--acsp-maroon);font-weight:700;border-bottom-color:var(--acsp-maroon);
}
.acsp-nav .acsp-ico{width:17px;height:17px;flex:0 0 17px}
.acsp-nav .sub-menu,.acsp-nav .children{display:none}

/* ── ส่วนหัววิชา ─────────────────────────────── */
.acsp-brand{background:#fff}
.acsp-brand-in{max-width:1180px;margin:0 auto;padding:16px 24px;display:flex;align-items:center;gap:14px}
.acsp-brand a{text-decoration:none}
.acsp-logo{
  width:58px;height:58px;flex:0 0 58px;border-radius:50%;
  background:var(--acsp-navy);color:#fff;display:grid;place-items:center;overflow:hidden;
  font-family:var(--acsp-head);font-weight:700;font-size:15px;letter-spacing:.3px;
  box-shadow:0 5px 14px rgba(11,53,112,.35);
}
.acsp-logo img{width:100%;height:100%;object-fit:cover}
.acsp-brand-title{margin:0;font-family:var(--acsp-head);font-weight:700;font-size:24px;line-height:1.2;color:var(--acsp-maroon)}
.acsp-brand-sub{margin:2px 0 0;font-size:13px;font-weight:600;letter-spacing:1.2px;color:var(--acsp-navy)}

/* ── Hero สีเลือดหมู ─────────────────────────── */
.acsp-hero{text-align:center;padding:46px 20px 14px;color:#fff}
.acsp-hero-title{
  display:inline-flex;align-items:center;gap:14px;margin:0;
  font-family:var(--acsp-head);font-weight:700;font-size:34px;line-height:1.25;color:#fff;
}
.acsp-hero-logo{
  width:46px;height:46px;flex:0 0 46px;border-radius:50%;background:#fff;color:var(--acsp-maroon);
  display:grid;place-items:center;font-size:12px;font-weight:800;letter-spacing:.2px;overflow:hidden;
}
.acsp-hero-logo img{width:100%;height:100%;object-fit:cover}
.acsp-pill{
  display:inline-block;margin-top:18px;padding:6px 22px;border-radius:99px;background:#fff;
  color:var(--acsp-maroon);font-family:var(--acsp-head);font-weight:600;font-size:17px;
}

/* ── พื้นที่เนื้อหา ─────────────────────────── */
.acsp-main{width:100%;max-width:1000px;margin:0 auto;padding:22px 20px 70px}
.acsp-main.wide{max-width:1180px}
.acsp-main.full{max-width:none;padding-left:24px;padding-right:24px}
.acsp-back{
  display:inline-flex;align-items:center;gap:6px;margin-bottom:22px;padding:6px 14px;border-radius:9px;
  border:1px solid rgba(255,255,255,.45);background:rgba(255,255,255,.08);color:#fff;
  font-size:14px;font-weight:600;text-decoration:none;transition:background .15s;
}
.acsp-back:hover{background:rgba(255,255,255,.18);color:#fff}

.acsp-card{
  position:relative;background:#fff;border-radius:var(--acsp-radius);box-shadow:var(--acsp-shadow);
  padding:28px 30px;overflow:hidden;margin-bottom:22px;
}
.acsp-card::before{content:'';position:absolute;left:0;right:0;top:0;height:5px;background:var(--acsp-stripe)}

/* เนื้อหาในการ์ด */
.entry-content > *:first-child{margin-top:0}
.entry-content > *:last-child{margin-bottom:0}
.entry-content h1,.entry-content h2,.entry-content h3,.entry-content h4{
  font-family:var(--acsp-head);color:var(--acsp-navy);line-height:1.3;font-weight:600;margin:1.4em 0 .5em;
}
.entry-content h2{font-size:26px}.entry-content h3{font-size:21px}
.entry-content a{color:var(--acsp-blue);text-underline-offset:3px}
.entry-content img,.entry-content iframe{border-radius:12px}
.entry-content iframe{width:100%;border:0}
.entry-content blockquote{margin:1.2em 0;padding:12px 18px;border-left:4px solid var(--acsp-maroon);background:var(--acsp-badge);border-radius:0 10px 10px 0}
.entry-content table{width:100%;border-collapse:collapse;font-size:15px}
.entry-content th,.entry-content td{padding:10px 12px;border-bottom:1px solid var(--acsp-line);text-align:left}
.entry-content th{background:var(--acsp-nav);color:var(--acsp-navy)}
.entry-content .wp-block-table thead{border-bottom:0}
.entry-content .wp-block-table th,.entry-content .wp-block-table td{border:0;border-bottom:1px solid var(--acsp-line)}
.entry-content .wp-block-table table{border-radius:10px;overflow:hidden}
.entry-content hr{border:0;height:1px;background:var(--acsp-line);margin:2em 0}
.wp-block-button__link,.acsp-btn{
  display:inline-flex;align-items:center;gap:6px;padding:9px 20px;border-radius:10px;border:0;
  background:linear-gradient(135deg,var(--acsp-cyan),var(--acsp-blue));color:#fff!important;
  font-weight:700;font-size:15px;text-decoration:none!important;box-shadow:0 4px 12px rgba(21,150,214,.3);
  cursor:pointer;transition:filter .15s,transform .15s;font-family:inherit;
}
.wp-block-button__link:hover,.acsp-btn:hover{filter:brightness(1.06);transform:translateY(-1px)}
.is-style-outline .wp-block-button__link,.acsp-btn.ghost{
  background:#EEF2F7;color:var(--acsp-ink-3)!important;box-shadow:none;border:1px solid var(--acsp-line);
}

/* ── การ์ดรายการ (บทความ / หน้าย่อย) ────────── */
.acsp-grid{display:grid;grid-template-columns:repeat(auto-fill,minmax(230px,1fr));gap:12px}
.acsp-item{display:flex;flex-direction:column;padding:18px 16px 16px;margin:0}
.acsp-item-head{display:flex;gap:11px;align-items:flex-start}
.acsp-num{
  width:34px;height:34px;flex:0 0 34px;border-radius:50%;background:var(--acsp-navy);color:#fff;
  display:grid;place-items:center;font-family:var(--acsp-head);font-weight:600;font-size:15px;
  box-shadow:0 3px 8px rgba(11,53,112,.3);
}
.acsp-item-title{margin:0;font-family:var(--acsp-head);font-weight:600;font-size:17px;line-height:1.35}
.acsp-item-title a{color:var(--acsp-navy);text-decoration:none}
.acsp-item-title a:hover{color:var(--acsp-maroon)}
.acsp-meta{font-size:13px;color:var(--acsp-ink-3);margin-top:2px}
.acsp-badge{
  display:inline-block;align-self:flex-start;margin-top:10px;padding:2px 11px;border-radius:99px;
  background:var(--acsp-badge);color:var(--acsp-maroon);font-size:12.5px;font-weight:600;
}
.acsp-excerpt{font-size:14px;color:var(--acsp-ink-2);margin:10px 0 0;flex:1}
.acsp-item .acsp-btn{margin-top:14px;align-self:flex-start;padding:6px 14px;font-size:14px}

.acsp-pagination{display:flex;justify-content:center;gap:8px;margin-top:26px;flex-wrap:wrap}
.acsp-pagination .page-numbers{
  min-width:40px;padding:7px 12px;border-radius:10px;background:rgba(255,255,255,.12);color:#fff;
  text-align:center;text-decoration:none;font-weight:600;border:1px solid rgba(255,255,255,.3);
}
.acsp-pagination .page-numbers.current{background:#fff;color:var(--acsp-maroon)}

/* ── ส่วนท้าย ─────────────────────────────────── */
.acsp-footer{margin-top:auto;background:var(--acsp-maroon-2);color:rgba(255,255,255,.8);font-size:14px}
.acsp-footer-in{max-width:1180px;margin:0 auto;padding:22px 24px;display:flex;flex-wrap:wrap;gap:10px 24px;align-items:center;justify-content:space-between}
.acsp-footer a{color:#fff;text-decoration:none}
.acsp-footer ul{list-style:none;margin:0;padding:0;display:flex;flex-wrap:wrap;gap:6px 18px}

/* ── ฟอร์มค้นหา / ความคิดเห็น ──────────────── */
.acsp-search{display:flex;gap:8px}
.acsp-search input[type=search]{
  flex:1;padding:10px 14px;border:1px solid var(--acsp-line);border-radius:10px;background:var(--acsp-nav);
  font:inherit;color:var(--acsp-ink);
}
.comment-respond input[type=text],.comment-respond input[type=email],.comment-respond textarea{
  width:100%;padding:10px 12px;border:1px solid var(--acsp-line);border-radius:10px;font:inherit;
}
.comment-respond .submit{padding:9px 20px;border:0;border-radius:10px;background:linear-gradient(135deg,var(--acsp-cyan),var(--acsp-blue));color:#fff;font:inherit;font-weight:700;cursor:pointer}

/* ── มือถือ ───────────────────────────────────── */
@media (max-width:640px){
  .acsp-topbar{font-size:13px}
  .acsp-brand-in{padding:12px 16px}
  .acsp-logo{width:48px;height:48px;flex-basis:48px;font-size:13px}
  .acsp-brand-title{font-size:20px}
  .acsp-brand-sub{font-size:11.5px;letter-spacing:.5px}
  .acsp-hero{padding:32px 16px 8px}
  .acsp-hero-title{font-size:26px;gap:10px}
  .acsp-hero-logo{width:38px;height:38px;flex-basis:38px;font-size:10px}
  .acsp-main{padding:18px 16px 56px}
  .acsp-card{padding:22px 18px}
}
