:root {
  --bg: #ffffff;
  --surface: #f8fafc;
  --surface-alt: #f1f5f9;
  --navy: #0f172a;
  --navy-soft: #1e293b;
  --slate-text: #334155;
  --muted: #64748b;
  --border: #e2e8f0;
  --accent: #0284c7;
  --accent-dark: #0369a1;
  --accent-soft: #e0f2fe;
  --danger: #b91c1c;
  --success: #047857;
  --font-ku: 'Rudaw', 'Vazirmatn', 'Noto Sans Arabic', system-ui, -apple-system, sans-serif;
  --container: 1200px;
  --radius: 10px;
}

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

html {
  direction: rtl;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-ku);
  background-color: var(--bg);
  color: var(--navy);
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: inherit;
  text-decoration: none;
}

a:hover {
  color: var(--accent);
}

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: 1.25rem;
}

/* Top Utility Bar */
.topbar {
  background: #020617;
  color: #cbd5e1;
  font-size: 0.82rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.topbar-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  min-height: 36px;
  flex-wrap: wrap;
  padding-block: 0.35rem;
}

.topbar-meta {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.topbar-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #38bdf8;
  display: inline-block;
}

.topbar-email {
  color: #94a3b8;
  font-size: 0.8rem;
  direction: ltr;
}

.topbar-email:hover {
  color: #ffffff;
}

/* Main Header */
.site-header {
  background: var(--navy);
  color: #ffffff;
  border-bottom: 3px solid var(--accent);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.14);
}

.header-main {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding-block: 0.85rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  flex-shrink: 0;
}

.brand:hover {
  color: #ffffff;
}

.brand-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: linear-gradient(135deg, #0284c7, #0369a1);
  display: grid;
  place-items: center;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: 0.5px;
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.25;
}

.brand-title {
  font-size: 1.28rem;
  font-weight: 800;
  color: #ffffff;
}

.brand-subtitle {
  font-size: 0.72rem;
  color: #94a3b8;
  letter-spacing: 0.04em;
}

.nav-desktop {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex-wrap: wrap;
}

.nav-link {
  padding: 0.48rem 0.78rem;
  border-radius: 6px;
  font-size: 0.93rem;
  font-weight: 600;
  color: #e2e8f0;
  transition: background-color 0.15s ease, color 0.15s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  background: rgba(56, 189, 248, 0.14);
  color: #ffffff;
}

.nav-link.active {
  box-shadow: inset 0 -2px 0 #38bdf8;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.search-inline {
  display: flex;
  align-items: center;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  overflow: hidden;
}

.search-inline input {
  background: transparent;
  border: 0;
  color: #ffffff;
  font-family: var(--font-ku);
  font-size: 0.85rem;
  padding: 0.42rem 0.75rem;
  width: 155px;
  outline: none;
}

.search-inline input::placeholder {
  color: #94a3b8;
}

.search-inline button {
  background: transparent;
  border: 0;
  color: #cbd5e1;
  padding: 0.42rem 0.65rem;
  cursor: pointer;
  font-family: var(--font-ku);
  font-size: 0.85rem;
}

.search-inline button:hover {
  color: #ffffff;
}

.menu-toggle {
  display: none;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
  color: #ffffff;
  border-radius: 6px;
  padding: 0.45rem 0.7rem;
  font-family: var(--font-ku);
  font-size: 0.9rem;
  cursor: pointer;
}

.nav-mobile {
  display: none;
  padding-bottom: 1rem;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
}

.nav-mobile.open {
  display: block;
}

.nav-mobile-links {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding-top: 0.75rem;
}

/* Main Content */
.main-content {
  padding-block: 2rem 3.5rem;
  min-height: 70vh;
}

/* Category Badge */
.cat-badge {
  display: inline-block;
  font-size: 0.76rem;
  font-weight: 700;
  padding: 0.2rem 0.62rem;
  border-radius: 5px;
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.cat-badge.cat-ai {
  background: #ede9fe;
  color: #5b21b6;
}

.cat-badge.cat-cybersecurity {
  background: #d1fae5;
  color: #065f46;
}

.cat-badge.cat-digital-economy {
  background: #fef3c7;
  color: #92400e;
}

.cat-badge.cat-technology {
  background: #e0f2fe;
  color: #075985;
}

/* Hero Section */
.hero-grid {
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2.5rem;
}

.hero-lead {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: box-shadow 0.2s ease;
}

.hero-lead:hover {
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.08);
}

.hero-lead-media {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--navy);
  overflow: hidden;
}

.hero-lead-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-lead-body {
  padding: 1.35rem 1.5rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.hero-lead-title {
  margin: 0;
  font-size: 1.58rem;
  line-height: 1.45;
  font-weight: 800;
  color: var(--navy);
}

.hero-lead-summary {
  margin: 0;
  color: var(--slate-text);
  font-size: 1rem;
  line-height: 1.8;
}

.meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.5rem 1rem;
  font-size: 0.82rem;
  color: var(--muted);
}

