/*
Theme Name: Kurdia Xak
Theme URI: https://kurdia.net
Author: Kurdia
Author URI: https://kurdia.net
Description: خاکی کوردیا — A bilingual (Kurdish/Persian) magazine theme for Kurdia network. RTL-first design with subject browsing, search, filtering, and institutional navigation.
Version: 1.0.0
Requires at least: 6.0
Tested up to: 6.7
Requires PHP: 8.0
License: GNU General Public License v2 or later
License URI: https://www.gnu.org/licenses/gpl-2.0.html
Text Domain: kurdia-xak
Tags: rtl, right-to-left, blog, news, magazine, custom-menu, featured-images, translation-ready
*/

:root {
  --k-bg: oklch(0.98 0.005 60);
  --k-bg-white: oklch(0.995 0.003 60);
  --k-text: oklch(0.2 0.01 60);
  --k-text-muted: oklch(0.45 0.01 60);
  --k-text-light: oklch(0.5 0.01 60);
  --k-accent: oklch(0.38 0.12 25);
  --k-accent-hover: oklch(0.3 0.13 25);
  --k-border: oklch(0.88 0.01 60);
  --k-border-light: oklch(0.85 0.01 60);
  --k-border-faint: oklch(0.9 0.008 60);
  --k-rank-color: oklch(0.85 0.01 60);
  --k-placeholder-bg: repeating-linear-gradient(135deg, oklch(0.9 0.01 60), oklch(0.9 0.01 60) 8px, oklch(0.93 0.008 60) 8px, oklch(0.93 0.008 60) 16px);
  --k-font-body: 'Noto Naskh Arabic', serif;
  --k-font-ui: 'Noto Sans Arabic', sans-serif;
  --k-max-width: 1180px;
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--k-bg);
  font-family: var(--k-font-body);
  color: var(--k-text);
  direction: rtl;
}
a { color: var(--k-accent); text-decoration: none; }
a:hover { color: var(--k-accent-hover); text-decoration: underline; }
img { max-width: 100%; height: auto; display: block; }
h1, h2, h3, h4, h5, h6 { font-family: var(--k-font-ui); }

/* Layout */
.k-container {
  max-width: var(--k-max-width);
  margin: 0 auto;
  padding: 0 20px;
}

/* Language Bar */
.k-lang-bar {
  background: oklch(0.15 0.01 60);
  font-family: var(--k-font-ui);
}
.k-lang-bar-inner {
  display: flex;
  gap: 0;
  justify-content: flex-start;
}
.k-lang-bar-item {
  padding: 8px 18px;
  font-size: 13px;
  font-weight: 600;
  color: oklch(0.75 0.005 60) !important;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
  border-bottom: 2px solid transparent;
}
.k-lang-bar-item:hover {
  background: oklch(0.22 0.01 60);
  color: white !important;
  text-decoration: none;
}
.k-lang-bar-item.active {
  color: white !important;
  background: oklch(0.25 0.01 60);
  border-bottom-color: var(--k-accent);
  font-weight: 800;
}

