/*
Theme Name: ALiSEA Knowledge Hub (demo)
Description: Local training theme modelled on the kh.ali-sea.org datablog layout.
Version: 1.0
*/

:root {
	--kh-text: #303030;
	--kh-body: rgba(48, 48, 48, .75);
	--kh-green: #2d7c3c;
	--kh-lime: #8dc640;
	--kh-blue: #5b9bd5;
	--kh-grey: #f1f2f2;
	--kh-chip: rgba(58, 111, 159, .314);
	--kh-width: 860px;
}

*, *::before, *::after { box-sizing: border-box; }

body {
	margin: 0;
	font-family: "Inter", system-ui, sans-serif;
	font-size: 16px;
	line-height: 1.4;
	color: var(--kh-body);
	background: #fff;
}

a { color: var(--kh-text); }
img { max-width: 100%; height: auto; }

.kh-container { max-width: 1024px; margin: 0 auto; padding: 0 20px; }
.kh-narrow { max-width: var(--kh-width); margin: 0 auto; }

/* Top bar with language flags */
.kh-topbar { background: var(--kh-grey); height: 50px; }
.kh-topbar .kh-container { height: 100%; display: flex; justify-content: flex-end; align-items: center; gap: 12px; }
.kh-demo-label { margin-right: auto; font-size: 13px; font-weight: 600; color: var(--kh-text); }
.kh-demo-label a { color: var(--kh-green); }
.kh-flag { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-size: 22px; line-height: 1; overflow: hidden; text-decoration: none; }

/* Header */
.kh-header { background: #fff; position: sticky; top: 0; z-index: 50; box-shadow: 0 1px 0 rgba(0,0,0,.06); }
.kh-header .kh-container { display: flex; align-items: center; height: 78px; padding-right: 0; }
.kh-logo { display: flex; align-items: baseline; gap: 14px; text-decoration: none; color: var(--kh-blue); }
.kh-logo strong { font-size: 24px; font-weight: 800; letter-spacing: .5px; }
.kh-logo span { font-size: 17px; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; }
.kh-header-right { margin-left: auto; display: flex; align-items: center; height: 100%; }
.kh-menu-toggle { background: none; border: 0; padding: 0 24px; cursor: pointer; color: var(--kh-text); font-size: 22px; height: 100%; }
.kh-side-logo { background: var(--kh-grey); height: 100%; display: flex; align-items: center; padding: 0 22px; gap: 8px; color: var(--kh-green); font-weight: 800; font-size: 15px; }
.kh-side-logo i { color: var(--kh-lime); font-size: 26px; }

.kh-nav { display: none; position: absolute; right: 0; top: 78px; background: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.12); min-width: 240px; }
.kh-nav.is-open { display: block; }
.kh-nav ul { list-style: none; margin: 0; padding: 8px 0; }
.kh-nav a { display: block; padding: 10px 24px; text-decoration: none; font-weight: 500; color: var(--kh-text); }
.kh-nav a:hover, .kh-nav .current a { color: var(--kh-green); background: var(--kh-grey); }

