/*
Theme Name: نوفا تقني
Theme URI: https://nofataqni.com
Author: نوفا تقني
Description: قالب عربي احترافي لمواقع التقنية والذكاء الاصطناعي — نسخة Midnight Editorial
Version: 2.0.0
Requires at least: 5.9
Tested up to: 6.5
Requires PHP: 7.4
License: GPL-2.0-or-later
Text Domain: nova-taqni
Tags: rtl-language, arabic, blog, technology, dark, responsive
*/

/* =============================================
   TOKENS — كل الألوان والقيم من مكان واحد
   ============================================= */
:root {
  /* Surfaces */
  --bg:          #0D1117;
  --bg-2:        #161B27;
  --bg-3:        #1C2333;
  --bg-4:        #1E2A3A;

  /* Borders */
  --line:        rgba(255,255,255,0.07);
  --line-hover:  rgba(255,255,255,0.14);

  /* Brand */
  --blue:        #3B82F6;
  --blue-glow:   rgba(59,130,246,0.18);
  --purple:      #A78BFA;
  --cyan:        #22D3EE;
  --green:       #34D399;
  --amber:       #FBBF24;
  --red:         #F87171;

  /* Text */
  --t1:          #F0F6FC;
  --t2:          #8B949E;
  --t3:          #484F58;

  /* Gradient */
  --grad-brand:  linear-gradient(135deg, #3B82F6 0%, #A78BFA 100%);
  --grad-dark:   linear-gradient(180deg, rgba(13,17,23,0) 0%, #0D1117 100%);

  /* Shapes */
  --r-sm:  6px;
  --r-md:  10px;
  --r-lg:  16px;
  --r-xl:  22px;
  --r-pill: 999px;

  /* Type */
  --font-h: 'Cairo', 'Segoe UI', Arial, sans-serif;
  --font-b: 'Tajawal', 'Segoe UI', Arial, sans-serif;

  /* Motion */
  --ease: cubic-bezier(.4,0,.2,1);
  --dur:  0.2s;

  --w: 1240px;
}

/* =============================================
   RESET
   ============================================= */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { direction: rtl; font-size: 16px; scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-b);
  background: var(--bg);
  color: var(--t1);
  line-height: 1.75;
  min-height: 100vh;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--blue); text-decoration: none; transition: color var(--dur) var(--ease); }
a:hover { color: var(--purple); }
ul, ol { list-style: none; }
button, input, select, textarea { font-family: var(--font-b); }

/* =============================================
   TYPOGRAPHY
   ============================================= */
h1,h2,h3,h4,h5,h6 {
  font-family: var(--font-h);
  font-weight: 800;
  line-height: 1.25;
  color: var(--t1);
}
h1 { font-size: clamp(1.8rem, 5vw, 3rem); }
h2 { font-size: clamp(1.35rem, 3.5vw, 2rem); }
h3 { font-size: clamp(1.1rem, 2.5vw, 1.4rem); }
p { color: var(--t2); line-height: 1.85; margin-bottom: 1.1em; }

/* =============================================
   LAYOUT
   ============================================= */
.wrap {
  max-width: var(--w);
  margin: 0 auto;
  padding: 0 20px;
}
.site-wrap { display: flex; flex-direction: column; min-height: 100vh; }
.site-main  { flex: 1; }

/* =============================================
   HEADER
   ============================================= */
.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  background: rgba(13,17,23,0.88);
  backdrop-filter: blur(16px) saturate(160%);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  border-bottom: 1px solid var(--line);
}
.hd-inner {
  display: flex;
  align-items: center;
  height: 64px;
  gap: 16px;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  flex-shrink: 0;
}
.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: var(--r-md);
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-h);
  font-weight: 900;
  font-size: 1.15rem;
  color: #fff;
  flex-shrink: 0;
}
.logo-name {
  font-family: var(--font-h);
  font-weight: 800;
  font-size: 1.2rem;
  color: var(--t1);
  line-height: 1;
}
.logo-name em {
  display: block;
  font-size: 0.62rem;
  font-style: normal;
  font-weight: 400;
  color: var(--t3);
  margin-top: 2px;
  letter-spacing: .04em;
}

