/* =========================================================
   عبّاس الملّاحي — لوحة خضراء (مستوحاة من إطعام)
   أخضر أساسي + برتقالي/ذهبي للتباين
   ========================================================= */

:root {
  --paper:      #f3f8f2;   /* خلفية فاتحة بمسحة خضراء */
  --paper-alt:  #e8f1e6;   /* خلفية أقسام بديلة */
  --cream:      #ffffff;   /* البطاقات */
  --ink:        #1f3d2b;   /* نص أساسي أخضر داكن */
  --ink-soft:   #4a6553;   /* نص ثانوي */
  --muted:      #8aa395;   /* نص خافت */
  --line:       #d4e4d0;   /* حدود */

  /* الأخضر (اللون الأساسي) */
  --green:       #2e7d4f;
  --green-dark:  #1f5d39;
  --green-deep:  #14492c;   /* أغمق درجة (للواجهة والتذييل) */
  --green-soft:  #cfe6d2;

  /* البرتقالي/الذهبي (لون التباين) */
  --amber:       #f0a92b;
  --amber-dark:  #e08d1a;
  --amber-soft:  #f8d68a;

  /* تدرجات */
  --grad-green: linear-gradient(160deg, #1f5d39 0%, #2e7d4f 55%, #3f9b63 100%);
  --grad-hero:  linear-gradient(165deg, #14492c 0%, #1f5d39 45%, #2e7d4f 100%);
  --grad-amber: linear-gradient(90deg, #f0a92b, #e08d1a);

  --radius: 18px;
  --shadow-sm: 0 6px 18px -10px rgba(20, 73, 44, 0.30);
  --shadow-md: 0 20px 44px -20px rgba(20, 73, 44, 0.40);

  --font-display: "Alyamama", "Tajawal", sans-serif;
  --font-body:    "Alyamama", "Tajawal", sans-serif;
  --font-quote:   "Alyamama", "Tajawal", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  color: var(--ink);
  background-color: var(--paper);
  /* لمسات خضراء خفيفة في الخلفية */
  background-image:
    radial-gradient(circle at 12% 18%, rgba(46,125,79,0.08), transparent 38%),
    radial-gradient(circle at 88% 85%, rgba(240,169,43,0.08), transparent 40%);
  line-height: 1.85;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.wrap { max-width: 1080px; margin: 0 auto; padding: 0 24px; }

/* ====================== شريط التنقل ====================== */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 100;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s, box-shadow .3s, background .3s;
}
.nav.is-scrolled {
  background: rgba(255, 255, 255, 0.95);
  border-bottom-color: var(--line);
  box-shadow: var(--shadow-sm);
}
.nav__inner {
  max-width: 1080px; margin: 0 auto;
  padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between;
}
.nav__logo {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  text-decoration: none;
  letter-spacing: -.5px;
  background: var(--grad-green);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent;
}
.nav__links { display: flex; gap: 30px; }
.nav__links a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: .98rem;
  font-weight: 500;
  transition: color .25s;
}
.nav__links a::after {
  content: ""; position: absolute; bottom: -6px; right: 0;
  width: 0; height: 2px; background: var(--green);
  transition: width .3s ease;
}
.nav__links a:hover { color: var(--green-dark); }
.nav__links a:hover::after { width: 100%; }

.nav__burger {
  display: none;
  flex-direction: column; gap: 5px;
  width: 42px; height: 42px;
  align-items: center; justify-content: center;
  background: none; border: none; cursor: pointer;
  border-radius: 10px; transition: background .2s;
}
.nav__burger:hover { background: rgba(226,213,189,.5); }
.nav__burger span {
  width: 24px; height: 2px; background: var(--ink);
  border-radius: 2px; transition: transform .3s, opacity .3s;
}
.nav__burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__burger.is-open span:nth-child(2) { opacity: 0; }
.nav__burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ====================== الواجهة الترحيبية ====================== */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  padding: 120px 24px 90px;
  background: var(--grad-hero);
  overflow: hidden;
}
/* زخارف خفيفة في الخلفية */
.hero::before, .hero::after {
  content: ""; position: absolute; border-radius: 50%;
  background: radial-gradient(circle, rgba(255,255,255,0.06), transparent 70%);
  pointer-events: none;
}
.hero::before { width: 480px; height: 480px; top: -120px; right: -120px; }
.hero::after  { width: 420px; height: 420px; bottom: -140px; left: -100px; }
/* موجة فاصلة بيضاء أسفل الواجهة */
.hero__wave {
  position: absolute; bottom: -1px; left: 0; width: 100%; line-height: 0;
}
.hero__wave svg { width: 100%; height: 70px; display: block; }
.hero__wave path { fill: var(--paper); }

/* تخطيط عمودين */
.hero__inner {
  position: relative; z-index: 2;
  width: 100%; max-width: 1080px;
  display: flex; align-items: center;
  gap: clamp(32px, 5vw, 72px);
}
.hero__text { flex: 1; text-align: right; }

/* الصورة الجانبية المدموجة */
.hero__figure {
  position: relative; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
}
.hero__blend {
  position: relative; z-index: 1;
  width: clamp(260px, 30vw, 390px);
  height: auto; display: block;
  filter: drop-shadow(0 22px 38px rgba(0,0,0,0.30));
}
/* هالة ناعمة خلف الصورة (دائرة شفافة لا تغطّي الصورة) */
.hero__figure::before {
  content: ""; position: absolute;
  top: 50%; left: 50%;
  width: 400px; height: 400px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: radial-gradient(circle, rgba(248,214,138,0.20), rgba(46,125,79,0) 62%);
  z-index: 0; pointer-events: none;
}

.hero__ornament {
  display: inline-block;
  font-size: .95rem; font-weight: 700;
  color: #fff; opacity: .95;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.25);
  padding: 8px 20px; border-radius: 999px;
  margin-bottom: 24px;
  animation: float 4s ease-in-out infinite;
}
@keyframes float { 0%,100%{transform:translateY(0)} 50%{transform:translateY(-8px)} }

.hero__name {
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 4.2rem);
  font-weight: 800;
  line-height: 1.22;
  letter-spacing: -1px;
  color: #fff;
}
.hero__name .accent { color: var(--amber); display: block; font-size: .62em; margin-top: 6px; }
.hero__tagline {
  max-width: 520px;
  font-family: var(--font-quote);
  font-size: 1.3rem;
  color: rgba(255,255,255,0.85);
  margin: 20px 0 34px;
  line-height: 2;
}
.hero__cta { display: flex; flex-wrap: wrap; gap: 16px; justify-content: flex-start; }

