/* ===== Content Writing Template Styles ===== */
:root {
  --bg: #121212;
  --bg-soft: #1a1a1a;
  --text: #eaeaea;
  --text-dim: #bdbdbd;
  --gold: #fdd835;
  --card: #191919;
  --muted: #2a2a2a;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(0,0,0,.35);
}

.cw-page {
  background: var(--bg);
  color: var(--text);
  font-family: "Poppins", system-ui, -apple-system, Segoe UI, Roboto, Arial, sans-serif;
}

/* Layout */
.section-pad { padding: 72px 0; }
.cw-container { width: min(1120px, 92%); margin-inline: auto; }

/* Hero */
.cw-hero { 
  position: relative; 
  background: radial-gradient(1200px 600px at 20% -10%, rgba(253,216,53,.07), transparent 60%),
              radial-gradient(900px 500px at 120% 10%, rgba(253,216,53,.06), transparent 60%),
              var(--bg);
  text-align: center;
}
.cw-hero__title {
  font-size: clamp(32px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: .2px;
}
.cw-hero__subtitle {
  color: var(--text-dim);
  margin: 14px auto 28px;
  max-width: 720px;
  font-size: clamp(15px, 2vw, 18px);
}
.cw-btn {
  display: inline-block;
  padding: 14px 22px;
  border-radius: 12px;
  font-weight: 600;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease;
}
.cw-btn--primary {
  background: var(--gold);
  color: #111;
  box-shadow: 0 6px 18px rgba(253,216,53,.22);
}
.cw-btn--primary:hover { transform: translateY(-2px); }

/* Section titles */
.cw-section-title {
  font-size: clamp(22px, 3.2vw, 32px);
  margin-bottom: 28px;
  text-align: center;
}

/* Cards & grids */
.cw-grid {
  display: grid;
  gap: 18px;
}
.cw-grid--services {
  grid-template-columns: repeat(2, minmax(0,1fr));
}
@media (min-width: 900px) {
  .cw-grid--services { grid-template-columns: repeat(4, minmax(0,1fr)); }
}
.cw-card {
  background: linear-gradient(180deg, var(--card), #151515);
  border: 1px solid #232323;
  border-radius: var(--radius);
  padding: 22px;
  display: flex; align-items: center; gap: 14px;
  box-shadow: var(--shadow);
  text-decoration: none; color: var(--text);
}
.cw-card:hover { border-color: var(--gold); }
.cw-card .cw-ico { font-size: 28px; filter: drop-shadow(0 0 0 rgba(0,0,0,0)); }
.cw-card__title { font-weight: 600; }

/* Portfolio */
.cw-grid--portfolio {
  grid-template-columns: 1fr;
}
@media (min-width: 800px) {
  .cw-grid--portfolio { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
.cw-card--thumb { padding: 0; overflow: hidden; }
.cw-card--thumb a { display: block; color: inherit; text-decoration: none; }
.cw-thumb {
  aspect-ratio: 16/10; 
  background-size: cover; background-position: center;
  filter: saturate(.95) contrast(1.05);
}
.cw-card__heading { font-size: 18px; padding: 16px 16px 6px; }
.cw-link { color: var(--text-dim); padding: 0 16px 18px; display: inline-block; }

/* Process */
.cw-steps {
  display: grid; gap: 22px;
  grid-template-columns: 1fr;
  counter-reset: steps;
}
@media (min-width: 900px) {
  .cw-steps { grid-template-columns: repeat(3, minmax(0,1fr)); }
}
.cw-step {
  background: var(--bg-soft);
  border: 1px solid #232323;
  border-radius: var(--radius);
  padding: 28px;
  text-align: center;
  box-shadow: var(--shadow);
}
.cw-step__num {
  display: inline-grid; place-items: center;
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--gold); color: #111; font-weight: 700;
  margin-bottom: 12px;
}

/* Final CTA */
.cw-final-cta__wrap {
  display: grid; gap: 22px;
  grid-template-columns: 1fr; 
  background: linear-gradient(180deg, var(--bg-soft), #101010);
  border: 1px solid #232323;
  border-radius: 20px; padding: 28px;
}
@media (min-width: 900px) {
  .cw-final-cta__wrap { grid-template-columns: 1.2fr .8fr; }
}
.cw-form h3 { font-size: 24px; margin-bottom: 14px; }
.cw-details ul { list-style: none; margin: 0; padding: 0; }
.cw-details li { padding: 8px 0; color: var(--text-dim); }

/* Helpers */
.cw-portfolio, .cw-services, .cw-process { position: relative; }
.cw-portfolio::before, .cw-services::before, .cw-process::before {
  content:""; position:absolute; inset:0; pointer-events:none;
  background:
    radial-gradient(600px 300px at 90% -10%, rgba(253,216,53,.06), transparent 60%),
    radial-gradient(600px 300px at -10% 110%, rgba(253,216,53,.05), transparent 60%);
  opacity:.7;
}

/* ===== RTL tweaks ===== */
[dir="rtl"] .cw-card,
[dir="rtl"] .cw-final-cta__wrap { direction: rtl; }
[dir="rtl"] .cw-hero__subtitle,
[dir="rtl"] .cw-section-title,
[dir="rtl"] .cw-step { text-align: center; }

/* ==== Fix: remove top gap on Astra for this template ==== */
.page-template-template-content-writing-en .site-content,
.page-template-template-content-writing-ar .site-content,
.page-template-template-content-writing-en .site-main,
.page-template-template-content-writing-ar .site-main {
  padding-top: 0 !important;
  margin-top: 0 !important;
  background: transparent !important;
}

.page-template-template-content-writing-en .entry-content,
.page-template-template-content-writing-ar .entry-content,
.page-template-template-content-writing-en .ast-container,
.page-template-template-content-writing-ar .ast-container {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* ==== Fix: hide default ordered list numbers ==== */
.cw-steps {
  list-style: none;
  counter-reset: none;
  padding-left: 0;
  margin-left: 0;
}
[dir="rtl"] .cw-steps { padding-right: 0; margin-right: 0; }
/* Hide Final CTA section on this template */
.page-template-template-content-writing-en .cw-final-cta,
.page-template-template-content-writing-ar .cw-final-cta { display: none !important; }

/* ===== Kill top white gap on Content Writing templates ===== */
.page-template-template-content-writing-en .site-header,
.page-template-template-content-writing-ar .site-header{
  margin-bottom: 0 !important;
}

.page-template-template-content-writing-en .site-content,
.page-template-template-content-writing-ar .site-content,
.page-template-template-content-writing-en .content-area,
.page-template-template-content-writing-ar .content-area,
.page-template-template-content-writing-en .ast-container,
.page-template-template-content-writing-ar .ast-container,
.page-template-template-content-writing-en .ast-article-single,
.page-template-template-content-writing-ar .ast-article-single,
.page-template-template-content-writing-en .entry-content,
.page-template-template-content-writing-ar .entry-content{
  background: transparent !important;
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* لو فيه مارجن من أول عنصر جوه المحتوى */
.page-template-template-content-writing-en .entry-content > *:first-child,
.page-template-template-content-writing-ar .entry-content > *:first-child{
  margin-top: 0 !important;
}

/* تأكد إن الهيرو نفسه مش مدي margin-top */
.page-template-template-content-writing-en .cw-hero,
.page-template-template-content-writing-ar .cw-hero{
  margin-top: 0 !important;
}

/* لو الصفحة متضبوطة كـ Separate container في أسترا – امسح padding المقال */
.page-template-template-content-writing-en.ast-separate-container .ast-article-single,
.page-template-template-content-writing-ar.ast-separate-container .ast-article-single{
  padding-top: 0 !important;
}

/* ==== Remove top white gap on Content Writing templates (theme-agnostic) ==== */
.page-template-template-content-writing-en,
.page-template-template-content-writing-ar {
  /* بعض الثيمات بتدي margin للـ body/containers */
  background: #121212 !important; /* تأكيد الخلفية الداكنة */
}

.page-template-template-content-writing-en main#primary,
.page-template-template-content-writing-ar main#primary,
.page-template-template-content-writing-en .site-main,
.page-template-template-content-writing-ar .site-main,
.page-template-template-content-writing-en .content-area,
.page-template-template-content-writing-ar .content-area,
.page-template-template-content-writing-en .site-content,
.page-template-template-content-writing-ar .site-content,
.page-template-template-content-writing-en .wrap,
.page-template-template-content-writing-ar .wrap,
.page-template-template-content-writing-en .container,
.page-template-template-content-writing-ar .container,
.page-template-template-content-writing-en .page-content,
.page-template-template-content-writing-ar .page-content,
.page-template-template-content-writing-en .hentry,
.page-template-template-content-writing-ar .hentry {
  margin-top: 0 !important;
  padding-top: 0 !important;
  background: transparent !important;
  border-top: 0 !important;
}

/* بعض الثيمات بتطلّع Header/title بلوك فوق المحتوى */
.page-template-template-content-writing-en .entry-header,
.page-template-template-content-writing-ar .entry-header,
.page-template-template-content-writing-en .page-header,
.page-template-template-content-writing-ar .page-header {
  margin: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  /* لو البلوك دا فاضي بس بيعمل مسافة: */
  display: none !important;
}

/* أول عنصر داخل المحتوى */
.page-template-template-content-writing-en .entry-content > *:first-child,
.page-template-template-content-writing-ar .entry-content > *:first-child,
.page-template-template-content-writing-en main#primary > *:first-child,
.page-template-template-content-writing-ar main#primary > *:first-child,
.page-template-template-content-writing-en .cw-hero,
.page-template-template-content-writing-ar .cw-hero {
  margin-top: 0 !important;
  padding-top: 0 !important;
}

/* في حالة نادرة: شريط أعلى المحتوى يسيب خط أبيض رفيع */
.page-template-template-content-writing-en #content,
.page-template-template-content-writing-ar #content {
  background: transparent !important;
}


/* 1) تأكيد ظهور الفوتر وعدم إخفائه */
footer, .site-footer, #colophon {
  display: block !important;
  visibility: visible !important;
  opacity: 1 !important;
  height: auto !important;
  background: #0b0b0b;               /* لون متقارب مع الصفحة */
  border-top: 1px solid rgba(255,255,255,.08);
}

/* 2) امنع أي عنصر يغطي الفوتر */
.cw-page { position: relative; z-index: 0; }
footer, .site-footer, #colophon { position: relative; z-index: 5; }

/* 3) لو في كونتينر عام مدي overflow أو مسافات تمنع ظهور الفوتر */
.page-template-template-content-writing-en .site-content,
.page-template-template-content-writing-ar .site-content,
.page-template-template-content-writing-en .content-area,
.page-template-template-content-writing-ar .content-area {
  overflow: visible !important;
  padding-bottom: 0 !important;
  margin-bottom: 0 !important;
}

/* 4) مسافة بسيطة بعد آخر سيكشن */
.cw-process { margin-bottom: 48px; }

/* 5) لو فيه بلوك عنوان صفحة/هيدر سفلي فاضي قبل الفوتر (نلغيه) */
.page-template-template-content-writing-en .entry-footer,
.page-template-template-content-writing-ar .entry-footer {
  display: none !important;
}
