/* ==========================================================
   مدونة فنون المسلم — Muslim Arts Co. Blog
   Main stylesheet (RTL, responsive, light + dark)
   ========================================================== */

/* ---------- 1. Tokens ---------- */
:root {
  --teal: #0ab0cd;
  --teal-d: #0a8aa3;
  --navy: #0a3f4d;
  --navy-d: #072c37;
  --orange: #f7941d;
  --orange-d: #e07f06;

  --bg: #f4f9fb;
  --card: #ffffff;
  --text: #1b3640;
  --heading: #0a2e39;
  --muted: #5d7882;
  --line: #e1ecf0;
  --soft: #eaf6f9;
  --header-bg: rgba(255, 255, 255, .92);

  --radius: 18px;
  --radius-s: 12px;
  --shadow-s: 0 2px 10px rgba(10, 63, 77, .06);
  --shadow: 0 12px 34px rgba(10, 63, 77, .10);
  --shadow-l: 0 22px 50px rgba(10, 63, 77, .16);
  --container: 1200px;
  --header-h: 76px;
  --font: "Tajawal", "Cairo", "Segoe UI", Tahoma, Arial, sans-serif;
}

[data-theme="dark"] {
  --bg: #071a21;
  --card: #0e2630;
  --text: #cfe0e6;
  --heading: #f1f8fa;
  --muted: #8ea8b1;
  --line: #1a3641;
  --soft: #0c2a34;
  --header-bg: rgba(8, 28, 35, .92);
  --shadow-s: 0 2px 10px rgba(0, 0, 0, .3);
  --shadow: 0 12px 34px rgba(0, 0, 0, .35);
  --shadow-l: 0 22px 50px rgba(0, 0, 0, .45);
}

/* ---------- 2. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; font-family: var(--font); font-size: 17px; line-height: 1.85;
  color: var(--text); background: var(--bg); direction: rtl;
  transition: background .3s, color .3s;
}
img, svg { max-width: 100%; display: block; }
img { height: auto; }
a { color: var(--teal-d); text-decoration: none; transition: color .2s; }
a:hover { color: var(--orange-d); }
h1, h2, h3, h4 { color: var(--heading); line-height: 1.4; margin: 0 0 .6em; font-weight: 800; }
p { margin: 0 0 1.1em; }
button { font-family: inherit; cursor: pointer; }
input, textarea, select { font-family: inherit; font-size: 1rem; }
:focus-visible { outline: 3px solid var(--orange); outline-offset: 2px; border-radius: 6px; }
.container { width: min(100% - 32px, var(--container)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ic { width: 1.25em; height: 1.25em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.skip-link { position: absolute; top: -60px; inset-inline-start: 16px; background: var(--orange); color: #fff; padding: 8px 16px; border-radius: 8px; z-index: 999; }
.skip-link:focus { top: 12px; color: #fff; }

/* ---------- 3. Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: .5em; border: 0; border-radius: 999px;
  padding: .7em 1.5em; font-weight: 700; font-size: .98rem; line-height: 1.4;
  background: var(--teal); color: #fff; transition: transform .2s, box-shadow .2s, background .2s;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(10, 176, 205, .35); color: #fff; }
.btn-orange { background: linear-gradient(135deg, #ffb13d, var(--orange-d)); }
.btn-orange:hover { box-shadow: 0 10px 24px rgba(247, 148, 29, .4); }
.btn-ghost { background: rgba(255, 255, 255, .14); border: 1.5px solid rgba(255, 255, 255, .5); }
.btn-ghost:hover { background: #fff; color: var(--navy); box-shadow: none; }
.btn-outline { background: transparent; color: var(--teal-d); border: 1.5px solid var(--teal); }
.btn-outline:hover { background: var(--teal); color: #fff; }
.btn-sm { padding: .5em 1.1em; font-size: .9rem; }

/* ---------- 4. Logo ---------- */
.logo { position: relative; display: block; width: 158px; aspect-ratio: 1590 / 580; overflow: hidden; flex: none; }
.logo img { position: absolute; max-width: none; width: 125.79%; left: -10.69%; top: -6.03%; }
.emblem { position: relative; display: block; width: 46px; aspect-ratio: 525 / 572; overflow: hidden; flex: none; }
.emblem img { position: absolute; max-width: none; width: 380.95%; left: -233.3%; top: -6.99%; }