.hero__scroll {
  position: absolute; bottom: 36px; left: 50%; transform: translateX(-50%);
  width: 26px; height: 42px; border: 2px solid rgba(255,255,255,0.5);
  border-radius: 14px; display: flex; justify-content: center; padding-top: 8px;
  z-index: 2;
}
.hero__scroll span {
  width: 4px; height: 8px; background: #fff;
  border-radius: 2px; animation: scrolldot 1.6s ease-in-out infinite;
}
@keyframes scrolldot { 0%{opacity:0;transform:translateY(-4px)} 50%{opacity:1} 100%{opacity:0;transform:translateY(10px)} }

/* ====================== الأزرار ====================== */
.btn {
  display: inline-block;
  padding: 13px 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 1rem;
  text-decoration: none;
  cursor: pointer;
  transition: transform .25s, box-shadow .25s, background .25s, color .25s;
  border: 1.5px solid transparent;
}
.btn--solid { background: #fff; color: var(--green-dark); box-shadow: var(--shadow-md); }
.btn--solid:hover { transform: translateY(-2px); background: var(--amber); color: #fff; }
.btn--ghost { background: rgba(255,255,255,0.12); color: #fff; border-color: rgba(255,255,255,0.5); }
.btn--ghost:hover { background: rgba(255,255,255,0.22); border-color: #fff; transform: translateY(-2px); }
.btn--small { padding: 9px 22px; font-size: .9rem; background: var(--grad-amber); color: #fff; white-space: nowrap; }
.btn--small:hover { transform: translateY(-2px); box-shadow: var(--shadow-sm); filter: brightness(1.05); }

/* ====================== الأقسام العامة ====================== */
.section { padding: 96px 0; }
.section--alt { background: var(--paper-alt); }

.sec-head { text-align: center; margin-bottom: 56px; }
.sec-head__kicker {
  display: inline-block;
  font-size: .85rem; letter-spacing: 3px;
  color: var(--green); text-transform: uppercase;
  margin-bottom: 8px;
}
.sec-head__title {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--ink); font-weight: 800;
}
.sec-head__title::after {
  content: ""; display: block;
  width: 64px; height: 4px; margin: 18px auto 0;
  background: var(--grad-green);
  border-radius: 3px;
}
.sec-head__sub { color: var(--ink-soft); margin-top: 14px; font-size: 1.05rem; }

/* ====================== نبذة (النص التعريفي) ====================== */
.about-intro {
  max-width: 760px; margin: 0 auto 60px; text-align: center;
}
.about-intro__lead {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  color: var(--green-dark); line-height: 1.6;
  margin-bottom: 20px;
  position: relative; display: inline-block;
}
.about-intro__lead::after {
  content: ""; display: block;
  width: 50px; height: 3px; margin: 14px auto 0;
  background: var(--grad-amber); border-radius: 3px;
}
.about-intro p {
  font-size: 1.18rem; line-height: 2.1; color: var(--ink-soft);
  margin-bottom: 16px;
}
.about-tags {
  display: flex; flex-wrap: wrap; gap: 12px;
  justify-content: center; margin-top: 28px;
}
.about-tags span {
  background: var(--cream); border: 1px solid var(--line);
  color: var(--ink); font-weight: 500; font-size: .95rem;
  padding: 8px 18px; border-radius: 999px; box-shadow: var(--shadow-sm);
}

.about-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 56px; }

.block-title {
  font-family: var(--font-display);
  font-size: 1.6rem; color: var(--ink);
  margin-bottom: 28px;
  display: flex; align-items: center; gap: 12px;
}
.block-title::before {
  content: ""; width: 12px; height: 12px; border-radius: 50%;
  background: var(--grad-amber);
}

/* وسوم المهارات (بدل الأشرطة) */
.skill-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.skill-tag {
  background: var(--green-soft); color: var(--green-dark);
  font-weight: 500; font-size: .92rem;
  padding: 8px 16px; border-radius: 10px;
  border: 1px solid transparent;
  transition: transform .2s, border-color .2s, background .2s;
}
.skill-tag:hover {
  transform: translateY(-2px);
  border-color: var(--green); background: #fff;
}

/* التكريمات */
.awards { margin-top: 64px; }
.awards__title { justify-content: center; }
.awards__grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px;
}
.award-card {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  display: flex; align-items: flex-start; gap: 14px;
  box-shadow: var(--shadow-sm);
  border-top: 3px solid var(--amber);
  transition: transform .3s, box-shadow .3s;
}
.award-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.award-card__ic {
  font-size: 1.6rem; flex-shrink: 0;
  filter: saturate(1.1);
}
.award-card strong { display: block; color: var(--ink); font-size: 1.02rem; margin-bottom: 4px; }
.award-card span { color: var(--ink-soft); font-size: .86rem; line-height: 1.6; }

@media (max-width: 880px) {
  .awards__grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .awards__grid { grid-template-columns: 1fr; }
}

/* الجدول الزمني للخبرات */
.timeline { list-style: none; position: relative; padding-right: 22px; }
.timeline::before {
  content: ""; position: absolute; top: 6px; bottom: 6px; right: 5px;
  width: 2px; background: linear-gradient(var(--green), var(--green), transparent);
}
.timeline__item { position: relative; padding-bottom: 26px; }
.timeline__dot {
  position: absolute; right: -22px; top: 6px;
  width: 13px; height: 13px; border-radius: 50%;
  background: var(--grad-amber); box-shadow: 0 0 0 4px var(--paper-alt);
}
.timeline__head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.timeline__head h4 { font-size: 1.15rem; color: var(--ink); }
.timeline__org { color: var(--green-dark); font-weight: 700; margin-top: 2px; }
.timeline__desc { color: var(--ink-soft); font-size: .95rem; margin-top: 6px; }
.chip {
  background: var(--grad-green); color: #fff;
  font-size: .72rem; font-weight: 700;
  padding: 3px 12px; border-radius: 999px;
}

/* المهارات */
.skills { display: flex; flex-direction: column; gap: 16px; }
.skill__row { display: flex; justify-content: space-between; font-size: .95rem; margin-bottom: 6px; }
.skill__pct { color: var(--green-dark); font-weight: 700; }
.skill__bar { height: 9px; background: var(--line); border-radius: 999px; overflow: hidden; }
.skill__fill {
  height: 100%; width: 0;
  background: var(--grad-green);
  border-radius: 999px;
  transition: width 1.1s cubic-bezier(.2,.8,.2,1);
}
.skill.is-visible .skill__fill { width: var(--w); }

.facts { display: flex; gap: 16px; margin-top: 32px; flex-wrap: wrap; }
.fact {
  flex: 1; min-width: 140px;
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 16px 18px;
  border-top: 3px solid transparent; border-image: var(--grad-green) 1;
}
.fact strong { display: block; color: var(--green-dark); font-size: 1.05rem; }
.fact span { font-size: .85rem; color: var(--ink-soft); }

/* ====================== بطاقات البرمجيات ====================== */
.cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 26px;
}
.card {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 28px;
  display: flex; flex-direction: column;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  position: relative; overflow: hidden;
}
.card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 4px;
  background: var(--grad-green);
  transform: scaleX(1); transform-origin: right; transition: transform .35s;
}
.card:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); border-color: var(--amber-soft); }
.card__top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.card__badge {
  background: var(--grad-green); color: #fff;
  font-size: .78rem; font-weight: 700;
  padding: 4px 13px; border-radius: 999px;
}
.card__tech { font-size: .78rem; color: var(--muted); letter-spacing: .5px; }
.card__free {
  background: var(--grad-amber); color: #fff;
  font-size: .74rem; font-weight: 700;
  padding: 3px 12px; border-radius: 999px;
}
.card__title { font-family: var(--font-display); font-size: 1.5rem; color: var(--ink); margin-bottom: 10px; }
.card__desc { color: var(--ink-soft); font-size: .96rem; flex: 1; }
.card__link {
  margin-top: 20px; color: var(--green-dark);
  font-weight: 700; text-decoration: none; font-size: .95rem;
  display: inline-flex; align-items: center; gap: 6px;
}
.card__link span { transition: transform .25s; }
.card:hover .card__link span { transform: translateX(-5px); }