/* Breadcrumb bar */
.kh-breadcrumbs { background: var(--kh-lime); padding: 10px 0; color: #fff; font-size: 14.4px; }
.kh-breadcrumbs a { color: #fff; font-weight: 500; text-decoration: none; }
.kh-breadcrumbs .sep { margin: 0 8px; }

/* Single datablog post */
.kh-single { padding: 96px 20px 64px; }
.kh-single h1 { font-size: 40px; line-height: 48px; font-weight: 700; color: var(--kh-text); margin: 0 0 40px; }
.kh-meta { border-top: 2px dashed #d3d3d3; padding-top: 16px; display: flex; flex-wrap: wrap; gap: 16px; list-style: none; margin: 0 0 32px; padding-left: 0; font-style: italic; }
.kh-meta li { display: flex; align-items: center; gap: 6px; }
.kh-meta i { color: var(--kh-green); font-size: 19px; font-style: normal; }
.kh-content p { margin: 0 0 24px; }
.kh-content strong { color: var(--kh-text); }
.kh-content a { font-weight: 600; }
.kh-content .ays-chart-container-google, .kh-content [class^="ays-chart-container"] { margin: 8px 0 32px; }

.kh-terms { display: flex; flex-wrap: wrap; gap: 8px; margin: 32px 0 48px; }
.kh-chip { background: var(--kh-chip); color: var(--kh-text); font-size: 12px; font-weight: 700; padding: 6px 12px; border-radius: 5px; text-decoration: none; line-height: 22px; }
.kh-chip:hover { background: rgba(58, 111, 159, .45); }

.kh-post-nav { display: flex; justify-content: space-between; gap: 24px; }
.kh-post-nav a { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--kh-text); font-weight: 600; max-width: 48%; }
.kh-post-nav .next { margin-left: auto; flex-direction: row-reverse; text-align: right; }
.kh-post-nav .thumb { width: 60px; height: 60px; flex: 0 0 60px; border: 1px solid rgba(48,48,48,.25); background: var(--kh-grey) center/cover no-repeat; }
.kh-post-nav .arrow { font-size: 20px; padding: 0 4px; }
.kh-post-nav .label { display: block; font-size: 12px; }
.kh-post-nav .title { display: block; font-size: 16px; font-weight: 700; margin: 2px 0 0; }

/* Hero (Datablog page) */
.kh-hero { position: relative; color: #fff; background: linear-gradient(110deg, rgba(45,124,60,.92), rgba(141,198,64,.80)); overflow: hidden; }
.kh-hero::after { content: ""; position: absolute; right: -60px; top: -40px; width: 380px; height: 380px; border-radius: 50%; background: radial-gradient(circle, rgba(255,255,255,.18), rgba(255,255,255,0) 70%); }
.kh-hero .kh-container { position: relative; z-index: 1; padding-top: 72px; padding-bottom: 72px; }
.kh-hero h1 { font-size: 48px; margin: 0 0 24px; color: #fff; }
.kh-hero p { max-width: 560px; margin: 0; font-size: 17px; line-height: 1.55; }

.kh-page { padding: 56px 20px 80px; }
.kh-intro { max-width: 760px; margin: 0 0 32px; }
.kh-intro h2 { color: var(--kh-text); font-size: 24px; margin: 0 0 12px; }

.kh-filters { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 36px; }
.kh-filters input, .kh-filters select { font: inherit; font-size: 15px; color: var(--kh-text); border: 1px solid #d3d3d3; border-radius: 5px; padding: 10px 12px; background: #fff; min-width: 200px; }
.kh-filters input { flex: 1 1 220px; }
.kh-filters button, .kh-filters .reset { font: inherit; font-size: 13px; font-weight: 700; letter-spacing: .5px; border: 0; border-radius: 5px; padding: 11px 18px; cursor: pointer; text-decoration: none; }
.kh-filters button { background: var(--kh-green); color: #fff; }
.kh-filters .reset { background: var(--kh-grey); color: var(--kh-text); }

.kh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 28px; }
.kh-tile { display: flex; flex-direction: column; text-decoration: none; color: var(--kh-text); background: #fff; border-radius: 6px; overflow: hidden; box-shadow: 0 2px 10px rgba(0,0,0,.08); transition: transform .15s, box-shadow .15s; }
.kh-tile:hover { transform: translateY(-3px); box-shadow: 0 8px 22px rgba(0,0,0,.14); }
.kh-tile .img { aspect-ratio: 1 / 1; background: var(--kh-grey) center/cover no-repeat; display: flex; align-items: center; justify-content: center; color: #9aa; font-size: 13px; }
.kh-tile .img i { font-size: 48px; color: var(--kh-lime); }
.kh-tile h3 { font-size: 16px; line-height: 1.35; margin: 0; padding: 16px; font-weight: 700; }
.kh-empty { color: var(--kh-body); }

/* Generic pages */
.kh-page-title { font-size: 40px; color: var(--kh-text); margin: 0 0 24px; }

/* Footer */
.kh-footer { background: var(--kh-green); color: #fff; }
.kh-footer .kh-container { padding-top: 56px; padding-bottom: 56px; }
.kh-footer h2 { font-size: 40px; line-height: 1.1; margin: 0 0 16px; max-width: 240px; color: #fff; }
.kh-footer p { max-width: 420px; margin: 0; }
.kh-copyright { background: var(--kh-green); border-top: 1px solid rgba(255,255,255,.2); text-align: center; font-size: 14.4px; padding: 14px 20px; color: #fff; }

@media (max-width: 700px) {
	.kh-single { padding-top: 48px; }
	.kh-single h1 { font-size: 30px; line-height: 38px; }
	.kh-logo span { display: none; }
	.kh-demo-label { font-size: 11px; }
	.kh-flag { display: none; }
	.kh-side-logo { padding: 0 14px; }
	.kh-hero h1 { font-size: 36px; }
	.kh-post-nav { flex-direction: column; }
	.kh-post-nav a { max-width: 100%; }
	.kh-filters select { flex: 1 1 100%; }
}