/* Primary Nav */
.primary-nav { margin-right: auto; margin-left: auto; }
.primary-nav ul {
  display: flex;
  align-items: center;
  gap: 2px;
}
.primary-nav a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 13px;
  font-size: .875rem;
  font-weight: 600;
  color: var(--t2);
  border-radius: var(--r-sm);
  transition: all var(--dur) var(--ease);
}
.primary-nav a:hover,
.primary-nav .current-menu-item a {
  background: rgba(59,130,246,.1);
  color: var(--blue);
}

/* Header Search */
.hd-search {
  display: flex;
  align-items: center;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.hd-search:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.hd-search input {
  background: transparent;
  border: none;
  outline: none;
  padding: 8px 14px;
  font-size: .84rem;
  color: var(--t1);
  width: 200px;
}
.hd-search input::placeholder { color: var(--t3); }
.hd-search button {
  background: none;
  border: none;
  padding: 8px 14px;
  cursor: pointer;
  color: var(--t2);
  font-size: 1rem;
  transition: color var(--dur);
}
.hd-search button:hover { color: var(--blue); }

/* Mobile Toggle */
.menu-btn {
  display: none;
  background: none;
  border: 1px solid var(--line);
  border-radius: var(--r-sm);
  padding: 7px 10px;
  cursor: pointer;
  color: var(--t1);
  font-size: 1.1rem;
}

/* =============================================
   READING PROGRESS
   ============================================= */
.progress-bar {
  position: fixed;
  top: 0;
  right: 0;
  height: 2px;
  width: 0%;
  background: var(--grad-brand);
  z-index: 999;
  transition: width .08s linear;
}

/* =============================================
   HERO
   ============================================= */
.hero-strip {
  border-bottom: 1px solid var(--line);
  padding: 18px 0;
  background: var(--bg-2);
  overflow: hidden;
}
.hero-ticker {
  display: flex;
  align-items: center;
  gap: 24px;
  white-space: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.hero-ticker::-webkit-scrollbar { display: none; }
.ticker-label {
  background: var(--grad-brand);
  color: #fff;
  font-size: .72rem;
  font-weight: 800;
  letter-spacing: .06em;
  padding: 4px 12px;
  border-radius: var(--r-pill);
  flex-shrink: 0;
  text-transform: uppercase;
}
.ticker-item {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: .84rem;
  color: var(--t2);
  flex-shrink: 0;
  text-decoration: none;
  transition: color var(--dur);
}
.ticker-item:hover { color: var(--t1); }
.ticker-dot { color: var(--t3); font-size: .5rem; }

/* =============================================
   SECTION LABELS
   ============================================= */
.sec-label {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 24px;
}
.sec-label h2 {
  font-size: 1.05rem;
  font-weight: 800;
  color: var(--t1);
  text-transform: uppercase;
  letter-spacing: .04em;
}
.sec-label::before {
  content: '';
  display: block;
  width: 3px;
  height: 20px;
  border-radius: 3px;
  background: var(--grad-brand);
}
.sec-label .see-all {
  margin-right: auto;
  margin-left: 0;
  font-size: .8rem;
  font-weight: 600;
  color: var(--t3);
  display: flex;
  align-items: center;
  gap: 4px;
  transition: color var(--dur);
}
.sec-label .see-all:hover { color: var(--blue); }

/* =============================================
   HERO FEATURE — Top 5 Posts Mosaic
   ============================================= */
.feature-section { padding: 40px 0; }

.mosaic {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  grid-template-rows: 320px 200px;
  gap: 10px;
}

/* Card base — image-dominant */
.mcard {
  position: relative;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--bg-2);
  display: block;
  text-decoration: none;
  border: 1px solid var(--line);
}
.mcard:hover .mcard-img img { transform: scale(1.06); }

.mcard-img {
  position: absolute;
  inset: 0;
  overflow: hidden;
}
.mcard-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .5s var(--ease);
}

/* Dark gradient overlay */
.mcard::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(7,10,18,.95) 0%, rgba(7,10,18,.6) 45%, rgba(7,10,18,.1) 100%);
  pointer-events: none;
}