/* ====================== الأدوات المجانية ====================== */
.tools { display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }
.tool {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 22px;
  display: flex; align-items: center; gap: 18px;
  transition: transform .3s, box-shadow .3s;
  text-decoration: none; color: inherit;
}
.tool:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.tool__icon {
  flex-shrink: 0;
  width: 54px; height: 54px; border-radius: 14px;
  background: var(--grad-green); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.7rem; font-weight: 700;
  box-shadow: var(--shadow-sm);
}
.tool__body { flex: 1; }
.tool__head { display: flex; align-items: baseline; gap: 10px; }
.tool__head h3 { font-size: 1.15rem; color: var(--ink); }
.tool__ver { font-size: .78rem; color: var(--muted); }
.tool__body p { font-size: .9rem; color: var(--ink-soft); margin-top: 2px; }

/* ====================== التذييل ====================== */
.footer { background: var(--green-deep); color: #fff; padding: 64px 0 0; }
.footer__inner {
  display: flex; justify-content: space-between; gap: 40px; flex-wrap: wrap;
  padding-bottom: 48px;
}
.footer__logo { font-family: var(--font-display); font-size: 1.9rem; color: var(--amber); font-weight: 800; }
.footer__brand p { max-width: 320px; margin-top: 12px; color: rgba(255,255,255,.72); font-size: .95rem; }
.footer__links { display: flex; flex-direction: column; gap: 10px; }
.footer__links h4 { color: var(--amber-soft); margin-bottom: 6px; }
.footer__links a { color: rgba(255,255,255,.85); text-decoration: none; transition: color .2s; }
.footer__links a:hover { color: var(--amber); }
.footer__bar {
  border-top: 1px solid rgba(255,255,255,.14);
  padding: 22px 24px; max-width: 1080px; margin: 0 auto;
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 10px;
  font-size: .85rem; color: rgba(255,255,255,.6);
}
.footer__sign { font-family: var(--font-display); color: var(--amber-soft); font-size: 1.05rem; }

/* ====================== صفحة تفاصيل البرنامج ====================== */
.program { padding: 110px 0 70px; min-height: 100vh; }

.crumbs { font-size: .9rem; color: var(--muted); margin-bottom: 24px; display: flex; gap: 8px; align-items: center; }
.crumbs a { color: var(--green); text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }

.program__head { margin-bottom: 32px; }
.program__badges { display: flex; gap: 10px; margin-bottom: 14px; }
.program__title {
  font-family: var(--font-display); font-weight: 800;
  font-size: clamp(1.8rem, 4vw, 2.8rem); color: var(--ink);
}
.program__tech { color: var(--green); font-weight: 700; margin-top: 4px; }

.program__grid { display: grid; grid-template-columns: 1.6fr .9fr; gap: 36px; align-items: start; }

/* معرض الصور */
.gallery { margin-bottom: 36px; }
.gallery__main {
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--cream);
  box-shadow: var(--shadow-sm);
}
.gallery__main img { width: 100%; display: block; max-height: 460px; object-fit: contain; background: #fff; }
.gallery__thumbs { display: flex; gap: 12px; margin-top: 14px; flex-wrap: wrap; }
.gallery__thumb {
  width: 90px; height: 64px; border-radius: 12px; overflow: hidden;
  border: 2px solid var(--line); background: #fff; cursor: pointer; padding: 0;
  transition: border-color .2s, transform .2s;
}
.gallery__thumb img { width: 100%; height: 100%; object-fit: cover; }
.gallery__thumb:hover { transform: translateY(-2px); }
.gallery__thumb.is-active { border-color: var(--green); }

/* الصورة الرئيسية قابلة للتكبير */
.gallery__main { position: relative; }
.gallery__zoom { cursor: zoom-in; }
.gallery__hint {
  position: absolute; bottom: 12px; left: 12px;
  background: rgba(20,73,44,0.78); color: #fff;
  font-size: .8rem; padding: 6px 12px; border-radius: 999px;
  pointer-events: none; opacity: 0; transition: opacity .25s;
}
.gallery__main:hover .gallery__hint { opacity: 1; }

/* نافذة تكبير الصور (Lightbox) */
.lightbox {
  position: fixed; inset: 0; z-index: 200;
  display: none; align-items: center; justify-content: center;
  background: rgba(15, 40, 25, 0.92);
  backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px);
  padding: 40px 20px;
}
.lightbox.is-open { display: flex; animation: lbFade .25s ease; }
@keyframes lbFade { from { opacity: 0; } to { opacity: 1; } }

