*{font-family:'Sarabun',system-ui,sans-serif}
body{background:#f0f4f8;padding-top:0;padding-bottom:0}
/* ---- header 2-bar ---- */
.bg_top{background:#ffffff;}
.header_top{background:#008000; padding-top: 10px;}
.dh-top{background:#008000;height:64px;position:relative;z-index:101;overflow:visible}
.dh-top-inner{max-width:1120px;margin:0 auto;padding:0 15px;display:flex;justify-content:flex-end;align-items:center;height:100%;position:relative}
/* logo white box */
.dh-logo-box{
  position:absolute;
  left:0;top:0;height:64px;
  display:flex;flex-direction:column;align-items:flex-start;justify-content:center;
  background:#ffffff;
  padding-left:0;
  padding-right:0;
  z-index:10;
}
/* ขยาย bg ขาวออกไปทางซ้ายสุดของหน้าจอ */
.dh-logo-box::before{content:"";position:absolute;top:0;right:100%;width:100vw;height:100%;background:#ffffff}
/* เส้นเฉียง */
.dh-logo-box::after{
    content:"";
    position:absolute;
    left:100%;bottom:0;
    width:0;height:0;
    border-bottom:64px solid #ffffff;
    border-right:36px solid transparent;
}
.dh-logo-text{font-size:28px;font-weight:900;color:#202124;text-decoration:none;letter-spacing:-.5px;white-space:nowrap;line-height:1.1;padding-right:24px}
.dh-logo-text:hover{color:#008000}
.dh-logo-sub{font-size:14px;font-weight:600;color:#008000;white-space:nowrap;padding-right:24px;line-height:1}
.dh-top-links{display:flex;align-items:center;gap:16px}
.dh-top-link{color:#fff;font-size:.85rem;font-weight:600;text-decoration:none;display:flex;align-items:center;gap:5px;transition:.2s}
.dh-top-link:hover{color:#d1fae5}
/* bottom white bar — ใช้ Bootstrap navbar แทน */
.dh-navbar{background:#fff;box-shadow:0 4px 10px -4px rgba(0,128,0,.3);min-height:54px}
.dh-nav-link{color:#202124 !important;font-weight:500;font-size:.9rem;padding:6px 10px !important;border-radius:6px;display:flex;align-items:center;gap:5px;white-space:nowrap;transition:.2s}
.dh-nav-link:hover,.dh-nav-link:focus{color:#008000 !important;background:#f0fdf4}
.dh-navbar .dropdown-menu{border:none;border-radius:10px;box-shadow:0 8px 24px rgba(0,0,0,.12);padding:6px 0;min-width:160px}
.dh-navbar .dropdown-item{font-size:.88rem;font-weight:500;padding:8px 16px;color:#1e293b}
.dh-navbar .dropdown-item:hover{background:#f0fdf4;color:#008000}
.dh-navbar .navbar-toggler:focus{box-shadow:none}
@media(max-width:991px){
  .dh-navbar .navbar-collapse{border-top:1px solid #f0f0f0;margin-top:4px}
  .dh-nav-link{border-bottom:1px solid #f0f0f0;border-radius:0;padding:12px 8px !important}
  .dh-navbar .dropdown-menu{box-shadow:none;border-radius:0;background:#f8fafc;border-bottom:1px solid #f0f0f0}
}
.ministry-premium-scroll {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 4px 12px;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
}
.ministry-premium-scroll::-webkit-scrollbar { height: 4px; }
.ministry-premium-scroll::-webkit-scrollbar-track { background: #f1f5f9; border-radius: 10px; }
.ministry-premium-scroll::-webkit-scrollbar-thumb { background: #94a3b8; border-radius: 10px; }
.ministry-premium-card {
    scroll-snap-align: start;
    flex: 0 0 auto;
    width: 110px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    padding: 12px 8px 10px;
    background: #fff;
    border: 1px solid #e2e8f0;
    border-radius: 14px;
    text-decoration: none;
    color: #1e293b;
    transition: box-shadow .2s, transform .2s;
    box-shadow: 0 1px 4px rgba(0,0,0,.06);
}
.ministry-premium-card:hover {
    box-shadow: 0 6px 18px rgba(0,128,0,.15);
    transform: translateY(-3px);
    border-color: #86efac;
    color: #008000;
}
.ministry-premium-logo {
    width: 52px; height: 52px;
    border-radius: 50%;
    background: #f0fdf4;
    border: 2px solid #bbf7d0;
    display: flex; align-items: center; justify-content: center;
    overflow: hidden;
    flex-shrink: 0;
}
.ministry-premium-logo img { width: 100%; height: 100%; object-fit: cover; }
.ministry-premium-placeholder {
    font-size: 1rem; font-weight: 700; color: #008000;
}
.ministry-premium-name {
    font-size: .72rem;
    font-weight: 600;
    text-align: center;
    line-height: 1.35;
    color: inherit;
}
.ministry-count {
    font-size: .68rem;
    font-weight: 400;
    color: #64748b;
    display: block;
    margin-top: 2px;
}
/* mobile */
@media(max-width:768px){
  .dh-top{height:52px}
  .dh-logo-box{height:52px;padding-left:12px}
  .dh-logo-box::after{border-bottom-width:52px;border-right-width:28px}
  .dh-logo-text{font-size:20px}
  .dh-logo-sub{font-size:11px}
  .dh-bottom{height:50px}
  .dh-bottom-inner{height:50px}
  .dh-site-title{display:none}
  .dh-toggle{display:flex}
  .dh-nav{display:none;position:absolute;top:100%;left:0;width:100%;background:#fff;flex-direction:column;align-items:stretch;padding:8px 0;box-shadow:0 8px 16px rgba(0,0,0,.1);z-index:99}
  .dh-nav.open{display:flex}
  .dh-nav a{padding:13px 20px;border-radius:0;border-bottom:1px solid #f0f0f0;font-size:.95rem}
  .dh-nav a:last-child{border-bottom:none}
}
/* ---- stat cards ---- */
.stat-card{border-radius:16px;padding:18px 20px;color:#fff;display:flex;align-items:center;gap:14px;text-decoration:none;transition:.2s;box-shadow:0 4px 12px rgba(0,0,0,.1)}
.stat-card:hover{transform:translateY(-3px);box-shadow:0 8px 20px rgba(0,0,0,.15);color:#fff}
.stat-card .si{width:52px;height:52px;border-radius:12px;background:rgba(255,255,255,.2);display:flex;align-items:center;justify-content:center;font-size:1.5rem;flex-shrink:0}
.stat-card .sv{font-size:1.4rem;font-weight:800;line-height:1}
.stat-card .sl{font-size:.8rem;opacity:.85;margin-top:2px}
/* ---- section header ---- */
.sec-head{display:flex;align-items:center;justify-content:space-between;margin-bottom:16px;margin-top:28px}
.sec-head h2{font-size:1.1rem;font-weight:800;margin:0;display:flex;align-items:center;gap:8px;border-left:4px solid #008000;padding-left:12px}
.sec-head a{font-size:.82rem;color:#008000;font-weight:600;text-decoration:none}
.sec-head a:hover{text-decoration:underline}
/* ---- news card ---- */
.nc{background:#fff;border-radius:16px;overflow:hidden;box-shadow:0 2px 8px rgba(0,0,0,.05);transition:.2s;height:100%;display:flex;flex-direction:column;text-decoration:none;color:inherit}
.nc:hover{box-shadow:0 8px 24px rgba(0,0,0,.1);transform:translateY(-3px);color:inherit}
.nc-img{width:100%;height:170px;object-fit:cover;background:#e2e8f0}
.nc-body{padding:14px;flex:1;display:flex;flex-direction:column}
.nc-title{font-weight:700;font-size:.95rem;line-height:1.4;color:#1e293b;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden;flex:1}
.nc-foot{margin-top:10px;display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px}
/* ---- hero card ---- */
.hero-card{background:#fff;border-radius:20px;overflow:hidden;box-shadow:0 4px 16px rgba(0,0,0,.08);text-decoration:none;color:inherit;display:block;transition:.2s}
.hero-card:hover{box-shadow:0 12px 32px rgba(0,0,0,.12);color:inherit}
.hero-img{width:100%;height:280px;object-fit:cover}
.hero-body{padding:20px}
.hero-title{font-size:1.3rem;font-weight:800;line-height:1.4;color:#0f172a;display:-webkit-box;-webkit-line-clamp:3;-webkit-box-orient:vertical;overflow:hidden}
/* ---- list item ---- */
.li-item{display:flex;gap:12px;padding:10px 0;border-bottom:1px solid #f1f5f9;text-decoration:none;color:inherit;align-items:center;transition:.15s}
.li-item:last-child{border-bottom:none}
.li-item:hover .li-title{color:#008000}
.li-thumb{width:72px;height:52px;border-radius:8px;object-fit:cover;flex-shrink:0;background:#e2e8f0}
.li-title{font-weight:600;font-size:.9rem;line-height:1.4;color:#1e293b;display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden}
/* ---- kopo section ---- */
.kopo-card{background:#fff;border-radius:16px;padding:16px;box-shadow:0 2px 8px rgba(0,0,0,.05)}
.kopo-head{display:flex;align-items:center;gap:10px;margin-bottom:14px;padding-bottom:10px;border-bottom:2px solid #f0f0f0}
.kopo-head i{font-size:1.4rem}
.kopo-head span{font-weight:800;font-size:1rem}
/* ---- sidebar widget ---- */
.widget{background:#fff;border-radius:16px;padding:16px;box-shadow:0 2px 8px rgba(0,0,0,.05);margin-bottom:20px}
.widget-title{font-weight:800;font-size:.95rem;margin-bottom:14px;display:flex;align-items:center;gap:8px;color:#1e293b}
.cat-pill{display:flex;align-items:center;gap:8px;padding:8px 12px;border-radius:10px;background:#f8fafc;text-decoration:none;color:#1e293b;font-size:.88rem;font-weight:600;transition:.15s;margin-bottom:6px}
.cat-pill:hover{background:#e8f5e9;color:#008000}
.cat-pill i{font-size:1rem}
/* ---- badge overrides ---- */
.badge{font-size:.72rem;font-weight:600;border-radius:20px;padding:3px 10px}
@media(max-width:768px){
    .hero-img{height:200px}
    .hero-title{font-size:1.1rem}
    .nc-img{height:140px}
}
/* ===== Footer ===== */
.ft{background:#0f172a;color:#94a3b8;font-size:.875rem}
.ft-top{padding:48px 0 32px}
.ft-bottom{border-top:1px solid #1e293b;padding:16px 0;display:flex}
.ft-bottom .container{display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:8px}
.ft-bottom-links{display:flex;gap:16px}
.ft-bottom-links a,.ft-bottom a{color:#64748b;text-decoration:none;font-size:.8rem;transition:color .2s}
.ft-bottom-links a:hover,.ft-bottom a:hover{color:#86efac}
.ft-brand{font-size:1.6rem;font-weight:900;color:#fff;text-decoration:none;letter-spacing:-.5px;display:inline-block;margin-bottom:10px}
.ft-brand:hover{color:#86efac}
.ft-tagline{color:#64748b;font-size:.85rem;line-height:1.6;margin-bottom:14px}
.ft-fb{display:inline-flex;align-items:center;gap:6px;background:#1877f2;color:#fff;padding:6px 14px;border-radius:20px;font-size:.82rem;font-weight:600;text-decoration:none;transition:.2s}
.ft-fb:hover{background:#1558b0;color:#fff}
.ft-heading{color:#e2e8f0;font-weight:700;font-size:.8rem;text-transform:uppercase;letter-spacing:.08em;margin-bottom:12px}
.ft-list{list-style:none;padding:0;margin:0;display:flex;flex-direction:column;gap:8px}
.ft-list a{color:#94a3b8;text-decoration:none;transition:color .2s;font-size:.85rem}
.ft-list a:hover{color:#86efac}
.ft-geo-wrap{display:flex;flex-wrap:wrap;gap:8px}
.ft-geo-btn{display:inline-flex;align-items:center;gap:5px;background:#1e293b;color:#94a3b8;padding:5px 12px;border-radius:20px;font-size:.8rem;text-decoration:none;transition:.2s;border:1px solid #334155}
.ft-geo-btn:hover{background:#008000;color:#fff;border-color:#008000}
.bg-hot{background:#0f172a;}

/* ===== Post/Edit Form ===== */
.post-form-card{background:#fff;border-radius:14px;box-shadow:0 4px 16px rgba(0,0,0,.08);border:1px solid #e2e8f0;margin-bottom:30px;overflow:visible}
.post-form-header{background:#008000;color:#fff;padding:18px 24px;border-radius:14px 14px 0 0;display:flex;align-items:center;gap:10px}
.post-form-header h1{margin:0;font-size:1.2rem;color:#fff;font-weight:700}
.post-form-body{padding:24px}
.post-form-footer{padding:16px 24px;background:#f8fafc;border-top:1px solid #e2e8f0;border-radius:0 0 14px 14px;display:flex;justify-content:flex-end;gap:10px}
.form-label-custom{font-weight:600;color:#374151;font-size:.9rem;margin-bottom:6px;display:block}
.form-control-custom{width:100%;padding:10px 14px;border:1px solid #d1d5db;border-radius:8px;font-size:1rem;font-family:inherit;transition:border-color .2s,box-shadow .2s}
.form-control-custom:focus{outline:none;border-color:#008000;box-shadow:0 0 0 3px rgba(0,128,0,.1)}
.img-preview{width:64px;height:64px;object-fit:cover;border-radius:8px;border:2px dashed #d1d5db;background:#f9fafb}
.preloader{display:none;position:fixed;inset:0;background:rgba(255,255,255,.92);z-index:9999;justify-content:center;align-items:center;flex-direction:column;gap:12px}
.preloader progress{width:240px;height:8px;accent-color:#008000}
#output { width: 120px; height: 120px;object-fit: cover; border-radius: 8px; border: 2px dashed #ddd; background: #fafafa;}