/* ===== SEMANTIC TOKENS ===== */
:root {
  --background: 42 27% 96%;
  --foreground: 45 6% 12%;
  --card: 42 24% 94%;
  --card-foreground: 45 6% 12%;
  --popover: 42 24% 94%;
  --primary: 172 81% 27%;
  --primary-foreground: 0 0% 100%;
  --secondary: 42 18% 88%;
  --secondary-foreground: 45 6% 12%;
  --muted: 42 14% 86%;
  --muted-foreground: 45 6% 40%;
  --accent: 41 49% 59%;
  --accent-foreground: 45 6% 12%;
  --destructive: 0 72% 51%;
  --success: 142 71% 45%;
  --warning: 38 92% 50%;
  --info: 217 91% 60%;
  --border: 42 12% 82%;
  --input: 42 12% 82%;
  --ring: 172 81% 27%;
  --radius: 0.625rem;
  --logo-dark: #012522;
  --logo-green: #379068;
  --font-display: 'Noto Kufi Arabic', sans-serif;
  --font-body: 'Noto Naskh Arabic', serif;
  --font-latin: 'Inter', sans-serif;
}
.dark {
  --background: 170 20% 7%;
  --foreground: 42 20% 92%;
  --card: 170 18% 10%;
  --card-foreground: 42 20% 92%;
  --popover: 170 18% 10%;
  --primary: 172 65% 38%;
  --primary-foreground: 0 0% 100%;
  --secondary: 170 14% 14%;
  --secondary-foreground: 42 20% 92%;
  --muted: 170 12% 16%;
  --muted-foreground: 42 10% 60%;
  --accent: 41 49% 59%;
  --accent-foreground: 45 6% 12%;
  --border: 170 12% 18%;
  --input: 170 12% 18%;
  --ring: 172 65% 38%;
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.75;
  background: hsl(var(--background));
  color: hsl(var(--foreground));
  transition: background 0.25s ease, color 0.25s ease;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3, h4, h5, h6 { font-family: var(--font-display); line-height: 1.3; font-weight: 600; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; background: none; color: inherit; }
:focus-visible { outline: 2px solid hsl(var(--ring)); outline-offset: 2px; }
img, svg { display: block; max-width: 100%; }

/* ===== UTILS ===== */
.container { max-width: 1200px; margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 5rem 0; }
.text-primary { color: hsl(var(--primary)); }
.text-muted { color: hsl(var(--muted-foreground)); }
.text-accent { color: hsl(var(--accent)); }
.bg-card { background: hsl(var(--card)); }
.bg-primary { background: hsl(var(--primary)); }
.bg-muted { background: hsl(var(--muted)); }
.border-default { border: 1px solid hsl(var(--border)); }
.rounded { border-radius: var(--radius); }
.rounded-lg { border-radius: calc(var(--radius) + 4px); }

/* ===== ISLAMIC GEOMETRIC PATTERN BG ===== */
.pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%230D7C66' stroke-width='0.5' opacity='0.08'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z'/%3E%3Cpath d='M30 10L50 30L30 50L10 30Z'/%3E%3Ccircle cx='30' cy='30' r='8'/%3E%3C/g%3E%3C/svg%3E");
}
.dark .pattern-bg {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='60' height='60' viewBox='0 0 60 60'%3E%3Cg fill='none' stroke='%23379068' stroke-width='0.5' opacity='0.12'%3E%3Cpath d='M30 0L60 30L30 60L0 30Z'/%3E%3Cpath d='M30 10L50 30L30 50L10 30Z'/%3E%3Ccircle cx='30' cy='30' r='8'/%3E%3C/g%3E%3C/svg%3E");
}

