/* =====================================================================
   GisEducation · ЖҚЗ және ГАЖ терминологиялық сөздігі
   Дизайн ap23487595.gis-education.kz (Stories темасы) негізінде:
   ақ фон, логотип + «ЖОБАЛАР ТІЗІМІ» батырмасы, иконкалы мәзір,
   10px дөңгеленген карточкалар, түрлі түсті санат атаулары.
   ===================================================================== */

/* Макет: 1200px контейнер · 3 бағанды карточкалар торы · термин бетінде 8/4 баған (контент + сайдбар) */
:root {
  --bg: #ffffff;
  --bg-grey: #f7f8f9;
  --card: #ffffff;
  --text: #333a44;
  --heading: #111418;
  --muted: #687385;
  --line: #eaecee;
  --primary: #2f6af0;
  --primary-hover: #1f55d4;
  --on-primary: #ffffff;
  --code-bg: #f3f5f8;
  --shadow: 0 10px 22px rgba(15, 30, 60, .07);
  --shadow-hover: 0 18px 50px rgba(15, 30, 60, .16);
  --focus: #2f6af0;
  /* санат түстері (Stories темасының түстері) */
  --c-fiz: #e38836;
  --c-sen: #2f6af0;
  --c-img: #09815c;
  --c-gis: #7a4fd6;
  --c-ras: #a0652b;
  --c-map: #d63c5e;
  --c-fmt: #0f8ea1;
  --c-msn: #4d5bd1;
  --font: "Roboto", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  --mono: "JetBrains Mono", "SFMono-Regular", Consolas, monospace;
  --container: 1200px;
  color-scheme: light;
}
/* Әдепкі — жарық тақырып. Қараңғы тақырып тек тақырып батырмасымен қосылады (html.theme-dark). */
html.theme-dark {
  --bg: #0f141b; --bg-grey: #141b24; --card: #161e28; --text: #c9d2dd; --heading: #f2f5f8;
  --muted: #8e9bab; --line: #243040; --primary: #6c97ff; --primary-hover: #8eb0ff; --on-primary: #0b1220;
  --code-bg: #1c2633; --shadow: 0 10px 22px rgba(0, 0, 0, .35); --shadow-hover: 0 18px 50px rgba(0, 0, 0, .55); --focus: #8eb0ff;
  --c-fiz: #f0a25a; --c-sen: #6c97ff; --c-img: #3cc28f; --c-gis: #a687ee; --c-ras: #d39a5d; --c-map: #f0708b; --c-fmt: #3fbfd0; --c-msn: #8d98f2;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 400 16px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 60; background: var(--bg); }
a { color: inherit; text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }
h1, h2, h3, h4, h5 { color: var(--heading); margin: 0; line-height: 1.25; text-wrap: balance; }
p { margin: 0; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 2px; border-radius: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

.container {
  width: 100%; max-width: calc(var(--container) + 2 * 16px); margin: 0 auto;
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
}

/* ---------------- HEADER ---------------- */
.header-top { border-bottom: 1px solid var(--line); }
.header-top .container { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-block: 22px; }
.logo { display: flex; align-items: center; gap: 12px; min-width: 0; }
.logo img { height: 56px; width: auto; }
html.theme-dark .logo img { filter: invert(1) hue-rotate(180deg) saturate(1.4); }
.logo-sub { border-left: 1px solid var(--line); padding-left: 12px; font-size: 12px; line-height: 1.35; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; font-weight: 500; }
.logo-sub b { display: block; color: var(--heading); font-size: 13px; letter-spacing: .4px; }
.header-right { display: flex; align-items: center; gap: 22px; }
.nav-topbar { display: flex; gap: 20px; list-style: none; margin: 0; padding: 0; font-size: 13px; color: var(--muted); font-weight: 500; }
.nav-topbar a.active { color: var(--primary); }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border: 0; border-radius: 4px; cursor: pointer; font-weight: 700; font-size: 14px;
  padding: 12px 20px; line-height: 1; text-transform: uppercase; letter-spacing: .3px;
  transition: background .2s, color .2s, box-shadow .2s;
}
.btn-primary { background: var(--primary); color: var(--on-primary); box-shadow: 0 6px 16px rgba(47, 106, 240, .25); }
.btn-primary:hover { background: var(--primary-hover); color: var(--on-primary); }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--heading); text-transform: none; font-weight: 500; padding: 10px 14px; }
.btn-ghost:hover { border-color: var(--primary); color: var(--primary); }
.icon-btn { display: inline-flex; color: var(--heading); width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); cursor: pointer; align-items: center; justify-content: center; }