.mcard-body {
  position: absolute;
  bottom: 0;
  right: 0;
  left: 0;
  padding: 18px 20px;
  z-index: 2;
}

/* Category chip */
.chip {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: var(--r-pill);
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .04em;
  text-transform: uppercase;
  margin-bottom: 8px;
  border: 1px solid rgba(255,255,255,.15);
  backdrop-filter: blur(4px);
}
.chip-blue   { background: rgba(59,130,246,.25); color: #93C5FD; }
.chip-purple { background: rgba(167,139,250,.25); color: #C4B5FD; }
.chip-cyan   { background: rgba(34,211,238,.25); color: #67E8F9; }
.chip-green  { background: rgba(52,211,153,.25); color: #6EE7B7; }
.chip-amber  { background: rgba(251,191,36,.25); color: #FDE68A; }

.mcard-title {
  font-family: var(--font-h);
  font-weight: 800;
  color: #fff;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 4px rgba(0,0,0,.5);
}

.mcard-meta {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  font-size: .75rem;
  color: rgba(255,255,255,.55);
}

/* Mosaic layout positions */
.mcard-0 { grid-column: 1; grid-row: 1 / 3; }
.mcard-0 .mcard-title { font-size: 1.25rem; -webkit-line-clamp: 3; }

.mcard-1 { grid-column: 2; grid-row: 1; }
.mcard-1 .mcard-title { font-size: 1rem; -webkit-line-clamp: 2; }

.mcard-2 { grid-column: 3; grid-row: 1; }
.mcard-2 .mcard-title { font-size: 1rem; -webkit-line-clamp: 2; }

.mcard-3 { grid-column: 2; grid-row: 2; }
.mcard-3 .mcard-title { font-size: .9rem; -webkit-line-clamp: 2; }
.mcard-3 .mcard-body { padding: 14px 16px; }

.mcard-4 { grid-column: 3; grid-row: 2; }
.mcard-4 .mcard-title { font-size: .9rem; -webkit-line-clamp: 2; }
.mcard-4 .mcard-body { padding: 14px 16px; }

/* =============================================
   CATEGORY PILLS BAR
   ============================================= */
.cats-bar {
  padding: 24px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  background: var(--bg-2);
}
.cats-inner {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}
.cats-inner::-webkit-scrollbar { display: none; }

.cat-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 9px 18px;
  border-radius: var(--r-pill);
  border: 1px solid var(--line);
  background: var(--bg-3);
  font-size: .82rem;
  font-weight: 700;
  color: var(--t2);
  white-space: nowrap;
  text-decoration: none;
  transition: all var(--dur) var(--ease);
  flex-shrink: 0;
}
.cat-pill:hover, .cat-pill.active {
  border-color: var(--blue);
  background: var(--blue-glow);
  color: var(--blue);
}
.cat-pill-icon { font-size: 1rem; }
.cat-pill-count {
  background: var(--bg);
  padding: 1px 7px;
  border-radius: var(--r-pill);
  font-size: .7rem;
  color: var(--t3);
}

/* =============================================
   STANDARD POST CARD
   ============================================= */
.pcard {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  overflow: hidden;
  text-decoration: none;
  display: flex;
  flex-direction: column;
  transition: border-color var(--dur) var(--ease), transform var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
.pcard:hover {
  border-color: var(--line-hover);
  transform: translateY(-3px);
  box-shadow: 0 12px 40px rgba(0,0,0,.5);
}
.pcard-thumb {
  aspect-ratio: 16/9;
  overflow: hidden;
  background: var(--bg-3);
  position: relative;
}
.pcard-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.pcard:hover .pcard-thumb img { transform: scale(1.05); }

.no-thumb {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--bg-3) 0%, var(--bg-4) 100%);
  color: var(--t3);
  font-size: 2rem;
}

.pcard-body { padding: 18px; flex: 1; display: flex; flex-direction: column; }

.pcard-cat {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--blue);
  margin-bottom: 8px;
  display: block;
}

.pcard-title {
  font-family: var(--font-h);
  font-size: .98rem;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.4;
  margin-bottom: 8px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--dur);
}
.pcard:hover .pcard-title { color: var(--blue); }

.pcard-excerpt {
  font-size: .84rem;
  color: var(--t2);
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 16px;
}

.pcard-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: .76rem;
  color: var(--t3);
  margin-top: auto;
}
.pcard-foot .avatar {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  flex-shrink: 0;
}
.pcard-author { font-weight: 600; color: var(--t2); }
.pcard-read {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 4px;
  background: var(--bg-3);
  padding: 2px 8px;
  border-radius: var(--r-pill);
}