.lightbox__stage {
  margin: 0; max-width: 92vw; max-height: 86vh;
  display: flex; flex-direction: column; align-items: center; gap: 14px;
}
.lightbox__img {
  max-width: 92vw; max-height: 80vh;
  border-radius: 12px; box-shadow: 0 20px 60px rgba(0,0,0,0.5);
  object-fit: contain; background: #fff;
}
.lightbox__counter {
  color: rgba(255,255,255,0.85); font-size: .95rem; font-weight: 500;
}

.lightbox__close {
  position: absolute; top: 20px; left: 20px;
  width: 46px; height: 46px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  font-size: 1.4rem; cursor: pointer; transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__close:hover { background: rgba(255,255,255,0.3); }

.lightbox__nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 54px; height: 54px; border-radius: 50%;
  background: rgba(255,255,255,0.15); color: #fff; border: none;
  font-size: 2rem; line-height: 1; cursor: pointer; transition: background .2s;
  display: flex; align-items: center; justify-content: center;
}
.lightbox__nav:hover { background: var(--amber); }
.lightbox__prev { right: 20px; }
.lightbox__next { left: 20px; }

@media (max-width: 560px) {
  .lightbox__nav { width: 44px; height: 44px; font-size: 1.6rem; }
  .lightbox__prev { right: 10px; }
  .lightbox__next { left: 10px; }
  .lightbox__close { top: 12px; left: 12px; }
}