/* Header */
.k-header {
  border-bottom: 1px solid var(--k-border);
  background: var(--k-bg-white);
  position: sticky;
  top: 0;
  z-index: 20;
}
.k-header-inner {
  max-width: var(--k-max-width);
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.k-logo {
  font-family: inherit;
  font-weight: 800;
  font-size: 26px;
  color: var(--k-text);
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  text-decoration: none;
}
.k-logo:hover { color: var(--k-text); text-decoration: none; }

/* Navigation */
.k-nav {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 15px;
  font-weight: 600;
  align-items: center;
}
.k-nav > a,
.k-nav > button,
.k-mega-nav-link {
  font-family: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px 2px;
  color: var(--k-text);
  font-size: inherit;
  font-weight: inherit;
}
.k-nav > a:hover,
.k-nav > button:hover,
.k-mega-nav-link:hover { color: var(--k-accent); text-decoration: none; }
.k-nav > a.active,
.k-nav > button.active { color: var(--k-accent); border-bottom: 2px solid var(--k-accent); }
.k-nav-sep { width: 1px; background: var(--k-border-light); margin: 0 4px; align-self: stretch; }
.k-nav-subject-link {
  font-family: var(--k-font-ui);
  font-size: 14px;
  font-weight: 600;
  padding: 4px 6px;
  color: var(--k-text) !important;
}
.k-nav-subject-link:hover { color: var(--k-accent) !important; text-decoration: none; }

/* Mega Nav — hover-based 2-level dropdowns */
.k-mega-nav-item {
  position: relative;
}
.k-mega-nav-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  font-family: var(--k-font-ui) !important;
}
.k-mega-arrow { transition: transform 0.2s; flex-shrink: 0; }
.k-has-mega:hover .k-mega-arrow { transform: rotate(180deg); }
.k-mega-drop {
  display: none;
  position: absolute;
  top: 100%;
  right: 0;
  min-width: 520px;
  padding-top: 8px;
  z-index: 40;
}
.k-has-mega:hover > .k-mega-drop,
.k-has-mega.k-mega-touch-open > .k-mega-drop {
  display: block;
}
.k-mega-drop-inner {
  background: white;
  border: 1px solid var(--k-border-light);
  border-radius: 12px;
  box-shadow: 0 12px 32px oklch(0.2 0.01 60 / 0.15);
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  gap: 16px;
}
.k-mega-drop-col {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.k-mega-drop-heading {
  display: flex;
  flex-direction: column;
  gap: 6px;
  text-decoration: none;
  color: var(--k-text);
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 700;
  transition: color 0.15s;
}
.k-mega-drop-heading:hover { color: var(--k-accent); text-decoration: none; }
.k-mega-drop-thumb {
  aspect-ratio: 16/10;
  border-radius: 6px;
  overflow: hidden;
  background: var(--k-placeholder-bg);
}
.k-mega-drop-thumb img { width: 100%; height: 100%; object-fit: cover; }
.k-mega-drop-list {
  list-style: none;
  padding: 0;
  margin: 4px 0 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.k-mega-drop-sub {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 6px;
  border-radius: 6px;
  font-family: var(--k-font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--k-text-muted);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.k-mega-drop-sub:hover { background: oklch(0.96 0.005 60); color: var(--k-accent); text-decoration: none; }
.k-mega-drop-sub-thumb {
  width: 32px;
  height: 24px;
  border-radius: 4px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--k-placeholder-bg);
}
.k-mega-drop-sub-thumb img { width: 100%; height: 100%; object-fit: cover; }

@media (max-width: 768px) {
  .k-mega-drop {
    position: fixed;
    top: auto;
    right: 16px;
    left: 16px;
    min-width: 0;
    padding-top: 4px;
  }
  .k-mega-drop-inner { grid-template-columns: repeat(2, 1fr); gap: 12px; padding: 14px; }
}
@media (max-width: 480px) {
  .k-mega-drop-inner { grid-template-columns: 1fr; }
}

/* Search */
.k-search-wrap {
  flex: 1;
  min-width: 220px;
  position: relative;
}
.k-search-row { display: flex; gap: 8px; align-items: center; }
.k-search-input {
  width: 100%;
  padding: 9px 14px;
  border-radius: 20px;
  border: 1px solid var(--k-border-light);
  font-size: 15px;
  background: var(--k-bg);
  outline: none;
  font-family: inherit;
}
.k-search-input:focus { border-color: var(--k-accent); }
.k-filter-btn {
  flex-shrink: 0;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--k-border-light);
  background: white;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}
.k-filter-btn span {
  height: 2px;
  background: var(--k-text);
  border-radius: 1px;
}
.k-filter-btn span:nth-child(1) { width: 16px; }
.k-filter-btn span:nth-child(2) { width: 11px; }
.k-filter-btn span:nth-child(3) { width: 6px; }

/* Advanced Search Panel */
.k-adv-search {
  display: none;
  background: white;
  border: 1px solid var(--k-border-light);
  border-radius: 12px;
  box-shadow: 0 12px 32px oklch(0.2 0.01 60 / 0.15);
  padding: 16px;
  margin-top: 8px;
}
.k-adv-search.open { display: block; }
.k-adv-form {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.k-adv-row {
  flex: 1 1 160px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.k-adv-row label {
  font-family: var(--k-font-ui);
  font-size: 12px;
  font-weight: 600;
  color: var(--k-text-muted);
}
.k-adv-row select,
.k-adv-row input {
  padding: 8px 12px;
  border: 1px solid var(--k-border-light);
  border-radius: 8px;
  font-family: inherit;
  font-size: 14px;
  background: var(--k-bg);
  outline: none;
}
.k-adv-row select:focus,
.k-adv-row input:focus { border-color: var(--k-accent); }
.k-adv-submit {
  padding: 8px 20px;
  background: var(--k-accent);
  color: white;
  border: none;
  border-radius: 8px;
  font-family: var(--k-font-ui);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
}
.k-adv-submit:hover { background: var(--k-accent-hover); }

/* Dropdowns */
.k-dropdown {
  position: absolute;
  background: white;
  border: 1px solid var(--k-border-light);
  border-radius: 12px;
  box-shadow: 0 12px 32px oklch(0.2 0.01 60 / 0.15);
  z-index: 30;
  display: none;
}
.k-dropdown.open { display: block; }

.k-mega-menu {
  top: calc(100% + 10px);
  right: -20px;
  width: 520px;
  padding: 18px;
}
.k-mega-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.k-mega-item { cursor: pointer; display: flex; flex-direction: column; gap: 6px; }
.k-mega-item:hover .k-mega-label { color: var(--k-accent); }
.k-mega-thumb {
  aspect-ratio: 16/10;
  border-radius: 6px;
  background: var(--k-placeholder-bg);
  overflow: hidden;
}
.k-mega-thumb img { width: 100%; height: 100%; object-fit: cover; }
.k-mega-label { font-size: 13px; font-weight: 600; }

/* Suggestions dropdown */
.k-suggestions {
  top: calc(100% + 6px);
  right: 0;
  left: 0;
  border-radius: 10px;
  box-shadow: 0 8px 24px oklch(0.2 0.01 60 / 0.12);
  overflow: hidden;
}
.k-suggestion-item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--k-border-faint);
  font-size: 14px;
}
.k-suggestion-item:hover { background: oklch(0.96 0.005 60); }
.k-suggestion-title { font-weight: 600; }
.k-suggestion-meta { font-size: 12px; color: var(--k-text-muted); }

/* Institution button & dropdown */
.k-inst-btn {
  font-family: inherit;
  background: none;
  border: 1px solid var(--k-border-light);
  border-radius: 20px;
  cursor: pointer;
  padding: 8px 14px;
  font-size: 14px;
  font-weight: 600;
  color: var(--k-text);
}
.k-inst-dropdown {
  top: calc(100% + 10px);
  left: 0;
  width: 460px;
  padding: 20px;
}
.k-inst-tree {
  display: flex;
  gap: 22px;
  justify-content: center;
}
.k-inst-branch {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}
.k-inst-parent {
  border: 1px solid oklch(0.65 0.01 60);
  border-radius: 8px;
  padding: 8px 14px;
  font-size: 12px;
  font-weight: 700;
  background: oklch(0.97 0.005 60);
  white-space: nowrap;
}
.k-inst-line { width: 2px; height: 12px; background: oklch(0.75 0.01 60); }
.k-inst-children {
  border-top: 2px solid oklch(0.75 0.01 60);
  padding-top: 10px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.k-inst-child {
  cursor: pointer;
  border: 1px solid var(--k-border-light);
  border-radius: 6px;
  padding: 6px 10px;
  font-size: 11px;
  text-align: center;
  background: var(--k-bg);
  white-space: nowrap;
  color: var(--k-text);
  text-decoration: none;
  display: block;
}
.k-inst-child:hover { background: oklch(0.95 0.005 60); text-decoration: none; }

/* Radio button */
.k-radio-btn {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 14px;
  font-weight: 700;
  padding: 8px 14px;
  border-radius: 20px;
  background: var(--k-accent);
  color: white;
  text-decoration: none;
}
.k-radio-btn:hover { color: white; text-decoration: none; opacity: 0.9; }
.k-radio-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: white;
  opacity: 0.9;
}

/* Main content */
.k-main {
  flex: 1;
  max-width: var(--k-max-width);
  margin: 0 auto;
  padding: 28px 20px 60px;
  width: 100%;
}

/* Featured */
.k-featured {
  display: grid;
  grid-template-columns: minmax(280px, 1.3fr) 1fr;
  gap: 0;
  border: 1px solid var(--k-border);
  border-radius: 14px;
  overflow: hidden;
  margin-bottom: 36px;
  background: white;
}
.k-featured:hover { box-shadow: 0 4px 16px oklch(0.2 0.01 60 / 0.08); }
.k-featured-img {
  aspect-ratio: 16/10;
  background: var(--k-placeholder-bg);
  overflow: hidden;
}
.k-featured-img img { width: 100%; height: 100%; object-fit: cover; }
.k-featured-body {
  padding: 28px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  justify-content: center;
}
.k-featured-subject {
  font-family: var(--k-font-ui);
  font-size: 12px;
  font-weight: 700;
  color: var(--k-accent);
  text-transform: uppercase;
}
.k-featured-title {
  font-size: 30px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
}
.k-featured-excerpt {
  margin: 0;
  color: oklch(0.4 0.01 60);
  font-size: 15px;
  line-height: 1.7;
}
.k-featured-meta {
  font-family: var(--k-font-ui);
  font-size: 13px;
  color: var(--k-text-muted);
}

/* Home grid */
.k-home-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.2fr) minmax(220px, 1fr);
  gap: 36px;
}
.k-section-title {
  font-size: 19px;
  font-weight: 800;
  border-bottom: 2px solid var(--k-text);
  padding-bottom: 10px;
  margin: 0 0 18px;
}
.k-articles-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 22px;
}