.hero-side {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.hero-side-card {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 0.9rem;
  padding: 0.9rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  align-items: center;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.hero-side-card:hover {
  border-color: var(--accent);
  background: #ffffff;
}

.hero-side-thumb {
  width: 120px;
  height: 84px;
  border-radius: 6px;
  overflow: hidden;
  background: var(--navy);
}

.hero-side-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-side-title {
  margin: 0.35rem 0 0.25rem;
  font-size: 0.98rem;
  line-height: 1.48;
  font-weight: 700;
  color: var(--navy);
}

.latest-ticker-box {
  background: var(--navy);
  color: #ffffff;
  border-radius: var(--radius);
  padding: 1rem 1.15rem;
  margin-top: auto;
}

.latest-ticker-label {
  font-size: 0.78rem;
  font-weight: 700;
  color: #38bdf8;
  margin-bottom: 0.35rem;
}

.latest-ticker-text {
  margin: 0;
  font-size: 0.9rem;
  color: #e2e8f0;
  line-height: 1.65;
}

/* Section Heading */
.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding-bottom: 0.7rem;
  margin-bottom: 1.35rem;
  border-bottom: 2px solid var(--navy);
}

.section-title {
  margin: 0;
  font-size: 1.25rem;
  font-weight: 800;
  color: var(--navy);
}

.section-more {
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--accent-dark);
}

/* Articles Grid */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.4rem;
  margin-bottom: 2.5rem;
}

.article-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  display: flex;
  flex-direction: column;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.article-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.article-card-media {
  aspect-ratio: 16 / 9;
  background: var(--navy);
  overflow: hidden;
}

.article-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article-card-body {
  padding: 1.05rem 1.15rem 1.2rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.55rem;
}

.article-card-title {
  margin: 0;
  font-size: 1.06rem;
  line-height: 1.52;
  font-weight: 700;
  color: var(--navy);
}

.article-card-summary {
  margin: 0;
  font-size: 0.89rem;
  color: var(--slate-text);
  line-height: 1.72;
  flex: 1;
}

/* Category Columns Strip */
.category-strip {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.75rem;
  margin-top: 1rem;
}

.category-panel {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.2rem 1.3rem;
  background: var(--surface);
}

.category-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 0.85rem;
}

.category-list-item {
  padding-bottom: 0.85rem;
  border-bottom: 1px solid var(--border);
}

.category-list-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.category-list-title {
  display: block;
  font-weight: 700;
  font-size: 0.96rem;
  line-height: 1.55;
  margin-bottom: 0.25rem;
}

/* Article Detail Page */
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.15fr) minmax(260px, 1fr);
  gap: 2.2rem;
  align-items: start;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.45rem;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 1rem;
}

.article-header {
  margin-bottom: 1.35rem;
}

.article-h1 {
  margin: 0.65rem 0 0.85rem;
  font-size: 1.9rem;
  line-height: 1.42;
  font-weight: 800;
  color: var(--navy);
}

.article-lead {
  font-size: 1.08rem;
  color: var(--slate-text);
  line-height: 1.85;
  margin: 0 0 1.15rem;
  padding-inline-start: 0.9rem;
  border-inline-start: 3px solid var(--accent);
}

.article-cover {
  margin: 0 0 1.5rem;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  background: var(--navy);
}

.article-cover img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.article-cover figcaption {
  padding: 0.55rem 0.9rem;
  font-size: 0.82rem;
  color: var(--muted);
  background: var(--surface);
  border-top: 1px solid var(--border);
}

.article-body {
  font-size: 1.06rem;
  line-height: 1.98;
  color: #1e293b;
}

.article-body p {
  margin: 0 0 1.25rem;
}

.article-body h2 {
  margin: 1.9rem 0 0.85rem;
  font-size: 1.32rem;
  font-weight: 800;
  color: var(--navy);
}

.article-body h3 {
  margin: 1.4rem 0 0.65rem;
  font-size: 1.12rem;
  font-weight: 700;
  color: var(--navy-soft);
}

.article-body ul {
  margin: 0 0 1.35rem;
  padding-inline-start: 1.4rem;
}

.article-body li {
  margin-bottom: 0.45rem;
}

.author-box {
  margin-top: 2rem;
  padding: 1.1rem 1.25rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
}

.sidebar-box {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.15rem;
  background: var(--surface);
  margin-bottom: 1.25rem;
}

.sidebar-title {
  margin: 0 0 1rem;
  font-size: 1.05rem;
  font-weight: 800;
  padding-bottom: 0.55rem;
  border-bottom: 2px solid var(--accent);
}

.related-item {
  display: flex;
  gap: 0.75rem;
  padding-block: 0.75rem;
  border-bottom: 1px solid var(--border);
}

.related-item:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.related-thumb {
  width: 84px;
  height: 58px;
  border-radius: 6px;
  overflow: hidden;
  flex-shrink: 0;
  background: var(--navy);
}