.gallery__placeholder {
  border: 2px dashed var(--line); border-radius: var(--radius);
  background: var(--paper-alt); color: var(--muted);
  padding: 60px 20px; text-align: center; margin-bottom: 36px;
}
.gallery__placeholder span { font-size: 3rem; display: block; opacity: .5; }
.gallery__placeholder p { margin-top: 10px; }

.program__desc p { color: var(--ink-soft); margin-bottom: 14px; line-height: 2; }

/* ====================== تنسيق محتوى Markdown ====================== */
.md-content h1, .md-content h2, .md-content h3, .md-content h4 {
  font-family: var(--font-display); color: var(--ink);
  margin: 28px 0 12px; line-height: 1.5;
}
.md-content h2.block-title { margin-top: 0; }   /* عنوان «عن البرنامج» */
.md-content h3 {
  font-size: 1.3rem; color: var(--green-dark);
  padding-right: 14px; border-right: 4px solid var(--amber);
}
.md-content h4 { font-size: 1.1rem; color: var(--green-dark); }
.md-content p { color: var(--ink-soft); margin-bottom: 14px; line-height: 2; }
.md-content ul, .md-content ol { margin: 0 0 16px; padding-right: 26px; color: var(--ink-soft); }
.md-content li { margin-bottom: 8px; line-height: 1.9; }
.md-content ul li::marker { color: var(--green); }
.md-content ol li::marker { color: var(--green); font-weight: 700; }
.md-content a { color: var(--green); font-weight: 700; text-decoration: none; }
.md-content a:hover { text-decoration: underline; }
.md-content strong { color: var(--ink); font-weight: 700; }
.md-content blockquote {
  border-right: 4px solid var(--green-soft);
  background: var(--paper-alt);
  margin: 0 0 16px; padding: 12px 18px; border-radius: 0 10px 10px 0;
  color: var(--ink-soft);
}
/* أكواد سطرية */
.md-content code {
  font-family: "Courier New", monospace; direction: ltr; display: inline-block;
  background: var(--paper-alt); color: var(--amber-dark);
  padding: 2px 7px; border-radius: 6px; font-size: .9em;
  border: 1px solid var(--line);
}
/* كتل الأكواد */
.md-content pre {
  background: #1f3d2b; color: #eaf3ea;
  padding: 18px 20px; border-radius: 12px; overflow-x: auto;
  margin: 0 0 18px; direction: ltr; text-align: left;
}
.md-content pre code {
  background: none; border: none; color: inherit; padding: 0;
  display: block; line-height: 1.7;
}
.md-content img { max-width: 100%; height: auto; border-radius: 10px; margin: 8px 0; }
.md-content hr { border: none; border-top: 1px solid var(--line); margin: 24px 0; }
.md-content table {
  width: 100%; border-collapse: collapse; margin: 0 0 18px; font-size: .95rem;
}
.md-content th, .md-content td {
  border: 1px solid var(--line); padding: 10px 12px; text-align: right;
}
.md-content th { background: var(--green-soft); color: var(--green-dark); font-weight: 700; }