/* ===== HEADER ===== */
.header {
  position: sticky; top: 0; z-index: 100;
  background: color-mix(in srgb, hsl(var(--background)) 80%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid hsl(var(--border));
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 0.75rem 1.5rem; max-width: 1200px; margin: 0 auto;
  height: 64px;
}
.logo { display: flex; align-items: center; gap: 0.625rem; }
.logo img { width: 36px; height: 36px; }
.logo-text { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; color: hsl(var(--foreground)); }
.nav { display: flex; align-items: center; gap: 1.5rem; }
.nav-links { display: flex; gap: 1.5rem; list-style: none; }
.nav-links a {
  color: hsl(var(--muted-foreground)); font-weight: 500; font-size: 0.875rem;
  transition: color 0.2s; padding: 0.5rem 0;
}
.nav-links a:hover { color: hsl(var(--primary)); }
.nav-links a.active { color: hsl(var(--primary)); font-weight: 600; }
.icon-btn {
  width: 40px; height: 40px; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); display: flex; align-items: center; justify-content: center;
  transition: border-color 0.2s, background 0.2s; color: hsl(var(--muted-foreground));
}
.icon-btn:hover { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }
.icon-btn svg { width: 18px; height: 18px; }
.lang-switch {
  font-family: var(--font-latin); font-size: 0.875rem; font-weight: 500;
  padding: 0.5rem 0.75rem; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); transition: border-color 0.2s;
}
.lang-switch:hover { border-color: hsl(var(--primary)); }
.mobile-toggle { display: none; }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex; align-items: center; gap: 0.5rem;
  padding: 0.625rem 1.25rem; border-radius: var(--radius);
  font-family: var(--font-display); font-weight: 600; font-size: 0.875rem;
  transition: all 0.2s; border: 1px solid transparent; min-height: 44px;
  cursor: pointer;
}
.btn-primary { background: hsl(var(--primary)); color: hsl(var(--primary-foreground)); }
.btn-primary:hover { background: hsl(var(--primary) / 0.9); }
.btn-outline { border-color: hsl(var(--border)); color: hsl(var(--foreground)); background: hsl(var(--background)); }
.btn-outline:hover { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }
.btn-ghost { color: hsl(var(--foreground)); }
.btn-ghost:hover { background: hsl(var(--muted)); }
.btn svg { width: 18px; height: 18px; }

/* ===== BADGES ===== */
.badge {
  font-size: 0.6875rem; padding: 0.125rem 0.5rem; border-radius: 4px;
  font-weight: 600; font-family: var(--font-latin);
}
.badge-primary { background: hsl(var(--primary) / 0.12); color: hsl(var(--primary)); }
.badge-success { background: hsl(var(--success) / 0.12); color: hsl(var(--success)); }
.badge-accent { background: hsl(var(--accent) / 0.15); color: hsl(var(--accent)); }
.badge-warning { background: hsl(var(--warning) / 0.12); color: hsl(var(--warning)); }

/* ===== BREADCRUMB ===== */
.breadcrumb {
  padding: 1.5rem 0 0;
  font-size: 0.8125rem; color: hsl(var(--muted-foreground));
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
}
.breadcrumb a { color: hsl(var(--muted-foreground)); transition: color 0.2s; }
.breadcrumb a:hover { color: hsl(var(--primary)); }
.breadcrumb .sep { opacity: 0.5; }
.breadcrumb .current { color: hsl(var(--foreground)); font-weight: 500; }

/* ===== ARTICLE HEADER ===== */
.article-header {
  padding: 2rem 0 2.5rem;
  max-width: 800px; margin: 0 auto;
  text-align: center;
}
.article-header .badge { margin-bottom: 1.25rem; }
.article-title {
  font-size: 2.75rem; font-weight: 700; line-height: 1.25;
  letter-spacing: normal; text-wrap: balance; margin-bottom: 1.25rem;
}
.article-subtitle {
  display: block; font-size: 1.25rem; font-weight: 500;
  color: hsl(var(--muted-foreground)); margin-top: 0.625rem; line-height: 1.45;
}
.article-excerpt {
  font-size: 1.125rem; color: hsl(var(--muted-foreground));
  line-height: 1.8; max-width: 60ch; margin: 0 auto 1.75rem;
}
.article-meta {
  display: flex; align-items: center; justify-content: center;
  gap: 1.5rem; flex-wrap: wrap; font-size: 0.875rem;
  color: hsl(var(--muted-foreground));
}
.article-meta .meta-item { display: inline-flex; align-items: center; gap: 0.375rem; }
.article-meta svg { width: 15px; height: 15px; color: hsl(var(--primary)); }
.article-meta .author { font-weight: 600; color: hsl(var(--foreground)); }