/* Grids */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }

/* =============================================
   HORIZONTAL SCROLL ROW (mobile-friendly)
   ============================================= */
.scroll-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 300px;
  gap: 14px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 4px;
  scroll-snap-type: x mandatory;
}
.scroll-row::-webkit-scrollbar { display: none; }
.scroll-row > * { scroll-snap-align: start; }

/* =============================================
   LIST CARD — compact horizontal
   ============================================= */
.lcard {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 14px;
  background: var(--bg-2);
  border-radius: var(--r-md);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color var(--dur), transform var(--dur);
}
.lcard:hover {
  border-color: var(--line-hover);
  transform: translateX(-3px);
}
.lcard-thumb {
  width: 90px;
  height: 68px;
  border-radius: var(--r-sm);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-3);
  order: 2;
}
.lcard-thumb img { width:100%; height:100%; object-fit:cover; }
.lcard-body { flex: 1; order: 1; }
.lcard-cat {
  font-size: .68rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--purple);
  display: block;
  margin-bottom: 5px;
}
.lcard-title {
  font-family: var(--font-h);
  font-size: .88rem;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.lcard-meta {
  font-size: .73rem;
  color: var(--t3);
  display: flex;
  align-items: center;
  gap: 8px;
}

/* =============================================
   NUMBERED POPULAR LIST
   ============================================= */
.top-list { display: flex; flex-direction: column; gap: 0; }
.top-item {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  text-decoration: none;
  transition: padding-right var(--dur) var(--ease);
}
.top-item:hover { padding-right: 6px; }
.top-item:last-child { border-bottom: none; }
.top-num {
  font-family: var(--font-h);
  font-size: 1.6rem;
  font-weight: 900;
  color: var(--bg-4);
  min-width: 36px;
  text-align: center;
  line-height: 1;
  flex-shrink: 0;
}
.top-item:nth-child(1) .top-num { color: var(--blue); }
.top-item:nth-child(2) .top-num { color: var(--purple); }
.top-item:nth-child(3) .top-num { color: var(--cyan); }
.top-body { flex: 1; }
.top-title {
  font-family: var(--font-h);
  font-size: .9rem;
  font-weight: 700;
  color: var(--t1);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.top-meta { font-size: .73rem; color: var(--t3); }

/* =============================================
   HOME SECTIONS
   ============================================= */
.home-sec { padding: 48px 0; border-bottom: 1px solid var(--line); }
.home-sec:last-child { border-bottom: none; }

/* Two column section */
.two-col {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 40px;
  align-items: start;
}

/* =============================================
   AD ZONES
   ============================================= */
.ad-zone {
  border: 1px dashed rgba(255,255,255,.06);
  border-radius: var(--r-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-2);
  color: var(--t3);
  font-size: .78rem;
  padding: 12px;
}
.ad-banner { min-height: 90px; margin: 16px 0; }
.ad-sidebar-box { min-height: 250px; flex-direction: column; gap: 6px; }
.ad-in-article { min-height: 250px; margin: 36px 0; }

/* =============================================
   SIDEBAR
   ============================================= */
.sidebar { display: flex; flex-direction: column; gap: 24px; }

.widget {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 20px;
}
.wt { /* widget title */
  font-family: var(--font-h);
  font-size: .9rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--t1);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  gap: 8px;
}
.wt::before {
  content: '';
  width: 3px;
  height: 14px;
  border-radius: 3px;
  background: var(--grad-brand);
}

/* Category list widget */
.cat-list { display: flex; flex-direction: column; gap: 2px; }
.cat-list a {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 10px;
  border-radius: var(--r-sm);
  font-size: .86rem;
  font-weight: 500;
  color: var(--t2);
  transition: all var(--dur);
}
.cat-list a:hover {
  background: var(--blue-glow);
  color: var(--blue);
}
.cat-list .n {
  background: var(--bg-3);
  padding: 1px 8px;
  border-radius: var(--r-pill);
  font-size: .72rem;
  color: var(--t3);
}

/* Tags widget */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 7px; }
.tag-pill {
  padding: 5px 12px;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  font-size: .78rem;
  color: var(--t2);
  text-decoration: none;
  transition: all var(--dur);
}
.tag-pill:hover {
  border-color: var(--blue);
  background: var(--blue-glow);
  color: var(--blue);
}