/* العمود الجانبي */
.program__side { display: flex; flex-direction: column; gap: 20px; position: sticky; top: 90px; }
.side-card {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow-sm);
}
.side-card h3 { font-family: var(--font-display); color: var(--ink); font-size: 1.25rem; margin-bottom: 12px; }
.side-card__note { color: var(--ink-soft); font-size: .92rem; margin-bottom: 16px; }
.side-card__btn { display: block; text-align: center; }
.dl-counter {
  margin-top: 14px; text-align: center;
  color: var(--ink-soft); font-size: .9rem;
  display: flex; align-items: center; justify-content: center; gap: 6px;
}
.dl-counter strong { color: var(--green-dark); font-size: 1.05rem; }
.dl-counter__ic {
  color: var(--green); font-weight: 700;
}
.side-card__link {
  display: block; margin-top: 14px; text-align: center;
  color: var(--green); font-weight: 700; text-decoration: none; font-size: .9rem;
}
.side-card__link:hover { text-decoration: underline; }

.side-info { list-style: none; }
.side-info li {
  display: flex; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.side-info li:last-child { border-bottom: none; }
.side-info span { color: var(--muted); }
.side-info strong { color: var(--ink); }

.program__back {
  display: inline-block; margin-top: 36px;
  color: var(--green); font-weight: 700; text-decoration: none;
}
.program__back:hover { text-decoration: underline; }

@media (max-width: 860px) {
  .program__grid { grid-template-columns: 1fr; }
  .program__side { position: static; }
}

/* ====================== نموذج المراسلة ====================== */
.contact {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 28px;
  align-items: stretch;
}

/* اللوحة الجانبية التعريفية */
.contact__aside {
  background: var(--grad-hero);
  color: #fff;
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-md);
}
.contact__aside h3 {
  font-family: var(--font-display); font-weight: 800;
  font-size: 1.5rem; margin-bottom: 12px; color: #fff;
}
.contact__aside > p { color: rgba(255,255,255,0.85); line-height: 2; margin-bottom: 26px; }
.contact__list { list-style: none; display: flex; flex-direction: column; gap: 18px; }
.contact__list li { display: flex; align-items: center; gap: 14px; }
.contact__ic {
  flex-shrink: 0;
  width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 1.2rem;
}
.contact__list strong { display: block; font-size: .95rem; }
.contact__list span, .contact__list a { color: rgba(255,255,255,0.8); font-size: .9rem; }
.contact__list a { text-decoration: none; }
.contact__list a:hover { color: var(--amber-soft); text-decoration: underline; }

/* غلاف النموذج */
.contact__form-wrap {
  background: var(--cream);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 32px;
  box-shadow: var(--shadow-sm);
}