.header-nav { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50; background: var(--bg); border-bottom: 1px solid var(--line); }
.main-menu { display: flex; flex-wrap: wrap; gap: 4px 40px; list-style: none; margin: 0; padding: 18px 0; }
.main-menu a { display: inline-flex; align-items: center; gap: 9px; font-size: 15px; font-weight: 500; color: var(--text); padding: 6px 0; white-space: nowrap; }
.main-menu a svg { width: 17px; height: 17px; flex: none; color: var(--muted); }
.main-menu a:hover, .main-menu a:hover svg { color: var(--primary); }
.main-menu a.active { color: var(--primary); }
.main-menu a.active svg { color: var(--primary); }
.main-menu .count { font-size: 11px; color: var(--muted); font-weight: 400; }

/* ---------------- TOOLBAR (іздеу + әліпби) ---------------- */
.toolbar { padding-top: 44px; }
.toolbar-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 24px; flex-wrap: wrap; }
.page-heading .eyebrow { font-size: 12px; text-transform: uppercase; letter-spacing: 1.2px; color: var(--muted); font-weight: 700; }
.page-heading h1 { font-size: 30px; font-weight: 900; margin-top: 6px; }
.page-heading p { color: var(--muted); margin-top: 6px; font-size: 15px; }
.search { position: relative; flex: 1 1 380px; max-width: 520px; }
.search input {
  width: 100%; height: 50px; border: 1px solid var(--line); border-radius: 6px; background: var(--card);
  padding: 0 46px 0 46px; font: 400 15px var(--font); color: var(--heading);
  box-shadow: var(--shadow);
}
.search input::placeholder { color: var(--muted); }
.search input:focus { outline: none; border-color: var(--primary); }
.search > svg { position: absolute; left: 16px; top: 50%; width: 18px; height: 18px; transform: translateY(-50%); color: var(--muted); pointer-events: none; }
.search .clear { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); width: 34px; height: 34px; border: 0; background: none; cursor: pointer; color: var(--muted); border-radius: 4px; }
.search .clear:hover { color: var(--primary); }
.search-hint { font-size: 12px; color: var(--muted); margin-top: 6px; }

.alphabet { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 26px; padding-bottom: 6px; }
.alphabet button {
  min-width: 34px; height: 34px; padding: 0 8px; border: 1px solid var(--line); border-radius: 4px; background: var(--card);
  font-weight: 700; font-size: 14px; cursor: pointer; color: var(--heading);
}
.alphabet button:hover { border-color: var(--primary); color: var(--primary); }
.alphabet button.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.alphabet button.all { font-weight: 500; text-transform: none; padding: 0 12px; }
.result-info { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 22px; font-size: 13px; color: var(--muted); flex-wrap: wrap; }
.result-info b { color: var(--heading); }

