/* =====================================================================
   Unifour - Knowledge Hub, articles and tools (shared design)
   Same palette and fonts as the homepage (css/style.css), modernised.
   ===================================================================== */
:root {
  --u-blue: #0274b3;
  --u-blue-d: #015a8c;
  --u-navy: #0b2545;
  --u-green: #1f9d55;
  --u-ink: #24303d;
  --u-muted: #64748b;
  --u-line: #e3e8ef;
  --u-bg: #f7f9fc;
  --u-card: #ffffff;
  --u-soft: #eef5fb;
  --u-radius: 14px;
  --u-shadow: 0 1px 2px rgba(15, 35, 60, .06), 0 8px 24px rgba(15, 35, 60, .06);
  --u-head: "Montserrat", sans-serif;
  --u-body: "Open Sans", sans-serif;
}

body.u-page { background: var(--u-bg); color: var(--u-ink); font-family: var(--u-body); }
body.u-page a { color: var(--u-blue); }
body.u-page a:hover { color: var(--u-blue-d); }

/* ---------- header (shared partial) : mobile menu ---------- */
#header { height: auto !important; padding: 18px 0 !important; position: sticky; top: 0; }
#header .container { display: flex; align-items: center; justify-content: space-between; }
#header #logo h1 a { white-space: nowrap; }
#header .nav-menu a { white-space: nowrap; }
#header .nav-menu > li { margin-left: 6px; }
@media (max-width: 1280px) { #header #logo h1 { font-size: 30px !important; } #header .nav-menu a { padding: 10px 6px; } }
.nav-toggle { display: none; background: none; border: 1px solid var(--u-line); border-radius: 10px;
  width: 42px; height: 42px; font-size: 20px; color: var(--u-navy); cursor: pointer; }
@media (max-width: 991px) {
  #header #logo h1 { font-size: 24px !important; }
  #header #logo img { max-height: 36px !important; height: 36px !important; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  #nav-menu-container { display: none !important; position: absolute; top: 100%; left: 0; right: 0;
    background: #fff; box-shadow: 0 12px 24px rgba(0,0,0,.08); padding: 8px 16px 16px; }
  #header.nav-open #nav-menu-container { display: block !important; }
  #header .nav-menu { flex-direction: column; align-items: stretch; }
  #header .nav-menu > li { margin: 0; border-bottom: 1px solid var(--u-line); }
  #header .nav-menu a { display: block; padding: 12px 4px; }
}

/* ---------- hero ---------- */
.u-hero { background: radial-gradient(1200px 300px at 85% -10%, rgba(2,116,179,.16), transparent 60%),
  linear-gradient(180deg, #ffffff 0%, var(--u-soft) 100%); border-bottom: 1px solid var(--u-line);
  padding: 44px 0 40px; }
.u-hero .u-crumbs { font-size: 13px; color: var(--u-muted); margin-bottom: 14px; }
.u-hero .u-crumbs a { color: var(--u-muted); text-decoration: none; }
.u-hero .u-crumbs a:hover { color: var(--u-blue); }
.u-hero .u-crumbs span { margin: 0 6px; opacity: .6; }
.u-hero h1 { font-family: var(--u-head); font-weight: 700; color: var(--u-navy); font-size: clamp(26px, 4vw, 40px);
  line-height: 1.2; margin: 10px 0 12px; max-width: 900px; }
.u-hero .u-lead { font-size: 17px; color: #475569; max-width: 780px; margin: 0; line-height: 1.65; }
.u-chip { display: inline-block; font-size: 12px; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  color: var(--u-blue); background: rgba(2,116,179,.1); border-radius: 999px; padding: 5px 12px; }
.u-chip.green { color: var(--u-green); background: rgba(31,157,85,.1); }
.u-meta { margin-top: 16px; font-size: 13px; color: var(--u-muted); display: flex; gap: 16px; flex-wrap: wrap; }

/* ---------- article layout ---------- */
.u-layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 32px; padding: 36px 15px 16px; }
@media (max-width: 991px) { .u-layout { grid-template-columns: minmax(0, 1fr); } }
.u-card { background: var(--u-card); border: 1px solid var(--u-line); border-radius: var(--u-radius); box-shadow: var(--u-shadow); }
.kb-article { padding: clamp(20px, 4vw, 44px); min-width: 0; font-size: 16.5px; line-height: 1.8; }
.kb-article h2, .kb-article h3, .kb-article h4 { font-family: var(--u-head); color: var(--u-navy); line-height: 1.3; scroll-margin-top: 110px; }
.kb-article h2 { font-size: 26px; font-weight: 700; margin: 2em 0 .7em; padding-top: .2em; }
.kb-article > h2:first-child, .kb-article > section:first-child > h2:first-child { margin-top: 0; }
.kb-article h3 { font-size: 20px; font-weight: 700; margin: 1.6em 0 .6em; }
.kb-article h4 { font-size: 17px; font-weight: 700; margin: 1.4em 0 .5em; }
.kb-article p, .kb-article li { color: var(--u-ink); }
.kb-article ul, .kb-article ol { padding-left: 1.3em; }
.kb-article li { margin: .3em 0; }
.kb-article img { max-width: 100%; height: auto; border-radius: 12px; }
.kb-article img.header-image, .kb-article > img:first-child { display: block; width: 100%; max-height: 420px;
  object-fit: cover; margin: 0 0 28px; box-shadow: var(--u-shadow); }
.kb-article table { width: 100%; border-collapse: collapse; margin: 1.2em 0; font-size: 15px; display: block; overflow-x: auto; }
.kb-article table th, .kb-article table td { border: 1px solid var(--u-line); padding: 10px 12px; vertical-align: top; }
.kb-article table th, .kb-article table thead td { background: var(--u-soft); color: var(--u-navy); font-weight: 700; }
.kb-article pre { background: #0f1b2d; color: #e2e8f0; border-radius: 12px; padding: 18px 20px; font-size: 14px;
  line-height: 1.6; overflow-x: auto; }
.kb-article code { background: var(--u-soft); color: #9a2c4a; border-radius: 6px; padding: 1px 6px; font-size: .92em; }
.kb-article pre code { background: none; color: inherit; padding: 0; }
.kb-article blockquote { border-left: 4px solid var(--u-blue); background: var(--u-soft); margin: 1.4em 0;
  padding: 14px 18px; border-radius: 0 12px 12px 0; }
.kb-article iframe { max-width: 100%; border: 1px solid var(--u-line); border-radius: 12px; }

/* ---------- sidebar ---------- */
.u-side { display: flex; flex-direction: column; gap: 20px; min-width: 0; }
.u-side .u-sticky { position: sticky; top: 110px; display: flex; flex-direction: column; gap: 20px; }
@media (max-width: 991px) { .u-side .u-sticky { position: static; } }
.u-box { padding: 20px 22px; }
.u-box h5 { font-family: var(--u-head); font-size: 14px; font-weight: 700; text-transform: uppercase; letter-spacing: .06em;
  color: var(--u-navy); margin: 0 0 12px; }
.u-toc ol { list-style: none; padding: 0; margin: 0; counter-reset: toc; }
.u-toc li { counter-increment: toc; margin: 0; }
.u-toc a { display: flex; gap: 10px; padding: 6px 0; font-size: 14px; color: #475569; text-decoration: none; line-height: 1.45; }
.u-toc a::before { content: counter(toc, decimal-leading-zero); color: var(--u-blue); font-weight: 700; font-size: 12px; padding-top: 1px; }
.u-toc a:hover, .u-toc a.on { color: var(--u-blue); }
.u-topics .u-cat { font-size: 12px; font-weight: 700; color: var(--u-muted); text-transform: uppercase; letter-spacing: .05em; margin: 14px 0 4px; }
.u-topics .u-cat:first-of-type { margin-top: 0; }
.u-topics a { display: block; padding: 6px 10px; margin: 0 -10px; border-radius: 8px; font-size: 14px; color: var(--u-ink);
  text-decoration: none; line-height: 1.4; }
.u-topics a:hover { background: var(--u-soft); color: var(--u-blue); }
.u-topics a.on { background: rgba(2,116,179,.1); color: var(--u-blue); font-weight: 600; }

/* ---------- ad slots ---------- */
.ad-slot { display: none; }
.ad-slot.ad-live, .ad-slot.ad-preview { display: block; text-align: center; }
/* Google marks unfilled units with data-ad-status="unfilled": hide the whole slot (label included) */
.ad-slot.ad-live:has(ins.adsbygoogle[data-ad-status="unfilled"]) { display: none; }
.ad-slot .ad-label { font-size: 10px; letter-spacing: .12em; text-transform: uppercase; color: #94a3b8; margin-bottom: 6px; }
.ad-slot.ad-preview .ad-box { border: 2px dashed #cbd5e1; border-radius: 12px; background: repeating-linear-gradient(45deg,
  #f8fafc, #f8fafc 10px, #f1f5f9 10px, #f1f5f9 20px); color: #94a3b8; font-size: 13px; display: flex;
  align-items: center; justify-content: center; }
.ad-slot[data-ad="sidebar"] .ad-box { min-height: 600px; }
@media (max-width: 991px) { .ad-slot[data-ad="sidebar"] .ad-box { min-height: 250px; } }
.ad-slot[data-ad="bottom"] .ad-box { min-height: 120px; }
.kb-article .ad-slot[data-ad="inarticle"] { margin: 28px 0; }
.ad-slot[data-ad="inarticle"] .ad-box { min-height: 180px; }
.ad-slot[data-ad="multiplex"] { margin: 8px 0 36px; }
.ad-slot[data-ad="multiplex"] .ad-box { min-height: 260px; }
.ad-slot[data-ad="sidebar"] { min-width: 0; }
.u-ad-wrap { padding: 8px 15px 0; }

/* ---------- related / cards grid ---------- */
.u-section { padding: 28px 15px 48px; }
.u-section h2.u-title { font-family: var(--u-head); font-weight: 700; color: var(--u-navy); font-size: 24px; margin: 0 0 18px; }
.u-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 22px; }
.u-tile { display: flex; flex-direction: column; overflow: hidden; text-decoration: none !important; color: inherit !important;
  transition: transform .18s ease, box-shadow .18s ease; }
.u-tile:hover { transform: translateY(-3px); box-shadow: 0 2px 4px rgba(15,35,60,.06), 0 16px 32px rgba(15,35,60,.10); }
.u-tile .u-thumb { aspect-ratio: 16 / 8; background: var(--u-soft) center / cover no-repeat; }
.u-tile .u-tbody { padding: 16px 18px 18px; display: flex; flex-direction: column; gap: 8px; flex: 1; }
.u-tile h3 { font-family: var(--u-head); font-size: 17px; font-weight: 700; color: var(--u-navy); line-height: 1.35; margin: 0; }
.u-tile p { font-size: 14px; color: #5b6b7f; line-height: 1.55; margin: 0; display: -webkit-box; -webkit-line-clamp: 3;
  -webkit-box-orient: vertical; overflow: hidden; }
.u-tile .u-more { margin-top: auto; font-size: 14px; font-weight: 700; color: var(--u-blue); }

/* ---------- hub controls ---------- */
.u-controls { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; justify-content: space-between; margin: 28px 0 8px; }
.u-filters { display: flex; flex-wrap: wrap; gap: 8px; }
.u-filters button { border: 1px solid var(--u-line); background: #fff; color: var(--u-ink); border-radius: 999px; padding: 8px 16px;
  font-size: 14px; font-weight: 600; cursor: pointer; transition: all .15s; }
.u-filters button:hover { border-color: var(--u-blue); color: var(--u-blue); }
.u-filters button.on { background: var(--u-blue); border-color: var(--u-blue); color: #fff; }
.u-search { position: relative; flex: 0 1 320px; }
.u-search input { width: 100%; border: 1px solid var(--u-line); border-radius: 999px; padding: 10px 16px 10px 40px; font-size: 14px; background: #fff; }
.u-search input:focus { outline: none; border-color: var(--u-blue); box-shadow: 0 0 0 4px rgba(2,116,179,.12); }
.u-search .fa { position: absolute; left: 15px; top: 50%; transform: translateY(-50%); color: var(--u-muted); }
.u-empty { text-align: center; color: var(--u-muted); padding: 40px 0; display: none; }

/* ---------- tool pages ---------- */
.kb-tool { padding: clamp(18px, 3vw, 32px); min-width: 0; }
.kb-tool > h1:first-child { display: none; }
.kb-tool .header-image { display: none; }

.u-tile .u-chip { align-self: flex-start; }