/* Article card */
.k-card { display: flex; flex-direction: column; gap: 8px; }
.k-card:hover .k-card-title { color: var(--k-accent); }
.k-card-thumb {
  aspect-ratio: 16/10;
  border-radius: 8px;
  background: var(--k-placeholder-bg);
  overflow: hidden;
}
.k-card-thumb img { width: 100%; height: 100%; object-fit: cover; }
.k-card-subject {
  font-family: var(--k-font-ui);
  font-size: 11px;
  font-weight: 700;
  color: var(--k-accent);
}
.k-card-title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.4;
  margin: 0;
  transition: color 0.15s;
}
.k-card-meta {
  font-size: 12px;
  color: var(--k-text-light);
  font-family: var(--k-font-ui);
}

/* Sidebar */
.k-sidebar { display: flex; flex-direction: column; gap: 28px; }
.k-sidebar-title {
  font-size: 15px;
  font-weight: 800;
  border-bottom: 2px solid var(--k-text);
  padding-bottom: 8px;
  margin: 0 0 14px;
}
.k-trending-list { display: flex; flex-direction: column; gap: 12px; }
.k-trending-item { cursor: pointer; display: flex; gap: 10px; align-items: baseline; }
.k-trending-item:hover .k-trending-title { color: var(--k-accent); }
.k-trending-rank {
  font-family: var(--k-font-ui);
  font-weight: 800;
  color: var(--k-rank-color);
  font-size: 20px;
  flex-shrink: 0;
}
.k-trending-title { font-size: 14px; font-weight: 600; line-height: 1.5; transition: color 0.15s; }