/* Search widget */
.search-box {
  display: flex;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.search-box:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.search-box input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 10px 14px;
  font-size: .86rem;
  color: var(--t1);
}
.search-box input::placeholder { color: var(--t3); }
.search-box button {
  background: none;
  border: none;
  padding: 10px 14px;
  cursor: pointer;
  color: var(--t2);
  font-size: 1rem;
  transition: color var(--dur);
}
.search-box button:hover { color: var(--blue); }

/* =============================================
   BREADCRUMBS
   ============================================= */
.breadcrumbs {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  font-size: .78rem;
  color: var(--t3);
  margin-bottom: 20px;
}
.breadcrumbs a { color: var(--t3); }
.breadcrumbs a:hover { color: var(--blue); }
.breadcrumbs .sep { color: var(--line-hover); }
.breadcrumbs .cur { color: var(--blue); font-weight: 600; }

/* =============================================
   SINGLE POST
   ============================================= */
.single-layout {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 40px;
  align-items: start;
  max-width: var(--w);
  margin: 0 auto;
  padding: 40px 20px;
}

/* Post header */
.post-cats { display: flex; align-items: center; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.post-cat-link {
  font-size: .7rem;
  font-weight: 800;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: var(--blue);
  background: var(--blue-glow);
  border: 1px solid rgba(59,130,246,.25);
  padding: 4px 12px;
  border-radius: var(--r-pill);
  text-decoration: none;
  transition: all var(--dur);
}
.post-cat-link:hover { background: var(--blue); color: #fff; }

.post-h1 {
  font-family: var(--font-h);
  font-size: clamp(1.6rem, 4vw, 2.5rem);
  font-weight: 900;
  color: var(--t1);
  line-height: 1.25;
  margin-bottom: 20px;
}

.post-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  padding: 14px 18px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 28px;
}
.pm-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: .8rem;
  color: var(--t2);
}
.pm-item strong { color: var(--t1); font-weight: 700; }
.pm-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 2px solid var(--line);
  object-fit: cover;
}

/* Featured image */
.feat-img {
  border-radius: var(--r-xl);
  overflow: hidden;
  margin-bottom: 36px;
  border: 1px solid var(--line);
}
.feat-img img { width: 100%; max-height: 500px; object-fit: cover; }

/* TOC */
.toc {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-right: 3px solid var(--blue);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 20px 22px;
  margin: 32px 0;
}
.toc-head {
  font-family: var(--font-h);
  font-size: .9rem;
  font-weight: 800;
  color: var(--t1);
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}
.toc ol { counter-reset: toc; padding: 0; }
.toc ol li {
  counter-increment: toc;
  padding: 5px 0;
  border-bottom: 1px solid var(--line);
}
.toc ol li:last-child { border-bottom: none; }
.toc ol li a {
  font-size: .86rem;
  color: var(--t2);
  display: flex;
  align-items: center;
  gap: 10px;
  transition: color var(--dur);
}
.toc ol li a:hover { color: var(--blue); }
.toc ol li a::before {
  content: counter(toc);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  background: var(--blue);
  color: #fff;
  border-radius: 50%;
  font-size: .68rem;
  font-weight: 900;
  flex-shrink: 0;
}