/* ---------- 5. Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 100; background: var(--header-bg);
  backdrop-filter: saturate(1.4) blur(14px); -webkit-backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line); transition: box-shadow .3s;
}
.site-header.scrolled { box-shadow: 0 6px 24px rgba(10, 63, 77, .10); }
.header-inner { display: flex; align-items: center; gap: 28px; height: var(--header-h); transition: height .3s; }
.site-header.scrolled .header-inner { height: 64px; }
[data-theme="dark"] .logo, [data-theme="dark"] .footer-logo { background: #fff; border-radius: 10px; }
.main-nav { margin-inline-start: auto; }
.main-nav ul { display: flex; align-items: center; gap: 4px; list-style: none; margin: 0; padding: 0; }
.main-nav a, .main-nav .dd-btn {
  display: inline-flex; align-items: center; gap: .3em; padding: .5em .95em; border-radius: 999px;
  font-weight: 700; font-size: .98rem; color: var(--heading); background: none; border: 0; transition: background .2s, color .2s;
}
.main-nav a:hover, .main-nav .dd-btn:hover { background: var(--soft); color: var(--teal-d); }
.main-nav a.active { color: var(--teal-d); background: var(--soft); }
.has-dd { position: relative; }
.dd-menu {
  position: absolute; top: 100%; inset-inline-start: 0; min-width: 230px; margin-top: 8px; padding: 8px;
  background: var(--card); border: 1px solid var(--line); border-radius: 16px; box-shadow: var(--shadow-l);
  opacity: 0; visibility: hidden; transform: translateY(8px); transition: .2s; flex-direction: column; align-items: stretch;
}
.has-dd:hover .dd-menu, .has-dd:focus-within .dd-menu, .has-dd.open .dd-menu { opacity: 1; visibility: visible; transform: none; }
.dd-menu a { display: flex; border-radius: 10px; padding: .6em .9em; }
.header-actions { display: flex; align-items: center; gap: 8px; }
.icon-btn {
  display: grid; place-items: center; width: 42px; height: 42px; border-radius: 50%;
  background: var(--soft); border: 0; color: var(--heading); transition: background .2s, color .2s, transform .2s;
}
.icon-btn:hover { background: var(--teal); color: #fff; transform: scale(1.06); }
.menu-toggle { display: none; }
.theme-toggle .i-sun { display: none; }
[data-theme="dark"] .theme-toggle .i-sun { display: block; }
[data-theme="dark"] .theme-toggle .i-moon { display: none; }
.progress-bar { position: fixed; top: 0; inset-inline: 0; height: 4px; z-index: 200; background: transparent; pointer-events: none; }
.progress-bar span { display: block; height: 100%; width: 0; background: linear-gradient(90deg, var(--teal), var(--orange)); transition: width .1s; }

/* ---------- 6. Search overlay ---------- */
.search-overlay {
  position: fixed; inset: 0; z-index: 300; background: rgba(5, 30, 38, .72); backdrop-filter: blur(6px);
  display: none; align-items: flex-start; justify-content: center; padding: 11vh 16px 16px;
}
.search-overlay.open { display: flex; animation: fade .2s; }
.search-box { width: min(680px, 100%); background: var(--card); border-radius: 22px; box-shadow: var(--shadow-l); overflow: hidden; animation: pop .25s; }
.search-field { display: flex; align-items: center; gap: 12px; padding: 18px 22px; border-bottom: 1px solid var(--line); color: var(--muted); }
.search-field input { flex: 1; border: 0; background: none; outline: none; font-size: 1.15rem; color: var(--heading); min-width: 0; }
.search-results { max-height: 52vh; overflow: auto; padding: 8px; }
.search-results a { display: flex; align-items: center; gap: 14px; padding: 10px; border-radius: 12px; color: var(--heading); }
.search-results a:hover, .search-results a:focus { background: var(--soft); }
.search-results img { width: 84px; aspect-ratio: 16/10; object-fit: cover; border-radius: 8px; flex: none; }
.search-results strong { display: block; font-size: .98rem; line-height: 1.5; }
.search-results small { color: var(--muted); }
.search-empty { padding: 28px; text-align: center; color: var(--muted); }