.k-sites-box {
  border: 1px solid var(--k-border);
  border-radius: 12px;
  padding: 16px;
  background: white;
}
.k-sites-box h2 { font-size: 14px; font-weight: 800; margin: 0 0 10px; }
.k-sites-list { display: flex; flex-direction: column; gap: 8px; font-size: 14px; }

/* Browse / Search layout */
/* Archive / Category / Search — Al Alam grid style */
.k-archive-layout {
  display: grid;
  grid-template-columns: 200px minmax(0, 1fr);
  gap: 32px;
  padding-bottom: 40px;
}
.k-archive-main { min-width: 0; }
.k-archive-sidebar {
  position: sticky;
  top: 80px;
  align-self: start;
}
.k-facet-title {
  font-family: var(--k-font-ui);
  font-size: 14px;
  font-weight: 800;
  margin: 0 0 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--k-text);
}
.k-facet-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.k-facet-list li a {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 0;
  font-family: var(--k-font-ui);
  font-size: 13px;
  color: var(--k-text-muted);
  border-bottom: 1px solid var(--k-border-faint);
  transition: color 0.15s;
}
.k-facet-list li a:hover { color: var(--k-text); text-decoration: none; }
.k-facet-list li a.active { color: var(--k-accent); font-weight: 700; }
.k-facet-list li a small { color: var(--k-text-light); font-size: 11px; }
.k-archive-header {
  text-align: center;
  padding: 28px 0 16px;
}
.k-archive-title {
  font-family: var(--k-font-ui);
  font-size: 22px;
  font-weight: 800;
  margin: 0;
}
.k-archive-desc {
  font-size: 14px;
  color: var(--k-text-muted);
  margin: 6px 0 0;
  line-height: 1.6;
}
.k-author-bio {
  display: flex;
  align-items: center;
  gap: 16px;
  justify-content: center;
  text-align: right;
}
.k-author-bio img { border-radius: 50%; width: 64px; height: 64px; }
.k-author-bio .k-archive-title { font-size: 20px; }
.k-archive-cats {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
  margin-bottom: 28px;
}
.k-archive-cat-tag {
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 700;
  padding: 6px 16px;
  border: 1px solid var(--k-border-light);
  border-radius: 6px;
  color: var(--k-text-muted);
  transition: all 0.15s;
}
.k-archive-cat-tag:hover { border-color: var(--k-accent); color: var(--k-accent); text-decoration: none; }
.k-archive-cat-tag.active {
  background: var(--k-accent);
  border-color: var(--k-accent);
  color: white;
}
.k-archive-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px 16px;
  margin-bottom: 32px;
}
.k-archive-card {
  display: block;
  text-decoration: none;
  color: inherit;
}
.k-archive-card:hover { text-decoration: none; }
.k-archive-card:hover .k-archive-card-title { color: var(--k-accent); }
.k-archive-card-img {
  aspect-ratio: 16/9;
  border-radius: 8px;
  overflow: hidden;
  background: var(--k-placeholder-bg);
  margin-bottom: 10px;
}
.k-archive-card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s;
}
.k-archive-card:hover .k-archive-card-img img { transform: scale(1.06); }
.k-archive-card-title {
  font-family: var(--k-font-ui);
  font-size: 14px;
  font-weight: 700;
  margin: 0 0 6px;
  line-height: 1.5;
  transition: color 0.15s;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.k-archive-card-meta {
  font-size: 11px;
  color: var(--k-text-light);
  font-family: var(--k-font-ui);
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.k-no-results {
  padding: 40px 0;
  text-align: center;
  color: var(--k-text-light);
  font-family: var(--k-font-ui);
}

/* Single article */
/* Authors byline */
.k-authors {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}
.k-author-avatar {
  display: inline-flex;
  flex-shrink: 0;
}
.k-author-avatar img {
  border-radius: 50%;
  width: 28px;
  height: 28px;
}
.k-author-name {
  font-weight: 700;
}
.k-author-sep {
  color: var(--k-text-muted);
  margin: 0 1px;
}
.k-author-guest {
  color: var(--k-text-muted);
}

/* ============================================================
   SINGLE POST — Wide template (YJC-style)
   ============================================================ */

/* Breadcrumb */
.k-breadcrumb {
  font-family: var(--k-font-ui);
  font-size: 13px;
  padding: 14px 0;
  color: var(--k-text-muted);
}
.k-breadcrumb a { color: var(--k-text-muted); font-weight: 600; }
.k-breadcrumb a:hover { color: var(--k-accent); text-decoration: none; }
.k-breadcrumb-sep { margin: 0 6px; color: var(--k-border); }

/* Full-width hero */
.k-single-hero {
  margin-bottom: 28px;
}
.k-single-hero-img {
  max-height: 540px;
  overflow: hidden;
  background: var(--k-placeholder-bg);
}
.k-single-hero-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.k-single-hero-caption {
  display: block;
  font-family: var(--k-font-ui);
  font-size: 12px;
  color: var(--k-text-muted);
  padding: 8px 0;
  border-bottom: 1px solid var(--k-border-faint);
}

/* Layout: content + sidebar */
.k-single-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 220px;
  gap: 36px;
  padding-bottom: 40px;
}

/* Main content */
.k-single-main { min-width: 0; }

.k-single-cat-badge {
  display: inline-block;
  font-family: var(--k-font-ui);
  font-size: 12px;
  font-weight: 700;
  color: white;
  background: var(--k-accent);
  padding: 3px 12px;
  border-radius: 4px;
  margin-bottom: 12px;
}
.k-single-cat-badge:hover { text-decoration: none; color: white; background: var(--k-accent-hover); }

.k-single-title {
  font-size: 34px;
  font-weight: 800;
  line-height: 1.45;
  margin: 0 0 18px;
}

.k-single-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--k-border-faint);
  margin-bottom: 16px;
}
.k-single-meta-authors {
  font-family: var(--k-font-ui);
  font-size: 14px;
}
.k-single-meta-authors .k-author-avatar img { width: 36px; height: 36px; }
.k-single-meta-info {
  font-family: var(--k-font-ui);
  font-size: 13px;
  color: var(--k-text-muted);
  display: flex;
  gap: 16px;
  align-items: center;
}
.k-single-id { color: var(--k-border); font-size: 11px; }

