/* ===========================================================
   BHE UNI — University details page (v2 redesign)
   Every rule is scoped to .ud-page so it does not leak into the
   shared layout. Heading/paragraph sizes use !important because
   front/css/style.css forces h1–h6 and p sizes with !important.
   =========================================================== */
.ud-page {
  --navy-900: #0a1a33;
  --navy-800: #0f2747;
  --brand-50: #fff5ed;
  --brand-300: #ffb877;
  --brand-400: #ff9a47;
  --brand-500: #f47b20;
  --brand-600: #dd6610;
  --orange-grad: linear-gradient(90deg, #f7a823, #f47b20);
  --section-pad: 56px;
  font-family: "Kanit", system-ui, -apple-system, sans-serif;
  color: var(--navy-900);
  background: #fff;
  -webkit-font-smoothing: antialiased;
}
.ud-page .container-xxl { max-width: 1320px; }
.ud-page a { text-decoration: none; }
.ud-page :is(a, button):focus-visible { outline: 3px solid #ff9823; outline-offset: 3px; }
.ud-page .section { padding-top: var(--section-pad); padding-bottom: var(--section-pad); }
.ud-page .bg-soft-line { background: #f8fafc; border-top: 1px solid #e8edf3; border-bottom: 1px solid #e8edf3; }
.ud-page .section-title { font-weight: 600; letter-spacing: -.01em; line-height: 1.1; font-size: clamp(1.9rem, 3.6vw, 2.7rem) !important; color: var(--navy-900); margin: 0; }
.ud-page .section-sub { font-size: 17px !important; line-height: 1.6; color: #5b6b82; margin: 16px 0 0; }

/* ---- breadcrumb ---- */
.ud-page .cd-crumbbar { background: #fff; border-bottom: 1px solid #eef2f7; padding: 16px 0; }
.ud-page .cd-crumb { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; font-size: 13.5px; font-weight: 500; }
.ud-page .cd-crumb a { color: #64748b; }
.ud-page .cd-crumb a:hover { color: var(--brand-600); }
.ud-page .cd-crumb i { color: #cbd5e1; font-size: 11px; }
.ud-page .cd-crumb .cur { color: var(--navy-900); font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 340px; }

/* ---- hero ---- */
.ud-page .cd-visual { position: relative; }
.ud-page .cd-photo { position: relative; height: 360px; overflow: hidden; background: #dbe3ee; }
.ud-page .cd-photo::after { content: ""; position: absolute; inset: 0; background: linear-gradient(110deg, rgba(10,35,85,.48), rgba(28,63,158,.32)); pointer-events: none; }
.ud-page .cd-photo > img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center; }
.ud-page .cd-banner { position: relative; isolation: isolate; overflow: hidden; padding: 44px 0 92px;
  background-color: #0f2747;
  background-image: radial-gradient(circle at 95% 50%, transparent 0 90px, #ffffff0b 91px 93px, transparent 94px 140px, #ffffff0b 141px 143px, transparent 144px), linear-gradient(105deg, #06122a, transparent);
  background-repeat: no-repeat; }
.ud-page .cd-banner h1 { font-weight: 700; font-size: clamp(1.8rem, 3.6vw, 2.6rem) !important; line-height: 1.28; color: #fff; margin: 0; }
.ud-page .cd-hl { display: inline-block; background: var(--brand-500); color: #fff; padding: 5px 14px; border-radius: 6px; box-decoration-break: clone; -webkit-box-decoration-break: clone; }
.ud-page .cd-loc { display: flex; align-items: center; gap: 9px; font-weight: 600; font-size: 15.5px; color: #fff; margin-top: 16px; }
.ud-page .cd-loc i { opacity: .85; }
.ud-page .cd-banner-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 22px; }
.ud-page .cd-wbtn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 46px; padding: 0 22px; border-radius: 999px; background: #fff; color: #1c3f9e; font-weight: 600; font-size: 14.5px; transition: transform .2s, box-shadow .2s; box-shadow: 0 10px 22px -12px rgba(0,0,0,.35); }
.ud-page .cd-wbtn:hover { transform: translateY(-2px); color: #1c3f9e; box-shadow: 0 16px 28px -12px rgba(0,0,0,.4); }
.ud-page .cd-wbtn.solid { background: transparent; color: #fff; border: 1.5px solid rgba(255,255,255,.8); box-shadow: none; }
.ud-page .cd-wbtn.solid:hover { background: rgba(255,255,255,.12); color: #fff; }
.ud-page .cd-side-actions { display: flex; gap: 10px; margin-top: 22px; }
.ud-page .cd-sbtn { display: inline-flex; align-items: center; gap: 7px; height: 38px; padding: 0 16px; border-radius: 999px; background: rgba(255,255,255,.95); border: 1px solid rgba(226,232,240,.9); color: var(--navy-800); font-weight: 500; font-size: 13px; cursor: pointer; transition: all .2s; }
.ud-page .cd-sbtn:hover { border-color: var(--brand-400); color: var(--brand-600); }

/* ---- information card ---- */
.ud-page .cd-info-sticky { position: sticky; top: 96px; margin-top: -40px; z-index: 6; max-width: 390px; margin-left: auto; }
.ud-page .cd-info-card { background: #fff; border-radius: 18px; overflow: hidden; box-shadow: 0 34px 70px -34px rgba(10,26,51,.5); }
.ud-page .cd-info-head { background: linear-gradient(100deg, #1c3f9e, #2a55cf); text-align: center; padding: 20px; font-weight: 600; font-size: 19px; color: #fff; }
.ud-page .cd-info-body { padding: 8px 24px 24px; }
.ud-page .cd-info-row { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; padding: 14px 0; border-bottom: 1px dashed #e2e8f0; }
.ud-page .cd-info-row:last-of-type { border-bottom: 0; }
.ud-page .cd-info-row .ir-k { font-weight: 600; font-size: 13.5px; color: #1c3f9e; white-space: nowrap; }
.ud-page .cd-info-row .ir-v { font-weight: 500; font-size: 13.5px; color: #475569; text-align: right; overflow-wrap: anywhere; }
.ud-page .cd-info-row .ir-v a { color: #475569; text-decoration: underline; text-underline-offset: 2px; }
.ud-page .cd-info-apply { display: flex; align-items: center; justify-content: center; gap: 8px; width: 100%; height: 52px; margin-top: 18px; border-radius: 12px; background: var(--orange-grad); color: #fff; font-weight: 600; font-size: 15.5px; box-shadow: 0 16px 30px -14px rgba(244,123,32,.6); transition: transform .2s, box-shadow .2s; }
.ud-page .cd-info-apply:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 20px 36px -14px rgba(244,123,32,.7); }
@media (max-width: 991px) {
  .ud-page .cd-photo { height: 260px; }
  .ud-page .cd-banner { padding: 34px 0 40px; }
  .ud-page .cd-info-sticky { position: static; margin: 16px 0 0; max-width: none; padding-bottom: 8px; }
  .ud-page .cd-side-actions { margin-top: 14px; }
}
@media (max-width: 575px) { .ud-page .cd-hl { padding: 4px 10px; } }

/* ---- tabs ---- */
.ud-page .ud-tabs { display: flex; border-bottom: 1px solid #eef2f7; margin-bottom: 32px; overflow-x: auto; }
.ud-page .ud-tab { flex: 1; text-align: center; padding: 16px 10px; font-weight: 600; font-size: 15px; color: #94a3b8; background: none; border: 0; border-bottom: 3px solid transparent; cursor: pointer; white-space: nowrap; transition: color .2s, border-color .2s; }
.ud-page .ud-tab:hover { color: #2a55cf; }
.ud-page .ud-tab[aria-selected="true"] { color: #1c3f9e; border-bottom-color: #2a55cf; background: linear-gradient(180deg, rgba(42,85,207,.06), transparent); }
.ud-page .ud-panel[hidden] { display: none; }
.ud-page .ud-panel-title { font-size: clamp(24px, 2.5vw, 32px) !important; font-weight: 600; line-height: 1.2; color: var(--navy-900); margin: 0 0 24px; }

/* ---- overview ---- */
.ud-page .ud-overview-row { display: flex; gap: 26px; align-items: flex-start; flex-wrap: wrap; margin-bottom: 30px; }
.ud-page .ud-logo-card { width: 200px; flex: none; border: 1.5px solid #cfe0fb; border-radius: 16px; overflow: hidden; background: #f8fafc; }
.ud-page .ud-logo-card img { display: block; width: 100%; height: 200px; padding: 28px; object-fit: contain; }
.ud-page .ud-logo-card .ud-logo-fallback { display: grid; place-items: center; height: 200px; font-weight: 700; font-size: 44px; color: #213870; }
.ud-page .ud-overview-text { flex: 1; min-width: 240px; }
.ud-page .ud-fact-table { border-top: 1px solid #eef2f7; }
.ud-page .ud-fact-row { display: flex; flex-wrap: wrap; gap: 8px 24px; padding: 16px 4px; border-bottom: 1px solid #eef2f7; }
.ud-page .ud-fact-row .fk { flex: 0 0 190px; font-weight: 600; font-size: 15px; color: var(--navy-900); }
.ud-page .ud-fact-row .fv { flex: 1; min-width: 180px; font-weight: 300; font-size: 15px; color: #475569; overflow-wrap: anywhere; }
.ud-page .ud-fact-row .fv a { color: var(--brand-600); text-decoration: underline; text-underline-offset: 2px; }
.ud-page .ud-sec { margin-top: 34px; }
.ud-page .ud-sec > h3, .ud-page .ud-why-h { font-weight: 600; font-size: 19px !important; line-height: 1.3; color: var(--navy-900); margin: 0 0 12px; }
.ud-page .ud-why-h { font-size: 22px !important; margin: 34px 0 12px; }
.ud-page .ud-fee-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; margin-top: 8px; }
@media (max-width: 640px) { .ud-page .ud-fee-cols { grid-template-columns: 1fr; } }

/* ---- rich text coming from the CMS editor ---- */
.ud-page .ud-rich { font-weight: 300; font-size: 15px; line-height: 1.75; color: #334155; overflow-wrap: anywhere; }
.ud-page .ud-rich p, .ud-page .ud-rich li, .ud-page .ud-rich td, .ud-page .ud-rich span { font-size: 15px !important; font-weight: 300; line-height: 1.75; color: #334155; }
.ud-page .ud-rich p { margin: 0 0 14px; }
.ud-page .ud-rich p:last-child { margin-bottom: 0; }
.ud-page .ud-rich :is(h1, h2, h3, h4, h5, h6) { font-weight: 600; font-size: 15.5px !important; line-height: 1.4; color: var(--navy-900); margin: 16px 0 6px; }
.ud-page .ud-rich strong, .ud-page .ud-rich b { font-weight: 600; color: var(--navy-900); }
.ud-page .ud-rich a { color: var(--brand-600); font-weight: 500; text-decoration: underline; text-underline-offset: 2px; }
.ud-page .ud-rich img { max-width: 100%; height: auto; border-radius: 12px; }
.ud-page .ud-rich table { width: 100%; margin: 0 0 14px; border-collapse: collapse; }
.ud-page .ud-rich td, .ud-page .ud-rich th { padding: 8px 10px; border: 1px solid #eef2f7; }
.ud-page .ud-rich ul, .ud-page .ud-plain-list { list-style: none; margin: 0 0 14px; padding: 0; }
.ud-page .ud-rich ul li, .ud-page .ud-plain-list li { position: relative; padding-left: 16px; font-weight: 300; font-size: 15px !important; line-height: 1.8; color: #334155; }
.ud-page .ud-rich ul li::before, .ud-page .ud-plain-list li::before { content: "-"; position: absolute; left: 0; color: #94a3b8; }
.ud-page .ud-rich ol { margin: 0 0 14px; padding-left: 20px; }

/* ---- history ---- */
.ud-page .ud-hist-photo { border-radius: 18px; overflow: hidden; margin-bottom: 26px; }
.ud-page .ud-hist-photo img { display: block; width: 100%; max-height: 380px; object-fit: cover; }

/* ---- why study ---- */
.ud-page .ud-gallery { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin: 26px 0 0; }
.ud-page .ud-gallery img { display: block; width: 100%; height: 150px; object-fit: cover; border-radius: 12px; }
@media (max-width: 767px) { .ud-page .ud-gallery { grid-template-columns: repeat(2, 1fr); } }
.ud-page .ud-why-rich ul { display: grid; grid-template-columns: 1fr 1fr; gap: 9px 32px; }
.ud-page .ud-why-rich ul li { font-size: 14.5px !important; line-height: 1.6; color: #475569; }
.ud-page .ud-why-rich ul li::before { content: ""; top: 9px; width: 5px; height: 5px; border-radius: 50%; background: var(--brand-500); }
@media (max-width: 575px) { .ud-page .ud-why-rich ul { grid-template-columns: 1fr; } }

/* ---- course cards ---- */
.ud-page .ud-courses-section { scroll-margin-top: 96px; border-top: 1px solid #e9eef5; }
.ud-page .course-card { height: 100%; background: #fff; border: 1px solid rgba(226,232,240,.85); border-radius: 20px; overflow: hidden; transition: transform .3s, box-shadow .3s, border-color .3s; display: flex; flex-direction: column; }
.ud-page .course-card:hover { transform: translateY(-5px); border-color: rgba(255,184,119,.7); box-shadow: 0 28px 56px -30px rgba(244,123,32,.4); }
.ud-page .course-thumbnail { position: relative; min-height: 200px; padding: 100px 22px 26px; display: flex; align-items: flex-end; isolation: isolate; background: #102443 url("../img/university-details/course-thumbnail.svg") center/cover no-repeat; }
.ud-page .course-lvl { position: absolute; top: 22px; right: 20px; z-index: 2; max-width: 48%; font-weight: 500; font-size: 10px; line-height: 1.4; color: #dce9fc; background: #ffffff0d; border: 1px solid #ffffff26; border-radius: 999px; padding: 5px 9px; }
.ud-page .course-thumbnail-brand { position: absolute; top: 18px; left: 22px; display: block; width: 86px; height: auto; }
.ud-page .course-thumbnail-title { position: relative; display: block; width: 100%; margin: 0; color: #fff; font-size: 24px !important; font-weight: 500; line-height: 1.22; letter-spacing: -.35px; overflow-wrap: break-word; text-wrap: balance; }
.ud-page .course-thumbnail-title::before { content: ""; display: block; width: 30px; height: 3px; margin-bottom: 13px; border-radius: 3px; background: linear-gradient(90deg, #ffb52c, #ff7620); }
.ud-page .course-thumbnail-title.is-long { font-size: 20px !important; line-height: 1.28; }
.ud-page .course-thumbnail-title a { color: inherit; }
.ud-page .course-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.ud-page .course-uni { display: flex; align-items: center; gap: 7px; font-size: 13.5px; color: #5b6b82; margin-bottom: 16px; }
.ud-page .course-uni i { color: var(--brand-500); }
.ud-page .course-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; padding-top: 16px; border-top: 1px solid #eef2f7; }
.ud-page .course-meta .cm-k { font-weight: 300; font-size: 11.5px; color: #94a3b8; }
.ud-page .course-meta .cm-v { font-weight: 600; font-size: 13.5px; color: var(--navy-900); margin-top: 2px; overflow-wrap: anywhere; }
.ud-page .course-meta .cm-v.fee { color: #0d9488; }
.ud-page .course-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 18px; }
.ud-page .course-apply { display: inline-flex; align-items: center; gap: 7px; font-weight: 600; font-size: 14px; color: #fff; background: var(--orange-grad); border-radius: 999px; padding: 10px 20px; transition: transform .2s, box-shadow .2s; box-shadow: 0 12px 24px -12px rgba(244,123,32,.6); }
.ud-page .course-apply:hover { transform: translateY(-2px); color: #fff; box-shadow: 0 18px 30px -12px rgba(244,123,32,.75); }
.ud-page .course-save { width: 40px; height: 40px; border-radius: 11px; border: 1px solid #dde5ef; background: #fff; color: #94a3b8; cursor: pointer; transition: all .2s; display: grid; place-items: center; font-size: 16px; }
.ud-page .course-save:hover, .ud-page .course-save.saved { border-color: var(--brand-400); color: var(--brand-500); background: var(--brand-50); }
.ud-page .ud-empty { color: #94a3b8; text-align: center; }
.ud-page .btn-brand { display: inline-flex; align-items: center; gap: 8px; height: 52px; padding: 0 32px; border-radius: 999px; background: var(--orange-grad); color: #fff; border: 0; font-weight: 600; font-size: 16px; box-shadow: 0 14px 30px -12px rgba(244,123,32,.6); transition: transform .2s, box-shadow .2s; }
.ud-page .btn-brand:hover { color: #fff; transform: translateY(-2px); box-shadow: 0 18px 40px -10px rgba(244,123,32,.85); }

/* ---- related universities ---- */
.ud-page .cd-related-card { display: block; height: 100%; background: #fff; border: 1px solid rgba(226,232,240,.7); border-radius: 16px; padding: 20px; transition: transform .3s, box-shadow .3s, border-color .3s; }
.ud-page .cd-related-card:hover { transform: translateY(-4px); border-color: rgba(255,184,119,.7); box-shadow: 0 22px 46px -28px rgba(244,123,32,.3); }
.ud-page .cd-related-card h3 { font-weight: 600; font-size: 16px !important; line-height: 1.3; color: var(--navy-900); margin: 10px 0 6px; }
.ud-page .cd-related-card .rc-meta { font-weight: 300; font-size: 12.5px; color: #64748b; }
.ud-page .cd-lvl { display: inline-flex; align-items: center; font-weight: 500; font-size: 13px; padding: 7px 16px; border-radius: 999px; background: #eef3fc; color: #1c3f9e; border: 1px solid rgba(28,63,158,.18); }

/* ---- CTA ---- */
.ud-page .cta-banner-sec { padding: 64px 0; background: #fff; }
.ud-page .cta-banner { position: relative; overflow: hidden; border-radius: 34px; padding: 64px 32px; text-align: center; background: linear-gradient(108deg, #142c7a 0%, #2452cf 52%, #3f74e8 100%); box-shadow: 0 44px 90px -44px rgba(20,52,140,.7); }
.ud-page .cta-banner::before { content: ""; position: absolute; inset: 0; background: radial-gradient(120% 90% at 88% 18%, rgba(255,255,255,.16), transparent 55%), radial-gradient(90% 80% at 8% 92%, rgba(8,20,60,.45), transparent 60%); pointer-events: none; }
.ud-page .cta-banner::after { content: ""; position: absolute; right: -70px; top: -70px; width: 260px; height: 260px; border-radius: 50%; border: 1.5px solid rgba(255,255,255,.12); pointer-events: none; }
.ud-page .cta-banner > * { position: relative; z-index: 1; }
.ud-page .cta-banner h2 { font-weight: 700; font-size: clamp(1.9rem, 4.2vw, 3rem) !important; line-height: 1.08; color: #fff; margin: 0; }
.ud-page .cta-banner p { font-size: 16px !important; line-height: 1.65; color: rgba(255,255,255,.78); max-width: 620px; margin: 16px auto 0; }
.ud-page .cta-banner .btn-cta { display: inline-flex; align-items: center; gap: 8px; margin-top: 30px; padding: 14px 34px; border-radius: 999px; font-weight: 600; font-size: 15.5px; color: #fff; border: 1.5px solid rgba(255,255,255,.65); transition: all .25s; }
.ud-page .cta-banner .btn-cta:hover { background: #fff; color: #1c3f9e; border-color: #fff; transform: translateY(-2px); }
@media (max-width: 575px) { .ud-page .cta-banner { padding: 48px 22px; border-radius: 26px; } }

@media (prefers-reduced-motion: reduce) { .ud-page * { transition: none !important; transform: none !important; } }