/* ===== COVER (pattern-bg) ===== */
.cover {
  max-width: 900px; margin: 0 auto 3rem;
  aspect-ratio: 16 / 7; border-radius: calc(var(--radius) + 8px);
  border: 1px solid hsl(var(--border)); position: relative; overflow: hidden;
  display: flex; align-items: center; justify-content: center;
}
.cover .pattern-bg { position: absolute; inset: 0; }
.cover-mark {
  position: relative; z-index: 1;
  width: 90px; height: 90px; opacity: 0.85;
}

/* ===== ARTICLE BODY ===== */
.article-body {
  max-width: 640px; margin: 0 auto;
  font-family: var(--font-body); font-size: 1rem; line-height: 1.8;
  color: hsl(var(--foreground));
}
.article-body p { margin-bottom: 1.25rem; }
.article-body .lead {
  font-size: 1.125rem; color: hsl(var(--foreground));
  margin-bottom: 1.75rem; line-height: 1.85; font-weight: 500;
}
.article-body h2 {
  font-size: 1.5rem; font-weight: 700; margin: 2.5rem 0 1rem;
  line-height: 1.35;
}
.article-body h2::before {
  content: ''; display: block; width: 32px; height: 3px;
  background: hsl(var(--primary)); border-radius: 2px;
  margin-bottom: 0.875rem;
}
.article-body ul { margin: 1rem 0 1.5rem; padding-inline-start: 1.5rem; }
.article-body li { margin-bottom: 0.5rem; line-height: 1.8; }
.article-body strong { font-weight: 600; color: hsl(var(--foreground)); }
.article-body a { color: hsl(var(--primary)); text-decoration: underline; text-underline-offset: 3px; }

/* ===== BLOCKQUOTE ===== */
.article-body blockquote {
  border-inline-start: 3px solid hsl(var(--primary));
  padding-inline-start: 1rem; margin: 2rem 0;
  font-style: italic; color: hsl(var(--muted-foreground));
  font-size: 1.0625rem; line-height: 1.8;
}

/* ===== CODE BLOCK ===== */
.article-body pre {
  background: hsl(var(--card)); border: 1px solid hsl(var(--border));
  border-radius: var(--radius); padding: 1.25rem 1.5rem;
  margin: 1.75rem 0; overflow-x: auto;
  font-family: 'Inter', 'Courier New', monospace; font-size: 0.8125rem;
  direction: ltr; text-align: left; line-height: 1.7;
}
.article-body pre code { color: hsl(var(--foreground)); font-family: inherit; }
.article-body :not(pre) > code {
  background: hsl(var(--muted)); padding: 0.125rem 0.375rem;
  border-radius: 4px; font-family: 'Inter', monospace; font-size: 0.85em;
  direction: ltr; display: inline-block;
}

/* ===== ARTICLE FOOTER (tags + share) ===== */
.article-footer {
  max-width: 640px; margin: 3rem auto 0;
  padding-top: 2rem; border-top: 1px solid hsl(var(--border));
}
.tags-row {
  display: flex; align-items: center; gap: 0.5rem; flex-wrap: wrap;
  margin-bottom: 1.5rem;
}
.tags-row .label {
  font-size: 0.8125rem; color: hsl(var(--muted-foreground)); font-weight: 600;
}
.tags-row .badge { font-size: 0.75rem; padding: 0.25rem 0.625rem; }
.share-row {
  display: flex; align-items: center; gap: 0.625rem; flex-wrap: wrap;
}
.share-row .label {
  font-size: 0.8125rem; color: hsl(var(--muted-foreground)); font-weight: 600;
}
.share-btn {
  width: 38px; height: 38px; border-radius: var(--radius);
  border: 1px solid hsl(var(--border)); display: flex; align-items: center; justify-content: center;
  color: hsl(var(--muted-foreground)); transition: all 0.2s; position: relative;
}
.share-btn:hover { border-color: hsl(var(--primary)); color: hsl(var(--primary)); }
.share-btn svg { width: 17px; height: 17px; }
.share-btn .copied-tip {
  position: absolute; bottom: calc(100% + 6px); left: 50%; transform: translateX(-50%);
  background: hsl(var(--primary)); color: hsl(var(--primary-foreground));
  font-size: 0.6875rem; font-family: var(--font-display); font-weight: 600;
  padding: 0.25rem 0.5rem; border-radius: 4px; white-space: nowrap;
  opacity: 0; pointer-events: none; transition: opacity 0.2s;
}
.share-btn .copied-tip.show { opacity: 1; }