/* Share buttons */
.k-single-share {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 0 20px;
  border-bottom: 1px solid var(--k-border-faint);
  margin-bottom: 28px;
}
.k-single-share-label {
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--k-text-muted);
  margin-left: 4px;
}
.k-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--k-border);
  background: white;
  color: var(--k-text-muted);
  cursor: pointer;
  transition: all 0.15s;
}
.k-share-btn:hover { text-decoration: none; }
.k-share-telegram:hover { background: #0088cc; color: white; border-color: #0088cc; }
.k-share-whatsapp:hover { background: #25D366; color: white; border-color: #25D366; }
.k-share-x:hover { background: #000; color: white; border-color: #000; }
.k-share-fb:hover { background: #1877F2; color: white; border-color: #1877F2; }
.k-share-copy:hover { background: var(--k-text); color: white; border-color: var(--k-text); }

/* Article body */
.k-single-content {
  font-size: 18px;
  line-height: 2;
  color: var(--k-text);
  max-width: 780px;
}
.k-single-content p { margin: 0 0 1.5em; }
.k-single-content img { border-radius: 8px; margin: 1em 0; }
.k-single-content blockquote {
  border-right: 4px solid var(--k-accent);
  padding: 12px 20px;
  margin: 1.5em 0;
  background: oklch(0.97 0.005 60);
  border-radius: 0 8px 8px 0;
  font-style: italic;
  color: oklch(0.3 0.01 60);
}
.k-single-content h2, .k-single-content h3, .k-single-content h4 {
  margin: 1.5em 0 0.5em;
  line-height: 1.4;
}
.k-single-content ul, .k-single-content ol {
  padding-right: 24px;
  margin: 0 0 1.5em;
}
.k-single-content li { margin-bottom: 0.4em; }
.k-single-content a { text-decoration: underline; }
.k-single-content figure { margin: 1.5em 0; }
.k-single-content figcaption {
  font-family: var(--k-font-ui);
  font-size: 13px;
  color: var(--k-text-muted);
  margin-top: 8px;
}

/* Tags */
.k-single-tags {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px 0;
  border-top: 1px solid var(--k-border-faint);
  margin-top: 32px;
}
.k-single-tags-label {
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--k-text-muted);
}
.k-single-tag {
  font-family: var(--k-font-ui);
  font-size: 12px;
  font-weight: 600;
  padding: 4px 14px;
  border: 1px solid var(--k-border);
  border-radius: 20px;
  color: var(--k-text);
  transition: all 0.15s;
}
.k-single-tag:hover { background: var(--k-accent); color: white; border-color: var(--k-accent); text-decoration: none; }

/* Post navigation */
.k-single-nav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  padding: 24px 0;
  border-top: 1px solid var(--k-border-faint);
}
.k-single-nav-item {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px;
  border: 1px solid var(--k-border);
  border-radius: 8px;
  text-decoration: none;
  color: var(--k-text);
  transition: box-shadow 0.15s;
}
.k-single-nav-item:hover { box-shadow: 0 2px 8px oklch(0.2 0.01 60 / 0.08); text-decoration: none; }
.k-single-nav-label {
  font-family: var(--k-font-ui);
  font-size: 12px;
  font-weight: 700;
  color: var(--k-text-muted);
}
.k-single-nav-title {
  font-family: var(--k-font-ui);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.45;
}
.k-single-nav-next { text-align: start; }

/* Sidebar */
.k-single-sidebar { min-width: 0; }
.k-single-sidebar-sticky {
  position: sticky;
  top: 80px;
  border: 1px solid var(--k-border);
  border-radius: 10px;
  background: white;
  overflow: hidden;
}
.k-single-sidebar-title {
  font-family: var(--k-font-ui);
  font-size: 14px;
  font-weight: 800;
  margin: 0;
  padding: 12px 16px;
  background: oklch(0.15 0.01 60);
  color: white;
}
.k-single-sidebar-recent {
  list-style: none;
  margin: 0;
  padding: 0;
  max-height: 520px;
  overflow-y: auto;
}
.k-single-sidebar-recent li a {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 10px 14px;
  border-bottom: 1px solid var(--k-border-faint);
  text-decoration: none;
  color: var(--k-text);
  transition: background 0.1s;
}
.k-single-sidebar-recent li a:hover { background: oklch(0.97 0.005 60); text-decoration: none; }
.k-single-sidebar-recent li a:hover .k-single-sidebar-post-title { color: var(--k-accent); }
.k-single-sidebar-thumb {
  width: 60px;
  height: 45px;
  border-radius: 5px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--k-placeholder-bg);
}
.k-single-sidebar-thumb img { width: 100%; height: 100%; object-fit: cover; }
.k-single-sidebar-body {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.k-single-sidebar-post-title {
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.45;
  transition: color 0.15s;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.k-single-sidebar-date {
  font-family: var(--k-font-ui);
  font-size: 11px;
  color: var(--k-text-muted);
}

/* Related articles */
.k-single-related {
  padding: 36px 0;
  background: oklch(0.975 0.003 60);
  border-top: 1px solid var(--k-border-faint);
}
.k-single-related-title {
  font-family: var(--k-font-ui);
  font-size: 20px;
  font-weight: 800;
  margin: 0 0 20px;
  padding-right: 14px;
  border-right: 4px solid var(--k-accent);
}
.k-single-related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
.k-single-related-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  text-decoration: none;
  color: var(--k-text);
}
.k-single-related-card:hover { text-decoration: none; }
.k-single-related-card:hover h3 { color: var(--k-accent); }
.k-single-related-img {
  aspect-ratio: 16/10;
  border-radius: 8px;
  overflow: hidden;
  background: var(--k-placeholder-bg);
}
.k-single-related-img img { width: 100%; height: 100%; object-fit: cover; }
.k-single-related-card h3 {
  font-family: var(--k-font-ui);
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  line-height: 1.45;
  transition: color 0.15s;
}
.k-single-related-date {
  font-family: var(--k-font-ui);
  font-size: 11px;
  color: var(--k-text-muted);
}

/* Publications */
.k-carousel {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 16px;
  margin-bottom: 32px;
}
.k-book-card {
  flex: 0 0 170px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  cursor: pointer;
}
.k-book-card:hover .k-book-title { color: var(--k-accent); }
.k-book-thumb {
  aspect-ratio: 2/3;
  border-radius: 8px;
  background: var(--k-placeholder-bg);
  overflow: hidden;
}
.k-book-thumb img { width: 100%; height: 100%; object-fit: cover; }
.k-book-title {
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 700;
  line-height: 1.4;
  transition: color 0.15s;
}
.k-book-list-item {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 16px;
  padding: 18px 0;
  border-bottom: 1px solid var(--k-border-faint);
}
.k-book-list-item:hover h3 { color: var(--k-accent); }

/* Footer */
.k-footer {
  border-top: 1px solid var(--k-border);
  background: var(--k-bg-white);
  margin-top: 20px;
}
.k-footer-inner {
  max-width: var(--k-max-width);
  margin: 0 auto;
  padding: 24px 20px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-family: var(--k-font-ui);
  font-size: 13px;
  color: var(--k-text-muted);
}
.k-footer-inner a { font-weight: 700; }
.k-footer-nav { display: flex; align-items: center; }
.k-footer-menu {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  gap: 18px;
}
.k-footer-menu li a {
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--k-text-muted);
  transition: color 0.15s;
}
.k-footer-menu li a:hover { color: var(--k-text); text-decoration: none; }

/* Pagination */
.k-pagination {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: 32px;
  font-family: var(--k-font-ui);
}
.k-pagination a,
.k-pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 36px;
  height: 36px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 14px;
  font-weight: 600;
  border: 1px solid var(--k-border-light);
}
.k-pagination a { color: var(--k-text); }
.k-pagination a:hover { background: oklch(0.96 0.005 60); text-decoration: none; }
.k-pagination .current {
  background: var(--k-accent);
  color: white;
  border-color: var(--k-accent);
}