/* Article body */
.article-body {
  font-size: 1.05rem;
  line-height: 1.9;
  color: #C9D1D9;
}
.article-body h2 {
  font-size: 1.45rem;
  font-weight: 900;
  color: var(--t1);
  margin: 44px 0 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
  position: relative;
}
.article-body h2::after {
  content: '';
  position: absolute;
  bottom: -1px;
  right: 0;
  width: 48px;
  height: 2px;
  background: var(--grad-brand);
  border-radius: 2px;
}
.article-body h3 {
  font-size: 1.15rem;
  font-weight: 800;
  color: var(--t1);
  margin: 30px 0 12px;
}
.article-body p { margin-bottom: 20px; }
.article-body a { color: var(--blue); text-decoration: underline; text-underline-offset: 3px; }
.article-body ul, .article-body ol {
  margin: 16px 0 20px 20px;
  color: #C9D1D9;
}
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; }
.article-body img {
  border-radius: var(--r-lg);
  margin: 28px 0;
  border: 1px solid var(--line);
}
.article-body blockquote {
  border-right: 3px solid var(--purple);
  background: rgba(167,139,250,.07);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 16px 20px;
  margin: 28px 0;
  color: #C9D1D9;
  font-style: italic;
}
.article-body code {
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 2px 7px;
  font-family: 'Courier New', monospace;
  font-size: .88em;
  color: var(--cyan);
  direction: ltr;
}
.article-body pre {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  padding: 20px;
  overflow-x: auto;
  margin: 24px 0;
  direction: ltr;
}
.article-body pre code {
  background: transparent;
  border: none;
  color: var(--t1);
  padding: 0;
}
.article-body strong { color: var(--t1); font-weight: 700; }

/* Info box */
.info-box {
  background: var(--blue-glow);
  border: 1px solid rgba(59,130,246,.25);
  border-right: 3px solid var(--blue);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 16px 20px;
  margin: 28px 0;
  font-size: .95rem;
  color: #93C5FD;
}

/* =============================================
   FAQ
   ============================================= */