/* ---------------- CARDS (post-card-1) ---------------- */
.grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 40px 30px; margin-top: 28px; }
.post-card {
  position: relative; display: flex; flex-direction: column; background: var(--card);
  border: 1px solid var(--line); border-radius: 10px;
  transition: transform .25s cubic-bezier(.02, .01, .47, 1), box-shadow .25s cubic-bezier(.02, .01, .47, 1);
  box-shadow: var(--shadow);
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-hover); }
.post-thumb { position: relative; aspect-ratio: 16 / 10; border-radius: 10px 10px 0 0; overflow: hidden; background: #0c1a2b; }
.post-thumb > a { position: absolute; inset: 0; z-index: 1; }
.post-thumb .ill { width: 100%; height: 100%; display: block; }
.post-thumb::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to bottom, transparent 55%, rgba(0, 0, 0, .55)); pointer-events: none; }
.thumb-badges { position: absolute; left: 16px; bottom: 14px; z-index: 2; display: flex; gap: 6px; pointer-events: none; }
.badge { display: inline-flex; align-items: center; gap: 5px; font-size: 11px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; padding: 4px 8px; border-radius: 3px; background: rgba(255, 255, 255, .92); color: #0c1a2b; }
.badge svg { width: 12px; height: 12px; }
.badge.num { background: rgba(12, 26, 43, .75); color: #fff; font-family: var(--mono); font-weight: 400; letter-spacing: 0; }
.social-share { position: absolute; right: 14px; bottom: 12px; z-index: 3; display: flex; gap: 6px; opacity: 0; transform: translateY(6px); transition: .2s; }
.post-card:hover .social-share, .post-card:focus-within .social-share { opacity: 1; transform: none; }
.social-share a, .social-share button {
  width: 28px; height: 28px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: #2f6af0; color: #fff; border: 0; cursor: pointer;
}
.social-share svg { width: 14px; height: 14px; }
.social-share .tg { background: #229ed9; }
.social-share .wa { background: #25d366; }
.post-content { padding: 32px 34px 30px; display: flex; flex-direction: column; flex: 1; min-width: 0; }
.post-cat { font-size: 15px; font-weight: 700; display: inline-flex; align-items: center; gap: 8px; align-self: flex-start; }
.post-cat::after { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--muted); }
.post-title { font-size: 21px; font-weight: 700; margin-top: 14px; line-height: 1.3; overflow-wrap: anywhere; }
.post-title a:hover { color: var(--primary); }
.langs { margin-top: 12px; display: grid; gap: 4px; font-size: 14px; line-height: 1.45; }
.langs div { display: grid; grid-template-columns: 40px 1fr; gap: 6px; min-width: 0; }
.langs abbr { text-decoration: none; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; color: var(--muted); padding-top: 2px; }
.langs span { color: var(--heading); overflow-wrap: anywhere; }
.excerpt { margin-top: 16px; color: var(--muted); font-size: 15.5px; line-height: 1.85; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.entry-meta { margin-top: auto; padding-top: 22px; display: flex; flex-wrap: wrap; gap: 6px 16px; font-size: 11.5px; text-transform: uppercase; letter-spacing: .5px; color: var(--muted); }
.entry-meta span { position: relative; padding-left: 10px; }
.entry-meta span::before { content: ""; position: absolute; left: 0; top: 50%; width: 3px; height: 3px; margin-top: -1.5px; border-radius: 50%; background: var(--muted); }
mark { background: rgba(255, 209, 102, .55); color: inherit; border-radius: 2px; padding: 0 1px; }

.empty { text-align: center; padding: 70px 16px; color: var(--muted); grid-column: 1 / -1; }
.empty h3 { font-size: 22px; margin-bottom: 8px; }

/* пагинация (Stories: дөңгелек батырмалар) */
.pagination { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px; margin: 56px 0 10px; list-style: none; padding: 0; }
.pagination button {
  min-width: 42px; height: 42px; padding: 0 6px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; font-weight: 500; font-variant-numeric: tabular-nums;
}
.pagination button:hover:not([disabled]) { border-color: var(--primary); color: var(--primary); }
.pagination button.active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }
.pagination button[disabled] { opacity: .4; cursor: default; }
.pagination .gap { align-self: center; color: var(--muted); padding: 0 4px; }

/* ---------------- SINGLE (термин беті) ---------------- */
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 13px; color: var(--muted); padding-top: 34px; }
.breadcrumb a:hover { color: var(--primary); }
.breadcrumb svg { width: 12px; height: 12px; }
.single-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 50px; margin-top: 22px; align-items: start; }
.entry-header .post-cat { font-size: 15px; }
.entry-header h1 { font-size: 40px; font-weight: 900; margin-top: 12px; letter-spacing: -.3px; overflow-wrap: anywhere; }
.entry-header .entry-meta { margin-top: 14px; padding-top: 0; }

.media-box { margin-top: 28px; border-radius: 10px; overflow: hidden; background: #0c1a2b; box-shadow: var(--shadow); }
.media-tabs { display: flex; gap: 2px; background: #091422; padding: 6px; flex-wrap: wrap; }
.media-tabs button {
  border: 0; background: transparent; color: #9fb3c8; padding: 9px 14px; border-radius: 6px; cursor: pointer;
  font-size: 13px; font-weight: 500; display: inline-flex; align-items: center; gap: 7px;
}
.media-tabs button svg { width: 15px; height: 15px; }
.media-tabs button:hover { color: #fff; }
.media-tabs button.active { background: #1a3150; color: #fff; }
.media-stage { position: relative; aspect-ratio: 16 / 10; width: 100%; }
.media-stage > .ill, .media-stage > img, .media-stage > video, .media-stage > model-viewer, .media-stage > .m3d { position: absolute; inset: 0; width: 100%; height: 100%; }
.media-stage > img, .media-stage > video { object-fit: contain; background: #0c1a2b; }
.media-stage .m3d { cursor: grab; touch-action: none; }
.media-stage .m3d:active { cursor: grabbing; }
.media-stage .m3d canvas { display: block; width: 100% !important; height: 100% !important; }
.m3d-error, .m3d-loading { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; text-align: center; padding: 20px; color: #9fb3c8; font-size: 14px; }
.media-caption { display: flex; justify-content: space-between; align-items: center; gap: 12px; padding: 10px 14px; font-size: 12.5px; color: #9fb3c8; background: #091422; flex-wrap: wrap; }
.media-caption button { background: none; border: 1px solid #284466; color: #cfe0f3; border-radius: 4px; padding: 5px 10px; cursor: pointer; font-size: 12px; }
.media-caption button:hover { border-color: #7fd4ff; }

.term-langs { margin-top: 30px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; }
.term-langs .row { display: grid; grid-template-columns: 120px minmax(0, 1fr) auto; align-items: center; gap: 12px; padding: 14px 18px; border-top: 1px solid var(--line); }
.term-langs .row:first-child { border-top: 0; }
.term-langs .lang { font-size: 11.5px; font-weight: 700; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.term-langs .val { font-size: 17px; color: var(--heading); font-weight: 500; overflow-wrap: anywhere; }
.copy { border: 1px solid var(--line); background: var(--card); border-radius: 4px; width: 34px; height: 34px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; color: var(--muted); }
.copy:hover { color: var(--primary); border-color: var(--primary); }
.copy svg { width: 15px; height: 15px; }

.entry-content { margin-top: 36px; display: grid; gap: 34px; }
.entry-content h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; color: var(--heading); padding-bottom: 10px; border-bottom: 1px solid var(--line); position: relative; margin-bottom: 16px; }
.entry-content h2::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 50px; height: 3px; background: var(--heading); }
.entry-content .lead { font-size: 19px; line-height: 1.75; color: var(--heading); max-width: 70ch; }
.entry-content .note { font-size: 16.5px; line-height: 1.9; max-width: 72ch; }
.cite { display: inline-block; font-size: 12px; font-weight: 700; color: var(--primary); background: color-mix(in srgb, var(--primary) 10%, transparent); padding: 0 5px; border-radius: 3px; vertical-align: 1px; cursor: pointer; border: 0; font-family: var(--font); line-height: 1.7; }
.cite:hover { background: var(--primary); color: var(--on-primary); }
.ref-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; counter-reset: none; }
.ref-list li { display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 10px; font-size: 14.5px; line-height: 1.6; padding: 12px 14px; border: 1px solid var(--line); border-radius: 8px; background: var(--card); }
.ref-list li.flash { border-color: var(--primary); box-shadow: 0 0 0 3px color-mix(in srgb, var(--primary) 20%, transparent); }
.ref-list .n { font-family: var(--mono); font-size: 13px; color: var(--primary); font-weight: 700; }
.ref-list a { color: var(--primary); overflow-wrap: anywhere; }
.ref-list a:hover { text-decoration: underline; }

.share-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding-top: 6px; }
.share-row .label { font-size: 12px; font-weight: 700; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); margin-right: 4px; }
.share-row a, .share-row button { display: inline-flex; align-items: center; gap: 7px; padding: 8px 14px; border-radius: 4px; border: 1px solid var(--line); background: var(--card); cursor: pointer; font-size: 13px; font-weight: 500; }
.share-row a:hover, .share-row button:hover { border-color: var(--primary); color: var(--primary); }
.share-row svg { width: 15px; height: 15px; }

.prev-next { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 8px; }
.prev-next a { display: block; padding: 18px 20px; border: 1px solid var(--line); border-radius: 10px; background: var(--card); min-width: 0; }
.prev-next a:hover { border-color: var(--primary); }
.prev-next small { display: block; font-size: 11px; text-transform: uppercase; letter-spacing: 1px; color: var(--muted); font-weight: 700; }
.prev-next b { display: block; margin-top: 6px; font-size: 16px; color: var(--heading); line-height: 1.35; overflow-wrap: anywhere; }
.prev-next .next { text-align: right; }

.related { margin-top: 70px; }
.section-title { font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; color: var(--heading); padding-bottom: 10px; border-bottom: 1px solid var(--line); position: relative; }
.section-title::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 50px; height: 3px; background: var(--heading); }

/* сайдбар виджеттері */
.sidebar { position: sticky; top: calc(env(safe-area-inset-top, 0px) + 90px); display: grid; gap: 38px; }
.widget h5 { font-size: 12px; text-transform: uppercase; letter-spacing: 1px; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--line); position: relative; margin-bottom: 14px; }
.widget h5::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 50px; height: 3px; background: var(--heading); }
.widget ul { list-style: none; margin: 0; padding: 0; }
.widget-cats li a { display: flex; justify-content: space-between; gap: 10px; padding: 9px 0; border-bottom: 1px dotted var(--line); font-size: 14.5px; }
.widget-cats li a .dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 10px; vertical-align: 1px; }
.widget-cats li a em { font-style: normal; color: var(--muted); font-size: 13px; font-variant-numeric: tabular-nums; }
.widget-cats li a.active { color: var(--primary); font-weight: 700; }
.mini-list li a { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 12px; align-items: center; padding: 8px 0; }
.mini-list .thumb { width: 64px; height: 48px; border-radius: 6px; overflow: hidden; background: #0c1a2b; }
.mini-list .thumb .ill { width: 100%; height: 100%; }
.mini-list b { font-size: 14px; color: var(--heading); font-weight: 500; line-height: 1.35; display: block; }
.mini-list small { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .5px; }
.mini-list a:hover b { color: var(--primary); }
.widget-abbr dl { display: grid; grid-template-columns: auto 1fr; gap: 6px 12px; margin: 0; font-size: 13.5px; }
.widget-abbr dt { font-weight: 700; color: var(--heading); }
.widget-abbr dd { margin: 0; color: var(--muted); }

/* ---------------- PAGES (туралы, дереккөздер, көрсеткіштер) ---------------- */
.page { padding-top: 10px; }
.page .entry-header h1 { font-size: 36px; }
.prose { max-width: 75ch; font-size: 16.5px; line-height: 1.9; display: grid; gap: 18px; }
.prose h2 { font-size: 13px; text-transform: uppercase; letter-spacing: 1.2px; font-weight: 700; padding-bottom: 10px; border-bottom: 1px solid var(--line); position: relative; margin-top: 18px; }
.prose h2::after { content: ""; position: absolute; left: 0; bottom: -1px; width: 50px; height: 3px; background: var(--heading); }
.prose ul { margin: 0; padding-left: 20px; display: grid; gap: 8px; }
.facts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin: 6px 0 4px; }
.facts div { border: 1px solid var(--line); border-radius: 10px; padding: 16px 18px; background: var(--card); }
.facts b { display: block; font-size: 28px; font-weight: 900; color: var(--heading); font-variant-numeric: tabular-nums; line-height: 1.1; }
.facts span { font-size: 12.5px; color: var(--muted); }
.abbr-table { width: 100%; border-collapse: collapse; font-size: 15px; }
.abbr-table td { padding: 9px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.abbr-table td:first-child { font-weight: 700; color: var(--heading); white-space: nowrap; width: 1%; }
.table-wrap { overflow-x: auto; }

.index-letters { display: flex; flex-wrap: wrap; gap: 6px; margin: 22px 0 8px; position: sticky; top: calc(env(safe-area-inset-top, 0px) + 66px); background: var(--bg); padding: 10px 0; z-index: 5; }
.index-letters a { min-width: 32px; height: 32px; display: inline-flex; align-items: center; justify-content: center; border: 1px solid var(--line); border-radius: 4px; font-weight: 700; font-size: 13px; }
.index-letters a:hover { border-color: var(--primary); color: var(--primary); }
.index-group { margin-top: 30px; scroll-margin-top: 140px; }
.index-group h3 { font-size: 26px; font-weight: 900; color: var(--primary); margin-bottom: 8px; }
.index-list { columns: 2; column-gap: 40px; list-style: none; margin: 0; padding: 0; }
.index-list li { break-inside: avoid; }
.index-list a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px; padding: 8px 0; border-bottom: 1px dotted var(--line); font-size: 15px; }
.index-list a small { display: block; color: var(--muted); font-size: 12.5px; }
.index-list a em { font-style: normal; font-family: var(--mono); color: var(--muted); font-size: 12.5px; align-self: center; }
.index-list a:hover em { color: var(--primary); }

.refs-full { counter-reset: none; }

/* ---------------- FOOTER ---------------- */
footer.site-footer { background: var(--bg-grey); margin-top: 90px; padding-top: 56px; }
.footer-cols { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 40px; }
.footer-cols p { font-size: 14.5px; color: var(--muted); line-height: 1.8; }
.footer-cols p strong { color: var(--heading); display: block; }
.footer-cols ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; font-size: 14.5px; }
.tagcloud { display: flex; flex-wrap: wrap; gap: 8px; }
.tagcloud a { font-size: 13px; padding: 5px 11px; border: 1px solid var(--line); border-radius: 4px; background: var(--card); }
.tagcloud a:hover { border-color: var(--primary); }
.footer-copy { margin-top: 36px; border-top: 1px solid var(--line); padding-block: 22px; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-size: 13px; color: var(--muted); }
.project-code { font-weight: 900; font-size: 18px; color: var(--heading); letter-spacing: .3px; }

/* қалқымалы хабар және дереккөз терезесі */
.toast { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%) translateY(20px); background: #111418; color: #fff; padding: 11px 18px; border-radius: 6px; font-size: 14px; opacity: 0; pointer-events: none; transition: .25s; z-index: 100; max-width: calc(100% - 32px); }
.toast.show { opacity: 1; transform: translateX(-50%); }
.ref-pop { position: absolute; z-index: 80; max-width: min(420px, calc(100vw - 32px)); background: var(--card); border: 1px solid var(--line); border-radius: 8px; box-shadow: var(--shadow-hover); padding: 14px 16px; font-size: 13.5px; line-height: 1.6; }
.ref-pop .n { font-family: var(--mono); color: var(--primary); font-weight: 700; margin-right: 6px; }
.ref-pop a { color: var(--primary); overflow-wrap: anywhere; }
.to-top { position: fixed; right: max(18px, calc(env(safe-area-inset-right, 0px) + 18px)); bottom: calc(18px + env(safe-area-inset-bottom, 0px)); width: 44px; height: 44px; border-radius: 50%; border: 0; background: var(--primary); color: var(--on-primary); cursor: pointer; display: flex; align-items: center; justify-content: center; box-shadow: var(--shadow-hover); opacity: 0; pointer-events: none; transition: .2s; z-index: 40; }
.to-top.show { opacity: 1; pointer-events: auto; }
.to-top svg { width: 18px; height: 18px; }

/* ---------------- RESPONSIVE ---------------- */
@media (max-width: 1100px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .single-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .facts { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 860px) {
  .nav-topbar { display: none; }
  .logo-sub { display: none; }
  .icon-btn { display: inline-flex; }
  .header-nav .main-menu { display: none; flex-direction: column; gap: 0; padding: 6px 0 14px; }
  .header-nav.open .main-menu { display: flex; }
  .header-nav .main-menu a { padding: 10px 0; width: 100%; border-bottom: 1px solid var(--line); }
  .header-nav .main-menu li:last-child a { border-bottom: 0; }
  .menu-bar { display: flex !important; }
  .footer-cols { grid-template-columns: 1fr; gap: 30px; }
  .index-list { columns: 1; }
}
@media (max-width: 640px) {
  body { font-size: 15px; }
  .logo img { height: 42px; }
  .header-top .container { padding-block: 14px; }
  .btn-projects { padding: 10px 12px; font-size: 12px; }
  .grid { grid-template-columns: minmax(0, 1fr); gap: 26px; }
  .post-content { padding: 24px 22px 22px; }
  .post-title { font-size: 20px; }
  .page-heading h1 { font-size: 24px; }
  .entry-header h1, .page .entry-header h1 { font-size: 28px; }
  .term-langs .row { grid-template-columns: 1fr auto; }
  .term-langs .lang { grid-column: 1 / -1; }
  .prev-next { grid-template-columns: 1fr; }
  .sidebar { grid-template-columns: minmax(0, 1fr); }
  .media-stage { aspect-ratio: 4 / 3; }
  .social-share { opacity: 1; transform: none; }
  .entry-content .lead { font-size: 17px; }
}
.menu-bar { display: none; align-items: center; justify-content: space-between; padding: 12px 0; font-weight: 700; font-size: 14px; text-transform: uppercase; letter-spacing: .6px; cursor: pointer; width: 100%; background: none; border: 0; color: var(--heading); }
.menu-bar svg { width: 20px; height: 20px; }

/* =====================================================================
   Иллюстрация анимациялары (SVG ішінде). Карточкаларда тек hover кезінде
   ойнайды, термин бетінде үнемі ойнайды.
   ===================================================================== */
.ill .travel { offset-rotate: 0deg; animation: ill-travel var(--t, 2.4s) linear infinite; animation-delay: var(--d, 0s); }
.ill .dash-flow { stroke-dasharray: 6 5; animation: ill-dash 1.2s linear infinite; }
.ill .pulse { animation: ill-pulse 1.8s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .pulse-fill { animation: ill-pulse 2.4s ease-in-out infinite; }
.ill .blink { animation: ill-blink 1.4s steps(2, jump-none) infinite; animation-delay: var(--d, 0s); }
.ill .fade-cycle { animation: ill-cycle 3.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .bob { transform-box: fill-box; transform-origin: center; animation: ill-bob 3s ease-in-out infinite; }
.ill .spin-slow { transform-box: view-box; animation: ill-spin 14s linear infinite; }
.ill .swing { transform-box: view-box; animation: ill-swing 2.4s ease-in-out infinite alternate; }
.ill .sun-arc { transform-box: view-box; animation: ill-sunarc 6s ease-in-out infinite alternate; }
.ill .slide-y { animation: ill-slide-y 6s linear infinite; }
.ill .slide-x { animation: ill-slide-x 6s ease-in-out infinite alternate; }
.ill .fly { animation: ill-fly 7s linear infinite; }
.ill .hover { transform-box: fill-box; animation: ill-bob 2s ease-in-out infinite; }
.ill .drift { transform-box: fill-box; animation: ill-drift 4s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.ill .drift-x { animation: ill-drift-x 8s ease-in-out infinite alternate; }
.ill .wipe { animation: ill-wipe 4s ease-in-out infinite; }
.ill .sweep { animation: ill-sweep 4s ease-in-out infinite; }
.ill .ring { transform-box: fill-box; transform-origin: center; animation: ill-ring 1.8s ease-out infinite; animation-delay: var(--d, 0s); opacity: 0; }
.ill .sonar { transform-box: fill-box; transform-origin: 50% 0; animation: ill-sonar 2s ease-out infinite; animation-delay: var(--d, 0s); opacity: 0; }
.ill .draw { stroke-dasharray: 1; animation: ill-draw 3.5s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .pop { transform-box: fill-box; transform-origin: center; animation: ill-pop 3.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .grow-in { animation: ill-growin 5s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .stack { transform-box: fill-box; animation: ill-stack 3.6s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .reorder { transform-box: fill-box; animation: ill-stack 2.4s ease-in-out infinite alternate; animation-delay: var(--d, 0s); }
.ill .settle { animation: ill-settle 4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .breathe { transform-box: fill-box; transform-origin: center; animation: ill-breathe 3s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .shake { transform-box: fill-box; animation: ill-shake .6s ease-in-out infinite alternate; }
.ill .drop { transform-box: fill-box; transform-origin: 50% 100%; animation: ill-drop 2.4s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .type-in { animation: ill-typein 4s steps(1) infinite; animation-delay: var(--d, 0s); }
.ill .bar-up { transform-box: fill-box; transform-origin: 50% 100%; animation: ill-barup 3s ease-out infinite; animation-delay: var(--d, 0s); }
.ill .buf-width { animation: ill-bufw 3s ease-in-out infinite alternate; }
.ill .buf-grow { transform-box: fill-box; transform-origin: center; animation: ill-breathe 2.4s ease-in-out infinite; }
.ill .fade-out { animation: ill-cycle 3.6s ease-in-out infinite reverse; }
.ill .measure { animation: ill-measure 3s ease-in-out infinite; }
.ill .flip { animation: ill-settle 5s ease-in-out infinite; animation-delay: var(--d, 0s); }
.ill .wobble { transform-box: fill-box; transform-origin: 0 50%; animation: ill-shake 1s ease-in-out infinite alternate; }
.ill .build { animation: ill-wipe 4s linear infinite; }
.ill .draw-axes { animation: ill-cycle 3.6s ease-in-out infinite; }

@keyframes ill-travel { from { offset-distance: 0%; } to { offset-distance: 100%; } }
@keyframes ill-dash { to { stroke-dashoffset: -22; } }
@keyframes ill-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
@keyframes ill-blink { 0% { opacity: 1; } 100% { opacity: .2; } }
@keyframes ill-cycle { 0%, 8% { opacity: 0; } 25%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ill-bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-4px); } }
@keyframes ill-spin { to { transform: rotate(360deg); } }
@keyframes ill-swing { from { transform: rotate(-22deg); } to { transform: rotate(22deg); } }
@keyframes ill-sunarc { from { transform: rotate(-12deg); } to { transform: rotate(-70deg); } }
@keyframes ill-slide-y { from { transform: translateY(0); } to { transform: translateY(200px); } }
@keyframes ill-slide-x { from { transform: translateX(0); } to { transform: translateX(90px); } }
@keyframes ill-fly { from { transform: translateX(-80px); } to { transform: translateX(380px); } }
@keyframes ill-drift { from { transform: translate(0, 0); } to { transform: translate(6px, -3px); } }
@keyframes ill-drift-x { from { transform: translateX(-10px); } to { transform: translateX(14px); } }
@keyframes ill-wipe { 0% { clip-path: inset(0 100% 0 0); } 45%, 85% { clip-path: inset(0 0 0 0); } 100% { clip-path: inset(0 0 0 0); opacity: 0; } }
@keyframes ill-sweep { 0% { transform: translateX(0); opacity: 1; } 45% { transform: translateX(var(--dx, 115px)); opacity: 1; } 50%, 100% { transform: translateX(var(--dx, 115px)); opacity: 0; } }
@keyframes ill-ring { 0% { transform: scale(.3); opacity: .9; } 100% { transform: scale(2.4); opacity: 0; } }
@keyframes ill-sonar { 0% { transform: scale(.4); opacity: .9; } 100% { transform: scale(2.6); opacity: 0; } }
@keyframes ill-draw { 0% { stroke-dashoffset: 1; } 55%, 85% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: 0; opacity: 0; } }
@keyframes ill-pop { 0%, 6% { transform: scale(0); } 18%, 85% { transform: scale(1); } 100% { transform: scale(0); } }
@keyframes ill-growin { 0%, 4% { opacity: 0; } 14%, 80% { opacity: 1; } 100% { opacity: 0; } }
@keyframes ill-stack { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ill-settle { 0% { transform: translate(-8px, -8px); opacity: 0; } 25%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
@keyframes ill-breathe { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.06); } }
@keyframes ill-shake { from { transform: translateX(-10px); } to { transform: translateX(10px); } }
@keyframes ill-drop { 0% { transform: translateY(-14px); opacity: 0; } 25%, 85% { transform: none; opacity: 1; } 100% { opacity: 0; } }
@keyframes ill-typein { 0% { opacity: 0; } 8%, 100% { opacity: 1; } }
@keyframes ill-barup { 0% { transform: scaleY(0); } 40%, 100% { transform: scaleY(1); } }
@keyframes ill-bufw { from { stroke-width: 22px; } to { stroke-width: 60px; } }
@keyframes ill-measure { 0% { width: 0; } 70%, 100% { width: 200px; } }

/* карточкада: анимация тек hover/фокус кезінде */
.post-card:not(:hover):not(:focus-within) .ill *, .mini-list .ill * { animation: none !important; }
@media (hover: none) { .post-card .ill * { animation: none !important; } }
@media (prefers-reduced-motion: reduce) { .ill * { animation: none !important; } }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }

/* тақырып ауыстырғыш және PDF батырмасы */
.icon-btn svg { width: 19px; height: 19px; }
.icon-btn:hover { border-color: var(--primary); color: var(--primary); }
.theme-toggle .moon { display: block; } .theme-toggle .sun { display: none; }
html.theme-dark .theme-toggle .moon { display: none; } html.theme-dark .theme-toggle .sun { display: block; }
.btn-pdf { background: var(--card); color: var(--heading); border: 1px solid var(--line); }
.btn-pdf:hover { border-color: var(--primary); color: var(--primary); }
.btn-pdf svg { width: 16px; height: 16px; flex: none; }
.btn-pdf small { font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }
.btn-pdf[aria-busy="true"] { opacity: .6; pointer-events: none; }
.download-card { display: flex; align-items: center; justify-content: space-between; gap: 18px; flex-wrap: wrap; padding: 20px 22px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg-grey); }
.download-card b { display: block; color: var(--heading); font-size: 16px; }
.download-card span { font-size: 13.5px; color: var(--muted); }
@media (max-width: 1180px) { .nav-topbar { display: none; } }
.nav-topbar a, .btn { white-space: nowrap; }
@media (max-width: 640px) {
  .header-right { gap: 8px; }
  .btn-pdf .lbl, .btn-pdf small { display: none; }
  .btn-pdf { padding: 10px 11px; }
}