/* Hero Slider */
.k-hero {
  position: relative;
  width: 100%;
  height: 520px;
  overflow: hidden;
  background: oklch(0.15 0.01 60);
}
.k-hero-track {
  position: relative;
  width: 100%;
  height: 100%;
}
.k-hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.7s ease;
  pointer-events: none;
}
.k-hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.k-hero-slide-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-color: oklch(0.2 0.01 60);
}
.k-hero-slide-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to left, oklch(0.1 0.01 60 / 0.75) 0%, oklch(0.1 0.01 60 / 0.45) 50%, transparent 100%);
}
.k-hero-slide-content {
  position: relative;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 14px;
  max-width: 620px;
  padding-top: 40px;
  padding-bottom: 40px;
}
.k-hero-subject {
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 700;
  color: oklch(0.85 0.08 25);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}
.k-hero-title {
  font-size: 36px;
  font-weight: 800;
  line-height: 1.35;
  margin: 0;
  color: white;
}
.k-hero-excerpt {
  margin: 0;
  font-size: 16px;
  line-height: 1.8;
  color: oklch(0.85 0.005 60);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.k-hero-meta {
  font-family: var(--k-font-ui);
  font-size: 13px;
  color: oklch(0.7 0.005 60);
}
.k-hero-cta {
  align-self: flex-start;
  display: inline-block;
  padding: 10px 28px;
  border-radius: 8px;
  background: var(--k-accent);
  color: white !important;
  font-family: var(--k-font-ui);
  font-size: 14px;
  font-weight: 700;
  margin-top: 6px;
  transition: background 0.2s;
}
.k-hero-cta:hover { background: var(--k-accent-hover); text-decoration: none; }

.k-hero-controls {
  position: absolute;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
  z-index: 5;
}
.k-hero-arrow {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid oklch(1 0 0 / 0.3);
  background: oklch(0.15 0.01 60 / 0.5);
  color: white;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.2s;
  backdrop-filter: blur(4px);
}
.k-hero-arrow:hover { background: oklch(0.15 0.01 60 / 0.8); }
.k-hero-dots {
  display: flex;
  gap: 8px;
  align-items: center;
}
.k-hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  border: 2px solid oklch(1 0 0 / 0.5);
  background: transparent;
  cursor: pointer;
  padding: 0;
  transition: background 0.2s, border-color 0.2s;
}
.k-hero-dot.active {
  background: white;
  border-color: white;
}
.k-hero-dot:hover { border-color: white; }