.faq { margin: 36px 0; }
.faq-item {
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  margin-bottom: 8px;
  overflow: hidden;
  transition: border-color var(--dur);
}
.faq-item.open { border-color: var(--blue); }
.faq-q {
  background: var(--bg-2);
  padding: 14px 18px;
  font-weight: 700;
  font-size: .92rem;
  cursor: pointer;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  color: var(--t1);
  user-select: none;
  transition: background var(--dur);
}
.faq-q:hover { background: var(--bg-3); }
.faq-icon {
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--blue-glow);
  border: 1px solid rgba(59,130,246,.3);
  color: var(--blue);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: .8rem;
  flex-shrink: 0;
  transition: transform var(--dur);
}
.faq-item.open .faq-icon { transform: rotate(45deg); background: var(--blue); color: #fff; }
.faq-a {
  background: var(--bg-2);
  padding: 14px 18px;
  font-size: .9rem;
  color: var(--t2);
  line-height: 1.75;
  border-top: 1px solid var(--line);
  display: none;
}
.faq-item.open .faq-a { display: block; }

/* =============================================
   CTA BOX
   ============================================= */
.cta {
  background: linear-gradient(135deg, rgba(59,130,246,.12) 0%, rgba(167,139,250,.12) 100%);
  border: 1px solid rgba(59,130,246,.2);
  border-radius: var(--r-xl);
  padding: 36px;
  text-align: center;
  margin: 40px 0;
}
.cta h3 { color: var(--t1); font-size: 1.3rem; margin-bottom: 10px; }
.cta p { color: var(--t2); margin-bottom: 20px; }

/* =============================================
   SHARE BAR
   ============================================= */
.share-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  padding: 20px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  margin: 32px 0;
}
.share-label { font-size: .84rem; font-weight: 700; color: var(--t2); }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: var(--r-pill);
  font-size: .78rem;
  font-weight: 700;
  text-decoration: none;
  transition: all var(--dur);
  border: none;
  cursor: pointer;
  font-family: var(--font-b);
}
.share-btn:hover { transform: translateY(-2px); filter: brightness(1.1); }
.share-x { background: #000; color: #fff; border: 1px solid rgba(255,255,255,.1); }
.share-wa { background: #25D366; color: #fff; }
.share-fb { background: #1877F2; color: #fff; }
.share-copy { background: var(--bg-3); color: var(--t1); border: 1px solid var(--line); }

/* =============================================
   RELATED POSTS
   ============================================= */
.related { margin-top: 48px; padding-top: 40px; border-top: 1px solid var(--line); }

/* =============================================
   AUTHOR BOX
   ============================================= */
.author-box {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  padding: 24px;
  margin: 32px 0;
}
.author-box img {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  object-fit: cover;
  border: 2px solid var(--line);
  flex-shrink: 0;
}
.author-box-name {
  font-family: var(--font-h);
  font-weight: 800;
  color: var(--t1);
  margin-bottom: 4px;
}
.author-box-bio { font-size: .86rem; color: var(--t2); margin: 0; }

/* =============================================
   BUTTONS
   ============================================= */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 24px;
  border-radius: var(--r-pill);
  font-weight: 700;
  font-size: .9rem;
  text-decoration: none;
  transition: all var(--dur) var(--ease);
  font-family: var(--font-h);
  border: none;
  cursor: pointer;
}
.btn-primary {
  background: var(--grad-brand);
  color: #fff;
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(59,130,246,.35);
  color: #fff;
}
.btn-ghost {
  background: transparent;
  color: var(--t2);
  border: 1px solid var(--line);
}
.btn-ghost:hover {
  border-color: var(--blue);
  color: var(--blue);
  background: var(--blue-glow);
}
.btn-white {
  background: rgba(255,255,255,.95);
  color: #1a1a2e;
}
.btn-white:hover {
  background: #fff;
  transform: scale(1.03);
  color: #1a1a2e;
}

/* =============================================
   ARCHIVE HEADER
   ============================================= */
.arc-head {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px;
  margin-bottom: 32px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.arc-icon {
  width: 60px;
  height: 60px;
  border-radius: var(--r-lg);
  background: var(--grad-brand);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.6rem;
  flex-shrink: 0;
}
.arc-head h1 { font-size: 1.6rem; }
.arc-head p { color: var(--t2); font-size: .9rem; margin: 6px 0 0; }

/* =============================================
   SEARCH PAGE
   ============================================= */
.search-head {
  background: var(--bg-2);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  padding: 36px;
  margin-bottom: 32px;
}
.search-form-big {
  display: flex;
  background: var(--bg-3);
  border: 1px solid var(--line);
  border-radius: var(--r-pill);
  overflow: hidden;
  max-width: 600px;
  margin-top: 18px;
  transition: border-color var(--dur), box-shadow var(--dur);
}
.search-form-big:focus-within {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--blue-glow);
}
.search-form-big input {
  flex: 1;
  background: transparent;
  border: none;
  outline: none;
  padding: 14px 20px;
  font-size: .96rem;
  color: var(--t1);
  font-family: var(--font-b);
}
.search-form-big input::placeholder { color: var(--t3); }
.search-form-big button {
  background: var(--grad-brand);
  border: none;
  color: #fff;
  padding: 14px 22px;
  cursor: pointer;
  font-size: .9rem;
  font-weight: 700;
  font-family: var(--font-b);
  white-space: nowrap;
}

/* =============================================
   404
   ============================================= */
.p404 { text-align: center; padding: 80px 20px; }
.p404-num {
  font-size: 8rem;
  font-weight: 900;
  font-family: var(--font-h);
  background: var(--grad-brand);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  line-height: 1;
  margin-bottom: 20px;
}
.p404 h2 { font-size: 1.5rem; color: var(--t1); margin-bottom: 12px; }
.p404 p { color: var(--t2); max-width: 400px; margin: 0 auto 28px; }

/* =============================================
   PAGINATION
   ============================================= */
.pagi {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin: 48px 0 0;
}
.pagi a, .pagi span {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: var(--r-sm);
  font-size: .86rem;
  font-weight: 700;
  border: 1px solid var(--line);
  color: var(--t2);
  text-decoration: none;
  transition: all var(--dur);
}
.pagi a:hover { border-color: var(--blue); color: var(--blue); background: var(--blue-glow); }
.pagi .current { background: var(--grad-brand); border-color: transparent; color: #fff; }

/* =============================================
   FOOTER
   ============================================= */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
}
.foot-top { padding: 56px 0 40px; border-bottom: 1px solid var(--line); }
.foot-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 40px;
}
.foot-desc { color: var(--t2); font-size: .88rem; line-height: 1.75; margin: 14px 0 20px; }
.social-row { display: flex; gap: 8px; }
.soc {
  width: 36px;
  height: 36px;
  border-radius: var(--r-sm);
  background: var(--bg-3);
  border: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--t2);
  text-decoration: none;
  font-size: .9rem;
  transition: all var(--dur);
}
.soc:hover { background: var(--blue); border-color: var(--blue); color: #fff; transform: translateY(-2px); }
.foot-col h4 {
  font-size: .8rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .05em;
  color: var(--t2);
  margin-bottom: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.foot-col ul { display: flex; flex-direction: column; gap: 8px; }
.foot-col ul li a {
  font-size: .86rem;
  color: var(--t3);
  text-decoration: none;
  transition: color var(--dur);
  display: flex;
  align-items: center;
  gap: 6px;
}
.foot-col ul li a:hover { color: var(--blue); }
.foot-col ul li a::before { content: '←'; font-size: .7rem; opacity: 0; transition: opacity var(--dur); }
.foot-col ul li a:hover::before { opacity: 1; }
.foot-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 0;
  gap: 16px;
  flex-wrap: wrap;
}
.foot-copy { color: var(--t3); font-size: .8rem; }
.foot-links { display: flex; gap: 16px; }
.foot-links a { color: var(--t3); font-size: .8rem; text-decoration: none; transition: color var(--dur); }
.foot-links a:hover { color: var(--blue); }

/* =============================================
   UTILITY
   ============================================= */
.sticky-sb { position: sticky; top: 80px; }
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); border: 0;
}