/* ---------- 7. Hero (home) ---------- */
.hero {
  position: relative; overflow: hidden; color: #fff; padding: 70px 0 96px;
  background: radial-gradient(1200px 500px at 85% -10%, rgba(10, 176, 205, .55), transparent 60%),
              linear-gradient(135deg, var(--navy-d), var(--navy) 55%, #0b6b80);
}
.hero::before {
  content: ""; position: absolute; inset: 0; opacity: .5;
  background-image: url("../img/pattern.svg"); background-size: 120px;
}
.hero-inner { position: relative; display: grid; grid-template-columns: 1.3fr .7fr; gap: 40px; align-items: center; }
.hero .eyebrow { display: inline-flex; align-items: center; gap: .5em; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .25); padding: .35em 1em; border-radius: 999px; font-size: .9rem; margin-bottom: 18px; }
.hero .eyebrow::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); box-shadow: 0 0 0 4px rgba(247, 148, 29, .3); }
.hero h1 { color: #fff; font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.3; margin-bottom: .45em; }
.hero h1 em { font-style: normal; color: #ffb13d; }
.hero p.lead { font-size: 1.12rem; opacity: .9; max-width: 600px; margin-bottom: 28px; }
.hero-search {
  display: flex; align-items: center; gap: 10px; background: #fff; color: var(--muted); border-radius: 999px;
  padding: 8px 8px 8px 20px; max-width: 560px; box-shadow: var(--shadow-l); cursor: text; border: 0; width: 100%; text-align: start;
  padding-inline-start: 22px;
}
.hero-search span { flex: 1; }
.hero-search .btn { pointer-events: none; }
.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; align-items: center; font-size: .92rem; }
.hero-tags a { color: #fff; background: rgba(255, 255, 255, .12); padding: .2em .9em; border-radius: 999px; border: 1px solid rgba(255, 255, 255, .2); }
.hero-tags a:hover { background: var(--orange); border-color: var(--orange); color: #fff; }
.hero-art { position: relative; display: grid; place-items: center; min-height: 280px; }
.hero-art .big-emblem { width: 190px; border-radius: 44px; background: #fff; box-shadow: 0 0 0 10px rgba(255, 255, 255, .15); aspect-ratio: 525 / 572; position: relative; overflow: hidden; filter: drop-shadow(0 24px 30px rgba(0, 0, 0, .35)); animation: float 5s ease-in-out infinite; z-index: 2; }
.hero-art .big-emblem img { position: absolute; max-width: none; width: 380.95%; left: -233.3%; top: -6.99%; }
.hero-art .ring { position: absolute; border: 1.5px dashed rgba(255, 255, 255, .35); border-radius: 50%; animation: spin 40s linear infinite; }
.hero-art .ring.r1 { width: 260px; height: 260px; }
.hero-art .ring.r2 { width: 360px; height: 360px; animation-direction: reverse; animation-duration: 60s; border-color: rgba(247, 148, 29, .45); }
.hero-art .chip { position: absolute; background: #fff; color: var(--navy); font-weight: 700; font-size: .82rem; padding: .35em .9em; border-radius: 999px; box-shadow: var(--shadow); z-index: 3; animation: float 6s ease-in-out infinite; }
.hero-art .chip.c1 { top: 12%; inset-inline-end: 4%; }
.hero-art .chip.c2 { bottom: 18%; inset-inline-start: 0; animation-delay: -2s; }
.hero-art .chip.c3 { top: 46%; inset-inline-end: -4%; animation-delay: -4s; }
.hero-wave { position: absolute; bottom: -1px; inset-inline: 0; line-height: 0; color: var(--bg); }
.hero-wave svg { width: 100%; height: 56px; fill: currentColor; }

/* Page header (category / simple pages) */
.page-hero { position: relative; overflow: hidden; color: #fff; padding: 52px 0 72px; background: linear-gradient(135deg, var(--navy-d), var(--navy) 60%, #0b6b80); }
.page-hero::before { content: ""; position: absolute; inset: 0; opacity: .5; background-image: url("../img/pattern.svg"); background-size: 120px; }
.page-hero .container { position: relative; }
.page-hero h1 { color: #fff; font-size: clamp(1.8rem, 4vw, 2.7rem); margin-bottom: .3em; }
.page-hero p { max-width: 680px; opacity: .9; margin: 0; font-size: 1.08rem; }
.breadcrumb { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: 0 0 18px; font-size: .9rem; opacity: .95; }
.breadcrumb li + li::before { content: "‹"; margin-inline-end: 6px; opacity: .6; }
.breadcrumb a { color: inherit; opacity: .85; }
.breadcrumb a:hover { opacity: 1; color: #ffb13d; }
.article-crumbs { color: var(--muted); margin-bottom: 14px; }

/* ---------- 8. Sections ---------- */
.section { padding: 64px 0; }
.section-sm { padding: 40px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 30px; flex-wrap: wrap; }
.section-head h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); position: relative; padding-inline-start: 18px; }
.section-head h2::before { content: ""; position: absolute; inset-inline-start: 0; top: .2em; bottom: .2em; width: 6px; border-radius: 6px; background: linear-gradient(var(--teal), var(--orange)); }
.section-head p { margin: 4px 0 0; color: var(--muted); }
.more-link { font-weight: 700; display: inline-flex; align-items: center; gap: .4em; }
.more-link .ic { transform: scaleX(-1); transition: transform .2s; }
.more-link:hover .ic { transform: scaleX(-1) translateX(4px); }
.pull-up { margin-top: -44px; position: relative; z-index: 5; }

/* ---------- 9. Cards ---------- */
.grid { display: grid; gap: 26px; }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.card {
  position: relative; display: flex; flex-direction: column; background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-s); transition: transform .3s, box-shadow .3s, border-color .3s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow); border-color: transparent; }
.card-img { position: relative; display: block; overflow: hidden; aspect-ratio: 16 / 9; background: var(--soft); }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform .6s; }
.card:hover .card-img img { transform: scale(1.06); }
.badge {
  display: inline-block; font-size: .8rem; font-weight: 800; padding: .2em .9em; border-radius: 999px; line-height: 1.7;
  background: var(--orange); color: #fff; letter-spacing: .2px;
}
.badge:hover { color: #fff; filter: brightness(1.08); }
.badge.seo { background: #0a8aa3; }
.badge.development { background: #5b4bdb; }
.badge.wordpress { background: #1f6fb5; }
.badge.ecommerce { background: #e07f06; }
.card .badge { position: absolute; top: 14px; inset-inline-start: 14px; z-index: 2; box-shadow: 0 4px 12px rgba(0, 0, 0, .2); }
.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px 22px 22px; }
.card-title { font-size: 1.15rem; line-height: 1.55; margin: 0 0 .5em; }
.card-title a { color: var(--heading); }
.card-title a::after { content: ""; position: absolute; inset: 0; z-index: 1; } /* whole card clickable */
.card:hover .card-title a { color: var(--teal-d); }
.card-excerpt { color: var(--muted); font-size: .95rem; line-height: 1.8; margin: 0 0 16px; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 16px; font-size: .86rem; color: var(--muted); margin-top: auto; }
.meta span { display: inline-flex; align-items: center; gap: .35em; }
.meta .ic { width: 1.05em; height: 1.05em; }

/* Featured grid (home) */
.featured { display: grid; grid-template-columns: 1.55fr 1fr; gap: 26px; }
.feat-main { position: relative; display: block; min-height: 480px; border-radius: 24px; overflow: hidden; color: #fff; box-shadow: var(--shadow-l); isolation: isolate; }
.feat-main img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; transition: transform .8s; }
.feat-main:hover img { transform: scale(1.05); }
.feat-main::after { content: ""; position: absolute; inset: 0; z-index: -1; background: linear-gradient(to top, rgba(4, 24, 31, .94) 8%, rgba(4, 24, 31, .35) 55%, rgba(4, 24, 31, .05)); }
.feat-main .feat-body { position: absolute; bottom: 0; inset-inline: 0; padding: 34px; }
.feat-main h3 { color: #fff; font-size: clamp(1.35rem, 2.6vw, 2rem); margin: 12px 0 10px; }
.feat-main p { opacity: .9; margin: 0 0 14px; max-width: 640px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feat-main .meta { color: rgba(255, 255, 255, .85); }
.feat-side { display: grid; gap: 26px; grid-template-rows: 1fr 1fr; }
.card-h { flex-direction: row; }
.card-h .card-img { aspect-ratio: auto; width: 42%; flex: none; }
.card-h .card-img img { position: absolute; inset: 0; }
.card-h .card-body { padding: 16px 18px; justify-content: center; }
.card-h .card-title { font-size: 1.02rem; }
.card-h .card-excerpt { display: none; }
.card-h .badge { position: static; align-self: flex-start; margin-bottom: 8px; font-size: .74rem; }

/* Categories */
.cat-card {
  position: relative; display: flex; flex-direction: column; gap: 6px; padding: 26px 24px; border-radius: var(--radius); color: #fff; overflow: hidden;
  transition: transform .3s, box-shadow .3s; box-shadow: var(--shadow);
}
.cat-card::before { content: ""; position: absolute; inset: 0; opacity: .5; background: url("../img/pattern.svg") 0 0 / 90px; }
.cat-card::after { content: ""; position: absolute; width: 150px; height: 150px; border-radius: 50%; background: rgba(255, 255, 255, .12); inset-inline-end: -40px; bottom: -50px; transition: transform .5s; }
.cat-card:hover { transform: translateY(-6px); box-shadow: var(--shadow-l); color: #fff; }
.cat-card:hover::after { transform: scale(1.5); }
.cat-card > * { position: relative; z-index: 1; }
.cat-card .cat-ic { width: 54px; height: 54px; border-radius: 16px; background: rgba(255, 255, 255, .2); display: grid; place-items: center; margin-bottom: 10px; }
.cat-card .cat-ic .ic { width: 28px; height: 28px; }
.cat-card h3 { color: #fff; margin: 0; font-size: 1.2rem; }
.cat-card span { opacity: .85; font-size: .92rem; }
.cat-seo { background: linear-gradient(135deg, #0a6f86, #0ab0cd); }
.cat-development { background: linear-gradient(135deg, #3f31b3, #7a66ff); }
.cat-wordpress { background: linear-gradient(135deg, #124a7d, #2a8bd9); }
.cat-ecommerce { background: linear-gradient(135deg, #c96a00, #ffb13d); }
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }

/* Filter chips */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-btn { border: 1.5px solid var(--line); background: var(--card); color: var(--heading); padding: .4em 1.2em; border-radius: 999px; font-weight: 700; font-size: .92rem; transition: .2s; }
.chip-btn:hover { border-color: var(--teal); color: var(--teal-d); }
.chip-btn.active { background: var(--teal); color: #fff; border-color: var(--teal); }
.card.hide { display: none; }
.no-results { display: none; text-align: center; padding: 40px; color: var(--muted); }

/* Stats */
.stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); padding: 26px 18px; }
.stat { text-align: center; padding: 6px; }
.stat + .stat { border-inline-start: 1px solid var(--line); }
.stat b { display: block; font-size: 2.1rem; color: var(--teal-d); line-height: 1.2; font-weight: 800; }
.stat span { color: var(--muted); font-size: .95rem; }

/* CTA band */
.cta-band {
  position: relative; overflow: hidden; border-radius: 28px; padding: 46px 44px; color: #fff; display: flex; align-items: center; justify-content: space-between; gap: 28px; flex-wrap: wrap;
  background: linear-gradient(120deg, #e07f06, #ffb13d);
}
.cta-band::before { content: ""; position: absolute; inset: 0; opacity: .55; background: url("../img/pattern.svg") 0 0 / 110px; }
.cta-band > * { position: relative; }
.cta-band h2 { color: #fff; margin: 0 0 .25em; font-size: clamp(1.4rem, 3vw, 2rem); }
.cta-band p { margin: 0; max-width: 560px; opacity: .95; }
.cta-band .btn { background: #fff; color: var(--orange-d); }
.cta-band .btn:hover { color: var(--orange-d); box-shadow: 0 10px 24px rgba(0, 0, 0, .2); }

/* Newsletter */
.newsletter { background: var(--soft); border: 1px solid var(--line); border-radius: 28px; padding: 44px; display: grid; grid-template-columns: 1fr 1fr; gap: 30px; align-items: center; }
.newsletter h2 { margin-bottom: .2em; }
.newsletter p { color: var(--muted); margin: 0; }
.nl-form { display: flex; gap: 8px; background: var(--card); padding: 7px; border-radius: 999px; border: 1px solid var(--line); box-shadow: var(--shadow-s); }
.nl-form input { flex: 1; min-width: 0; border: 0; background: none; padding: 0 16px; color: var(--heading); outline: none; }
.form-msg { margin: 10px 14px 0; font-weight: 700; color: var(--teal-d); min-height: 1.5em; }

/* ---------- 10. Article ---------- */
.article-layout { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 44px; align-items: start; padding: 40px 0 70px; }
.article-head h1 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); line-height: 1.45; margin: 12px 0 18px; }
.article-head .lead { font-size: 1.15rem; color: var(--muted); }
.byline { display: flex; align-items: center; flex-wrap: wrap; gap: 12px 22px; padding: 16px 0; margin: 20px 0; border-block: 1px solid var(--line); font-size: .92rem; color: var(--muted); }
.byline .author { display: flex; align-items: center; gap: 10px; color: var(--heading); font-weight: 700; }
.byline .author .emblem { width: 34px; }
.byline span { display: inline-flex; align-items: center; gap: .4em; }
.article-cover { margin: 0 0 30px; border-radius: 22px; overflow: hidden; box-shadow: var(--shadow); aspect-ratio: 16 / 9; background: var(--soft); }
.article-cover img { width: 100%; height: 100%; object-fit: cover; }
.prose { font-size: 1.12rem; line-height: 2; }
.prose h2 { font-size: 1.65rem; margin: 1.8em 0 .6em; padding-inline-start: 16px; position: relative; }
.prose h2::before { content: ""; position: absolute; inset-inline-start: 0; top: .25em; bottom: .25em; width: 5px; border-radius: 5px; background: linear-gradient(var(--teal), var(--orange)); }
.prose h3 { font-size: 1.3rem; margin: 1.5em 0 .5em; color: var(--teal-d); }
.prose ul, .prose ol { padding-inline-start: 1.4em; margin: 0 0 1.3em; }
.prose li { margin-bottom: .5em; }
.prose li::marker { color: var(--orange); font-weight: 800; }
.prose a { text-decoration: underline; text-underline-offset: 4px; text-decoration-color: rgba(10, 176, 205, .5); }
.prose strong { color: var(--heading); }
.prose blockquote { margin: 1.6em 0; padding: 20px 26px; background: var(--soft); border-inline-start: 5px solid var(--orange); border-radius: 0 16px 16px 0; font-size: 1.12rem; color: var(--heading); }
[dir="rtl"] .prose blockquote, .prose blockquote { border-radius: 16px 0 0 16px; }
.prose blockquote p:last-child { margin: 0; }
.prose code { background: var(--soft); color: var(--orange-d); padding: .1em .45em; border-radius: 6px; font-size: .92em; direction: ltr; unicode-bidi: embed; font-family: Consolas, "SFMono-Regular", Menlo, monospace; }
.prose pre { direction: ltr; text-align: left; background: #0b2530; color: #d6eef5; padding: 22px 24px; border-radius: 16px; overflow-x: auto; font-size: .92rem; line-height: 1.7; margin: 1.5em 0; box-shadow: var(--shadow-s); }
.prose pre code { background: none; color: inherit; padding: 0; }
.prose figure { margin: 1.8em 0; }
.prose figure img { border-radius: 16px; width: 100%; }
.prose figcaption { text-align: center; font-size: .88rem; color: var(--muted); margin-top: 8px; }
.table-wrap { overflow-x: auto; margin: 1.6em 0; border-radius: 16px; border: 1px solid var(--line); background: var(--card); }
.prose table { width: 100%; border-collapse: collapse; font-size: .98rem; min-width: 520px; }
.prose th { background: var(--navy); color: #fff; text-align: start; padding: 12px 16px; }
.prose td { padding: 12px 16px; border-top: 1px solid var(--line); }
.prose tr:nth-child(even) td { background: var(--soft); }
.callout { display: flex; gap: 14px; margin: 1.6em 0; padding: 18px 22px; border-radius: 16px; background: #fff7ea; border: 1px solid #ffe2b8; color: #6b4300; }
[data-theme="dark"] .callout { background: #2a2210; border-color: #4a3a14; color: #f3d9a4; }
.callout .ic { color: var(--orange); width: 1.6em; height: 1.6em; margin-top: .2em; }
.callout p { margin: 0; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin: 34px 0 0; }
.tags a { background: var(--soft); color: var(--teal-d); padding: .25em 1em; border-radius: 999px; font-size: .9rem; font-weight: 700; }
.tags a:hover { background: var(--teal); color: #fff; }
.share { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 28px 0; padding: 18px 22px; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.share b { margin-inline-end: 6px; }
.share a, .share button { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--soft); color: var(--heading); border: 0; transition: .2s; }
.share a:hover, .share button:hover { background: var(--teal); color: #fff; transform: translateY(-3px); }
.author-box { display: flex; gap: 20px; align-items: center; padding: 26px; background: linear-gradient(135deg, var(--soft), var(--card)); border: 1px solid var(--line); border-radius: 22px; margin-bottom: 34px; }
.author-box .emblem { width: 64px; }
.author-box h4 { margin: 0 0 .2em; }
.author-box p { margin: 0; color: var(--muted); font-size: .96rem; line-height: 1.8; }

/* Sidebar */
.sidebar { position: sticky; top: calc(var(--header-h) + 20px); display: grid; gap: 22px; }
.widget { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 22px; box-shadow: var(--shadow-s); }
.widget h4 { font-size: 1.05rem; margin-bottom: .9em; display: flex; align-items: center; gap: .5em; }
.widget h4::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: var(--orange); }
.toc { list-style: none; margin: 0; padding: 0; max-height: 42vh; overflow: auto; }
.toc li a { display: block; padding: .45em .8em; border-radius: 10px; color: var(--text); font-size: .95rem; line-height: 1.6; border-inline-start: 3px solid transparent; }
.toc li a:hover { background: var(--soft); }
.toc li a.active { background: var(--soft); color: var(--teal-d); font-weight: 800; border-inline-start-color: var(--orange); }
.widget-cta { background: linear-gradient(135deg, var(--navy), #0b6b80); color: #fff; border: 0; position: relative; overflow: hidden; }
.widget-cta::before { content: ""; position: absolute; inset: 0; opacity: .5; background: url("../img/pattern.svg") 0 0 / 90px; }
.widget-cta > * { position: relative; }
.widget-cta h4, .widget-cta p { color: #fff; }
.widget-cta p { opacity: .9; font-size: .95rem; line-height: 1.8; }
.cat-list { list-style: none; margin: 0; padding: 0; }
.cat-list a { display: flex; justify-content: space-between; padding: .55em .2em; color: var(--text); border-bottom: 1px dashed var(--line); }
.cat-list li:last-child a { border: 0; }
.cat-list a:hover { color: var(--teal-d); padding-inline-start: .6em; }
.cat-list small { background: var(--soft); color: var(--teal-d); border-radius: 999px; padding: 0 .7em; font-weight: 800; }
.related { padding: 56px 0 70px; background: var(--soft); border-top: 1px solid var(--line); }

/* ---------- 11. Simple pages ---------- */
.content-narrow { width: min(100% - 32px, 820px); margin: 0 auto; padding: 50px 0 70px; }
.values { display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; margin: 30px 0; }
.value { background: var(--card); border: 1px solid var(--line); border-radius: 20px; padding: 26px; box-shadow: var(--shadow-s); }
.value .cat-ic { width: 52px; height: 52px; border-radius: 16px; display: grid; place-items: center; background: var(--soft); color: var(--teal-d); margin-bottom: 14px; }
.value h3 { font-size: 1.1rem; }
.value p { color: var(--muted); font-size: .96rem; margin: 0; }
.contact-grid { display: grid; grid-template-columns: 1fr 1.2fr; gap: 30px; align-items: start; }
.form-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; padding: 30px; box-shadow: var(--shadow); }
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 700; margin-bottom: 6px; color: var(--heading); font-size: .95rem; }
.field input, .field textarea, .field select { width: 100%; padding: .75em 1em; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); color: var(--heading); transition: border-color .2s, box-shadow .2s; }
.field input:focus, .field textarea:focus, .field select:focus { outline: 0; border-color: var(--teal); box-shadow: 0 0 0 4px rgba(10, 176, 205, .15); }
.field textarea { min-height: 140px; resize: vertical; }
.info-item { display: flex; gap: 14px; align-items: center; margin-bottom: 18px; }
.info-item .cat-ic { width: 48px; height: 48px; border-radius: 14px; background: var(--soft); color: var(--teal-d); display: grid; place-items: center; flex: none; }
.error-page { text-align: center; padding: 90px 0; }
.error-page h1 { font-size: clamp(5rem, 16vw, 9rem); margin: 0; line-height: 1; background: linear-gradient(135deg, var(--teal), var(--orange)); -webkit-background-clip: text; background-clip: text; color: transparent; }

/* ---------- 12. Footer ---------- */
.site-footer { position: relative; background: var(--navy-d); color: #b7cfd6; padding: 64px 0 0; overflow: hidden; }
.site-footer::before { content: ""; position: absolute; inset: 0; opacity: .35; background: url("../img/pattern.svg") 0 0 / 130px; }
.site-footer .container { position: relative; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; padding-bottom: 44px; }
.footer-logo { background: #fff; padding: 0; border-radius: 14px; width: 170px; }
.site-footer h4 { color: #fff; font-size: 1.05rem; margin-bottom: 1em; }
.site-footer p { font-size: .95rem; line-height: 1.9; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: .55em; }
.site-footer a { color: #b7cfd6; }
.site-footer a:hover { color: #ffb13d; }
.socials { display: flex; gap: 10px; margin-top: 18px; }
.socials a { display: grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: rgba(255, 255, 255, .08); color: #fff; transition: .2s; }
.socials a:hover { background: var(--orange); color: #fff; transform: translateY(-3px); }
.footer-bottom { position: relative; border-top: 1px solid rgba(255, 255, 255, .1); padding: 20px 0; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px; font-size: .9rem; }
.to-top {
  position: fixed; bottom: 22px; inset-inline-start: 22px; z-index: 90; width: 48px; height: 48px; border-radius: 50%; border: 0; color: #fff;
  background: linear-gradient(135deg, #ffb13d, var(--orange-d)); box-shadow: var(--shadow-l); display: grid; place-items: center;
  opacity: 0; visibility: hidden; transform: translateY(16px); transition: .3s;
}
.to-top.show { opacity: 1; visibility: visible; transform: none; }
.to-top:hover { transform: translateY(-4px); }

/* ---------- 13. Animation ---------- */
@keyframes float { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-14px); } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pop { from { opacity: 0; transform: translateY(-14px) scale(.97); } to { opacity: 1; transform: none; } }
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .7s ease, transform .7s ease; transition-delay: var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; }
.no-js .reveal { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- 14. Responsive ---------- */
@media (max-width: 1100px) {
  .article-layout { grid-template-columns: minmax(0, 1fr) 290px; gap: 30px; }
  .cats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 960px) {
  .menu-toggle { display: grid; }
  .header-inner { gap: 12px; }
  .main-nav {
    position: fixed; top: 0; bottom: 0; inset-inline-start: 0; width: min(330px, 86vw); background: var(--card); z-index: 150; margin: 0;
    padding: 90px 20px 30px; overflow: auto; transform: translateX(105%); transition: transform .35s; box-shadow: var(--shadow-l);
  }
  .main-nav.open { transform: none; }
  .main-nav ul { flex-direction: column; align-items: stretch; gap: 4px; }
  .main-nav a, .main-nav .dd-btn { width: 100%; justify-content: space-between; border-radius: 12px; padding: .8em 1em; }
  .dd-menu { position: static; opacity: 1; visibility: visible; transform: none; box-shadow: none; border: 0; margin: 0; padding: 0 12px 0 0; display: none; background: none; }
  .has-dd.open .dd-menu { display: flex; }
  .header-actions { margin-inline-start: auto; }
  .nav-scrim { position: fixed; inset: 0; background: rgba(5, 30, 38, .55); z-index: 140; opacity: 0; visibility: hidden; transition: .3s; }
  .nav-scrim.show { opacity: 1; visibility: visible; }
  .header-actions .btn { display: none; }
  .hero { padding: 48px 0 80px; }
  .hero-inner { grid-template-columns: 1fr; }
  .hero-art { display: none; }
  .featured { grid-template-columns: 1fr; }
  .feat-main { min-height: 400px; }
  .feat-side { grid-template-columns: 1fr 1fr; grid-template-rows: auto; }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .article-layout { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; }
  .sidebar .toc-widget { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .newsletter { grid-template-columns: 1fr; padding: 30px; }
  .values { grid-template-columns: 1fr; }
  .contact-grid { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
  .stat:nth-child(3) { border-inline-start: 0; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  :root { --header-h: 66px; }
  .logo { width: 132px; }
  .section { padding: 44px 0; }
  .grid-3, .grid-2, .cats, .feat-side { grid-template-columns: 1fr; }
  .cats { gap: 14px; }
  .cat-card { flex-direction: row; align-items: center; gap: 14px; padding: 18px; }
  .cat-card .cat-ic { margin: 0; flex: none; }
  .feat-main { min-height: 360px; border-radius: 20px; }
  .feat-main .feat-body { padding: 22px; }
  .card-h .card-img { width: 38%; }
  .prose { font-size: 1.05rem; line-height: 1.95; }
  .prose h2 { font-size: 1.4rem; }
  .article-head h1 { font-size: 1.6rem; }
  .article-cover { border-radius: 16px; }
  .cta-band { padding: 32px 24px; border-radius: 22px; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .nl-form { flex-direction: column; border-radius: 22px; padding: 10px; }
  .nl-form input { padding: 10px 12px; }
  .author-box { flex-direction: column; text-align: center; }
  .stat b { font-size: 1.7rem; }
  .to-top { bottom: 16px; inset-inline-start: 16px; width: 44px; height: 44px; }
}
@media print {
  .site-header, .site-footer, .sidebar, .share, .related, .to-top, .progress-bar, .cta-band { display: none !important; }
  .article-layout { display: block; }
  body { background: #fff; }
}

/* ---------- 15. Additions ---------- */
.nav-cta { display: none; }
.hero-search .btn { flex: none; }
.hero-search > span:first-of-type { flex: 1; }
@media (max-width: 960px) {
  .nav-cta { display: block; margin-top: 12px; }
  .nav-cta .btn { justify-content: center; color: #fff; }
}
@media (max-width: 960px) {
  /* backdrop-filter يجعل الهيدر "كتلة حاوية" للعناصر الثابتة، فنلغيه على الجوال حتى تظهر القائمة الجانبية بكامل الطول */
  .site-header { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--card); }
  .nav-scrim { z-index: 99; }
  .main-nav { height: 100vh; height: 100dvh; }
}

/* ---------- 16. Feedback, cookie banner, honeypot ---------- */
.hp { position: absolute !important; width: 1px; height: 1px; opacity: 0; overflow: hidden; clip: rect(0 0 0 0); pointer-events: none; }
.feedback { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; margin: 30px 0 0; padding: 16px 22px; background: var(--soft); border-radius: 18px; }
.feedback button { border: 1.5px solid var(--line); background: var(--card); color: var(--heading); border-radius: 999px; padding: .3em 1.1em; font-weight: 700; transition: .2s; }
.feedback button:hover:not(:disabled) { border-color: var(--teal); color: var(--teal-d); }
.feedback button:disabled { opacity: .5; cursor: default; }
.fb-msg { color: var(--teal-d); font-weight: 700; }
.cookie-banner {
  position: fixed; inset-inline: 16px; bottom: 16px; z-index: 250; max-width: 720px; margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  background: var(--card); color: var(--text); border: 1px solid var(--line); border-radius: 18px; padding: 16px 20px; box-shadow: var(--shadow-l);
  transform: translateY(140%); transition: transform .4s;
}
.cookie-banner.show { transform: none; }
.cookie-banner p { margin: 0; font-size: .93rem; line-height: 1.7; flex: 1 1 260px; }
.cookie-banner div { display: flex; gap: 8px; }

/* روابط ونصوص طويلة لا تُمدّد الصفحة على الجوال */
.prose { overflow-wrap: anywhere; word-break: break-word; }
.prose pre { overflow-wrap: normal; word-break: normal; }

/* ---------- الصورة الرمزية الثابتة في الهيرو (يسار الشاشة) ---------- */
.hero-art { min-height: 0; }
.hero-art::before { content: ""; position: absolute; inset: 8% 6%; border-radius: 50%; background: radial-gradient(circle, rgba(255, 255, 255, .22), transparent 68%); }
.hero-avatar { position: relative; z-index: 2; width: min(100%, 430px); height: auto; margin-inline: auto; filter: drop-shadow(0 22px 30px rgba(0, 0, 0, .28)); }

/* ===== WP-compat layer (port additions) ===== */
body.admin-bar .site-header { top: 32px; }
@media screen and (max-width: 782px) { body.admin-bar .site-header { top: 46px; } }

[data-theme="dark"] .prose [style*="color:"] { color: var(--text, #e8f1f2) !important; }
.prose iframe, .prose video, .prose embed, .prose object { max-width: 100%; }

.fm-pagination { margin: 34px 0 10px; display: flex; justify-content: center; }
.fm-pagination .nav-links { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.fm-pagination .page-numbers {
  display: inline-flex; align-items: center; justify-content: center; min-width: 42px; height: 42px; padding: 0 14px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--card); color: var(--text);
  font-weight: 500; text-decoration: none; transition: .2s;
}
.fm-pagination .page-numbers:hover { border-color: var(--accent, #f7941d); }
.fm-pagination .page-numbers.current { background: var(--accent, #f7941d); border-color: var(--accent, #f7941d); color: #fff; }
.fm-pagination .page-numbers.dots { border: 0; background: none; }
.prose .wpcf7-form { display: grid; gap: 14px; }
.prose .wpcf7-form p { margin: 0; }
.prose .wpcf7-form input[type="text"], .prose .wpcf7-form input[type="email"],
.prose .wpcf7-form input[type="tel"], .prose .wpcf7-form textarea {
  width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--bg); color: var(--text); font: inherit;
}
.prose .wpcf7-form input[type="submit"], .prose .wpcf7-form button {
  background: var(--accent, #f7941d); color: #fff; border: 0; border-radius: 12px; padding: 12px 26px; font: inherit; font-weight: 700; cursor: pointer;
}
.prose .wpcf7-not-valid-tip { color: #c0392b; font-size: .9em; }
.prose .wpcf7-response-output { border-radius: 10px; padding: 10px 14px; font-size: .95em; }
.prose .more-link { display: inline-block; margin-top: 10px; font-weight: 700; }
.prose .aligncenter { display: block; margin-inline: auto; }


.prose figure { max-width: 100%; }
.prose .wp-caption { max-width: 100%; }


/* ===== R2 fix-pack CSS ===== */

/* hide WP screen-reader-text (visible pagination heading otherwise) */
.screen-reader-text {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); border: 0; word-wrap: normal !important;
}

/* inline imgs: skip aligned (they keep block layout) */
.prose p img.alignnone, .prose p > img:not(.aligncenter):not(.alignleft):not(.alignright) { display: inline-block; vertical-align: middle; }

/* dark-mode: neutralize ONLY foreground color (not background-color etc) + table cells with hardcoded colors in both modes */
[data-theme="dark"] .prose [style*="color:"] { color: var(--text, #e8f1f2) !important; }
.prose th [style*="color:"] { color: inherit !important; }
[data-theme="dark"] .prose th [style*="color:"] { color: inherit !important; }

/* physical floats with logical margins (align classes come from the editor as physical) */
.prose .alignleft { float: left; margin: 6px 24px 12px 0; }
.prose .alignright { float: right; margin: 6px 0 12px 24px; }

/* embeds: fluid width, keep provider aspect (no forced 16:9) */
.prose .wp-block-embed iframe, .prose iframe { max-width: 100%; width: 100%; border: 0; border-radius: 14px; }

/* admin-bar: offset the fixed/sticky chrome too */
body.admin-bar .progress-bar { top: 32px; }
body.admin-bar .nav-scrim, body.admin-bar .main-nav { top: 32px; }
@media screen and (max-width: 782px) {
  body.admin-bar .progress-bar { top: 46px; }
  body.admin-bar .nav-scrim, body.admin-bar .main-nav { top: 46px; }
}

/* multipage + comments styling */
.prose .page-links { margin: 18px 0; font-weight: 700; }
.prose-comments { margin-top: 34px; }
.prose-comments .comment-list { display: grid; gap: 14px; margin: 0; padding: 0; list-style: none; }
.prose-comments .comment-body { padding: 14px 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.prose-comments .comment-meta { font-size: .85rem; color: var(--muted); margin-bottom: 6px; }
.prose-comments .comment-form { display: grid; gap: 12px; margin-top: 14px; }
.prose-comments .comment-form input[type="text"], .prose-comments .comment-form input[type="email"], .prose-comments .comment-form textarea {
  width: 100%; padding: 12px 16px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg); color: var(--text); font: inherit;
}
.prose-comments .comment-form input[type="submit"] { background: var(--accent, #e07f06); color: #fff; border: 0; border-radius: 12px; padding: 12px 26px; font: inherit; font-weight: 700; cursor: pointer; }