/* Sections */
.k-section {
  padding: 40px 0;
}
.k-section--alt {
  background: oklch(0.97 0.004 60);
}
.k-section--subjects {
  padding: 32px 0;
  border-bottom: 1px solid var(--k-border);
}
.k-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.k-section-header .k-section-title {
  margin-bottom: 0;
}
.k-section-more {
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 600;
  white-space: nowrap;
}

/* Subjects strip */
.k-subjects-strip {
  display: flex;
  gap: 14px;
  overflow-x: auto;
  padding-bottom: 8px;
}
.k-subject-chip {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-decoration: none;
  min-width: 100px;
}
.k-subject-chip:hover { text-decoration: none; }
.k-subject-chip:hover .k-subject-chip-label { color: var(--k-accent); }
.k-subject-chip-thumb {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  overflow: hidden;
  background: var(--k-placeholder-bg);
  border: 2px solid var(--k-border);
  transition: border-color 0.2s;
}
.k-subject-chip:hover .k-subject-chip-thumb { border-color: var(--k-accent); }
.k-subject-chip-thumb img { width: 100%; height: 100%; object-fit: cover; }
.k-subject-chip-label {
  font-family: var(--k-font-ui);
  font-size: 13px;
  font-weight: 700;
  color: var(--k-text);
  transition: color 0.15s;
  text-align: center;
}
.k-subject-chip-count {
  font-family: var(--k-font-ui);
  font-size: 11px;
  color: var(--k-text-muted);
}