/* =============================================
   RESPONSIVE
   ============================================= */
@media (max-width: 1024px) {
  .two-col { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 28px; }
  .mosaic {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: 280px 180px 180px;
  }
  .mcard-0 { grid-column: 1 / 3; grid-row: 1; }
  .mcard-0 .mcard-title { font-size: 1.15rem; }
  .mcard-1 { grid-column: 1; grid-row: 2; }
  .mcard-2 { grid-column: 2; grid-row: 2; }
  .mcard-3 { grid-column: 1; grid-row: 3; }
  .mcard-4 { grid-column: 2; grid-row: 3; }
  .single-layout { grid-template-columns: 1fr; padding: 24px 16px; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 768px) {
  .primary-nav { display: none; }
  .primary-nav.open {
    display: flex;
    position: fixed;
    inset: 64px 0 0;
    background: rgba(13,17,23,0.97);
    backdrop-filter: blur(20px);
    flex-direction: column;
    padding: 20px;
    border-top: 1px solid var(--line);
    overflow-y: auto;
    z-index: 199;
  }
  .primary-nav.open ul { flex-direction: column; width: 100%; gap: 2px; }
  .primary-nav.open ul li { width: 100%; }
  .primary-nav.open a {
    padding: 14px 16px;
    font-size: 1rem;
    border-radius: var(--r-md);
    border-bottom: 1px solid var(--line);
  }
  .menu-btn { display: flex; }
  .hd-search input { width: 130px; }
  .mosaic {
    grid-template-columns: 1fr;
    grid-template-rows: repeat(5, 200px);
  }
  .mcard-0, .mcard-1, .mcard-2, .mcard-3, .mcard-4 {
    grid-column: 1;
    grid-row: auto;
  }
  .grid-3, .grid-2 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; gap: 24px; }
  .foot-bottom { flex-direction: column; text-align: center; }
  .arc-head { flex-direction: column; text-align: center; }
  .share-bar { gap: 7px; }
  .share-btn { font-size: .74rem; padding: 6px 11px; }
  .cta { padding: 24px 18px; }
  .home-sec { padding: 36px 0; }
  .author-box { flex-direction: column; }
  .post-meta { gap: 10px; }
}

@media (max-width: 480px) {
  .hd-search { display: none; }
  .pagi a, .pagi span { width: 36px; height: 36px; font-size: .8rem; }
  .foot-links { flex-direction: column; gap: 8px; align-items: center; }
  .mcard-body { padding: 14px 14px; }
}