.related-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Static Editorial Pages */
.editorial-page {
  max-width: 860px;
  margin: 0 auto;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 2rem;
}

.editorial-page h1 {
  margin-top: 0;
  font-size: 1.75rem;
  font-weight: 800;
  color: var(--navy);
  border-bottom: 2px solid var(--accent);
  padding-bottom: 0.65rem;
}

.editorial-page h2 {
  margin-top: 1.65rem;
  font-size: 1.22rem;
  font-weight: 800;
}

.editorial-page p,
.editorial-page li {
  color: var(--slate-text);
  line-height: 1.9;
}

.category-banner {
  background: var(--surface);
  border: 1px solid var(--border);
  border-inline-start: 4px solid var(--accent);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
  margin-bottom: 1.75rem;
}

.category-banner h1 {
  margin: 0 0 0.35rem;
  font-size: 1.6rem;
  font-weight: 800;
}

.category-banner p {
  margin: 0;
  color: var(--slate-text);
}

/* Footer (Strict Minimal Content) */
.site-footer {
  background: var(--navy);
  color: #cbd5e1;
  border-top: 3px solid var(--accent);
  padding-block: 1.6rem;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.9rem;
}

.footer-copy {
  margin: 0;
  color: #f8fafc;
  font-weight: 600;
}

.footer-links {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1.2rem;
}

.footer-links a {
  color: #cbd5e1;
}

.footer-links a:hover {
  color: #38bdf8;
}

/* Admin Panel */
.admin-shell {
  max-width: 1120px;
  margin: 0 auto;
}

.admin-header-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  padding: 1.15rem 1.35rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: 1.5rem;
}

.admin-actions {
  display: flex;
  align-items: center;
  gap: 0.65rem;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  padding: 0.55rem 1.05rem;
  border-radius: 7px;
  border: 1px solid transparent;
  font-family: var(--font-ku);
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--accent);
  color: #ffffff;
}

.btn-primary:hover {
  background: var(--accent-dark);
  color: #ffffff;
}

.btn-secondary {
  background: #ffffff;
  color: var(--navy);
  border-color: var(--border);
}

.btn-secondary:hover {
  border-color: var(--navy);
  color: var(--navy);
}

.btn-danger {
  background: #fef2f2;
  color: var(--danger);
  border-color: #fecaca;
}

.btn-danger:hover {
  background: var(--danger);
  color: #ffffff;
}

.btn-sm {
  padding: 0.34rem 0.68rem;
  font-size: 0.82rem;
}

.card-box {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  margin-bottom: 1.5rem;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1.1rem;
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  margin-bottom: 1rem;
}

.form-group label {
  font-weight: 700;
  font-size: 0.9rem;
  color: var(--navy);
}

.form-control {
  width: 100%;
  padding: 0.6rem 0.8rem;
  border: 1px solid #cbd5e1;
  border-radius: 7px;
  font-family: var(--font-ku);
  font-size: 0.94rem;
  color: var(--navy);
  background: #ffffff;
}

.form-control:focus {
  outline: 2px solid rgba(2, 132, 199, 0.25);
  border-color: var(--accent);
}

.form-hint {
  font-size: 0.78rem;
  color: var(--muted);
}

.alert {
  padding: 0.8rem 1rem;
  border-radius: 8px;
  margin-bottom: 1.15rem;
  font-size: 0.92rem;
  font-weight: 600;
}

.alert-error {
  background: #fef2f2;
  color: var(--danger);
  border: 1px solid #fecaca;
}

.alert-success {
  background: #ecfdf5;
  color: var(--success);
  border: 1px solid #a7f3d0;
}

.table-wrap {
  overflow-x: auto;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}

.admin-table th,
.admin-table td {
  text-align: right;
  padding: 0.75rem 0.85rem;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

.admin-table th {
  background: var(--surface);
  font-weight: 800;
  color: var(--navy);
}

.status-pill {
  display: inline-block;
  padding: 0.18rem 0.55rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 700;
}

.status-published {
  background: #dcfce7;
  color: #166534;
}

.status-draft {
  background: #f1f5f9;
  color: #475569;
}

.login-box {
  max-width: 440px;
  margin: 2rem auto;
}

/* Responsive */
@media (max-width: 980px) {
  .nav-desktop,
  .search-inline {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
  }

  .hero-grid {
    grid-template-columns: 1fr;
  }

  .articles-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .article-layout {
    grid-template-columns: 1fr;
  }

  .category-strip {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .articles-grid,
  .form-grid {
    grid-template-columns: 1fr;
  }

  .hero-side-card {
    grid-template-columns: 96px 1fr;
  }

  .hero-side-thumb {
    width: 96px;
    height: 70px;
  }

  .hero-lead-title,
  .article-h1 {
    font-size: 1.38rem;
  }

  .editorial-page {
    padding: 1.25rem;
  }
}