/* Trending grid (front page) */
.k-trending-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.k-trending-card {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  padding: 14px;
  border: 1px solid var(--k-border);
  border-radius: 10px;
  background: white;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}
.k-trending-card:hover {
  box-shadow: 0 4px 16px oklch(0.2 0.01 60 / 0.08);
  text-decoration: none;
  color: inherit;
}
.k-trending-card:hover .k-trending-title { color: var(--k-accent); }
.k-trending-card .k-trending-rank { line-height: 1; }
.k-trending-card-body { display: flex; flex-direction: column; gap: 4px; min-width: 0; }

/* Responsive */
@media (max-width: 768px) {
  .k-hero { height: 420px; }
  .k-hero-title { font-size: 26px; }
  .k-hero-excerpt { font-size: 14px; -webkit-line-clamp: 2; }
  .k-featured { grid-template-columns: 1fr; }
  .k-featured-title { font-size: 22px; }
  .k-home-layout { grid-template-columns: 1fr; }
  .k-archive-layout { grid-template-columns: 1fr; }
  .k-archive-sidebar { position: static; order: -1; }
  .k-archive-grid { grid-template-columns: repeat(2, 1fr); }
  .k-mega-menu { width: 320px; grid-template-columns: repeat(2, 1fr); }
  .k-inst-dropdown { width: 300px; }
  .k-inst-tree { flex-direction: column; align-items: center; }
  .k-single-layout { grid-template-columns: 1fr; }
  .k-single-sidebar { display: none; }
  .k-single-title { font-size: 26px; }
  .k-single-hero-img { max-height: 360px; }
  .k-single-related-grid { grid-template-columns: repeat(2, 1fr); }
  .k-single-nav { grid-template-columns: 1fr; }
  .k-header-inner { gap: 12px; }
}
@media (max-width: 480px) {
  .k-mega-menu { width: 280px; grid-template-columns: 1fr; }
  .k-archive-grid { grid-template-columns: 1fr; }
  .k-archive-card-title { font-size: 13px; }
  .k-single-title { font-size: 22px; }
  .k-single-content { font-size: 16px; }
  .k-single-related-grid { grid-template-columns: 1fr; }
  .k-single-hero-img { max-height: 260px; }
  .k-single-share { flex-wrap: wrap; }
}