/* ===== MORE POSTS ===== */
.more-posts { background: hsl(var(--card)); }
.more-posts-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; }
.post-card {
  padding: 1.5rem; border-radius: var(--radius);
  background: hsl(var(--background)); border: 1px solid hsl(var(--border));
  transition: border-color 0.2s, transform 0.2s;
  display: flex; flex-direction: column; gap: 0.625rem;
}
.post-card:hover { border-color: hsl(var(--primary)); transform: translateY(-2px); }
.post-card .badge { align-self: flex-start; }
.post-card h3 { color: var(--wt-ink); font-size: 21px; line-height: 1.4; }
.post-card .excerpt { color: hsl(var(--muted-foreground)); font-size: 0.8125rem; line-height: 1.7; flex-grow: 1; }
.post-card .date { font-size: 0.75rem; color: hsl(var(--muted-foreground)); font-family: var(--font-latin); }

/* ===== SECTION HEADER ===== */
.section-header { text-align: center; margin-bottom: 3rem; }
.section-eyebrow {
  font-family: var(--font-latin); font-size: 0.75rem; letter-spacing: 0.15em;
  text-transform: uppercase; color: hsl(var(--primary)); font-weight: 600;
  margin-bottom: 0.75rem;
}
.section-title { font-size: 2rem; font-weight: 700; margin-bottom: 0.75rem; }

/* ===== FOOTER ===== */
.footer {
  background: hsl(var(--logo-dark)); color: hsl(42 20% 90%);
  padding: 3rem 0 2rem; border-top: 1px solid hsl(var(--border));
}
.dark .footer { background: hsl(var(--background)); color: hsl(var(--foreground)); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; margin-bottom: 2rem; }
.footer-brand { display: flex; align-items: center; gap: 0.625rem; margin-bottom: 1rem; }
.footer-brand img { width: 36px; height: 36px; filter: brightness(0) invert(1); }
.dark .footer-brand img { filter: none; }
.footer-brand .logo-text { color: hsl(42 20% 90%); }
.dark .footer-brand .logo-text { color: hsl(var(--foreground)); }
.footer p { color: hsl(42 20% 70%); font-size: 0.875rem; line-height: 1.7; }
.dark .footer p { color: hsl(var(--muted-foreground)); }
.footer h4 { margin: 8px 0 13px; color: var(--wt-lime); font: 700 11px var(--wt-mono); letter-spacing: .11em; }
.footer-links { list-style: none; display: flex; flex-direction: column; gap: 0.5rem; }
.footer-links a { color: hsl(42 20% 70%); font-size: 0.875rem; transition: color 0.2s; }
.dark .footer-links a { color: hsl(var(--muted-foreground)); }
.footer-links a:hover { color: hsl(var(--accent)); }
.footer-bottom {
  border-top: 1px solid hsl(42 10% 20%); padding-top: 1.5rem;
  text-align: center; font-size: 0.8125rem; color: hsl(42 20% 60%);
}
.dark .footer-bottom { border-top-color: hsl(var(--border)); color: hsl(var(--muted-foreground)); }

/* ===== REVEAL ===== */
.reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto !important; }
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .article-title { font-size: 2rem; }
  .more-posts-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .nav-links { display: none; }
  .mobile-toggle { display: flex; }
}
@media (max-width: 600px) {
  .section { padding: 3rem 0; }
  .article-title { font-size: 1.625rem; }
  .article-excerpt { font-size: 1rem; }
  .article-meta { gap: 1rem; }
  .cover { aspect-ratio: 4 / 3; }
  .footer-grid { grid-template-columns: 1fr; }
}
.copy-status { min-height: 1.2rem; margin: 0.5rem 0 0; font-weight: 700; }
.copy-fallback { display: flex; flex-wrap: wrap; gap: 0.5rem; align-items: center; margin-top: 0.5rem; }
.copy-fallback[hidden] { display: none; }
.copy-fallback input { flex: 1 1 16rem; padding: 0.5rem; border: 1px solid hsl(var(--border)); border-radius: var(--radius); direction: ltr; }

.post-card h2 { color: var(--wt-ink); font-size: 21px; line-height: 1.4; }