.form { display: flex; flex-direction: column; gap: 18px; }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.field { display: flex; flex-direction: column; gap: 7px; }
.field label { font-weight: 700; color: var(--ink); font-size: .95rem; }
.field input, .field textarea {
  font-family: var(--font-body); font-size: 1rem;
  padding: 12px 14px; border: 1.5px solid var(--line);
  border-radius: 12px; background: #fff; color: var(--ink);
  transition: border-color .2s, box-shadow .2s; width: 100%;
}
.field input::placeholder, .field textarea::placeholder { color: #b9c4bc; }
.field input:focus, .field textarea:focus {
  outline: none; border-color: var(--green);
  box-shadow: 0 0 0 3px rgba(46,125,79,0.12);
}
.field textarea { resize: vertical; min-height: 130px; }

/* سؤال التحقق */
.captcha {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  background: var(--paper-alt); border: 1px dashed var(--green-soft);
  border-radius: 12px; padding: 12px 16px;
}
.captcha__q { font-weight: 700; color: var(--green-dark); white-space: nowrap; }
.captcha__q strong { color: var(--amber-dark); }
.captcha input { flex: 1; min-width: 120px; background: #fff; }

.contact__submit { width: 100%; padding: 14px; font-size: 1rem; margin-top: 4px; }

.alert { padding: 14px 16px; border-radius: 12px; margin-bottom: 22px; font-size: .95rem; }
.alert--ok  { background: var(--green-soft); color: var(--green-dark); border: 1px solid var(--green); }
.alert--err { background: #fdecea; color: #b3261e; border: 1px solid #f3b9b3; }

@media (max-width: 760px) {
  .contact { grid-template-columns: 1fr; gap: 20px; }
  .contact__aside { order: 2; }           /* النموذج أولاً على الجوال */
  .contact__form-wrap { order: 1; }
  .form__row { grid-template-columns: 1fr; }
  .contact__aside, .contact__form-wrap { padding: 24px; }
}

/* ====================== حركة الظهور ====================== */
.reveal { opacity: 0; transform: translateY(28px); transition: opacity .7s ease, transform .7s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ====================== شريط التمرير ====================== */
::-webkit-scrollbar { width: 11px; }
::-webkit-scrollbar-track { background: var(--paper-alt); }
::-webkit-scrollbar-thumb { background: var(--amber); border-radius: 6px; }
::-webkit-scrollbar-thumb:hover { background: var(--green); }

/* ====================== التجاوب (جوال) ====================== */
@media (max-width: 880px) {
  .about-grid { grid-template-columns: 1fr; gap: 48px; }
  .cards { grid-template-columns: repeat(2, 1fr); }

  /* الواجهة: الصورة فوق النص، كل شيء موسّط */
  .hero__inner { flex-direction: column-reverse; text-align: center; gap: 28px; }
  .hero__text { text-align: center; }
  .hero__cta { justify-content: center; }
  .hero__tagline { margin-right: auto; margin-left: auto; }
  .hero__blend { width: clamp(220px, 60vw, 300px); }
}

@media (max-width: 720px) {
  .nav__links {
    position: absolute; inset: 100% 0 auto 0;
    flex-direction: column; gap: 0;
    background: rgba(255,255,255,.97);
    backdrop-filter: blur(14px);
    border-bottom: 1px solid var(--line);
    max-height: 0; overflow: hidden;
    transition: max-height .35s ease;
  }
  /* ارتفاع مرن يتسع لأي عدد من الروابط، مع تمرير عند الحاجة */
  .nav__links.is-open { max-height: min(80vh, 600px); overflow-y: auto; }
  .nav__links a { padding: 15px 24px; border-bottom: 1px solid var(--line); }
  .nav__links a::after { display: none; }
  .nav__burger { display: flex; }

  .cards { grid-template-columns: 1fr; }
  .tools { grid-template-columns: 1fr; }
  .tool { flex-direction: row; }
  .footer__inner { flex-direction: column; gap: 28px; }
}

@media (max-width: 420px) {
  .tool { flex-direction: column; align-items: flex-start; }
  .tool .btn--small { align-self: stretch; text-align: center; }
}

/* ====================== كتاباتي (مقالات وقصائد) ====================== */
.posts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.post-card {
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 26px;
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform .3s, box-shadow .3s, border-color .3s;
  position: relative; overflow: hidden;
}
.post-card::before {
  content: ""; position: absolute; inset: 0 0 auto 0; height: 3px;
  background: var(--grad-green);
}
.post-card:hover { transform: translateY(-5px); box-shadow: var(--shadow-md); border-color: var(--green-soft); }
.post-card__type {
  align-self: flex-start;
  background: var(--green-soft); color: var(--green-dark);
  font-size: .75rem; font-weight: 700;
  padding: 3px 12px; border-radius: 999px; margin-bottom: 12px;
}
.post-card__type.is-poem { background: var(--amber-soft); color: #7a5310; }
.post-card__title { font-size: 1.3rem; font-weight: 800; color: var(--ink); margin-bottom: 8px; }
.post-card__excerpt { color: var(--ink-soft); font-size: .95rem; flex: 1; line-height: 1.9; }
/* مقتطف القصيدة: يحافظ على الأسطر كما كُتبت */
.post-card__excerpt.is-verse {
  white-space: pre-line;      /* يُبقي الأسطر الجديدة ويطوي المسافات الزائدة */
  text-align: center;
  line-height: 2.1;
  font-size: 1rem;
}
.post-card__foot {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line);
  font-size: .85rem; color: var(--muted);
}
.post-card__more { color: var(--green); font-weight: 700; }

/* صفحة المقال */
.post__meta { color: var(--muted); font-size: .9rem; margin-top: 6px; }
.post-body { margin-top: 10px; }
.poem-body {
  font-size: 1.25rem; line-height: 2.4; color: var(--ink);
  text-align: center; padding: 30px 20px; margin-top: 10px;
  background: var(--cream); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
}

/* ====================== معرض الصور ====================== */
.gal-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.gal-item {
  margin: 0; position: relative; cursor: zoom-in;
  border-radius: var(--radius); overflow: hidden;
  border: 1px solid var(--line); background: var(--cream);
  box-shadow: var(--shadow-sm);
  transition: transform .3s, box-shadow .3s;
}
.gal-item:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.gal-item img {
  width: 100%; height: 210px; object-fit: cover; display: block;
  transition: transform .5s;
}
.gal-item:hover img { transform: scale(1.05); }
.gal-item figcaption {
  padding: 14px 16px; background: var(--cream);
  display: flex; flex-direction: column; gap: 4px;
}
.gal-item__cat {
  align-self: flex-start;
  background: var(--green-soft); color: var(--green-dark);
  font-size: .72rem; font-weight: 700; padding: 2px 10px; border-radius: 999px;
}
.gal-item figcaption strong { color: var(--ink); font-size: 1rem; line-height: 1.5; }
.gal-item__date { color: var(--muted); font-size: .8rem; }

/* لوحة بيانات الصورة داخل النافذة */
.galbox__stage { max-width: 96vw; }
.galbox__info {
  background: rgba(255,255,255,0.96); border-radius: 12px;
  padding: 16px 20px; max-width: 640px; text-align: center;
  display: flex; flex-direction: column; gap: 6px; align-items: center;
}
.galbox__cat {
  background: var(--green-soft); color: var(--green-dark);
  font-size: .75rem; font-weight: 700; padding: 3px 12px; border-radius: 999px;
}
.galbox__info h3 { color: var(--ink); font-size: 1.15rem; font-weight: 800; }
.galbox__info p { color: var(--ink-soft); font-size: .92rem; line-height: 1.8; margin: 0; }
.galbox__date { color: var(--muted); font-size: .82rem; }
.galbox__info .lightbox__counter { color: var(--muted); font-size: .82rem; }
.galbox__stage .lightbox__img { max-height: 62vh; }

@media (max-width: 880px) {
  .posts { grid-template-columns: repeat(2, 1fr); }
  .gal-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 560px) {
  .posts { grid-template-columns: 1fr; }
  .gal-grid { grid-template-columns: 1fr; }
  .gal-item img { height: 190px; }
  .galbox__stage .lightbox__img { max-height: 48vh; }
  .poem-body { font-size: 1.1rem; padding: 22px 14px; }
}

/* ====================== الهاشتاقات (الوسوم) ====================== */
.tag-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }
.tag-row--page { margin: 26px 0 10px; gap: 8px; }

.tag-chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: var(--paper-alt); color: var(--green-dark);
  border: 1px solid var(--line);
  font-size: .82rem; font-weight: 600;
  padding: 5px 12px; border-radius: 999px;
  text-decoration: none;
  transition: background .2s, color .2s, border-color .2s, transform .2s;
}
a.tag-chip:hover {
  background: var(--green); color: #fff; border-color: var(--green);
  transform: translateY(-2px);
}
.tag-chip--sm { font-size: .74rem; padding: 3px 9px; }
.tag-chip.is-active { background: var(--grad-amber); color: #fff; border-color: transparent; }
.tag-chip__n {
  background: rgba(0,0,0,.08); color: inherit;
  font-size: .72em; padding: 1px 6px; border-radius: 999px; font-weight: 700;
}

/* سحابة الوسوم */
.tag-cloud { display: flex; flex-wrap: wrap; gap: 9px; margin-bottom: 40px; }

/* وسوم داخل نافذة المعرض */
.galbox__tags { display: flex; flex-wrap: wrap; gap: 6px; justify-content: center; margin-top: 2px; }
