/* ===== EKSASTRA custom homepage (scoped, robust) ===== */

/* front-page reset: hide theme chrome, full-bleed content (home only) */
body.home .wp-block-template-part,
body.home header.wp-block-template-part,
body.home footer.wp-block-template-part,
body.home .wp-site-blocks > header,
body.home .wp-site-blocks > footer,
body.home .entry-header,
body.home .wp-block-post-title,
body.home .post-navigation,
body.home .wp-block-post-navigation-link,
body.home .sharedaddy, body.home .sd-sharing, body.home .jp-relatedposts,
body.home .addtoany_share_save_container, body.home #jp-post-flair,
body.home .entry-footer,
body.home .ekcc-nav,
body.home .eksc-wrap { display:none !important; }
body.home .wp-site-blocks,
body.home main, body.home .wp-site-blocks > main,
body.home .entry-content, body.home .wp-block-post-content,
body.home .wp-block-group.is-layout-constrained {
  max-width:none !important; width:auto !important; margin:0 !important; padding:0 !important; gap:0 !important;
}
body.home .entry-content > * { max-width:none !important; }
body.home { background:#eef2f8 !important; }

/* design tokens + base */
.eks-home{ --ink:#18324c; --muted:#5d6b7d; --bg:#eef2f8; --card:#ffffff; --line:#e2e8f1;
  --navy:#1c3a59; --navy2:#132638; --gold:#c39a3f; --gold2:#8f6d24; --teal:#2e6fc0;
  font-family:'Kantumruy Pro',system-ui,-apple-system,'Segoe UI','Noto Sans Khmer','Khmer OS',sans-serif; color:var(--ink);
  background:var(--bg); line-height:1.72; font-size:16px; -webkit-font-smoothing:antialiased; }
.eks-home *{ box-sizing:border-box; }
.eks-home a{ color:inherit; text-decoration:none; transition:color .2s, border-color .2s, transform .2s, background .2s; }
.eks-home h1,.eks-home h2,.eks-home h3{ margin:0; }
.eks-wrap{ max-width:1160px; margin:0 auto; padding:0 22px; }

/* header */
.eks-hd{ position:sticky; top:0; z-index:50; background:rgba(238,242,248,.9); backdrop-filter:saturate(1.4) blur(10px); border-bottom:1px solid var(--line); }
.eks-hd .row{ display:flex; align-items:center; gap:16px; height:64px; }
.eks-logo{ display:flex; align-items:center; gap:9px; font-weight:700; font-size:1.25rem; color:var(--navy); }
.eks-logo .mk{ width:34px; height:34px; border-radius:9px; background:var(--navy); color:#f0d89a; display:flex; align-items:center; justify-content:center; font-weight:700; }
.eks-logo b{ color:var(--gold2); }
.eks-nav{ display:flex; gap:2px; margin-left:10px; }
.eks-nav a{ padding:8px 13px; border-radius:9px; font-size:.95rem; font-weight:500; color:var(--muted); }
.eks-nav a:hover{ color:var(--navy); background:#e2e9f3; }
.eks-sp{ flex:1; }
.eks-hd .hsrch{ display:flex; align-items:center; gap:8px; background:#fff; border:1px solid var(--line); border-radius:10px; padding:8px 14px; color:var(--muted); font-size:.9rem; min-width:210px; }

/* hero */
.eks-hero{ padding:54px 0 30px; }
.eks-eyebrow{ font-size:.8rem; font-weight:600; letter-spacing:.05em; color:var(--gold2); text-transform:uppercase; }
.eks-hero h1{ font-size:clamp(2rem,4.6vw,3.05rem); line-height:1.26; font-weight:700; margin:12px 0 0; letter-spacing:-.01em; color:var(--navy); }
.eks-hero .sub{ color:var(--muted); font-size:1.05rem; max-width:62ch; margin:16px 0 0; }
.eks-search{ display:flex; gap:8px; margin:24px 0 0; background:#fff; border:1px solid var(--line); border-radius:14px; padding:8px; max-width:560px; box-shadow:0 12px 32px -20px rgba(20,41,63,.5); }
.eks-search .fld{ flex:1; display:flex; align-items:center; gap:9px; padding:8px 12px; color:var(--muted); font-size:1rem; }
.eks-search .go{ background:linear-gradient(135deg,#e3c072,#c39a3f); color:#14293f; font-weight:600; border-radius:10px; padding:11px 22px; font-size:.95rem; white-space:nowrap; }
.eks-search .go:hover{ transform:translateY(-1px); }
.eks-chips{ display:flex; flex-wrap:wrap; gap:8px; margin:16px 0 0; align-items:center; }
.eks-chips .lb{ color:var(--muted); font-size:.9rem; font-weight:600; }
.eks-chip{ font-size:.9rem; padding:6px 14px; border-radius:999px; background:#fff; border:1px solid var(--line); }
.eks-chip:hover{ border-color:var(--gold); color:var(--gold2); }

/* hero 2-column + featured card */
.eks-hero .eks-wrap{ display:grid; grid-template-columns:1.08fr .92fr; gap:44px; align-items:center; }
.eks-hero-l{ min-width:0; }
.eks-hero-viz{ position:relative; }
.hv-card{ background:var(--card); border:1px solid var(--line); border-radius:20px; box-shadow:0 24px 56px -26px rgba(20,41,63,.55); padding:22px; position:relative; z-index:1; }
.hv-card::before{ content:""; position:absolute; inset:-14px -14px auto auto; width:140px; height:140px; background:radial-gradient(circle,rgba(201,161,76,.22),transparent 68%); border-radius:50%; z-index:-1; }
.hv-top{ display:flex; align-items:center; justify-content:space-between; margin-bottom:16px; }
.hv-badge{ font-size:.72rem; font-weight:600; background:var(--navy); color:#f0d89a; padding:5px 12px; border-radius:999px; }
.hv-live{ display:flex; align-items:center; gap:7px; font-size:.72rem; font-weight:600; color:var(--muted); }
.hv-dot{ width:8px; height:8px; border-radius:50%; background:var(--gold); flex:0 0 auto; }
.hv-doc{ display:flex; align-items:center; gap:13px; padding:15px; background:var(--bg); border-radius:14px; border:1px solid var(--line); }
.hv-ic{ width:44px; height:52px; border-radius:9px; background:#fff; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; font-size:.6rem; font-weight:700; color:var(--navy); flex:0 0 auto; }
.hv-t{ font-weight:600; font-size:.98rem; line-height:1.45; }
.hv-m{ font-size:.8rem; color:var(--muted); margin-top:3px; }
.hv-stats{ display:grid; grid-template-columns:repeat(3,1fr); gap:10px; margin-top:16px; }
.hv-stats > div{ text-align:center; background:var(--bg); border:1px solid var(--line); border-radius:12px; padding:12px 6px; }
.hv-stats b{ display:block; font-size:1.3rem; font-weight:700; color:var(--navy); line-height:1.1; }
.hv-stats span{ font-size:.72rem; color:var(--muted); }

/* hero rotating showcase (CSS-only, no script) */
.hv-rota{ position:relative; height:106px; margin-bottom:14px; }
.hv-slide{ position:absolute; inset:0; display:flex; flex-direction:column; justify-content:center; gap:5px; padding:15px 16px; background:var(--bg); border:1px solid var(--line); border-radius:14px; opacity:0; animation:hvcyc 18s infinite; }
.hv-slide:nth-child(1){ animation-delay:0s; }
.hv-slide:nth-child(2){ animation-delay:6s; }
.hv-slide:nth-child(3){ animation-delay:12s; }
.hv-tag{ font-size:.64rem; font-weight:700; color:var(--gold2); text-transform:uppercase; letter-spacing:.05em; }
.hv-slide .st{ font-weight:600; font-size:.92rem; line-height:1.4; color:var(--ink); display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.hv-slide .sm{ font-size:.75rem; color:var(--muted); }
@keyframes hvcyc{ 0%{opacity:0} 2%{opacity:1} 30%{opacity:1} 33%{opacity:0} 100%{opacity:0} }
@media(prefers-reduced-motion:reduce){ .hv-slide{ animation:none; } .hv-slide:nth-child(1){ opacity:1; } }

/* 3-column lists */
.eks-3col{ display:grid; grid-template-columns:repeat(3,1fr); gap:16px; }
.eks-3col .eks-doc .dt{ display:-webkit-box; -webkit-line-clamp:2; -webkit-box-orient:vertical; overflow:hidden; }
.eks-3col .eks-card{ padding:20px 20px; }

/* sections */
.eks-sec{ padding:34px 0; }
.eks-sec.tint{ background:#e7edf6; border-top:1px solid var(--line); border-bottom:1px solid var(--line); }
.eks-shd{ margin-bottom:20px; }
.eks-shd .k{ font-size:.78rem; font-weight:600; letter-spacing:.05em; color:var(--gold2); text-transform:uppercase; }
.eks-shd h2{ font-size:1.5rem; font-weight:700; margin:6px 0 0; color:var(--navy); }
.eks-shd p{ color:var(--muted); font-size:.95rem; margin:5px 0 0; }
.eks-shd .all{ float:right; color:var(--teal); font-weight:600; font-size:.9rem; margin-top:8px; }

/* KPI */
.eks-kpis{ display:grid; grid-template-columns:repeat(4,1fr); gap:14px; }
.eks-kpi{ background:var(--card); border:1px solid var(--line); border-radius:14px; padding:20px; box-shadow:0 2px 6px -4px rgba(20,41,63,.18); position:relative; overflow:hidden; }
.eks-kpi::before{ content:""; position:absolute; left:0; top:0; bottom:0; width:3px; background:linear-gradient(180deg,#e3c072,#c39a3f); }
.eks-kpi .n{ font-size:2rem; font-weight:700; color:var(--navy); letter-spacing:-.02em; line-height:1.1; }
.eks-kpi .l{ color:var(--muted); font-size:.9rem; margin-top:5px; }

/* card + 2col */
.eks-2col{ display:grid; grid-template-columns:1fr 1fr; gap:16px; }
.eks-card{ background:var(--card); border:1px solid var(--line); border-radius:16px; padding:22px 24px; box-shadow:0 2px 8px -4px rgba(20,41,63,.15); }
.eks-card .ct{ font-size:1.05rem; font-weight:700; color:var(--navy); }
.eks-card .cs{ font-size:.83rem; color:var(--muted); margin:3px 0 18px; }

/* bar chart */
.eks-bars{ display:flex; flex-direction:column; gap:12px; }
.eks-bar .t{ display:flex; align-items:center; gap:8px; margin-bottom:5px; }
.eks-bar .ab{ font-size:.68rem; font-weight:600; background:#eef2f8; border:1px solid var(--line); color:var(--gold2); padding:2px 7px; border-radius:6px; letter-spacing:.02em; }
.eks-bar .nm{ flex:1; font-size:.88rem; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; color:var(--ink); }
.eks-bar .v{ font-weight:700; font-size:.88rem; color:var(--navy); }
.eks-bar .track{ height:11px; background:#e7edf6; border-radius:99px; overflow:hidden; }
.eks-bar .fill{ height:100%; background:linear-gradient(90deg,#e3c072,#c39a3f); border-radius:99px; min-width:6px; }

/* month columns */
.eks-months{ display:flex; align-items:flex-end; gap:8px; height:190px; padding-top:10px; }
.eks-mo{ flex:1; display:flex; flex-direction:column; align-items:center; justify-content:flex-end; gap:6px; height:100%; }
.eks-mo .mv{ font-size:.72rem; font-weight:700; color:var(--navy); }
.eks-mo .col{ width:100%; max-width:30px; background:linear-gradient(180deg,#4a7ab5,#1c3a59); border-radius:6px 6px 0 0; }
.eks-mo .col.hi{ background:linear-gradient(180deg,#e3c072,#c39a3f); }
.eks-mo .ml{ font-size:.68rem; color:var(--muted); }

/* browse by type */
.eks-grid3{ display:grid; grid-template-columns:repeat(3,1fr); gap:13px; }
.eks-cat{ background:var(--card); border:1px solid var(--line); border-radius:14px; padding:16px 18px; display:flex; align-items:center; gap:13px; }
.eks-cat:hover{ border-color:var(--gold); transform:translateY(-2px); box-shadow:0 10px 26px -16px rgba(20,41,63,.4); }
.eks-cat .ico{ width:42px; height:42px; border-radius:11px; background:#eef2f8; display:flex; align-items:center; justify-content:center; color:var(--gold2); font-weight:700; flex:0 0 auto; }
.eks-cat .cn{ font-weight:600; font-size:.98rem; }
.eks-cat .cc{ font-size:.83rem; color:var(--muted); }

/* doc list */
.eks-docs{ display:flex; flex-direction:column; }
.eks-doc{ display:flex; align-items:center; gap:14px; padding:14px 0; border-bottom:1px solid var(--line); }
.eks-doc:last-child{ border-bottom:0; }
.eks-doc .ic{ width:40px; height:46px; border-radius:8px; background:#eef2f8; border:1px solid var(--line); display:flex; align-items:center; justify-content:center; color:var(--navy); flex:0 0 auto; font-size:.62rem; font-weight:700; }
.eks-doc .m{ flex:1; min-width:0; }
.eks-doc .dt{ font-weight:600; font-size:.98rem; line-height:1.5; }
.eks-doc .dd{ font-size:.82rem; color:var(--muted); margin-top:2px; }
.eks-doc .go{ color:var(--teal); font-weight:600; font-size:.9rem; flex:0 0 auto; }

/* ministry chips */
.eks-mins{ display:flex; flex-wrap:wrap; gap:10px; }
.eks-min{ background:var(--card); border:1px solid var(--line); border-radius:11px; padding:11px 15px; font-size:.9rem; font-weight:500; display:flex; align-items:center; gap:9px; }
.eks-min:hover{ border-color:var(--gold); color:var(--gold2); transform:translateY(-2px); }
.eks-min .d{ width:8px; height:8px; border-radius:2px; background:var(--gold); flex:0 0 auto; }

/* scholarships */
.eks-sch{ display:grid; grid-template-columns:repeat(3,1fr); gap:14px; }
.eks-scard{ background:var(--card); border:1px solid var(--line); border-radius:14px; padding:18px 20px; display:flex; flex-direction:column; }
.eks-scard:hover{ border-color:var(--gold); transform:translateY(-3px); box-shadow:0 14px 30px -18px rgba(20,41,63,.45); }
.eks-scard .tp{ display:flex; align-items:center; gap:8px; margin-bottom:9px; }
.eks-scard .fl{ font-size:.72rem; font-weight:600; padding:3px 10px; border-radius:99px; background:#eef2f8; color:var(--gold2); }
.eks-scard h3{ font-size:.96rem; font-weight:600; line-height:1.5; }
.eks-scard .dd{ font-size:.82rem; color:var(--muted); margin-top:auto; padding-top:12px; }
.eks-scard.more{ align-items:center; justify-content:center; text-align:center; background:linear-gradient(160deg,#1c3a59,#132638); color:#e7eef7; }
.eks-scard.more .big{ font-size:1.6rem; font-weight:700; color:#f0d89a; }

/* footer */
.eks-ft{ background:var(--navy2); color:#cdd8e6; margin-top:22px; }
.eks-ft .g{ display:grid; grid-template-columns:1.7fr 1fr 1fr 1fr; gap:26px; padding:42px 0 26px; }
.eks-ft h4{ color:#8ea4bd; font-size:.76rem; text-transform:uppercase; letter-spacing:.09em; margin:0 0 12px; }
.eks-ft a{ display:block; color:#cdd8e6; font-size:.9rem; padding:4px 0; }
.eks-ft a:hover{ color:#f0d89a; }
.eks-ft .lg{ display:flex; align-items:center; gap:9px; font-weight:700; font-size:1.2rem; color:#fff; }
.eks-ft .lg .mk{ width:32px; height:32px; border-radius:8px; background:#f0d89a; color:#14293f; display:flex; align-items:center; justify-content:center; }
.eks-ft .ab{ color:#9fb2c9; font-size:.9rem; margin-top:12px; max-width:36ch; }
.eks-ft .bot{ border-top:1px solid rgba(255,255,255,.1); padding:18px 0; display:flex; flex-wrap:wrap; gap:10px; justify-content:space-between; font-size:.82rem; color:#8ea4bd; }

/* responsive */
@media(max-width:900px){
  .eks-hero .eks-wrap{ grid-template-columns:1fr; gap:30px; }
  .eks-kpis{ grid-template-columns:repeat(2,1fr); }
  .eks-2col,.eks-grid3,.eks-sch,.eks-3col{ grid-template-columns:1fr; }
  .eks-ft .g{ grid-template-columns:1fr 1fr; }
  .eks-nav,.eks-hd .hsrch{ display:none; }
}
@media(max-width:560px){
  .eks-kpis{ grid-template-columns:1fr 1fr; }
  .eks-months{ gap:4px; height:170px; }
  .eks-mo .ml{ font-size:.6rem; }
  .eks-ft .g{ grid-template-columns:1fr; }
}

/* ===== ek-kourdeng-dir-widen: widen narrow directory blocks on /kourdeng/ (page 16851, desktop) ===== */
@media(min-width:1000px){
body.page-id-16851 #kd,
body.page-id-16851 .eksc-wrap{
  width: min(1400px, 92vw) !important;
  max-width: min(1400px, 92vw) !important;
  margin-left: calc(50% - min(700px, 46vw)) !important;
  margin-right: calc(50% - min(700px, 46vw)) !important;
}
}

/* ===== ek-archive-widen: full-width archive/category pages ===== */
body.archive main.wp-block-query{max-width:none !important;width:100% !important}
body.archive .ek-cards,
body.archive .ek-th,
body.archive .ek-tbc,
body.archive .ek-tcbar,
body.archive .ek-dhero,
body.archive .ek-dbc,
body.archive .ek-dfilter{max-width:1400px !important}

/* ===== ek-kd-hub-widen: widen branded /category/kourdeng hub (desktop only) ===== */
@media(min-width:1200px){
body.archive .ek-kd-wrap,
body.archive .ek-kd-cols,
body.archive .ek-kd-hero,
body.archive .ek-kd-toolbar{max-width:1400px !important}
body.archive .ek-kd-cols{grid-template-columns:minmax(0,1fr) 320px !important}
}

/* ===== ek-lesson-widen: widen two-column lesson layout on /kourdeng/ lessons (desktop) ===== */
@media(min-width:1000px){
.ekl-article-layout{
  max-width: min(1180px, 94vw) !important;
  grid-template-columns: 220px minmax(0,1fr) !important;
}
}
/* ek-hide-session1 : hide duplicate post header on all designed articles (.ek-wrap). remove this block to undo */
body:has(.ek-wrap) .ek-sp-bc,
body:has(.ek-wrap) .ek-bc,
body:has(.ek-wrap) .wp-block-columns:has(.ek-bc),
body:has(.ek-wrap) .wp-block-group.is-position-sticky:has(a[href*="payway"]),
body:has(.ek-wrap) .ek-desc-wrap,
body:has(.ek-wrap) .wp-block-group:has(> .ekl-article-layout) > hr:first-child,
body:has(.ek-wrap) .wp-block-group:has(> .ekl-article-layout) > .wp-block-spacer{display:none !important;}


/* ============================================================
 *    Fix: /scholarships/ horizontal overflow (page-id-16346 only)
 *    Added by Claude technical audit - 2026-07-21
 *    Root Cause 1: <main> template flex wrapper (flex-wrap:nowrap +
 *    justify-content:center) has a single content child with no
 *    min-width, so on narrow screens it cannot shrink below its
 *    content's intrinsic width and the whole page overflows equally
 *    left/right (measured: 64px @320px, 37px @375px, 17px @414px).
 *    Root Cause 2: #eks-sch .filter-grid uses repeat(2,1fr) without
 *    minmax(0,...), so <select> filter fields refuse to shrink and
 *    get silently clipped by #eks-sch's own overflow-x:hidden,
 *    making some mobile filters unreachable.
 *    Verified 0px overflow at 320/360/375/390/414/768/820/1024/
 *    1280/1366/1440/1920px after this fix, with no change at
 *    tablet/desktop widths. Scoped to body.page-id-16346 only, so
 *    no other page on the site is affected.
 *    ============================================================ */
body.page-id-16346 main.wp-block-group.is-layout-flex > .wp-block-group.is-layout-constrained {
	min-width: 0;
}

body.page-id-16346 #eks-sch .filter-grid {
	grid-template-columns: repeat(2, minmax(0, 1fr));
}

body.page-id-16346 #eks-sch .filter-grid > *,
body.page-id-16346 #eks-sch .fld,
body.page-id-16346 #eks-sch .fld select,
body.page-id-16346 #eks-sch select.kh {
	min-width: 0;
	max-width: 100%;
}
}
}
}